├── VPCodeObfuscationDemo
├── VPCodeObfuscationFiles
│ ├── vp_repCustom.list
│ ├── vp_resCustom.list
│ ├── vp_specifiedFile.list
│ ├── vp_frameworkKeys.list
│ ├── vp_symbols.db
│ ├── vp_func.list
│ ├── vp_excludeFile.list
│ ├── VPCodeConfuscationMacros.h
│ └── vp_confuse.sh
├── VPFrameworkTest
│ └── VPerson.framework
│ │ ├── _CodeSignature
│ │ ├── CodeSignature
│ │ ├── CodeDirectory
│ │ ├── CodeRequirements
│ │ ├── CodeRequirements-1
│ │ └── CodeResources
│ │ ├── VPerson
│ │ ├── Info.plist
│ │ ├── Modules
│ │ └── module.modulemap
│ │ └── Headers
│ │ ├── VPerson.h
│ │ └── VPersonObject.h
├── VPCodeObfuscationDemo.xcodeproj
│ ├── project.xcworkspace
│ │ └── contents.xcworkspacedata
│ └── project.pbxproj
└── VPCodeObfuscationDemo
│ ├── RootViewController.h
│ ├── VPAppDelegate.h
│ ├── main.m
│ ├── VPViewController.h
│ ├── VPPrefixHeader.pch
│ ├── RootViewController.m
│ ├── VPViewController.m
│ ├── Info.plist
│ ├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
│ ├── Assets.xcassets
│ └── AppIcon.appiconset
│ │ └── Contents.json
│ └── VPAppDelegate.m
└── README.md
/VPCodeObfuscationDemo/VPCodeObfuscationFiles/vp_repCustom.list:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/VPCodeObfuscationDemo/VPCodeObfuscationFiles/vp_resCustom.list:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/VPCodeObfuscationDemo/VPCodeObfuscationFiles/vp_specifiedFile.list:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/VPCodeObfuscationDemo/VPFrameworkTest/VPerson.framework/_CodeSignature/CodeSignature:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/VPCodeObfuscationDemo/VPCodeObfuscationFiles/vp_frameworkKeys.list:
--------------------------------------------------------------------------------
1 | VPersonObject
2 | age
3 | initWithName
4 | introduce
5 | name
6 | personWithName
7 | sex
8 |
--------------------------------------------------------------------------------
/VPCodeObfuscationDemo/VPCodeObfuscationFiles/vp_symbols.db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nevermore-imba/VPCodeObfuscation/HEAD/VPCodeObfuscationDemo/VPCodeObfuscationFiles/vp_symbols.db
--------------------------------------------------------------------------------
/VPCodeObfuscationDemo/VPFrameworkTest/VPerson.framework/VPerson:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nevermore-imba/VPCodeObfuscation/HEAD/VPCodeObfuscationDemo/VPFrameworkTest/VPerson.framework/VPerson
--------------------------------------------------------------------------------
/VPCodeObfuscationDemo/VPFrameworkTest/VPerson.framework/Info.plist:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nevermore-imba/VPCodeObfuscation/HEAD/VPCodeObfuscationDemo/VPFrameworkTest/VPerson.framework/Info.plist
--------------------------------------------------------------------------------
/VPCodeObfuscationDemo/VPFrameworkTest/VPerson.framework/Modules/module.modulemap:
--------------------------------------------------------------------------------
1 | framework module VPerson {
2 | umbrella header "VPerson.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/VPCodeObfuscationDemo/VPCodeObfuscationFiles/vp_func.list:
--------------------------------------------------------------------------------
1 | VPAppDelegate
2 | VPViewController
3 | _vpTitle
4 | params1
5 | params2
6 | params4
7 | personObject
8 | setVpTitle
9 | testFunction1
10 | testFunction2
11 | vpTitle
12 |
--------------------------------------------------------------------------------
/VPCodeObfuscationDemo/VPFrameworkTest/VPerson.framework/_CodeSignature/CodeDirectory:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nevermore-imba/VPCodeObfuscation/HEAD/VPCodeObfuscationDemo/VPFrameworkTest/VPerson.framework/_CodeSignature/CodeDirectory
--------------------------------------------------------------------------------
/VPCodeObfuscationDemo/VPFrameworkTest/VPerson.framework/_CodeSignature/CodeRequirements:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nevermore-imba/VPCodeObfuscation/HEAD/VPCodeObfuscationDemo/VPFrameworkTest/VPerson.framework/_CodeSignature/CodeRequirements
--------------------------------------------------------------------------------
/VPCodeObfuscationDemo/VPCodeObfuscationFiles/vp_excludeFile.list:
--------------------------------------------------------------------------------
1 | *.framework
2 | *.mm
3 | *.storyboard
4 | *.swift
5 | *.xib
6 | Libs
7 | VPCodeObfuscationDemo.xcodeproj
8 | VPCodeObfuscationFiles
9 | include
10 | lib
11 | libraries
12 |
--------------------------------------------------------------------------------
/VPCodeObfuscationDemo/VPFrameworkTest/VPerson.framework/_CodeSignature/CodeRequirements-1:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nevermore-imba/VPCodeObfuscation/HEAD/VPCodeObfuscationDemo/VPFrameworkTest/VPerson.framework/_CodeSignature/CodeRequirements-1
--------------------------------------------------------------------------------
/VPCodeObfuscationDemo/VPCodeObfuscationDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/VPCodeObfuscationDemo/VPCodeObfuscationDemo/RootViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // RootViewController.h
3 | // VPCodeObfuscationDemo
4 | //
5 | // Created by Axe on 2018/3/21.
6 | // Copyright © 2018年 Axe. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface RootViewController : UIViewController
12 | @property (copy, nonatomic) NSString *vpTitle;
13 | @end
14 |
--------------------------------------------------------------------------------
/VPCodeObfuscationDemo/VPCodeObfuscationDemo/VPAppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // VPAppDelegate.h
3 | // VPCodeObfuscationDemo
4 | //
5 | // Created by Axe on 2018/3/21.
6 | // Copyright © 2018年 Axe. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface VPAppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow *window;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/VPCodeObfuscationDemo/VPCodeObfuscationDemo/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // VPCodeObfuscationDemo
4 | //
5 | // Created by Axe on 2018/3/21.
6 | // Copyright © 2018年 Axe. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "VPAppDelegate.h"
11 |
12 | int main(int argc, char * argv[]) {
13 | @autoreleasepool {
14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([VPAppDelegate class]));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/VPCodeObfuscationDemo/VPCodeObfuscationDemo/VPViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // VPViewController.h
3 | // VPCodeObfuscationDemo
4 | //
5 | // Created by Axe on 2018/3/21.
6 | // Copyright © 2018年 Axe. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface VPViewController : UIViewController
12 |
13 | - (void)testFunction1:(NSString *)params0
14 | params1:(NSString *)params1
15 | params2:(NSArray *)params2;
16 |
17 | - (void)introduce;
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/VPCodeObfuscationDemo/VPCodeObfuscationDemo/VPPrefixHeader.pch:
--------------------------------------------------------------------------------
1 | //
2 | // VPPrefixHeader.pch
3 | // VPCodeObfuscationDemo
4 | //
5 | // Created by Axe on 2018/3/21.
6 | // Copyright © 2018年 Axe. All rights reserved.
7 | //
8 |
9 | #ifndef VPPrefixHeader_pch
10 | #define VPPrefixHeader_pch
11 |
12 | // Include any system framework and library headers here that should be included in all compilation units.
13 | // You will also need to set the Prefix Header build setting of one or more of your targets to reference this file.
14 |
15 | #ifdef __OBJC__
16 | #import "VPCodeConfuscationMacros.h"
17 | #endif
18 |
19 | #endif /* VPPrefixHeader_pch */
20 |
--------------------------------------------------------------------------------
/VPCodeObfuscationDemo/VPFrameworkTest/VPerson.framework/Headers/VPerson.h:
--------------------------------------------------------------------------------
1 | //
2 | // VPerson.h
3 | // VPerson
4 | //
5 | // Created by Axe on 2018/3/27.
6 | // Copyright © 2018年 Axe. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | //! Project version number for VPerson.
12 | FOUNDATION_EXPORT double VPersonVersionNumber;
13 |
14 | //! Project version string for VPerson.
15 | FOUNDATION_EXPORT const unsigned char VPersonVersionString[];
16 |
17 | // In this header, you should import all the public headers of your framework using statements like #import
18 | #import
19 |
20 |
--------------------------------------------------------------------------------
/VPCodeObfuscationDemo/VPCodeObfuscationFiles/VPCodeConfuscationMacros.h:
--------------------------------------------------------------------------------
1 | #ifndef VPCodeConfuscationMacros_h
2 | #define VPCodeConfuscationMacros_h
3 |
4 | /// The VPCodeConfuscationMacros.h file be created by vp_confuse.sh shell at 2018-03-27 13:20:01 by Axe.
5 |
6 | #define VPAppDelegate NTBYL2nIWPUQiPBy
7 | #define VPViewController UB5eTBQ3rdA4tKWV
8 | #define _vpTitle _QAo1kwTKeQs9Pggm
9 | #define params1 gXXQRFesfE9rRWEm
10 | #define params2 FgXlaFTZKhga3SEh
11 | #define params4 awkU3JtJzP15ZOG9
12 | #define personObject ggx5zBSxhxKgsMOz
13 | #define setVpTitle setQAo1kwTKeQs9Pggm
14 | #define testFunction1 BuypAv89eootrSxK
15 | #define testFunction2 q43B4aEyhKOywsrR
16 | #define vpTitle QAo1kwTKeQs9Pggm
17 |
18 | #endif /* VPCodeConfuscationMacros_h */
19 |
--------------------------------------------------------------------------------
/VPCodeObfuscationDemo/VPFrameworkTest/VPerson.framework/Headers/VPersonObject.h:
--------------------------------------------------------------------------------
1 | //
2 | // VPersonObject.h
3 | // VPerson
4 | //
5 | // Created by Axe on 2018/3/27.
6 | // Copyright © 2018年 Axe. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface VPersonObject : NSObject
14 |
15 | @property (copy, nonatomic) NSString *name;
16 | @property (copy, nonatomic, nullable) NSString *sex;
17 | @property (strong, nonatomic, nullable) NSNumber *age;
18 |
19 | - (instancetype)initWithName:(NSString *)name age:(nullable NSNumber *)age sex:(nullable NSString *)sex;
20 | + (instancetype)personWithName:(NSString *)name age:(nullable NSNumber *)age sex:(nullable NSString *)sex;
21 |
22 | - (void)introduce;
23 |
24 | @end
25 |
26 | NS_ASSUME_NONNULL_END
27 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # VPCodeObfuscation
2 | `Objective-C` 项目自动代码混淆,暂不支持 `Swift`
3 |
4 | # 文件说明
5 |
6 | ## vp_confuse.sh
7 | 这是一个可以执行的脚本,帮助我们生成混淆代码所需文件
8 |
9 | 以下文件都是在 `vp_confuse.sh` 执行后,自动生成:
10 |
11 | ## VPCodeConfuscationMacros.h
12 | 该文件采用宏的形式,分别罗列出需要混淆的关键字及各自随机生成的替换的字符串。
13 |
14 | ## vp_func.list
15 | 该文件罗列出了需要混淆的关键字,跟 `VPCodeConfuscationMacros.h` 一一对应
16 |
17 | ## vp_repCustom.list
18 | 默认是没有内容的表单,如果需要对指定的关键字进行混淆,那么你可以将其加入该文件中。如果有多个关键字,请逐行加入该表单中。
19 |
20 | ## vp_resCustom.list
21 | 默认是没有内容的表单,如果不希望指定的关键字被混淆,你可以将其加入该文件中。如果有多个关键字,请逐行加入该表单中。
22 |
23 | ## vp_reservedKeywords.list
24 | 默认是没有内容的表单,它跟 `vp_resCustom.list` 表单是同一个意思,不过里面加入的是 `Apple` 系统的 `APIs` 关键字,该表单中所添加的系统关键字不会被混淆。
25 |
26 | ## vp_specifiedFile.list
27 | 默认是没有内容的表单,我们可以指定需要混淆的文件。比如我们只需要混淆 VPViewController.[mh] 这两个文件,你只需将文件的名称 `VPViewController` 添加到该表单即可,当然也可以逐行分别写入表单。
28 |
29 | ## vp_excludeFile.list
30 | 该表单会默认添加一些文件或者文件夹名称,表示需要排除的文件或者文件夹,该文件或者文件夹下的文件将不会参与混淆,比如我们用到的第三方库就可以加到该表单中。
31 |
--------------------------------------------------------------------------------
/VPCodeObfuscationDemo/VPCodeObfuscationDemo/RootViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // RootViewController.m
3 | // VPCodeObfuscationDemo
4 | //
5 | // Created by Axe on 2018/3/21.
6 | // Copyright © 2018年 Axe. All rights reserved.
7 | //
8 |
9 | #import "RootViewController.h"
10 | #import
11 | #import "VPViewController.h"
12 |
13 | @interface RootViewController ()
14 | @property (weak, nonatomic) IBOutlet UIButton *testButton;
15 | @property (strong, nonatomic) VPersonObject *personObject;
16 | @end
17 |
18 | @implementation RootViewController
19 |
20 | - (void)viewDidLoad {
21 | [super viewDidLoad];
22 |
23 | [self setVpTitle:@"Vp"];
24 |
25 | NSLog(@"title: %@", _vpTitle);
26 | }
27 |
28 | - (IBAction)clickTestButtonAction:(UIButton *)sender forEvent:(UIEvent *)event {
29 | VPViewController *vc = [[VPViewController alloc] init];
30 | [self presentViewController:vc animated:YES completion:^{
31 | VPersonObject *person = [VPersonObject personWithName:@"Axe" age:@323 sex:@"Man"];
32 | [person introduce];
33 | }];
34 | }
35 |
36 |
37 | @end
38 |
--------------------------------------------------------------------------------
/VPCodeObfuscationDemo/VPCodeObfuscationDemo/VPViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // VPViewController.m
3 | // VPCodeObfuscationDemo
4 | //
5 | // Created by Axe on 2018/3/21.
6 | // Copyright © 2018年 Axe. All rights reserved.
7 | //
8 |
9 | #import "VPViewController.h"
10 |
11 | @interface VPViewController ()
12 |
13 | @end
14 |
15 | @implementation VPViewController
16 |
17 | - (void)viewDidLoad {
18 | [super viewDidLoad];
19 | // Do any additional setup after loading the view.
20 |
21 | self.view.backgroundColor = [UIColor redColor];
22 |
23 | UILabel *label = [UILabel new];
24 | label.text = @"触摸屏幕任意地方返回";
25 | label.textAlignment = NSTextAlignmentCenter;
26 | label.textColor = [UIColor whiteColor];
27 | label.frame = self.view.bounds;
28 | [self.view addSubview:label];
29 |
30 | [self introduce];
31 | [self testFunction1:@"Zero" params1:@"One" params2:@[@1, @2]];
32 | [self testFunction2:@"Three" params4:@"Four"];
33 | }
34 |
35 | - (void)testFunction1:(NSString *)params0
36 | params1:(NSString *)params1
37 | params2:(NSArray *)params2 {
38 | NSLog(@"params0 = %@, params1 = %@, params2 = %@", params0, params1, params2);
39 | }
40 |
41 | - (void)testFunction2:(NSString *)params3 params4:(NSString *)params4 {
42 | NSLog(@"%s{params3 = %@, params4 = %@}", __FUNCTION__, params3, params4);
43 | }
44 |
45 |
46 | - (void)introduce {
47 | NSLog(@"跟第三方库中的方法名相同,不参与混淆 %s", __func__);
48 | }
49 |
50 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
51 | [super touchesBegan:touches withEvent:event];
52 |
53 | [self dismissViewControllerAnimated:YES completion:nil];
54 | }
55 |
56 | @end
57 |
--------------------------------------------------------------------------------
/VPCodeObfuscationDemo/VPCodeObfuscationDemo/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIMainStoryboardFile
26 | Main
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UISupportedInterfaceOrientations~ipad
38 |
39 | UIInterfaceOrientationPortrait
40 | UIInterfaceOrientationPortraitUpsideDown
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/VPCodeObfuscationDemo/VPCodeObfuscationDemo/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/VPCodeObfuscationDemo/VPCodeObfuscationDemo/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "20x20",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "20x20",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "29x29",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "29x29",
61 | "scale" : "2x"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "size" : "40x40",
66 | "scale" : "1x"
67 | },
68 | {
69 | "idiom" : "ipad",
70 | "size" : "40x40",
71 | "scale" : "2x"
72 | },
73 | {
74 | "idiom" : "ipad",
75 | "size" : "76x76",
76 | "scale" : "1x"
77 | },
78 | {
79 | "idiom" : "ipad",
80 | "size" : "76x76",
81 | "scale" : "2x"
82 | },
83 | {
84 | "idiom" : "ipad",
85 | "size" : "83.5x83.5",
86 | "scale" : "2x"
87 | }
88 | ],
89 | "info" : {
90 | "version" : 1,
91 | "author" : "xcode"
92 | }
93 | }
--------------------------------------------------------------------------------
/VPCodeObfuscationDemo/VPCodeObfuscationDemo/VPAppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // VPAppDelegate.m
3 | // VPCodeObfuscationDemo
4 | //
5 | // Created by Axe on 2018/3/21.
6 | // Copyright © 2018年 Axe. All rights reserved.
7 | //
8 |
9 | #import "VPAppDelegate.h"
10 |
11 | @implementation VPAppDelegate
12 |
13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
14 | // Override point for customization after application launch.
15 | return YES;
16 | }
17 |
18 |
19 | - (void)applicationWillResignActive:(UIApplication *)application {
20 | // 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.
21 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
22 | }
23 |
24 |
25 | - (void)applicationDidEnterBackground:(UIApplication *)application {
26 | // 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.
27 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
28 | }
29 |
30 |
31 | - (void)applicationWillEnterForeground:(UIApplication *)application {
32 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
33 | }
34 |
35 |
36 | - (void)applicationDidBecomeActive:(UIApplication *)application {
37 | // 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.
38 | }
39 |
40 |
41 | - (void)applicationWillTerminate:(UIApplication *)application {
42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
43 | }
44 |
45 | @end
46 |
--------------------------------------------------------------------------------
/VPCodeObfuscationDemo/VPCodeObfuscationDemo/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/VPCodeObfuscationDemo/VPFrameworkTest/VPerson.framework/_CodeSignature/CodeResources:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | files
6 |
7 | Headers/VPerson.h
8 |
9 | ix5HTBHS7a4u5Omd+vdhesUOg2c=
10 |
11 | Headers/VPersonObject.h
12 |
13 | TGyBKAtgDNxGcPj3F5RxGQFsgvs=
14 |
15 | Info.plist
16 |
17 | MkTG/LBe4nmk7SBtR4t5kgBC3wk=
18 |
19 | Modules/module.modulemap
20 |
21 | nwRHMgzcjuYRG2YFKjMwbMN6Yzo=
22 |
23 | PrivateHeaders/VPersonObject.m
24 |
25 | E7U+BZLIavf/V1PWiOFUDk5D+us=
26 |
27 |
28 | files2
29 |
30 | Headers/VPerson.h
31 |
32 | hash
33 |
34 | ix5HTBHS7a4u5Omd+vdhesUOg2c=
35 |
36 | hash2
37 |
38 | L2lZvYSvNGHFXlijv7PiUdwwrYBCfFKgivvdBVZIVIE=
39 |
40 |
41 | Headers/VPersonObject.h
42 |
43 | hash
44 |
45 | TGyBKAtgDNxGcPj3F5RxGQFsgvs=
46 |
47 | hash2
48 |
49 | UlCNQFITyGuduZ8FOAyPW514f4YpKczctSud0g7fORY=
50 |
51 |
52 | Modules/module.modulemap
53 |
54 | hash
55 |
56 | nwRHMgzcjuYRG2YFKjMwbMN6Yzo=
57 |
58 | hash2
59 |
60 | TW0gcwKXtjpjdtawrOtOVAanfLX3O3ga2HyJZPdXLAk=
61 |
62 |
63 | PrivateHeaders/VPersonObject.m
64 |
65 | hash
66 |
67 | E7U+BZLIavf/V1PWiOFUDk5D+us=
68 |
69 | hash2
70 |
71 | oF6dcpKBiv9RtAQn9hNUH0Si8RmKNJJGRX5GlbD0wDc=
72 |
73 |
74 |
75 | rules
76 |
77 | ^
78 |
79 | ^.*\.lproj/
80 |
81 | optional
82 |
83 | weight
84 | 1000
85 |
86 | ^.*\.lproj/locversion.plist$
87 |
88 | omit
89 |
90 | weight
91 | 1100
92 |
93 | ^Base\.lproj/
94 |
95 | weight
96 | 1010
97 |
98 | ^version.plist$
99 |
100 |
101 | rules2
102 |
103 | .*\.dSYM($|/)
104 |
105 | weight
106 | 11
107 |
108 | ^
109 |
110 | weight
111 | 20
112 |
113 | ^(.*/)?\.DS_Store$
114 |
115 | omit
116 |
117 | weight
118 | 2000
119 |
120 | ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/
121 |
122 | nested
123 |
124 | weight
125 | 10
126 |
127 | ^.*
128 |
129 | ^.*\.lproj/
130 |
131 | optional
132 |
133 | weight
134 | 1000
135 |
136 | ^.*\.lproj/locversion.plist$
137 |
138 | omit
139 |
140 | weight
141 | 1100
142 |
143 | ^Base\.lproj/
144 |
145 | weight
146 | 1010
147 |
148 | ^Info\.plist$
149 |
150 | omit
151 |
152 | weight
153 | 20
154 |
155 | ^PkgInfo$
156 |
157 | omit
158 |
159 | weight
160 | 20
161 |
162 | ^[^/]+$
163 |
164 | nested
165 |
166 | weight
167 | 10
168 |
169 | ^embedded\.provisionprofile$
170 |
171 | weight
172 | 20
173 |
174 | ^version\.plist$
175 |
176 | weight
177 | 20
178 |
179 |
180 |
181 |
182 |
--------------------------------------------------------------------------------
/VPCodeObfuscationDemo/VPCodeObfuscationDemo.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 48;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | F234E0E52069EF1200010036 /* VPerson.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F234E0E42069EF1200010036 /* VPerson.framework */; };
11 | F2CF168D20624852006AFD75 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F2CF168B20624852006AFD75 /* Main.storyboard */; };
12 | F2CF168F20624852006AFD75 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F2CF168E20624852006AFD75 /* Assets.xcassets */; };
13 | F2CF169220624852006AFD75 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F2CF169020624852006AFD75 /* LaunchScreen.storyboard */; };
14 | F2CF169520624852006AFD75 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = F2CF169420624852006AFD75 /* main.m */; };
15 | F2CF169F20624929006AFD75 /* VPAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = F2CF169E20624929006AFD75 /* VPAppDelegate.m */; };
16 | F2CF16A22062498B006AFD75 /* RootViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F2CF16A12062498B006AFD75 /* RootViewController.m */; };
17 | F2CF16A52062499B006AFD75 /* VPViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F2CF16A42062499B006AFD75 /* VPViewController.m */; };
18 | /* End PBXBuildFile section */
19 |
20 | /* Begin PBXFileReference section */
21 | F234E0E42069EF1200010036 /* VPerson.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = VPerson.framework; sourceTree = ""; };
22 | F2CF168220624852006AFD75 /* VPCodeObfuscationDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = VPCodeObfuscationDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
23 | F2CF168C20624852006AFD75 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
24 | F2CF168E20624852006AFD75 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
25 | F2CF169120624852006AFD75 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
26 | F2CF169320624852006AFD75 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
27 | F2CF169420624852006AFD75 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
28 | F2CF169D20624929006AFD75 /* VPAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VPAppDelegate.h; sourceTree = ""; };
29 | F2CF169E20624929006AFD75 /* VPAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VPAppDelegate.m; sourceTree = ""; };
30 | F2CF16A02062498B006AFD75 /* RootViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RootViewController.h; sourceTree = ""; };
31 | F2CF16A12062498B006AFD75 /* RootViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RootViewController.m; sourceTree = ""; };
32 | F2CF16A32062499B006AFD75 /* VPViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VPViewController.h; sourceTree = ""; };
33 | F2CF16A42062499B006AFD75 /* VPViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VPViewController.m; sourceTree = ""; };
34 | F2CF16AA20624CFF006AFD75 /* VPCodeConfuscationMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VPCodeConfuscationMacros.h; sourceTree = ""; };
35 | F2CF16B420624D1A006AFD75 /* VPPrefixHeader.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VPPrefixHeader.pch; sourceTree = ""; };
36 | /* End PBXFileReference section */
37 |
38 | /* Begin PBXFrameworksBuildPhase section */
39 | F2CF167F20624852006AFD75 /* Frameworks */ = {
40 | isa = PBXFrameworksBuildPhase;
41 | buildActionMask = 2147483647;
42 | files = (
43 | F234E0E52069EF1200010036 /* VPerson.framework in Frameworks */,
44 | );
45 | runOnlyForDeploymentPostprocessing = 0;
46 | };
47 | /* End PBXFrameworksBuildPhase section */
48 |
49 | /* Begin PBXGroup section */
50 | F234E0E12069ED5B00010036 /* VPFrameworkTest */ = {
51 | isa = PBXGroup;
52 | children = (
53 | F234E0E42069EF1200010036 /* VPerson.framework */,
54 | );
55 | path = VPFrameworkTest;
56 | sourceTree = "";
57 | };
58 | F2CF167920624852006AFD75 = {
59 | isa = PBXGroup;
60 | children = (
61 | F234E0E12069ED5B00010036 /* VPFrameworkTest */,
62 | F2CF169B2062485D006AFD75 /* VPCodeObfuscationFiles */,
63 | F2CF168420624852006AFD75 /* VPCodeObfuscationDemo */,
64 | F2CF168320624852006AFD75 /* Products */,
65 | );
66 | sourceTree = "";
67 | };
68 | F2CF168320624852006AFD75 /* Products */ = {
69 | isa = PBXGroup;
70 | children = (
71 | F2CF168220624852006AFD75 /* VPCodeObfuscationDemo.app */,
72 | );
73 | name = Products;
74 | sourceTree = "";
75 | };
76 | F2CF168420624852006AFD75 /* VPCodeObfuscationDemo */ = {
77 | isa = PBXGroup;
78 | children = (
79 | F2CF169D20624929006AFD75 /* VPAppDelegate.h */,
80 | F2CF169E20624929006AFD75 /* VPAppDelegate.m */,
81 | F2CF16A02062498B006AFD75 /* RootViewController.h */,
82 | F2CF16A12062498B006AFD75 /* RootViewController.m */,
83 | F2CF16A32062499B006AFD75 /* VPViewController.h */,
84 | F2CF16A42062499B006AFD75 /* VPViewController.m */,
85 | F2CF168B20624852006AFD75 /* Main.storyboard */,
86 | F2CF168E20624852006AFD75 /* Assets.xcassets */,
87 | F2CF169020624852006AFD75 /* LaunchScreen.storyboard */,
88 | F2CF169320624852006AFD75 /* Info.plist */,
89 | F2CF169420624852006AFD75 /* main.m */,
90 | F2CF16B420624D1A006AFD75 /* VPPrefixHeader.pch */,
91 | );
92 | path = VPCodeObfuscationDemo;
93 | sourceTree = "";
94 | };
95 | F2CF169B2062485D006AFD75 /* VPCodeObfuscationFiles */ = {
96 | isa = PBXGroup;
97 | children = (
98 | F2CF16AA20624CFF006AFD75 /* VPCodeConfuscationMacros.h */,
99 | );
100 | path = VPCodeObfuscationFiles;
101 | sourceTree = "";
102 | };
103 | /* End PBXGroup section */
104 |
105 | /* Begin PBXNativeTarget section */
106 | F2CF168120624852006AFD75 /* VPCodeObfuscationDemo */ = {
107 | isa = PBXNativeTarget;
108 | buildConfigurationList = F2CF169820624852006AFD75 /* Build configuration list for PBXNativeTarget "VPCodeObfuscationDemo" */;
109 | buildPhases = (
110 | F2CF167E20624852006AFD75 /* Sources */,
111 | F2CF167F20624852006AFD75 /* Frameworks */,
112 | F2CF168020624852006AFD75 /* Resources */,
113 | F2CF16A6206249DC006AFD75 /* Run Script Code Obfuscation */,
114 | );
115 | buildRules = (
116 | );
117 | dependencies = (
118 | );
119 | name = VPCodeObfuscationDemo;
120 | productName = VPCodeObfuscationDemo;
121 | productReference = F2CF168220624852006AFD75 /* VPCodeObfuscationDemo.app */;
122 | productType = "com.apple.product-type.application";
123 | };
124 | /* End PBXNativeTarget section */
125 |
126 | /* Begin PBXProject section */
127 | F2CF167A20624852006AFD75 /* Project object */ = {
128 | isa = PBXProject;
129 | attributes = {
130 | LastUpgradeCheck = 0920;
131 | ORGANIZATIONNAME = Axe;
132 | TargetAttributes = {
133 | F2CF168120624852006AFD75 = {
134 | CreatedOnToolsVersion = 9.2;
135 | ProvisioningStyle = Automatic;
136 | };
137 | };
138 | };
139 | buildConfigurationList = F2CF167D20624852006AFD75 /* Build configuration list for PBXProject "VPCodeObfuscationDemo" */;
140 | compatibilityVersion = "Xcode 8.0";
141 | developmentRegion = en;
142 | hasScannedForEncodings = 0;
143 | knownRegions = (
144 | en,
145 | Base,
146 | );
147 | mainGroup = F2CF167920624852006AFD75;
148 | productRefGroup = F2CF168320624852006AFD75 /* Products */;
149 | projectDirPath = "";
150 | projectRoot = "";
151 | targets = (
152 | F2CF168120624852006AFD75 /* VPCodeObfuscationDemo */,
153 | );
154 | };
155 | /* End PBXProject section */
156 |
157 | /* Begin PBXResourcesBuildPhase section */
158 | F2CF168020624852006AFD75 /* Resources */ = {
159 | isa = PBXResourcesBuildPhase;
160 | buildActionMask = 2147483647;
161 | files = (
162 | F2CF169220624852006AFD75 /* LaunchScreen.storyboard in Resources */,
163 | F2CF168F20624852006AFD75 /* Assets.xcassets in Resources */,
164 | F2CF168D20624852006AFD75 /* Main.storyboard in Resources */,
165 | );
166 | runOnlyForDeploymentPostprocessing = 0;
167 | };
168 | /* End PBXResourcesBuildPhase section */
169 |
170 | /* Begin PBXShellScriptBuildPhase section */
171 | F2CF16A6206249DC006AFD75 /* Run Script Code Obfuscation */ = {
172 | isa = PBXShellScriptBuildPhase;
173 | buildActionMask = 2147483647;
174 | files = (
175 | );
176 | inputPaths = (
177 | );
178 | name = "Run Script Code Obfuscation";
179 | outputPaths = (
180 | );
181 | runOnlyForDeploymentPostprocessing = 0;
182 | shellPath = /bin/sh;
183 | shellScript = $PROJECT_DIR/VPCodeObfuscationFiles/vp_confuse.sh;
184 | };
185 | /* End PBXShellScriptBuildPhase section */
186 |
187 | /* Begin PBXSourcesBuildPhase section */
188 | F2CF167E20624852006AFD75 /* Sources */ = {
189 | isa = PBXSourcesBuildPhase;
190 | buildActionMask = 2147483647;
191 | files = (
192 | F2CF169F20624929006AFD75 /* VPAppDelegate.m in Sources */,
193 | F2CF169520624852006AFD75 /* main.m in Sources */,
194 | F2CF16A52062499B006AFD75 /* VPViewController.m in Sources */,
195 | F2CF16A22062498B006AFD75 /* RootViewController.m in Sources */,
196 | );
197 | runOnlyForDeploymentPostprocessing = 0;
198 | };
199 | /* End PBXSourcesBuildPhase section */
200 |
201 | /* Begin PBXVariantGroup section */
202 | F2CF168B20624852006AFD75 /* Main.storyboard */ = {
203 | isa = PBXVariantGroup;
204 | children = (
205 | F2CF168C20624852006AFD75 /* Base */,
206 | );
207 | name = Main.storyboard;
208 | sourceTree = "";
209 | };
210 | F2CF169020624852006AFD75 /* LaunchScreen.storyboard */ = {
211 | isa = PBXVariantGroup;
212 | children = (
213 | F2CF169120624852006AFD75 /* Base */,
214 | );
215 | name = LaunchScreen.storyboard;
216 | sourceTree = "";
217 | };
218 | /* End PBXVariantGroup section */
219 |
220 | /* Begin XCBuildConfiguration section */
221 | F2CF169620624852006AFD75 /* Debug */ = {
222 | isa = XCBuildConfiguration;
223 | buildSettings = {
224 | ALWAYS_SEARCH_USER_PATHS = NO;
225 | CLANG_ANALYZER_NONNULL = YES;
226 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
227 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
228 | CLANG_CXX_LIBRARY = "libc++";
229 | CLANG_ENABLE_MODULES = YES;
230 | CLANG_ENABLE_OBJC_ARC = YES;
231 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
232 | CLANG_WARN_BOOL_CONVERSION = YES;
233 | CLANG_WARN_COMMA = YES;
234 | CLANG_WARN_CONSTANT_CONVERSION = YES;
235 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
236 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
237 | CLANG_WARN_EMPTY_BODY = YES;
238 | CLANG_WARN_ENUM_CONVERSION = YES;
239 | CLANG_WARN_INFINITE_RECURSION = YES;
240 | CLANG_WARN_INT_CONVERSION = YES;
241 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
242 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
243 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
244 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
245 | CLANG_WARN_STRICT_PROTOTYPES = YES;
246 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
247 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
248 | CLANG_WARN_UNREACHABLE_CODE = YES;
249 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
250 | CODE_SIGN_IDENTITY = "iPhone Developer";
251 | COPY_PHASE_STRIP = NO;
252 | DEBUG_INFORMATION_FORMAT = dwarf;
253 | ENABLE_STRICT_OBJC_MSGSEND = YES;
254 | ENABLE_TESTABILITY = YES;
255 | GCC_C_LANGUAGE_STANDARD = gnu11;
256 | GCC_DYNAMIC_NO_PIC = NO;
257 | GCC_NO_COMMON_BLOCKS = YES;
258 | GCC_OPTIMIZATION_LEVEL = 0;
259 | GCC_PREPROCESSOR_DEFINITIONS = (
260 | "DEBUG=1",
261 | "$(inherited)",
262 | );
263 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
264 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
265 | GCC_WARN_UNDECLARED_SELECTOR = YES;
266 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
267 | GCC_WARN_UNUSED_FUNCTION = YES;
268 | GCC_WARN_UNUSED_VARIABLE = YES;
269 | IPHONEOS_DEPLOYMENT_TARGET = 11.2;
270 | MTL_ENABLE_DEBUG_INFO = YES;
271 | ONLY_ACTIVE_ARCH = YES;
272 | SDKROOT = iphoneos;
273 | };
274 | name = Debug;
275 | };
276 | F2CF169720624852006AFD75 /* Release */ = {
277 | isa = XCBuildConfiguration;
278 | buildSettings = {
279 | ALWAYS_SEARCH_USER_PATHS = NO;
280 | CLANG_ANALYZER_NONNULL = YES;
281 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
282 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
283 | CLANG_CXX_LIBRARY = "libc++";
284 | CLANG_ENABLE_MODULES = YES;
285 | CLANG_ENABLE_OBJC_ARC = YES;
286 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
287 | CLANG_WARN_BOOL_CONVERSION = YES;
288 | CLANG_WARN_COMMA = YES;
289 | CLANG_WARN_CONSTANT_CONVERSION = YES;
290 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
291 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
292 | CLANG_WARN_EMPTY_BODY = YES;
293 | CLANG_WARN_ENUM_CONVERSION = YES;
294 | CLANG_WARN_INFINITE_RECURSION = YES;
295 | CLANG_WARN_INT_CONVERSION = YES;
296 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
297 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
298 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
299 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
300 | CLANG_WARN_STRICT_PROTOTYPES = YES;
301 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
302 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
303 | CLANG_WARN_UNREACHABLE_CODE = YES;
304 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
305 | CODE_SIGN_IDENTITY = "iPhone Developer";
306 | COPY_PHASE_STRIP = NO;
307 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
308 | ENABLE_NS_ASSERTIONS = NO;
309 | ENABLE_STRICT_OBJC_MSGSEND = YES;
310 | GCC_C_LANGUAGE_STANDARD = gnu11;
311 | GCC_NO_COMMON_BLOCKS = YES;
312 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
313 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
314 | GCC_WARN_UNDECLARED_SELECTOR = YES;
315 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
316 | GCC_WARN_UNUSED_FUNCTION = YES;
317 | GCC_WARN_UNUSED_VARIABLE = YES;
318 | IPHONEOS_DEPLOYMENT_TARGET = 11.2;
319 | MTL_ENABLE_DEBUG_INFO = NO;
320 | SDKROOT = iphoneos;
321 | VALIDATE_PRODUCT = YES;
322 | };
323 | name = Release;
324 | };
325 | F2CF169920624852006AFD75 /* Debug */ = {
326 | isa = XCBuildConfiguration;
327 | buildSettings = {
328 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
329 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
330 | CODE_SIGN_STYLE = Automatic;
331 | DEVELOPMENT_TEAM = "";
332 | FRAMEWORK_SEARCH_PATHS = (
333 | "$(inherited)",
334 | "$(PROJECT_DIR)/VPFrameworkTest",
335 | );
336 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
337 | GCC_PREFIX_HEADER = "$(SRCROOT)/$(PROJECT_NAME)/VPPrefixHeader.pch";
338 | INFOPLIST_FILE = VPCodeObfuscationDemo/Info.plist;
339 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
340 | PRODUCT_BUNDLE_IDENTIFIER = com.axe.VPCodeObfuscationDemo;
341 | PRODUCT_NAME = "$(TARGET_NAME)";
342 | PROVISIONING_PROFILE_SPECIFIER = "";
343 | TARGETED_DEVICE_FAMILY = "1,2";
344 | };
345 | name = Debug;
346 | };
347 | F2CF169A20624852006AFD75 /* Release */ = {
348 | isa = XCBuildConfiguration;
349 | buildSettings = {
350 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
351 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
352 | CODE_SIGN_STYLE = Automatic;
353 | DEVELOPMENT_TEAM = "";
354 | FRAMEWORK_SEARCH_PATHS = (
355 | "$(inherited)",
356 | "$(PROJECT_DIR)/VPFrameworkTest",
357 | );
358 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
359 | GCC_PREFIX_HEADER = "$(SRCROOT)/$(PROJECT_NAME)/VPPrefixHeader.pch";
360 | INFOPLIST_FILE = VPCodeObfuscationDemo/Info.plist;
361 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
362 | PRODUCT_BUNDLE_IDENTIFIER = com.axe.VPCodeObfuscationDemo;
363 | PRODUCT_NAME = "$(TARGET_NAME)";
364 | PROVISIONING_PROFILE_SPECIFIER = "";
365 | TARGETED_DEVICE_FAMILY = "1,2";
366 | };
367 | name = Release;
368 | };
369 | /* End XCBuildConfiguration section */
370 |
371 | /* Begin XCConfigurationList section */
372 | F2CF167D20624852006AFD75 /* Build configuration list for PBXProject "VPCodeObfuscationDemo" */ = {
373 | isa = XCConfigurationList;
374 | buildConfigurations = (
375 | F2CF169620624852006AFD75 /* Debug */,
376 | F2CF169720624852006AFD75 /* Release */,
377 | );
378 | defaultConfigurationIsVisible = 0;
379 | defaultConfigurationName = Release;
380 | };
381 | F2CF169820624852006AFD75 /* Build configuration list for PBXNativeTarget "VPCodeObfuscationDemo" */ = {
382 | isa = XCConfigurationList;
383 | buildConfigurations = (
384 | F2CF169920624852006AFD75 /* Debug */,
385 | F2CF169A20624852006AFD75 /* Release */,
386 | );
387 | defaultConfigurationIsVisible = 0;
388 | defaultConfigurationName = Release;
389 | };
390 | /* End XCConfigurationList section */
391 | };
392 | rootObject = F2CF167A20624852006AFD75 /* Project object */;
393 | }
394 |
--------------------------------------------------------------------------------
/VPCodeObfuscationDemo/VPCodeObfuscationFiles/vp_confuse.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # vp_confuse.sh
4 | # VPCodeObfuscationDemo
5 | #
6 | # Created by Axe on 2018/3/21.
7 | # Copyright © 2018年 Axe. All rights reserved.
8 | # Run Script: $PROJECT_DIR/VPCodeObfuscationFiles/vp_confuse.sh
9 | # cd VPCodeObfuscationFiles: chmod 755 vp_confuse.sh
10 |
11 | # The root directory
12 | ROOT_FOLDER="$PROJECT_DIR"
13 |
14 | # Filename prefix
15 | FILE_NAME_PREFIX="vp"
16 | FILE_NAME_PREFIX_CAPITAL=`echo $FILE_NAME_PREFIX | tr [a-z] [A-Z]`
17 |
18 | # The root directory of the script
19 | CONFUSE_ROOT_FILE="$ROOT_FOLDER/VPCodeObfuscationFiles"
20 |
21 | # Confuse the macro definition file
22 | HEAD_FILE="$CONFUSE_ROOT_FILE/${FILE_NAME_PREFIX_CAPITAL}CodeConfuscationMacros.h"
23 |
24 | #waring This file lists the reserved keywords of the Apple system API and does not recommend deleting the text file.
25 | RESERVEDKEYWORDS="$CONFUSE_ROOT_FILE/${FILE_NAME_PREFIX}_reservedKeywords.list"
26 |
27 | STRING_SYMBOL_FILE="$CONFUSE_ROOT_FILE/${FILE_NAME_PREFIX}_func.list"
28 |
29 | # Third party framework
30 | THIRD_PARTY_FRAMEWORK="$CONFUSE_ROOT_FILE/${FILE_NAME_PREFIX}_frameworkKeys.list"
31 |
32 | # SQLite_DB
33 | TABLE_NAME=symbols
34 | SYMBOL_DB_FILE="$CONFUSE_ROOT_FILE/${FILE_NAME_PREFIX}_symbols.db"
35 |
36 | RES_CUSTOM_FILE="$CONFUSE_ROOT_FILE/${FILE_NAME_PREFIX}_resCustom.list"
37 | REP_CUSTOM_FILE="$CONFUSE_ROOT_FILE/${FILE_NAME_PREFIX}_repCustom.list"
38 |
39 | SPECIFIED_FILE="$CONFUSE_ROOT_FILE/${FILE_NAME_PREFIX}_specifiedFile.list"
40 | EXCLUDE_FILE="$CONFUSE_ROOT_FILE/${FILE_NAME_PREFIX}_excludeFile.list"
41 |
42 | export LC_CTYPE=C
43 |
44 | ramdomString() {
45 | openssl rand -base64 64 | tr -cd 'a-zA-Z0-9' | sed 's/^[0-9]*//g' | head -c 16
46 | }
47 |
48 | createDatabase() {
49 | echo "create table $TABLE_NAME(src text, des text, date text);" | sqlite3 $SYMBOL_DB_FILE
50 | }
51 |
52 | insertValue() {
53 | echo "insert into $TABLE_NAME values('$1' ,'$2' ,'$3');" | sqlite3 $SYMBOL_DB_FILE
54 | }
55 |
56 | if [ ! -f $RESERVEDKEYWORDS ]
57 | then
58 | touch $RESERVEDKEYWORDS
59 | fi
60 |
61 | if [ ! -f $STRING_SYMBOL_FILE ]
62 | then
63 | touch $STRING_SYMBOL_FILE
64 | fi
65 |
66 | ## Custom reserved file list
67 | if [ ! -f $RES_CUSTOM_FILE ]
68 | then
69 | touch $RES_CUSTOM_FILE
70 | fi
71 |
72 | ## Custom obfuscation file list
73 | if [ ! -f $REP_CUSTOM_FILE ]
74 | then
75 | touch $REP_CUSTOM_FILE
76 | fi
77 |
78 | ## Specified file list
79 | if [ ! -f $SPECIFIED_FILE ]
80 | then
81 | touch $SPECIFIED_FILE
82 | fi
83 |
84 | ## Exclude file list
85 | if [ ! -f $EXCLUDE_FILE ]
86 | then
87 | touch $EXCLUDE_FILE
88 | fi
89 |
90 | ## Default exclude file
91 | rm -f exclude_default_file.txt
92 | arr=($(basename $CONFUSE_ROOT_FILE) *.framework *.xcodeproj *.storyboard *.swift *.mm *.xib include libraries Libs lib)
93 | for data in ${arr[@]}
94 | do
95 | echo $data >> exclude_default_file.txt
96 | done
97 |
98 | ## User add exclude file
99 | if [ ! -f exclude_added_file.txt ]
100 | then
101 | touch exclude_added_file.txt
102 | else
103 | rm -f exclude_added_file.txt
104 | fi
105 |
106 | cat $EXCLUDE_FILE |
107 | while read line
108 | do
109 | echo $line >> exclude_added_file.txt
110 | done
111 |
112 | rm -f exclude_file_tmp.txt
113 | cat exclude_default_file.txt exclude_added_file.txt | sort | uniq | sed '/^$/d' > exclude_file_tmp.txt
114 | rm -f exclude_default_file.txt
115 | rm -f exclude_added_file.txt
116 |
117 | rm -f exclude_file.txt
118 | rm -f $EXCLUDE_FILE
119 |
120 | cat exclude_file_tmp.txt |
121 | while read line
122 | do
123 | echo $line >> $EXCLUDE_FILE
124 | echo "--exclude-dir=$line" >> exclude_file.txt
125 | done
126 | rm -f exclude_file_tmp.txt
127 |
128 | for line in `cat exclude_file.txt`
129 | do
130 | EXCLUDE_DIR="$EXCLUDE_DIR $line"
131 | done
132 |
133 | #echo EXCLUDE_DIR: $EXCLUDE_DIR
134 |
135 | rm -f exclude_file.txt
136 |
137 | ## File Paths
138 | rm -f filePaths.txt
139 |
140 | if [ -s $SPECIFIED_FILE ]
141 | then
142 | cat $SPECIFIED_FILE |
143 | while read filename
144 | do
145 | if [[ $filename =~ "." ]]
146 | then
147 | find $ROOT_FOLDER -name "$filename" -type f | sed "/\/\./d" >> filePaths.txt
148 | else
149 | find $ROOT_FOLDER -name "$filename.h" -o -name "$filename.m" -type f | sed "/\/\./d" >> filePaths.txt
150 | fi
151 | done
152 | fi
153 |
154 | rm -f classPaths.txt
155 | rm -f funcPaths.txt
156 | rm -f propertyPaths.txt
157 | rm -f protocolPaths.txt
158 |
159 | if [ -s filePaths.txt ]
160 | then
161 | cat filePaths.txt |
162 | while read filepath
163 | do
164 | grep -h -r -I "^@interface" $filepath >> classPaths.txt
165 | grep -r -n -I -w "^[-+]" $filepath >> funcPaths.txt
166 | grep -h -r -I "^@property" $filepath >> propertyPaths.txt
167 | grep -h -r -I "^@protocol" $filepath >> protocolPaths.txt
168 | done
169 | else ## empty file
170 | grep -h -r -I "^@interface" $ROOT_FOLDER $EXCLUDE_DIR --include '*.[mh]' > classPaths.txt
171 | grep -r -n -I -w "^[-+]" $ROOT_FOLDER $EXCLUDE_DIR --include '*.[mh]' > funcPaths.txt
172 | grep -h -r -I "^@property" $ROOT_FOLDER $EXCLUDE_DIR --include '*.[mh]' > propertyPaths.txt
173 | grep -h -r -I "^@protocol" $ROOT_FOLDER $EXCLUDE_DIR --include '*.[mh]' > protocolPaths.txt
174 | fi
175 |
176 | rm -f filePaths.txt
177 |
178 | ## property list
179 | rm -f filter_property.txt
180 | grep -v "IBOutlet" propertyPaths.txt | sed 's/;.*//g' | sed "s/( *^/ /g" | sed "s/) *(/{/g" | sed "s/{.*)/ /g" | sed "s/(.*)/ /g" | sed "s/<.*>//g" | sed "s/[,*]/ /g" | sed 's/[ ][ ]*/ /g' | awk -F " " '{print $NF}' | sort | uniq | sed '/^$/d' > filter_property.txt
181 | rm -f propertyPaths.txt
182 |
183 | rm -f all_property_path.txt
184 | grep -h -r -I "^@property" $ROOT_FOLDER $EXCLUDE_DIR --include '*.[mh]' > all_property_path.txt
185 | rm -f property_with_iboutlet.txt
186 | grep "IBOutlet" all_property_path.txt | sed 's/;.*//g' | sed "s/( *^/ /g" | sed "s/) *(/{/g" | sed "s/{.*)/ /g" | sed "s/(.*)/ /g" | sed "s/<.*>//g" | sed "s/[,*]/ /g" | sed 's/[ ][ ]*/ /g' | awk -F " " '{print $NF}' | sort | uniq | sed '/^$/d' > property_with_iboutlet.txt
187 | rm -f all_property_path.txt
188 |
189 | ## function list
190 |
191 | rm -f full_func.txt
192 | rm -f infull_func.txt
193 |
194 | rm -f func_info_tmp.txt
195 | cat funcPaths.txt | sed 's/;.*/;/g' | sed 's/\/\/.*//g' > func_info_tmp.txt
196 | rm -f funcPaths.txt
197 |
198 | cat func_info_tmp.txt |
199 | while read msg
200 | do
201 | func=$(echo "$msg" | cut -d ":" -f 3-)
202 | if [[ $func =~ [';''{'] ]]
203 | then
204 | echo $func >> full_func.txt
205 | else
206 | echo $msg >> infull_func.txt
207 | fi
208 | done
209 | rm -f func_info_tmp.txt
210 |
211 | rm -f infull_to_full_func.txt
212 | cat infull_func.txt |
213 | while read msg
214 | do
215 | rm -f tmp.txt
216 | path=$(echo "$msg" | cut -d ":" -f 1)
217 | line=$(echo "$msg" | cut -d ":" -f 2)
218 | func=$(echo "$msg" | cut -d ":" -f 3-)
219 | echo $func > tmp.txt
220 | i=$[$line+1]
221 | result=1
222 | while(($result > 0))
223 | do
224 | next_line_p="${i}p"
225 | next_line_func=`sed -n $next_line_p $path`
226 | next_line_func_tmp=`echo $next_line_func | sed 's/;.*/;/g' | sed 's/\/\/.*//g'`
227 | if [[ $next_line_func_tmp =~ [-+] ]]
228 | then
229 | break
230 | else
231 | if [[ $next_line_func_tmp =~ ":" ]]
232 | then
233 | echo JoiningMethodParameter: $next_line_func_tmp
234 | echo $next_line_func_tmp >> tmp.txt
235 | if [[ $next_line_func_tmp =~ ";" ]] || [[ $next_line_func_tmp =~ "{" ]]
236 | then
237 | break
238 | fi
239 | else
240 | break
241 | fi
242 | fi
243 | i=$(($i+1))
244 | done
245 | cat tmp.txt | xargs >> infull_to_full_func.txt
246 | rm -f tmp.txt
247 | done
248 | rm -f infull_func.txt
249 |
250 | rm -f function_path.txt
251 | cat full_func.txt infull_to_full_func.txt | sort | uniq | sed '/^$/d' > function_path.txt
252 | rm -f full_func.txt
253 | rm -f infull_to_full_func.txt
254 |
255 | rm -f func_proxy.txt
256 | grep -v "IBAction" function_path.txt | sed 's/;.*//g' | sed 's/[{}]/ /g' | sed 's/[-+]//g' | sed 's/^[ ]*//g' | sed 's/[ ]*$//g' | sed 's/([^)]*)*//g' | sed 's/[ ][ ]*/ /g' | sed 's/ *: */:/g' | sed 's/
//g' | sed "/^init/d"| sort | uniq | sed '/^$/d' > func_proxy.txt
257 | rm -f function_path.txt
258 |
259 | rm -f func_proxy_tmp.txt
260 | cat func_proxy.txt |
261 | while read line
262 | do
263 | OLD_IFS="$IFS"
264 | IFS=" "
265 | arr=($line)
266 | IFS="$OLD_IFS"
267 | for data in ${arr[@]}
268 | do
269 | first_data=`echo $data | awk -F ":" '{print $1}'`
270 | echo $first_data >> func_proxy_tmp.txt
271 | done
272 | done
273 | rm -f func_proxy.txt
274 |
275 | rm -f filter_func.txt
276 | cat func_proxy_tmp.txt | sort | uniq | sed '/^$/d' > filter_func.txt
277 | rm -f func_proxy_tmp.txt
278 |
279 | rm -f all_func_path.txt
280 | grep -h -r -I "^[-+]" $ROOT_FOLDER $EXCLUDE_DIR --include '*.[mh]' > all_func_path.txt
281 |
282 | rm -f func_with_ibaction_proxy.txt
283 | grep "IBAction" all_func_path.txt | sed 's/;.*//g' | sed 's/[{}]/ /g' | sed 's/[-+]//g' | sed 's/^[ ]*//g' | sed 's/[ ]*$//g' | sed 's/([^)]*)*//g' | sed 's/[ ][ ]*/ /g' | sed 's/ *: */:/g' | sed 's/
//g' | sed "/^init/d"| sort | uniq | sed '/^$/d' > func_with_ibaction_proxy.txt
284 | rm -f all_func_path.txt
285 |
286 | if [ ! -f func_with_ibaction.txt ]
287 | then
288 | touch func_with_ibaction.txt
289 | else
290 | rm -f func_with_ibaction.txt
291 | fi
292 |
293 | cat func_with_ibaction_proxy.txt |
294 | while read line
295 | do
296 | OLD_IFS="$IFS"
297 | IFS=" "
298 | arr=($line)
299 | IFS="$OLD_IFS"
300 | for data in ${arr[@]}
301 | do
302 | first_data=`echo $data | awk -F ":" '{print $1}'`
303 | echo $first_data >> func_with_ibaction.txt
304 | done
305 | done
306 | rm -f func_with_ibaction_proxy.txt
307 |
308 | ## class name list
309 | rm -f filter_class_tmp.txt
310 | cat classPaths.txt | sed "s/[:(]/ /" | awk '{split($0,s," ");print s[2];}' | sort | uniq | sed '/^$/d' >> filter_class_tmp.txt ## class
311 | rm -f classPaths.txt
312 |
313 | rm -f filter_class.txt
314 | cat filter_class_tmp.txt |
315 | while read class_name
316 | do
317 | rm -f class_tmp.txt
318 | if grep -r -n -I -w "$class_name" $ROOT_FOLDER $EXCLUDE_DIR --include="*.c" --include="*.mm" --include="*.storyboard" --include="*.xib" > class_tmp.txt
319 | then
320 | cat class_tmp.txt |
321 | while read ts
322 | do
323 | v1=$(echo "$ts"|cut -d: -f 1 )
324 | v2=$(echo "$ts"|cut -d: -f 2 )
325 | echo "Find class: $class_name at $(basename $v1) line:$v2"
326 | done
327 | else
328 | echo $class_name >> filter_class.txt
329 | fi
330 | done
331 | rm -f class_tmp.txt
332 |
333 | rm -f filter_class_tmp.txt
334 |
335 | ## protocol name list
336 | rm -f filter_protocol.txt
337 | cat protocolPaths.txt | sed "s/[\<,;].*$//g" | awk '{print $2;}' | sed 's/[[:space:]]//g' | sort | uniq | sed "/^$/d" >> filter_protocol.txt ## protocol
338 | rm -f protocolPaths.txt
339 |
340 | ############################ Third party framework #############################
341 |
342 | rm -f f.list
343 | find $ROOT_FOLDER -type f | sed "/\/\./d" >> f.list
344 |
345 | rm -f third_party_framework_path.txt
346 | cat f.list |
347 | while read line
348 | do
349 | if [[ $line =~ ".framework" ]]
350 | then
351 | echo $line >> third_party_framework_path.txt
352 | fi
353 | done
354 | rm -f f.list
355 |
356 | rm -f third_party_framework_func_path.txt
357 | rm -f third_party_framework_class_path.txt
358 | rm -f third_party_framework_property_path.txt
359 | rm -f third_party_framework_protocol_path.txt
360 |
361 | cat third_party_framework_path.txt |
362 | while read filepath
363 | do
364 | grep -h -r -I "^@interface" $filepath >> third_party_framework_class_path.txt
365 | grep -h -r -I "^[-+]" $filepath >> third_party_framework_func_path.txt
366 | grep -h -r -I "^@property" $filepath >> third_party_framework_property_path.txt
367 | grep -h -r -I "^@protocol" $filepath >> third_party_framework_protocol_path.txt
368 | done
369 |
370 | rm -f third_party_framework_path.txt
371 |
372 | rm -f third_party_framework_func.txt
373 | rm -f third_party_framework_class.txt
374 | rm -f third_party_framework_property.txt
375 | rm -f third_party_framework_protocol.txt
376 |
377 | grep -v "IBOutlet" third_party_framework_property_path.txt | sed 's/;.*//g' | sed 's/__attribute__.*//g' | sed "s/( *^/ /g" | sed "s/) *(/{/g" | sed "s/{.*)/ /g" | sed "s/(.*)/ /g" | sed "s/<.*>//g" | sed "s/[,*]/ /g" | sed 's/[ ][ ]*/ /g' | awk -F " " '{print $NF}' | sort | uniq | sed '/^$/d' > third_party_framework_property.txt
378 | rm -f third_party_framework_property_path.txt
379 |
380 | grep -v "IBAction" third_party_framework_func_path.txt | sed 's/;.*//g' | awk -F':' '{print $1}' | sed "s/[+-]//g" | sed 's/(.*)//g' | sed 's/[,: *\^\/\{}]//g' | sed 's/[[:space:]]//g' | sort | uniq | sed '/^$/d' > third_party_framework_func.txt
381 | rm -f third_party_framework_func_path.txt
382 |
383 | cat third_party_framework_class_path.txt | sed "s/[:(]/ /" | awk '{split($0,s," ");print s[2];}' | sort | uniq | sed '/^$/d' >> third_party_framework_class.txt ## class
384 | rm -f third_party_framework_class_path.txt
385 |
386 | cat third_party_framework_protocol_path.txt | sed "s/[\<,;].*$//g" | awk '{print $2;}' | sed 's/[[:space:]]//g' | sort | uniq | sed "/^$/d" >> third_party_framework_protocol.txt
387 | rm -f third_party_framework_protocol_path.txt
388 |
389 | cat third_party_framework_func.txt third_party_framework_class.txt third_party_framework_property.txt third_party_framework_protocol.txt | sort | uniq | sed "/^$/d" > $THIRD_PARTY_FRAMEWORK
390 |
391 | rm -f third_party_framework_func.txt
392 | rm -f third_party_framework_class.txt
393 | rm -f third_party_framework_property.txt
394 | rm -f third_party_framework_protocol.txt
395 |
396 | ############################ Third party framework #############################
397 | ## Generate `Setter` method names based on properties.
398 | if [ ! -f property_setter_func.txt ]
399 | then
400 | touch property_setter_func.txt
401 | else
402 | rm -f property_setter_func.txt
403 | fi
404 |
405 | cat filter_property.txt |
406 | while read property
407 | do
408 | first_property=`echo $property | cut -c -1 | tr [a-z] [A-Z]`
409 | without_first_property=`echo $property | cut -c 2-`
410 | setter_func=`echo set$first_property$without_first_property`
411 | echo $setter_func >> property_setter_func.txt
412 | done
413 |
414 | if [ ! -f filter_func_without_getter_and_setter.txt ]
415 | then
416 | touch filter_func_without_getter_and_setter.txt
417 | else
418 | rm -f filter_func_without_getter_and_setter.txt
419 | fi
420 |
421 | ## Merge filter_func.txt, filter_class.txt, filter_protocol.txt
422 | if [ ! -f without_property_derive.txt ]
423 | then
424 | touch without_property_derive.txt
425 | else
426 | rm -f without_property_derive.txt
427 | fi
428 |
429 | cat filter_func.txt filter_class.txt filter_protocol.txt $REP_CUSTOM_FILE | sort | uniq | sed "/^$/d" >> without_property_derive.txt
430 | rm -f filter_func.txt
431 | rm -f filter_class.txt
432 | rm -f filter_protocol.txt
433 |
434 | rm -f getter_setter_ibaction.txt
435 | cat filter_property.txt property_setter_func.txt func_with_ibaction.txt | sort | uniq | sed "/^$/d" >> getter_setter_ibaction.txt
436 | rm -f property_setter_func.txt
437 | rm -f func_with_ibaction.txt
438 |
439 | cat without_property_derive.txt |
440 | while read line
441 | do
442 | if grep "$line\>" getter_setter_ibaction.txt
443 | then
444 | echo Find_Getter_Setter_IBAction: $line
445 | else
446 | random=`ramdomString`
447 | echo "$line $random" >> filter_func_without_getter_and_setter.txt ## function
448 | fi
449 | done
450 | rm -f without_property_derive.txt
451 | rm -f getter_setter_ibaction.txt
452 |
453 | if [ ! -f repProperty.txt ]
454 | then
455 | touch repProperty.txt
456 | else
457 | rm -f repProperty.txt
458 | fi
459 |
460 | cat filter_property.txt |
461 | while read line
462 | do
463 | if grep "$line\>" property_with_iboutlet.txt $RESERVEDKEYWORDS $RES_CUSTOM_FILE
464 | then
465 | echo Find_Property_IBOutlet: $line
466 | else
467 | random=`ramdomString`
468 | echo "$line $random" >> repProperty.txt ## property
469 | fi
470 | done
471 |
472 | rm -f filter_property.txt
473 | rm -f property_with_iboutlet.txt
474 |
475 | if [ ! -f var_property.txt ]
476 | then
477 | touch var_property.txt
478 | else
479 | rm -f var_property.txt
480 | fi
481 |
482 | cat repProperty.txt |
483 | while read line
484 | do
485 | ar=(`echo "$line"|cut -d " " -f 1-2`)
486 | _property=`echo _${ar[0]}`
487 | _random=`echo _${ar[1]}`
488 | rm -f var_tmp.txt
489 | if grep -r -n -I -w "$_property" $ROOT_FOLDER $EXCLUDE_DIR --include="*.[mhc]" --include="*.mm" > var_tmp.txt
490 | then
491 | cat var_tmp.txt |
492 | while read ts
493 | do
494 | v1=$(echo "$ts"|cut -d: -f 1 )
495 | v2=$(echo "$ts"|cut -d: -f 2 )
496 | echo "Find $_property at $(basename $v1) line:$v2"
497 | echo "$_property $_random" >> var_property.txt ## var_property
498 | done
499 | else
500 | echo "Do not find $_property"
501 | fi
502 | done
503 | rm -f var_tmp.txt
504 |
505 | if [ ! -f set_property.txt ]
506 | then
507 | touch set_property.txt
508 | else
509 | rm -f set_property.txt
510 | fi
511 |
512 | cat repProperty.txt |
513 | while read line
514 | do
515 | ar=(`echo "$line"|cut -d " " -f 1-2`)
516 | property=`echo ${ar[0]}`
517 | random=`echo ${ar[1]}`
518 | first_property=`echo $property | cut -c -1 | tr [a-z] [A-Z]`
519 | first_random=`echo $random | cut -c -1 | tr [a-z] [A-Z]`
520 | without_first_property=`echo $property | cut -c 2-`
521 | without_first_random=`echo $random | cut -c 2-`
522 | setter_property=`echo set$first_property$without_first_property`
523 | setter_random=`echo set$first_random$without_first_random`
524 | rm -f setter_tmp.txt
525 | if grep -r -n -I -w "$setter_property" $ROOT_FOLDER $EXCLUDE_DIR --include="*.[mhc]" --include="*.mm" > setter_tmp.txt
526 | then
527 | cat setter_tmp.txt |
528 | while read ts
529 | do
530 | v1=$(echo "$ts"|cut -d: -f 1 )
531 | v2=$(echo "$ts"|cut -d: -f 2 )
532 | echo "Find $setter_property at $(basename $v1) line:$v2"
533 | echo "$setter_property $setter_random" >> set_property.txt ## set_property
534 | done
535 | else
536 | echo "Do not find $setter_property"
537 | fi
538 | done
539 | rm -f setter_tmp.txt
540 |
541 | rm -f rep_keys_all.txt
542 | cat filter_func_without_getter_and_setter.txt repProperty.txt set_property.txt var_property.txt | sort | uniq | sed '/^$/d' > rep_keys_all.txt
543 | rm -f filter_func_without_getter_and_setter.txt
544 | rm -f repProperty.txt
545 | rm -f set_property.txt
546 | rm -f var_property.txt
547 |
548 | rm -f res_keys_all.txt
549 | cat $RESERVEDKEYWORDS $RES_CUSTOM_FILE $THIRD_PARTY_FRAMEWORK | sort | uniq | sed '/^$/d' > res_keys_all.txt
550 |
551 | rm -f $STRING_SYMBOL_FILE
552 | rm -f $HEAD_FILE
553 |
554 | symbol_file_h="_h"
555 | macros_file_name=`echo $(basename $HEAD_FILE .h)$symbol_file_h`
556 |
557 | echo "#ifndef $macros_file_name
558 | #define $macros_file_name" >> $HEAD_FILE
559 | echo "" >> $HEAD_FILE
560 | echo "/// The $(basename $HEAD_FILE) file be created by ${FILE_NAME_PREFIX}_confuse.sh shell at `date '+%Y-%m-%d %H:%M:%S'` by Axe." >> $HEAD_FILE
561 | echo "" >> $HEAD_FILE
562 |
563 | createDatabase
564 |
565 | cat rep_keys_all.txt |
566 | while read line
567 | do
568 | key=`echo $line | cut -d " " -f 1`
569 | value=`echo $line | cut -d " " -f 2`
570 | if grep "$key\>" res_keys_all.txt
571 | then
572 | echo Filtering systems or custom keywords: $key
573 | else
574 | date=`date '+%Y-%m-%d %H:%M:%S'`
575 | insertValue $key $value "$date"
576 | echo $key >> $STRING_SYMBOL_FILE
577 | echo "#define $line" >> $HEAD_FILE
578 | fi
579 | done
580 |
581 | echo "" >> $HEAD_FILE
582 | echo "#endif /* $macros_file_name */" >> $HEAD_FILE
583 |
584 | sqlite3 $SYMBOL_DB_FILE .dump
585 |
586 | rm -f rep_keys_all.txt
587 | rm -f res_keys_all.txt
588 |
589 | exit
590 |
--------------------------------------------------------------------------------