File tree Expand file tree Collapse file tree 13 files changed +243
-1
lines changed Expand file tree Collapse file tree 13 files changed +243
-1
lines changed Original file line number Diff line number Diff line change @@ -6,3 +6,5 @@ SSLKillSwitch_FILES = Tweak.xm HookedNSURLConnectionDelegate.m
66
77SSLKillSwitch_FRAMEWORKS = UIKit
88include $(THEOS_MAKE_PATH ) /tweak.mk
9+ SUBPROJECTS += testapp
10+ include $(THEOS_MAKE_PATH ) /aggregate.mk
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 1+ @interface RootViewController : UIViewController {
2+ }
3+ @end
Original file line number Diff line number Diff line change 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+
Original file line number Diff line number Diff line change 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+
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments