├── .gitignore ├── LICENSE ├── README.md ├── ZDURLSchemeInspector.podspec ├── ZDURLSchemeInspector.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── ZDURLSchemeInspector ├── ZDURLSchemeInspector.h └── ZDURLSchemeInspector.m └── ZDURLSchemeInspectorTests └── Info.plist /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | *.xccheckout 14 | *.moved-aside 15 | DerivedData 16 | *.hmap 17 | *.ipa 18 | *.xcuserstate 19 | 20 | # CocoaPods 21 | # 22 | # We recommend against adding the Pods directory to your .gitignore. However 23 | # you should judge for yourself, the pros and cons are mentioned at: 24 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 25 | # 26 | # Pods/ 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 0dayZh 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 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ZDURLSchemeInspector 2 | 3 | A delightful URL Scheme inspector for iOS in Objective-C. This inspector can help you to find out the apps who are hacking your URL Scheme. 4 | 5 | ## Usage 6 | 7 | ```Objective-C 8 | /** 9 | * Check if your URL Scheme is hacked. 10 | */ 11 | if ([ZDURLSchemeInspector isURLSchemeHacked:@"YOUR_URL_SCHEME"]) { 12 | // Hacked 13 | } 14 | 15 | /** 16 | * Find out who are hacking your URL Scheme. 17 | */ 18 | NSArray *who = [ZDURLSchemeInspector whoCanHandleURLScheme:@"YOUR_URL_SCHEME"]; 19 | ``` 20 | 21 | ## Install 22 | 23 | Add this 24 | 25 | ``` 26 | pod 'ZDURLSchemeInspector' 27 | ``` 28 | 29 | to your Podfile. 30 | 31 | ## Lincense 32 | 33 | The MIT License (MIT) 34 | 35 | Copyright (c) 2015 0dayZh 36 | 37 | Permission is hereby granted, free of charge, to any person obtaining a copy 38 | of this software and associated documentation files (the "Software"), to deal 39 | in the Software without restriction, including without limitation the rights 40 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 41 | copies of the Software, and to permit persons to whom the Software is 42 | furnished to do so, subject to the following conditions: 43 | 44 | The above copyright notice and this permission notice shall be included in all 45 | copies or substantial portions of the Software. 46 | 47 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 48 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 49 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 50 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 51 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 52 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 53 | SOFTWARE. -------------------------------------------------------------------------------- /ZDURLSchemeInspector.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "ZDURLSchemeInspector" 3 | s.version = "0.1.0" 4 | s.summary = "A delightful URL Scheme inspector for iOS in Objective-C." 5 | s.homepage = "https://github.com/0dayZh/ZDURLSchemeInspector" 6 | s.license = 'MIT' 7 | s.author = { "0dayZh" => "0day.zh@gmail.com" } 8 | s.ios.deployment_target = '7.0' 9 | s.source = { :git => "https://github.com/0dayZh/ZDURLSchemeInspector.git", :tag => s.version } 10 | 11 | s.public_header_files = 'ZDURLSchemeInspector/*.h' 12 | s.source_files = 'ZDURLSchemeInspector/*.{h,m}' 13 | s.requires_arc = true 14 | s.framework = 'MobileCoreServices' 15 | end 16 | -------------------------------------------------------------------------------- /ZDURLSchemeInspector.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 762DCA3A1AC06037008AC369 /* ZDURLSchemeInspector.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 762DCA391AC06037008AC369 /* ZDURLSchemeInspector.h */; }; 11 | 762DCA3C1AC06037008AC369 /* ZDURLSchemeInspector.m in Sources */ = {isa = PBXBuildFile; fileRef = 762DCA3B1AC06037008AC369 /* ZDURLSchemeInspector.m */; }; 12 | 762DCA421AC06037008AC369 /* libZDURLSchemeInspector.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 762DCA361AC06037008AC369 /* libZDURLSchemeInspector.a */; }; 13 | /* End PBXBuildFile section */ 14 | 15 | /* Begin PBXContainerItemProxy section */ 16 | 762DCA431AC06037008AC369 /* PBXContainerItemProxy */ = { 17 | isa = PBXContainerItemProxy; 18 | containerPortal = 762DCA2E1AC06037008AC369 /* Project object */; 19 | proxyType = 1; 20 | remoteGlobalIDString = 762DCA351AC06037008AC369; 21 | remoteInfo = ZDURLSchemeInspector; 22 | }; 23 | /* End PBXContainerItemProxy section */ 24 | 25 | /* Begin PBXCopyFilesBuildPhase section */ 26 | 762DCA341AC06037008AC369 /* CopyFiles */ = { 27 | isa = PBXCopyFilesBuildPhase; 28 | buildActionMask = 2147483647; 29 | dstPath = "include/$(PRODUCT_NAME)"; 30 | dstSubfolderSpec = 16; 31 | files = ( 32 | 762DCA3A1AC06037008AC369 /* ZDURLSchemeInspector.h in CopyFiles */, 33 | ); 34 | runOnlyForDeploymentPostprocessing = 0; 35 | }; 36 | /* End PBXCopyFilesBuildPhase section */ 37 | 38 | /* Begin PBXFileReference section */ 39 | 762DCA361AC06037008AC369 /* libZDURLSchemeInspector.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libZDURLSchemeInspector.a; sourceTree = BUILT_PRODUCTS_DIR; }; 40 | 762DCA391AC06037008AC369 /* ZDURLSchemeInspector.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ZDURLSchemeInspector.h; sourceTree = ""; }; 41 | 762DCA3B1AC06037008AC369 /* ZDURLSchemeInspector.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ZDURLSchemeInspector.m; sourceTree = ""; }; 42 | 762DCA411AC06037008AC369 /* ZDURLSchemeInspectorTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ZDURLSchemeInspectorTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | 762DCA471AC06037008AC369 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 44 | /* End PBXFileReference section */ 45 | 46 | /* Begin PBXFrameworksBuildPhase section */ 47 | 762DCA331AC06037008AC369 /* Frameworks */ = { 48 | isa = PBXFrameworksBuildPhase; 49 | buildActionMask = 2147483647; 50 | files = ( 51 | ); 52 | runOnlyForDeploymentPostprocessing = 0; 53 | }; 54 | 762DCA3E1AC06037008AC369 /* Frameworks */ = { 55 | isa = PBXFrameworksBuildPhase; 56 | buildActionMask = 2147483647; 57 | files = ( 58 | 762DCA421AC06037008AC369 /* libZDURLSchemeInspector.a in Frameworks */, 59 | ); 60 | runOnlyForDeploymentPostprocessing = 0; 61 | }; 62 | /* End PBXFrameworksBuildPhase section */ 63 | 64 | /* Begin PBXGroup section */ 65 | 762DCA2D1AC06037008AC369 = { 66 | isa = PBXGroup; 67 | children = ( 68 | 762DCA381AC06037008AC369 /* ZDURLSchemeInspector */, 69 | 762DCA451AC06037008AC369 /* ZDURLSchemeInspectorTests */, 70 | 762DCA371AC06037008AC369 /* Products */, 71 | ); 72 | sourceTree = ""; 73 | }; 74 | 762DCA371AC06037008AC369 /* Products */ = { 75 | isa = PBXGroup; 76 | children = ( 77 | 762DCA361AC06037008AC369 /* libZDURLSchemeInspector.a */, 78 | 762DCA411AC06037008AC369 /* ZDURLSchemeInspectorTests.xctest */, 79 | ); 80 | name = Products; 81 | sourceTree = ""; 82 | }; 83 | 762DCA381AC06037008AC369 /* ZDURLSchemeInspector */ = { 84 | isa = PBXGroup; 85 | children = ( 86 | 762DCA391AC06037008AC369 /* ZDURLSchemeInspector.h */, 87 | 762DCA3B1AC06037008AC369 /* ZDURLSchemeInspector.m */, 88 | ); 89 | path = ZDURLSchemeInspector; 90 | sourceTree = ""; 91 | }; 92 | 762DCA451AC06037008AC369 /* ZDURLSchemeInspectorTests */ = { 93 | isa = PBXGroup; 94 | children = ( 95 | 762DCA461AC06037008AC369 /* Supporting Files */, 96 | ); 97 | path = ZDURLSchemeInspectorTests; 98 | sourceTree = ""; 99 | }; 100 | 762DCA461AC06037008AC369 /* Supporting Files */ = { 101 | isa = PBXGroup; 102 | children = ( 103 | 762DCA471AC06037008AC369 /* Info.plist */, 104 | ); 105 | name = "Supporting Files"; 106 | sourceTree = ""; 107 | }; 108 | /* End PBXGroup section */ 109 | 110 | /* Begin PBXNativeTarget section */ 111 | 762DCA351AC06037008AC369 /* ZDURLSchemeInspector */ = { 112 | isa = PBXNativeTarget; 113 | buildConfigurationList = 762DCA4A1AC06037008AC369 /* Build configuration list for PBXNativeTarget "ZDURLSchemeInspector" */; 114 | buildPhases = ( 115 | 762DCA321AC06037008AC369 /* Sources */, 116 | 762DCA331AC06037008AC369 /* Frameworks */, 117 | 762DCA341AC06037008AC369 /* CopyFiles */, 118 | ); 119 | buildRules = ( 120 | ); 121 | dependencies = ( 122 | ); 123 | name = ZDURLSchemeInspector; 124 | productName = ZDURLSchemeInspector; 125 | productReference = 762DCA361AC06037008AC369 /* libZDURLSchemeInspector.a */; 126 | productType = "com.apple.product-type.library.static"; 127 | }; 128 | 762DCA401AC06037008AC369 /* ZDURLSchemeInspectorTests */ = { 129 | isa = PBXNativeTarget; 130 | buildConfigurationList = 762DCA4D1AC06037008AC369 /* Build configuration list for PBXNativeTarget "ZDURLSchemeInspectorTests" */; 131 | buildPhases = ( 132 | 762DCA3D1AC06037008AC369 /* Sources */, 133 | 762DCA3E1AC06037008AC369 /* Frameworks */, 134 | 762DCA3F1AC06037008AC369 /* Resources */, 135 | ); 136 | buildRules = ( 137 | ); 138 | dependencies = ( 139 | 762DCA441AC06037008AC369 /* PBXTargetDependency */, 140 | ); 141 | name = ZDURLSchemeInspectorTests; 142 | productName = ZDURLSchemeInspectorTests; 143 | productReference = 762DCA411AC06037008AC369 /* ZDURLSchemeInspectorTests.xctest */; 144 | productType = "com.apple.product-type.bundle.unit-test"; 145 | }; 146 | /* End PBXNativeTarget section */ 147 | 148 | /* Begin PBXProject section */ 149 | 762DCA2E1AC06037008AC369 /* Project object */ = { 150 | isa = PBXProject; 151 | attributes = { 152 | LastUpgradeCheck = 0620; 153 | ORGANIZATIONNAME = 0dayZh; 154 | TargetAttributes = { 155 | 762DCA351AC06037008AC369 = { 156 | CreatedOnToolsVersion = 6.2; 157 | }; 158 | 762DCA401AC06037008AC369 = { 159 | CreatedOnToolsVersion = 6.2; 160 | }; 161 | }; 162 | }; 163 | buildConfigurationList = 762DCA311AC06037008AC369 /* Build configuration list for PBXProject "ZDURLSchemeInspector" */; 164 | compatibilityVersion = "Xcode 3.2"; 165 | developmentRegion = English; 166 | hasScannedForEncodings = 0; 167 | knownRegions = ( 168 | en, 169 | ); 170 | mainGroup = 762DCA2D1AC06037008AC369; 171 | productRefGroup = 762DCA371AC06037008AC369 /* Products */; 172 | projectDirPath = ""; 173 | projectRoot = ""; 174 | targets = ( 175 | 762DCA351AC06037008AC369 /* ZDURLSchemeInspector */, 176 | 762DCA401AC06037008AC369 /* ZDURLSchemeInspectorTests */, 177 | ); 178 | }; 179 | /* End PBXProject section */ 180 | 181 | /* Begin PBXResourcesBuildPhase section */ 182 | 762DCA3F1AC06037008AC369 /* Resources */ = { 183 | isa = PBXResourcesBuildPhase; 184 | buildActionMask = 2147483647; 185 | files = ( 186 | ); 187 | runOnlyForDeploymentPostprocessing = 0; 188 | }; 189 | /* End PBXResourcesBuildPhase section */ 190 | 191 | /* Begin PBXSourcesBuildPhase section */ 192 | 762DCA321AC06037008AC369 /* Sources */ = { 193 | isa = PBXSourcesBuildPhase; 194 | buildActionMask = 2147483647; 195 | files = ( 196 | 762DCA3C1AC06037008AC369 /* ZDURLSchemeInspector.m in Sources */, 197 | ); 198 | runOnlyForDeploymentPostprocessing = 0; 199 | }; 200 | 762DCA3D1AC06037008AC369 /* Sources */ = { 201 | isa = PBXSourcesBuildPhase; 202 | buildActionMask = 2147483647; 203 | files = ( 204 | ); 205 | runOnlyForDeploymentPostprocessing = 0; 206 | }; 207 | /* End PBXSourcesBuildPhase section */ 208 | 209 | /* Begin PBXTargetDependency section */ 210 | 762DCA441AC06037008AC369 /* PBXTargetDependency */ = { 211 | isa = PBXTargetDependency; 212 | target = 762DCA351AC06037008AC369 /* ZDURLSchemeInspector */; 213 | targetProxy = 762DCA431AC06037008AC369 /* PBXContainerItemProxy */; 214 | }; 215 | /* End PBXTargetDependency section */ 216 | 217 | /* Begin XCBuildConfiguration section */ 218 | 762DCA481AC06037008AC369 /* Debug */ = { 219 | isa = XCBuildConfiguration; 220 | buildSettings = { 221 | ALWAYS_SEARCH_USER_PATHS = NO; 222 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 223 | CLANG_CXX_LIBRARY = "libc++"; 224 | CLANG_ENABLE_MODULES = YES; 225 | CLANG_ENABLE_OBJC_ARC = YES; 226 | CLANG_WARN_BOOL_CONVERSION = YES; 227 | CLANG_WARN_CONSTANT_CONVERSION = YES; 228 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 229 | CLANG_WARN_EMPTY_BODY = YES; 230 | CLANG_WARN_ENUM_CONVERSION = YES; 231 | CLANG_WARN_INT_CONVERSION = YES; 232 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 233 | CLANG_WARN_UNREACHABLE_CODE = YES; 234 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 235 | COPY_PHASE_STRIP = NO; 236 | ENABLE_STRICT_OBJC_MSGSEND = YES; 237 | GCC_C_LANGUAGE_STANDARD = gnu99; 238 | GCC_DYNAMIC_NO_PIC = NO; 239 | GCC_OPTIMIZATION_LEVEL = 0; 240 | GCC_PREPROCESSOR_DEFINITIONS = ( 241 | "DEBUG=1", 242 | "$(inherited)", 243 | ); 244 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 245 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 246 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 247 | GCC_WARN_UNDECLARED_SELECTOR = YES; 248 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 249 | GCC_WARN_UNUSED_FUNCTION = YES; 250 | GCC_WARN_UNUSED_VARIABLE = YES; 251 | IPHONEOS_DEPLOYMENT_TARGET = 8.2; 252 | MTL_ENABLE_DEBUG_INFO = YES; 253 | ONLY_ACTIVE_ARCH = YES; 254 | SDKROOT = iphoneos; 255 | }; 256 | name = Debug; 257 | }; 258 | 762DCA491AC06037008AC369 /* Release */ = { 259 | isa = XCBuildConfiguration; 260 | buildSettings = { 261 | ALWAYS_SEARCH_USER_PATHS = NO; 262 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 263 | CLANG_CXX_LIBRARY = "libc++"; 264 | CLANG_ENABLE_MODULES = YES; 265 | CLANG_ENABLE_OBJC_ARC = YES; 266 | CLANG_WARN_BOOL_CONVERSION = YES; 267 | CLANG_WARN_CONSTANT_CONVERSION = YES; 268 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 269 | CLANG_WARN_EMPTY_BODY = YES; 270 | CLANG_WARN_ENUM_CONVERSION = YES; 271 | CLANG_WARN_INT_CONVERSION = YES; 272 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 273 | CLANG_WARN_UNREACHABLE_CODE = YES; 274 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 275 | COPY_PHASE_STRIP = NO; 276 | ENABLE_NS_ASSERTIONS = NO; 277 | ENABLE_STRICT_OBJC_MSGSEND = YES; 278 | GCC_C_LANGUAGE_STANDARD = gnu99; 279 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 280 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 281 | GCC_WARN_UNDECLARED_SELECTOR = YES; 282 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 283 | GCC_WARN_UNUSED_FUNCTION = YES; 284 | GCC_WARN_UNUSED_VARIABLE = YES; 285 | IPHONEOS_DEPLOYMENT_TARGET = 8.2; 286 | MTL_ENABLE_DEBUG_INFO = NO; 287 | SDKROOT = iphoneos; 288 | VALIDATE_PRODUCT = YES; 289 | }; 290 | name = Release; 291 | }; 292 | 762DCA4B1AC06037008AC369 /* Debug */ = { 293 | isa = XCBuildConfiguration; 294 | buildSettings = { 295 | OTHER_LDFLAGS = "-ObjC"; 296 | PRODUCT_NAME = "$(TARGET_NAME)"; 297 | SKIP_INSTALL = YES; 298 | }; 299 | name = Debug; 300 | }; 301 | 762DCA4C1AC06037008AC369 /* Release */ = { 302 | isa = XCBuildConfiguration; 303 | buildSettings = { 304 | OTHER_LDFLAGS = "-ObjC"; 305 | PRODUCT_NAME = "$(TARGET_NAME)"; 306 | SKIP_INSTALL = YES; 307 | }; 308 | name = Release; 309 | }; 310 | 762DCA4E1AC06037008AC369 /* Debug */ = { 311 | isa = XCBuildConfiguration; 312 | buildSettings = { 313 | FRAMEWORK_SEARCH_PATHS = ( 314 | "$(SDKROOT)/Developer/Library/Frameworks", 315 | "$(inherited)", 316 | ); 317 | GCC_PREPROCESSOR_DEFINITIONS = ( 318 | "DEBUG=1", 319 | "$(inherited)", 320 | ); 321 | INFOPLIST_FILE = ZDURLSchemeInspectorTests/Info.plist; 322 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 323 | PRODUCT_NAME = "$(TARGET_NAME)"; 324 | }; 325 | name = Debug; 326 | }; 327 | 762DCA4F1AC06037008AC369 /* Release */ = { 328 | isa = XCBuildConfiguration; 329 | buildSettings = { 330 | FRAMEWORK_SEARCH_PATHS = ( 331 | "$(SDKROOT)/Developer/Library/Frameworks", 332 | "$(inherited)", 333 | ); 334 | INFOPLIST_FILE = ZDURLSchemeInspectorTests/Info.plist; 335 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 336 | PRODUCT_NAME = "$(TARGET_NAME)"; 337 | }; 338 | name = Release; 339 | }; 340 | /* End XCBuildConfiguration section */ 341 | 342 | /* Begin XCConfigurationList section */ 343 | 762DCA311AC06037008AC369 /* Build configuration list for PBXProject "ZDURLSchemeInspector" */ = { 344 | isa = XCConfigurationList; 345 | buildConfigurations = ( 346 | 762DCA481AC06037008AC369 /* Debug */, 347 | 762DCA491AC06037008AC369 /* Release */, 348 | ); 349 | defaultConfigurationIsVisible = 0; 350 | defaultConfigurationName = Release; 351 | }; 352 | 762DCA4A1AC06037008AC369 /* Build configuration list for PBXNativeTarget "ZDURLSchemeInspector" */ = { 353 | isa = XCConfigurationList; 354 | buildConfigurations = ( 355 | 762DCA4B1AC06037008AC369 /* Debug */, 356 | 762DCA4C1AC06037008AC369 /* Release */, 357 | ); 358 | defaultConfigurationIsVisible = 0; 359 | }; 360 | 762DCA4D1AC06037008AC369 /* Build configuration list for PBXNativeTarget "ZDURLSchemeInspectorTests" */ = { 361 | isa = XCConfigurationList; 362 | buildConfigurations = ( 363 | 762DCA4E1AC06037008AC369 /* Debug */, 364 | 762DCA4F1AC06037008AC369 /* Release */, 365 | ); 366 | defaultConfigurationIsVisible = 0; 367 | }; 368 | /* End XCConfigurationList section */ 369 | }; 370 | rootObject = 762DCA2E1AC06037008AC369 /* Project object */; 371 | } 372 | -------------------------------------------------------------------------------- /ZDURLSchemeInspector.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ZDURLSchemeInspector/ZDURLSchemeInspector.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZDURLSchemeInspector.h 3 | // ZDURLSchemeInspector 4 | // 5 | // Created by 0day on 15/3/23. 6 | // Copyright (c) 2015年 0dayZh. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZDURLSchemeInspector : NSObject 12 | 13 | + (BOOL)isURLSchemeHacked:(NSString *)URLScheme; 14 | 15 | + (NSArray *)whoCanHandleURLScheme:(NSString *)URLScheme; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /ZDURLSchemeInspector/ZDURLSchemeInspector.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZDURLSchemeInspector.m 3 | // ZDURLSchemeInspector 4 | // 5 | // Created by 0day on 15/3/23. 6 | // Copyright (c) 2015年 0dayZh. All rights reserved. 7 | // 8 | 9 | #import "ZDURLSchemeInspector.h" 10 | 11 | #import 12 | #import 13 | #import 14 | 15 | @implementation ZDURLSchemeInspector 16 | 17 | + (BOOL)isURLSchemeHacked:(NSString *)URLScheme { 18 | NSParameterAssert(URLScheme != nil); 19 | 20 | NSArray *who = [self whoCanHandleURLScheme:URLScheme]; 21 | if (who.count > 1) { 22 | return YES; 23 | } 24 | 25 | return NO; 26 | } 27 | 28 | + (NSArray *)whoCanHandleURLScheme:(NSString *)URLScheme { 29 | Class LSApplicationWorkspace_class = objc_getClass("LSApplicationWorkspace"); 30 | NSObject *workspace = [LSApplicationWorkspace_class performSelector:@selector(defaultWorkspace)]; 31 | return [workspace performSelector:@selector(applicationsAvailableForHandlingURLScheme:) withObject:URLScheme]; 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /ZDURLSchemeInspectorTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.0dayZh.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | --------------------------------------------------------------------------------