├── .gitignore ├── Dyamk ├── DYAEngine.h └── DYAEngine.m ├── DyamkClient.podspec ├── DyamkDemoApp ├── DyamkDemoApp.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── DyamkDemoApp.xcworkspace │ └── contents.xcworkspacedata ├── DyamkDemoApp │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Info.plist │ ├── ViewController.h │ ├── ViewController.m │ └── main.m └── Podfile ├── DyamkInjector ├── DyamkInjector.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata └── DyamkInjector │ ├── DyamkCodePlayground.h │ ├── DyamkCodePlayground.m │ ├── Info.plist │ ├── core │ ├── DyamkNativeInjector.h │ ├── DyamkNativeInjector.m │ └── DyamkNativeInjector.m-e │ ├── py │ └── trigger.py │ ├── sh │ ├── clear.sh │ ├── replace.sh │ └── run.sh │ └── tool │ ├── DyamkEventTool.h │ ├── DyamkEventTool.m │ ├── DyamkUIAspectTool.h │ └── DyamkUIAspectTool.m ├── LICENSE ├── README.md ├── arch ├── arch.graffle │ ├── data.plist │ ├── image2.png │ ├── image3.png │ ├── image4.png │ ├── image5.png │ ├── image6.png │ ├── image7.png │ └── image8.png └── arch.png ├── install.sh └── uninstall.sh /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | # CocoaPods 32 | # 33 | # We recommend against adding the Pods directory to your .gitignore. However 34 | # you should judge for yourself, the pros and cons are mentioned at: 35 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 36 | # 37 | Pods/ 38 | 39 | # Carthage 40 | # 41 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 42 | # Carthage/Checkouts 43 | 44 | Carthage/Build 45 | 46 | # fastlane 47 | # 48 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 49 | # screenshots whenever they are needed. 50 | # For more information about the recommended setup visit: 51 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 52 | 53 | fastlane/report.xml 54 | fastlane/Preview.html 55 | fastlane/screenshots/**/*.png 56 | fastlane/test_output 57 | 58 | # Code Injection 59 | # 60 | # After new code Injection tools there's a generated folder /iOSInjectionProject 61 | # https://github.com/johnno1962/injectionforxcode 62 | 63 | iOSInjectionProject/ 64 | -------------------------------------------------------------------------------- /Dyamk/DYAEngine.h: -------------------------------------------------------------------------------- 1 | // 2 | // DYAEngine.h 3 | // DynamicKit 4 | // 5 | // Created by soulghost on 22/6/2018. 6 | // Copyright © 2018 soulghost. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DYAEngine : NSObject 12 | 13 | - (BOOL)startAtPort:(uint16_t)port error:(NSError **)error; 14 | - (void)stop; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Dyamk/DYAEngine.m: -------------------------------------------------------------------------------- 1 | // 2 | // DYAEngine.m 3 | // DynamicKit 4 | // 5 | // Created by soulghost on 22/6/2018. 6 | // Copyright © 2018 soulghost. All rights reserved. 7 | // 8 | 9 | #import "DYAEngine.h" 10 | #import 11 | #import 12 | 13 | @interface DYAEngine () 14 | 15 | @property (nonatomic, strong) GCDAsyncSocket *server; 16 | @property (nonatomic, assign) NSInteger currentDylibNo; 17 | 18 | @end 19 | 20 | @implementation DYAEngine 21 | 22 | - (BOOL)startAtPort:(uint16_t)port error:(NSError *__autoreleasing *)error { 23 | if (self.server.isConnected) { 24 | [self.server disconnect]; 25 | } 26 | GCDAsyncSocket *server = [[GCDAsyncSocket alloc] initWithDelegate:self delegateQueue:dispatch_get_global_queue(0, 0)]; 27 | self.server = server; 28 | NSError *err = nil; 29 | [server acceptOnPort:port error:&err]; 30 | if (err) { 31 | if (error != nil) { 32 | *error = err; 33 | } 34 | return NO; 35 | } 36 | return YES; 37 | } 38 | 39 | - (void)stop { 40 | [self.server disconnect]; 41 | self.server = nil; 42 | } 43 | 44 | - (void)performDylib { 45 | NSString *libPath = @"/opt/Dyamk/dylib/DyamkInjector.framework"; 46 | libPath = [libPath stringByAppendingPathComponent:[NSString stringWithFormat:@"DyamkInjector_%@", @(self.currentDylibNo)]]; 47 | void *handle = dlopen(libPath.UTF8String, RTLD_NOW); 48 | if (!handle) { 49 | NSLog(@"Error: cannot find <%@>", libPath); 50 | return; 51 | } 52 | NSString *className = [NSString stringWithFormat:@"DyamkNativeInjector_%@", @(self.currentDylibNo)]; 53 | Class class = NSClassFromString(className); 54 | if (class == nil) { 55 | NSLog(@"Error: cannot find class %@", className); 56 | dlclose(handle); 57 | return; 58 | } 59 | [class performSelector:@selector(run)]; 60 | dlclose(handle); 61 | } 62 | 63 | #pragma mark - GCDAsyncSocket Delegate 64 | - (void)socket:(GCDAsyncSocket *)sock didReadData:(NSData *)data withTag:(long)tag { 65 | NSString *dylibNoStr = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; 66 | self.currentDylibNo = [dylibNoStr intValue]; 67 | dispatch_async(dispatch_get_main_queue(), ^{ 68 | [self performDylib]; 69 | }); 70 | } 71 | 72 | - (void)socket:(GCDAsyncSocket *)sock didAcceptNewSocket:(GCDAsyncSocket *)newSocket { 73 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 74 | [newSocket readDataWithTimeout:-1 tag:0]; 75 | }); 76 | } 77 | 78 | @end 79 | -------------------------------------------------------------------------------- /DyamkClient.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod spec lint DyamkClient.podspec' to ensure this is a 3 | # valid spec and to remove all comments including this before submitting the spec. 4 | # 5 | # To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html 6 | # To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/ 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | 11 | s.name = "DyamkClient" 12 | s.version = "0.0.1" 13 | s.summary = "A short description of DyamkClient." 14 | s.description = <<-DESC 15 | a client for Dyamk Injector to inject native code into running apps. 16 | DESC 17 | 18 | s.homepage = "https://github.com/Soulghost/Dyamk" 19 | s.license = { :type => "MIT", :file => "LICENSE" } 20 | s.author = { "xiuyutong" => "xiuyutong1994@163.com" } 21 | s.social_media_url = "https://twitter.com/Soulghost4" 22 | 23 | s.platform = :ios 24 | s.platform = :ios, "7.0" 25 | 26 | s.source = { :git => "https://github.com/Soulghost/Dyamk", :tag => "#{s.version}" } 27 | s.source_files = "Dyamk/**/*.{h,m}" 28 | s.public_header_files = "Dyamk/**/*.h" 29 | 30 | s.requires_arc = true 31 | s.dependency "CocoaAsyncSocket" 32 | 33 | #s.script_phase = { :name => '[Dyamk] Reset Framework Version', :script => 'rm /opt/Dyamk/dylib/framework_version || true' } 34 | end 35 | -------------------------------------------------------------------------------- /DyamkDemoApp/DyamkDemoApp.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 48; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 68DF1F1120DD2462000974E7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 68DF1F1020DD2462000974E7 /* AppDelegate.m */; }; 11 | 68DF1F1420DD2462000974E7 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 68DF1F1320DD2462000974E7 /* ViewController.m */; }; 12 | 68DF1F1720DD2462000974E7 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 68DF1F1520DD2462000974E7 /* Main.storyboard */; }; 13 | 68DF1F1920DD2462000974E7 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 68DF1F1820DD2462000974E7 /* Assets.xcassets */; }; 14 | 68DF1F1C20DD2462000974E7 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 68DF1F1A20DD2462000974E7 /* LaunchScreen.storyboard */; }; 15 | 68DF1F1F20DD2462000974E7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 68DF1F1E20DD2462000974E7 /* main.m */; }; 16 | EDB8A0F54A13B772E9024A21 /* libPods-DyamkDemoApp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DB7C60B5FBFD3CDD040EF23 /* libPods-DyamkDemoApp.a */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXFileReference section */ 20 | 1DB7C60B5FBFD3CDD040EF23 /* libPods-DyamkDemoApp.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-DyamkDemoApp.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 21 | 208D9729BF10439A85048091 /* Pods-DyamkDemoApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DyamkDemoApp.debug.xcconfig"; path = "Pods/Target Support Files/Pods-DyamkDemoApp/Pods-DyamkDemoApp.debug.xcconfig"; sourceTree = ""; }; 22 | 68DF1F0C20DD2462000974E7 /* DyamkDemoApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DyamkDemoApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; 23 | 68DF1F0F20DD2462000974E7 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 24 | 68DF1F1020DD2462000974E7 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 25 | 68DF1F1220DD2462000974E7 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 26 | 68DF1F1320DD2462000974E7 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 27 | 68DF1F1620DD2462000974E7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 28 | 68DF1F1820DD2462000974E7 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 29 | 68DF1F1B20DD2462000974E7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 30 | 68DF1F1D20DD2462000974E7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 31 | 68DF1F1E20DD2462000974E7 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 32 | 7ED4204DE05AC45ED84623C5 /* Pods-DyamkDemoApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DyamkDemoApp.release.xcconfig"; path = "Pods/Target Support Files/Pods-DyamkDemoApp/Pods-DyamkDemoApp.release.xcconfig"; sourceTree = ""; }; 33 | /* End PBXFileReference section */ 34 | 35 | /* Begin PBXFrameworksBuildPhase section */ 36 | 68DF1F0920DD2462000974E7 /* Frameworks */ = { 37 | isa = PBXFrameworksBuildPhase; 38 | buildActionMask = 2147483647; 39 | files = ( 40 | EDB8A0F54A13B772E9024A21 /* libPods-DyamkDemoApp.a in Frameworks */, 41 | ); 42 | runOnlyForDeploymentPostprocessing = 0; 43 | }; 44 | /* End PBXFrameworksBuildPhase section */ 45 | 46 | /* Begin PBXGroup section */ 47 | 21D22DA590343A2DAC82273F /* Pods */ = { 48 | isa = PBXGroup; 49 | children = ( 50 | 208D9729BF10439A85048091 /* Pods-DyamkDemoApp.debug.xcconfig */, 51 | 7ED4204DE05AC45ED84623C5 /* Pods-DyamkDemoApp.release.xcconfig */, 52 | ); 53 | name = Pods; 54 | sourceTree = ""; 55 | }; 56 | 68DF1F0320DD2462000974E7 = { 57 | isa = PBXGroup; 58 | children = ( 59 | 68DF1F0E20DD2462000974E7 /* DyamkDemoApp */, 60 | 68DF1F0D20DD2462000974E7 /* Products */, 61 | 21D22DA590343A2DAC82273F /* Pods */, 62 | 7D20CEFD170FA03B870652F6 /* Frameworks */, 63 | ); 64 | sourceTree = ""; 65 | }; 66 | 68DF1F0D20DD2462000974E7 /* Products */ = { 67 | isa = PBXGroup; 68 | children = ( 69 | 68DF1F0C20DD2462000974E7 /* DyamkDemoApp.app */, 70 | ); 71 | name = Products; 72 | sourceTree = ""; 73 | }; 74 | 68DF1F0E20DD2462000974E7 /* DyamkDemoApp */ = { 75 | isa = PBXGroup; 76 | children = ( 77 | 68DF1F0F20DD2462000974E7 /* AppDelegate.h */, 78 | 68DF1F1020DD2462000974E7 /* AppDelegate.m */, 79 | 68DF1F1220DD2462000974E7 /* ViewController.h */, 80 | 68DF1F1320DD2462000974E7 /* ViewController.m */, 81 | 68DF1F1520DD2462000974E7 /* Main.storyboard */, 82 | 68DF1F1820DD2462000974E7 /* Assets.xcassets */, 83 | 68DF1F1A20DD2462000974E7 /* LaunchScreen.storyboard */, 84 | 68DF1F1D20DD2462000974E7 /* Info.plist */, 85 | 68DF1F1E20DD2462000974E7 /* main.m */, 86 | ); 87 | path = DyamkDemoApp; 88 | sourceTree = ""; 89 | }; 90 | 7D20CEFD170FA03B870652F6 /* Frameworks */ = { 91 | isa = PBXGroup; 92 | children = ( 93 | 1DB7C60B5FBFD3CDD040EF23 /* libPods-DyamkDemoApp.a */, 94 | ); 95 | name = Frameworks; 96 | sourceTree = ""; 97 | }; 98 | /* End PBXGroup section */ 99 | 100 | /* Begin PBXNativeTarget section */ 101 | 68DF1F0B20DD2462000974E7 /* DyamkDemoApp */ = { 102 | isa = PBXNativeTarget; 103 | buildConfigurationList = 68DF1F2220DD2462000974E7 /* Build configuration list for PBXNativeTarget "DyamkDemoApp" */; 104 | buildPhases = ( 105 | 9CF139C1E0DDAA46FB84A698 /* [CP] Check Pods Manifest.lock */, 106 | 68DF1F0820DD2462000974E7 /* Sources */, 107 | 68DF1F0920DD2462000974E7 /* Frameworks */, 108 | 68DF1F0A20DD2462000974E7 /* Resources */, 109 | ); 110 | buildRules = ( 111 | ); 112 | dependencies = ( 113 | ); 114 | name = DyamkDemoApp; 115 | productName = DyamkDemoApp; 116 | productReference = 68DF1F0C20DD2462000974E7 /* DyamkDemoApp.app */; 117 | productType = "com.apple.product-type.application"; 118 | }; 119 | /* End PBXNativeTarget section */ 120 | 121 | /* Begin PBXProject section */ 122 | 68DF1F0420DD2462000974E7 /* Project object */ = { 123 | isa = PBXProject; 124 | attributes = { 125 | LastUpgradeCheck = 0920; 126 | ORGANIZATIONNAME = soulghost; 127 | TargetAttributes = { 128 | 68DF1F0B20DD2462000974E7 = { 129 | CreatedOnToolsVersion = 9.2; 130 | ProvisioningStyle = Automatic; 131 | }; 132 | }; 133 | }; 134 | buildConfigurationList = 68DF1F0720DD2462000974E7 /* Build configuration list for PBXProject "DyamkDemoApp" */; 135 | compatibilityVersion = "Xcode 8.0"; 136 | developmentRegion = en; 137 | hasScannedForEncodings = 0; 138 | knownRegions = ( 139 | en, 140 | Base, 141 | ); 142 | mainGroup = 68DF1F0320DD2462000974E7; 143 | productRefGroup = 68DF1F0D20DD2462000974E7 /* Products */; 144 | projectDirPath = ""; 145 | projectRoot = ""; 146 | targets = ( 147 | 68DF1F0B20DD2462000974E7 /* DyamkDemoApp */, 148 | ); 149 | }; 150 | /* End PBXProject section */ 151 | 152 | /* Begin PBXResourcesBuildPhase section */ 153 | 68DF1F0A20DD2462000974E7 /* Resources */ = { 154 | isa = PBXResourcesBuildPhase; 155 | buildActionMask = 2147483647; 156 | files = ( 157 | 68DF1F1C20DD2462000974E7 /* LaunchScreen.storyboard in Resources */, 158 | 68DF1F1920DD2462000974E7 /* Assets.xcassets in Resources */, 159 | 68DF1F1720DD2462000974E7 /* Main.storyboard in Resources */, 160 | ); 161 | runOnlyForDeploymentPostprocessing = 0; 162 | }; 163 | /* End PBXResourcesBuildPhase section */ 164 | 165 | /* Begin PBXShellScriptBuildPhase section */ 166 | 9CF139C1E0DDAA46FB84A698 /* [CP] Check Pods Manifest.lock */ = { 167 | isa = PBXShellScriptBuildPhase; 168 | buildActionMask = 2147483647; 169 | files = ( 170 | ); 171 | inputPaths = ( 172 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 173 | "${PODS_ROOT}/Manifest.lock", 174 | ); 175 | name = "[CP] Check Pods Manifest.lock"; 176 | outputPaths = ( 177 | "$(DERIVED_FILE_DIR)/Pods-DyamkDemoApp-checkManifestLockResult.txt", 178 | ); 179 | runOnlyForDeploymentPostprocessing = 0; 180 | shellPath = /bin/sh; 181 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 182 | showEnvVarsInLog = 0; 183 | }; 184 | /* End PBXShellScriptBuildPhase section */ 185 | 186 | /* Begin PBXSourcesBuildPhase section */ 187 | 68DF1F0820DD2462000974E7 /* Sources */ = { 188 | isa = PBXSourcesBuildPhase; 189 | buildActionMask = 2147483647; 190 | files = ( 191 | 68DF1F1420DD2462000974E7 /* ViewController.m in Sources */, 192 | 68DF1F1F20DD2462000974E7 /* main.m in Sources */, 193 | 68DF1F1120DD2462000974E7 /* AppDelegate.m in Sources */, 194 | ); 195 | runOnlyForDeploymentPostprocessing = 0; 196 | }; 197 | /* End PBXSourcesBuildPhase section */ 198 | 199 | /* Begin PBXVariantGroup section */ 200 | 68DF1F1520DD2462000974E7 /* Main.storyboard */ = { 201 | isa = PBXVariantGroup; 202 | children = ( 203 | 68DF1F1620DD2462000974E7 /* Base */, 204 | ); 205 | name = Main.storyboard; 206 | sourceTree = ""; 207 | }; 208 | 68DF1F1A20DD2462000974E7 /* LaunchScreen.storyboard */ = { 209 | isa = PBXVariantGroup; 210 | children = ( 211 | 68DF1F1B20DD2462000974E7 /* Base */, 212 | ); 213 | name = LaunchScreen.storyboard; 214 | sourceTree = ""; 215 | }; 216 | /* End PBXVariantGroup section */ 217 | 218 | /* Begin XCBuildConfiguration section */ 219 | 68DF1F2020DD2462000974E7 /* Debug */ = { 220 | isa = XCBuildConfiguration; 221 | buildSettings = { 222 | ALWAYS_SEARCH_USER_PATHS = NO; 223 | CLANG_ANALYZER_NONNULL = YES; 224 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 225 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 226 | CLANG_CXX_LIBRARY = "libc++"; 227 | CLANG_ENABLE_MODULES = YES; 228 | CLANG_ENABLE_OBJC_ARC = YES; 229 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 230 | CLANG_WARN_BOOL_CONVERSION = YES; 231 | CLANG_WARN_COMMA = YES; 232 | CLANG_WARN_CONSTANT_CONVERSION = YES; 233 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 234 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 235 | CLANG_WARN_EMPTY_BODY = YES; 236 | CLANG_WARN_ENUM_CONVERSION = YES; 237 | CLANG_WARN_INFINITE_RECURSION = YES; 238 | CLANG_WARN_INT_CONVERSION = YES; 239 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 240 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 241 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 242 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 243 | CLANG_WARN_STRICT_PROTOTYPES = YES; 244 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 245 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 246 | CLANG_WARN_UNREACHABLE_CODE = YES; 247 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 248 | CODE_SIGN_IDENTITY = "iPhone Developer"; 249 | COPY_PHASE_STRIP = NO; 250 | DEBUG_INFORMATION_FORMAT = dwarf; 251 | ENABLE_STRICT_OBJC_MSGSEND = YES; 252 | ENABLE_TESTABILITY = YES; 253 | GCC_C_LANGUAGE_STANDARD = gnu11; 254 | GCC_DYNAMIC_NO_PIC = NO; 255 | GCC_NO_COMMON_BLOCKS = YES; 256 | GCC_OPTIMIZATION_LEVEL = 0; 257 | GCC_PREPROCESSOR_DEFINITIONS = ( 258 | "DEBUG=1", 259 | "$(inherited)", 260 | ); 261 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 262 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 263 | GCC_WARN_UNDECLARED_SELECTOR = YES; 264 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 265 | GCC_WARN_UNUSED_FUNCTION = YES; 266 | GCC_WARN_UNUSED_VARIABLE = YES; 267 | IPHONEOS_DEPLOYMENT_TARGET = 11.2; 268 | MTL_ENABLE_DEBUG_INFO = YES; 269 | ONLY_ACTIVE_ARCH = YES; 270 | SDKROOT = iphoneos; 271 | }; 272 | name = Debug; 273 | }; 274 | 68DF1F2120DD2462000974E7 /* Release */ = { 275 | isa = XCBuildConfiguration; 276 | buildSettings = { 277 | ALWAYS_SEARCH_USER_PATHS = NO; 278 | CLANG_ANALYZER_NONNULL = YES; 279 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 280 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 281 | CLANG_CXX_LIBRARY = "libc++"; 282 | CLANG_ENABLE_MODULES = YES; 283 | CLANG_ENABLE_OBJC_ARC = YES; 284 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 285 | CLANG_WARN_BOOL_CONVERSION = YES; 286 | CLANG_WARN_COMMA = YES; 287 | CLANG_WARN_CONSTANT_CONVERSION = YES; 288 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 289 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 290 | CLANG_WARN_EMPTY_BODY = YES; 291 | CLANG_WARN_ENUM_CONVERSION = YES; 292 | CLANG_WARN_INFINITE_RECURSION = YES; 293 | CLANG_WARN_INT_CONVERSION = YES; 294 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 295 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 296 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 297 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 298 | CLANG_WARN_STRICT_PROTOTYPES = YES; 299 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 300 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 301 | CLANG_WARN_UNREACHABLE_CODE = YES; 302 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 303 | CODE_SIGN_IDENTITY = "iPhone Developer"; 304 | COPY_PHASE_STRIP = NO; 305 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 306 | ENABLE_NS_ASSERTIONS = NO; 307 | ENABLE_STRICT_OBJC_MSGSEND = YES; 308 | GCC_C_LANGUAGE_STANDARD = gnu11; 309 | GCC_NO_COMMON_BLOCKS = YES; 310 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 311 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 312 | GCC_WARN_UNDECLARED_SELECTOR = YES; 313 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 314 | GCC_WARN_UNUSED_FUNCTION = YES; 315 | GCC_WARN_UNUSED_VARIABLE = YES; 316 | IPHONEOS_DEPLOYMENT_TARGET = 11.2; 317 | MTL_ENABLE_DEBUG_INFO = NO; 318 | SDKROOT = iphoneos; 319 | VALIDATE_PRODUCT = YES; 320 | }; 321 | name = Release; 322 | }; 323 | 68DF1F2320DD2462000974E7 /* Debug */ = { 324 | isa = XCBuildConfiguration; 325 | baseConfigurationReference = 208D9729BF10439A85048091 /* Pods-DyamkDemoApp.debug.xcconfig */; 326 | buildSettings = { 327 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 328 | CODE_SIGN_STYLE = Automatic; 329 | DEVELOPMENT_TEAM = 6CMYQQFFT8; 330 | INFOPLIST_FILE = DyamkDemoApp/Info.plist; 331 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 332 | PRODUCT_BUNDLE_IDENTIFIER = "com.soulghost.dyamk-demoapp.DyamkDemoApp"; 333 | PRODUCT_NAME = "$(TARGET_NAME)"; 334 | TARGETED_DEVICE_FAMILY = "1,2"; 335 | }; 336 | name = Debug; 337 | }; 338 | 68DF1F2420DD2462000974E7 /* Release */ = { 339 | isa = XCBuildConfiguration; 340 | baseConfigurationReference = 7ED4204DE05AC45ED84623C5 /* Pods-DyamkDemoApp.release.xcconfig */; 341 | buildSettings = { 342 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 343 | CODE_SIGN_STYLE = Automatic; 344 | DEVELOPMENT_TEAM = 6CMYQQFFT8; 345 | INFOPLIST_FILE = DyamkDemoApp/Info.plist; 346 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 347 | PRODUCT_BUNDLE_IDENTIFIER = "com.soulghost.dyamk-demoapp.DyamkDemoApp"; 348 | PRODUCT_NAME = "$(TARGET_NAME)"; 349 | TARGETED_DEVICE_FAMILY = "1,2"; 350 | }; 351 | name = Release; 352 | }; 353 | /* End XCBuildConfiguration section */ 354 | 355 | /* Begin XCConfigurationList section */ 356 | 68DF1F0720DD2462000974E7 /* Build configuration list for PBXProject "DyamkDemoApp" */ = { 357 | isa = XCConfigurationList; 358 | buildConfigurations = ( 359 | 68DF1F2020DD2462000974E7 /* Debug */, 360 | 68DF1F2120DD2462000974E7 /* Release */, 361 | ); 362 | defaultConfigurationIsVisible = 0; 363 | defaultConfigurationName = Release; 364 | }; 365 | 68DF1F2220DD2462000974E7 /* Build configuration list for PBXNativeTarget "DyamkDemoApp" */ = { 366 | isa = XCConfigurationList; 367 | buildConfigurations = ( 368 | 68DF1F2320DD2462000974E7 /* Debug */, 369 | 68DF1F2420DD2462000974E7 /* Release */, 370 | ); 371 | defaultConfigurationIsVisible = 0; 372 | defaultConfigurationName = Release; 373 | }; 374 | /* End XCConfigurationList section */ 375 | }; 376 | rootObject = 68DF1F0420DD2462000974E7 /* Project object */; 377 | } 378 | -------------------------------------------------------------------------------- /DyamkDemoApp/DyamkDemoApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DyamkDemoApp/DyamkDemoApp.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /DyamkDemoApp/DyamkDemoApp/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // DyamkDemoApp 4 | // 5 | // Created by soulghost on 22/6/2018. 6 | // Copyright © 2018 soulghost. 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 | -------------------------------------------------------------------------------- /DyamkDemoApp/DyamkDemoApp/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // DyamkDemoApp 4 | // 5 | // Created by soulghost on 22/6/2018. 6 | // Copyright © 2018 soulghost. 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 | -------------------------------------------------------------------------------- /DyamkDemoApp/DyamkDemoApp/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 | } -------------------------------------------------------------------------------- /DyamkDemoApp/DyamkDemoApp/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 | -------------------------------------------------------------------------------- /DyamkDemoApp/DyamkDemoApp/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 | -------------------------------------------------------------------------------- /DyamkDemoApp/DyamkDemoApp/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 | -------------------------------------------------------------------------------- /DyamkDemoApp/DyamkDemoApp/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // DyamkDemoApp 4 | // 5 | // Created by soulghost on 22/6/2018. 6 | // Copyright © 2018 soulghost. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /DyamkDemoApp/DyamkDemoApp/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // DyamkDemoApp 4 | // 5 | // Created by soulghost on 22/6/2018. 6 | // Copyright © 2018 soulghost. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "DYAEngine.h" 11 | 12 | @interface ViewController () 13 | 14 | @property (nonatomic, strong) DYAEngine *dyaEngine; 15 | 16 | @end 17 | 18 | @implementation ViewController 19 | 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | self.dyaEngine = [[DYAEngine alloc] init]; 23 | NSError *dyaError = nil; 24 | [self.dyaEngine startAtPort:2224 error:&dyaError]; 25 | if (dyaError) { 26 | NSLog(@"Error: %@", dyaError); 27 | } else { 28 | NSLog(@"DYA Server start at 2224"); 29 | } 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /DyamkDemoApp/DyamkDemoApp/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // DyamkDemoApp 4 | // 5 | // Created by soulghost on 22/6/2018. 6 | // Copyright © 2018 soulghost. 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 | -------------------------------------------------------------------------------- /DyamkDemoApp/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | target 'DyamkDemoApp' do 5 | 6 | inhibit_all_warnings! 7 | pod 'DyamkClient', :path => '../DyamkClient.podspec' 8 | 9 | end 10 | -------------------------------------------------------------------------------- /DyamkInjector/DyamkInjector.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 48; 7 | objects = { 8 | 9 | /* Begin PBXAggregateTarget section */ 10 | 68DF1EE520DD17FE000974E7 /* BuildMe */ = { 11 | isa = PBXAggregateTarget; 12 | buildConfigurationList = 68DF1EE620DD17FE000974E7 /* Build configuration list for PBXAggregateTarget "BuildMe" */; 13 | buildPhases = ( 14 | 68DF1EF620DD1A5A000974E7 /* [Dyamk] Delete old dylib */, 15 | 68DF1EEB20DD180D000974E7 /* [Dyamk] Copy dylib */, 16 | 68DF1EF520DD19D7000974E7 /* [Dyamk] Process with Dylib */, 17 | 68DF1F0220DD1DC1000974E7 /* [Dyamk] Trig Update */, 18 | ); 19 | dependencies = ( 20 | 68DF1EEA20DD1804000974E7 /* PBXTargetDependency */, 21 | ); 22 | name = BuildMe; 23 | productName = BuildMe; 24 | }; 25 | /* End PBXAggregateTarget section */ 26 | 27 | /* Begin PBXBuildFile section */ 28 | 68DF1EEC20DD182B000974E7 /* DyamkInjector.framework in [Dyamk] Copy dylib */ = {isa = PBXBuildFile; fileRef = 68DF1ED420DD16DA000974E7 /* DyamkInjector.framework */; }; 29 | 68DF1EF220DD18B5000974E7 /* replace.sh in Resources */ = {isa = PBXBuildFile; fileRef = 68DF1EF120DD18B5000974E7 /* replace.sh */; }; 30 | 68DF1EFD20DD1CBD000974E7 /* DyamkNativeInjector.h in Headers */ = {isa = PBXBuildFile; fileRef = 68DF1EFB20DD1CBC000974E7 /* DyamkNativeInjector.h */; }; 31 | 68DF1EFE20DD1CBD000974E7 /* DyamkNativeInjector.m in Sources */ = {isa = PBXBuildFile; fileRef = 68DF1EFC20DD1CBD000974E7 /* DyamkNativeInjector.m */; }; 32 | 68DF1F0020DD1D26000974E7 /* DyamkCodePlayground.m in Sources */ = {isa = PBXBuildFile; fileRef = 68DF1EFF20DD1D26000974E7 /* DyamkCodePlayground.m */; }; 33 | 68DF1F2C20DDE5E2000974E7 /* DyamkUIAspectTool.h in Headers */ = {isa = PBXBuildFile; fileRef = 68DF1F2A20DDE5E2000974E7 /* DyamkUIAspectTool.h */; }; 34 | 68DF1F2D20DDE5E2000974E7 /* DyamkUIAspectTool.m in Sources */ = {isa = PBXBuildFile; fileRef = 68DF1F2B20DDE5E2000974E7 /* DyamkUIAspectTool.m */; }; 35 | 68DF1F3020DF319E000974E7 /* DyamkEventTool.h in Headers */ = {isa = PBXBuildFile; fileRef = 68DF1F2E20DF319E000974E7 /* DyamkEventTool.h */; }; 36 | 68DF1F3120DF319E000974E7 /* DyamkEventTool.m in Sources */ = {isa = PBXBuildFile; fileRef = 68DF1F2F20DF319E000974E7 /* DyamkEventTool.m */; }; 37 | /* End PBXBuildFile section */ 38 | 39 | /* Begin PBXContainerItemProxy section */ 40 | 68DF1EE920DD1804000974E7 /* PBXContainerItemProxy */ = { 41 | isa = PBXContainerItemProxy; 42 | containerPortal = 68DF1ECB20DD16DA000974E7 /* Project object */; 43 | proxyType = 1; 44 | remoteGlobalIDString = 68DF1ED320DD16DA000974E7; 45 | remoteInfo = DyamkInjector; 46 | }; 47 | /* End PBXContainerItemProxy section */ 48 | 49 | /* Begin PBXCopyFilesBuildPhase section */ 50 | 68DF1EEB20DD180D000974E7 /* [Dyamk] Copy dylib */ = { 51 | isa = PBXCopyFilesBuildPhase; 52 | buildActionMask = 2147483647; 53 | dstPath = /opt/Dyamk/dylib; 54 | dstSubfolderSpec = 0; 55 | files = ( 56 | 68DF1EEC20DD182B000974E7 /* DyamkInjector.framework in [Dyamk] Copy dylib */, 57 | ); 58 | name = "[Dyamk] Copy dylib"; 59 | runOnlyForDeploymentPostprocessing = 0; 60 | }; 61 | /* End PBXCopyFilesBuildPhase section */ 62 | 63 | /* Begin PBXFileReference section */ 64 | 68DF1ED420DD16DA000974E7 /* DyamkInjector.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = DyamkInjector.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 65 | 68DF1ED820DD16DA000974E7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 66 | 68DF1EEF20DD18A0000974E7 /* trigger.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = trigger.py; sourceTree = ""; }; 67 | 68DF1EF120DD18B5000974E7 /* replace.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = replace.sh; sourceTree = ""; }; 68 | 68DF1EF320DD18C3000974E7 /* run.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = run.sh; sourceTree = ""; }; 69 | 68DF1EF720DD1A82000974E7 /* clear.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = clear.sh; sourceTree = ""; }; 70 | 68DF1EFB20DD1CBC000974E7 /* DyamkNativeInjector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DyamkNativeInjector.h; sourceTree = ""; }; 71 | 68DF1EFC20DD1CBD000974E7 /* DyamkNativeInjector.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DyamkNativeInjector.m; sourceTree = ""; }; 72 | 68DF1EFF20DD1D26000974E7 /* DyamkCodePlayground.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DyamkCodePlayground.m; sourceTree = ""; }; 73 | 68DF1F0120DD1D48000974E7 /* DyamkCodePlayground.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DyamkCodePlayground.h; sourceTree = ""; }; 74 | 68DF1F2A20DDE5E2000974E7 /* DyamkUIAspectTool.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DyamkUIAspectTool.h; sourceTree = ""; }; 75 | 68DF1F2B20DDE5E2000974E7 /* DyamkUIAspectTool.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DyamkUIAspectTool.m; sourceTree = ""; }; 76 | 68DF1F2E20DF319E000974E7 /* DyamkEventTool.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DyamkEventTool.h; sourceTree = ""; }; 77 | 68DF1F2F20DF319E000974E7 /* DyamkEventTool.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DyamkEventTool.m; sourceTree = ""; }; 78 | /* End PBXFileReference section */ 79 | 80 | /* Begin PBXFrameworksBuildPhase section */ 81 | 68DF1ED020DD16DA000974E7 /* Frameworks */ = { 82 | isa = PBXFrameworksBuildPhase; 83 | buildActionMask = 2147483647; 84 | files = ( 85 | ); 86 | runOnlyForDeploymentPostprocessing = 0; 87 | }; 88 | /* End PBXFrameworksBuildPhase section */ 89 | 90 | /* Begin PBXGroup section */ 91 | 68DF1ECA20DD16DA000974E7 = { 92 | isa = PBXGroup; 93 | children = ( 94 | 68DF1ED620DD16DA000974E7 /* DyamkInjector */, 95 | 68DF1ED520DD16DA000974E7 /* Products */, 96 | ); 97 | sourceTree = ""; 98 | }; 99 | 68DF1ED520DD16DA000974E7 /* Products */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | 68DF1ED420DD16DA000974E7 /* DyamkInjector.framework */, 103 | ); 104 | name = Products; 105 | sourceTree = ""; 106 | }; 107 | 68DF1ED620DD16DA000974E7 /* DyamkInjector */ = { 108 | isa = PBXGroup; 109 | children = ( 110 | 68DF1F2920DDE5B5000974E7 /* tool */, 111 | 68DF1EFA20DD1C9D000974E7 /* core */, 112 | 68DF1EEE20DD188E000974E7 /* py */, 113 | 68DF1EED20DD1889000974E7 /* sh */, 114 | 68DF1ED820DD16DA000974E7 /* Info.plist */, 115 | 68DF1F0120DD1D48000974E7 /* DyamkCodePlayground.h */, 116 | 68DF1EFF20DD1D26000974E7 /* DyamkCodePlayground.m */, 117 | ); 118 | path = DyamkInjector; 119 | sourceTree = ""; 120 | }; 121 | 68DF1EED20DD1889000974E7 /* sh */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | 68DF1EF320DD18C3000974E7 /* run.sh */, 125 | 68DF1EF120DD18B5000974E7 /* replace.sh */, 126 | 68DF1EF720DD1A82000974E7 /* clear.sh */, 127 | ); 128 | path = sh; 129 | sourceTree = ""; 130 | }; 131 | 68DF1EEE20DD188E000974E7 /* py */ = { 132 | isa = PBXGroup; 133 | children = ( 134 | 68DF1EEF20DD18A0000974E7 /* trigger.py */, 135 | ); 136 | path = py; 137 | sourceTree = ""; 138 | }; 139 | 68DF1EFA20DD1C9D000974E7 /* core */ = { 140 | isa = PBXGroup; 141 | children = ( 142 | 68DF1EFB20DD1CBC000974E7 /* DyamkNativeInjector.h */, 143 | 68DF1EFC20DD1CBD000974E7 /* DyamkNativeInjector.m */, 144 | ); 145 | path = core; 146 | sourceTree = ""; 147 | }; 148 | 68DF1F2920DDE5B5000974E7 /* tool */ = { 149 | isa = PBXGroup; 150 | children = ( 151 | 68DF1F2A20DDE5E2000974E7 /* DyamkUIAspectTool.h */, 152 | 68DF1F2B20DDE5E2000974E7 /* DyamkUIAspectTool.m */, 153 | 68DF1F2E20DF319E000974E7 /* DyamkEventTool.h */, 154 | 68DF1F2F20DF319E000974E7 /* DyamkEventTool.m */, 155 | ); 156 | path = tool; 157 | sourceTree = ""; 158 | }; 159 | /* End PBXGroup section */ 160 | 161 | /* Begin PBXHeadersBuildPhase section */ 162 | 68DF1ED120DD16DA000974E7 /* Headers */ = { 163 | isa = PBXHeadersBuildPhase; 164 | buildActionMask = 2147483647; 165 | files = ( 166 | 68DF1EFD20DD1CBD000974E7 /* DyamkNativeInjector.h in Headers */, 167 | 68DF1F2C20DDE5E2000974E7 /* DyamkUIAspectTool.h in Headers */, 168 | 68DF1F3020DF319E000974E7 /* DyamkEventTool.h in Headers */, 169 | ); 170 | runOnlyForDeploymentPostprocessing = 0; 171 | }; 172 | /* End PBXHeadersBuildPhase section */ 173 | 174 | /* Begin PBXNativeTarget section */ 175 | 68DF1ED320DD16DA000974E7 /* DyamkInjector */ = { 176 | isa = PBXNativeTarget; 177 | buildConfigurationList = 68DF1EDC20DD16DA000974E7 /* Build configuration list for PBXNativeTarget "DyamkInjector" */; 178 | buildPhases = ( 179 | 68DF1EF920DD1B70000974E7 /* [Dyamk] Do symbol replace */, 180 | 68DF1ECF20DD16DA000974E7 /* Sources */, 181 | 68DF1ED020DD16DA000974E7 /* Frameworks */, 182 | 68DF1ED120DD16DA000974E7 /* Headers */, 183 | 68DF1ED220DD16DA000974E7 /* Resources */, 184 | ); 185 | buildRules = ( 186 | ); 187 | dependencies = ( 188 | ); 189 | name = DyamkInjector; 190 | productName = DyamkInjector; 191 | productReference = 68DF1ED420DD16DA000974E7 /* DyamkInjector.framework */; 192 | productType = "com.apple.product-type.framework"; 193 | }; 194 | /* End PBXNativeTarget section */ 195 | 196 | /* Begin PBXProject section */ 197 | 68DF1ECB20DD16DA000974E7 /* Project object */ = { 198 | isa = PBXProject; 199 | attributes = { 200 | LastUpgradeCheck = 0920; 201 | ORGANIZATIONNAME = soulghost; 202 | TargetAttributes = { 203 | 68DF1ED320DD16DA000974E7 = { 204 | CreatedOnToolsVersion = 9.2; 205 | ProvisioningStyle = Automatic; 206 | }; 207 | 68DF1EE520DD17FE000974E7 = { 208 | CreatedOnToolsVersion = 9.2; 209 | ProvisioningStyle = Automatic; 210 | }; 211 | }; 212 | }; 213 | buildConfigurationList = 68DF1ECE20DD16DA000974E7 /* Build configuration list for PBXProject "DyamkInjector" */; 214 | compatibilityVersion = "Xcode 8.0"; 215 | developmentRegion = en; 216 | hasScannedForEncodings = 0; 217 | knownRegions = ( 218 | en, 219 | ); 220 | mainGroup = 68DF1ECA20DD16DA000974E7; 221 | productRefGroup = 68DF1ED520DD16DA000974E7 /* Products */; 222 | projectDirPath = ""; 223 | projectRoot = ""; 224 | targets = ( 225 | 68DF1ED320DD16DA000974E7 /* DyamkInjector */, 226 | 68DF1EE520DD17FE000974E7 /* BuildMe */, 227 | ); 228 | }; 229 | /* End PBXProject section */ 230 | 231 | /* Begin PBXResourcesBuildPhase section */ 232 | 68DF1ED220DD16DA000974E7 /* Resources */ = { 233 | isa = PBXResourcesBuildPhase; 234 | buildActionMask = 2147483647; 235 | files = ( 236 | 68DF1EF220DD18B5000974E7 /* replace.sh in Resources */, 237 | ); 238 | runOnlyForDeploymentPostprocessing = 0; 239 | }; 240 | /* End PBXResourcesBuildPhase section */ 241 | 242 | /* Begin PBXShellScriptBuildPhase section */ 243 | 68DF1EF520DD19D7000974E7 /* [Dyamk] Process with Dylib */ = { 244 | isa = PBXShellScriptBuildPhase; 245 | buildActionMask = 2147483647; 246 | files = ( 247 | ); 248 | inputPaths = ( 249 | ); 250 | name = "[Dyamk] Process with Dylib"; 251 | outputPaths = ( 252 | ); 253 | runOnlyForDeploymentPostprocessing = 0; 254 | shellPath = /bin/sh; 255 | shellScript = "sh ${SRCROOT}/DyamkInjector/sh/run.sh"; 256 | }; 257 | 68DF1EF620DD1A5A000974E7 /* [Dyamk] Delete old dylib */ = { 258 | isa = PBXShellScriptBuildPhase; 259 | buildActionMask = 2147483647; 260 | files = ( 261 | ); 262 | inputPaths = ( 263 | ); 264 | name = "[Dyamk] Delete old dylib"; 265 | outputPaths = ( 266 | ); 267 | runOnlyForDeploymentPostprocessing = 0; 268 | shellPath = /bin/sh; 269 | shellScript = "sh ${SRCROOT}/DyamkInjector/sh/clear.sh"; 270 | }; 271 | 68DF1EF920DD1B70000974E7 /* [Dyamk] Do symbol replace */ = { 272 | isa = PBXShellScriptBuildPhase; 273 | buildActionMask = 2147483647; 274 | files = ( 275 | ); 276 | inputPaths = ( 277 | ); 278 | name = "[Dyamk] Do symbol replace"; 279 | outputPaths = ( 280 | ); 281 | runOnlyForDeploymentPostprocessing = 0; 282 | shellPath = /bin/sh; 283 | shellScript = "sh ${SRCROOT}/DyamkInjector/sh/replace.sh"; 284 | }; 285 | 68DF1F0220DD1DC1000974E7 /* [Dyamk] Trig Update */ = { 286 | isa = PBXShellScriptBuildPhase; 287 | buildActionMask = 2147483647; 288 | files = ( 289 | ); 290 | inputPaths = ( 291 | ); 292 | name = "[Dyamk] Trig Update"; 293 | outputPaths = ( 294 | ); 295 | runOnlyForDeploymentPostprocessing = 0; 296 | shellPath = "${DYAMK_PYTHON3_PATH}"; 297 | shellScript = "python ${SRCROOT}/DyamkInjector/py/trigger.py ${DYAMK_SOCKET_IP} ${DYAMK_SOCKET_PORT}"; 298 | }; 299 | /* End PBXShellScriptBuildPhase section */ 300 | 301 | /* Begin PBXSourcesBuildPhase section */ 302 | 68DF1ECF20DD16DA000974E7 /* Sources */ = { 303 | isa = PBXSourcesBuildPhase; 304 | buildActionMask = 2147483647; 305 | files = ( 306 | 68DF1F2D20DDE5E2000974E7 /* DyamkUIAspectTool.m in Sources */, 307 | 68DF1F3120DF319E000974E7 /* DyamkEventTool.m in Sources */, 308 | 68DF1F0020DD1D26000974E7 /* DyamkCodePlayground.m in Sources */, 309 | 68DF1EFE20DD1CBD000974E7 /* DyamkNativeInjector.m in Sources */, 310 | ); 311 | runOnlyForDeploymentPostprocessing = 0; 312 | }; 313 | /* End PBXSourcesBuildPhase section */ 314 | 315 | /* Begin PBXTargetDependency section */ 316 | 68DF1EEA20DD1804000974E7 /* PBXTargetDependency */ = { 317 | isa = PBXTargetDependency; 318 | target = 68DF1ED320DD16DA000974E7 /* DyamkInjector */; 319 | targetProxy = 68DF1EE920DD1804000974E7 /* PBXContainerItemProxy */; 320 | }; 321 | /* End PBXTargetDependency section */ 322 | 323 | /* Begin XCBuildConfiguration section */ 324 | 68DF1EDA20DD16DA000974E7 /* Debug */ = { 325 | isa = XCBuildConfiguration; 326 | buildSettings = { 327 | ALWAYS_SEARCH_USER_PATHS = NO; 328 | CLANG_ANALYZER_NONNULL = YES; 329 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 330 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 331 | CLANG_CXX_LIBRARY = "libc++"; 332 | CLANG_ENABLE_MODULES = YES; 333 | CLANG_ENABLE_OBJC_ARC = YES; 334 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 335 | CLANG_WARN_BOOL_CONVERSION = YES; 336 | CLANG_WARN_COMMA = YES; 337 | CLANG_WARN_CONSTANT_CONVERSION = YES; 338 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 339 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 340 | CLANG_WARN_EMPTY_BODY = YES; 341 | CLANG_WARN_ENUM_CONVERSION = YES; 342 | CLANG_WARN_INFINITE_RECURSION = YES; 343 | CLANG_WARN_INT_CONVERSION = YES; 344 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 345 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 346 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 347 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 348 | CLANG_WARN_STRICT_PROTOTYPES = YES; 349 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 350 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 351 | CLANG_WARN_UNREACHABLE_CODE = YES; 352 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 353 | CODE_SIGN_IDENTITY = "iPhone Developer"; 354 | COPY_PHASE_STRIP = NO; 355 | CURRENT_PROJECT_VERSION = 1; 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.2; 374 | MTL_ENABLE_DEBUG_INFO = YES; 375 | ONLY_ACTIVE_ARCH = YES; 376 | SDKROOT = iphoneos; 377 | VERSIONING_SYSTEM = "apple-generic"; 378 | VERSION_INFO_PREFIX = ""; 379 | }; 380 | name = Debug; 381 | }; 382 | 68DF1EDB20DD16DA000974E7 /* Release */ = { 383 | isa = XCBuildConfiguration; 384 | buildSettings = { 385 | ALWAYS_SEARCH_USER_PATHS = NO; 386 | CLANG_ANALYZER_NONNULL = YES; 387 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 388 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 389 | CLANG_CXX_LIBRARY = "libc++"; 390 | CLANG_ENABLE_MODULES = YES; 391 | CLANG_ENABLE_OBJC_ARC = YES; 392 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 393 | CLANG_WARN_BOOL_CONVERSION = YES; 394 | CLANG_WARN_COMMA = YES; 395 | CLANG_WARN_CONSTANT_CONVERSION = YES; 396 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 397 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 398 | CLANG_WARN_EMPTY_BODY = YES; 399 | CLANG_WARN_ENUM_CONVERSION = YES; 400 | CLANG_WARN_INFINITE_RECURSION = YES; 401 | CLANG_WARN_INT_CONVERSION = YES; 402 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 403 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 404 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 405 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 406 | CLANG_WARN_STRICT_PROTOTYPES = YES; 407 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 408 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 409 | CLANG_WARN_UNREACHABLE_CODE = YES; 410 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 411 | CODE_SIGN_IDENTITY = "iPhone Developer"; 412 | COPY_PHASE_STRIP = NO; 413 | CURRENT_PROJECT_VERSION = 1; 414 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 415 | ENABLE_NS_ASSERTIONS = NO; 416 | ENABLE_STRICT_OBJC_MSGSEND = YES; 417 | GCC_C_LANGUAGE_STANDARD = gnu11; 418 | GCC_NO_COMMON_BLOCKS = YES; 419 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 420 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 421 | GCC_WARN_UNDECLARED_SELECTOR = YES; 422 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 423 | GCC_WARN_UNUSED_FUNCTION = YES; 424 | GCC_WARN_UNUSED_VARIABLE = YES; 425 | IPHONEOS_DEPLOYMENT_TARGET = 11.2; 426 | MTL_ENABLE_DEBUG_INFO = NO; 427 | SDKROOT = iphoneos; 428 | VALIDATE_PRODUCT = YES; 429 | VERSIONING_SYSTEM = "apple-generic"; 430 | VERSION_INFO_PREFIX = ""; 431 | }; 432 | name = Release; 433 | }; 434 | 68DF1EDD20DD16DA000974E7 /* Debug */ = { 435 | isa = XCBuildConfiguration; 436 | buildSettings = { 437 | CODE_SIGN_IDENTITY = ""; 438 | CODE_SIGN_STYLE = Automatic; 439 | DEFINES_MODULE = YES; 440 | DEVELOPMENT_TEAM = 6CMYQQFFT8; 441 | DYLIB_COMPATIBILITY_VERSION = 1; 442 | DYLIB_CURRENT_VERSION = 1; 443 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 444 | INFOPLIST_FILE = DyamkInjector/Info.plist; 445 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 446 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 447 | PRODUCT_BUNDLE_IDENTIFIER = "com.soulghost.dyamk-injector.DyamkInjector"; 448 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 449 | SKIP_INSTALL = YES; 450 | TARGETED_DEVICE_FAMILY = "1,2"; 451 | }; 452 | name = Debug; 453 | }; 454 | 68DF1EDE20DD16DA000974E7 /* Release */ = { 455 | isa = XCBuildConfiguration; 456 | buildSettings = { 457 | CODE_SIGN_IDENTITY = ""; 458 | CODE_SIGN_STYLE = Automatic; 459 | DEFINES_MODULE = YES; 460 | DEVELOPMENT_TEAM = 6CMYQQFFT8; 461 | DYLIB_COMPATIBILITY_VERSION = 1; 462 | DYLIB_CURRENT_VERSION = 1; 463 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 464 | INFOPLIST_FILE = DyamkInjector/Info.plist; 465 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 466 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 467 | PRODUCT_BUNDLE_IDENTIFIER = "com.soulghost.dyamk-injector.DyamkInjector"; 468 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 469 | SKIP_INSTALL = YES; 470 | TARGETED_DEVICE_FAMILY = "1,2"; 471 | }; 472 | name = Release; 473 | }; 474 | 68DF1EE720DD17FE000974E7 /* Debug */ = { 475 | isa = XCBuildConfiguration; 476 | buildSettings = { 477 | CODE_SIGN_STYLE = Automatic; 478 | DEVELOPMENT_TEAM = 6CMYQQFFT8; 479 | DYAMK_PYTHON3_PATH = /Users/soulghost/.pyenv/shims/python; 480 | DYAMK_SOCKET_IP = 127.0.0.1; 481 | DYAMK_SOCKET_PORT = 2224; 482 | PRODUCT_NAME = "$(TARGET_NAME)"; 483 | }; 484 | name = Debug; 485 | }; 486 | 68DF1EE820DD17FE000974E7 /* Release */ = { 487 | isa = XCBuildConfiguration; 488 | buildSettings = { 489 | CODE_SIGN_STYLE = Automatic; 490 | DEVELOPMENT_TEAM = 6CMYQQFFT8; 491 | DYAMK_PYTHON3_PATH = /Users/soulghost/.pyenv/shims/python; 492 | DYAMK_SOCKET_IP = 127.0.0.1; 493 | DYAMK_SOCKET_PORT = 2224; 494 | PRODUCT_NAME = "$(TARGET_NAME)"; 495 | }; 496 | name = Release; 497 | }; 498 | /* End XCBuildConfiguration section */ 499 | 500 | /* Begin XCConfigurationList section */ 501 | 68DF1ECE20DD16DA000974E7 /* Build configuration list for PBXProject "DyamkInjector" */ = { 502 | isa = XCConfigurationList; 503 | buildConfigurations = ( 504 | 68DF1EDA20DD16DA000974E7 /* Debug */, 505 | 68DF1EDB20DD16DA000974E7 /* Release */, 506 | ); 507 | defaultConfigurationIsVisible = 0; 508 | defaultConfigurationName = Release; 509 | }; 510 | 68DF1EDC20DD16DA000974E7 /* Build configuration list for PBXNativeTarget "DyamkInjector" */ = { 511 | isa = XCConfigurationList; 512 | buildConfigurations = ( 513 | 68DF1EDD20DD16DA000974E7 /* Debug */, 514 | 68DF1EDE20DD16DA000974E7 /* Release */, 515 | ); 516 | defaultConfigurationIsVisible = 0; 517 | defaultConfigurationName = Release; 518 | }; 519 | 68DF1EE620DD17FE000974E7 /* Build configuration list for PBXAggregateTarget "BuildMe" */ = { 520 | isa = XCConfigurationList; 521 | buildConfigurations = ( 522 | 68DF1EE720DD17FE000974E7 /* Debug */, 523 | 68DF1EE820DD17FE000974E7 /* Release */, 524 | ); 525 | defaultConfigurationIsVisible = 0; 526 | defaultConfigurationName = Release; 527 | }; 528 | /* End XCConfigurationList section */ 529 | }; 530 | rootObject = 68DF1ECB20DD16DA000974E7 /* Project object */; 531 | } 532 | -------------------------------------------------------------------------------- /DyamkInjector/DyamkInjector.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DyamkInjector/DyamkInjector/DyamkCodePlayground.h: -------------------------------------------------------------------------------- 1 | // 2 | // DyamkCodePlayground.h 3 | // DyamkInjector 4 | // 5 | // Created by soulghost on 22/6/2018. 6 | // Copyright © 2018 soulghost. All rights reserved. 7 | // 8 | 9 | #ifndef DyamkCodePlayground_h 10 | #define DyamkCodePlayground_h 11 | 12 | void __dyamk_debug_code_goes_here(void); 13 | 14 | #endif /* DyamkCodePlayground_h */ 15 | -------------------------------------------------------------------------------- /DyamkInjector/DyamkInjector/DyamkCodePlayground.m: -------------------------------------------------------------------------------- 1 | // 2 | // DyamkCodePlayground.m 3 | // DyamkInjector 4 | // 5 | // Created by soulghost on 22/6/2018. 6 | // Copyright © 2018 soulghost. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "DyamkUIAspectTool.h" 11 | #import 12 | #import "DyamkEventTool.h" 13 | 14 | #pragma clang diagnostic push 15 | #pragma clang diagnostic ignored "-Wundeclared-selector" 16 | 17 | Dyamk_Method_1(void, onClick, id, sender) { 18 | UIViewController *vc = (UIViewController *)self; 19 | UIView *v = [vc.view viewWithTag:1]; 20 | // v.frame = CGRectMake(100, 100, arc4random_uniform(100) + 100, arc4random_uniform(100) + 100); 21 | [UIView animateWithDuration:2.0 animations:^{ 22 | v.backgroundColor = [UIColor redColor]; 23 | }]; 24 | } 25 | 26 | void __dyamk_debug_code_goes_here() { 27 | UIViewController *self = dya_presentControllerForDebug(); 28 | self.view.backgroundColor = [UIColor lightGrayColor]; 29 | UIView *box = [UIView new]; 30 | box.tag = 1; 31 | box.frame = CGRectMake(100, 100, 200, 200); 32 | box.backgroundColor = [UIColor orangeColor]; 33 | [self.view addSubview:box]; 34 | UIButton *addBtn = [UIButton buttonWithType:UIButtonTypeContactAdd]; 35 | addBtn.center = self.view.center; 36 | [addBtn addTarget:self action:@selector(addClick:) forControlEvents:UIControlEventTouchUpInside]; 37 | Dyamk_AddMethod(UIViewController, @selector(addClick:), onClick, v@:@); 38 | [self.view addSubview:addBtn]; 39 | } 40 | 41 | #pragma clang diagnostic pop 42 | 43 | 44 | -------------------------------------------------------------------------------- /DyamkInjector/DyamkInjector/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 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /DyamkInjector/DyamkInjector/core/DyamkNativeInjector.h: -------------------------------------------------------------------------------- 1 | // 2 | // DyamkNativeInjector.h 3 | // DyamkInjector 4 | // 5 | // Created by soulghost on 22/6/2018. 6 | // Copyright © 2018 soulghost. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | -------------------------------------------------------------------------------- /DyamkInjector/DyamkInjector/core/DyamkNativeInjector.m: -------------------------------------------------------------------------------- 1 | // 2 | // DyamkNativeInjector.m 3 | // DyamkInjector 4 | // 5 | // Created by soulghost on 22/6/2018. 6 | // Copyright © 2018 soulghost. All rights reserved. 7 | // 8 | 9 | #import "DyamkNativeInjector.h" 10 | #import "DyamkCodePlayground.h" 11 | 12 | @interface DyamkNativeInjector_25 : NSObject 13 | 14 | + (void)run; 15 | 16 | @end 17 | 18 | @implementation DyamkNativeInjector_25 19 | 20 | + (void)run { 21 | __dyamk_debug_code_goes_here(); 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /DyamkInjector/DyamkInjector/core/DyamkNativeInjector.m-e: -------------------------------------------------------------------------------- 1 | // 2 | // DyamkNativeInjector.m 3 | // DyamkInjector 4 | // 5 | // Created by soulghost on 22/6/2018. 6 | // Copyright © 2018 soulghost. All rights reserved. 7 | // 8 | 9 | #import "DyamkNativeInjector.h" 10 | #import "DyamkCodePlayground.h" 11 | 12 | @interface DyamkNativeInjector_24 : NSObject 13 | 14 | + (void)run; 15 | 16 | @end 17 | 18 | @implementation DyamkNativeInjector_24 19 | 20 | + (void)run { 21 | __dyamk_debug_code_goes_here(); 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /DyamkInjector/DyamkInjector/py/trigger.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import socket 4 | import sys 5 | 6 | 7 | def conn(): 8 | args = sys.argv 9 | ip = args[1] 10 | port = int(args[2]) 11 | s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 12 | s.connect((ip, port)) 13 | f = open('/opt/Dyamk/dylib/framework_version', 'r') 14 | number = int(f.readlines()[0]) 15 | if number > 0: 16 | number -= 1 17 | msg = "{}".format(number) 18 | s.send(msg.encode()) 19 | s.close() 20 | 21 | 22 | if __name__ == '__main__': 23 | conn() 24 | -------------------------------------------------------------------------------- /DyamkInjector/DyamkInjector/sh/clear.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # clear.sh 4 | # DyamkInjector 5 | # 6 | # Created by soulghost on 22/6/2018. 7 | # Copyright © 2018 soulghost. All rights reserved. 8 | 9 | cd /opt/Dyamk/dylib 10 | if [ -e "DyamkInjector.framework" ]; then 11 | rm -r DyamkInjector.framework 12 | fi 13 | -------------------------------------------------------------------------------- /DyamkInjector/DyamkInjector/sh/replace.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # replacer.sh 4 | # DynamicKit 5 | # 6 | # Created by soulghost on 22/6/2018. 7 | # Copyright © 2018 soulghost. All rights reserved. 8 | 9 | cd /opt/Dyamk/dylib 10 | path=`pwd`'/' 11 | number_name='framework_version' 12 | number=$path$number_name 13 | v=0 14 | if [ -e $number ]; then 15 | v=`cat $number_name` 16 | else 17 | echo 0 > $number_name 18 | fi 19 | sed -i -e 's/DyamkNativeInjector_[0-9]*/DyamkNativeInjector_'$v'/g' ${SRCROOT}'/DyamkInjector/core/DyamkNativeInjector.m' 20 | 21 | -------------------------------------------------------------------------------- /DyamkInjector/DyamkInjector/sh/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # run.sh 4 | # DynamicKit 5 | # 6 | # Created by soulghost on 22/6/2018. 7 | # Copyright © 2018 soulghost. All rights reserved. 8 | 9 | cd /opt/Dyamk/dylib 10 | path=`pwd`'/' 11 | number_name='framework_version' 12 | number=$path$number_name 13 | v=0 14 | if [ -e $number ]; then 15 | v=`cat $number_name` 16 | else 17 | echo 0 > $number_name 18 | fi 19 | 20 | 21 | from="DyamkInjector.framework/DyamkInjector" 22 | to="DyamkInjector.framework/DyamkInjector_"$v 23 | mv $from $to 24 | 25 | # add version 26 | v="$(($v+1))" 27 | echo $v > $number_name 28 | -------------------------------------------------------------------------------- /DyamkInjector/DyamkInjector/tool/DyamkEventTool.h: -------------------------------------------------------------------------------- 1 | // 2 | // DyamkEventTool.h 3 | // DyamkInjector 4 | // 5 | // Created by soulghost on 24/6/2018. 6 | // Copyright © 2018 soulghost. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #define Dyamk_Runtime_Method_Params id self, SEL _cmd, 12 | 13 | #define Dyamk_IMP(fname) (IMP)__dyamk_debug_symbol_##fname 14 | 15 | #define Dyamk_AddMethod(class, sel, fname, encode) class_replaceMethod(NSClassFromString(@#class), sel, Dyamk_IMP(fname), #encode) 16 | 17 | #define Dyamk_Method_1(ret, fname, type, name) ret __dyamk_debug_symbol_##fname (Dyamk_Runtime_Method_Params type name) 18 | #define Dyamk_Method_2(ret, fname, t1, n1, t2, n2) ret __dyamk_debug_symbol_##fname (Dyamk_Runtime_Method_Params t1 n1, t2 n2) 19 | 20 | -------------------------------------------------------------------------------- /DyamkInjector/DyamkInjector/tool/DyamkEventTool.m: -------------------------------------------------------------------------------- 1 | // 2 | // DyamkEventTool.m 3 | // DyamkInjector 4 | // 5 | // Created by soulghost on 24/6/2018. 6 | // Copyright © 2018 soulghost. All rights reserved. 7 | // 8 | 9 | #import "DyamkEventTool.h" 10 | 11 | 12 | -------------------------------------------------------------------------------- /DyamkInjector/DyamkInjector/tool/DyamkUIAspectTool.h: -------------------------------------------------------------------------------- 1 | // 2 | // DyamkUIAspectTool.h 3 | // DyamkInjector 4 | // 5 | // Created by soulghost on 23/6/2018. 6 | // Copyright © 2018 soulghost. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | UIViewController* dya_getTopViewController(void); 12 | UIViewController* dya_getViewControllerByClassName(NSString *className); 13 | UIViewController* dya_presentControllerForDebug(void); 14 | -------------------------------------------------------------------------------- /DyamkInjector/DyamkInjector/tool/DyamkUIAspectTool.m: -------------------------------------------------------------------------------- 1 | // 2 | // DyamkUIAspectTool.m 3 | // DyamkInjector 4 | // 5 | // Created by soulghost on 23/6/2018. 6 | // Copyright © 2018 soulghost. All rights reserved. 7 | // 8 | 9 | #import "DyamkUIAspectTool.h" 10 | 11 | UIViewController *__vc_being_presented; 12 | 13 | NSArray * __dya_getViewControllers(void) { 14 | NSArray *wds = [UIApplication sharedApplication].windows; 15 | NSMutableArray *vcs = @[].mutableCopy; 16 | for (UIWindow *wd in wds) { 17 | UIViewController *root = wd.rootViewController; 18 | [vcs addObject:root]; 19 | if ([root isKindOfClass:[UINavigationController class]]) { 20 | UINavigationController *nav = (UINavigationController *)root; 21 | [vcs addObjectsFromArray:nav.viewControllers]; 22 | } else if ([root isKindOfClass:[UITabBarController class]]) { 23 | UITabBarController *tab = (UITabBarController *)root; 24 | [vcs addObjectsFromArray:tab.viewControllers]; 25 | } 26 | } 27 | return vcs.copy; 28 | } 29 | 30 | UIViewController* __dya_topViewControllerWithRootViewController(UIViewController* rootViewController) { 31 | if ([rootViewController isKindOfClass:[UITabBarController class]]) { 32 | UITabBarController* tabBarController = (UITabBarController*)rootViewController; 33 | return __dya_topViewControllerWithRootViewController(tabBarController.selectedViewController); 34 | } else if ([rootViewController isKindOfClass:[UINavigationController class]]) { 35 | UINavigationController* navigationController = (UINavigationController*)rootViewController; 36 | return __dya_topViewControllerWithRootViewController(navigationController.visibleViewController); 37 | } else if (rootViewController.presentedViewController) { 38 | UIViewController* presentedViewController = rootViewController.presentedViewController; 39 | return __dya_topViewControllerWithRootViewController(presentedViewController); 40 | } else { 41 | return rootViewController; 42 | } 43 | } 44 | 45 | UIViewController* dya_getTopViewController(void) { 46 | return __dya_topViewControllerWithRootViewController([UIApplication sharedApplication].keyWindow.rootViewController); 47 | } 48 | 49 | UIViewController* dya_getViewControllerByClassName(NSString *className) { 50 | NSArray *allVcs = __dya_getViewControllers(); 51 | for (UIViewController *vc in allVcs) { 52 | if ([vc isMemberOfClass:NSClassFromString(className)]) { 53 | return vc; 54 | } 55 | } 56 | return nil; 57 | } 58 | 59 | UIViewController* dya_presentControllerForDebug(void) { 60 | if (__vc_being_presented) { 61 | [__vc_being_presented dismissViewControllerAnimated:NO completion:nil]; 62 | } 63 | __vc_being_presented = [UIViewController new]; 64 | [dya_getTopViewController() presentViewController:__vc_being_presented animated:YES completion:nil]; 65 | __vc_being_presented.view.backgroundColor = [UIColor whiteColor]; 66 | return __vc_being_presented; 67 | } 68 | 69 | 70 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 修玉同(音弦) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Dyamk 2 | iOS native code injector at runtime, only for debug. 3 | 4 | [中文版框架原理介绍](https://juejin.im/post/5b41a908e51d4519962e87e8) 5 | 6 | [中文版README (TODO)](#) 7 | 8 | [Dyamk WIKI](https://github.com/Soulghost/Dyamk/wiki/Install-and-Usage-Tutorial) 9 | 10 | [中文版WIKI (TODO)](#) 11 | 12 | ## Why use Dyamk 13 | Dyamk can help you run Objective-C code without recompile and restart the app, it can helps you to debug UI and so forth, it is based on the `dlopen`, so it is only for debug, when you finish your debug, just copy the right code to your main app. 14 | 15 | Dyamk using socket to communicate with the dylib generate and send project, it works as an aspect in the main app, so it has no intrusion for the main app, just enjoy it! 16 | 17 | ## Arch & Principle 18 | ![](https://raw.githubusercontent.com/Soulghost/Dyamk/master/arch/arch.png) 19 | 20 | ## Installation 21 | - Clone the repo and go into it. 22 | ```bash 23 | git clone https://github.com/Soulghost/Dyamk 24 | cd Dyamk 25 | ``` 26 | 27 | - Run `install.sh`, it needs root to mkdir in /opt, you can check if it is safe by your self. 28 | ```bash 29 | sh install.sh 30 | ``` 31 | 32 | - Some scripts are written in Python3, so you needs Python3 environment, if you don't have it, try [pyenv](https://github.com/pyenv/pyenv). 33 | 34 | ## How to get start 35 | There are two project in the `Dyamk` folder, `DyamkInjector` and `DyamkDemoApp`, the former is the dylib generate and inject project and the latter is a demo app to be injected at runtime, when you use this framework for your own app, your app will be the latter one, now we just talk about the demo. 36 | 37 | ## Demo App 38 | - go into the `DyamkDemoApp` folder. 39 | - run `pod install --verbose --no-repo-update`. 40 | - open `DyamkDemoApp.xcworkspace`. 41 | - run it with a iOS Simulator, the framework does not support real device by default. 42 | - because the Dyamk library needs socket to receive build message from injector, there will be an alert to confirm. 43 | - if there is no error, you can see logs in console as below. 44 | ```plain 45 | 2018-06-22 21:01:03.051985+0800 DyamkDemoApp[52912:50098406] DYA Server start at 2224 46 | ``` 47 | - now the demo app is ready to inject code, now you can leave the project but keep the app running on Simulator. 48 | 49 | ## DyamkInjector Project 50 | - go into the `DyamkInjector` dir and open the project with Xcode. 51 | - change the build Target to `BuildMe` 52 | - open `Build Settings` for target `BuildMe`, ant find User-Defined Params `DYAMK_PYTHON3_PATH`, change it to your python3 path instead. you can use `which python` in the terminal to find the location, if you don't have python3, try [pyenv](https://github.com/pyenv/pyenv). 53 | - open `DyamkCodePlayground.m`, you can see the function `__dyamk_debug_code_goes_here`, your code to inject goes here. 54 | ```objc 55 | void __dyamk_debug_code_goes_here() { 56 | // a simple code to inject 57 | UIWindow *window = [UIApplication sharedApplication].windows.lastObject; 58 | UIViewController *vc = window.rootViewController; 59 | vc.view.backgroundColor = [UIColor redColor]; 60 | } 61 | ``` 62 | - build the project, and you can see the demo app running on Simulator has changed it view's background color to red. 63 | - you can write some code in the `__dyamk_debug_code_goes_here` function, when you build it, these code will be injected to demo app. 64 | 65 | ## Usage 66 | [Dyamk Wiki](https://github.com/Soulghost/Dyamk/wiki/Install-and-Usage-Tutorial) 67 | -------------------------------------------------------------------------------- /arch/arch.graffle/data.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soulghost/Dyamk/258494d76aaeec9021a5005d783e76b17e8e3681/arch/arch.graffle/data.plist -------------------------------------------------------------------------------- /arch/arch.graffle/image2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soulghost/Dyamk/258494d76aaeec9021a5005d783e76b17e8e3681/arch/arch.graffle/image2.png -------------------------------------------------------------------------------- /arch/arch.graffle/image3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soulghost/Dyamk/258494d76aaeec9021a5005d783e76b17e8e3681/arch/arch.graffle/image3.png -------------------------------------------------------------------------------- /arch/arch.graffle/image4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soulghost/Dyamk/258494d76aaeec9021a5005d783e76b17e8e3681/arch/arch.graffle/image4.png -------------------------------------------------------------------------------- /arch/arch.graffle/image5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soulghost/Dyamk/258494d76aaeec9021a5005d783e76b17e8e3681/arch/arch.graffle/image5.png -------------------------------------------------------------------------------- /arch/arch.graffle/image6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soulghost/Dyamk/258494d76aaeec9021a5005d783e76b17e8e3681/arch/arch.graffle/image6.png -------------------------------------------------------------------------------- /arch/arch.graffle/image7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soulghost/Dyamk/258494d76aaeec9021a5005d783e76b17e8e3681/arch/arch.graffle/image7.png -------------------------------------------------------------------------------- /arch/arch.graffle/image8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soulghost/Dyamk/258494d76aaeec9021a5005d783e76b17e8e3681/arch/arch.graffle/image8.png -------------------------------------------------------------------------------- /arch/arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soulghost/Dyamk/258494d76aaeec9021a5005d783e76b17e8e3681/arch/arch.png -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | echo 'create path at /opt/Dyamk' 3 | sudo mkdir -p /opt/Dyamk/ 4 | sudo chmod a+w /opt/Dyamk/ 5 | mkdir -p /opt/Dyamk/dylib 6 | sudo chmod a+w /opt/Dyamk/dylib 7 | echo 'Install Finished!' -------------------------------------------------------------------------------- /uninstall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | echo 'remove /opt/Dyamk' 3 | sudo rm -rf /opt/Dyamk 4 | echo 'Uninstall Finished!' --------------------------------------------------------------------------------