├── README.md ├── iOS应用防护 ├── ggh函数混淆 │ ├── Resource │ │ ├── PrefixHeader.pch │ │ ├── codeObfuscation.h │ │ ├── confuse.sh │ │ └── func.list │ ├── ggh函数混淆.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcuserdata │ │ │ │ └── guogh.xcuserdatad │ │ │ │ └── UserInterfaceState.xcuserstate │ │ └── xcuserdata │ │ │ └── guogh.xcuserdatad │ │ │ └── xcschemes │ │ │ ├── ggh函数混淆.xcscheme │ │ │ └── xcschememanagement.plist │ ├── ggh函数混淆 │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Assets.xcassets │ │ │ └── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ ├── Base.lproj │ │ │ ├── LaunchScreen.storyboard │ │ │ └── Main.storyboard │ │ ├── Info.plist │ │ ├── ViewController.h │ │ ├── ViewController.m │ │ └── main.m │ ├── ggh函数混淆Tests │ │ ├── Info.plist │ │ └── ggh____Tests.m │ ├── ggh函数混淆UITests │ │ ├── Info.plist │ │ └── ggh____UITests.m │ └── symbols ├── iOS应用防护.md ├── obfuscate.py ├── obfuscate.sh ├── securityDome1 │ ├── securityDome1.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcuserdata │ │ │ │ └── guogh.xcuserdatad │ │ │ │ └── UserInterfaceState.xcuserstate │ │ └── xcuserdata │ │ │ └── guogh.xcuserdatad │ │ │ └── xcschemes │ │ │ ├── securityDome1.xcscheme │ │ │ └── xcschememanagement.plist │ ├── securityDome1 │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Assets.xcassets │ │ │ └── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ ├── Base.lproj │ │ │ ├── LaunchScreen.storyboard │ │ │ └── Main.storyboard │ │ ├── Info.plist │ │ ├── ViewController.h │ │ ├── ViewController.m │ │ └── main.m │ ├── securityDome1Tests │ │ ├── Info.plist │ │ └── securityDome1Tests.m │ └── securityDome1UITests │ │ ├── Info.plist │ │ └── securityDome1UITests.m ├── securityDome2 │ ├── Resource │ │ ├── PrefixHeader.pch │ │ ├── codeObfuscation.h │ │ ├── confuse.sh │ │ └── func.list │ ├── securityDome1 │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Assets.xcassets │ │ │ └── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ ├── Base.lproj │ │ │ ├── LaunchScreen.storyboard │ │ │ └── Main.storyboard │ │ ├── Info.plist │ │ ├── ViewController.h │ │ ├── ViewController.m │ │ └── main.m │ ├── securityDome1Tests │ │ ├── Info.plist │ │ └── securityDome1Tests.m │ ├── securityDome1UITests │ │ ├── Info.plist │ │ └── securityDome1UITests.m │ └── securityDome2.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── guogh.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ │ └── xcuserdata │ │ └── guogh.xcuserdatad │ │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ ├── securityDome1.xcscheme │ │ └── xcschememanagement.plist ├── 字符串混淆前反汇编.png ├── 字符串混淆前的代码.png ├── 字符串混淆后反汇编.png ├── 字符串混淆后的代码.png ├── 未混淆前.png ├── 混淆后.png └── 混淆脚本设置.png └── 字符串硬编码混淆 ├── hello String ├── confusion │ ├── confusion.py │ └── decodeConfusion.py ├── hello String.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── guogh.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ └── guogh.xcuserdatad │ │ └── xcschemes │ │ └── xcschememanagement.plist ├── hello String │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Info.plist │ ├── ViewController.h │ ├── ViewController.m │ └── main.m ├── hello StringTests │ ├── Info.plist │ └── hello_StringTests.m └── hello StringUITests │ ├── Info.plist │ └── hello_StringUITests.m ├── iOS字符串硬编码混淆.md ├── 已混淆.png └── 未混淆.png /README.md: -------------------------------------------------------------------------------- 1 | # iOSApplicationReinforcement 2 | 3 | [简书地址](http://www.jianshu.com/p/a2ed798a7f62) 4 | 5 | [字符串硬编码简书地址](http://www.jianshu.com/p/49e98b8a05fd) -------------------------------------------------------------------------------- /iOS应用防护/ggh函数混淆/Resource/PrefixHeader.pch: -------------------------------------------------------------------------------- 1 | // 2 | // PrefixHeader.pch 3 | // HSKConfuse 4 | // 5 | // Created by Code_Hou on 2017/3/11. 6 | // Copyright © 2017年 侯森魁. All rights reserved. 7 | // 8 | 9 | #ifndef PrefixHeader_pch 10 | #define PrefixHeader_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 | #import "codeObfuscation.h" 16 | 17 | #endif /* PrefixHeader_pch */ 18 | -------------------------------------------------------------------------------- /iOS应用防护/ggh函数混淆/Resource/codeObfuscation.h: -------------------------------------------------------------------------------- 1 | #ifndef Demo_codeObfuscation_h 2 | #define Demo_codeObfuscation_h 3 | //confuse string at Sun Jul 16 16:37:42 CST 2017 4 | #define ggh_func1 NJjVGsytKMrTBbYd 5 | #define ggh_func2 gGCWmYikdGFXLMfl 6 | #define ggh_func3 gIYRDMQrHMnXaYFN 7 | #define ggh_func4 gFzwDJFfqpBXWpMy 8 | #endif 9 | -------------------------------------------------------------------------------- /iOS应用防护/ggh函数混淆/Resource/confuse.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | TABLENAME=symbols 4 | SYMBOL_DB_FILE="symbols" 5 | STRING_SYMBOL_FILE="$PROJECT_DIR/Resource/func.list" 6 | 7 | CONFUSE_FILE="$PROJECT_DIR/" 8 | 9 | HEAD_FILE="$PROJECT_DIR/Resource/codeObfuscation.h" 10 | 11 | export LC_CTYPE=C 12 | 13 | #取以.m或.h结尾的文件以+号或-号开头的行 |去掉所有+号或-号|用空格代替符号|n个空格跟着<号 替换成 <号|开头不能是IBAction|用空格split字串取第二部分|排序|去重复|删除空行|删掉以init开头的行>写进func.list 14 | grep -h -r -I "^[-+]" $CONFUSE_FILE --include '*.[mh]' |sed "s/[+-]//g"|sed "s/[();,: *\^\/\{]/ /g"|sed "s/[ ]*$STRING_SYMBOL_FILE 15 | 16 | 17 | #维护数据库方便日后作排重,一下代码来自念茜的微博 18 | createTable() 19 | { 20 | echo "create table $TABLENAME(src text, des text);" | sqlite3 $SYMBOL_DB_FILE 21 | } 22 | 23 | insertValue() 24 | { 25 | echo "insert into $TABLENAME values('$1' ,'$2');" | sqlite3 $SYMBOL_DB_FILE 26 | } 27 | 28 | query() 29 | { 30 | echo "select * from $TABLENAME where src='$1';" | sqlite3 $SYMBOL_DB_FILE 31 | } 32 | 33 | ramdomString() 34 | { 35 | openssl rand -base64 64 | tr -cd 'a-zA-Z' |head -c 16 36 | 37 | } 38 | 39 | rm -f $SYMBOL_DB_FILE 40 | rm -f $HEAD_FILE 41 | createTable 42 | 43 | touch $HEAD_FILE 44 | echo '#ifndef Demo_codeObfuscation_h 45 | #define Demo_codeObfuscation_h' >> $HEAD_FILE 46 | echo "//confuse string at `date`" >> $HEAD_FILE 47 | cat "$STRING_SYMBOL_FILE" | while read -ra line; do 48 | if [[ ! -z "$line" ]]; then 49 | ramdom=`ramdomString` 50 | echo $line $ramdom 51 | insertValue $line $ramdom 52 | echo "#define $line $ramdom" >> $HEAD_FILE 53 | fi 54 | done 55 | echo "#endif" >> $HEAD_FILE 56 | 57 | 58 | sqlite3 $SYMBOL_DB_FILE .dump 59 | 60 | -------------------------------------------------------------------------------- /iOS应用防护/ggh函数混淆/Resource/func.list: -------------------------------------------------------------------------------- 1 | ggh_func1 2 | ggh_func2 3 | ggh_func3 4 | ggh_func4 5 | -------------------------------------------------------------------------------- /iOS应用防护/ggh函数混淆/ggh函数混淆.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | CFA4694A1F1B5AA000532B31 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CFA469491F1B5AA000532B31 /* main.m */; }; 11 | CFA4694D1F1B5AA000532B31 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CFA4694C1F1B5AA000532B31 /* AppDelegate.m */; }; 12 | CFA469501F1B5AA000532B31 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CFA4694F1F1B5AA000532B31 /* ViewController.m */; }; 13 | CFA469531F1B5AA000532B31 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CFA469511F1B5AA000532B31 /* Main.storyboard */; }; 14 | CFA469551F1B5AA000532B31 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CFA469541F1B5AA000532B31 /* Assets.xcassets */; }; 15 | CFA469581F1B5AA000532B31 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CFA469561F1B5AA000532B31 /* LaunchScreen.storyboard */; }; 16 | CFA469631F1B5AA000532B31 /* ggh____Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = CFA469621F1B5AA000532B31 /* ggh____Tests.m */; }; 17 | CFA4696E1F1B5AA000532B31 /* ggh____UITests.m in Sources */ = {isa = PBXBuildFile; fileRef = CFA4696D1F1B5AA000532B31 /* ggh____UITests.m */; }; 18 | CFA469811F1B5B3A00532B31 /* confuse.sh in Resources */ = {isa = PBXBuildFile; fileRef = CFA4697E1F1B5B3A00532B31 /* confuse.sh */; }; 19 | CFA469821F1B5B3A00532B31 /* func.list in Resources */ = {isa = PBXBuildFile; fileRef = CFA4697F1F1B5B3A00532B31 /* func.list */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXContainerItemProxy section */ 23 | CFA4695F1F1B5AA000532B31 /* PBXContainerItemProxy */ = { 24 | isa = PBXContainerItemProxy; 25 | containerPortal = CFA4693D1F1B5AA000532B31 /* Project object */; 26 | proxyType = 1; 27 | remoteGlobalIDString = CFA469441F1B5AA000532B31; 28 | remoteInfo = "ggh函数混淆"; 29 | }; 30 | CFA4696A1F1B5AA000532B31 /* PBXContainerItemProxy */ = { 31 | isa = PBXContainerItemProxy; 32 | containerPortal = CFA4693D1F1B5AA000532B31 /* Project object */; 33 | proxyType = 1; 34 | remoteGlobalIDString = CFA469441F1B5AA000532B31; 35 | remoteInfo = "ggh函数混淆"; 36 | }; 37 | /* End PBXContainerItemProxy section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | CFA469451F1B5AA000532B31 /* ggh函数混淆.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ggh函数混淆.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | CFA469491F1B5AA000532B31 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 42 | CFA4694B1F1B5AA000532B31 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 43 | CFA4694C1F1B5AA000532B31 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 44 | CFA4694E1F1B5AA000532B31 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 45 | CFA4694F1F1B5AA000532B31 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 46 | CFA469521F1B5AA000532B31 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 47 | CFA469541F1B5AA000532B31 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 48 | CFA469571F1B5AA000532B31 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 49 | CFA469591F1B5AA000532B31 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 50 | CFA4695E1F1B5AA000532B31 /* ggh函数混淆Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "ggh函数混淆Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 51 | CFA469621F1B5AA000532B31 /* ggh____Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "ggh____Tests.m"; sourceTree = ""; }; 52 | CFA469641F1B5AA000532B31 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 53 | CFA469691F1B5AA000532B31 /* ggh函数混淆UITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "ggh函数混淆UITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 54 | CFA4696D1F1B5AA000532B31 /* ggh____UITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "ggh____UITests.m"; sourceTree = ""; }; 55 | CFA4696F1F1B5AA000532B31 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 56 | CFA4697D1F1B5B3A00532B31 /* codeObfuscation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = codeObfuscation.h; sourceTree = ""; }; 57 | CFA4697E1F1B5B3A00532B31 /* confuse.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = confuse.sh; sourceTree = ""; }; 58 | CFA4697F1F1B5B3A00532B31 /* func.list */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = func.list; sourceTree = ""; }; 59 | CFA469801F1B5B3A00532B31 /* PrefixHeader.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PrefixHeader.pch; sourceTree = ""; }; 60 | /* End PBXFileReference section */ 61 | 62 | /* Begin PBXFrameworksBuildPhase section */ 63 | CFA469421F1B5AA000532B31 /* Frameworks */ = { 64 | isa = PBXFrameworksBuildPhase; 65 | buildActionMask = 2147483647; 66 | files = ( 67 | ); 68 | runOnlyForDeploymentPostprocessing = 0; 69 | }; 70 | CFA4695B1F1B5AA000532B31 /* Frameworks */ = { 71 | isa = PBXFrameworksBuildPhase; 72 | buildActionMask = 2147483647; 73 | files = ( 74 | ); 75 | runOnlyForDeploymentPostprocessing = 0; 76 | }; 77 | CFA469661F1B5AA000532B31 /* Frameworks */ = { 78 | isa = PBXFrameworksBuildPhase; 79 | buildActionMask = 2147483647; 80 | files = ( 81 | ); 82 | runOnlyForDeploymentPostprocessing = 0; 83 | }; 84 | /* End PBXFrameworksBuildPhase section */ 85 | 86 | /* Begin PBXGroup section */ 87 | CFA4693C1F1B5AA000532B31 = { 88 | isa = PBXGroup; 89 | children = ( 90 | CFA4697C1F1B5B3A00532B31 /* Resource */, 91 | CFA469471F1B5AA000532B31 /* ggh函数混淆 */, 92 | CFA469611F1B5AA000532B31 /* ggh函数混淆Tests */, 93 | CFA4696C1F1B5AA000532B31 /* ggh函数混淆UITests */, 94 | CFA469461F1B5AA000532B31 /* Products */, 95 | ); 96 | sourceTree = ""; 97 | }; 98 | CFA469461F1B5AA000532B31 /* Products */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | CFA469451F1B5AA000532B31 /* ggh函数混淆.app */, 102 | CFA4695E1F1B5AA000532B31 /* ggh函数混淆Tests.xctest */, 103 | CFA469691F1B5AA000532B31 /* ggh函数混淆UITests.xctest */, 104 | ); 105 | name = Products; 106 | sourceTree = ""; 107 | }; 108 | CFA469471F1B5AA000532B31 /* ggh函数混淆 */ = { 109 | isa = PBXGroup; 110 | children = ( 111 | CFA4694B1F1B5AA000532B31 /* AppDelegate.h */, 112 | CFA4694C1F1B5AA000532B31 /* AppDelegate.m */, 113 | CFA4694E1F1B5AA000532B31 /* ViewController.h */, 114 | CFA4694F1F1B5AA000532B31 /* ViewController.m */, 115 | CFA469511F1B5AA000532B31 /* Main.storyboard */, 116 | CFA469541F1B5AA000532B31 /* Assets.xcassets */, 117 | CFA469561F1B5AA000532B31 /* LaunchScreen.storyboard */, 118 | CFA469591F1B5AA000532B31 /* Info.plist */, 119 | CFA469481F1B5AA000532B31 /* Supporting Files */, 120 | ); 121 | path = "ggh函数混淆"; 122 | sourceTree = ""; 123 | }; 124 | CFA469481F1B5AA000532B31 /* Supporting Files */ = { 125 | isa = PBXGroup; 126 | children = ( 127 | CFA469491F1B5AA000532B31 /* main.m */, 128 | ); 129 | name = "Supporting Files"; 130 | sourceTree = ""; 131 | }; 132 | CFA469611F1B5AA000532B31 /* ggh函数混淆Tests */ = { 133 | isa = PBXGroup; 134 | children = ( 135 | CFA469621F1B5AA000532B31 /* ggh____Tests.m */, 136 | CFA469641F1B5AA000532B31 /* Info.plist */, 137 | ); 138 | path = "ggh函数混淆Tests"; 139 | sourceTree = ""; 140 | }; 141 | CFA4696C1F1B5AA000532B31 /* ggh函数混淆UITests */ = { 142 | isa = PBXGroup; 143 | children = ( 144 | CFA4696D1F1B5AA000532B31 /* ggh____UITests.m */, 145 | CFA4696F1F1B5AA000532B31 /* Info.plist */, 146 | ); 147 | path = "ggh函数混淆UITests"; 148 | sourceTree = ""; 149 | }; 150 | CFA4697C1F1B5B3A00532B31 /* Resource */ = { 151 | isa = PBXGroup; 152 | children = ( 153 | CFA4697D1F1B5B3A00532B31 /* codeObfuscation.h */, 154 | CFA4697E1F1B5B3A00532B31 /* confuse.sh */, 155 | CFA4697F1F1B5B3A00532B31 /* func.list */, 156 | CFA469801F1B5B3A00532B31 /* PrefixHeader.pch */, 157 | ); 158 | path = Resource; 159 | sourceTree = ""; 160 | }; 161 | /* End PBXGroup section */ 162 | 163 | /* Begin PBXNativeTarget section */ 164 | CFA469441F1B5AA000532B31 /* ggh函数混淆 */ = { 165 | isa = PBXNativeTarget; 166 | buildConfigurationList = CFA469721F1B5AA000532B31 /* Build configuration list for PBXNativeTarget "ggh函数混淆" */; 167 | buildPhases = ( 168 | CFA469411F1B5AA000532B31 /* Sources */, 169 | CFA469421F1B5AA000532B31 /* Frameworks */, 170 | CFA469431F1B5AA000532B31 /* Resources */, 171 | CFA4697B1F1B5B2700532B31 /* ShellScript */, 172 | ); 173 | buildRules = ( 174 | ); 175 | dependencies = ( 176 | ); 177 | name = "ggh函数混淆"; 178 | productName = "ggh函数混淆"; 179 | productReference = CFA469451F1B5AA000532B31 /* ggh函数混淆.app */; 180 | productType = "com.apple.product-type.application"; 181 | }; 182 | CFA4695D1F1B5AA000532B31 /* ggh函数混淆Tests */ = { 183 | isa = PBXNativeTarget; 184 | buildConfigurationList = CFA469751F1B5AA000532B31 /* Build configuration list for PBXNativeTarget "ggh函数混淆Tests" */; 185 | buildPhases = ( 186 | CFA4695A1F1B5AA000532B31 /* Sources */, 187 | CFA4695B1F1B5AA000532B31 /* Frameworks */, 188 | CFA4695C1F1B5AA000532B31 /* Resources */, 189 | ); 190 | buildRules = ( 191 | ); 192 | dependencies = ( 193 | CFA469601F1B5AA000532B31 /* PBXTargetDependency */, 194 | ); 195 | name = "ggh函数混淆Tests"; 196 | productName = "ggh函数混淆Tests"; 197 | productReference = CFA4695E1F1B5AA000532B31 /* ggh函数混淆Tests.xctest */; 198 | productType = "com.apple.product-type.bundle.unit-test"; 199 | }; 200 | CFA469681F1B5AA000532B31 /* ggh函数混淆UITests */ = { 201 | isa = PBXNativeTarget; 202 | buildConfigurationList = CFA469781F1B5AA000532B31 /* Build configuration list for PBXNativeTarget "ggh函数混淆UITests" */; 203 | buildPhases = ( 204 | CFA469651F1B5AA000532B31 /* Sources */, 205 | CFA469661F1B5AA000532B31 /* Frameworks */, 206 | CFA469671F1B5AA000532B31 /* Resources */, 207 | ); 208 | buildRules = ( 209 | ); 210 | dependencies = ( 211 | CFA4696B1F1B5AA000532B31 /* PBXTargetDependency */, 212 | ); 213 | name = "ggh函数混淆UITests"; 214 | productName = "ggh函数混淆UITests"; 215 | productReference = CFA469691F1B5AA000532B31 /* ggh函数混淆UITests.xctest */; 216 | productType = "com.apple.product-type.bundle.ui-testing"; 217 | }; 218 | /* End PBXNativeTarget section */ 219 | 220 | /* Begin PBXProject section */ 221 | CFA4693D1F1B5AA000532B31 /* Project object */ = { 222 | isa = PBXProject; 223 | attributes = { 224 | LastUpgradeCheck = 0830; 225 | ORGANIZATIONNAME = "郭滚华"; 226 | TargetAttributes = { 227 | CFA469441F1B5AA000532B31 = { 228 | CreatedOnToolsVersion = 8.3.3; 229 | DevelopmentTeam = 22DBSR3WQ7; 230 | ProvisioningStyle = Automatic; 231 | }; 232 | CFA4695D1F1B5AA000532B31 = { 233 | CreatedOnToolsVersion = 8.3.3; 234 | ProvisioningStyle = Automatic; 235 | TestTargetID = CFA469441F1B5AA000532B31; 236 | }; 237 | CFA469681F1B5AA000532B31 = { 238 | CreatedOnToolsVersion = 8.3.3; 239 | ProvisioningStyle = Automatic; 240 | TestTargetID = CFA469441F1B5AA000532B31; 241 | }; 242 | }; 243 | }; 244 | buildConfigurationList = CFA469401F1B5AA000532B31 /* Build configuration list for PBXProject "ggh函数混淆" */; 245 | compatibilityVersion = "Xcode 3.2"; 246 | developmentRegion = English; 247 | hasScannedForEncodings = 0; 248 | knownRegions = ( 249 | en, 250 | Base, 251 | ); 252 | mainGroup = CFA4693C1F1B5AA000532B31; 253 | productRefGroup = CFA469461F1B5AA000532B31 /* Products */; 254 | projectDirPath = ""; 255 | projectRoot = ""; 256 | targets = ( 257 | CFA469441F1B5AA000532B31 /* ggh函数混淆 */, 258 | CFA4695D1F1B5AA000532B31 /* ggh函数混淆Tests */, 259 | CFA469681F1B5AA000532B31 /* ggh函数混淆UITests */, 260 | ); 261 | }; 262 | /* End PBXProject section */ 263 | 264 | /* Begin PBXResourcesBuildPhase section */ 265 | CFA469431F1B5AA000532B31 /* Resources */ = { 266 | isa = PBXResourcesBuildPhase; 267 | buildActionMask = 2147483647; 268 | files = ( 269 | CFA469581F1B5AA000532B31 /* LaunchScreen.storyboard in Resources */, 270 | CFA469821F1B5B3A00532B31 /* func.list in Resources */, 271 | CFA469551F1B5AA000532B31 /* Assets.xcassets in Resources */, 272 | CFA469811F1B5B3A00532B31 /* confuse.sh in Resources */, 273 | CFA469531F1B5AA000532B31 /* Main.storyboard in Resources */, 274 | ); 275 | runOnlyForDeploymentPostprocessing = 0; 276 | }; 277 | CFA4695C1F1B5AA000532B31 /* Resources */ = { 278 | isa = PBXResourcesBuildPhase; 279 | buildActionMask = 2147483647; 280 | files = ( 281 | ); 282 | runOnlyForDeploymentPostprocessing = 0; 283 | }; 284 | CFA469671F1B5AA000532B31 /* Resources */ = { 285 | isa = PBXResourcesBuildPhase; 286 | buildActionMask = 2147483647; 287 | files = ( 288 | ); 289 | runOnlyForDeploymentPostprocessing = 0; 290 | }; 291 | /* End PBXResourcesBuildPhase section */ 292 | 293 | /* Begin PBXShellScriptBuildPhase section */ 294 | CFA4697B1F1B5B2700532B31 /* ShellScript */ = { 295 | isa = PBXShellScriptBuildPhase; 296 | buildActionMask = 2147483647; 297 | files = ( 298 | ); 299 | inputPaths = ( 300 | ); 301 | outputPaths = ( 302 | ); 303 | runOnlyForDeploymentPostprocessing = 0; 304 | shellPath = /bin/sh; 305 | shellScript = $PROJECT_DIR/Resource/confuse.sh; 306 | }; 307 | /* End PBXShellScriptBuildPhase section */ 308 | 309 | /* Begin PBXSourcesBuildPhase section */ 310 | CFA469411F1B5AA000532B31 /* Sources */ = { 311 | isa = PBXSourcesBuildPhase; 312 | buildActionMask = 2147483647; 313 | files = ( 314 | CFA469501F1B5AA000532B31 /* ViewController.m in Sources */, 315 | CFA4694D1F1B5AA000532B31 /* AppDelegate.m in Sources */, 316 | CFA4694A1F1B5AA000532B31 /* main.m in Sources */, 317 | ); 318 | runOnlyForDeploymentPostprocessing = 0; 319 | }; 320 | CFA4695A1F1B5AA000532B31 /* Sources */ = { 321 | isa = PBXSourcesBuildPhase; 322 | buildActionMask = 2147483647; 323 | files = ( 324 | CFA469631F1B5AA000532B31 /* ggh____Tests.m in Sources */, 325 | ); 326 | runOnlyForDeploymentPostprocessing = 0; 327 | }; 328 | CFA469651F1B5AA000532B31 /* Sources */ = { 329 | isa = PBXSourcesBuildPhase; 330 | buildActionMask = 2147483647; 331 | files = ( 332 | CFA4696E1F1B5AA000532B31 /* ggh____UITests.m in Sources */, 333 | ); 334 | runOnlyForDeploymentPostprocessing = 0; 335 | }; 336 | /* End PBXSourcesBuildPhase section */ 337 | 338 | /* Begin PBXTargetDependency section */ 339 | CFA469601F1B5AA000532B31 /* PBXTargetDependency */ = { 340 | isa = PBXTargetDependency; 341 | target = CFA469441F1B5AA000532B31 /* ggh函数混淆 */; 342 | targetProxy = CFA4695F1F1B5AA000532B31 /* PBXContainerItemProxy */; 343 | }; 344 | CFA4696B1F1B5AA000532B31 /* PBXTargetDependency */ = { 345 | isa = PBXTargetDependency; 346 | target = CFA469441F1B5AA000532B31 /* ggh函数混淆 */; 347 | targetProxy = CFA4696A1F1B5AA000532B31 /* PBXContainerItemProxy */; 348 | }; 349 | /* End PBXTargetDependency section */ 350 | 351 | /* Begin PBXVariantGroup section */ 352 | CFA469511F1B5AA000532B31 /* Main.storyboard */ = { 353 | isa = PBXVariantGroup; 354 | children = ( 355 | CFA469521F1B5AA000532B31 /* Base */, 356 | ); 357 | name = Main.storyboard; 358 | sourceTree = ""; 359 | }; 360 | CFA469561F1B5AA000532B31 /* LaunchScreen.storyboard */ = { 361 | isa = PBXVariantGroup; 362 | children = ( 363 | CFA469571F1B5AA000532B31 /* Base */, 364 | ); 365 | name = LaunchScreen.storyboard; 366 | sourceTree = ""; 367 | }; 368 | /* End PBXVariantGroup section */ 369 | 370 | /* Begin XCBuildConfiguration section */ 371 | CFA469701F1B5AA000532B31 /* Debug */ = { 372 | isa = XCBuildConfiguration; 373 | buildSettings = { 374 | ALWAYS_SEARCH_USER_PATHS = NO; 375 | CLANG_ANALYZER_NONNULL = YES; 376 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 377 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 378 | CLANG_CXX_LIBRARY = "libc++"; 379 | CLANG_ENABLE_MODULES = YES; 380 | CLANG_ENABLE_OBJC_ARC = YES; 381 | CLANG_WARN_BOOL_CONVERSION = YES; 382 | CLANG_WARN_CONSTANT_CONVERSION = YES; 383 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 384 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 385 | CLANG_WARN_EMPTY_BODY = YES; 386 | CLANG_WARN_ENUM_CONVERSION = YES; 387 | CLANG_WARN_INFINITE_RECURSION = YES; 388 | CLANG_WARN_INT_CONVERSION = YES; 389 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 390 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 391 | CLANG_WARN_UNREACHABLE_CODE = YES; 392 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 393 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 394 | COPY_PHASE_STRIP = NO; 395 | DEBUG_INFORMATION_FORMAT = dwarf; 396 | ENABLE_STRICT_OBJC_MSGSEND = YES; 397 | ENABLE_TESTABILITY = YES; 398 | GCC_C_LANGUAGE_STANDARD = gnu99; 399 | GCC_DYNAMIC_NO_PIC = NO; 400 | GCC_NO_COMMON_BLOCKS = YES; 401 | GCC_OPTIMIZATION_LEVEL = 0; 402 | GCC_PREPROCESSOR_DEFINITIONS = ( 403 | "DEBUG=1", 404 | "$(inherited)", 405 | ); 406 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 407 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 408 | GCC_WARN_UNDECLARED_SELECTOR = YES; 409 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 410 | GCC_WARN_UNUSED_FUNCTION = YES; 411 | GCC_WARN_UNUSED_VARIABLE = YES; 412 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 413 | MTL_ENABLE_DEBUG_INFO = YES; 414 | ONLY_ACTIVE_ARCH = YES; 415 | SDKROOT = iphoneos; 416 | TARGETED_DEVICE_FAMILY = "1,2"; 417 | }; 418 | name = Debug; 419 | }; 420 | CFA469711F1B5AA000532B31 /* Release */ = { 421 | isa = XCBuildConfiguration; 422 | buildSettings = { 423 | ALWAYS_SEARCH_USER_PATHS = NO; 424 | CLANG_ANALYZER_NONNULL = YES; 425 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 426 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 427 | CLANG_CXX_LIBRARY = "libc++"; 428 | CLANG_ENABLE_MODULES = YES; 429 | CLANG_ENABLE_OBJC_ARC = YES; 430 | CLANG_WARN_BOOL_CONVERSION = YES; 431 | CLANG_WARN_CONSTANT_CONVERSION = YES; 432 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 433 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 434 | CLANG_WARN_EMPTY_BODY = YES; 435 | CLANG_WARN_ENUM_CONVERSION = YES; 436 | CLANG_WARN_INFINITE_RECURSION = YES; 437 | CLANG_WARN_INT_CONVERSION = YES; 438 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 439 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 440 | CLANG_WARN_UNREACHABLE_CODE = YES; 441 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 442 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 443 | COPY_PHASE_STRIP = NO; 444 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 445 | ENABLE_NS_ASSERTIONS = NO; 446 | ENABLE_STRICT_OBJC_MSGSEND = YES; 447 | GCC_C_LANGUAGE_STANDARD = gnu99; 448 | GCC_NO_COMMON_BLOCKS = YES; 449 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 450 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 451 | GCC_WARN_UNDECLARED_SELECTOR = YES; 452 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 453 | GCC_WARN_UNUSED_FUNCTION = YES; 454 | GCC_WARN_UNUSED_VARIABLE = YES; 455 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 456 | MTL_ENABLE_DEBUG_INFO = NO; 457 | SDKROOT = iphoneos; 458 | TARGETED_DEVICE_FAMILY = "1,2"; 459 | VALIDATE_PRODUCT = YES; 460 | }; 461 | name = Release; 462 | }; 463 | CFA469731F1B5AA000532B31 /* Debug */ = { 464 | isa = XCBuildConfiguration; 465 | buildSettings = { 466 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 467 | DEVELOPMENT_TEAM = 22DBSR3WQ7; 468 | INFOPLIST_FILE = "ggh函数混淆/Info.plist"; 469 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 470 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 471 | PRODUCT_BUNDLE_IDENTIFIER = "jc.ggh----"; 472 | PRODUCT_NAME = "$(TARGET_NAME)"; 473 | USER_HEADER_SEARCH_PATHS = "$PROJECT_DIR/Resource/PrefixHeader.pch/**"; 474 | }; 475 | name = Debug; 476 | }; 477 | CFA469741F1B5AA000532B31 /* Release */ = { 478 | isa = XCBuildConfiguration; 479 | buildSettings = { 480 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 481 | DEVELOPMENT_TEAM = 22DBSR3WQ7; 482 | INFOPLIST_FILE = "ggh函数混淆/Info.plist"; 483 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 484 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 485 | PRODUCT_BUNDLE_IDENTIFIER = "jc.ggh----"; 486 | PRODUCT_NAME = "$(TARGET_NAME)"; 487 | USER_HEADER_SEARCH_PATHS = "$PROJECT_DIR/Resource/PrefixHeader.pch/**"; 488 | }; 489 | name = Release; 490 | }; 491 | CFA469761F1B5AA000532B31 /* Debug */ = { 492 | isa = XCBuildConfiguration; 493 | buildSettings = { 494 | BUNDLE_LOADER = "$(TEST_HOST)"; 495 | INFOPLIST_FILE = "ggh函数混淆Tests/Info.plist"; 496 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 497 | PRODUCT_BUNDLE_IDENTIFIER = "jc.ggh----Tests"; 498 | PRODUCT_NAME = "$(TARGET_NAME)"; 499 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ggh函数混淆.app/ggh函数混淆"; 500 | }; 501 | name = Debug; 502 | }; 503 | CFA469771F1B5AA000532B31 /* Release */ = { 504 | isa = XCBuildConfiguration; 505 | buildSettings = { 506 | BUNDLE_LOADER = "$(TEST_HOST)"; 507 | INFOPLIST_FILE = "ggh函数混淆Tests/Info.plist"; 508 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 509 | PRODUCT_BUNDLE_IDENTIFIER = "jc.ggh----Tests"; 510 | PRODUCT_NAME = "$(TARGET_NAME)"; 511 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ggh函数混淆.app/ggh函数混淆"; 512 | }; 513 | name = Release; 514 | }; 515 | CFA469791F1B5AA000532B31 /* Debug */ = { 516 | isa = XCBuildConfiguration; 517 | buildSettings = { 518 | INFOPLIST_FILE = "ggh函数混淆UITests/Info.plist"; 519 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 520 | PRODUCT_BUNDLE_IDENTIFIER = "jc.ggh----UITests"; 521 | PRODUCT_NAME = "$(TARGET_NAME)"; 522 | TEST_TARGET_NAME = "ggh函数混淆"; 523 | }; 524 | name = Debug; 525 | }; 526 | CFA4697A1F1B5AA000532B31 /* Release */ = { 527 | isa = XCBuildConfiguration; 528 | buildSettings = { 529 | INFOPLIST_FILE = "ggh函数混淆UITests/Info.plist"; 530 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 531 | PRODUCT_BUNDLE_IDENTIFIER = "jc.ggh----UITests"; 532 | PRODUCT_NAME = "$(TARGET_NAME)"; 533 | TEST_TARGET_NAME = "ggh函数混淆"; 534 | }; 535 | name = Release; 536 | }; 537 | /* End XCBuildConfiguration section */ 538 | 539 | /* Begin XCConfigurationList section */ 540 | CFA469401F1B5AA000532B31 /* Build configuration list for PBXProject "ggh函数混淆" */ = { 541 | isa = XCConfigurationList; 542 | buildConfigurations = ( 543 | CFA469701F1B5AA000532B31 /* Debug */, 544 | CFA469711F1B5AA000532B31 /* Release */, 545 | ); 546 | defaultConfigurationIsVisible = 0; 547 | defaultConfigurationName = Release; 548 | }; 549 | CFA469721F1B5AA000532B31 /* Build configuration list for PBXNativeTarget "ggh函数混淆" */ = { 550 | isa = XCConfigurationList; 551 | buildConfigurations = ( 552 | CFA469731F1B5AA000532B31 /* Debug */, 553 | CFA469741F1B5AA000532B31 /* Release */, 554 | ); 555 | defaultConfigurationIsVisible = 0; 556 | }; 557 | CFA469751F1B5AA000532B31 /* Build configuration list for PBXNativeTarget "ggh函数混淆Tests" */ = { 558 | isa = XCConfigurationList; 559 | buildConfigurations = ( 560 | CFA469761F1B5AA000532B31 /* Debug */, 561 | CFA469771F1B5AA000532B31 /* Release */, 562 | ); 563 | defaultConfigurationIsVisible = 0; 564 | }; 565 | CFA469781F1B5AA000532B31 /* Build configuration list for PBXNativeTarget "ggh函数混淆UITests" */ = { 566 | isa = XCConfigurationList; 567 | buildConfigurations = ( 568 | CFA469791F1B5AA000532B31 /* Debug */, 569 | CFA4697A1F1B5AA000532B31 /* Release */, 570 | ); 571 | defaultConfigurationIsVisible = 0; 572 | }; 573 | /* End XCConfigurationList section */ 574 | }; 575 | rootObject = CFA4693D1F1B5AA000532B31 /* Project object */; 576 | } 577 | -------------------------------------------------------------------------------- /iOS应用防护/ggh函数混淆/ggh函数混淆.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /iOS应用防护/ggh函数混淆/ggh函数混淆.xcodeproj/project.xcworkspace/xcuserdata/guogh.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guogh/iOSApplicationReinforcement/8c4664f5eaf0929b9d1a36f74c87691af80512ca/iOS应用防护/ggh函数混淆/ggh函数混淆.xcodeproj/project.xcworkspace/xcuserdata/guogh.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /iOS应用防护/ggh函数混淆/ggh函数混淆.xcodeproj/xcuserdata/guogh.xcuserdatad/xcschemes/ggh函数混淆.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /iOS应用防护/ggh函数混淆/ggh函数混淆.xcodeproj/xcuserdata/guogh.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ggh函数混淆.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | CFA469441F1B5AA000532B31 16 | 17 | primary 18 | 19 | 20 | CFA4695D1F1B5AA000532B31 21 | 22 | primary 23 | 24 | 25 | CFA469681F1B5AA000532B31 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /iOS应用防护/ggh函数混淆/ggh函数混淆/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // ggh函数混淆 4 | // 5 | // Created by guogh on 2017/7/16. 6 | // Copyright © 2017年 郭滚华. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /iOS应用防护/ggh函数混淆/ggh函数混淆/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // ggh函数混淆 4 | // 5 | // Created by guogh on 2017/7/16. 6 | // Copyright © 2017年 郭滚华. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // 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. 26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 27 | } 28 | 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // 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. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // 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. 38 | } 39 | 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // 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. 43 | } 44 | 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /iOS应用防护/ggh函数混淆/ggh函数混淆/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /iOS应用防护/ggh函数混淆/ggh函数混淆/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 | 27 | 28 | -------------------------------------------------------------------------------- /iOS应用防护/ggh函数混淆/ggh函数混淆/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 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /iOS应用防护/ggh函数混淆/ggh函数混淆/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 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 | -------------------------------------------------------------------------------- /iOS应用防护/ggh函数混淆/ggh函数混淆/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // ggh函数混淆 4 | // 5 | // Created by guogh on 2017/7/16. 6 | // Copyright © 2017年 郭滚华. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /iOS应用防护/ggh函数混淆/ggh函数混淆/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // ggh函数混淆 4 | // 5 | // Created by guogh on 2017/7/16. 6 | // Copyright © 2017年 郭滚华. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "codeObfuscation.h" 11 | 12 | @interface ViewController () 13 | 14 | @end 15 | 16 | @implementation ViewController 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | 21 | [self ggh_func1]; 22 | } 23 | 24 | 25 | -(void)ggh_func1{ 26 | [self ggh_func2]; 27 | } 28 | 29 | -(void)ggh_func2{ 30 | [self ggh_func3]; 31 | } 32 | 33 | -(void)ggh_func3{ 34 | [self ggh_func4]; 35 | } 36 | 37 | -(void)ggh_func4{ 38 | NSLog(@"hello world!"); 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /iOS应用防护/ggh函数混淆/ggh函数混淆/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // ggh函数混淆 4 | // 5 | // Created by guogh on 2017/7/16. 6 | // Copyright © 2017年 郭滚华. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /iOS应用防护/ggh函数混淆/ggh函数混淆Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /iOS应用防护/ggh函数混淆/ggh函数混淆Tests/ggh____Tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ggh____Tests.m 3 | // ggh函数混淆Tests 4 | // 5 | // Created by guogh on 2017/7/16. 6 | // Copyright © 2017年 郭滚华. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ggh____Tests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation ggh____Tests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /iOS应用防护/ggh函数混淆/ggh函数混淆UITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /iOS应用防护/ggh函数混淆/ggh函数混淆UITests/ggh____UITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ggh____UITests.m 3 | // ggh函数混淆UITests 4 | // 5 | // Created by guogh on 2017/7/16. 6 | // Copyright © 2017年 郭滚华. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ggh____UITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation ggh____UITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /iOS应用防护/ggh函数混淆/symbols: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guogh/iOSApplicationReinforcement/8c4664f5eaf0929b9d1a36f74c87691af80512ca/iOS应用防护/ggh函数混淆/symbols -------------------------------------------------------------------------------- /iOS应用防护/iOS应用防护.md: -------------------------------------------------------------------------------- 1 | ### 前提 2 | 众所周知,iOS系统安全性非常高,很少出现漏洞,几乎不会中毒。大家认为苹果系统的封闭性会使iOS APP安全性比较高,但是实际上iOS应用本身被破解的难度并不高,一旦在越狱设备上,ipa被分析就会变得很容易。对于iOS开发者来说,有必要了解一些APP加固的方法,用以提高破解的难度,特别是针对一些金融、游戏类APP的开发。 3 | ##### iOS代码保护 4 | 在大多数iOS应用中,一些工具,比如Clutch,class-dump,cycript,lldb,theos.对应用程序的结构,代码逻辑,运行流程,可以做到很容易的分析。然后进行应用的破解,篡改,重签名。可以从逆向分析的方式做代码保护的思路: 5 | 6 | - 1.静态分析:针对这种情况可以把字符串加密,类名方法名混淆,代码混淆 7 | - 2.调试 :反调试 8 | - 3.注入 :反注入 9 | - 4.中间人攻击 :https, 证书验证, 数据加密 10 | 11 | ### 一,静态分析 12 | 静态分析是指用工具对程序结构,代码逻辑的分析。很大程度上取决关键字,通过关键字找到敏感代码,进行破解。所以静态分析的防护主要是代码混淆。 13 | #### 1,混淆硬编码的明文字符串 14 | 明文字符串可直接在二进制包搜索到,常常是作为逆向分析的切入口,隐藏明文字符串可有效提升静态分析的难度。在源代码中将字符串加密,运行时先解密在使用,如果直接在代码中写加密后字符串,代码的可读性会变得非常差。网上又一个方法不是很优雅,但有效,私以为不错: 15 | 16 | - 将源代码中的字符串通过函数宏手动标记 17 | - 打包的时候拷贝源代码副本 18 | - 执行脚本,将副本代码中所有标记过的字符串,替换成decrypt("密文")的形式 19 | - 在适当的位置,插入decrypt函数的实现(或者事先在源代码中写好) 20 | - 编译 21 | 22 | 通过函数宏手动标记字符串: 23 | ![](字符串混淆前的代码.png) 24 | 25 | 执行加密脚本后 26 | ![](字符串混淆后的代码.png) 27 | 这里的加密仅仅是做了一个简单的异或运算,解密函数内联编译到代码中。 28 | 29 | ![](字符串混淆前反汇编.png) 30 | 上图是未做混淆前的反汇编代码,可以直接看到明文字符串。 31 | 下面是经过混淆的反汇编代码,已经看不到明文字符串了。 32 | ![](字符串混淆后反汇编.png) 33 | 34 | #### 2,objective C代码混淆 35 | 网上方法较多,其中尤以念茜大神的方法为佳。大抵是在编译前执行混淆脚本,对OC函数(消息)进行混淆。但是又不能全部混淆,有一些是SDK的代理回掉,如tableView的UITableViewDataSource,混淆后将不会调用,如继承子类的init,混淆后也不会调用。解决办法有很多,这里介绍两个匹配的办法: 36 | 37 | - 1,建立一个索引文件,将需要混淆的函数写入索引文件,混淆脚本读取索引文件的函数名进行匹配。 38 | - 2,在代码中以前缀或后缀的方式标识需要混淆的函数,混淆脚本通过这些标识进行自动混淆。 39 | 40 | 匹配函数名后,将混淆过的函数写入数据库中记录下来,以便在后续在分析app Crash的时候找对应的函数,快速定位到对应的代码. 41 | 为混淆的二进制包,可以直接看到代码中的函数名,逆向者以此猜测程序功能,快速切入。 42 | ![](未混淆前.png) 43 | 44 | 混淆脚本设置 45 | ![](混淆脚本设置.png) 46 | 47 | 混淆后的代码,无法通过函数名猜测到程序功能,可大大增加逆向难度。 48 | ![](混淆后.png) 49 | 代码混淆除了函数名的混淆,还有类名,协议名,文件名的混淆等。此外,敏感代码可以用C函数来实现,可以避免在class-dump等工具中倒出,但是在nm等工具中还是可以看到一些符号表的信息。 50 | 51 | ###### 小结,静态分析的防护手段主要是作代码的混淆,已到达提升逆向的难度。此外还有代码逻辑的混淆,通过在代码中加入大量无用的逻辑判断,增加程序结构的复杂性,以此提升程序在ida,hopper等工具分析中的难度。但是此方法对源代码的改动性较大,识代码的可读性变得极差。 52 | 53 | ### 二,动态分析 反调试 54 | 逆向者不仅可以静态分析程序,也可以通过debugserver,lldb等工具动态分析程序,通过在程序中打断点,修改内存中的变量等方式分析,改变程序的行为。以为达到分析,hoock程序的目的。 55 | #### 1,反调试之 ptrace 56 | 谈到debug,首先会想到的一个系统调用是ptrace,它主要用于实现断点调试和系统调用跟踪。 PT_DENY_ATTACH是苹果增加的一个ptrace选项,用以防止gdb等调试器依附到某进程。代码如下: 57 | 58 | ``` 59 | #ifndef PT_DENY_ATTACH 60 | #define PT_DENY_ATTACH 31 61 | #endif 62 | 63 | typedef int (*ptrace_ptr_t)(int _request, pid_t _pid, caddr_t _addr, int _data); 64 | 65 | @implementation ViewController 66 | 67 | - (void)viewDidLoad { 68 | [super viewDidLoad]; 69 | 70 | 71 | void *handle = dlopen(0, RTLD_GLOBAL | RTLD_NOW); 72 | ptrace_ptr_t ptrace_ptr = (ptrace_ptr_t)dlsym(handle, "ptrace"); 73 | ptrace_ptr(PT_DENY_ATTACH, 0, 0, 0); 74 | 75 | } 76 | ``` 77 | 手边没有越狱机器,直接通过xcode debug,应用会Crash掉,安装到手机后可正常打开。 78 | 针对这种ptrace的反反调试方法其实很简单,通过下断点,然后修改ptrace的参数或者用hook函数去掉反调试保护就可以搞定。也可在程序多个处调用来增加crash 79 | 80 | #### 2,反调试之 sysctl 81 | 思路是通过sysctl查看信息进程里的标记,判断自己是否正在被调试。sysctl是用以查询内核状态的接口,并允许具备相应权限的进程设置内核状态。其定义如下: 82 | 83 | ``` 84 | int sysctl(int *name, u_int namelen, void *old, size_t *oldlen, void *newp, size_t newlen); 85 | name参数是一个用以指定查询的信息数组; 86 | namelen用以指定name数组的元素个数; 87 | old是用以函数返回的缓冲区; 88 | oldlen用以指定oldp缓冲区长度; 89 | newp和newlen在设置时使用; 90 | 当进程被调试器依附时,kinfo_proc结构下有一个kp_proc结构域,kp_proc的p_flag的被调试标识将被设置,即会进行类似如下的设置: 91 | kinfo_proc. kp_proc. p_flag & P_TRACED 92 | 其中P_TRACED的定义如下: 93 | #define P_TRACED 0x00000800 /* Debugged process being traced */ 94 | ``` 95 | 我们可以通过sysctl查询进程相应的kinfo_proc信息,查询函数的实现可以这样: 96 | 97 | ``` 98 | static int is_debugged() __attribute__((always_inline)); 99 | 100 | @implementation ViewController 101 | 102 | 103 | - (void)viewDidLoad { 104 | [super viewDidLoad]; 105 | 106 | if (is_debugged() == YES) { 107 | self.label.text = @"is_debugged "; 108 | exit(-1); 109 | }else{ 110 | self.label.text = @"not is_debugged"; 111 | } 112 | 113 | } 114 | 115 | static int is_debugged(){ 116 | int name[4] = {CTL_KERN,KERN_PROC,KERN_PROC_PID,getpid()}; 117 | struct kinfo_proc Kproc; 118 | size_t kproc_size = sizeof(Kproc); 119 | 120 | memset((void*)&Kproc, 0, kproc_size); 121 | 122 | if (sysctl(name, 4, &Kproc, &kproc_size, NULL, 0) == -1) { 123 | perror("sysctl error \n "); 124 | exit(-1); 125 | } 126 | 127 | return (Kproc.kp_proc.p_flag & P_TRACED) ? 1 : 0; 128 | } 129 | 130 | ``` 131 | 针对sysctl的反反调试的思路其实很简单,只需要在函数返回时清除p_flag标识位即可,根据sysctl.h文件中的定义: 132 | 133 | ``` 134 | #define CTL_KERN 1 135 | #define KERN_PROC 14 136 | #define KERN_PROC_PID 1 137 | ``` 138 | 以及sysctl的第二个参数为4,对sysctl下条件断点,在sysctl返回后,根据反编译二进制文件找到kproc的首地址,接下来找到p_flag相对kproc首地址的偏移,最后修改对应内存地址的值就OK了。 139 | 140 | ###### 动态分析的防护还有很多,如:dylib注入检测,越狱检测等。当然,也有响应的发发调试手段。 141 | 142 | ### 三,总结 143 | 总体来说,iOS系统安全性是很高的,且大多数iOS应用都没做混淆,反调试等。对于金融类,游戏类的应用防护套路来一点还是能增加逆向破解的难度的。当然,要完全防止程序被调试或者被逆向,理论上来说是不可能的。 144 | 145 | ##### 参考文章 146 | [iOS App的加固保护原理](http://www.cocoachina.com/ios/20170324/18955.html) http://www.cocoachina.com/ios/20170324/18955.html 147 | [念茜的博客 iOS安全攻防(二十四):敏感逻辑的保护方案(1)](http://blog.csdn.net/yiyaaixuexi/article/details/29210413) http://blog.csdn.net/yiyaaixuexi/article/details/29210413 148 | [iOS代码混淆](http://xelz.info/blog/2016/11/20/ios-code-obfuscation/) http://xelz.info/blog/2016/11/20/ios-code-obfuscation/ 149 | [对 iOS app 进行安全加固](https://danleechina.github.io/ios-app-security-reinforce/) https://danleechina.github.io/ios-app-security-reinforce/ 150 | [iOS代码混淆----自动](http://www.jianshu.com/p/0d42e5c6361c) http://www.jianshu.com/p/0d42e5c6361c 151 | [阿里 iOS Anti-Debug](https://jaq.alibaba.com/blog.htm?id=53) https://jaq.alibaba.com/blog.htm?id=53 152 | [关于反调试&反反调试那些事](http://bbs.iosre.com/t/topic/8179) http://bbs.iosre.com/t/topic/8179 153 | [看雪论坛 iOS加固浅谈之字符串加密](http://bbs.pediy.com/thread-217991.htm) http://bbs.pediy.com/thread-217991.htm 154 | -------------------------------------------------------------------------------- /iOS应用防护/obfuscate.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # 本脚本用于对源代码中的字符串进行加密 4 | # 1. 在源代码中插入解密函数decryptConstString 5 | # 2. 插入宏,替换所有的NSSTRING(...)和CSTRING(...)为decryptConstString(encrypted_string) 6 | # 3. 替换所有字符串常量为加密的char数组,形式((char[]){1, 2, 3, 0}) 7 | 8 | import sys 9 | import re 10 | import os 11 | 12 | # 插入宏和解密函数,解密方法:每个字节与0xAA异或 13 | insert_code = '''#define STRING_OBFUSCATE 14 | 15 | static char* decryptConstString(char* string) __attribute__((always_inline)); 16 | 17 | #define NSSTRING(string) [NSString stringWithUTF8String:decryptConstString(string)] 18 | #define CSTRING(string) decryptConstString(string) 19 | 20 | static char* decryptConstString(char* string) 21 | { 22 | char* origin_string = string; 23 | while(*string) { 24 | *string ^= 0xAA; 25 | string++; 26 | } 27 | return origin_string; 28 | } 29 | 30 | #ifndef STRING_OBFUSCATE''' 31 | 32 | # 替换字符串为((char[]){1, 2, 3, 0})的形式,同时让每个字节与0xAA异或进行加密 33 | def replace(match): 34 | # print match.group() 35 | string = match.group(2) + '\x00' 36 | 37 | replaced_string = '((char []) {' + ', '.join(["%i" % ((ord(c) ^ 0xAA) if c != '\0' else 0) for c in list(string)]) + '})' 38 | # print replaced_string 39 | return match.group(1) + replaced_string + match.group(3) 40 | 41 | # 修改源代码,加入字符串加密的函数 42 | def obfuscate(file): 43 | with open(file, 'r') as f: 44 | code = f.read() 45 | f.close() 46 | code = re.sub(r'(NSSTRING\(|CSTRING\()"(.*?)"(\))', replace, code) 47 | code = code.replace('#ifndef STRING_OBFUSCATE', insert_code) 48 | # print code 49 | with open(file, 'w') as f: 50 | f.write(code) 51 | f.close() 52 | 53 | if __name__ == '__main__': 54 | if len(sys.argv) == 2 and os.path.exists(sys.argv[1]): 55 | obfuscate(sys.argv[1]) 56 | else: 57 | sys.exit() -------------------------------------------------------------------------------- /iOS应用防护/obfuscate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 本脚本用于对源代码中的函数名及全局变量名进行混淆,生成映射文件 3 | 4 | # usage: rand a b 5 | # 生成[a, b)之间的随机数 6 | function rand(){ 7 | min=$1 8 | max=$(($2-$min)) 9 | num=$(($RANDOM+1000000000)) 10 | echo $(($num%$max+$min)) 11 | } 12 | 13 | # 生成随机字符 14 | function rand_c() { 15 | base="qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM_$" 16 | echo ${base:$(rand 0 54):1} 17 | } 18 | 19 | # 生成16-32长度的随机变量名 20 | function rand_s() { 21 | symbol="" 22 | for i in $(seq $(rand 16 33)); do 23 | symbol=$symbol$(rand_c) 24 | done 25 | echo $symbol 26 | } 27 | 28 | file=$2 29 | src=$1 30 | 31 | # 生成文件头,注释 32 | cat > $file << EOF 33 | // 34 | // $file 35 | // 36 | 37 | /* 38 | * This is the symbol substitution mapping file. 39 | * Auto-generated by $0, from the source file $src. 40 | * You can change the value of macro defination freely, but DO NOT DELETE any of them. 41 | */ 42 | 43 | EOF 44 | 45 | # 提取源文件中所有的SYMBOL(_xxx)宏,并生成随机标识符 46 | cat $src | sed -n "s/.*SYMBOL(\(_.*\)).*/\1/p" | while read symbol 47 | do 48 | rand_symbol=`rand_s` 49 | echo -e "\033[32m$symbol\033[m -> \033[33m$rand_symbol\033[m" 50 | echo "#define $symbol \"$rand_symbol\"" >> $file 51 | done 52 | 53 | exit -------------------------------------------------------------------------------- /iOS应用防护/securityDome1/securityDome1.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | CFB872A71F19E46F00226B35 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CFB872A61F19E46F00226B35 /* main.m */; }; 11 | CFB872AA1F19E46F00226B35 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CFB872A91F19E46F00226B35 /* AppDelegate.m */; }; 12 | CFB872AD1F19E46F00226B35 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CFB872AC1F19E46F00226B35 /* ViewController.m */; }; 13 | CFB872B01F19E46F00226B35 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CFB872AE1F19E46F00226B35 /* Main.storyboard */; }; 14 | CFB872B21F19E46F00226B35 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CFB872B11F19E46F00226B35 /* Assets.xcassets */; }; 15 | CFB872B51F19E46F00226B35 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CFB872B31F19E46F00226B35 /* LaunchScreen.storyboard */; }; 16 | CFB872C01F19E46F00226B35 /* securityDome1Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = CFB872BF1F19E46F00226B35 /* securityDome1Tests.m */; }; 17 | CFB872CB1F19E47000226B35 /* securityDome1UITests.m in Sources */ = {isa = PBXBuildFile; fileRef = CFB872CA1F19E47000226B35 /* securityDome1UITests.m */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXContainerItemProxy section */ 21 | CFB872BC1F19E46F00226B35 /* PBXContainerItemProxy */ = { 22 | isa = PBXContainerItemProxy; 23 | containerPortal = CFB8729A1F19E46F00226B35 /* Project object */; 24 | proxyType = 1; 25 | remoteGlobalIDString = CFB872A11F19E46F00226B35; 26 | remoteInfo = securityDome1; 27 | }; 28 | CFB872C71F19E47000226B35 /* PBXContainerItemProxy */ = { 29 | isa = PBXContainerItemProxy; 30 | containerPortal = CFB8729A1F19E46F00226B35 /* Project object */; 31 | proxyType = 1; 32 | remoteGlobalIDString = CFB872A11F19E46F00226B35; 33 | remoteInfo = securityDome1; 34 | }; 35 | /* End PBXContainerItemProxy section */ 36 | 37 | /* Begin PBXFileReference section */ 38 | CFB872A21F19E46F00226B35 /* securityDome1.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = securityDome1.app; sourceTree = BUILT_PRODUCTS_DIR; }; 39 | CFB872A61F19E46F00226B35 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 40 | CFB872A81F19E46F00226B35 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 41 | CFB872A91F19E46F00226B35 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 42 | CFB872AB1F19E46F00226B35 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 43 | CFB872AC1F19E46F00226B35 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 44 | CFB872AF1F19E46F00226B35 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 45 | CFB872B11F19E46F00226B35 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 46 | CFB872B41F19E46F00226B35 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 47 | CFB872B61F19E46F00226B35 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 48 | CFB872BB1F19E46F00226B35 /* securityDome1Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = securityDome1Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 49 | CFB872BF1F19E46F00226B35 /* securityDome1Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = securityDome1Tests.m; sourceTree = ""; }; 50 | CFB872C11F19E46F00226B35 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 51 | CFB872C61F19E47000226B35 /* securityDome1UITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = securityDome1UITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 52 | CFB872CA1F19E47000226B35 /* securityDome1UITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = securityDome1UITests.m; sourceTree = ""; }; 53 | CFB872CC1F19E47000226B35 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 54 | /* End PBXFileReference section */ 55 | 56 | /* Begin PBXFrameworksBuildPhase section */ 57 | CFB8729F1F19E46F00226B35 /* Frameworks */ = { 58 | isa = PBXFrameworksBuildPhase; 59 | buildActionMask = 2147483647; 60 | files = ( 61 | ); 62 | runOnlyForDeploymentPostprocessing = 0; 63 | }; 64 | CFB872B81F19E46F00226B35 /* Frameworks */ = { 65 | isa = PBXFrameworksBuildPhase; 66 | buildActionMask = 2147483647; 67 | files = ( 68 | ); 69 | runOnlyForDeploymentPostprocessing = 0; 70 | }; 71 | CFB872C31F19E46F00226B35 /* Frameworks */ = { 72 | isa = PBXFrameworksBuildPhase; 73 | buildActionMask = 2147483647; 74 | files = ( 75 | ); 76 | runOnlyForDeploymentPostprocessing = 0; 77 | }; 78 | /* End PBXFrameworksBuildPhase section */ 79 | 80 | /* Begin PBXGroup section */ 81 | CFB872991F19E46F00226B35 = { 82 | isa = PBXGroup; 83 | children = ( 84 | CFB872A41F19E46F00226B35 /* securityDome1 */, 85 | CFB872BE1F19E46F00226B35 /* securityDome1Tests */, 86 | CFB872C91F19E47000226B35 /* securityDome1UITests */, 87 | CFB872A31F19E46F00226B35 /* Products */, 88 | ); 89 | sourceTree = ""; 90 | }; 91 | CFB872A31F19E46F00226B35 /* Products */ = { 92 | isa = PBXGroup; 93 | children = ( 94 | CFB872A21F19E46F00226B35 /* securityDome1.app */, 95 | CFB872BB1F19E46F00226B35 /* securityDome1Tests.xctest */, 96 | CFB872C61F19E47000226B35 /* securityDome1UITests.xctest */, 97 | ); 98 | name = Products; 99 | sourceTree = ""; 100 | }; 101 | CFB872A41F19E46F00226B35 /* securityDome1 */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | CFB872A81F19E46F00226B35 /* AppDelegate.h */, 105 | CFB872A91F19E46F00226B35 /* AppDelegate.m */, 106 | CFB872AB1F19E46F00226B35 /* ViewController.h */, 107 | CFB872AC1F19E46F00226B35 /* ViewController.m */, 108 | CFB872AE1F19E46F00226B35 /* Main.storyboard */, 109 | CFB872B11F19E46F00226B35 /* Assets.xcassets */, 110 | CFB872B31F19E46F00226B35 /* LaunchScreen.storyboard */, 111 | CFB872B61F19E46F00226B35 /* Info.plist */, 112 | CFB872A51F19E46F00226B35 /* Supporting Files */, 113 | ); 114 | path = securityDome1; 115 | sourceTree = ""; 116 | }; 117 | CFB872A51F19E46F00226B35 /* Supporting Files */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | CFB872A61F19E46F00226B35 /* main.m */, 121 | ); 122 | name = "Supporting Files"; 123 | sourceTree = ""; 124 | }; 125 | CFB872BE1F19E46F00226B35 /* securityDome1Tests */ = { 126 | isa = PBXGroup; 127 | children = ( 128 | CFB872BF1F19E46F00226B35 /* securityDome1Tests.m */, 129 | CFB872C11F19E46F00226B35 /* Info.plist */, 130 | ); 131 | path = securityDome1Tests; 132 | sourceTree = ""; 133 | }; 134 | CFB872C91F19E47000226B35 /* securityDome1UITests */ = { 135 | isa = PBXGroup; 136 | children = ( 137 | CFB872CA1F19E47000226B35 /* securityDome1UITests.m */, 138 | CFB872CC1F19E47000226B35 /* Info.plist */, 139 | ); 140 | path = securityDome1UITests; 141 | sourceTree = ""; 142 | }; 143 | /* End PBXGroup section */ 144 | 145 | /* Begin PBXNativeTarget section */ 146 | CFB872A11F19E46F00226B35 /* securityDome1 */ = { 147 | isa = PBXNativeTarget; 148 | buildConfigurationList = CFB872CF1F19E47000226B35 /* Build configuration list for PBXNativeTarget "securityDome1" */; 149 | buildPhases = ( 150 | CFB8729E1F19E46F00226B35 /* Sources */, 151 | CFB8729F1F19E46F00226B35 /* Frameworks */, 152 | CFB872A01F19E46F00226B35 /* Resources */, 153 | ); 154 | buildRules = ( 155 | ); 156 | dependencies = ( 157 | ); 158 | name = securityDome1; 159 | productName = securityDome1; 160 | productReference = CFB872A21F19E46F00226B35 /* securityDome1.app */; 161 | productType = "com.apple.product-type.application"; 162 | }; 163 | CFB872BA1F19E46F00226B35 /* securityDome1Tests */ = { 164 | isa = PBXNativeTarget; 165 | buildConfigurationList = CFB872D21F19E47000226B35 /* Build configuration list for PBXNativeTarget "securityDome1Tests" */; 166 | buildPhases = ( 167 | CFB872B71F19E46F00226B35 /* Sources */, 168 | CFB872B81F19E46F00226B35 /* Frameworks */, 169 | CFB872B91F19E46F00226B35 /* Resources */, 170 | ); 171 | buildRules = ( 172 | ); 173 | dependencies = ( 174 | CFB872BD1F19E46F00226B35 /* PBXTargetDependency */, 175 | ); 176 | name = securityDome1Tests; 177 | productName = securityDome1Tests; 178 | productReference = CFB872BB1F19E46F00226B35 /* securityDome1Tests.xctest */; 179 | productType = "com.apple.product-type.bundle.unit-test"; 180 | }; 181 | CFB872C51F19E46F00226B35 /* securityDome1UITests */ = { 182 | isa = PBXNativeTarget; 183 | buildConfigurationList = CFB872D51F19E47000226B35 /* Build configuration list for PBXNativeTarget "securityDome1UITests" */; 184 | buildPhases = ( 185 | CFB872C21F19E46F00226B35 /* Sources */, 186 | CFB872C31F19E46F00226B35 /* Frameworks */, 187 | CFB872C41F19E46F00226B35 /* Resources */, 188 | ); 189 | buildRules = ( 190 | ); 191 | dependencies = ( 192 | CFB872C81F19E47000226B35 /* PBXTargetDependency */, 193 | ); 194 | name = securityDome1UITests; 195 | productName = securityDome1UITests; 196 | productReference = CFB872C61F19E47000226B35 /* securityDome1UITests.xctest */; 197 | productType = "com.apple.product-type.bundle.ui-testing"; 198 | }; 199 | /* End PBXNativeTarget section */ 200 | 201 | /* Begin PBXProject section */ 202 | CFB8729A1F19E46F00226B35 /* Project object */ = { 203 | isa = PBXProject; 204 | attributes = { 205 | LastUpgradeCheck = 0830; 206 | ORGANIZATIONNAME = "郭滚华"; 207 | TargetAttributes = { 208 | CFB872A11F19E46F00226B35 = { 209 | CreatedOnToolsVersion = 8.3.3; 210 | DevelopmentTeam = 22DBSR3WQ7; 211 | ProvisioningStyle = Automatic; 212 | }; 213 | CFB872BA1F19E46F00226B35 = { 214 | CreatedOnToolsVersion = 8.3.3; 215 | ProvisioningStyle = Automatic; 216 | TestTargetID = CFB872A11F19E46F00226B35; 217 | }; 218 | CFB872C51F19E46F00226B35 = { 219 | CreatedOnToolsVersion = 8.3.3; 220 | ProvisioningStyle = Automatic; 221 | TestTargetID = CFB872A11F19E46F00226B35; 222 | }; 223 | }; 224 | }; 225 | buildConfigurationList = CFB8729D1F19E46F00226B35 /* Build configuration list for PBXProject "securityDome1" */; 226 | compatibilityVersion = "Xcode 3.2"; 227 | developmentRegion = English; 228 | hasScannedForEncodings = 0; 229 | knownRegions = ( 230 | en, 231 | Base, 232 | ); 233 | mainGroup = CFB872991F19E46F00226B35; 234 | productRefGroup = CFB872A31F19E46F00226B35 /* Products */; 235 | projectDirPath = ""; 236 | projectRoot = ""; 237 | targets = ( 238 | CFB872A11F19E46F00226B35 /* securityDome1 */, 239 | CFB872BA1F19E46F00226B35 /* securityDome1Tests */, 240 | CFB872C51F19E46F00226B35 /* securityDome1UITests */, 241 | ); 242 | }; 243 | /* End PBXProject section */ 244 | 245 | /* Begin PBXResourcesBuildPhase section */ 246 | CFB872A01F19E46F00226B35 /* Resources */ = { 247 | isa = PBXResourcesBuildPhase; 248 | buildActionMask = 2147483647; 249 | files = ( 250 | CFB872B51F19E46F00226B35 /* LaunchScreen.storyboard in Resources */, 251 | CFB872B21F19E46F00226B35 /* Assets.xcassets in Resources */, 252 | CFB872B01F19E46F00226B35 /* Main.storyboard in Resources */, 253 | ); 254 | runOnlyForDeploymentPostprocessing = 0; 255 | }; 256 | CFB872B91F19E46F00226B35 /* Resources */ = { 257 | isa = PBXResourcesBuildPhase; 258 | buildActionMask = 2147483647; 259 | files = ( 260 | ); 261 | runOnlyForDeploymentPostprocessing = 0; 262 | }; 263 | CFB872C41F19E46F00226B35 /* Resources */ = { 264 | isa = PBXResourcesBuildPhase; 265 | buildActionMask = 2147483647; 266 | files = ( 267 | ); 268 | runOnlyForDeploymentPostprocessing = 0; 269 | }; 270 | /* End PBXResourcesBuildPhase section */ 271 | 272 | /* Begin PBXSourcesBuildPhase section */ 273 | CFB8729E1F19E46F00226B35 /* Sources */ = { 274 | isa = PBXSourcesBuildPhase; 275 | buildActionMask = 2147483647; 276 | files = ( 277 | CFB872AD1F19E46F00226B35 /* ViewController.m in Sources */, 278 | CFB872AA1F19E46F00226B35 /* AppDelegate.m in Sources */, 279 | CFB872A71F19E46F00226B35 /* main.m in Sources */, 280 | ); 281 | runOnlyForDeploymentPostprocessing = 0; 282 | }; 283 | CFB872B71F19E46F00226B35 /* Sources */ = { 284 | isa = PBXSourcesBuildPhase; 285 | buildActionMask = 2147483647; 286 | files = ( 287 | CFB872C01F19E46F00226B35 /* securityDome1Tests.m in Sources */, 288 | ); 289 | runOnlyForDeploymentPostprocessing = 0; 290 | }; 291 | CFB872C21F19E46F00226B35 /* Sources */ = { 292 | isa = PBXSourcesBuildPhase; 293 | buildActionMask = 2147483647; 294 | files = ( 295 | CFB872CB1F19E47000226B35 /* securityDome1UITests.m in Sources */, 296 | ); 297 | runOnlyForDeploymentPostprocessing = 0; 298 | }; 299 | /* End PBXSourcesBuildPhase section */ 300 | 301 | /* Begin PBXTargetDependency section */ 302 | CFB872BD1F19E46F00226B35 /* PBXTargetDependency */ = { 303 | isa = PBXTargetDependency; 304 | target = CFB872A11F19E46F00226B35 /* securityDome1 */; 305 | targetProxy = CFB872BC1F19E46F00226B35 /* PBXContainerItemProxy */; 306 | }; 307 | CFB872C81F19E47000226B35 /* PBXTargetDependency */ = { 308 | isa = PBXTargetDependency; 309 | target = CFB872A11F19E46F00226B35 /* securityDome1 */; 310 | targetProxy = CFB872C71F19E47000226B35 /* PBXContainerItemProxy */; 311 | }; 312 | /* End PBXTargetDependency section */ 313 | 314 | /* Begin PBXVariantGroup section */ 315 | CFB872AE1F19E46F00226B35 /* Main.storyboard */ = { 316 | isa = PBXVariantGroup; 317 | children = ( 318 | CFB872AF1F19E46F00226B35 /* Base */, 319 | ); 320 | name = Main.storyboard; 321 | sourceTree = ""; 322 | }; 323 | CFB872B31F19E46F00226B35 /* LaunchScreen.storyboard */ = { 324 | isa = PBXVariantGroup; 325 | children = ( 326 | CFB872B41F19E46F00226B35 /* Base */, 327 | ); 328 | name = LaunchScreen.storyboard; 329 | sourceTree = ""; 330 | }; 331 | /* End PBXVariantGroup section */ 332 | 333 | /* Begin XCBuildConfiguration section */ 334 | CFB872CD1F19E47000226B35 /* Debug */ = { 335 | isa = XCBuildConfiguration; 336 | buildSettings = { 337 | ALWAYS_SEARCH_USER_PATHS = NO; 338 | CLANG_ANALYZER_NONNULL = YES; 339 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 340 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 341 | CLANG_CXX_LIBRARY = "libc++"; 342 | CLANG_ENABLE_MODULES = YES; 343 | CLANG_ENABLE_OBJC_ARC = YES; 344 | CLANG_WARN_BOOL_CONVERSION = YES; 345 | CLANG_WARN_CONSTANT_CONVERSION = YES; 346 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 347 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 348 | CLANG_WARN_EMPTY_BODY = YES; 349 | CLANG_WARN_ENUM_CONVERSION = YES; 350 | CLANG_WARN_INFINITE_RECURSION = YES; 351 | CLANG_WARN_INT_CONVERSION = YES; 352 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 353 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 354 | CLANG_WARN_UNREACHABLE_CODE = YES; 355 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 356 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 357 | COPY_PHASE_STRIP = NO; 358 | DEBUG_INFORMATION_FORMAT = dwarf; 359 | ENABLE_STRICT_OBJC_MSGSEND = YES; 360 | ENABLE_TESTABILITY = YES; 361 | GCC_C_LANGUAGE_STANDARD = gnu99; 362 | GCC_DYNAMIC_NO_PIC = NO; 363 | GCC_NO_COMMON_BLOCKS = YES; 364 | GCC_OPTIMIZATION_LEVEL = 0; 365 | GCC_PREPROCESSOR_DEFINITIONS = ( 366 | "DEBUG=1", 367 | "$(inherited)", 368 | ); 369 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 370 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 371 | GCC_WARN_UNDECLARED_SELECTOR = YES; 372 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 373 | GCC_WARN_UNUSED_FUNCTION = YES; 374 | GCC_WARN_UNUSED_VARIABLE = YES; 375 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 376 | MTL_ENABLE_DEBUG_INFO = YES; 377 | ONLY_ACTIVE_ARCH = YES; 378 | SDKROOT = iphoneos; 379 | TARGETED_DEVICE_FAMILY = "1,2"; 380 | }; 381 | name = Debug; 382 | }; 383 | CFB872CE1F19E47000226B35 /* Release */ = { 384 | isa = XCBuildConfiguration; 385 | buildSettings = { 386 | ALWAYS_SEARCH_USER_PATHS = NO; 387 | CLANG_ANALYZER_NONNULL = YES; 388 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 389 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 390 | CLANG_CXX_LIBRARY = "libc++"; 391 | CLANG_ENABLE_MODULES = YES; 392 | CLANG_ENABLE_OBJC_ARC = YES; 393 | CLANG_WARN_BOOL_CONVERSION = YES; 394 | CLANG_WARN_CONSTANT_CONVERSION = YES; 395 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 396 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 397 | CLANG_WARN_EMPTY_BODY = YES; 398 | CLANG_WARN_ENUM_CONVERSION = YES; 399 | CLANG_WARN_INFINITE_RECURSION = YES; 400 | CLANG_WARN_INT_CONVERSION = YES; 401 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 402 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 403 | CLANG_WARN_UNREACHABLE_CODE = YES; 404 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 405 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 406 | COPY_PHASE_STRIP = NO; 407 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 408 | ENABLE_NS_ASSERTIONS = NO; 409 | ENABLE_STRICT_OBJC_MSGSEND = YES; 410 | GCC_C_LANGUAGE_STANDARD = gnu99; 411 | GCC_NO_COMMON_BLOCKS = YES; 412 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 413 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 414 | GCC_WARN_UNDECLARED_SELECTOR = YES; 415 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 416 | GCC_WARN_UNUSED_FUNCTION = YES; 417 | GCC_WARN_UNUSED_VARIABLE = YES; 418 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 419 | MTL_ENABLE_DEBUG_INFO = NO; 420 | SDKROOT = iphoneos; 421 | TARGETED_DEVICE_FAMILY = "1,2"; 422 | VALIDATE_PRODUCT = YES; 423 | }; 424 | name = Release; 425 | }; 426 | CFB872D01F19E47000226B35 /* Debug */ = { 427 | isa = XCBuildConfiguration; 428 | buildSettings = { 429 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 430 | DEVELOPMENT_TEAM = 22DBSR3WQ7; 431 | INFOPLIST_FILE = securityDome1/Info.plist; 432 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 433 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 434 | PRODUCT_BUNDLE_IDENTIFIER = jc.securityDome1; 435 | PRODUCT_NAME = "$(TARGET_NAME)"; 436 | }; 437 | name = Debug; 438 | }; 439 | CFB872D11F19E47000226B35 /* Release */ = { 440 | isa = XCBuildConfiguration; 441 | buildSettings = { 442 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 443 | DEVELOPMENT_TEAM = 22DBSR3WQ7; 444 | INFOPLIST_FILE = securityDome1/Info.plist; 445 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 446 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 447 | PRODUCT_BUNDLE_IDENTIFIER = jc.securityDome1; 448 | PRODUCT_NAME = "$(TARGET_NAME)"; 449 | }; 450 | name = Release; 451 | }; 452 | CFB872D31F19E47000226B35 /* Debug */ = { 453 | isa = XCBuildConfiguration; 454 | buildSettings = { 455 | BUNDLE_LOADER = "$(TEST_HOST)"; 456 | INFOPLIST_FILE = securityDome1Tests/Info.plist; 457 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 458 | PRODUCT_BUNDLE_IDENTIFIER = jc.securityDome1Tests; 459 | PRODUCT_NAME = "$(TARGET_NAME)"; 460 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/securityDome1.app/securityDome1"; 461 | }; 462 | name = Debug; 463 | }; 464 | CFB872D41F19E47000226B35 /* Release */ = { 465 | isa = XCBuildConfiguration; 466 | buildSettings = { 467 | BUNDLE_LOADER = "$(TEST_HOST)"; 468 | INFOPLIST_FILE = securityDome1Tests/Info.plist; 469 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 470 | PRODUCT_BUNDLE_IDENTIFIER = jc.securityDome1Tests; 471 | PRODUCT_NAME = "$(TARGET_NAME)"; 472 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/securityDome1.app/securityDome1"; 473 | }; 474 | name = Release; 475 | }; 476 | CFB872D61F19E47000226B35 /* Debug */ = { 477 | isa = XCBuildConfiguration; 478 | buildSettings = { 479 | INFOPLIST_FILE = securityDome1UITests/Info.plist; 480 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 481 | PRODUCT_BUNDLE_IDENTIFIER = jc.securityDome1UITests; 482 | PRODUCT_NAME = "$(TARGET_NAME)"; 483 | TEST_TARGET_NAME = securityDome1; 484 | }; 485 | name = Debug; 486 | }; 487 | CFB872D71F19E47000226B35 /* Release */ = { 488 | isa = XCBuildConfiguration; 489 | buildSettings = { 490 | INFOPLIST_FILE = securityDome1UITests/Info.plist; 491 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 492 | PRODUCT_BUNDLE_IDENTIFIER = jc.securityDome1UITests; 493 | PRODUCT_NAME = "$(TARGET_NAME)"; 494 | TEST_TARGET_NAME = securityDome1; 495 | }; 496 | name = Release; 497 | }; 498 | /* End XCBuildConfiguration section */ 499 | 500 | /* Begin XCConfigurationList section */ 501 | CFB8729D1F19E46F00226B35 /* Build configuration list for PBXProject "securityDome1" */ = { 502 | isa = XCConfigurationList; 503 | buildConfigurations = ( 504 | CFB872CD1F19E47000226B35 /* Debug */, 505 | CFB872CE1F19E47000226B35 /* Release */, 506 | ); 507 | defaultConfigurationIsVisible = 0; 508 | defaultConfigurationName = Release; 509 | }; 510 | CFB872CF1F19E47000226B35 /* Build configuration list for PBXNativeTarget "securityDome1" */ = { 511 | isa = XCConfigurationList; 512 | buildConfigurations = ( 513 | CFB872D01F19E47000226B35 /* Debug */, 514 | CFB872D11F19E47000226B35 /* Release */, 515 | ); 516 | defaultConfigurationIsVisible = 0; 517 | }; 518 | CFB872D21F19E47000226B35 /* Build configuration list for PBXNativeTarget "securityDome1Tests" */ = { 519 | isa = XCConfigurationList; 520 | buildConfigurations = ( 521 | CFB872D31F19E47000226B35 /* Debug */, 522 | CFB872D41F19E47000226B35 /* Release */, 523 | ); 524 | defaultConfigurationIsVisible = 0; 525 | }; 526 | CFB872D51F19E47000226B35 /* Build configuration list for PBXNativeTarget "securityDome1UITests" */ = { 527 | isa = XCConfigurationList; 528 | buildConfigurations = ( 529 | CFB872D61F19E47000226B35 /* Debug */, 530 | CFB872D71F19E47000226B35 /* Release */, 531 | ); 532 | defaultConfigurationIsVisible = 0; 533 | }; 534 | /* End XCConfigurationList section */ 535 | }; 536 | rootObject = CFB8729A1F19E46F00226B35 /* Project object */; 537 | } 538 | -------------------------------------------------------------------------------- /iOS应用防护/securityDome1/securityDome1.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /iOS应用防护/securityDome1/securityDome1.xcodeproj/project.xcworkspace/xcuserdata/guogh.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guogh/iOSApplicationReinforcement/8c4664f5eaf0929b9d1a36f74c87691af80512ca/iOS应用防护/securityDome1/securityDome1.xcodeproj/project.xcworkspace/xcuserdata/guogh.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /iOS应用防护/securityDome1/securityDome1.xcodeproj/xcuserdata/guogh.xcuserdatad/xcschemes/securityDome1.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /iOS应用防护/securityDome1/securityDome1.xcodeproj/xcuserdata/guogh.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | securityDome1.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | CFB872A11F19E46F00226B35 16 | 17 | primary 18 | 19 | 20 | CFB872BA1F19E46F00226B35 21 | 22 | primary 23 | 24 | 25 | CFB872C51F19E46F00226B35 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /iOS应用防护/securityDome1/securityDome1/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // securityDome1 4 | // 5 | // Created by guogh on 2017/7/15. 6 | // Copyright © 2017年 郭滚华. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /iOS应用防护/securityDome1/securityDome1/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // securityDome1 4 | // 5 | // Created by guogh on 2017/7/15. 6 | // Copyright © 2017年 郭滚华. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // 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. 26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 27 | } 28 | 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // 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. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // 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. 38 | } 39 | 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // 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. 43 | } 44 | 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /iOS应用防护/securityDome1/securityDome1/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /iOS应用防护/securityDome1/securityDome1/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 | 27 | 28 | -------------------------------------------------------------------------------- /iOS应用防护/securityDome1/securityDome1/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 | 22 | 23 | 24 | 25 | 31 | 37 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /iOS应用防护/securityDome1/securityDome1/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 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 | -------------------------------------------------------------------------------- /iOS应用防护/securityDome1/securityDome1/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // securityDome1 4 | // 5 | // Created by guogh on 2017/7/15. 6 | // Copyright © 2017年 郭滚华. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /iOS应用防护/securityDome1/securityDome1/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // securityDome1 4 | // 5 | // Created by guogh on 2017/7/15. 6 | // Copyright © 2017年 郭滚华. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | #define STRING_OBFUSCATE 12 | 13 | static char* decryptConstString(char* string) __attribute__((always_inline)); 14 | 15 | #define NSSTRING(string) [NSString stringWithUTF8String:decryptConstString(string)] 16 | #define CSTRING(string) decryptConstString(string) 17 | 18 | static char* decryptConstString(char* string) 19 | { 20 | char* origin_string = string; 21 | while(*string) { 22 | *string ^= 0xAA; 23 | string++; 24 | } 25 | return origin_string; 26 | } 27 | 28 | #ifndef STRING_OBFUSCATE 29 | 30 | #define NSSTRING(string) @string 31 | #define CSTRING(string) string 32 | 33 | #endif 34 | 35 | 36 | @interface ViewController () 37 | @property (weak, nonatomic) IBOutlet UILabel *label1; 38 | @property (weak, nonatomic) IBOutlet UILabel *label2; 39 | @property (weak, nonatomic) IBOutlet UILabel *label3; 40 | 41 | @end 42 | 43 | #define lableText1 NSSTRING(((char []) {194, 207, 198, 198, 197, 139, 0})); 44 | 45 | @implementation ViewController 46 | 47 | - (void)viewDidLoad { 48 | [super viewDidLoad]; 49 | 50 | static NSString *labeText3 = @"welcome"; 51 | 52 | self.label1.text = lableText1; 53 | self.label2.text = NSSTRING(((char []) {226, 207, 198, 198, 197, 134, 138, 221, 197, 216, 198, 206, 139, 0})); 54 | self.label3.text = labeText3; 55 | 56 | printf("%s",CSTRING(((char []) {221, 207, 198, 201, 197, 199, 207, 138, 226, 207, 198, 198, 197, 134, 138, 221, 197, 216, 198, 206, 139, 0}))); 57 | 58 | } 59 | 60 | 61 | - (void)didReceiveMemoryWarning { 62 | [super didReceiveMemoryWarning]; 63 | // Dispose of any resources that can be recreated. 64 | } 65 | 66 | 67 | @end 68 | -------------------------------------------------------------------------------- /iOS应用防护/securityDome1/securityDome1/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // securityDome1 4 | // 5 | // Created by guogh on 2017/7/15. 6 | // Copyright © 2017年 郭滚华. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /iOS应用防护/securityDome1/securityDome1Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /iOS应用防护/securityDome1/securityDome1Tests/securityDome1Tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // securityDome1Tests.m 3 | // securityDome1Tests 4 | // 5 | // Created by guogh on 2017/7/15. 6 | // Copyright © 2017年 郭滚华. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface securityDome1Tests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation securityDome1Tests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /iOS应用防护/securityDome1/securityDome1UITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /iOS应用防护/securityDome1/securityDome1UITests/securityDome1UITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // securityDome1UITests.m 3 | // securityDome1UITests 4 | // 5 | // Created by guogh on 2017/7/15. 6 | // Copyright © 2017年 郭滚华. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface securityDome1UITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation securityDome1UITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /iOS应用防护/securityDome2/Resource/PrefixHeader.pch: -------------------------------------------------------------------------------- 1 | // 2 | // PrefixHeader.pch 3 | // HSKConfuse 4 | // 5 | // Created by Code_Hou on 2017/3/11. 6 | // Copyright © 2017年 侯森魁. All rights reserved. 7 | // 8 | 9 | #ifndef PrefixHeader_pch 10 | #define PrefixHeader_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 | #import "codeObfuscation.h" 16 | 17 | #endif /* PrefixHeader_pch */ 18 | -------------------------------------------------------------------------------- /iOS应用防护/securityDome2/Resource/codeObfuscation.h: -------------------------------------------------------------------------------- 1 | #ifndef Demo_codeObfuscation_h 2 | #define Demo_codeObfuscation_h 3 | //confuse string at Sun Jul 16 14:12:52 CST 2017 4 | #define hsk_func1 ZsfqOLVNZoadWBpm 5 | #define hsk_func2 kDTrKjniWeeSkaQi 6 | #define hsk_func3 wbBPrzrbElyoMuiY 7 | #endif 8 | -------------------------------------------------------------------------------- /iOS应用防护/securityDome2/Resource/confuse.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | TABLENAME=symbols 4 | SYMBOL_DB_FILE="symbols" 5 | STRING_SYMBOL_FILE="$PROJECT_DIR/Resource/func.list" 6 | 7 | CONFUSE_FILE="$PROJECT_DIR/" 8 | 9 | HEAD_FILE="$PROJECT_DIR/Resource/codeObfuscation.h" 10 | 11 | export LC_CTYPE=C 12 | 13 | #取以.m或.h结尾的文件以+号或-号开头的行 |去掉所有+号或-号|用空格代替符号|n个空格跟着<号 替换成 <号|开头不能是IBAction|用空格split字串取第二部分|排序|去重复|删除空行|删掉以init开头的行>写进func.list 14 | grep -h -r -I "^[-+]" $CONFUSE_FILE --include '*.[mh]' |sed "s/[+-]//g"|sed "s/[();,: *\^\/\{]/ /g"|sed "s/[ ]*$STRING_SYMBOL_FILE 15 | 16 | 17 | #维护数据库方便日后作排重,一下代码来自念茜的微博 18 | createTable() 19 | { 20 | echo "create table $TABLENAME(src text, des text);" | sqlite3 $SYMBOL_DB_FILE 21 | } 22 | 23 | insertValue() 24 | { 25 | echo "insert into $TABLENAME values('$1' ,'$2');" | sqlite3 $SYMBOL_DB_FILE 26 | } 27 | 28 | query() 29 | { 30 | echo "select * from $TABLENAME where src='$1';" | sqlite3 $SYMBOL_DB_FILE 31 | } 32 | 33 | ramdomString() 34 | { 35 | openssl rand -base64 64 | tr -cd 'a-zA-Z' |head -c 16 36 | 37 | } 38 | 39 | rm -f $SYMBOL_DB_FILE 40 | rm -f $HEAD_FILE 41 | createTable 42 | 43 | touch $HEAD_FILE 44 | echo '#ifndef Demo_codeObfuscation_h 45 | #define Demo_codeObfuscation_h' >> $HEAD_FILE 46 | echo "//confuse string at `date`" >> $HEAD_FILE 47 | cat "$STRING_SYMBOL_FILE" | while read -ra line; do 48 | if [[ ! -z "$line" ]]; then 49 | ramdom=`ramdomString` 50 | echo $line $ramdom 51 | insertValue $line $ramdom 52 | echo "#define $line $ramdom" >> $HEAD_FILE 53 | fi 54 | done 55 | echo "#endif" >> $HEAD_FILE 56 | 57 | 58 | sqlite3 $SYMBOL_DB_FILE .dump 59 | 60 | -------------------------------------------------------------------------------- /iOS应用防护/securityDome2/Resource/func.list: -------------------------------------------------------------------------------- 1 | hsk_func1 2 | hsk_func2 3 | hsk_func3 4 | -------------------------------------------------------------------------------- /iOS应用防护/securityDome2/securityDome1/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // securityDome1 4 | // 5 | // Created by guogh on 2017/7/15. 6 | // Copyright © 2017年 郭滚华. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /iOS应用防护/securityDome2/securityDome1/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // securityDome1 4 | // 5 | // Created by guogh on 2017/7/15. 6 | // Copyright © 2017年 郭滚华. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // 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. 26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 27 | } 28 | 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // 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. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // 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. 38 | } 39 | 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // 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. 43 | } 44 | 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /iOS应用防护/securityDome2/securityDome1/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /iOS应用防护/securityDome2/securityDome1/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 | 27 | 28 | -------------------------------------------------------------------------------- /iOS应用防护/securityDome2/securityDome1/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 | 22 | 23 | 24 | 25 | 31 | 37 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /iOS应用防护/securityDome2/securityDome1/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 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 | -------------------------------------------------------------------------------- /iOS应用防护/securityDome2/securityDome1/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // securityDome1 4 | // 5 | // Created by guogh on 2017/7/15. 6 | // Copyright © 2017年 郭滚华. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /iOS应用防护/securityDome2/securityDome1/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // securityDome1 4 | // 5 | // Created by guogh on 2017/7/15. 6 | // Copyright © 2017年 郭滚华. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "codeObfuscation.h" 11 | 12 | #import 13 | #import 14 | 15 | 16 | #include 17 | #include 18 | 19 | 20 | @interface ViewController () 21 | 22 | @property (weak, nonatomic) IBOutlet UILabel *label; 23 | 24 | @end 25 | 26 | #ifndef PT_DENY_ATTACH 27 | #define PT_DENY_ATTACH 31 28 | #endif 29 | 30 | typedef int (*ptrace_ptr_t)(int _request, pid_t _pid, caddr_t _addr, int _data); 31 | 32 | 33 | static int is_debugged() __attribute__((always_inline)); 34 | 35 | @implementation ViewController 36 | 37 | 38 | - (void)viewDidLoad { 39 | [super viewDidLoad]; 40 | 41 | if (is_debugged() == YES) { 42 | self.label.text = @"is_debugged "; 43 | exit(-1); 44 | }else{ 45 | self.label.text = @"not is_debugged"; 46 | } 47 | 48 | } 49 | 50 | static int is_debugged(){ 51 | int name[4] = {CTL_KERN,KERN_PROC,KERN_PROC_PID,getpid()}; 52 | struct kinfo_proc Kproc; 53 | size_t kproc_size = sizeof(Kproc); 54 | 55 | memset((void*)&Kproc, 0, kproc_size); 56 | 57 | if (sysctl(name, 4, &Kproc, &kproc_size, NULL, 0) == -1) { 58 | perror("sysctl error \n "); 59 | exit(-1); 60 | } 61 | 62 | return (Kproc.kp_proc.p_flag & P_TRACED) ? 1 : 0; 63 | } 64 | 65 | 66 | 67 | //以下不需要做任何处理,保持原样即可 68 | -(void)hsk_func1{ 69 | NSLog(@"%@",@"dddddddd"); 70 | } 71 | 72 | -(void)hsk_func2{ 73 | [self hsk_func1]; 74 | } 75 | 76 | -(void)hsk_func3{ 77 | [self hsk_func2]; 78 | 79 | 80 | 81 | 82 | // void *handle = dlopen(0, RTLD_GLOBAL | RTLD_NOW); 83 | // ptrace_ptr_t ptrace_ptr = (ptrace_ptr_t)dlsym(handle, "ptrace"); 84 | // ptrace_ptr(PT_DENY_ATTACH, 0, 0, 0); 85 | 86 | [self hsk_func3]; 87 | } 88 | 89 | 90 | 91 | @end 92 | -------------------------------------------------------------------------------- /iOS应用防护/securityDome2/securityDome1/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // securityDome1 4 | // 5 | // Created by guogh on 2017/7/15. 6 | // Copyright © 2017年 郭滚华. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /iOS应用防护/securityDome2/securityDome1Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /iOS应用防护/securityDome2/securityDome1Tests/securityDome1Tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // securityDome1Tests.m 3 | // securityDome1Tests 4 | // 5 | // Created by guogh on 2017/7/15. 6 | // Copyright © 2017年 郭滚华. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface securityDome1Tests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation securityDome1Tests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /iOS应用防护/securityDome2/securityDome1UITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /iOS应用防护/securityDome2/securityDome1UITests/securityDome1UITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // securityDome1UITests.m 3 | // securityDome1UITests 4 | // 5 | // Created by guogh on 2017/7/15. 6 | // Copyright © 2017年 郭滚华. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface securityDome1UITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation securityDome1UITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /iOS应用防护/securityDome2/securityDome2.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | CFB872A71F19E46F00226B35 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CFB872A61F19E46F00226B35 /* main.m */; }; 11 | CFB872AA1F19E46F00226B35 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CFB872A91F19E46F00226B35 /* AppDelegate.m */; }; 12 | CFB872AD1F19E46F00226B35 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CFB872AC1F19E46F00226B35 /* ViewController.m */; }; 13 | CFB872B01F19E46F00226B35 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CFB872AE1F19E46F00226B35 /* Main.storyboard */; }; 14 | CFB872B21F19E46F00226B35 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CFB872B11F19E46F00226B35 /* Assets.xcassets */; }; 15 | CFB872B51F19E46F00226B35 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CFB872B31F19E46F00226B35 /* LaunchScreen.storyboard */; }; 16 | CFB872C01F19E46F00226B35 /* securityDome1Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = CFB872BF1F19E46F00226B35 /* securityDome1Tests.m */; }; 17 | CFB872CB1F19E47000226B35 /* securityDome1UITests.m in Sources */ = {isa = PBXBuildFile; fileRef = CFB872CA1F19E47000226B35 /* securityDome1UITests.m */; }; 18 | CFB872EC1F1A1A0D00226B35 /* confuse.sh in Resources */ = {isa = PBXBuildFile; fileRef = CFB872E91F1A1A0D00226B35 /* confuse.sh */; }; 19 | CFB872ED1F1A1A0D00226B35 /* func.list in Resources */ = {isa = PBXBuildFile; fileRef = CFB872EA1F1A1A0D00226B35 /* func.list */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXContainerItemProxy section */ 23 | CFB872BC1F19E46F00226B35 /* PBXContainerItemProxy */ = { 24 | isa = PBXContainerItemProxy; 25 | containerPortal = CFB8729A1F19E46F00226B35 /* Project object */; 26 | proxyType = 1; 27 | remoteGlobalIDString = CFB872A11F19E46F00226B35; 28 | remoteInfo = securityDome1; 29 | }; 30 | CFB872C71F19E47000226B35 /* PBXContainerItemProxy */ = { 31 | isa = PBXContainerItemProxy; 32 | containerPortal = CFB8729A1F19E46F00226B35 /* Project object */; 33 | proxyType = 1; 34 | remoteGlobalIDString = CFB872A11F19E46F00226B35; 35 | remoteInfo = securityDome1; 36 | }; 37 | /* End PBXContainerItemProxy section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | CFB872A21F19E46F00226B35 /* securityDome2.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = securityDome2.app; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | CFB872A61F19E46F00226B35 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 42 | CFB872A81F19E46F00226B35 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 43 | CFB872A91F19E46F00226B35 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 44 | CFB872AB1F19E46F00226B35 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 45 | CFB872AC1F19E46F00226B35 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 46 | CFB872AF1F19E46F00226B35 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 47 | CFB872B11F19E46F00226B35 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 48 | CFB872B41F19E46F00226B35 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 49 | CFB872B61F19E46F00226B35 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 50 | CFB872BB1F19E46F00226B35 /* securityDome2Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = securityDome2Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 51 | CFB872BF1F19E46F00226B35 /* securityDome1Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = securityDome1Tests.m; sourceTree = ""; }; 52 | CFB872C11F19E46F00226B35 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 53 | CFB872C61F19E47000226B35 /* securityDome2UITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = securityDome2UITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 54 | CFB872CA1F19E47000226B35 /* securityDome1UITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = securityDome1UITests.m; sourceTree = ""; }; 55 | CFB872CC1F19E47000226B35 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 56 | CFB872E81F1A1A0D00226B35 /* codeObfuscation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = codeObfuscation.h; sourceTree = ""; }; 57 | CFB872E91F1A1A0D00226B35 /* confuse.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = confuse.sh; sourceTree = ""; }; 58 | CFB872EA1F1A1A0D00226B35 /* func.list */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = func.list; sourceTree = ""; }; 59 | CFB872EB1F1A1A0D00226B35 /* PrefixHeader.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PrefixHeader.pch; sourceTree = ""; }; 60 | /* End PBXFileReference section */ 61 | 62 | /* Begin PBXFrameworksBuildPhase section */ 63 | CFB8729F1F19E46F00226B35 /* Frameworks */ = { 64 | isa = PBXFrameworksBuildPhase; 65 | buildActionMask = 2147483647; 66 | files = ( 67 | ); 68 | runOnlyForDeploymentPostprocessing = 0; 69 | }; 70 | CFB872B81F19E46F00226B35 /* Frameworks */ = { 71 | isa = PBXFrameworksBuildPhase; 72 | buildActionMask = 2147483647; 73 | files = ( 74 | ); 75 | runOnlyForDeploymentPostprocessing = 0; 76 | }; 77 | CFB872C31F19E46F00226B35 /* Frameworks */ = { 78 | isa = PBXFrameworksBuildPhase; 79 | buildActionMask = 2147483647; 80 | files = ( 81 | ); 82 | runOnlyForDeploymentPostprocessing = 0; 83 | }; 84 | /* End PBXFrameworksBuildPhase section */ 85 | 86 | /* Begin PBXGroup section */ 87 | CFB872991F19E46F00226B35 = { 88 | isa = PBXGroup; 89 | children = ( 90 | CFB872E71F1A1A0D00226B35 /* Resource */, 91 | CFB872A41F19E46F00226B35 /* securityDome2 */, 92 | CFB872BE1F19E46F00226B35 /* securityDome1Tests */, 93 | CFB872C91F19E47000226B35 /* securityDome1UITests */, 94 | CFB872A31F19E46F00226B35 /* Products */, 95 | ); 96 | sourceTree = ""; 97 | }; 98 | CFB872A31F19E46F00226B35 /* Products */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | CFB872A21F19E46F00226B35 /* securityDome2.app */, 102 | CFB872BB1F19E46F00226B35 /* securityDome2Tests.xctest */, 103 | CFB872C61F19E47000226B35 /* securityDome2UITests.xctest */, 104 | ); 105 | name = Products; 106 | sourceTree = ""; 107 | }; 108 | CFB872A41F19E46F00226B35 /* securityDome2 */ = { 109 | isa = PBXGroup; 110 | children = ( 111 | CFB872A81F19E46F00226B35 /* AppDelegate.h */, 112 | CFB872A91F19E46F00226B35 /* AppDelegate.m */, 113 | CFB872AB1F19E46F00226B35 /* ViewController.h */, 114 | CFB872AC1F19E46F00226B35 /* ViewController.m */, 115 | CFB872AE1F19E46F00226B35 /* Main.storyboard */, 116 | CFB872B11F19E46F00226B35 /* Assets.xcassets */, 117 | CFB872B31F19E46F00226B35 /* LaunchScreen.storyboard */, 118 | CFB872B61F19E46F00226B35 /* Info.plist */, 119 | CFB872A51F19E46F00226B35 /* Supporting Files */, 120 | ); 121 | name = securityDome2; 122 | path = securityDome1; 123 | sourceTree = ""; 124 | }; 125 | CFB872A51F19E46F00226B35 /* Supporting Files */ = { 126 | isa = PBXGroup; 127 | children = ( 128 | CFB872A61F19E46F00226B35 /* main.m */, 129 | ); 130 | name = "Supporting Files"; 131 | sourceTree = ""; 132 | }; 133 | CFB872BE1F19E46F00226B35 /* securityDome1Tests */ = { 134 | isa = PBXGroup; 135 | children = ( 136 | CFB872BF1F19E46F00226B35 /* securityDome1Tests.m */, 137 | CFB872C11F19E46F00226B35 /* Info.plist */, 138 | ); 139 | path = securityDome1Tests; 140 | sourceTree = ""; 141 | }; 142 | CFB872C91F19E47000226B35 /* securityDome1UITests */ = { 143 | isa = PBXGroup; 144 | children = ( 145 | CFB872CA1F19E47000226B35 /* securityDome1UITests.m */, 146 | CFB872CC1F19E47000226B35 /* Info.plist */, 147 | ); 148 | path = securityDome1UITests; 149 | sourceTree = ""; 150 | }; 151 | CFB872E71F1A1A0D00226B35 /* Resource */ = { 152 | isa = PBXGroup; 153 | children = ( 154 | CFB872E81F1A1A0D00226B35 /* codeObfuscation.h */, 155 | CFB872E91F1A1A0D00226B35 /* confuse.sh */, 156 | CFB872EA1F1A1A0D00226B35 /* func.list */, 157 | CFB872EB1F1A1A0D00226B35 /* PrefixHeader.pch */, 158 | ); 159 | path = Resource; 160 | sourceTree = ""; 161 | }; 162 | /* End PBXGroup section */ 163 | 164 | /* Begin PBXNativeTarget section */ 165 | CFB872A11F19E46F00226B35 /* securityDome2 */ = { 166 | isa = PBXNativeTarget; 167 | buildConfigurationList = CFB872CF1F19E47000226B35 /* Build configuration list for PBXNativeTarget "securityDome2" */; 168 | buildPhases = ( 169 | CFB8729E1F19E46F00226B35 /* Sources */, 170 | CFB8729F1F19E46F00226B35 /* Frameworks */, 171 | CFB872A01F19E46F00226B35 /* Resources */, 172 | CFB872DF1F1A16C700226B35 /* ShellScript */, 173 | ); 174 | buildRules = ( 175 | ); 176 | dependencies = ( 177 | ); 178 | name = securityDome2; 179 | productName = securityDome1; 180 | productReference = CFB872A21F19E46F00226B35 /* securityDome2.app */; 181 | productType = "com.apple.product-type.application"; 182 | }; 183 | CFB872BA1F19E46F00226B35 /* securityDome2Tests */ = { 184 | isa = PBXNativeTarget; 185 | buildConfigurationList = CFB872D21F19E47000226B35 /* Build configuration list for PBXNativeTarget "securityDome2Tests" */; 186 | buildPhases = ( 187 | CFB872B71F19E46F00226B35 /* Sources */, 188 | CFB872B81F19E46F00226B35 /* Frameworks */, 189 | CFB872B91F19E46F00226B35 /* Resources */, 190 | ); 191 | buildRules = ( 192 | ); 193 | dependencies = ( 194 | CFB872BD1F19E46F00226B35 /* PBXTargetDependency */, 195 | ); 196 | name = securityDome2Tests; 197 | productName = securityDome1Tests; 198 | productReference = CFB872BB1F19E46F00226B35 /* securityDome2Tests.xctest */; 199 | productType = "com.apple.product-type.bundle.unit-test"; 200 | }; 201 | CFB872C51F19E46F00226B35 /* securityDome2UITests */ = { 202 | isa = PBXNativeTarget; 203 | buildConfigurationList = CFB872D51F19E47000226B35 /* Build configuration list for PBXNativeTarget "securityDome2UITests" */; 204 | buildPhases = ( 205 | CFB872C21F19E46F00226B35 /* Sources */, 206 | CFB872C31F19E46F00226B35 /* Frameworks */, 207 | CFB872C41F19E46F00226B35 /* Resources */, 208 | ); 209 | buildRules = ( 210 | ); 211 | dependencies = ( 212 | CFB872C81F19E47000226B35 /* PBXTargetDependency */, 213 | ); 214 | name = securityDome2UITests; 215 | productName = securityDome1UITests; 216 | productReference = CFB872C61F19E47000226B35 /* securityDome2UITests.xctest */; 217 | productType = "com.apple.product-type.bundle.ui-testing"; 218 | }; 219 | /* End PBXNativeTarget section */ 220 | 221 | /* Begin PBXProject section */ 222 | CFB8729A1F19E46F00226B35 /* Project object */ = { 223 | isa = PBXProject; 224 | attributes = { 225 | LastUpgradeCheck = 0830; 226 | ORGANIZATIONNAME = "郭滚华"; 227 | TargetAttributes = { 228 | CFB872A11F19E46F00226B35 = { 229 | CreatedOnToolsVersion = 8.3.3; 230 | DevelopmentTeam = 22DBSR3WQ7; 231 | ProvisioningStyle = Automatic; 232 | }; 233 | CFB872BA1F19E46F00226B35 = { 234 | CreatedOnToolsVersion = 8.3.3; 235 | ProvisioningStyle = Automatic; 236 | TestTargetID = CFB872A11F19E46F00226B35; 237 | }; 238 | CFB872C51F19E46F00226B35 = { 239 | CreatedOnToolsVersion = 8.3.3; 240 | ProvisioningStyle = Automatic; 241 | TestTargetID = CFB872A11F19E46F00226B35; 242 | }; 243 | }; 244 | }; 245 | buildConfigurationList = CFB8729D1F19E46F00226B35 /* Build configuration list for PBXProject "securityDome2" */; 246 | compatibilityVersion = "Xcode 3.2"; 247 | developmentRegion = English; 248 | hasScannedForEncodings = 0; 249 | knownRegions = ( 250 | en, 251 | Base, 252 | ); 253 | mainGroup = CFB872991F19E46F00226B35; 254 | productRefGroup = CFB872A31F19E46F00226B35 /* Products */; 255 | projectDirPath = ""; 256 | projectRoot = ""; 257 | targets = ( 258 | CFB872A11F19E46F00226B35 /* securityDome2 */, 259 | CFB872BA1F19E46F00226B35 /* securityDome2Tests */, 260 | CFB872C51F19E46F00226B35 /* securityDome2UITests */, 261 | ); 262 | }; 263 | /* End PBXProject section */ 264 | 265 | /* Begin PBXResourcesBuildPhase section */ 266 | CFB872A01F19E46F00226B35 /* Resources */ = { 267 | isa = PBXResourcesBuildPhase; 268 | buildActionMask = 2147483647; 269 | files = ( 270 | CFB872B51F19E46F00226B35 /* LaunchScreen.storyboard in Resources */, 271 | CFB872ED1F1A1A0D00226B35 /* func.list in Resources */, 272 | CFB872B21F19E46F00226B35 /* Assets.xcassets in Resources */, 273 | CFB872EC1F1A1A0D00226B35 /* confuse.sh in Resources */, 274 | CFB872B01F19E46F00226B35 /* Main.storyboard in Resources */, 275 | ); 276 | runOnlyForDeploymentPostprocessing = 0; 277 | }; 278 | CFB872B91F19E46F00226B35 /* Resources */ = { 279 | isa = PBXResourcesBuildPhase; 280 | buildActionMask = 2147483647; 281 | files = ( 282 | ); 283 | runOnlyForDeploymentPostprocessing = 0; 284 | }; 285 | CFB872C41F19E46F00226B35 /* Resources */ = { 286 | isa = PBXResourcesBuildPhase; 287 | buildActionMask = 2147483647; 288 | files = ( 289 | ); 290 | runOnlyForDeploymentPostprocessing = 0; 291 | }; 292 | /* End PBXResourcesBuildPhase section */ 293 | 294 | /* Begin PBXShellScriptBuildPhase section */ 295 | CFB872DF1F1A16C700226B35 /* ShellScript */ = { 296 | isa = PBXShellScriptBuildPhase; 297 | buildActionMask = 2147483647; 298 | files = ( 299 | ); 300 | inputPaths = ( 301 | ); 302 | outputPaths = ( 303 | ); 304 | runOnlyForDeploymentPostprocessing = 0; 305 | shellPath = /bin/sh; 306 | shellScript = $PROJECT_DIR/Resource/confuse.sh; 307 | }; 308 | /* End PBXShellScriptBuildPhase section */ 309 | 310 | /* Begin PBXSourcesBuildPhase section */ 311 | CFB8729E1F19E46F00226B35 /* Sources */ = { 312 | isa = PBXSourcesBuildPhase; 313 | buildActionMask = 2147483647; 314 | files = ( 315 | CFB872AD1F19E46F00226B35 /* ViewController.m in Sources */, 316 | CFB872AA1F19E46F00226B35 /* AppDelegate.m in Sources */, 317 | CFB872A71F19E46F00226B35 /* main.m in Sources */, 318 | ); 319 | runOnlyForDeploymentPostprocessing = 0; 320 | }; 321 | CFB872B71F19E46F00226B35 /* Sources */ = { 322 | isa = PBXSourcesBuildPhase; 323 | buildActionMask = 2147483647; 324 | files = ( 325 | CFB872C01F19E46F00226B35 /* securityDome1Tests.m in Sources */, 326 | ); 327 | runOnlyForDeploymentPostprocessing = 0; 328 | }; 329 | CFB872C21F19E46F00226B35 /* Sources */ = { 330 | isa = PBXSourcesBuildPhase; 331 | buildActionMask = 2147483647; 332 | files = ( 333 | CFB872CB1F19E47000226B35 /* securityDome1UITests.m in Sources */, 334 | ); 335 | runOnlyForDeploymentPostprocessing = 0; 336 | }; 337 | /* End PBXSourcesBuildPhase section */ 338 | 339 | /* Begin PBXTargetDependency section */ 340 | CFB872BD1F19E46F00226B35 /* PBXTargetDependency */ = { 341 | isa = PBXTargetDependency; 342 | target = CFB872A11F19E46F00226B35 /* securityDome2 */; 343 | targetProxy = CFB872BC1F19E46F00226B35 /* PBXContainerItemProxy */; 344 | }; 345 | CFB872C81F19E47000226B35 /* PBXTargetDependency */ = { 346 | isa = PBXTargetDependency; 347 | target = CFB872A11F19E46F00226B35 /* securityDome2 */; 348 | targetProxy = CFB872C71F19E47000226B35 /* PBXContainerItemProxy */; 349 | }; 350 | /* End PBXTargetDependency section */ 351 | 352 | /* Begin PBXVariantGroup section */ 353 | CFB872AE1F19E46F00226B35 /* Main.storyboard */ = { 354 | isa = PBXVariantGroup; 355 | children = ( 356 | CFB872AF1F19E46F00226B35 /* Base */, 357 | ); 358 | name = Main.storyboard; 359 | sourceTree = ""; 360 | }; 361 | CFB872B31F19E46F00226B35 /* LaunchScreen.storyboard */ = { 362 | isa = PBXVariantGroup; 363 | children = ( 364 | CFB872B41F19E46F00226B35 /* Base */, 365 | ); 366 | name = LaunchScreen.storyboard; 367 | sourceTree = ""; 368 | }; 369 | /* End PBXVariantGroup section */ 370 | 371 | /* Begin XCBuildConfiguration section */ 372 | CFB872CD1F19E47000226B35 /* Debug */ = { 373 | isa = XCBuildConfiguration; 374 | buildSettings = { 375 | ALWAYS_SEARCH_USER_PATHS = NO; 376 | CLANG_ANALYZER_NONNULL = YES; 377 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 378 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 379 | CLANG_CXX_LIBRARY = "libc++"; 380 | CLANG_ENABLE_MODULES = YES; 381 | CLANG_ENABLE_OBJC_ARC = YES; 382 | CLANG_WARN_BOOL_CONVERSION = YES; 383 | CLANG_WARN_CONSTANT_CONVERSION = YES; 384 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 385 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 386 | CLANG_WARN_EMPTY_BODY = YES; 387 | CLANG_WARN_ENUM_CONVERSION = YES; 388 | CLANG_WARN_INFINITE_RECURSION = YES; 389 | CLANG_WARN_INT_CONVERSION = YES; 390 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 391 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 392 | CLANG_WARN_UNREACHABLE_CODE = YES; 393 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 394 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 395 | COPY_PHASE_STRIP = NO; 396 | DEBUG_INFORMATION_FORMAT = dwarf; 397 | ENABLE_STRICT_OBJC_MSGSEND = YES; 398 | ENABLE_TESTABILITY = YES; 399 | GCC_C_LANGUAGE_STANDARD = gnu99; 400 | GCC_DYNAMIC_NO_PIC = NO; 401 | GCC_NO_COMMON_BLOCKS = YES; 402 | GCC_OPTIMIZATION_LEVEL = 0; 403 | GCC_PREPROCESSOR_DEFINITIONS = ( 404 | "DEBUG=1", 405 | "$(inherited)", 406 | ); 407 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 408 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 409 | GCC_WARN_UNDECLARED_SELECTOR = YES; 410 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 411 | GCC_WARN_UNUSED_FUNCTION = YES; 412 | GCC_WARN_UNUSED_VARIABLE = YES; 413 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 414 | MTL_ENABLE_DEBUG_INFO = YES; 415 | ONLY_ACTIVE_ARCH = YES; 416 | SDKROOT = iphoneos; 417 | TARGETED_DEVICE_FAMILY = "1,2"; 418 | }; 419 | name = Debug; 420 | }; 421 | CFB872CE1F19E47000226B35 /* Release */ = { 422 | isa = XCBuildConfiguration; 423 | buildSettings = { 424 | ALWAYS_SEARCH_USER_PATHS = NO; 425 | CLANG_ANALYZER_NONNULL = YES; 426 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 427 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 428 | CLANG_CXX_LIBRARY = "libc++"; 429 | CLANG_ENABLE_MODULES = YES; 430 | CLANG_ENABLE_OBJC_ARC = YES; 431 | CLANG_WARN_BOOL_CONVERSION = YES; 432 | CLANG_WARN_CONSTANT_CONVERSION = YES; 433 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 434 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 435 | CLANG_WARN_EMPTY_BODY = YES; 436 | CLANG_WARN_ENUM_CONVERSION = YES; 437 | CLANG_WARN_INFINITE_RECURSION = YES; 438 | CLANG_WARN_INT_CONVERSION = YES; 439 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 440 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 441 | CLANG_WARN_UNREACHABLE_CODE = YES; 442 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 443 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 444 | COPY_PHASE_STRIP = NO; 445 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 446 | ENABLE_NS_ASSERTIONS = NO; 447 | ENABLE_STRICT_OBJC_MSGSEND = YES; 448 | GCC_C_LANGUAGE_STANDARD = gnu99; 449 | GCC_NO_COMMON_BLOCKS = YES; 450 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 451 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 452 | GCC_WARN_UNDECLARED_SELECTOR = YES; 453 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 454 | GCC_WARN_UNUSED_FUNCTION = YES; 455 | GCC_WARN_UNUSED_VARIABLE = YES; 456 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 457 | MTL_ENABLE_DEBUG_INFO = NO; 458 | SDKROOT = iphoneos; 459 | TARGETED_DEVICE_FAMILY = "1,2"; 460 | VALIDATE_PRODUCT = YES; 461 | }; 462 | name = Release; 463 | }; 464 | CFB872D01F19E47000226B35 /* Debug */ = { 465 | isa = XCBuildConfiguration; 466 | buildSettings = { 467 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 468 | DEVELOPMENT_TEAM = 22DBSR3WQ7; 469 | ENABLE_BITCODE = NO; 470 | INFOPLIST_FILE = securityDome1/Info.plist; 471 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 472 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 473 | PRODUCT_BUNDLE_IDENTIFIER = jc.securityDome2; 474 | PRODUCT_NAME = "$(TARGET_NAME)"; 475 | USER_HEADER_SEARCH_PATHS = "$PROJECT_DIR/Resource/PrefixHeader.pch/**"; 476 | }; 477 | name = Debug; 478 | }; 479 | CFB872D11F19E47000226B35 /* Release */ = { 480 | isa = XCBuildConfiguration; 481 | buildSettings = { 482 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 483 | DEVELOPMENT_TEAM = 22DBSR3WQ7; 484 | ENABLE_BITCODE = NO; 485 | INFOPLIST_FILE = securityDome1/Info.plist; 486 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 487 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 488 | PRODUCT_BUNDLE_IDENTIFIER = jc.securityDome2; 489 | PRODUCT_NAME = "$(TARGET_NAME)"; 490 | USER_HEADER_SEARCH_PATHS = "$PROJECT_DIR/Resource/PrefixHeader.pch/**"; 491 | }; 492 | name = Release; 493 | }; 494 | CFB872D31F19E47000226B35 /* Debug */ = { 495 | isa = XCBuildConfiguration; 496 | buildSettings = { 497 | BUNDLE_LOADER = "$(TEST_HOST)"; 498 | INFOPLIST_FILE = securityDome1Tests/Info.plist; 499 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 500 | PRODUCT_BUNDLE_IDENTIFIER = jc.securityDome1Tests; 501 | PRODUCT_NAME = "$(TARGET_NAME)"; 502 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/securityDome2.app/securityDome2"; 503 | }; 504 | name = Debug; 505 | }; 506 | CFB872D41F19E47000226B35 /* Release */ = { 507 | isa = XCBuildConfiguration; 508 | buildSettings = { 509 | BUNDLE_LOADER = "$(TEST_HOST)"; 510 | INFOPLIST_FILE = securityDome1Tests/Info.plist; 511 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 512 | PRODUCT_BUNDLE_IDENTIFIER = jc.securityDome1Tests; 513 | PRODUCT_NAME = "$(TARGET_NAME)"; 514 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/securityDome2.app/securityDome2"; 515 | }; 516 | name = Release; 517 | }; 518 | CFB872D61F19E47000226B35 /* Debug */ = { 519 | isa = XCBuildConfiguration; 520 | buildSettings = { 521 | INFOPLIST_FILE = securityDome1UITests/Info.plist; 522 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 523 | PRODUCT_BUNDLE_IDENTIFIER = jc.securityDome1UITests; 524 | PRODUCT_NAME = "$(TARGET_NAME)"; 525 | TEST_TARGET_NAME = securityDome1; 526 | }; 527 | name = Debug; 528 | }; 529 | CFB872D71F19E47000226B35 /* Release */ = { 530 | isa = XCBuildConfiguration; 531 | buildSettings = { 532 | INFOPLIST_FILE = securityDome1UITests/Info.plist; 533 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 534 | PRODUCT_BUNDLE_IDENTIFIER = jc.securityDome1UITests; 535 | PRODUCT_NAME = "$(TARGET_NAME)"; 536 | TEST_TARGET_NAME = securityDome1; 537 | }; 538 | name = Release; 539 | }; 540 | /* End XCBuildConfiguration section */ 541 | 542 | /* Begin XCConfigurationList section */ 543 | CFB8729D1F19E46F00226B35 /* Build configuration list for PBXProject "securityDome2" */ = { 544 | isa = XCConfigurationList; 545 | buildConfigurations = ( 546 | CFB872CD1F19E47000226B35 /* Debug */, 547 | CFB872CE1F19E47000226B35 /* Release */, 548 | ); 549 | defaultConfigurationIsVisible = 0; 550 | defaultConfigurationName = Release; 551 | }; 552 | CFB872CF1F19E47000226B35 /* Build configuration list for PBXNativeTarget "securityDome2" */ = { 553 | isa = XCConfigurationList; 554 | buildConfigurations = ( 555 | CFB872D01F19E47000226B35 /* Debug */, 556 | CFB872D11F19E47000226B35 /* Release */, 557 | ); 558 | defaultConfigurationIsVisible = 0; 559 | defaultConfigurationName = Release; 560 | }; 561 | CFB872D21F19E47000226B35 /* Build configuration list for PBXNativeTarget "securityDome2Tests" */ = { 562 | isa = XCConfigurationList; 563 | buildConfigurations = ( 564 | CFB872D31F19E47000226B35 /* Debug */, 565 | CFB872D41F19E47000226B35 /* Release */, 566 | ); 567 | defaultConfigurationIsVisible = 0; 568 | defaultConfigurationName = Release; 569 | }; 570 | CFB872D51F19E47000226B35 /* Build configuration list for PBXNativeTarget "securityDome2UITests" */ = { 571 | isa = XCConfigurationList; 572 | buildConfigurations = ( 573 | CFB872D61F19E47000226B35 /* Debug */, 574 | CFB872D71F19E47000226B35 /* Release */, 575 | ); 576 | defaultConfigurationIsVisible = 0; 577 | defaultConfigurationName = Release; 578 | }; 579 | /* End XCConfigurationList section */ 580 | }; 581 | rootObject = CFB8729A1F19E46F00226B35 /* Project object */; 582 | } 583 | -------------------------------------------------------------------------------- /iOS应用防护/securityDome2/securityDome2.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /iOS应用防护/securityDome2/securityDome2.xcodeproj/project.xcworkspace/xcuserdata/guogh.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guogh/iOSApplicationReinforcement/8c4664f5eaf0929b9d1a36f74c87691af80512ca/iOS应用防护/securityDome2/securityDome2.xcodeproj/project.xcworkspace/xcuserdata/guogh.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /iOS应用防护/securityDome2/securityDome2.xcodeproj/xcuserdata/guogh.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /iOS应用防护/securityDome2/securityDome2.xcodeproj/xcuserdata/guogh.xcuserdatad/xcschemes/securityDome1.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /iOS应用防护/securityDome2/securityDome2.xcodeproj/xcuserdata/guogh.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | securityDome1.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | CFB872A11F19E46F00226B35 16 | 17 | primary 18 | 19 | 20 | CFB872BA1F19E46F00226B35 21 | 22 | primary 23 | 24 | 25 | CFB872C51F19E46F00226B35 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /iOS应用防护/字符串混淆前反汇编.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guogh/iOSApplicationReinforcement/8c4664f5eaf0929b9d1a36f74c87691af80512ca/iOS应用防护/字符串混淆前反汇编.png -------------------------------------------------------------------------------- /iOS应用防护/字符串混淆前的代码.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guogh/iOSApplicationReinforcement/8c4664f5eaf0929b9d1a36f74c87691af80512ca/iOS应用防护/字符串混淆前的代码.png -------------------------------------------------------------------------------- /iOS应用防护/字符串混淆后反汇编.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guogh/iOSApplicationReinforcement/8c4664f5eaf0929b9d1a36f74c87691af80512ca/iOS应用防护/字符串混淆后反汇编.png -------------------------------------------------------------------------------- /iOS应用防护/字符串混淆后的代码.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guogh/iOSApplicationReinforcement/8c4664f5eaf0929b9d1a36f74c87691af80512ca/iOS应用防护/字符串混淆后的代码.png -------------------------------------------------------------------------------- /iOS应用防护/未混淆前.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guogh/iOSApplicationReinforcement/8c4664f5eaf0929b9d1a36f74c87691af80512ca/iOS应用防护/未混淆前.png -------------------------------------------------------------------------------- /iOS应用防护/混淆后.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guogh/iOSApplicationReinforcement/8c4664f5eaf0929b9d1a36f74c87691af80512ca/iOS应用防护/混淆后.png -------------------------------------------------------------------------------- /iOS应用防护/混淆脚本设置.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guogh/iOSApplicationReinforcement/8c4664f5eaf0929b9d1a36f74c87691af80512ca/iOS应用防护/混淆脚本设置.png -------------------------------------------------------------------------------- /字符串硬编码混淆/hello String/confusion/confusion.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # encoding=utf8 3 | # -*- coding: utf-8 -*- 4 | # 本脚本用于对源代码中的字符串进行加密 5 | # 替换所有字符串常量为加密的char数组,形式((char[]){1, 2, 3, 0}) 6 | 7 | import importlib 8 | import os 9 | import re 10 | import sys 11 | 12 | 13 | # 替换字符串为((char[]){1, 2, 3, 0})的形式,同时让每个字节与0xAA异或进行加密 14 | def replace(match): 15 | string = match.group(2) + '\x00' 16 | replaced_string = '((char []) {' + ', '.join(["%i" % ((ord(c) ^ 0xAA) if c != '\0' else 0) for c in list(string)]) + '})' 17 | return match.group(1) + replaced_string + match.group(3) 18 | 19 | 20 | # 修改源代码,加入字符串加密的函数 21 | def obfuscate(file): 22 | with open(file, 'r') as f: 23 | code = f.read() 24 | f.close() 25 | code = re.sub(r'(confusion_NSSTRING\(|confusion_CSTRING\()"(.*?)"(\))', replace, code) 26 | code = re.sub(r'//#define ggh_confusion', '#define ggh_confusion', code) 27 | with open(file, 'w') as f: 28 | f.write(code) 29 | f.close() 30 | 31 | 32 | #读取源码路径下的所有.h和.m 文件 33 | def openSrcFile(path): 34 | print("开始处理路径: "+ path +" 下的所有.h和.m文件") 35 | # this folder is custom 36 | for parent,dirnames,filenames in os.walk(path): 37 | #case 1: 38 | # for dirname in dirnames: 39 | # print((" parent folder is:" + parent).encode('utf-8')) 40 | # print((" dirname is:" + dirname).encode('utf-8')) 41 | #case 2 42 | for filename in filenames: 43 | extendedName = os.path.splitext(os.path.join(parent,filename)) 44 | if (extendedName[1] == '.h' or extendedName[1] == '.m'): 45 | print("处理源代码文件: "+ os.path.join(parent,filename)) 46 | obfuscate(os.path.join(parent,filename)) 47 | 48 | 49 | #源码路径 50 | srcPath = '../hello String' 51 | 52 | if __name__ == '__main__': 53 | print("本脚本用于对源代码中被标记的字符串进行加密") 54 | 55 | if len(srcPath) > 0: 56 | openSrcFile(srcPath) 57 | else: 58 | print("请输入正确的源代码路径") 59 | sys.exit() 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /字符串硬编码混淆/hello String/confusion/decodeConfusion.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # encoding=utf8 3 | # -*- coding: utf-8 -*- 4 | # 本脚本用于对源代码中的字符串进行解密 5 | # 替换所有加密的char数组为字符串常量,"" 6 | 7 | import importlib 8 | import os 9 | import re 10 | import sys 11 | 12 | 13 | # 替换((char[]){1, 2, 3, 0})的形式为字符串,同时让每个数组值与0xAA异或进行解密 14 | def replace(match): 15 | string = match.group(2) 16 | decodeConfusion_string = "" 17 | for numberStr in list(string.split(',')): 18 | if int(numberStr) != 0: 19 | decodeConfusion_string = decodeConfusion_string + "%c" % (int(numberStr) ^ 0xAA) 20 | 21 | # replaced_string = '\"' + "".join(["%c" % ((int(c) ^ 0xAA) if int(c) != 0 else '\0') for c in string.split(',')]) + '\"' 22 | replaced_string = '\"' + decodeConfusion_string + '\"' 23 | print("replaced_string = " + replaced_string) 24 | 25 | return match.group(1) + replaced_string + match.group(3) 26 | 27 | 28 | # 修改源代码,加入字符串加密的函数 29 | def obfuscate(file): 30 | with open(file, 'r') as f: 31 | code = f.read() 32 | f.close() 33 | code = re.sub(r'(confusion_NSSTRING\(|confusion_CSTRING\()\(\(char \[\]\) \{(.*?)\}\)(\))', replace, code) 34 | code = re.sub(r'[/]*#define ggh_confusion', '//#define ggh_confusion', code) 35 | with open(file, 'w') as f: 36 | f.write(code) 37 | f.close() 38 | 39 | 40 | #读取源码路径下的所有.h和.m 文件 41 | def openSrcFile(path): 42 | print("开始处理路径: "+ path +" 下的所有.h和.m文件") 43 | # this folder is custom 44 | for parent,dirnames,filenames in os.walk(path): 45 | #case 1: 46 | # for dirname in dirnames: 47 | # print((" parent folder is:" + parent).encode('utf-8')) 48 | # print((" dirname is:" + dirname).encode('utf-8')) 49 | #case 2 50 | for filename in filenames: 51 | extendedName = os.path.splitext(os.path.join(parent,filename)) 52 | #读取所有.h和.m 的源文件 53 | if (extendedName[1] == '.h' or extendedName[1] == '.m'): 54 | print("处理代码文件:"+ os.path.join(parent,filename)) 55 | obfuscate(os.path.join(parent,filename)) 56 | 57 | 58 | #源码路径 59 | srcPath = '../hello String' 60 | if __name__ == '__main__': 61 | print("字符串解混淆脚本,将被标记过的char数组转为字符串,并和0xAA异或。还原代码") 62 | if len(srcPath) > 0: 63 | openSrcFile(srcPath) 64 | else: 65 | print("请输入正确的源代码路径!") 66 | sys.exit() 67 | 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /字符串硬编码混淆/hello String/hello String.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 48; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | CF7064751FBC0E5200B0B300 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CF7064741FBC0E5200B0B300 /* AppDelegate.m */; }; 11 | CF7064781FBC0E5200B0B300 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CF7064771FBC0E5200B0B300 /* ViewController.m */; }; 12 | CF70647B1FBC0E5200B0B300 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CF7064791FBC0E5200B0B300 /* Main.storyboard */; }; 13 | CF70647D1FBC0E5200B0B300 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CF70647C1FBC0E5200B0B300 /* Assets.xcassets */; }; 14 | CF7064801FBC0E5200B0B300 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CF70647E1FBC0E5200B0B300 /* LaunchScreen.storyboard */; }; 15 | CF7064831FBC0E5200B0B300 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CF7064821FBC0E5200B0B300 /* main.m */; }; 16 | CF70648D1FBC0E5200B0B300 /* hello_StringTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CF70648C1FBC0E5200B0B300 /* hello_StringTests.m */; }; 17 | CF7064981FBC0E5200B0B300 /* hello_StringUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = CF7064971FBC0E5200B0B300 /* hello_StringUITests.m */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXContainerItemProxy section */ 21 | CF7064891FBC0E5200B0B300 /* PBXContainerItemProxy */ = { 22 | isa = PBXContainerItemProxy; 23 | containerPortal = CF7064681FBC0E5200B0B300 /* Project object */; 24 | proxyType = 1; 25 | remoteGlobalIDString = CF70646F1FBC0E5200B0B300; 26 | remoteInfo = "hello String"; 27 | }; 28 | CF7064941FBC0E5200B0B300 /* PBXContainerItemProxy */ = { 29 | isa = PBXContainerItemProxy; 30 | containerPortal = CF7064681FBC0E5200B0B300 /* Project object */; 31 | proxyType = 1; 32 | remoteGlobalIDString = CF70646F1FBC0E5200B0B300; 33 | remoteInfo = "hello String"; 34 | }; 35 | /* End PBXContainerItemProxy section */ 36 | 37 | /* Begin PBXFileReference section */ 38 | CF7064701FBC0E5200B0B300 /* hello String.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "hello String.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 39 | CF7064731FBC0E5200B0B300 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 40 | CF7064741FBC0E5200B0B300 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 41 | CF7064761FBC0E5200B0B300 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 42 | CF7064771FBC0E5200B0B300 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 43 | CF70647A1FBC0E5200B0B300 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 44 | CF70647C1FBC0E5200B0B300 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 45 | CF70647F1FBC0E5200B0B300 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 46 | CF7064811FBC0E5200B0B300 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 47 | CF7064821FBC0E5200B0B300 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 48 | CF7064881FBC0E5200B0B300 /* hello StringTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "hello StringTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 49 | CF70648C1FBC0E5200B0B300 /* hello_StringTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = hello_StringTests.m; sourceTree = ""; }; 50 | CF70648E1FBC0E5200B0B300 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 51 | CF7064931FBC0E5200B0B300 /* hello StringUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "hello StringUITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 52 | CF7064971FBC0E5200B0B300 /* hello_StringUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = hello_StringUITests.m; sourceTree = ""; }; 53 | CF7064991FBC0E5200B0B300 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 54 | /* End PBXFileReference section */ 55 | 56 | /* Begin PBXFrameworksBuildPhase section */ 57 | CF70646D1FBC0E5200B0B300 /* Frameworks */ = { 58 | isa = PBXFrameworksBuildPhase; 59 | buildActionMask = 2147483647; 60 | files = ( 61 | ); 62 | runOnlyForDeploymentPostprocessing = 0; 63 | }; 64 | CF7064851FBC0E5200B0B300 /* Frameworks */ = { 65 | isa = PBXFrameworksBuildPhase; 66 | buildActionMask = 2147483647; 67 | files = ( 68 | ); 69 | runOnlyForDeploymentPostprocessing = 0; 70 | }; 71 | CF7064901FBC0E5200B0B300 /* Frameworks */ = { 72 | isa = PBXFrameworksBuildPhase; 73 | buildActionMask = 2147483647; 74 | files = ( 75 | ); 76 | runOnlyForDeploymentPostprocessing = 0; 77 | }; 78 | /* End PBXFrameworksBuildPhase section */ 79 | 80 | /* Begin PBXGroup section */ 81 | CF7064671FBC0E5200B0B300 = { 82 | isa = PBXGroup; 83 | children = ( 84 | CF7064721FBC0E5200B0B300 /* hello String */, 85 | CF70648B1FBC0E5200B0B300 /* hello StringTests */, 86 | CF7064961FBC0E5200B0B300 /* hello StringUITests */, 87 | CF7064711FBC0E5200B0B300 /* Products */, 88 | ); 89 | sourceTree = ""; 90 | }; 91 | CF7064711FBC0E5200B0B300 /* Products */ = { 92 | isa = PBXGroup; 93 | children = ( 94 | CF7064701FBC0E5200B0B300 /* hello String.app */, 95 | CF7064881FBC0E5200B0B300 /* hello StringTests.xctest */, 96 | CF7064931FBC0E5200B0B300 /* hello StringUITests.xctest */, 97 | ); 98 | name = Products; 99 | sourceTree = ""; 100 | }; 101 | CF7064721FBC0E5200B0B300 /* hello String */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | CF7064731FBC0E5200B0B300 /* AppDelegate.h */, 105 | CF7064741FBC0E5200B0B300 /* AppDelegate.m */, 106 | CF7064761FBC0E5200B0B300 /* ViewController.h */, 107 | CF7064771FBC0E5200B0B300 /* ViewController.m */, 108 | CF7064791FBC0E5200B0B300 /* Main.storyboard */, 109 | CF70647C1FBC0E5200B0B300 /* Assets.xcassets */, 110 | CF70647E1FBC0E5200B0B300 /* LaunchScreen.storyboard */, 111 | CF7064811FBC0E5200B0B300 /* Info.plist */, 112 | CF7064821FBC0E5200B0B300 /* main.m */, 113 | ); 114 | path = "hello String"; 115 | sourceTree = ""; 116 | }; 117 | CF70648B1FBC0E5200B0B300 /* hello StringTests */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | CF70648C1FBC0E5200B0B300 /* hello_StringTests.m */, 121 | CF70648E1FBC0E5200B0B300 /* Info.plist */, 122 | ); 123 | path = "hello StringTests"; 124 | sourceTree = ""; 125 | }; 126 | CF7064961FBC0E5200B0B300 /* hello StringUITests */ = { 127 | isa = PBXGroup; 128 | children = ( 129 | CF7064971FBC0E5200B0B300 /* hello_StringUITests.m */, 130 | CF7064991FBC0E5200B0B300 /* Info.plist */, 131 | ); 132 | path = "hello StringUITests"; 133 | sourceTree = ""; 134 | }; 135 | /* End PBXGroup section */ 136 | 137 | /* Begin PBXNativeTarget section */ 138 | CF70646F1FBC0E5200B0B300 /* hello String */ = { 139 | isa = PBXNativeTarget; 140 | buildConfigurationList = CF70649C1FBC0E5200B0B300 /* Build configuration list for PBXNativeTarget "hello String" */; 141 | buildPhases = ( 142 | CF70646C1FBC0E5200B0B300 /* Sources */, 143 | CF70646D1FBC0E5200B0B300 /* Frameworks */, 144 | CF70646E1FBC0E5200B0B300 /* Resources */, 145 | ); 146 | buildRules = ( 147 | ); 148 | dependencies = ( 149 | ); 150 | name = "hello String"; 151 | productName = "hello String"; 152 | productReference = CF7064701FBC0E5200B0B300 /* hello String.app */; 153 | productType = "com.apple.product-type.application"; 154 | }; 155 | CF7064871FBC0E5200B0B300 /* hello StringTests */ = { 156 | isa = PBXNativeTarget; 157 | buildConfigurationList = CF70649F1FBC0E5200B0B300 /* Build configuration list for PBXNativeTarget "hello StringTests" */; 158 | buildPhases = ( 159 | CF7064841FBC0E5200B0B300 /* Sources */, 160 | CF7064851FBC0E5200B0B300 /* Frameworks */, 161 | CF7064861FBC0E5200B0B300 /* Resources */, 162 | ); 163 | buildRules = ( 164 | ); 165 | dependencies = ( 166 | CF70648A1FBC0E5200B0B300 /* PBXTargetDependency */, 167 | ); 168 | name = "hello StringTests"; 169 | productName = "hello StringTests"; 170 | productReference = CF7064881FBC0E5200B0B300 /* hello StringTests.xctest */; 171 | productType = "com.apple.product-type.bundle.unit-test"; 172 | }; 173 | CF7064921FBC0E5200B0B300 /* hello StringUITests */ = { 174 | isa = PBXNativeTarget; 175 | buildConfigurationList = CF7064A21FBC0E5200B0B300 /* Build configuration list for PBXNativeTarget "hello StringUITests" */; 176 | buildPhases = ( 177 | CF70648F1FBC0E5200B0B300 /* Sources */, 178 | CF7064901FBC0E5200B0B300 /* Frameworks */, 179 | CF7064911FBC0E5200B0B300 /* Resources */, 180 | ); 181 | buildRules = ( 182 | ); 183 | dependencies = ( 184 | CF7064951FBC0E5200B0B300 /* PBXTargetDependency */, 185 | ); 186 | name = "hello StringUITests"; 187 | productName = "hello StringUITests"; 188 | productReference = CF7064931FBC0E5200B0B300 /* hello StringUITests.xctest */; 189 | productType = "com.apple.product-type.bundle.ui-testing"; 190 | }; 191 | /* End PBXNativeTarget section */ 192 | 193 | /* Begin PBXProject section */ 194 | CF7064681FBC0E5200B0B300 /* Project object */ = { 195 | isa = PBXProject; 196 | attributes = { 197 | LastUpgradeCheck = 0910; 198 | ORGANIZATIONNAME = guogh_macBookPro; 199 | TargetAttributes = { 200 | CF70646F1FBC0E5200B0B300 = { 201 | CreatedOnToolsVersion = 9.1; 202 | ProvisioningStyle = Automatic; 203 | }; 204 | CF7064871FBC0E5200B0B300 = { 205 | CreatedOnToolsVersion = 9.1; 206 | ProvisioningStyle = Automatic; 207 | TestTargetID = CF70646F1FBC0E5200B0B300; 208 | }; 209 | CF7064921FBC0E5200B0B300 = { 210 | CreatedOnToolsVersion = 9.1; 211 | ProvisioningStyle = Automatic; 212 | TestTargetID = CF70646F1FBC0E5200B0B300; 213 | }; 214 | }; 215 | }; 216 | buildConfigurationList = CF70646B1FBC0E5200B0B300 /* Build configuration list for PBXProject "hello String" */; 217 | compatibilityVersion = "Xcode 8.0"; 218 | developmentRegion = en; 219 | hasScannedForEncodings = 0; 220 | knownRegions = ( 221 | en, 222 | Base, 223 | ); 224 | mainGroup = CF7064671FBC0E5200B0B300; 225 | productRefGroup = CF7064711FBC0E5200B0B300 /* Products */; 226 | projectDirPath = ""; 227 | projectRoot = ""; 228 | targets = ( 229 | CF70646F1FBC0E5200B0B300 /* hello String */, 230 | CF7064871FBC0E5200B0B300 /* hello StringTests */, 231 | CF7064921FBC0E5200B0B300 /* hello StringUITests */, 232 | ); 233 | }; 234 | /* End PBXProject section */ 235 | 236 | /* Begin PBXResourcesBuildPhase section */ 237 | CF70646E1FBC0E5200B0B300 /* Resources */ = { 238 | isa = PBXResourcesBuildPhase; 239 | buildActionMask = 2147483647; 240 | files = ( 241 | CF7064801FBC0E5200B0B300 /* LaunchScreen.storyboard in Resources */, 242 | CF70647D1FBC0E5200B0B300 /* Assets.xcassets in Resources */, 243 | CF70647B1FBC0E5200B0B300 /* Main.storyboard in Resources */, 244 | ); 245 | runOnlyForDeploymentPostprocessing = 0; 246 | }; 247 | CF7064861FBC0E5200B0B300 /* Resources */ = { 248 | isa = PBXResourcesBuildPhase; 249 | buildActionMask = 2147483647; 250 | files = ( 251 | ); 252 | runOnlyForDeploymentPostprocessing = 0; 253 | }; 254 | CF7064911FBC0E5200B0B300 /* Resources */ = { 255 | isa = PBXResourcesBuildPhase; 256 | buildActionMask = 2147483647; 257 | files = ( 258 | ); 259 | runOnlyForDeploymentPostprocessing = 0; 260 | }; 261 | /* End PBXResourcesBuildPhase section */ 262 | 263 | /* Begin PBXSourcesBuildPhase section */ 264 | CF70646C1FBC0E5200B0B300 /* Sources */ = { 265 | isa = PBXSourcesBuildPhase; 266 | buildActionMask = 2147483647; 267 | files = ( 268 | CF7064781FBC0E5200B0B300 /* ViewController.m in Sources */, 269 | CF7064831FBC0E5200B0B300 /* main.m in Sources */, 270 | CF7064751FBC0E5200B0B300 /* AppDelegate.m in Sources */, 271 | ); 272 | runOnlyForDeploymentPostprocessing = 0; 273 | }; 274 | CF7064841FBC0E5200B0B300 /* Sources */ = { 275 | isa = PBXSourcesBuildPhase; 276 | buildActionMask = 2147483647; 277 | files = ( 278 | CF70648D1FBC0E5200B0B300 /* hello_StringTests.m in Sources */, 279 | ); 280 | runOnlyForDeploymentPostprocessing = 0; 281 | }; 282 | CF70648F1FBC0E5200B0B300 /* Sources */ = { 283 | isa = PBXSourcesBuildPhase; 284 | buildActionMask = 2147483647; 285 | files = ( 286 | CF7064981FBC0E5200B0B300 /* hello_StringUITests.m in Sources */, 287 | ); 288 | runOnlyForDeploymentPostprocessing = 0; 289 | }; 290 | /* End PBXSourcesBuildPhase section */ 291 | 292 | /* Begin PBXTargetDependency section */ 293 | CF70648A1FBC0E5200B0B300 /* PBXTargetDependency */ = { 294 | isa = PBXTargetDependency; 295 | target = CF70646F1FBC0E5200B0B300 /* hello String */; 296 | targetProxy = CF7064891FBC0E5200B0B300 /* PBXContainerItemProxy */; 297 | }; 298 | CF7064951FBC0E5200B0B300 /* PBXTargetDependency */ = { 299 | isa = PBXTargetDependency; 300 | target = CF70646F1FBC0E5200B0B300 /* hello String */; 301 | targetProxy = CF7064941FBC0E5200B0B300 /* PBXContainerItemProxy */; 302 | }; 303 | /* End PBXTargetDependency section */ 304 | 305 | /* Begin PBXVariantGroup section */ 306 | CF7064791FBC0E5200B0B300 /* Main.storyboard */ = { 307 | isa = PBXVariantGroup; 308 | children = ( 309 | CF70647A1FBC0E5200B0B300 /* Base */, 310 | ); 311 | name = Main.storyboard; 312 | sourceTree = ""; 313 | }; 314 | CF70647E1FBC0E5200B0B300 /* LaunchScreen.storyboard */ = { 315 | isa = PBXVariantGroup; 316 | children = ( 317 | CF70647F1FBC0E5200B0B300 /* Base */, 318 | ); 319 | name = LaunchScreen.storyboard; 320 | sourceTree = ""; 321 | }; 322 | /* End PBXVariantGroup section */ 323 | 324 | /* Begin XCBuildConfiguration section */ 325 | CF70649A1FBC0E5200B0B300 /* Debug */ = { 326 | isa = XCBuildConfiguration; 327 | buildSettings = { 328 | ALWAYS_SEARCH_USER_PATHS = NO; 329 | CLANG_ANALYZER_NONNULL = YES; 330 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 331 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 332 | CLANG_CXX_LIBRARY = "libc++"; 333 | CLANG_ENABLE_MODULES = YES; 334 | CLANG_ENABLE_OBJC_ARC = YES; 335 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 336 | CLANG_WARN_BOOL_CONVERSION = YES; 337 | CLANG_WARN_COMMA = YES; 338 | CLANG_WARN_CONSTANT_CONVERSION = YES; 339 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 340 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 341 | CLANG_WARN_EMPTY_BODY = YES; 342 | CLANG_WARN_ENUM_CONVERSION = YES; 343 | CLANG_WARN_INFINITE_RECURSION = YES; 344 | CLANG_WARN_INT_CONVERSION = YES; 345 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 346 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 347 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 348 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 349 | CLANG_WARN_STRICT_PROTOTYPES = YES; 350 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 351 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 352 | CLANG_WARN_UNREACHABLE_CODE = YES; 353 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 354 | CODE_SIGN_IDENTITY = "iPhone Developer"; 355 | COPY_PHASE_STRIP = NO; 356 | DEBUG_INFORMATION_FORMAT = dwarf; 357 | ENABLE_STRICT_OBJC_MSGSEND = YES; 358 | ENABLE_TESTABILITY = YES; 359 | GCC_C_LANGUAGE_STANDARD = gnu11; 360 | GCC_DYNAMIC_NO_PIC = NO; 361 | GCC_NO_COMMON_BLOCKS = YES; 362 | GCC_OPTIMIZATION_LEVEL = 0; 363 | GCC_PREPROCESSOR_DEFINITIONS = ( 364 | "DEBUG=1", 365 | "$(inherited)", 366 | ); 367 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 368 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 369 | GCC_WARN_UNDECLARED_SELECTOR = YES; 370 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 371 | GCC_WARN_UNUSED_FUNCTION = YES; 372 | GCC_WARN_UNUSED_VARIABLE = YES; 373 | IPHONEOS_DEPLOYMENT_TARGET = 11.1; 374 | MTL_ENABLE_DEBUG_INFO = YES; 375 | ONLY_ACTIVE_ARCH = YES; 376 | SDKROOT = iphoneos; 377 | }; 378 | name = Debug; 379 | }; 380 | CF70649B1FBC0E5200B0B300 /* Release */ = { 381 | isa = XCBuildConfiguration; 382 | buildSettings = { 383 | ALWAYS_SEARCH_USER_PATHS = NO; 384 | CLANG_ANALYZER_NONNULL = YES; 385 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 386 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 387 | CLANG_CXX_LIBRARY = "libc++"; 388 | CLANG_ENABLE_MODULES = YES; 389 | CLANG_ENABLE_OBJC_ARC = YES; 390 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 391 | CLANG_WARN_BOOL_CONVERSION = YES; 392 | CLANG_WARN_COMMA = YES; 393 | CLANG_WARN_CONSTANT_CONVERSION = YES; 394 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 395 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 396 | CLANG_WARN_EMPTY_BODY = YES; 397 | CLANG_WARN_ENUM_CONVERSION = YES; 398 | CLANG_WARN_INFINITE_RECURSION = YES; 399 | CLANG_WARN_INT_CONVERSION = YES; 400 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 401 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 402 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 403 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 404 | CLANG_WARN_STRICT_PROTOTYPES = YES; 405 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 406 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 407 | CLANG_WARN_UNREACHABLE_CODE = YES; 408 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 409 | CODE_SIGN_IDENTITY = "iPhone Developer"; 410 | COPY_PHASE_STRIP = NO; 411 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 412 | ENABLE_NS_ASSERTIONS = NO; 413 | ENABLE_STRICT_OBJC_MSGSEND = YES; 414 | GCC_C_LANGUAGE_STANDARD = gnu11; 415 | GCC_NO_COMMON_BLOCKS = YES; 416 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 417 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 418 | GCC_WARN_UNDECLARED_SELECTOR = YES; 419 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 420 | GCC_WARN_UNUSED_FUNCTION = YES; 421 | GCC_WARN_UNUSED_VARIABLE = YES; 422 | IPHONEOS_DEPLOYMENT_TARGET = 11.1; 423 | MTL_ENABLE_DEBUG_INFO = NO; 424 | SDKROOT = iphoneos; 425 | VALIDATE_PRODUCT = YES; 426 | }; 427 | name = Release; 428 | }; 429 | CF70649D1FBC0E5200B0B300 /* Debug */ = { 430 | isa = XCBuildConfiguration; 431 | buildSettings = { 432 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 433 | CODE_SIGN_STYLE = Automatic; 434 | DEVELOPMENT_TEAM = 22DBSR3WQ7; 435 | ENABLE_BITCODE = NO; 436 | INFOPLIST_FILE = "hello String/Info.plist"; 437 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 438 | PRODUCT_BUNDLE_IDENTIFIER = "ghj.hello-String"; 439 | PRODUCT_NAME = "$(TARGET_NAME)"; 440 | TARGETED_DEVICE_FAMILY = "1,2"; 441 | }; 442 | name = Debug; 443 | }; 444 | CF70649E1FBC0E5200B0B300 /* Release */ = { 445 | isa = XCBuildConfiguration; 446 | buildSettings = { 447 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 448 | CODE_SIGN_STYLE = Automatic; 449 | DEVELOPMENT_TEAM = 22DBSR3WQ7; 450 | ENABLE_BITCODE = NO; 451 | INFOPLIST_FILE = "hello String/Info.plist"; 452 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 453 | PRODUCT_BUNDLE_IDENTIFIER = "ghj.hello-String"; 454 | PRODUCT_NAME = "$(TARGET_NAME)"; 455 | TARGETED_DEVICE_FAMILY = "1,2"; 456 | }; 457 | name = Release; 458 | }; 459 | CF7064A01FBC0E5200B0B300 /* Debug */ = { 460 | isa = XCBuildConfiguration; 461 | buildSettings = { 462 | BUNDLE_LOADER = "$(TEST_HOST)"; 463 | CODE_SIGN_STYLE = Automatic; 464 | INFOPLIST_FILE = "hello StringTests/Info.plist"; 465 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 466 | PRODUCT_BUNDLE_IDENTIFIER = "ghj.hello-StringTests"; 467 | PRODUCT_NAME = "$(TARGET_NAME)"; 468 | TARGETED_DEVICE_FAMILY = "1,2"; 469 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/hello String.app/hello String"; 470 | }; 471 | name = Debug; 472 | }; 473 | CF7064A11FBC0E5200B0B300 /* Release */ = { 474 | isa = XCBuildConfiguration; 475 | buildSettings = { 476 | BUNDLE_LOADER = "$(TEST_HOST)"; 477 | CODE_SIGN_STYLE = Automatic; 478 | INFOPLIST_FILE = "hello StringTests/Info.plist"; 479 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 480 | PRODUCT_BUNDLE_IDENTIFIER = "ghj.hello-StringTests"; 481 | PRODUCT_NAME = "$(TARGET_NAME)"; 482 | TARGETED_DEVICE_FAMILY = "1,2"; 483 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/hello String.app/hello String"; 484 | }; 485 | name = Release; 486 | }; 487 | CF7064A31FBC0E5200B0B300 /* Debug */ = { 488 | isa = XCBuildConfiguration; 489 | buildSettings = { 490 | CODE_SIGN_STYLE = Automatic; 491 | INFOPLIST_FILE = "hello StringUITests/Info.plist"; 492 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 493 | PRODUCT_BUNDLE_IDENTIFIER = "ghj.hello-StringUITests"; 494 | PRODUCT_NAME = "$(TARGET_NAME)"; 495 | TARGETED_DEVICE_FAMILY = "1,2"; 496 | TEST_TARGET_NAME = "hello String"; 497 | }; 498 | name = Debug; 499 | }; 500 | CF7064A41FBC0E5200B0B300 /* Release */ = { 501 | isa = XCBuildConfiguration; 502 | buildSettings = { 503 | CODE_SIGN_STYLE = Automatic; 504 | INFOPLIST_FILE = "hello StringUITests/Info.plist"; 505 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 506 | PRODUCT_BUNDLE_IDENTIFIER = "ghj.hello-StringUITests"; 507 | PRODUCT_NAME = "$(TARGET_NAME)"; 508 | TARGETED_DEVICE_FAMILY = "1,2"; 509 | TEST_TARGET_NAME = "hello String"; 510 | }; 511 | name = Release; 512 | }; 513 | /* End XCBuildConfiguration section */ 514 | 515 | /* Begin XCConfigurationList section */ 516 | CF70646B1FBC0E5200B0B300 /* Build configuration list for PBXProject "hello String" */ = { 517 | isa = XCConfigurationList; 518 | buildConfigurations = ( 519 | CF70649A1FBC0E5200B0B300 /* Debug */, 520 | CF70649B1FBC0E5200B0B300 /* Release */, 521 | ); 522 | defaultConfigurationIsVisible = 0; 523 | defaultConfigurationName = Release; 524 | }; 525 | CF70649C1FBC0E5200B0B300 /* Build configuration list for PBXNativeTarget "hello String" */ = { 526 | isa = XCConfigurationList; 527 | buildConfigurations = ( 528 | CF70649D1FBC0E5200B0B300 /* Debug */, 529 | CF70649E1FBC0E5200B0B300 /* Release */, 530 | ); 531 | defaultConfigurationIsVisible = 0; 532 | defaultConfigurationName = Release; 533 | }; 534 | CF70649F1FBC0E5200B0B300 /* Build configuration list for PBXNativeTarget "hello StringTests" */ = { 535 | isa = XCConfigurationList; 536 | buildConfigurations = ( 537 | CF7064A01FBC0E5200B0B300 /* Debug */, 538 | CF7064A11FBC0E5200B0B300 /* Release */, 539 | ); 540 | defaultConfigurationIsVisible = 0; 541 | defaultConfigurationName = Release; 542 | }; 543 | CF7064A21FBC0E5200B0B300 /* Build configuration list for PBXNativeTarget "hello StringUITests" */ = { 544 | isa = XCConfigurationList; 545 | buildConfigurations = ( 546 | CF7064A31FBC0E5200B0B300 /* Debug */, 547 | CF7064A41FBC0E5200B0B300 /* Release */, 548 | ); 549 | defaultConfigurationIsVisible = 0; 550 | defaultConfigurationName = Release; 551 | }; 552 | /* End XCConfigurationList section */ 553 | }; 554 | rootObject = CF7064681FBC0E5200B0B300 /* Project object */; 555 | } 556 | -------------------------------------------------------------------------------- /字符串硬编码混淆/hello String/hello String.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /字符串硬编码混淆/hello String/hello String.xcodeproj/project.xcworkspace/xcuserdata/guogh.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guogh/iOSApplicationReinforcement/8c4664f5eaf0929b9d1a36f74c87691af80512ca/字符串硬编码混淆/hello String/hello String.xcodeproj/project.xcworkspace/xcuserdata/guogh.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /字符串硬编码混淆/hello String/hello String.xcodeproj/xcuserdata/guogh.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | hello String.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /字符串硬编码混淆/hello String/hello String/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // hello String 4 | // 5 | // Created by guogh_macBookPro on 2017/11/15. 6 | // Copyright © 2017年 guogh_macBookPro. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /字符串硬编码混淆/hello String/hello String/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // hello String 4 | // 5 | // Created by guogh_macBookPro on 2017/11/15. 6 | // Copyright © 2017年 guogh_macBookPro. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // 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. 26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 27 | } 28 | 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // 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. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // 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. 38 | } 39 | 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // 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. 43 | } 44 | 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /字符串硬编码混淆/hello String/hello String/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 | } -------------------------------------------------------------------------------- /字符串硬编码混淆/hello String/hello String/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 | -------------------------------------------------------------------------------- /字符串硬编码混淆/hello String/hello String/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 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /字符串硬编码混淆/hello String/hello String/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 | -------------------------------------------------------------------------------- /字符串硬编码混淆/hello String/hello String/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // hello String 4 | // 5 | // Created by guogh_macBookPro on 2017/11/15. 6 | // Copyright © 2017年 guogh_macBookPro. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /字符串硬编码混淆/hello String/hello String/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // hello String 4 | // 5 | // Created by guogh_macBookPro on 2017/11/15. 6 | // Copyright © 2017年 guogh_macBookPro. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | /* 12 | * 字符串混淆解密函数,将char[] 形式字符数组和 aa异或运算揭秘 13 | * 如果没有经过混淆,请关闭宏开关 14 | */ 15 | extern char* decryptConstString(char* string) 16 | { 17 | char* origin_string = string; 18 | while(*string) { 19 | *string ^= 0xAA; 20 | string++; 21 | } 22 | return origin_string; 23 | } 24 | 25 | 26 | //字符串混淆加密 和 解密的宏开关 27 | //#define ggh_confusion 28 | #ifdef ggh_confusion 29 | #define confusion_NSSTRING(string) [NSString stringWithUTF8String:decryptConstString(string)] 30 | #define confusion_CSTRING(string) decryptConstString(string) 31 | #else 32 | #define confusion_NSSTRING(string) @string 33 | #define confusion_CSTRING(string) string 34 | #endif 35 | 36 | 37 | 38 | @implementation ViewController 39 | 40 | - (void)viewDidLoad { 41 | [super viewDidLoad]; 42 | 43 | NSString *string = confusion_NSSTRING("hello world"); 44 | NSLog(@"%@",string); 45 | 46 | //只能混淆英文,暂不支持中文编码 47 | NSString *string1 = @"只能混淆英文,暂不支持中文编码"; 48 | NSLog(@"%@",string1); 49 | } 50 | 51 | 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /字符串硬编码混淆/hello String/hello String/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // hello String 4 | // 5 | // Created by guogh_macBookPro on 2017/11/15. 6 | // Copyright © 2017年 guogh_macBookPro. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /字符串硬编码混淆/hello String/hello StringTests/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 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /字符串硬编码混淆/hello String/hello StringTests/hello_StringTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // hello_StringTests.m 3 | // hello StringTests 4 | // 5 | // Created by guogh_macBookPro on 2017/11/15. 6 | // Copyright © 2017年 guogh_macBookPro. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface hello_StringTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation hello_StringTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /字符串硬编码混淆/hello String/hello StringUITests/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 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /字符串硬编码混淆/hello String/hello StringUITests/hello_StringUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // hello_StringUITests.m 3 | // hello StringUITests 4 | // 5 | // Created by guogh_macBookPro on 2017/11/15. 6 | // Copyright © 2017年 guogh_macBookPro. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface hello_StringUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation hello_StringUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /字符串硬编码混淆/iOS字符串硬编码混淆.md: -------------------------------------------------------------------------------- 1 | # iOS字符串硬编码混淆 2 | 3 | ### 前提 4 | 众所周知iOS应用在越狱设备上比较容易被逆向分析,而静态字符串的硬编码比较容易成为逆向者的突破口。因此有必要做一些字符串硬编码的混淆,如加密的对称加密key,md5的key,域名,接口名等。 5 | 6 | ### 混淆前 7 | 混淆前代码 8 | 9 | ``` 10 | @implementation ViewController 11 | 12 | - (void)viewDidLoad { 13 | [super viewDidLoad]; 14 | 15 | NSString *string = @"hello world"; 16 | NSLog(@"%@",string); 17 | } 18 | 19 | @end 20 | ``` 21 | 直接在源代码里面编写字符串,使用hopper可直接找到该串 22 | ![未混淆](未混淆.png) 23 | 24 | ### 混淆方案 25 | 这里采用的是直接修改源代码的方式做混淆。首先对需要混淆的字符串用宏打上标记,然后使用脚本过滤所有源代码,生成混淆过的代码。因为混淆过的代码可读性极差,不利于维护,所以就需要解混淆代码,用于把混淆过的代码做还原。 26 | 27 | ##### 混淆脚本 28 | ``` 29 | #!/usr/bin/env python 30 | # encoding=utf8 31 | # -*- coding: utf-8 -*- 32 | # 本脚本用于对源代码中的字符串进行加密 33 | # 替换所有字符串常量为加密的char数组,形式((char[]){1, 2, 3, 0}) 34 | 35 | import importlib 36 | import os 37 | import re 38 | import sys 39 | 40 | 41 | # 替换字符串为((char[]){1, 2, 3, 0})的形式,同时让每个字节与0xAA异或进行加密 42 | def replace(match): 43 | string = match.group(2) + '\x00' 44 | replaced_string = '((char []) {' + ', '.join(["%i" % ((ord(c) ^ 0xAA) if c != '\0' else 0) for c in list(string)]) + '})' 45 | return match.group(1) + replaced_string + match.group(3) 46 | 47 | 48 | # 修改源代码,加入字符串加密的函数 49 | def obfuscate(file): 50 | with open(file, 'r') as f: 51 | code = f.read() 52 | f.close() 53 | code = re.sub(r'(confusion_NSSTRING\(|confusion_CSTRING\()"(.*?)"(\))', replace, code) 54 | code = re.sub(r'//#define ggh_confusion', '#define ggh_confusion', code) 55 | with open(file, 'w') as f: 56 | f.write(code) 57 | f.close() 58 | 59 | 60 | #读取源码路径下的所有.h和.m 文件 61 | def openSrcFile(path): 62 | print("开始处理路径: "+ path +" 下的所有.h和.m文件") 63 | # this folder is custom 64 | for parent,dirnames,filenames in os.walk(path): 65 | #case 1: 66 | # for dirname in dirnames: 67 | # print((" parent folder is:" + parent).encode('utf-8')) 68 | # print((" dirname is:" + dirname).encode('utf-8')) 69 | #case 2 70 | for filename in filenames: 71 | extendedName = os.path.splitext(os.path.join(parent,filename)) 72 | if (extendedName[1] == '.h' or extendedName[1] == '.m'): 73 | print("处理源代码文件: "+ os.path.join(parent,filename)) 74 | obfuscate(os.path.join(parent,filename)) 75 | 76 | 77 | #源码路径 78 | srcPath = '../hello String' 79 | 80 | if __name__ == '__main__': 81 | print("本脚本用于对源代码中被标记的字符串进行加密") 82 | 83 | if len(srcPath) > 0: 84 | openSrcFile(srcPath) 85 | else: 86 | print("请输入正确的源代码路径") 87 | sys.exit() 88 | 89 | ``` 90 | 运行该脚本 ``` $ python3 confusion.py ``` 把标记过的代码混淆。 91 | 92 | ##### 生成混淆代码 93 | 94 | ``` 95 | /* 96 | * 字符串混淆解密函数,将char[] 形式字符数组和 aa异或运算揭秘 97 | * 如果没有经过混淆,请关闭宏开关 98 | */ 99 | extern char* decryptConstString(char* string) 100 | { 101 | char* origin_string = string; 102 | while(*string) { 103 | *string ^= 0xAA; 104 | string++; 105 | } 106 | return origin_string; 107 | } 108 | 109 | 110 | //字符串混淆加密 和 解密的宏开关 111 | #define ggh_confusion 112 | #ifdef ggh_confusion 113 | #define confusion_NSSTRING(string) [NSString stringWithUTF8String:decryptConstString(string)] 114 | #define confusion_CSTRING(string) decryptConstString(string) 115 | #else 116 | #define confusion_NSSTRING(string) @string 117 | #define confusion_CSTRING(string) string 118 | #endif 119 | 120 | 121 | 122 | @implementation ViewController 123 | 124 | - (void)viewDidLoad { 125 | [super viewDidLoad]; 126 | 127 | NSString *string = confusion_NSSTRING(((char []) {194, 207, 198, 198, 197, 138, 221, 197, 216, 198, 206, 0})); 128 | NSLog(@"%@",string); 129 | } 130 | 131 | @end 132 | ``` 133 | 134 | 混淆后的代码已经看不到硬编码了。在内联函数中做异或运算。 135 | ![混淆后](已混淆.png) 136 | 137 | ##### 解混淆脚本 138 | 解混淆脚本用于还原代码,增加代码可读性。 139 | 140 | ``` 141 | #!/usr/bin/env python 142 | # encoding=utf8 143 | # -*- coding: utf-8 -*- 144 | # 本脚本用于对源代码中的字符串进行解密 145 | # 替换所有加密的char数组为字符串常量,"" 146 | 147 | import importlib 148 | import os 149 | import re 150 | import sys 151 | 152 | 153 | # 替换((char[]){1, 2, 3, 0})的形式为字符串,同时让每个数组值与0xAA异或进行解密 154 | def replace(match): 155 | string = match.group(2) 156 | decodeConfusion_string = "" 157 | for numberStr in list(string.split(',')): 158 | if int(numberStr) != 0: 159 | decodeConfusion_string = decodeConfusion_string + "%c" % (int(numberStr) ^ 0xAA) 160 | 161 | # replaced_string = '\"' + "".join(["%c" % ((int(c) ^ 0xAA) if int(c) != 0 else '\0') for c in string.split(',')]) + '\"' 162 | replaced_string = '\"' + decodeConfusion_string + '\"' 163 | print("replaced_string = " + replaced_string) 164 | 165 | return match.group(1) + replaced_string + match.group(3) 166 | 167 | 168 | # 修改源代码,加入字符串加密的函数 169 | def obfuscate(file): 170 | with open(file, 'r') as f: 171 | code = f.read() 172 | f.close() 173 | code = re.sub(r'(confusion_NSSTRING\(|confusion_CSTRING\()\(\(char \[\]\) \{(.*?)\}\)(\))', replace, code) 174 | code = re.sub(r'[/]*#define ggh_confusion', '//#define ggh_confusion', code) 175 | with open(file, 'w') as f: 176 | f.write(code) 177 | f.close() 178 | 179 | 180 | #读取源码路径下的所有.h和.m 文件 181 | def openSrcFile(path): 182 | print("开始处理路径: "+ path +" 下的所有.h和.m文件") 183 | # this folder is custom 184 | for parent,dirnames,filenames in os.walk(path): 185 | #case 1: 186 | # for dirname in dirnames: 187 | # print((" parent folder is:" + parent).encode('utf-8')) 188 | # print((" dirname is:" + dirname).encode('utf-8')) 189 | #case 2 190 | for filename in filenames: 191 | extendedName = os.path.splitext(os.path.join(parent,filename)) 192 | #读取所有.h和.m 的源文件 193 | if (extendedName[1] == '.h' or extendedName[1] == '.m'): 194 | print("处理代码文件:"+ os.path.join(parent,filename)) 195 | obfuscate(os.path.join(parent,filename)) 196 | 197 | 198 | #源码路径 199 | srcPath = '../hello String' 200 | if __name__ == '__main__': 201 | print("字符串解混淆脚本,将被标记过的char数组转为字符串,并和0xAA异或。还原代码") 202 | if len(srcPath) > 0: 203 | openSrcFile(srcPath) 204 | else: 205 | print("请输入正确的源代码路径!") 206 | sys.exit() 207 | 208 | ``` 209 | 210 | ### 混淆原理 211 | 因为硬编码的字符串是在可执行文件 Mach-O 全局的数据区,在符号表中很容易被搜索到,而字符串数组则不会。 212 | 213 | ### 总结 214 | 混淆方案多种多样,个有优缺点。个人认为最好的方式是依据Clang 抽象语法树AST,做全局混淆。另外,该方法还可以做方法名,类名,属性名等的混淆,只是全局混淆不能对所有名称做混淆,如一些系统控件的代理方法等。 215 | -------------------------------------------------------------------------------- /字符串硬编码混淆/已混淆.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guogh/iOSApplicationReinforcement/8c4664f5eaf0929b9d1a36f74c87691af80512ca/字符串硬编码混淆/已混淆.png -------------------------------------------------------------------------------- /字符串硬编码混淆/未混淆.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guogh/iOSApplicationReinforcement/8c4664f5eaf0929b9d1a36f74c87691af80512ca/字符串硬编码混淆/未混淆.png --------------------------------------------------------------------------------