Skip to content

Commit ef8a034

Browse files
committed
Add testapp as a theos subproject
1 parent 8c8340f commit ef8a034

13 files changed

+243
-1
lines changed

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ SSLKillSwitch_FILES = Tweak.xm HookedNSURLConnectionDelegate.m
66

77
SSLKillSwitch_FRAMEWORKS = UIKit
88
include $(THEOS_MAKE_PATH)/tweak.mk
9+
SUBPROJECTS += testapp
10+
include $(THEOS_MAKE_PATH)/aggregate.mk

Tweak.xm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
%ctor {
4343
// Should we hook NSURLConnection ?
44-
NSString* preferenceFilePath = @PREFERENCEFILE; // Dirty ?
44+
NSString* preferenceFilePath = @PREFERENCEFILE;
4545
BOOL shouldHook = [HookedNSURLConnectionDelegate shouldHookNSURLConnectionFromPreference:preferenceFilePath];
4646
[preferenceFilePath release];
4747

testapp/Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
include theos/makefiles/common.mk
2+
3+
APPLICATION_NAME = SSLKillSwitchTestApplication
4+
SSLKillSwitchTestApplication_FILES = main.m SSLKillSwitchTestApplication.mm RootViewController.mm TestSSLKillSwitch.m
5+
SSLKillSwitchTestApplication_FRAMEWORKS = UIKit CoreGraphics Security
6+
7+
include $(THEOS_MAKE_PATH)/application.mk

testapp/Resources/Info.plist

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
CFBundleExecutable = "SSLKillSwitchTestApplication";
3+
CFBundleIconFile = icon.png;
4+
CFBundleIdentifier = "com.isecpartners.nabla.sslkillswitchtestapp";
5+
CFBundleInfoDictionaryVersion = 6.0;
6+
CFBundlePackageType = APPL;
7+
CFBundleSignature = "????";
8+
CFBundleSupportedPlatforms = (
9+
iPhoneOS
10+
);
11+
CFBundleVersion = 1.0;
12+
DTPlatformName = iphoneos;
13+
DTSDKName = iphoneos3.0;
14+
LSRequiresIPhoneOS = 1;
15+
MinimumOSVersion = 3.0;
16+
}
Binary file not shown.

testapp/RootViewController.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@interface RootViewController: UIViewController {
2+
}
3+
@end

testapp/RootViewController.mm

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#import "RootViewController.h"
2+
#import "TestSSLKillSwitch.h"
3+
4+
5+
6+
@implementation RootViewController
7+
- (void)loadView {
8+
self.view = [[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease];
9+
self.view.backgroundColor = [UIColor redColor];
10+
11+
UIAlertView *alert =
12+
[[UIAlertView alloc] initWithTitle: @"iOS SSL Kill Switch"
13+
message: @"iOS SSL Kill Switch Test App Started"
14+
delegate: self
15+
cancelButtonTitle: @"OK"
16+
otherButtonTitles: nil];
17+
[alert show];
18+
[alert release];
19+
20+
[TestSSLKillSwitch runAllTests];
21+
22+
}
23+
@end
24+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#import "RootViewController.h"
2+
3+
@interface SSLKillSwitchTestApplication: UIApplication <UIApplicationDelegate> {
4+
UIWindow *_window;
5+
RootViewController *_viewController;
6+
}
7+
@property (nonatomic, retain) UIWindow *window;
8+
@end
9+
10+
@implementation SSLKillSwitchTestApplication
11+
@synthesize window = _window;
12+
- (void)applicationDidFinishLaunching:(UIApplication *)application {
13+
_window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
14+
_viewController = [[RootViewController alloc] init];
15+
[_window addSubview:_viewController.view];
16+
[_window makeKeyAndVisible];
17+
}
18+
19+
- (void)dealloc {
20+
[_viewController release];
21+
[_window release];
22+
[super dealloc];
23+
}
24+
@end
25+
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#import "RootViewController.h"
2+
3+
@interface SSLKillSwitchTestApplicationApplication: UIApplication <UIApplicationDelegate> {
4+
UIWindow *_window;
5+
RootViewController *_viewController;
6+
}
7+
@property (nonatomic, retain) UIWindow *window;
8+
@end
9+
10+
@implementation SSLKillSwitchTestApplicationApplication
11+
@synthesize window = _window;
12+
- (void)applicationDidFinishLaunching:(UIApplication *)application {
13+
_window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
14+
_viewController = [[RootViewController alloc] init];
15+
[_window addSubview:_viewController.view];
16+
[_window makeKeyAndVisible];
17+
}
18+
19+
- (void)dealloc {
20+
[_viewController release];
21+
[_window release];
22+
[super dealloc];
23+
}
24+
@end
25+
26+
// vim:ft=objc

testapp/TestSSLKillSwitch.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
@interface TestSSLKillSwitch: NSObject {
2+
}
3+
4+
+ (void)runAllTests;
5+
+ (void)testNSURLConnectionClassMethods;
6+
+ (void)testNSURLConnectionInstanceMethods;
7+
8+
@end
9+
10+
11+
@interface SSLPinnedNSURLConnectionDelegate: NSObject {
12+
}
13+
14+
- (void)connectionDidFinishLoading:(NSURLConnection *)connection;
15+
- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error;
16+
- (NSCachedURLResponse *)connection:(NSURLConnection *)connection willCacheResponse:(NSCachedURLResponse *)cachedResponse;
17+
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response;
18+
- (NSURLRequest *)connection:(NSURLConnection *)connection willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)redirectResponse;
19+
- (void)connection:(NSURLConnection *)connection willSendRequestForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge;
20+
@end

0 commit comments

Comments
 (0)