objc-obfuscator 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (29) hide show
  1. checksums.yaml +6 -14
  2. data/bin/objc-obfuscator +5 -0
  3. data/lib/objc-obfuscator.rb +6 -0
  4. data/lib/objc-obfuscator/cli.rb +64 -0
  5. data/lib/objc-obfuscator/integrator.rb +59 -0
  6. data/lib/objc-obfuscator/obfuscator.rb +52 -0
  7. data/lib/objc-obfuscator/stringencryptor.rb +33 -0
  8. data/spec/encryptor_spec.rb +0 -0
  9. data/spec/integrator_spec.rb +17 -0
  10. data/spec/string_encryptor_spec.rb +36 -0
  11. data/spec/support/sample_project/Podfile +1 -0
  12. data/spec/support/sample_project/TestProject/TestProject.xcodeproj/project.pbxproj +459 -0
  13. data/spec/support/sample_project/TestProject/TestProject.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  14. data/spec/support/sample_project/TestProject/TestProject.xcodeproj/project.xcworkspace/xcuserdata/dune.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  15. data/spec/support/sample_project/TestProject/TestProject.xcodeproj/xcuserdata/dune.xcuserdatad/xcschemes/TestProject.xcscheme +96 -0
  16. data/spec/support/sample_project/TestProject/TestProject.xcodeproj/xcuserdata/dune.xcuserdatad/xcschemes/xcschememanagement.plist +27 -0
  17. data/spec/support/sample_project/TestProject/TestProject/FWTAppDelegate.h +15 -0
  18. data/spec/support/sample_project/TestProject/TestProject/FWTAppDelegate.m +49 -0
  19. data/spec/support/sample_project/TestProject/TestProject/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
  20. data/spec/support/sample_project/TestProject/TestProject/Images.xcassets/LaunchImage.launchimage/Contents.json +51 -0
  21. data/spec/support/sample_project/TestProject/TestProject/TestProject-Info.plist +45 -0
  22. data/spec/support/sample_project/TestProject/TestProject/TestProject-Prefix.pch +16 -0
  23. data/spec/support/sample_project/TestProject/TestProject/en.lproj/InfoPlist.strings +2 -0
  24. data/spec/support/sample_project/TestProject/TestProject/main.m +18 -0
  25. data/spec/support/sample_project/TestProject/TestProjectTests/TestProjectTests-Info.plist +22 -0
  26. data/spec/support/sample_project/TestProject/TestProjectTests/TestProjectTests.m +34 -0
  27. data/spec/support/sample_project/TestProject/TestProjectTests/en.lproj/InfoPlist.strings +2 -0
  28. metadata +124 -8
  29. data/lib/obfuscator.rb +0 -46
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Workspace
3
+ version = "1.0">
4
+ <FileRef
5
+ location = "self:TestProject.xcodeproj">
6
+ </FileRef>
7
+ </Workspace>
@@ -0,0 +1,96 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Scheme
3
+ LastUpgradeVersion = "0500"
4
+ version = "1.3">
5
+ <BuildAction
6
+ parallelizeBuildables = "YES"
7
+ buildImplicitDependencies = "YES">
8
+ <BuildActionEntries>
9
+ <BuildActionEntry
10
+ buildForTesting = "YES"
11
+ buildForRunning = "YES"
12
+ buildForProfiling = "YES"
13
+ buildForArchiving = "YES"
14
+ buildForAnalyzing = "YES">
15
+ <BuildableReference
16
+ BuildableIdentifier = "primary"
17
+ BlueprintIdentifier = "B71EE892189665D800C6B549"
18
+ BuildableName = "TestProject.app"
19
+ BlueprintName = "TestProject"
20
+ ReferencedContainer = "container:TestProject.xcodeproj">
21
+ </BuildableReference>
22
+ </BuildActionEntry>
23
+ </BuildActionEntries>
24
+ </BuildAction>
25
+ <TestAction
26
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
27
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
28
+ shouldUseLaunchSchemeArgsEnv = "YES"
29
+ buildConfiguration = "Debug">
30
+ <Testables>
31
+ <TestableReference
32
+ skipped = "NO">
33
+ <BuildableReference
34
+ BuildableIdentifier = "primary"
35
+ BlueprintIdentifier = "B71EE8AD189665D800C6B549"
36
+ BuildableName = "TestProjectTests.xctest"
37
+ BlueprintName = "TestProjectTests"
38
+ ReferencedContainer = "container:TestProject.xcodeproj">
39
+ </BuildableReference>
40
+ </TestableReference>
41
+ </Testables>
42
+ <MacroExpansion>
43
+ <BuildableReference
44
+ BuildableIdentifier = "primary"
45
+ BlueprintIdentifier = "B71EE892189665D800C6B549"
46
+ BuildableName = "TestProject.app"
47
+ BlueprintName = "TestProject"
48
+ ReferencedContainer = "container:TestProject.xcodeproj">
49
+ </BuildableReference>
50
+ </MacroExpansion>
51
+ </TestAction>
52
+ <LaunchAction
53
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
54
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
55
+ launchStyle = "0"
56
+ useCustomWorkingDirectory = "NO"
57
+ buildConfiguration = "Debug"
58
+ ignoresPersistentStateOnLaunch = "NO"
59
+ debugDocumentVersioning = "YES"
60
+ allowLocationSimulation = "YES">
61
+ <BuildableProductRunnable>
62
+ <BuildableReference
63
+ BuildableIdentifier = "primary"
64
+ BlueprintIdentifier = "B71EE892189665D800C6B549"
65
+ BuildableName = "TestProject.app"
66
+ BlueprintName = "TestProject"
67
+ ReferencedContainer = "container:TestProject.xcodeproj">
68
+ </BuildableReference>
69
+ </BuildableProductRunnable>
70
+ <AdditionalOptions>
71
+ </AdditionalOptions>
72
+ </LaunchAction>
73
+ <ProfileAction
74
+ shouldUseLaunchSchemeArgsEnv = "YES"
75
+ savedToolIdentifier = ""
76
+ useCustomWorkingDirectory = "NO"
77
+ buildConfiguration = "Release"
78
+ debugDocumentVersioning = "YES">
79
+ <BuildableProductRunnable>
80
+ <BuildableReference
81
+ BuildableIdentifier = "primary"
82
+ BlueprintIdentifier = "B71EE892189665D800C6B549"
83
+ BuildableName = "TestProject.app"
84
+ BlueprintName = "TestProject"
85
+ ReferencedContainer = "container:TestProject.xcodeproj">
86
+ </BuildableReference>
87
+ </BuildableProductRunnable>
88
+ </ProfileAction>
89
+ <AnalyzeAction
90
+ buildConfiguration = "Debug">
91
+ </AnalyzeAction>
92
+ <ArchiveAction
93
+ buildConfiguration = "Release"
94
+ revealArchiveInOrganizer = "YES">
95
+ </ArchiveAction>
96
+ </Scheme>
@@ -0,0 +1,27 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>SchemeUserState</key>
6
+ <dict>
7
+ <key>TestProject.xcscheme</key>
8
+ <dict>
9
+ <key>orderHint</key>
10
+ <integer>0</integer>
11
+ </dict>
12
+ </dict>
13
+ <key>SuppressBuildableAutocreation</key>
14
+ <dict>
15
+ <key>B71EE892189665D800C6B549</key>
16
+ <dict>
17
+ <key>primary</key>
18
+ <true/>
19
+ </dict>
20
+ <key>B71EE8AD189665D800C6B549</key>
21
+ <dict>
22
+ <key>primary</key>
23
+ <true/>
24
+ </dict>
25
+ </dict>
26
+ </dict>
27
+ </plist>
@@ -0,0 +1,15 @@
1
+ //
2
+ // FWTAppDelegate.h
3
+ // TestProject
4
+ //
5
+ // Created by Fabio Gallonetto on 27/01/2014.
6
+ // Copyright (c) 2014 Future Workshops. All rights reserved.
7
+ //
8
+
9
+ #import <UIKit/UIKit.h>
10
+
11
+ @interface FWTAppDelegate : UIResponder <UIApplicationDelegate>
12
+
13
+ @property (strong, nonatomic) UIWindow *window;
14
+
15
+ @end
@@ -0,0 +1,49 @@
1
+ //
2
+ // FWTAppDelegate.m
3
+ // TestProject
4
+ //
5
+ // Created by Fabio Gallonetto on 27/01/2014.
6
+ // Copyright (c) 2014 Future Workshops. All rights reserved.
7
+ //
8
+
9
+ #import "FWTAppDelegate.h"
10
+
11
+ @implementation FWTAppDelegate
12
+
13
+ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
14
+ {
15
+ self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
16
+ // Override point for customization after application launch.
17
+ self.window.backgroundColor = [UIColor whiteColor];
18
+ [self.window makeKeyAndVisible];
19
+ return YES;
20
+ }
21
+
22
+ - (void)applicationWillResignActive:(UIApplication *)application
23
+ {
24
+ // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
25
+ // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
26
+ }
27
+
28
+ - (void)applicationDidEnterBackground:(UIApplication *)application
29
+ {
30
+ // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
31
+ // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
32
+ }
33
+
34
+ - (void)applicationWillEnterForeground:(UIApplication *)application
35
+ {
36
+ // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
37
+ }
38
+
39
+ - (void)applicationDidBecomeActive:(UIApplication *)application
40
+ {
41
+ // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
42
+ }
43
+
44
+ - (void)applicationWillTerminate:(UIApplication *)application
45
+ {
46
+ // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
47
+ }
48
+
49
+ @end
@@ -0,0 +1,53 @@
1
+ {
2
+ "images" : [
3
+ {
4
+ "idiom" : "iphone",
5
+ "size" : "29x29",
6
+ "scale" : "2x"
7
+ },
8
+ {
9
+ "idiom" : "iphone",
10
+ "size" : "40x40",
11
+ "scale" : "2x"
12
+ },
13
+ {
14
+ "idiom" : "iphone",
15
+ "size" : "60x60",
16
+ "scale" : "2x"
17
+ },
18
+ {
19
+ "idiom" : "ipad",
20
+ "size" : "29x29",
21
+ "scale" : "1x"
22
+ },
23
+ {
24
+ "idiom" : "ipad",
25
+ "size" : "29x29",
26
+ "scale" : "2x"
27
+ },
28
+ {
29
+ "idiom" : "ipad",
30
+ "size" : "40x40",
31
+ "scale" : "1x"
32
+ },
33
+ {
34
+ "idiom" : "ipad",
35
+ "size" : "40x40",
36
+ "scale" : "2x"
37
+ },
38
+ {
39
+ "idiom" : "ipad",
40
+ "size" : "76x76",
41
+ "scale" : "1x"
42
+ },
43
+ {
44
+ "idiom" : "ipad",
45
+ "size" : "76x76",
46
+ "scale" : "2x"
47
+ }
48
+ ],
49
+ "info" : {
50
+ "version" : 1,
51
+ "author" : "xcode"
52
+ }
53
+ }
@@ -0,0 +1,51 @@
1
+ {
2
+ "images" : [
3
+ {
4
+ "orientation" : "portrait",
5
+ "idiom" : "iphone",
6
+ "extent" : "full-screen",
7
+ "minimum-system-version" : "7.0",
8
+ "scale" : "2x"
9
+ },
10
+ {
11
+ "orientation" : "portrait",
12
+ "idiom" : "iphone",
13
+ "subtype" : "retina4",
14
+ "extent" : "full-screen",
15
+ "minimum-system-version" : "7.0",
16
+ "scale" : "2x"
17
+ },
18
+ {
19
+ "orientation" : "portrait",
20
+ "idiom" : "ipad",
21
+ "extent" : "full-screen",
22
+ "minimum-system-version" : "7.0",
23
+ "scale" : "1x"
24
+ },
25
+ {
26
+ "orientation" : "landscape",
27
+ "idiom" : "ipad",
28
+ "extent" : "full-screen",
29
+ "minimum-system-version" : "7.0",
30
+ "scale" : "1x"
31
+ },
32
+ {
33
+ "orientation" : "portrait",
34
+ "idiom" : "ipad",
35
+ "extent" : "full-screen",
36
+ "minimum-system-version" : "7.0",
37
+ "scale" : "2x"
38
+ },
39
+ {
40
+ "orientation" : "landscape",
41
+ "idiom" : "ipad",
42
+ "extent" : "full-screen",
43
+ "minimum-system-version" : "7.0",
44
+ "scale" : "2x"
45
+ }
46
+ ],
47
+ "info" : {
48
+ "version" : 1,
49
+ "author" : "xcode"
50
+ }
51
+ }
@@ -0,0 +1,45 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>CFBundleDevelopmentRegion</key>
6
+ <string>en</string>
7
+ <key>CFBundleDisplayName</key>
8
+ <string>${PRODUCT_NAME}</string>
9
+ <key>CFBundleExecutable</key>
10
+ <string>${EXECUTABLE_NAME}</string>
11
+ <key>CFBundleIdentifier</key>
12
+ <string>com.futureworkshops.objcobfuscator.${PRODUCT_NAME:rfc1034identifier}</string>
13
+ <key>CFBundleInfoDictionaryVersion</key>
14
+ <string>6.0</string>
15
+ <key>CFBundleName</key>
16
+ <string>${PRODUCT_NAME}</string>
17
+ <key>CFBundlePackageType</key>
18
+ <string>APPL</string>
19
+ <key>CFBundleShortVersionString</key>
20
+ <string>1.0</string>
21
+ <key>CFBundleSignature</key>
22
+ <string>????</string>
23
+ <key>CFBundleVersion</key>
24
+ <string>1.0</string>
25
+ <key>LSRequiresIPhoneOS</key>
26
+ <true/>
27
+ <key>UIRequiredDeviceCapabilities</key>
28
+ <array>
29
+ <string>armv7</string>
30
+ </array>
31
+ <key>UISupportedInterfaceOrientations</key>
32
+ <array>
33
+ <string>UIInterfaceOrientationPortrait</string>
34
+ <string>UIInterfaceOrientationLandscapeLeft</string>
35
+ <string>UIInterfaceOrientationLandscapeRight</string>
36
+ </array>
37
+ <key>UISupportedInterfaceOrientations~ipad</key>
38
+ <array>
39
+ <string>UIInterfaceOrientationPortrait</string>
40
+ <string>UIInterfaceOrientationPortraitUpsideDown</string>
41
+ <string>UIInterfaceOrientationLandscapeLeft</string>
42
+ <string>UIInterfaceOrientationLandscapeRight</string>
43
+ </array>
44
+ </dict>
45
+ </plist>
@@ -0,0 +1,16 @@
1
+ //
2
+ // Prefix header
3
+ //
4
+ // The contents of this file are implicitly included at the beginning of every source file.
5
+ //
6
+
7
+ #import <Availability.h>
8
+
9
+ #ifndef __IPHONE_3_0
10
+ #warning "This project uses features only available in iOS SDK 3.0 and later."
11
+ #endif
12
+
13
+ #ifdef __OBJC__
14
+ #import <UIKit/UIKit.h>
15
+ #import <Foundation/Foundation.h>
16
+ #endif
@@ -0,0 +1,2 @@
1
+ /* Localized versions of Info.plist keys */
2
+
@@ -0,0 +1,18 @@
1
+ //
2
+ // main.m
3
+ // TestProject
4
+ //
5
+ // Created by Fabio Gallonetto on 27/01/2014.
6
+ // Copyright (c) 2014 Future Workshops. All rights reserved.
7
+ //
8
+
9
+ #import <UIKit/UIKit.h>
10
+
11
+ #import "FWTAppDelegate.h"
12
+
13
+ int main(int argc, char * argv[])
14
+ {
15
+ @autoreleasepool {
16
+ return UIApplicationMain(argc, argv, nil, NSStringFromClass([FWTAppDelegate class]));
17
+ }
18
+ }
@@ -0,0 +1,22 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>CFBundleDevelopmentRegion</key>
6
+ <string>en</string>
7
+ <key>CFBundleExecutable</key>
8
+ <string>${EXECUTABLE_NAME}</string>
9
+ <key>CFBundleIdentifier</key>
10
+ <string>com.futureworkshops.objcobfuscator.${PRODUCT_NAME:rfc1034identifier}</string>
11
+ <key>CFBundleInfoDictionaryVersion</key>
12
+ <string>6.0</string>
13
+ <key>CFBundlePackageType</key>
14
+ <string>BNDL</string>
15
+ <key>CFBundleShortVersionString</key>
16
+ <string>1.0</string>
17
+ <key>CFBundleSignature</key>
18
+ <string>????</string>
19
+ <key>CFBundleVersion</key>
20
+ <string>1</string>
21
+ </dict>
22
+ </plist>
@@ -0,0 +1,34 @@
1
+ //
2
+ // TestProjectTests.m
3
+ // TestProjectTests
4
+ //
5
+ // Created by Fabio Gallonetto on 27/01/2014.
6
+ // Copyright (c) 2014 Future Workshops. All rights reserved.
7
+ //
8
+
9
+ #import <XCTest/XCTest.h>
10
+
11
+ @interface TestProjectTests : XCTestCase
12
+
13
+ @end
14
+
15
+ @implementation TestProjectTests
16
+
17
+ - (void)setUp
18
+ {
19
+ [super setUp];
20
+ // Put setup code here. This method is called before the invocation of each test method in the class.
21
+ }
22
+
23
+ - (void)tearDown
24
+ {
25
+ // Put teardown code here. This method is called after the invocation of each test method in the class.
26
+ [super tearDown];
27
+ }
28
+
29
+ - (void)testExample
30
+ {
31
+ XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__);
32
+ }
33
+
34
+ @end