Skip to content

Commit

Permalink
Refactored into framework
Browse files Browse the repository at this point in the history
  • Loading branch information
Legoless committed Nov 29, 2016
1 parent 6f938a3 commit c915ddb
Show file tree
Hide file tree
Showing 254 changed files with 2,199 additions and 7,890 deletions.
5 changes: 1 addition & 4 deletions Alpha.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = "Alpha"
spec.version = "0.2.8"
spec.version = "0.3.0"
spec.summary = "Next generation debugging framework for iOS"
spec.description = <<-DESC
- A simple unified debugging plugin API.
Expand All @@ -21,7 +21,6 @@ Pod::Spec.new do |spec|
spec.documentation_url = "https://github.com/Legoless/Alpha/wiki"
spec.author = { "Dal Rupnik" => "legoless@gmail.com" }
spec.social_media_url = "https://twitter.com/thelegoless"
spec.platform = :ios, "9.0"
spec.source = { :git => "https://github.com/legoless/Alpha.git", :tag => "#{spec.version}" }
spec.ios.deployment_target = '8.0'
spec.source_files = "Alpha/Alpha.h"
Expand All @@ -32,7 +31,6 @@ Pod::Spec.new do |spec|
#
spec.subspec 'Asset' do |subspec|
subspec.source_files = 'Alpha/Asset/**/*.{h,m}'
subspec.dependency 'Haystack'
end

#
Expand All @@ -49,7 +47,6 @@ Pod::Spec.new do |spec|

spec.subspec 'Utility' do |subspec|
subspec.source_files = 'Alpha/Utility/**/*.{h,m}'
subspec.dependency 'Haystack'
end

#
Expand Down
6 changes: 6 additions & 0 deletions Alpha/Alpha.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
// Copyright © 2015 Unified Sense. All rights reserved.
//

//! Project version number for Alpha.
FOUNDATION_EXPORT double AlphaVersionNumber;

//! Project version string for Alpha.
FOUNDATION_EXPORT const unsigned char AlphaVersionString[];

#import "ALPHACore.h"
#import "ALPHACoreAssets.h"
#import "ALPHAManager.h"
24 changes: 24 additions & 0 deletions Alpha/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
4 changes: 2 additions & 2 deletions Alpha/Integration/UIApplication+Delegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

@import ObjectiveC.runtime;

#import <Haystack/Haystack.h>
#import "NSObject+Swizzle.h"

#import "UIApplication+Delegate.h"
#import "ALPHAApplicationDelegate.h"
Expand All @@ -22,7 +22,7 @@ + (void)load
// Swizzle delegate methods, to hide Alpha's delegation injection
//

[UIApplication hay_swizzleInstanceMethod:@selector(setDelegate:) withMethod:@selector(alpha_setDelegate:)];
[UIApplication alpha_swizzleInstanceMethod:@selector(setDelegate:) withMethod:@selector(alpha_setDelegate:)];
}

- (id)alpha_injectedDelegate
Expand Down
14 changes: 9 additions & 5 deletions Alpha/Manager/ALPHAManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@
// Copyright © 2015 Unified Sense. All rights reserved.
//

#import <Haystack/Haystack.h>

#import "UIApplication+Private.h"

#import "UIApplication+Information.h"

#import "NSObject+Runtime.h"

#import "NSArray+Class.h"

#import "ALPHAManager.h"

// Defaults
Expand Down Expand Up @@ -67,7 +71,7 @@ - (ALPHAPlugin *)interfacePlugin
{
if (!_interfacePlugin)
{
_interfacePlugin = [self.plugins hay_firstObjectOfClass:NSClassFromString(@"ALPHAInterfacePlugin")];
_interfacePlugin = [self.plugins alpha_firstObjectOfClass:NSClassFromString(@"ALPHAInterfacePlugin")];
[self addOverlayViewController:_interfacePlugin.mainInterface animated:NO completion:nil];
}

Expand Down Expand Up @@ -199,7 +203,7 @@ - (instancetype)init
// If we are running tests, we'll just return nil here, to disable all Alpha functionality
// and speed up loading time.
//
if ([[UIApplication sharedApplication] hay_isRunningTests])
if ([[UIApplication sharedApplication] alpha_isRunningTests])
{
return nil;
}
Expand Down Expand Up @@ -232,7 +236,7 @@ - (void)integrate

- (NSArray *)createInstancesOfClass:(Class)class
{
NSArray *subclasses = [class hay_subclasses];
NSArray *subclasses = [class alpha_subclasses];
NSMutableArray* instances = [NSMutableArray array];

for (Class class in subclasses)
Expand Down
14 changes: 7 additions & 7 deletions Alpha/Palettes/ALPHAAlizarinColorPalette.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2015 Unified Sense. All rights reserved.
//

#import <Haystack/Haystack.h>
#import "UIColor+Utility.h"
#import "ALPHAAlizarinColorPalette.h"

@implementation ALPHAAlizarinColorPalette
Expand All @@ -19,12 +19,12 @@ + (instancetype)defaultPalette
palette.contentFontFamily = @"Menlo";
palette.contentFontSize = 12.0;

palette.mainColor = UIColorFromKey(@"#1B1F28");
palette.accentColor = UIColorFromKey(@"#EA6573");
palette.backgroundColor = UIColorFromKey(@"#1B1F28");
palette.contentColor = UIColorFromKey(@"#30353A");
palette.contentTintColor = UIColorFromKey(@"#EA6B76");
palette.textColor = UIColorFromKey(@"#B3B6BD");
palette.mainColor = ALPHAColorFromKey(@"#1B1F28");
palette.accentColor = ALPHAColorFromKey(@"#EA6573");
palette.backgroundColor = ALPHAColorFromKey(@"#1B1F28");
palette.contentColor = ALPHAColorFromKey(@"#30353A");
palette.contentTintColor = ALPHAColorFromKey(@"#EA6B76");
palette.textColor = ALPHAColorFromKey(@"#B3B6BD");

return palette;
}
Expand Down
14 changes: 7 additions & 7 deletions Alpha/Palettes/ALPHAAmethystColorPalette.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2015 Unified Sense. All rights reserved.
//

#import <Haystack/Haystack.h>
#import "UIColor+Utility.h"

#import "ALPHAAmethystColorPalette.h"

Expand All @@ -21,12 +21,12 @@ + (instancetype)defaultPalette
palette.contentFontFamily = @"Menlo";
palette.contentFontSize = 12.0;

palette.mainColor = UIColorFromKey(@"#968187");
palette.accentColor = UIColorFromKey(@"#FFF6F4");
palette.backgroundColor = UIColorFromKey(@"#BFB5BE");
palette.contentColor = UIColorFromKey(@"#A69BA9");
palette.contentTintColor = UIColorFromKey(@"#34373F");
palette.textColor = UIColorFromKey(@"#5A5C68");
palette.mainColor = ALPHAColorFromKey(@"#968187");
palette.accentColor = ALPHAColorFromKey(@"#FFF6F4");
palette.backgroundColor = ALPHAColorFromKey(@"#BFB5BE");
palette.contentColor = ALPHAColorFromKey(@"#A69BA9");
palette.contentTintColor = ALPHAColorFromKey(@"#34373F");
palette.textColor = ALPHAColorFromKey(@"#5A5C68");

return palette;
}
Expand Down
14 changes: 7 additions & 7 deletions Alpha/Palettes/ALPHAFormenteraColorPalette.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2015 Unified Sense. All rights reserved.
//

#import <Haystack/Haystack.h>
#import "UIColor+Utility.h"

#import "ALPHAFormenteraColorPalette.h"

Expand All @@ -20,12 +20,12 @@ + (instancetype)defaultPalette
palette.contentFontFamily = @"Menlo";
palette.contentFontSize = 12.0;

palette.mainColor = UIColorFromKey(@"#07263B");
palette.accentColor = UIColorFromKey(@"#85E3EB");
palette.backgroundColor = UIColorFromKey(@"#07263B");
palette.contentColor = UIColorFromKey(@"#0B304A");
palette.contentTintColor = UIColorFromKey(@"#E5D947");
palette.textColor = UIColorFromKey(@"#95B3CB");
palette.mainColor = ALPHAColorFromKey(@"#07263B");
palette.accentColor = ALPHAColorFromKey(@"#85E3EB");
palette.backgroundColor = ALPHAColorFromKey(@"#07263B");
palette.contentColor = ALPHAColorFromKey(@"#0B304A");
palette.contentTintColor = ALPHAColorFromKey(@"#E5D947");
palette.textColor = ALPHAColorFromKey(@"#95B3CB");

return palette;
}
Expand Down
14 changes: 7 additions & 7 deletions Alpha/Palettes/ALPHAGreenSeaColorPalette.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2015 Unified Sense. All rights reserved.
//

#import <Haystack/Haystack.h>
#import "UIColor+Utility.h"

#import "ALPHAGreenSeaColorPalette.h"

Expand All @@ -20,12 +20,12 @@ + (instancetype)defaultPalette
palette.contentFontFamily = @"Menlo";
palette.contentFontSize = 12.0;

palette.mainColor = UIColorFromKey(@"#343842");
palette.accentColor = UIColorFromKey(@"#4CBA9C");
palette.backgroundColor = UIColorFromKey(@"#46535B");
palette.contentColor = UIColorFromKey(@"#464A55");
palette.contentTintColor = UIColorFromKey(@"#6BB9A6");
palette.textColor = UIColorFromKey(@"#FFFFFF");
palette.mainColor = ALPHAColorFromKey(@"#343842");
palette.accentColor = ALPHAColorFromKey(@"#4CBA9C");
palette.backgroundColor = ALPHAColorFromKey(@"#46535B");
palette.contentColor = ALPHAColorFromKey(@"#464A55");
palette.contentTintColor = ALPHAColorFromKey(@"#6BB9A6");
palette.textColor = ALPHAColorFromKey(@"#FFFFFF");

return palette;
}
Expand Down
11 changes: 5 additions & 6 deletions Alpha/Palettes/ALPHANotioColorPalette.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
// Copyright © 2015 Unified Sense. All rights reserved.
//

#import <Haystack/Haystack.h>

#import "UIColor+Utility.h"
#import "ALPHANotioColorPalette.h"

@implementation ALPHANotioColorPalette
Expand All @@ -20,12 +19,12 @@ + (instancetype)defaultPalette
palette.contentFontFamily = @"Menlo";
palette.contentFontSize = 12.0;

palette.mainColor = UIColorFromKey(@"#E46A6B");
palette.mainColor = ALPHAColorFromKey(@"#E46A6B");
palette.accentColor = [UIColor whiteColor];
palette.backgroundColor = UIColorFromKey(@"#EEEEEE");
palette.backgroundColor = ALPHAColorFromKey(@"#EEEEEE");
palette.contentColor = [UIColor whiteColor];
palette.contentTintColor = UIColorFromKey(@"#6E6E6E");
palette.textColor = UIColorFromKey(@"#3F3F3F");
palette.contentTintColor = ALPHAColorFromKey(@"#6E6E6E");
palette.textColor = ALPHAColorFromKey(@"#3F3F3F");

return palette;
}
Expand Down
6 changes: 3 additions & 3 deletions Alpha/Plugins/Bonjour/Model/ALPHABonjourServer.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
// Copyright © 2015 Unified Sense. All rights reserved.
//

#import <Haystack/Haystack.h>

#import <DTBonjour/DTBonjourServer.h>

#import "NSString+Random.h"

#import "ALPHABonjourConfig.h"
#import "ALPHANetworkObject.h"

Expand All @@ -35,7 +35,7 @@ - (BOOL)isActive
- (void)start
{
self.server = [[DTBonjourServer alloc] initWithBonjourType:ALPHABonjourType];
self.server.TXTRecord = @{ @"id" : [NSString hay_UUID], @"name" : [[UIDevice currentDevice] name], @"type" : [[UIDevice currentDevice] model], @"system" : [[UIDevice currentDevice] systemName], @"version" : [[UIDevice currentDevice] systemVersion] };
self.server.TXTRecord = @{ @"id" : [NSString alpha_UUID], @"name" : [[UIDevice currentDevice] name], @"type" : [[UIDevice currentDevice] model], @"system" : [[UIDevice currentDevice] systemName], @"version" : [[UIDevice currentDevice] systemVersion] };

self.server.delegate = self;
[self.server start];
Expand Down
6 changes: 3 additions & 3 deletions Alpha/Plugins/Event/Library/UIViewController+ALPHAEventLog.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2015 Unified Sense. All rights reserved.
//

#import <Haystack/Haystack.h>
#import "NSObject+Swizzle.h"

#import "NSString+Identifier.h"

Expand All @@ -17,8 +17,8 @@ @implementation UIViewController (ALPHAEventLog)

+ (void)load
{
[UIViewController hay_swizzleInstanceMethod:@selector(viewDidAppear:) withMethod:@selector(alpha_viewDidAppear:)];
[UIViewController hay_swizzleInstanceMethod:@selector(viewDidDisappear:) withMethod:@selector(alpha_viewDidDisappear:)];
[UIViewController alpha_swizzleInstanceMethod:@selector(viewDidAppear:) withMethod:@selector(alpha_viewDidAppear:)];
[UIViewController alpha_swizzleInstanceMethod:@selector(viewDidDisappear:) withMethod:@selector(alpha_viewDidDisappear:)];
}

- (void)alpha_viewDidAppear:(BOOL)animated
Expand Down
4 changes: 2 additions & 2 deletions Alpha/Plugins/Event/Sources/ALPHAEventSource.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2015 Unified Sense. All rights reserved.
//

#import <Haystack/Haystack.h>
#import "NSInvocation+Argument.h"

#import "ALPHAEventSource.h"
#import "ALPHAEventModel.h"
Expand Down Expand Up @@ -105,7 +105,7 @@ - (void)delegateEvent:(NSNotification *)notification
if (anInvocation.selector == @selector(application:didFinishLaunchingWithOptions:))
{
// Launched with options, 0 - self, 1 - _cmd, 2 - UIApplication, 3 - options
event.info = [anInvocation hay_objectAtIndex:3];
event.info = [anInvocation alpha_objectAtIndex:3];
}

[self addEvent:event];
Expand Down
13 changes: 7 additions & 6 deletions Alpha/Plugins/Notification/Sources/ALPHANotificationSource.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
// Copyright © 2014 Unifed Sense. All rights reserved.
//

#import <Haystack/Haystack.h>
#import "NSInvocation+Argument.h"

#import "ALPHAApplicationDelegate.h"

#import "NSString+Data.h"
Expand Down Expand Up @@ -165,7 +166,7 @@ - (void)delegateEvent:(NSNotification *)notification
//
// Get a dictionary
//
NSDictionary* userInfo = [anInvocation hay_objectAtIndex:3];
NSDictionary* userInfo = [anInvocation alpha_objectAtIndex:3];

ALPHANotification* notification = [ALPHANotification notificationWithRemoteNotification:[userInfo copy]];

Expand All @@ -183,7 +184,7 @@ - (void)delegateEvent:(NSNotification *)notification

else if (anInvocation.selector == @selector(application:didFinishLaunchingWithOptions:))
{
NSDictionary *launchOptions = [anInvocation hay_objectAtIndex:3];
NSDictionary *launchOptions = [anInvocation alpha_objectAtIndex:3];

//
// Remote Notifications
Expand All @@ -208,7 +209,7 @@ - (void)delegateEvent:(NSNotification *)notification

else if (anInvocation.selector == @selector(application:didRegisterForRemoteNotificationsWithDeviceToken:))
{
NSData* deviceToken = [anInvocation hay_objectAtIndex:3];
NSData* deviceToken = [anInvocation alpha_objectAtIndex:3];

NSString* tokenString = [NSString alpha_hexStringFromData:deviceToken];

Expand All @@ -217,12 +218,12 @@ - (void)delegateEvent:(NSNotification *)notification
}
else if (anInvocation.selector == @selector(application:didFailToRegisterForRemoteNotificationsWithError:))
{
NSError *error = [anInvocation hay_objectAtIndex:3];
NSError *error = [anInvocation alpha_objectAtIndex:3];
self.remoteRegistrationDescription = error.localizedDescription;
}
else if (anInvocation.selector == @selector(application:didReceiveLocalNotification:))
{
UILocalNotification *localNotifiation = [anInvocation hay_objectAtIndex:3];
UILocalNotification *localNotifiation = [anInvocation alpha_objectAtIndex:3];

ALPHANotification *notification = [ALPHANotification notificationWithLocalNotification:localNotifiation];

Expand Down
4 changes: 2 additions & 2 deletions Alpha/Plugins/Permission/Model/ALPHATCCPermission.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ - (NSString *)name {
}

- (void)requestPermission:(ALPHAPermissionRequestCompletion)completion {

/*
void *block = (__bridge void *)(^{
completion(self, self.status, nil);
});
});*/

int access = TCCAccessRequest(self.identifier, @"Alpha is requesting permission", 0);

Expand Down
Loading

0 comments on commit c915ddb

Please sign in to comment.