├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── Demos ├── HTTPDNS-Mac-Demo.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── HTTPDNS-Mac-Demo │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Base.lproj │ │ └── Main.storyboard │ ├── Info.plist │ ├── ViewController.h │ ├── ViewController.m │ └── main.m ├── HTTPDNS-iOS-Demo.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata └── HTTPDNS-iOS-Demo │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ ├── ViewController.h │ ├── ViewController.m │ └── main.m ├── HTTPDNS.podspec ├── HTTPDNS.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcshareddata │ └── xcschemes │ ├── HTTPDNS_OSX.xcscheme │ └── HTTPDNS_iOS.xcscheme ├── HTTPDNS.xcworkspace └── contents.xcworkspacedata ├── HTTPDNS ├── HTTPDNS.h ├── HTTPDNSAliYun.h ├── HTTPDNSAliYun.m ├── HTTPDNSBase.h ├── HTTPDNSBase.m ├── HTTPDNSClient.h ├── HTTPDNSClient.m ├── HTTPDNSCryptor.h ├── HTTPDNSCryptor.m ├── HTTPDNSDNSPod.h ├── HTTPDNSDNSPod.m ├── HTTPDNSGoogle.h ├── HTTPDNSGoogle.m ├── HTTPDNSHex.h ├── HTTPDNSHex.m ├── HTTPDNSRecord.h ├── HTTPDNSRecord.m ├── HTTPDNSUtil.h ├── HTTPDNSUtil.m └── Info.plist ├── HTTPDNSTests ├── HTTPDNSAliYunTest.m ├── HTTPDNSDNSPodTest.m ├── HTTPDNSGoogleTest.m ├── HTTPDNSUtilTest.m └── Info.plist ├── LICENSE └── README.md /.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 | *.xccheckout 22 | *.moved-aside 23 | *.xcuserstate 24 | *.xcscmblueprint 25 | 26 | ## Obj-C/Swift specific 27 | *.hmap 28 | *.ipa 29 | 30 | # CocoaPods 31 | # 32 | # We recommend against adding the Pods directory to your .gitignore. However 33 | # you should judge for yourself, the pros and cons are mentioned at: 34 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 35 | # 36 | # Pods/ 37 | 38 | # Carthage 39 | # 40 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 41 | # Carthage/Checkouts 42 | 43 | Carthage/Build 44 | 45 | # fastlane 46 | # 47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 48 | # screenshots whenever they are needed. 49 | # For more information about the recommended setup visit: 50 | # https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md 51 | 52 | fastlane/report.xml 53 | fastlane/screenshots 54 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | osx_image: xcode7.3 3 | 4 | env: 5 | global: 6 | - WORKSPACE=HTTPDNS.xcworkspace 7 | - IOS_SCHEME=HTTPDNS_iOS 8 | - OSX_SCHEME=HTTPDNS_OSX 9 | - IOS_SDK=iphonesimulator9.3 10 | - OSX_SDK=macosx10.11 11 | - CONFIG="ONLY_ACTIVE_ARCH=NO ENABLE_TESTABILITY=YES" 12 | matrix: 13 | - SCHEME="$IOS_SCHEME" SDK="$IOS_SDK" DESTINATION="OS=8.1,name=iPhone 4S" 14 | - SCHEME="$IOS_SCHEME" SDK="$IOS_SDK" DESTINATION="OS=8.2,name=iPhone 5" 15 | - SCHEME="$IOS_SCHEME" SDK="$IOS_SDK" DESTINATION="OS=8.3,name=iPhone 5S" 16 | - SCHEME="$IOS_SCHEME" SDK="$IOS_SDK" DESTINATION="OS=8.4,name=iPhone 6" 17 | - SCHEME="$IOS_SCHEME" SDK="$IOS_SDK" DESTINATION="OS=9.0,name=iPhone 6" 18 | - SCHEME="$IOS_SCHEME" SDK="$IOS_SDK" DESTINATION="OS=9.1,name=iPhone 6 Plus" 19 | - SCHEME="$IOS_SCHEME" SDK="$IOS_SDK" DESTINATION="OS=9.2,name=iPhone 6S" 20 | - SCHEME="$IOS_SCHEME" SDK="$IOS_SDK" DESTINATION="OS=9.3,name=iPhone 6S Plus" 21 | - SCHEME="$OSX_SCHEME" SDK="$OSX_SDK" DESTINATION="arch=x86_64" 22 | 23 | script: 24 | - set -o pipefail 25 | - xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration "$CONFIG" test | xcpretty -c; 26 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | CHANGELOG 2 | ========= 3 | 4 | *0.8.0* 5 | --- 6 | - Add Google DNS-over-HTTP 7 | - update and add HTTPDNSAliYun HTTPS support 8 | - use [HTTPDNSClient sharedInstance] 9 | - update Project 10 | 11 | *0.7.0* 12 | --- 13 | - add CHANGELOG 14 | - Fixed Test bugs 15 | - change Int to NSTimeInterval 16 | 17 | *0.6.0* 18 | --- 19 | 20 | - update README and Sample 21 | - add Docs 22 | 23 | *0.5.2* 24 | --- 25 | 26 | - bug fix for head file 27 | 28 | *0.5.1* 29 | --- 30 | 31 | - update README fix bug 32 | 33 | *0.5.0* 34 | --- 35 | 36 | - update README and podfile 37 | - add test and fix bug 38 | - support iOS 8 39 | - add test and .travis 40 | - update DNSPodPro 41 | - add pod file and update README 42 | - finish basic client 43 | 44 | *0.4.0* 45 | --- 46 | 47 | - add DNSPodPro 48 | - add HTTPDNSCryptor and HTTPDNSHex 49 | - update project group 50 | 51 | *0.3.0* 52 | --- 53 | 54 | - add aliyun 55 | - add copyWithZone 56 | - update block 57 | - update mac support 58 | - mac sample 59 | - update Project 60 | 61 | *0.2.0* 62 | --- 63 | 64 | - Base DNSPod 65 | 66 | *0.1.0* 67 | --- 68 | 69 | - HTTPDNSFactory 70 | - HTTPDNSBase 71 | - add HTTPDNSRecord description 72 | - add demos 73 | - add mac demo 74 | - add iOS Demo 75 | - add mac support 76 | - remove old demo 77 | - add HTTPDNSRecord 78 | - update HTTPDNSUtil 79 | - add Util 80 | - add Demo project 81 | - Init Project 82 | - Initial commit 83 | -------------------------------------------------------------------------------- /Demos/HTTPDNS-Mac-Demo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | CB14D50D1D095BCB00EB35C9 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CB14D50C1D095BCB00EB35C9 /* AppDelegate.m */; }; 11 | CB14D5101D095BCB00EB35C9 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CB14D50F1D095BCB00EB35C9 /* main.m */; }; 12 | CB14D5131D095BCB00EB35C9 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CB14D5121D095BCB00EB35C9 /* ViewController.m */; }; 13 | CB14D5151D095BCB00EB35C9 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CB14D5141D095BCB00EB35C9 /* Assets.xcassets */; }; 14 | CB14D5181D095BCB00EB35C9 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CB14D5161D095BCB00EB35C9 /* Main.storyboard */; }; 15 | CB14D52C1D095CB100EB35C9 /* HTTPDNS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB14D52A1D095CAA00EB35C9 /* HTTPDNS.framework */; }; 16 | CB14D52D1D095CB100EB35C9 /* HTTPDNS.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = CB14D52A1D095CAA00EB35C9 /* HTTPDNS.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXCopyFilesBuildPhase section */ 20 | CB14D52E1D095CB100EB35C9 /* Embed Frameworks */ = { 21 | isa = PBXCopyFilesBuildPhase; 22 | buildActionMask = 2147483647; 23 | dstPath = ""; 24 | dstSubfolderSpec = 10; 25 | files = ( 26 | CB14D52D1D095CB100EB35C9 /* HTTPDNS.framework in Embed Frameworks */, 27 | ); 28 | name = "Embed Frameworks"; 29 | runOnlyForDeploymentPostprocessing = 0; 30 | }; 31 | /* End PBXCopyFilesBuildPhase section */ 32 | 33 | /* Begin PBXFileReference section */ 34 | CB14D5081D095BCB00EB35C9 /* HTTPDNS-Mac-Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "HTTPDNS-Mac-Demo.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 35 | CB14D50B1D095BCB00EB35C9 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 36 | CB14D50C1D095BCB00EB35C9 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 37 | CB14D50F1D095BCB00EB35C9 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 38 | CB14D5111D095BCB00EB35C9 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 39 | CB14D5121D095BCB00EB35C9 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 40 | CB14D5141D095BCB00EB35C9 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 41 | CB14D5171D095BCB00EB35C9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 42 | CB14D5191D095BCB00EB35C9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 43 | CB14D52A1D095CAA00EB35C9 /* HTTPDNS.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = HTTPDNS.framework; path = "../../../../Library/Developer/Xcode/DerivedData/HTTPDNS-gbomfzesgwkjzbbzoxbedfbxcndz/Build/Products/Debug/HTTPDNS.framework"; sourceTree = ""; }; 44 | /* End PBXFileReference section */ 45 | 46 | /* Begin PBXFrameworksBuildPhase section */ 47 | CB14D5051D095BCB00EB35C9 /* Frameworks */ = { 48 | isa = PBXFrameworksBuildPhase; 49 | buildActionMask = 2147483647; 50 | files = ( 51 | CB14D52C1D095CB100EB35C9 /* HTTPDNS.framework in Frameworks */, 52 | ); 53 | runOnlyForDeploymentPostprocessing = 0; 54 | }; 55 | /* End PBXFrameworksBuildPhase section */ 56 | 57 | /* Begin PBXGroup section */ 58 | CB14D4FF1D095BCB00EB35C9 = { 59 | isa = PBXGroup; 60 | children = ( 61 | CB14D52A1D095CAA00EB35C9 /* HTTPDNS.framework */, 62 | CB14D50A1D095BCB00EB35C9 /* HTTPDNS-Mac-Demo */, 63 | CB14D5091D095BCB00EB35C9 /* Products */, 64 | ); 65 | sourceTree = ""; 66 | }; 67 | CB14D5091D095BCB00EB35C9 /* Products */ = { 68 | isa = PBXGroup; 69 | children = ( 70 | CB14D5081D095BCB00EB35C9 /* HTTPDNS-Mac-Demo.app */, 71 | ); 72 | name = Products; 73 | sourceTree = ""; 74 | }; 75 | CB14D50A1D095BCB00EB35C9 /* HTTPDNS-Mac-Demo */ = { 76 | isa = PBXGroup; 77 | children = ( 78 | CB14D50B1D095BCB00EB35C9 /* AppDelegate.h */, 79 | CB14D50C1D095BCB00EB35C9 /* AppDelegate.m */, 80 | CB14D5111D095BCB00EB35C9 /* ViewController.h */, 81 | CB14D5121D095BCB00EB35C9 /* ViewController.m */, 82 | CB14D5141D095BCB00EB35C9 /* Assets.xcassets */, 83 | CB14D5161D095BCB00EB35C9 /* Main.storyboard */, 84 | CB14D5191D095BCB00EB35C9 /* Info.plist */, 85 | CB14D50E1D095BCB00EB35C9 /* Supporting Files */, 86 | ); 87 | path = "HTTPDNS-Mac-Demo"; 88 | sourceTree = ""; 89 | }; 90 | CB14D50E1D095BCB00EB35C9 /* Supporting Files */ = { 91 | isa = PBXGroup; 92 | children = ( 93 | CB14D50F1D095BCB00EB35C9 /* main.m */, 94 | ); 95 | name = "Supporting Files"; 96 | sourceTree = ""; 97 | }; 98 | /* End PBXGroup section */ 99 | 100 | /* Begin PBXNativeTarget section */ 101 | CB14D5071D095BCB00EB35C9 /* HTTPDNS-Mac-Demo */ = { 102 | isa = PBXNativeTarget; 103 | buildConfigurationList = CB14D51C1D095BCB00EB35C9 /* Build configuration list for PBXNativeTarget "HTTPDNS-Mac-Demo" */; 104 | buildPhases = ( 105 | CB14D5041D095BCB00EB35C9 /* Sources */, 106 | CB14D5051D095BCB00EB35C9 /* Frameworks */, 107 | CB14D5061D095BCB00EB35C9 /* Resources */, 108 | CB14D52E1D095CB100EB35C9 /* Embed Frameworks */, 109 | ); 110 | buildRules = ( 111 | ); 112 | dependencies = ( 113 | ); 114 | name = "HTTPDNS-Mac-Demo"; 115 | productName = "HTTPDNS-Mac-Demo"; 116 | productReference = CB14D5081D095BCB00EB35C9 /* HTTPDNS-Mac-Demo.app */; 117 | productType = "com.apple.product-type.application"; 118 | }; 119 | /* End PBXNativeTarget section */ 120 | 121 | /* Begin PBXProject section */ 122 | CB14D5001D095BCB00EB35C9 /* Project object */ = { 123 | isa = PBXProject; 124 | attributes = { 125 | LastUpgradeCheck = 0730; 126 | ORGANIZATIONNAME = Yourtion; 127 | TargetAttributes = { 128 | CB14D5071D095BCB00EB35C9 = { 129 | CreatedOnToolsVersion = 7.3.1; 130 | }; 131 | }; 132 | }; 133 | buildConfigurationList = CB14D5031D095BCB00EB35C9 /* Build configuration list for PBXProject "HTTPDNS-Mac-Demo" */; 134 | compatibilityVersion = "Xcode 3.2"; 135 | developmentRegion = English; 136 | hasScannedForEncodings = 0; 137 | knownRegions = ( 138 | en, 139 | Base, 140 | ); 141 | mainGroup = CB14D4FF1D095BCB00EB35C9; 142 | productRefGroup = CB14D5091D095BCB00EB35C9 /* Products */; 143 | projectDirPath = ""; 144 | projectRoot = ""; 145 | targets = ( 146 | CB14D5071D095BCB00EB35C9 /* HTTPDNS-Mac-Demo */, 147 | ); 148 | }; 149 | /* End PBXProject section */ 150 | 151 | /* Begin PBXResourcesBuildPhase section */ 152 | CB14D5061D095BCB00EB35C9 /* Resources */ = { 153 | isa = PBXResourcesBuildPhase; 154 | buildActionMask = 2147483647; 155 | files = ( 156 | CB14D5151D095BCB00EB35C9 /* Assets.xcassets in Resources */, 157 | CB14D5181D095BCB00EB35C9 /* Main.storyboard in Resources */, 158 | ); 159 | runOnlyForDeploymentPostprocessing = 0; 160 | }; 161 | /* End PBXResourcesBuildPhase section */ 162 | 163 | /* Begin PBXSourcesBuildPhase section */ 164 | CB14D5041D095BCB00EB35C9 /* Sources */ = { 165 | isa = PBXSourcesBuildPhase; 166 | buildActionMask = 2147483647; 167 | files = ( 168 | CB14D5131D095BCB00EB35C9 /* ViewController.m in Sources */, 169 | CB14D5101D095BCB00EB35C9 /* main.m in Sources */, 170 | CB14D50D1D095BCB00EB35C9 /* AppDelegate.m in Sources */, 171 | ); 172 | runOnlyForDeploymentPostprocessing = 0; 173 | }; 174 | /* End PBXSourcesBuildPhase section */ 175 | 176 | /* Begin PBXVariantGroup section */ 177 | CB14D5161D095BCB00EB35C9 /* Main.storyboard */ = { 178 | isa = PBXVariantGroup; 179 | children = ( 180 | CB14D5171D095BCB00EB35C9 /* Base */, 181 | ); 182 | name = Main.storyboard; 183 | sourceTree = ""; 184 | }; 185 | /* End PBXVariantGroup section */ 186 | 187 | /* Begin XCBuildConfiguration section */ 188 | CB14D51A1D095BCB00EB35C9 /* Debug */ = { 189 | isa = XCBuildConfiguration; 190 | buildSettings = { 191 | ALWAYS_SEARCH_USER_PATHS = NO; 192 | CLANG_ANALYZER_NONNULL = YES; 193 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 194 | CLANG_CXX_LIBRARY = "libc++"; 195 | CLANG_ENABLE_MODULES = YES; 196 | CLANG_ENABLE_OBJC_ARC = YES; 197 | CLANG_WARN_BOOL_CONVERSION = YES; 198 | CLANG_WARN_CONSTANT_CONVERSION = YES; 199 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 200 | CLANG_WARN_EMPTY_BODY = YES; 201 | CLANG_WARN_ENUM_CONVERSION = YES; 202 | CLANG_WARN_INT_CONVERSION = YES; 203 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 204 | CLANG_WARN_UNREACHABLE_CODE = YES; 205 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 206 | CODE_SIGN_IDENTITY = "-"; 207 | COPY_PHASE_STRIP = NO; 208 | DEBUG_INFORMATION_FORMAT = dwarf; 209 | ENABLE_STRICT_OBJC_MSGSEND = YES; 210 | ENABLE_TESTABILITY = YES; 211 | GCC_C_LANGUAGE_STANDARD = gnu99; 212 | GCC_DYNAMIC_NO_PIC = NO; 213 | GCC_NO_COMMON_BLOCKS = YES; 214 | GCC_OPTIMIZATION_LEVEL = 0; 215 | GCC_PREPROCESSOR_DEFINITIONS = ( 216 | "DEBUG=1", 217 | "$(inherited)", 218 | ); 219 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 220 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 221 | GCC_WARN_UNDECLARED_SELECTOR = YES; 222 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 223 | GCC_WARN_UNUSED_FUNCTION = YES; 224 | GCC_WARN_UNUSED_VARIABLE = YES; 225 | MACOSX_DEPLOYMENT_TARGET = 10.11; 226 | MTL_ENABLE_DEBUG_INFO = YES; 227 | ONLY_ACTIVE_ARCH = YES; 228 | SDKROOT = macosx; 229 | }; 230 | name = Debug; 231 | }; 232 | CB14D51B1D095BCB00EB35C9 /* Release */ = { 233 | isa = XCBuildConfiguration; 234 | buildSettings = { 235 | ALWAYS_SEARCH_USER_PATHS = NO; 236 | CLANG_ANALYZER_NONNULL = YES; 237 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 238 | CLANG_CXX_LIBRARY = "libc++"; 239 | CLANG_ENABLE_MODULES = YES; 240 | CLANG_ENABLE_OBJC_ARC = YES; 241 | CLANG_WARN_BOOL_CONVERSION = YES; 242 | CLANG_WARN_CONSTANT_CONVERSION = YES; 243 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 244 | CLANG_WARN_EMPTY_BODY = YES; 245 | CLANG_WARN_ENUM_CONVERSION = YES; 246 | CLANG_WARN_INT_CONVERSION = YES; 247 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 248 | CLANG_WARN_UNREACHABLE_CODE = YES; 249 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 250 | CODE_SIGN_IDENTITY = "-"; 251 | COPY_PHASE_STRIP = NO; 252 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 253 | ENABLE_NS_ASSERTIONS = NO; 254 | ENABLE_STRICT_OBJC_MSGSEND = YES; 255 | GCC_C_LANGUAGE_STANDARD = gnu99; 256 | GCC_NO_COMMON_BLOCKS = YES; 257 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 258 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 259 | GCC_WARN_UNDECLARED_SELECTOR = YES; 260 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 261 | GCC_WARN_UNUSED_FUNCTION = YES; 262 | GCC_WARN_UNUSED_VARIABLE = YES; 263 | MACOSX_DEPLOYMENT_TARGET = 10.11; 264 | MTL_ENABLE_DEBUG_INFO = NO; 265 | SDKROOT = macosx; 266 | }; 267 | name = Release; 268 | }; 269 | CB14D51D1D095BCB00EB35C9 /* Debug */ = { 270 | isa = XCBuildConfiguration; 271 | buildSettings = { 272 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 273 | COMBINE_HIDPI_IMAGES = YES; 274 | INFOPLIST_FILE = "HTTPDNS-Mac-Demo/Info.plist"; 275 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 276 | PRODUCT_BUNDLE_IDENTIFIER = "com.yourtion.HTTPDNS-Mac-Demo"; 277 | PRODUCT_NAME = "$(TARGET_NAME)"; 278 | }; 279 | name = Debug; 280 | }; 281 | CB14D51E1D095BCB00EB35C9 /* Release */ = { 282 | isa = XCBuildConfiguration; 283 | buildSettings = { 284 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 285 | COMBINE_HIDPI_IMAGES = YES; 286 | INFOPLIST_FILE = "HTTPDNS-Mac-Demo/Info.plist"; 287 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 288 | PRODUCT_BUNDLE_IDENTIFIER = "com.yourtion.HTTPDNS-Mac-Demo"; 289 | PRODUCT_NAME = "$(TARGET_NAME)"; 290 | }; 291 | name = Release; 292 | }; 293 | /* End XCBuildConfiguration section */ 294 | 295 | /* Begin XCConfigurationList section */ 296 | CB14D5031D095BCB00EB35C9 /* Build configuration list for PBXProject "HTTPDNS-Mac-Demo" */ = { 297 | isa = XCConfigurationList; 298 | buildConfigurations = ( 299 | CB14D51A1D095BCB00EB35C9 /* Debug */, 300 | CB14D51B1D095BCB00EB35C9 /* Release */, 301 | ); 302 | defaultConfigurationIsVisible = 0; 303 | defaultConfigurationName = Release; 304 | }; 305 | CB14D51C1D095BCB00EB35C9 /* Build configuration list for PBXNativeTarget "HTTPDNS-Mac-Demo" */ = { 306 | isa = XCConfigurationList; 307 | buildConfigurations = ( 308 | CB14D51D1D095BCB00EB35C9 /* Debug */, 309 | CB14D51E1D095BCB00EB35C9 /* Release */, 310 | ); 311 | defaultConfigurationIsVisible = 0; 312 | defaultConfigurationName = Release; 313 | }; 314 | /* End XCConfigurationList section */ 315 | }; 316 | rootObject = CB14D5001D095BCB00EB35C9 /* Project object */; 317 | } 318 | -------------------------------------------------------------------------------- /Demos/HTTPDNS-Mac-Demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Demos/HTTPDNS-Mac-Demo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // HTTPDNS-Mac-Demo 4 | // 5 | // Created by YourtionGuo on 6/9/16. 6 | // Copyright © 2016 Yourtion. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : NSObject 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /Demos/HTTPDNS-Mac-Demo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // HTTPDNS-Mac-Demo 4 | // 5 | // Created by YourtionGuo on 6/9/16. 6 | // Copyright © 2016 Yourtion. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { 18 | // Insert code here to initialize your application 19 | } 20 | 21 | - (void)applicationWillTerminate:(NSNotification *)aNotification { 22 | // Insert code here to tear down your application 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Demos/HTTPDNS-Mac-Demo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "size" : "16x16", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "size" : "16x16", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "size" : "32x32", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "size" : "32x32", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "size" : "128x128", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "size" : "128x128", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "size" : "256x256", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "size" : "256x256", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "size" : "512x512", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "size" : "512x512", 51 | "scale" : "2x" 52 | } 53 | ], 54 | "info" : { 55 | "version" : 1, 56 | "author" : "xcode" 57 | } 58 | } -------------------------------------------------------------------------------- /Demos/HTTPDNS-Mac-Demo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | Default 510 | 511 | 512 | 513 | 514 | 515 | 516 | Left to Right 517 | 518 | 519 | 520 | 521 | 522 | 523 | Right to Left 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | Default 535 | 536 | 537 | 538 | 539 | 540 | 541 | Left to Right 542 | 543 | 544 | 545 | 546 | 547 | 548 | Right to Left 549 | 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 681 | 682 | -------------------------------------------------------------------------------- /Demos/HTTPDNS-Mac-Demo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | $(MACOSX_DEPLOYMENT_TARGET) 27 | NSAppTransportSecurity 28 | 29 | NSAllowsArbitraryLoads 30 | 31 | 32 | NSHumanReadableCopyright 33 | Copyright © 2016 Yourtion. All rights reserved. 34 | NSMainStoryboardFile 35 | Main 36 | NSPrincipalClass 37 | NSApplication 38 | 39 | 40 | -------------------------------------------------------------------------------- /Demos/HTTPDNS-Mac-Demo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // HTTPDNS-Mac-Demo 4 | // 5 | // Created by YourtionGuo on 6/9/16. 6 | // Copyright © 2016 Yourtion. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : NSViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /Demos/HTTPDNS-Mac-Demo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // HTTPDNS-Mac-Demo 4 | // 5 | // Created by YourtionGuo on 6/9/16. 6 | // Copyright © 2016 Yourtion. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import 11 | 12 | @implementation ViewController 13 | 14 | - (void)viewDidLoad { 15 | [super viewDidLoad]; 16 | 17 | // Do any additional setup after loading the view. 18 | [[HTTPDNSClient sharedInstance] getRecord:@"www.taobao.com" callback:^(HTTPDNSRecord *record) { 19 | NSLog(@"IP : %@", record.ip); 20 | NSLog(@"description : %@", record.description); 21 | }]; 22 | [[HTTPDNSClient sharedInstance] cleanAllCache]; 23 | 24 | [[HTTPDNSClient sharedInstance] useDNSPod]; 25 | 26 | [[HTTPDNSClient sharedInstance] useGoogle]; 27 | [[HTTPDNSClient sharedInstance] getRecord:@"apple.com" callback:^(HTTPDNSRecord *record) { 28 | NSLog(@"IP : %@", record.ip); 29 | NSLog(@"description : %@", record.description); 30 | }]; 31 | [[HTTPDNSClient sharedInstance] useAliYunWithKey:@"Your Aliyun HTTPNDS accound id"]; 32 | [[HTTPDNSClient sharedInstance] useDNSPodProWithAccount:@"Your DNSPod pro accound id" Key:@"Your DNSPod pro key"]; 33 | } 34 | 35 | - (void)setRepresentedObject:(id)representedObject { 36 | [super setRepresentedObject:representedObject]; 37 | 38 | // Update the view, if already loaded. 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /Demos/HTTPDNS-Mac-Demo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // HTTPDNS-Mac-Demo 4 | // 5 | // Created by YourtionGuo on 6/9/16. 6 | // Copyright © 2016 Yourtion. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, const char * argv[]) { 12 | return NSApplicationMain(argc, argv); 13 | } 14 | -------------------------------------------------------------------------------- /Demos/HTTPDNS-iOS-Demo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | CB14D4EA1D095B8E00EB35C9 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CB14D4E91D095B8E00EB35C9 /* main.m */; }; 11 | CB14D4ED1D095B8E00EB35C9 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CB14D4EC1D095B8E00EB35C9 /* AppDelegate.m */; }; 12 | CB14D4F01D095B8E00EB35C9 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CB14D4EF1D095B8E00EB35C9 /* ViewController.m */; }; 13 | CB14D4F31D095B8E00EB35C9 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CB14D4F11D095B8E00EB35C9 /* Main.storyboard */; }; 14 | CB14D4F51D095B8E00EB35C9 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CB14D4F41D095B8E00EB35C9 /* Assets.xcassets */; }; 15 | CB14D4F81D095B8E00EB35C9 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CB14D4F61D095B8E00EB35C9 /* LaunchScreen.storyboard */; }; 16 | CB14D5271D095C8C00EB35C9 /* HTTPDNS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB14D5251D095C8500EB35C9 /* HTTPDNS.framework */; }; 17 | CB14D5281D095C8C00EB35C9 /* HTTPDNS.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = CB14D5251D095C8500EB35C9 /* HTTPDNS.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXCopyFilesBuildPhase section */ 21 | CB14D5291D095C8C00EB35C9 /* Embed Frameworks */ = { 22 | isa = PBXCopyFilesBuildPhase; 23 | buildActionMask = 2147483647; 24 | dstPath = ""; 25 | dstSubfolderSpec = 10; 26 | files = ( 27 | CB14D5281D095C8C00EB35C9 /* HTTPDNS.framework in Embed Frameworks */, 28 | ); 29 | name = "Embed Frameworks"; 30 | runOnlyForDeploymentPostprocessing = 0; 31 | }; 32 | /* End PBXCopyFilesBuildPhase section */ 33 | 34 | /* Begin PBXFileReference section */ 35 | CB14D4E51D095B8E00EB35C9 /* HTTPDNS-iOS-Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "HTTPDNS-iOS-Demo.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 36 | CB14D4E91D095B8E00EB35C9 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 37 | CB14D4EB1D095B8E00EB35C9 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 38 | CB14D4EC1D095B8E00EB35C9 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 39 | CB14D4EE1D095B8E00EB35C9 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 40 | CB14D4EF1D095B8E00EB35C9 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 41 | CB14D4F21D095B8E00EB35C9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 42 | CB14D4F41D095B8E00EB35C9 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 43 | CB14D4F71D095B8E00EB35C9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 44 | CB14D4F91D095B8E00EB35C9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 45 | CB14D5251D095C8500EB35C9 /* HTTPDNS.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = HTTPDNS.framework; path = "../../../../Library/Developer/Xcode/DerivedData/HTTPDNS-gbomfzesgwkjzbbzoxbedfbxcndz/Build/Products/Debug-iphoneos/HTTPDNS.framework"; sourceTree = ""; }; 46 | /* End PBXFileReference section */ 47 | 48 | /* Begin PBXFrameworksBuildPhase section */ 49 | CB14D4E21D095B8E00EB35C9 /* Frameworks */ = { 50 | isa = PBXFrameworksBuildPhase; 51 | buildActionMask = 2147483647; 52 | files = ( 53 | CB14D5271D095C8C00EB35C9 /* HTTPDNS.framework in Frameworks */, 54 | ); 55 | runOnlyForDeploymentPostprocessing = 0; 56 | }; 57 | /* End PBXFrameworksBuildPhase section */ 58 | 59 | /* Begin PBXGroup section */ 60 | CB14D4DC1D095B8E00EB35C9 = { 61 | isa = PBXGroup; 62 | children = ( 63 | CB14D5251D095C8500EB35C9 /* HTTPDNS.framework */, 64 | CB14D4E71D095B8E00EB35C9 /* HTTPDNS-iOS-Demo */, 65 | CB14D4E61D095B8E00EB35C9 /* Products */, 66 | ); 67 | sourceTree = ""; 68 | }; 69 | CB14D4E61D095B8E00EB35C9 /* Products */ = { 70 | isa = PBXGroup; 71 | children = ( 72 | CB14D4E51D095B8E00EB35C9 /* HTTPDNS-iOS-Demo.app */, 73 | ); 74 | name = Products; 75 | sourceTree = ""; 76 | }; 77 | CB14D4E71D095B8E00EB35C9 /* HTTPDNS-iOS-Demo */ = { 78 | isa = PBXGroup; 79 | children = ( 80 | CB14D4EB1D095B8E00EB35C9 /* AppDelegate.h */, 81 | CB14D4EC1D095B8E00EB35C9 /* AppDelegate.m */, 82 | CB14D4EE1D095B8E00EB35C9 /* ViewController.h */, 83 | CB14D4EF1D095B8E00EB35C9 /* ViewController.m */, 84 | CB14D4F11D095B8E00EB35C9 /* Main.storyboard */, 85 | CB14D4F41D095B8E00EB35C9 /* Assets.xcassets */, 86 | CB14D4F61D095B8E00EB35C9 /* LaunchScreen.storyboard */, 87 | CB14D4F91D095B8E00EB35C9 /* Info.plist */, 88 | CB14D4E81D095B8E00EB35C9 /* Supporting Files */, 89 | ); 90 | path = "HTTPDNS-iOS-Demo"; 91 | sourceTree = ""; 92 | }; 93 | CB14D4E81D095B8E00EB35C9 /* Supporting Files */ = { 94 | isa = PBXGroup; 95 | children = ( 96 | CB14D4E91D095B8E00EB35C9 /* main.m */, 97 | ); 98 | name = "Supporting Files"; 99 | sourceTree = ""; 100 | }; 101 | /* End PBXGroup section */ 102 | 103 | /* Begin PBXNativeTarget section */ 104 | CB14D4E41D095B8E00EB35C9 /* HTTPDNS-iOS-Demo */ = { 105 | isa = PBXNativeTarget; 106 | buildConfigurationList = CB14D4FC1D095B8E00EB35C9 /* Build configuration list for PBXNativeTarget "HTTPDNS-iOS-Demo" */; 107 | buildPhases = ( 108 | CB14D4E11D095B8E00EB35C9 /* Sources */, 109 | CB14D4E21D095B8E00EB35C9 /* Frameworks */, 110 | CB14D4E31D095B8E00EB35C9 /* Resources */, 111 | CB14D5291D095C8C00EB35C9 /* Embed Frameworks */, 112 | ); 113 | buildRules = ( 114 | ); 115 | dependencies = ( 116 | ); 117 | name = "HTTPDNS-iOS-Demo"; 118 | productName = "HTTPDNS-iOS-Demo"; 119 | productReference = CB14D4E51D095B8E00EB35C9 /* HTTPDNS-iOS-Demo.app */; 120 | productType = "com.apple.product-type.application"; 121 | }; 122 | /* End PBXNativeTarget section */ 123 | 124 | /* Begin PBXProject section */ 125 | CB14D4DD1D095B8E00EB35C9 /* Project object */ = { 126 | isa = PBXProject; 127 | attributes = { 128 | LastUpgradeCheck = 0810; 129 | ORGANIZATIONNAME = Yourtion; 130 | TargetAttributes = { 131 | CB14D4E41D095B8E00EB35C9 = { 132 | CreatedOnToolsVersion = 7.3.1; 133 | }; 134 | }; 135 | }; 136 | buildConfigurationList = CB14D4E01D095B8E00EB35C9 /* Build configuration list for PBXProject "HTTPDNS-iOS-Demo" */; 137 | compatibilityVersion = "Xcode 3.2"; 138 | developmentRegion = English; 139 | hasScannedForEncodings = 0; 140 | knownRegions = ( 141 | en, 142 | Base, 143 | ); 144 | mainGroup = CB14D4DC1D095B8E00EB35C9; 145 | productRefGroup = CB14D4E61D095B8E00EB35C9 /* Products */; 146 | projectDirPath = ""; 147 | projectRoot = ""; 148 | targets = ( 149 | CB14D4E41D095B8E00EB35C9 /* HTTPDNS-iOS-Demo */, 150 | ); 151 | }; 152 | /* End PBXProject section */ 153 | 154 | /* Begin PBXResourcesBuildPhase section */ 155 | CB14D4E31D095B8E00EB35C9 /* Resources */ = { 156 | isa = PBXResourcesBuildPhase; 157 | buildActionMask = 2147483647; 158 | files = ( 159 | CB14D4F81D095B8E00EB35C9 /* LaunchScreen.storyboard in Resources */, 160 | CB14D4F51D095B8E00EB35C9 /* Assets.xcassets in Resources */, 161 | CB14D4F31D095B8E00EB35C9 /* Main.storyboard in Resources */, 162 | ); 163 | runOnlyForDeploymentPostprocessing = 0; 164 | }; 165 | /* End PBXResourcesBuildPhase section */ 166 | 167 | /* Begin PBXSourcesBuildPhase section */ 168 | CB14D4E11D095B8E00EB35C9 /* Sources */ = { 169 | isa = PBXSourcesBuildPhase; 170 | buildActionMask = 2147483647; 171 | files = ( 172 | CB14D4F01D095B8E00EB35C9 /* ViewController.m in Sources */, 173 | CB14D4ED1D095B8E00EB35C9 /* AppDelegate.m in Sources */, 174 | CB14D4EA1D095B8E00EB35C9 /* main.m in Sources */, 175 | ); 176 | runOnlyForDeploymentPostprocessing = 0; 177 | }; 178 | /* End PBXSourcesBuildPhase section */ 179 | 180 | /* Begin PBXVariantGroup section */ 181 | CB14D4F11D095B8E00EB35C9 /* Main.storyboard */ = { 182 | isa = PBXVariantGroup; 183 | children = ( 184 | CB14D4F21D095B8E00EB35C9 /* Base */, 185 | ); 186 | name = Main.storyboard; 187 | sourceTree = ""; 188 | }; 189 | CB14D4F61D095B8E00EB35C9 /* LaunchScreen.storyboard */ = { 190 | isa = PBXVariantGroup; 191 | children = ( 192 | CB14D4F71D095B8E00EB35C9 /* Base */, 193 | ); 194 | name = LaunchScreen.storyboard; 195 | sourceTree = ""; 196 | }; 197 | /* End PBXVariantGroup section */ 198 | 199 | /* Begin XCBuildConfiguration section */ 200 | CB14D4FA1D095B8E00EB35C9 /* Debug */ = { 201 | isa = XCBuildConfiguration; 202 | buildSettings = { 203 | ALWAYS_SEARCH_USER_PATHS = NO; 204 | CLANG_ANALYZER_NONNULL = YES; 205 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 206 | CLANG_CXX_LIBRARY = "libc++"; 207 | CLANG_ENABLE_MODULES = YES; 208 | CLANG_ENABLE_OBJC_ARC = YES; 209 | CLANG_WARN_BOOL_CONVERSION = YES; 210 | CLANG_WARN_CONSTANT_CONVERSION = YES; 211 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 212 | CLANG_WARN_EMPTY_BODY = YES; 213 | CLANG_WARN_ENUM_CONVERSION = YES; 214 | CLANG_WARN_INFINITE_RECURSION = YES; 215 | CLANG_WARN_INT_CONVERSION = YES; 216 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 217 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 218 | CLANG_WARN_UNREACHABLE_CODE = YES; 219 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 220 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 221 | COPY_PHASE_STRIP = NO; 222 | DEBUG_INFORMATION_FORMAT = dwarf; 223 | ENABLE_STRICT_OBJC_MSGSEND = YES; 224 | ENABLE_TESTABILITY = YES; 225 | GCC_C_LANGUAGE_STANDARD = gnu99; 226 | GCC_DYNAMIC_NO_PIC = NO; 227 | GCC_NO_COMMON_BLOCKS = YES; 228 | GCC_OPTIMIZATION_LEVEL = 0; 229 | GCC_PREPROCESSOR_DEFINITIONS = ( 230 | "DEBUG=1", 231 | "$(inherited)", 232 | ); 233 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 234 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 235 | GCC_WARN_UNDECLARED_SELECTOR = YES; 236 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 237 | GCC_WARN_UNUSED_FUNCTION = YES; 238 | GCC_WARN_UNUSED_VARIABLE = YES; 239 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 240 | MTL_ENABLE_DEBUG_INFO = YES; 241 | ONLY_ACTIVE_ARCH = YES; 242 | SDKROOT = iphoneos; 243 | }; 244 | name = Debug; 245 | }; 246 | CB14D4FB1D095B8E00EB35C9 /* Release */ = { 247 | isa = XCBuildConfiguration; 248 | buildSettings = { 249 | ALWAYS_SEARCH_USER_PATHS = NO; 250 | CLANG_ANALYZER_NONNULL = YES; 251 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 252 | CLANG_CXX_LIBRARY = "libc++"; 253 | CLANG_ENABLE_MODULES = YES; 254 | CLANG_ENABLE_OBJC_ARC = YES; 255 | CLANG_WARN_BOOL_CONVERSION = YES; 256 | CLANG_WARN_CONSTANT_CONVERSION = YES; 257 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 258 | CLANG_WARN_EMPTY_BODY = YES; 259 | CLANG_WARN_ENUM_CONVERSION = YES; 260 | CLANG_WARN_INFINITE_RECURSION = YES; 261 | CLANG_WARN_INT_CONVERSION = YES; 262 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 263 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 264 | CLANG_WARN_UNREACHABLE_CODE = YES; 265 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 266 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 267 | COPY_PHASE_STRIP = NO; 268 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 269 | ENABLE_NS_ASSERTIONS = NO; 270 | ENABLE_STRICT_OBJC_MSGSEND = YES; 271 | GCC_C_LANGUAGE_STANDARD = gnu99; 272 | GCC_NO_COMMON_BLOCKS = YES; 273 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 274 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 275 | GCC_WARN_UNDECLARED_SELECTOR = YES; 276 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 277 | GCC_WARN_UNUSED_FUNCTION = YES; 278 | GCC_WARN_UNUSED_VARIABLE = YES; 279 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 280 | MTL_ENABLE_DEBUG_INFO = NO; 281 | SDKROOT = iphoneos; 282 | VALIDATE_PRODUCT = YES; 283 | }; 284 | name = Release; 285 | }; 286 | CB14D4FD1D095B8E00EB35C9 /* Debug */ = { 287 | isa = XCBuildConfiguration; 288 | buildSettings = { 289 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 290 | INFOPLIST_FILE = "HTTPDNS-iOS-Demo/Info.plist"; 291 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 292 | PRODUCT_BUNDLE_IDENTIFIER = "com.yourtion.HTTPDNS-iOS-Demo"; 293 | PRODUCT_NAME = "$(TARGET_NAME)"; 294 | }; 295 | name = Debug; 296 | }; 297 | CB14D4FE1D095B8E00EB35C9 /* Release */ = { 298 | isa = XCBuildConfiguration; 299 | buildSettings = { 300 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 301 | INFOPLIST_FILE = "HTTPDNS-iOS-Demo/Info.plist"; 302 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 303 | PRODUCT_BUNDLE_IDENTIFIER = "com.yourtion.HTTPDNS-iOS-Demo"; 304 | PRODUCT_NAME = "$(TARGET_NAME)"; 305 | }; 306 | name = Release; 307 | }; 308 | /* End XCBuildConfiguration section */ 309 | 310 | /* Begin XCConfigurationList section */ 311 | CB14D4E01D095B8E00EB35C9 /* Build configuration list for PBXProject "HTTPDNS-iOS-Demo" */ = { 312 | isa = XCConfigurationList; 313 | buildConfigurations = ( 314 | CB14D4FA1D095B8E00EB35C9 /* Debug */, 315 | CB14D4FB1D095B8E00EB35C9 /* Release */, 316 | ); 317 | defaultConfigurationIsVisible = 0; 318 | defaultConfigurationName = Release; 319 | }; 320 | CB14D4FC1D095B8E00EB35C9 /* Build configuration list for PBXNativeTarget "HTTPDNS-iOS-Demo" */ = { 321 | isa = XCConfigurationList; 322 | buildConfigurations = ( 323 | CB14D4FD1D095B8E00EB35C9 /* Debug */, 324 | CB14D4FE1D095B8E00EB35C9 /* Release */, 325 | ); 326 | defaultConfigurationIsVisible = 0; 327 | defaultConfigurationName = Release; 328 | }; 329 | /* End XCConfigurationList section */ 330 | }; 331 | rootObject = CB14D4DD1D095B8E00EB35C9 /* Project object */; 332 | } 333 | -------------------------------------------------------------------------------- /Demos/HTTPDNS-iOS-Demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Demos/HTTPDNS-iOS-Demo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // HTTPDNS-iOS-Demo 4 | // 5 | // Created by YourtionGuo on 6/9/16. 6 | // Copyright © 2016 Yourtion. 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 | -------------------------------------------------------------------------------- /Demos/HTTPDNS-iOS-Demo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // HTTPDNS-iOS-Demo 4 | // 5 | // Created by YourtionGuo on 6/9/16. 6 | // Copyright © 2016 Yourtion. 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 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // 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. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // 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. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /Demos/HTTPDNS-iOS-Demo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /Demos/HTTPDNS-iOS-Demo/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Demos/HTTPDNS-iOS-Demo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Demos/HTTPDNS-iOS-Demo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Demos/HTTPDNS-iOS-Demo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // HTTPDNS-iOS-Demo 4 | // 5 | // Created by YourtionGuo on 6/9/16. 6 | // Copyright © 2016 Yourtion. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /Demos/HTTPDNS-iOS-Demo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // HTTPDNS-iOS-Demo 4 | // 5 | // Created by YourtionGuo on 6/9/16. 6 | // Copyright © 2016 Yourtion. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import 11 | 12 | @interface ViewController () 13 | 14 | @end 15 | 16 | @implementation ViewController 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | // Do any additional setup after loading the view, typically from a nib. 21 | [[HTTPDNSClient sharedInstance] getRecord:@"www.taobao.com" callback:^(HTTPDNSRecord *record) { 22 | NSLog(@"IP : %@", record.ip); 23 | NSLog(@"description : %@", record.description); 24 | }]; 25 | [[HTTPDNSClient sharedInstance] cleanAllCache]; 26 | 27 | [[HTTPDNSClient sharedInstance] useDNSPod]; 28 | 29 | [[HTTPDNSClient sharedInstance] useGoogle]; 30 | [[HTTPDNSClient sharedInstance] getRecord:@"apple.com" callback:^(HTTPDNSRecord *record) { 31 | NSLog(@"IP : %@", record.ip); 32 | NSLog(@"description : %@", record.description); 33 | }]; 34 | [[HTTPDNSClient sharedInstance] useAliYunWithKey:@"Your Aliyun HTTPNDS accound id"]; 35 | [[HTTPDNSClient sharedInstance] useDNSPodProWithAccount:@"Your DNSPod pro accound id" Key:@"Your DNSPod pro key"]; 36 | } 37 | 38 | - (void)didReceiveMemoryWarning { 39 | [super didReceiveMemoryWarning]; 40 | // Dispose of any resources that can be recreated. 41 | } 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /Demos/HTTPDNS-iOS-Demo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // HTTPDNS-iOS-Demo 4 | // 5 | // Created by YourtionGuo on 6/9/16. 6 | // Copyright © 2016 Yourtion. 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 | -------------------------------------------------------------------------------- /HTTPDNS.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | 3 | s.name = "HTTPDNS" 4 | s.version = "0.8.0" 5 | s.summary = "Use HTTP to resolve domain ( DNSPod AliYun Google )" 6 | 7 | s.description = <<-DESC 8 | HTTPDNS 库 Objective-C 实现。 9 | 支持 DNSPod、DNSPod 企业版、AliYunDNS、 Google 等(方便扩展) 10 | DESC 11 | 12 | s.homepage = "https://github.com/yourtion/HTTPDNS-OC" 13 | s.license = "MIT" 14 | s.author = { "Yourtion" => "yourtion@gmail.com" } 15 | s.source = { :git => "https://github.com/yourtion/HTTPDNS-OC.git", :tag => s.version } 16 | s.source_files = "HTTPDNS" 17 | 18 | s.ios.deployment_target = '8.0' 19 | s.osx.deployment_target = '10.10' 20 | 21 | s.frameworks = "Foundation" 22 | s.requires_arc = true 23 | 24 | end 25 | -------------------------------------------------------------------------------- /HTTPDNS.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | CB14CB5A1D0FAEC20077903F /* HTTPDNSAliYun.h in Headers */ = {isa = PBXBuildFile; fileRef = CB14CB581D0FAEC20077903F /* HTTPDNSAliYun.h */; }; 11 | CB14CB5B1D0FAEC20077903F /* HTTPDNSAliYun.h in Headers */ = {isa = PBXBuildFile; fileRef = CB14CB581D0FAEC20077903F /* HTTPDNSAliYun.h */; }; 12 | CB14CB5C1D0FAEC20077903F /* HTTPDNSAliYun.m in Sources */ = {isa = PBXBuildFile; fileRef = CB14CB591D0FAEC20077903F /* HTTPDNSAliYun.m */; }; 13 | CB14CB5D1D0FAEC20077903F /* HTTPDNSAliYun.m in Sources */ = {isa = PBXBuildFile; fileRef = CB14CB591D0FAEC20077903F /* HTTPDNSAliYun.m */; }; 14 | CB14D4D51D095A4A00EB35C9 /* HTTPDNS.h in Headers */ = {isa = PBXBuildFile; fileRef = CB45C1F01CA809D30018439A /* HTTPDNS.h */; settings = {ATTRIBUTES = (Public, ); }; }; 15 | CB14D4D61D095A4A00EB35C9 /* HTTPDNSClient.h in Headers */ = {isa = PBXBuildFile; fileRef = CB65B29A1D053E5300434C3A /* HTTPDNSClient.h */; settings = {ATTRIBUTES = (Public, ); }; }; 16 | CB14D4D71D095A4A00EB35C9 /* HTTPDNSRecord.h in Headers */ = {isa = PBXBuildFile; fileRef = CB65B2A31D05424600434C3A /* HTTPDNSRecord.h */; settings = {ATTRIBUTES = (Public, ); }; }; 17 | CB14D4D81D095A5800EB35C9 /* HTTPDNSClient.m in Sources */ = {isa = PBXBuildFile; fileRef = CB65B29B1D053E5300434C3A /* HTTPDNSClient.m */; }; 18 | CB14D4D91D095A5800EB35C9 /* HTTPDNSUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = CB65B29F1D053E7C00434C3A /* HTTPDNSUtil.m */; }; 19 | CB14D4DA1D095A5800EB35C9 /* HTTPDNSRecord.m in Sources */ = {isa = PBXBuildFile; fileRef = CB65B2A41D05424600434C3A /* HTTPDNSRecord.m */; }; 20 | CB14D4DB1D095A6900EB35C9 /* HTTPDNSUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = CB65B29E1D053E7C00434C3A /* HTTPDNSUtil.h */; }; 21 | CB45C1F11CA809D30018439A /* HTTPDNS.h in Headers */ = {isa = PBXBuildFile; fileRef = CB45C1F01CA809D30018439A /* HTTPDNS.h */; settings = {ATTRIBUTES = (Public, ); }; }; 22 | CB65B29C1D053E5300434C3A /* HTTPDNSClient.h in Headers */ = {isa = PBXBuildFile; fileRef = CB65B29A1D053E5300434C3A /* HTTPDNSClient.h */; settings = {ATTRIBUTES = (Public, ); }; }; 23 | CB65B29D1D053E5300434C3A /* HTTPDNSClient.m in Sources */ = {isa = PBXBuildFile; fileRef = CB65B29B1D053E5300434C3A /* HTTPDNSClient.m */; }; 24 | CB65B2A01D053E7C00434C3A /* HTTPDNSUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = CB65B29E1D053E7C00434C3A /* HTTPDNSUtil.h */; }; 25 | CB65B2A11D053E7C00434C3A /* HTTPDNSUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = CB65B29F1D053E7C00434C3A /* HTTPDNSUtil.m */; }; 26 | CB65B2A51D05424600434C3A /* HTTPDNSRecord.h in Headers */ = {isa = PBXBuildFile; fileRef = CB65B2A31D05424600434C3A /* HTTPDNSRecord.h */; settings = {ATTRIBUTES = (Public, ); }; }; 27 | CB65B2A61D05424600434C3A /* HTTPDNSRecord.m in Sources */ = {isa = PBXBuildFile; fileRef = CB65B2A41D05424600434C3A /* HTTPDNSRecord.m */; }; 28 | CB7E82C51D1786A700767E10 /* HTTPDNS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB45C1ED1CA809D30018439A /* HTTPDNS.framework */; }; 29 | CB7E82D41D1786CB00767E10 /* HTTPDNS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB14D4CD1D095A0000EB35C9 /* HTTPDNS.framework */; }; 30 | CB7E82DB1D17876800767E10 /* HTTPDNSUtilTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CB7E82DA1D17876800767E10 /* HTTPDNSUtilTest.m */; }; 31 | CB7E82DC1D17876800767E10 /* HTTPDNSUtilTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CB7E82DA1D17876800767E10 /* HTTPDNSUtilTest.m */; }; 32 | CBD4EBAA1D0D08AC006FFD74 /* HTTPDNSBase.h in Headers */ = {isa = PBXBuildFile; fileRef = CBD4EBA81D0D08AC006FFD74 /* HTTPDNSBase.h */; }; 33 | CBD4EBAB1D0D08AC006FFD74 /* HTTPDNSBase.h in Headers */ = {isa = PBXBuildFile; fileRef = CBD4EBA81D0D08AC006FFD74 /* HTTPDNSBase.h */; }; 34 | CBD4EBAC1D0D08AC006FFD74 /* HTTPDNSBase.m in Sources */ = {isa = PBXBuildFile; fileRef = CBD4EBA91D0D08AC006FFD74 /* HTTPDNSBase.m */; }; 35 | CBD4EBAD1D0D08AC006FFD74 /* HTTPDNSBase.m in Sources */ = {isa = PBXBuildFile; fileRef = CBD4EBA91D0D08AC006FFD74 /* HTTPDNSBase.m */; }; 36 | CBD4EBB21D0D0CBA006FFD74 /* HTTPDNSDNSPod.h in Headers */ = {isa = PBXBuildFile; fileRef = CBD4EBB01D0D0CBA006FFD74 /* HTTPDNSDNSPod.h */; }; 37 | CBD4EBB31D0D0CBA006FFD74 /* HTTPDNSDNSPod.h in Headers */ = {isa = PBXBuildFile; fileRef = CBD4EBB01D0D0CBA006FFD74 /* HTTPDNSDNSPod.h */; }; 38 | CBD4EBB41D0D0CBA006FFD74 /* HTTPDNSDNSPod.m in Sources */ = {isa = PBXBuildFile; fileRef = CBD4EBB11D0D0CBA006FFD74 /* HTTPDNSDNSPod.m */; }; 39 | CBD4EBB51D0D0CBA006FFD74 /* HTTPDNSDNSPod.m in Sources */ = {isa = PBXBuildFile; fileRef = CBD4EBB11D0D0CBA006FFD74 /* HTTPDNSDNSPod.m */; }; 40 | CBDFBC751D193F0B00D52170 /* HTTPDNSDNSPodTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CBDFBC741D193F0B00D52170 /* HTTPDNSDNSPodTest.m */; }; 41 | CBDFBC761D193F0B00D52170 /* HTTPDNSDNSPodTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CBDFBC741D193F0B00D52170 /* HTTPDNSDNSPodTest.m */; }; 42 | CBDFBC781D1946AA00D52170 /* HTTPDNSAliYunTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CBDFBC771D1946AA00D52170 /* HTTPDNSAliYunTest.m */; }; 43 | CBDFBC791D1946AA00D52170 /* HTTPDNSAliYunTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CBDFBC771D1946AA00D52170 /* HTTPDNSAliYunTest.m */; }; 44 | CBE754881E0235D0004BFE61 /* HTTPDNSGoogle.h in Headers */ = {isa = PBXBuildFile; fileRef = CBE754861E0235D0004BFE61 /* HTTPDNSGoogle.h */; }; 45 | CBE754891E0235D0004BFE61 /* HTTPDNSGoogle.h in Headers */ = {isa = PBXBuildFile; fileRef = CBE754861E0235D0004BFE61 /* HTTPDNSGoogle.h */; }; 46 | CBE7548A1E0235D0004BFE61 /* HTTPDNSGoogle.m in Sources */ = {isa = PBXBuildFile; fileRef = CBE754871E0235D0004BFE61 /* HTTPDNSGoogle.m */; }; 47 | CBE7548B1E0235D0004BFE61 /* HTTPDNSGoogle.m in Sources */ = {isa = PBXBuildFile; fileRef = CBE754871E0235D0004BFE61 /* HTTPDNSGoogle.m */; }; 48 | CBE7548D1E0236AF004BFE61 /* HTTPDNSGoogleTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CBE7548C1E0236AF004BFE61 /* HTTPDNSGoogleTest.m */; }; 49 | CBE7548E1E0236AF004BFE61 /* HTTPDNSGoogleTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CBE7548C1E0236AF004BFE61 /* HTTPDNSGoogleTest.m */; }; 50 | CBEF15791D1532A00028B2B1 /* HTTPDNSCryptor.h in Headers */ = {isa = PBXBuildFile; fileRef = CBEF15771D1532A00028B2B1 /* HTTPDNSCryptor.h */; }; 51 | CBEF157A1D1532A00028B2B1 /* HTTPDNSCryptor.h in Headers */ = {isa = PBXBuildFile; fileRef = CBEF15771D1532A00028B2B1 /* HTTPDNSCryptor.h */; }; 52 | CBEF157B1D1532A00028B2B1 /* HTTPDNSCryptor.m in Sources */ = {isa = PBXBuildFile; fileRef = CBEF15781D1532A00028B2B1 /* HTTPDNSCryptor.m */; }; 53 | CBEF157C1D1532A00028B2B1 /* HTTPDNSCryptor.m in Sources */ = {isa = PBXBuildFile; fileRef = CBEF15781D1532A00028B2B1 /* HTTPDNSCryptor.m */; }; 54 | CBEF157F1D1537100028B2B1 /* HTTPDNSHex.h in Headers */ = {isa = PBXBuildFile; fileRef = CBEF157D1D1537100028B2B1 /* HTTPDNSHex.h */; }; 55 | CBEF15801D1537100028B2B1 /* HTTPDNSHex.h in Headers */ = {isa = PBXBuildFile; fileRef = CBEF157D1D1537100028B2B1 /* HTTPDNSHex.h */; }; 56 | CBEF15811D1537100028B2B1 /* HTTPDNSHex.m in Sources */ = {isa = PBXBuildFile; fileRef = CBEF157E1D1537100028B2B1 /* HTTPDNSHex.m */; }; 57 | CBEF15821D1537100028B2B1 /* HTTPDNSHex.m in Sources */ = {isa = PBXBuildFile; fileRef = CBEF157E1D1537100028B2B1 /* HTTPDNSHex.m */; }; 58 | /* End PBXBuildFile section */ 59 | 60 | /* Begin PBXContainerItemProxy section */ 61 | CB7E82C61D1786A700767E10 /* PBXContainerItemProxy */ = { 62 | isa = PBXContainerItemProxy; 63 | containerPortal = CB45C1E41CA809D30018439A /* Project object */; 64 | proxyType = 1; 65 | remoteGlobalIDString = CB45C1EC1CA809D30018439A; 66 | remoteInfo = HTTPDNS_iOS; 67 | }; 68 | CB7E82D51D1786CB00767E10 /* PBXContainerItemProxy */ = { 69 | isa = PBXContainerItemProxy; 70 | containerPortal = CB45C1E41CA809D30018439A /* Project object */; 71 | proxyType = 1; 72 | remoteGlobalIDString = CB14D4CC1D095A0000EB35C9; 73 | remoteInfo = HTTPDNS_OSX; 74 | }; 75 | /* End PBXContainerItemProxy section */ 76 | 77 | /* Begin PBXFileReference section */ 78 | CB14CB581D0FAEC20077903F /* HTTPDNSAliYun.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPDNSAliYun.h; sourceTree = ""; }; 79 | CB14CB591D0FAEC20077903F /* HTTPDNSAliYun.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTTPDNSAliYun.m; sourceTree = ""; }; 80 | CB14D4CD1D095A0000EB35C9 /* HTTPDNS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = HTTPDNS.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 81 | CB45C1ED1CA809D30018439A /* HTTPDNS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = HTTPDNS.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 82 | CB45C1F01CA809D30018439A /* HTTPDNS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HTTPDNS.h; sourceTree = ""; }; 83 | CB45C1F21CA809D30018439A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 84 | CB65B29A1D053E5300434C3A /* HTTPDNSClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPDNSClient.h; sourceTree = ""; }; 85 | CB65B29B1D053E5300434C3A /* HTTPDNSClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTTPDNSClient.m; sourceTree = ""; }; 86 | CB65B29E1D053E7C00434C3A /* HTTPDNSUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPDNSUtil.h; sourceTree = ""; }; 87 | CB65B29F1D053E7C00434C3A /* HTTPDNSUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTTPDNSUtil.m; sourceTree = ""; }; 88 | CB65B2A31D05424600434C3A /* HTTPDNSRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPDNSRecord.h; sourceTree = ""; }; 89 | CB65B2A41D05424600434C3A /* HTTPDNSRecord.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTTPDNSRecord.m; sourceTree = ""; }; 90 | CB7E82C01D1786A700767E10 /* HTTPDNSTests_iOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = HTTPDNSTests_iOS.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 91 | CB7E82C41D1786A700767E10 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 92 | CB7E82CF1D1786CB00767E10 /* HTTPDNSTests_OSX.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = HTTPDNSTests_OSX.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 93 | CB7E82DA1D17876800767E10 /* HTTPDNSUtilTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTTPDNSUtilTest.m; sourceTree = ""; }; 94 | CBD4EBA81D0D08AC006FFD74 /* HTTPDNSBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPDNSBase.h; sourceTree = ""; }; 95 | CBD4EBA91D0D08AC006FFD74 /* HTTPDNSBase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTTPDNSBase.m; sourceTree = ""; }; 96 | CBD4EBB01D0D0CBA006FFD74 /* HTTPDNSDNSPod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPDNSDNSPod.h; sourceTree = ""; }; 97 | CBD4EBB11D0D0CBA006FFD74 /* HTTPDNSDNSPod.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTTPDNSDNSPod.m; sourceTree = ""; }; 98 | CBDFBC741D193F0B00D52170 /* HTTPDNSDNSPodTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTTPDNSDNSPodTest.m; sourceTree = ""; }; 99 | CBDFBC771D1946AA00D52170 /* HTTPDNSAliYunTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTTPDNSAliYunTest.m; sourceTree = ""; }; 100 | CBE754861E0235D0004BFE61 /* HTTPDNSGoogle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPDNSGoogle.h; sourceTree = ""; }; 101 | CBE754871E0235D0004BFE61 /* HTTPDNSGoogle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTTPDNSGoogle.m; sourceTree = ""; }; 102 | CBE7548C1E0236AF004BFE61 /* HTTPDNSGoogleTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTTPDNSGoogleTest.m; sourceTree = ""; }; 103 | CBEF15771D1532A00028B2B1 /* HTTPDNSCryptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPDNSCryptor.h; sourceTree = ""; }; 104 | CBEF15781D1532A00028B2B1 /* HTTPDNSCryptor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTTPDNSCryptor.m; sourceTree = ""; }; 105 | CBEF157D1D1537100028B2B1 /* HTTPDNSHex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPDNSHex.h; sourceTree = ""; }; 106 | CBEF157E1D1537100028B2B1 /* HTTPDNSHex.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTTPDNSHex.m; sourceTree = ""; }; 107 | /* End PBXFileReference section */ 108 | 109 | /* Begin PBXFrameworksBuildPhase section */ 110 | CB14D4C91D095A0000EB35C9 /* Frameworks */ = { 111 | isa = PBXFrameworksBuildPhase; 112 | buildActionMask = 2147483647; 113 | files = ( 114 | ); 115 | runOnlyForDeploymentPostprocessing = 0; 116 | }; 117 | CB45C1E91CA809D30018439A /* Frameworks */ = { 118 | isa = PBXFrameworksBuildPhase; 119 | buildActionMask = 2147483647; 120 | files = ( 121 | ); 122 | runOnlyForDeploymentPostprocessing = 0; 123 | }; 124 | CB7E82BD1D1786A700767E10 /* Frameworks */ = { 125 | isa = PBXFrameworksBuildPhase; 126 | buildActionMask = 2147483647; 127 | files = ( 128 | CB7E82C51D1786A700767E10 /* HTTPDNS.framework in Frameworks */, 129 | ); 130 | runOnlyForDeploymentPostprocessing = 0; 131 | }; 132 | CB7E82CC1D1786CB00767E10 /* Frameworks */ = { 133 | isa = PBXFrameworksBuildPhase; 134 | buildActionMask = 2147483647; 135 | files = ( 136 | CB7E82D41D1786CB00767E10 /* HTTPDNS.framework in Frameworks */, 137 | ); 138 | runOnlyForDeploymentPostprocessing = 0; 139 | }; 140 | /* End PBXFrameworksBuildPhase section */ 141 | 142 | /* Begin PBXGroup section */ 143 | CB45C1E31CA809D30018439A = { 144 | isa = PBXGroup; 145 | children = ( 146 | CB45C1EF1CA809D30018439A /* HTTPDNS */, 147 | CB7E82C11D1786A700767E10 /* HTTPDNSTests */, 148 | CB45C1EE1CA809D30018439A /* Products */, 149 | ); 150 | sourceTree = ""; 151 | }; 152 | CB45C1EE1CA809D30018439A /* Products */ = { 153 | isa = PBXGroup; 154 | children = ( 155 | CB45C1ED1CA809D30018439A /* HTTPDNS.framework */, 156 | CB14D4CD1D095A0000EB35C9 /* HTTPDNS.framework */, 157 | CB7E82C01D1786A700767E10 /* HTTPDNSTests_iOS.xctest */, 158 | CB7E82CF1D1786CB00767E10 /* HTTPDNSTests_OSX.xctest */, 159 | ); 160 | name = Products; 161 | sourceTree = ""; 162 | }; 163 | CB45C1EF1CA809D30018439A /* HTTPDNS */ = { 164 | isa = PBXGroup; 165 | children = ( 166 | CB45C1F21CA809D30018439A /* Info.plist */, 167 | CB45C1F01CA809D30018439A /* HTTPDNS.h */, 168 | CBEF15761D1532240028B2B1 /* Utils */, 169 | CBEF15751D1532160028B2B1 /* Provider */, 170 | CB65B29A1D053E5300434C3A /* HTTPDNSClient.h */, 171 | CB65B29B1D053E5300434C3A /* HTTPDNSClient.m */, 172 | CB65B2A31D05424600434C3A /* HTTPDNSRecord.h */, 173 | CB65B2A41D05424600434C3A /* HTTPDNSRecord.m */, 174 | ); 175 | path = HTTPDNS; 176 | sourceTree = ""; 177 | }; 178 | CB7E82C11D1786A700767E10 /* HTTPDNSTests */ = { 179 | isa = PBXGroup; 180 | children = ( 181 | CB7E82C41D1786A700767E10 /* Info.plist */, 182 | CB7E82DA1D17876800767E10 /* HTTPDNSUtilTest.m */, 183 | CBDFBC771D1946AA00D52170 /* HTTPDNSAliYunTest.m */, 184 | CBDFBC741D193F0B00D52170 /* HTTPDNSDNSPodTest.m */, 185 | CBE7548C1E0236AF004BFE61 /* HTTPDNSGoogleTest.m */, 186 | ); 187 | path = HTTPDNSTests; 188 | sourceTree = ""; 189 | }; 190 | CBEF15751D1532160028B2B1 /* Provider */ = { 191 | isa = PBXGroup; 192 | children = ( 193 | CBD4EBA81D0D08AC006FFD74 /* HTTPDNSBase.h */, 194 | CBD4EBA91D0D08AC006FFD74 /* HTTPDNSBase.m */, 195 | CB14CB581D0FAEC20077903F /* HTTPDNSAliYun.h */, 196 | CB14CB591D0FAEC20077903F /* HTTPDNSAliYun.m */, 197 | CBD4EBB01D0D0CBA006FFD74 /* HTTPDNSDNSPod.h */, 198 | CBD4EBB11D0D0CBA006FFD74 /* HTTPDNSDNSPod.m */, 199 | CBE754861E0235D0004BFE61 /* HTTPDNSGoogle.h */, 200 | CBE754871E0235D0004BFE61 /* HTTPDNSGoogle.m */, 201 | ); 202 | name = Provider; 203 | sourceTree = ""; 204 | }; 205 | CBEF15761D1532240028B2B1 /* Utils */ = { 206 | isa = PBXGroup; 207 | children = ( 208 | CB65B29E1D053E7C00434C3A /* HTTPDNSUtil.h */, 209 | CB65B29F1D053E7C00434C3A /* HTTPDNSUtil.m */, 210 | CBEF15771D1532A00028B2B1 /* HTTPDNSCryptor.h */, 211 | CBEF15781D1532A00028B2B1 /* HTTPDNSCryptor.m */, 212 | CBEF157D1D1537100028B2B1 /* HTTPDNSHex.h */, 213 | CBEF157E1D1537100028B2B1 /* HTTPDNSHex.m */, 214 | ); 215 | name = Utils; 216 | sourceTree = ""; 217 | }; 218 | /* End PBXGroup section */ 219 | 220 | /* Begin PBXHeadersBuildPhase section */ 221 | CB14D4CA1D095A0000EB35C9 /* Headers */ = { 222 | isa = PBXHeadersBuildPhase; 223 | buildActionMask = 2147483647; 224 | files = ( 225 | CB14D4D51D095A4A00EB35C9 /* HTTPDNS.h in Headers */, 226 | CB14D4D61D095A4A00EB35C9 /* HTTPDNSClient.h in Headers */, 227 | CB14D4D71D095A4A00EB35C9 /* HTTPDNSRecord.h in Headers */, 228 | CBD4EBAB1D0D08AC006FFD74 /* HTTPDNSBase.h in Headers */, 229 | CB14CB5B1D0FAEC20077903F /* HTTPDNSAliYun.h in Headers */, 230 | CBD4EBB31D0D0CBA006FFD74 /* HTTPDNSDNSPod.h in Headers */, 231 | CBEF157A1D1532A00028B2B1 /* HTTPDNSCryptor.h in Headers */, 232 | CBE754891E0235D0004BFE61 /* HTTPDNSGoogle.h in Headers */, 233 | CB14D4DB1D095A6900EB35C9 /* HTTPDNSUtil.h in Headers */, 234 | CBEF15801D1537100028B2B1 /* HTTPDNSHex.h in Headers */, 235 | ); 236 | runOnlyForDeploymentPostprocessing = 0; 237 | }; 238 | CB45C1EA1CA809D30018439A /* Headers */ = { 239 | isa = PBXHeadersBuildPhase; 240 | buildActionMask = 2147483647; 241 | files = ( 242 | CB45C1F11CA809D30018439A /* HTTPDNS.h in Headers */, 243 | CB65B29C1D053E5300434C3A /* HTTPDNSClient.h in Headers */, 244 | CBD4EBAA1D0D08AC006FFD74 /* HTTPDNSBase.h in Headers */, 245 | CB65B2A51D05424600434C3A /* HTTPDNSRecord.h in Headers */, 246 | CB14CB5A1D0FAEC20077903F /* HTTPDNSAliYun.h in Headers */, 247 | CBD4EBB21D0D0CBA006FFD74 /* HTTPDNSDNSPod.h in Headers */, 248 | CBEF157F1D1537100028B2B1 /* HTTPDNSHex.h in Headers */, 249 | CBE754881E0235D0004BFE61 /* HTTPDNSGoogle.h in Headers */, 250 | CBEF15791D1532A00028B2B1 /* HTTPDNSCryptor.h in Headers */, 251 | CB65B2A01D053E7C00434C3A /* HTTPDNSUtil.h in Headers */, 252 | ); 253 | runOnlyForDeploymentPostprocessing = 0; 254 | }; 255 | /* End PBXHeadersBuildPhase section */ 256 | 257 | /* Begin PBXNativeTarget section */ 258 | CB14D4CC1D095A0000EB35C9 /* HTTPDNS_OSX */ = { 259 | isa = PBXNativeTarget; 260 | buildConfigurationList = CB14D4D21D095A0000EB35C9 /* Build configuration list for PBXNativeTarget "HTTPDNS_OSX" */; 261 | buildPhases = ( 262 | CB14D4C81D095A0000EB35C9 /* Sources */, 263 | CB14D4C91D095A0000EB35C9 /* Frameworks */, 264 | CB14D4CA1D095A0000EB35C9 /* Headers */, 265 | CB14D4CB1D095A0000EB35C9 /* Resources */, 266 | ); 267 | buildRules = ( 268 | ); 269 | dependencies = ( 270 | ); 271 | name = HTTPDNS_OSX; 272 | productName = HTTPDNS; 273 | productReference = CB14D4CD1D095A0000EB35C9 /* HTTPDNS.framework */; 274 | productType = "com.apple.product-type.framework"; 275 | }; 276 | CB45C1EC1CA809D30018439A /* HTTPDNS_iOS */ = { 277 | isa = PBXNativeTarget; 278 | buildConfigurationList = CB45C1F51CA809D30018439A /* Build configuration list for PBXNativeTarget "HTTPDNS_iOS" */; 279 | buildPhases = ( 280 | CB45C1E81CA809D30018439A /* Sources */, 281 | CB45C1E91CA809D30018439A /* Frameworks */, 282 | CB45C1EA1CA809D30018439A /* Headers */, 283 | CB45C1EB1CA809D30018439A /* Resources */, 284 | ); 285 | buildRules = ( 286 | ); 287 | dependencies = ( 288 | ); 289 | name = HTTPDNS_iOS; 290 | productName = HTTPDNS; 291 | productReference = CB45C1ED1CA809D30018439A /* HTTPDNS.framework */; 292 | productType = "com.apple.product-type.framework"; 293 | }; 294 | CB7E82BF1D1786A700767E10 /* HTTPDNSTests_iOS */ = { 295 | isa = PBXNativeTarget; 296 | buildConfigurationList = CB7E82CA1D1786A700767E10 /* Build configuration list for PBXNativeTarget "HTTPDNSTests_iOS" */; 297 | buildPhases = ( 298 | CB7E82BC1D1786A700767E10 /* Sources */, 299 | CB7E82BD1D1786A700767E10 /* Frameworks */, 300 | CB7E82BE1D1786A700767E10 /* Resources */, 301 | ); 302 | buildRules = ( 303 | ); 304 | dependencies = ( 305 | CB7E82C71D1786A700767E10 /* PBXTargetDependency */, 306 | ); 307 | name = HTTPDNSTests_iOS; 308 | productName = HTTPDNSTests; 309 | productReference = CB7E82C01D1786A700767E10 /* HTTPDNSTests_iOS.xctest */; 310 | productType = "com.apple.product-type.bundle.unit-test"; 311 | }; 312 | CB7E82CE1D1786CB00767E10 /* HTTPDNSTests_OSX */ = { 313 | isa = PBXNativeTarget; 314 | buildConfigurationList = CB7E82D71D1786CB00767E10 /* Build configuration list for PBXNativeTarget "HTTPDNSTests_OSX" */; 315 | buildPhases = ( 316 | CB7E82CB1D1786CB00767E10 /* Sources */, 317 | CB7E82CC1D1786CB00767E10 /* Frameworks */, 318 | CB7E82CD1D1786CB00767E10 /* Resources */, 319 | ); 320 | buildRules = ( 321 | ); 322 | dependencies = ( 323 | CB7E82D61D1786CB00767E10 /* PBXTargetDependency */, 324 | ); 325 | name = HTTPDNSTests_OSX; 326 | productName = HTTPDNSTests; 327 | productReference = CB7E82CF1D1786CB00767E10 /* HTTPDNSTests_OSX.xctest */; 328 | productType = "com.apple.product-type.bundle.unit-test"; 329 | }; 330 | /* End PBXNativeTarget section */ 331 | 332 | /* Begin PBXProject section */ 333 | CB45C1E41CA809D30018439A /* Project object */ = { 334 | isa = PBXProject; 335 | attributes = { 336 | LastUpgradeCheck = 0810; 337 | ORGANIZATIONNAME = Yourtion; 338 | TargetAttributes = { 339 | CB14D4CC1D095A0000EB35C9 = { 340 | CreatedOnToolsVersion = 7.3.1; 341 | }; 342 | CB45C1EC1CA809D30018439A = { 343 | CreatedOnToolsVersion = 7.3; 344 | }; 345 | CB7E82BF1D1786A700767E10 = { 346 | CreatedOnToolsVersion = 7.3.1; 347 | }; 348 | CB7E82CE1D1786CB00767E10 = { 349 | CreatedOnToolsVersion = 7.3.1; 350 | }; 351 | }; 352 | }; 353 | buildConfigurationList = CB45C1E71CA809D30018439A /* Build configuration list for PBXProject "HTTPDNS" */; 354 | compatibilityVersion = "Xcode 3.2"; 355 | developmentRegion = English; 356 | hasScannedForEncodings = 0; 357 | knownRegions = ( 358 | en, 359 | ); 360 | mainGroup = CB45C1E31CA809D30018439A; 361 | productRefGroup = CB45C1EE1CA809D30018439A /* Products */; 362 | projectDirPath = ""; 363 | projectRoot = ""; 364 | targets = ( 365 | CB45C1EC1CA809D30018439A /* HTTPDNS_iOS */, 366 | CB14D4CC1D095A0000EB35C9 /* HTTPDNS_OSX */, 367 | CB7E82BF1D1786A700767E10 /* HTTPDNSTests_iOS */, 368 | CB7E82CE1D1786CB00767E10 /* HTTPDNSTests_OSX */, 369 | ); 370 | }; 371 | /* End PBXProject section */ 372 | 373 | /* Begin PBXResourcesBuildPhase section */ 374 | CB14D4CB1D095A0000EB35C9 /* Resources */ = { 375 | isa = PBXResourcesBuildPhase; 376 | buildActionMask = 2147483647; 377 | files = ( 378 | ); 379 | runOnlyForDeploymentPostprocessing = 0; 380 | }; 381 | CB45C1EB1CA809D30018439A /* Resources */ = { 382 | isa = PBXResourcesBuildPhase; 383 | buildActionMask = 2147483647; 384 | files = ( 385 | ); 386 | runOnlyForDeploymentPostprocessing = 0; 387 | }; 388 | CB7E82BE1D1786A700767E10 /* Resources */ = { 389 | isa = PBXResourcesBuildPhase; 390 | buildActionMask = 2147483647; 391 | files = ( 392 | ); 393 | runOnlyForDeploymentPostprocessing = 0; 394 | }; 395 | CB7E82CD1D1786CB00767E10 /* Resources */ = { 396 | isa = PBXResourcesBuildPhase; 397 | buildActionMask = 2147483647; 398 | files = ( 399 | ); 400 | runOnlyForDeploymentPostprocessing = 0; 401 | }; 402 | /* End PBXResourcesBuildPhase section */ 403 | 404 | /* Begin PBXSourcesBuildPhase section */ 405 | CB14D4C81D095A0000EB35C9 /* Sources */ = { 406 | isa = PBXSourcesBuildPhase; 407 | buildActionMask = 2147483647; 408 | files = ( 409 | CBE7548B1E0235D0004BFE61 /* HTTPDNSGoogle.m in Sources */, 410 | CBD4EBAD1D0D08AC006FFD74 /* HTTPDNSBase.m in Sources */, 411 | CB14D4D81D095A5800EB35C9 /* HTTPDNSClient.m in Sources */, 412 | CBEF157C1D1532A00028B2B1 /* HTTPDNSCryptor.m in Sources */, 413 | CBEF15821D1537100028B2B1 /* HTTPDNSHex.m in Sources */, 414 | CB14D4D91D095A5800EB35C9 /* HTTPDNSUtil.m in Sources */, 415 | CB14D4DA1D095A5800EB35C9 /* HTTPDNSRecord.m in Sources */, 416 | CB14CB5D1D0FAEC20077903F /* HTTPDNSAliYun.m in Sources */, 417 | CBD4EBB51D0D0CBA006FFD74 /* HTTPDNSDNSPod.m in Sources */, 418 | ); 419 | runOnlyForDeploymentPostprocessing = 0; 420 | }; 421 | CB45C1E81CA809D30018439A /* Sources */ = { 422 | isa = PBXSourcesBuildPhase; 423 | buildActionMask = 2147483647; 424 | files = ( 425 | CBE7548A1E0235D0004BFE61 /* HTTPDNSGoogle.m in Sources */, 426 | CB65B29D1D053E5300434C3A /* HTTPDNSClient.m in Sources */, 427 | CB65B2A61D05424600434C3A /* HTTPDNSRecord.m in Sources */, 428 | CBEF157B1D1532A00028B2B1 /* HTTPDNSCryptor.m in Sources */, 429 | CBEF15811D1537100028B2B1 /* HTTPDNSHex.m in Sources */, 430 | CB65B2A11D053E7C00434C3A /* HTTPDNSUtil.m in Sources */, 431 | CBD4EBAC1D0D08AC006FFD74 /* HTTPDNSBase.m in Sources */, 432 | CB14CB5C1D0FAEC20077903F /* HTTPDNSAliYun.m in Sources */, 433 | CBD4EBB41D0D0CBA006FFD74 /* HTTPDNSDNSPod.m in Sources */, 434 | ); 435 | runOnlyForDeploymentPostprocessing = 0; 436 | }; 437 | CB7E82BC1D1786A700767E10 /* Sources */ = { 438 | isa = PBXSourcesBuildPhase; 439 | buildActionMask = 2147483647; 440 | files = ( 441 | CBE7548D1E0236AF004BFE61 /* HTTPDNSGoogleTest.m in Sources */, 442 | CBDFBC781D1946AA00D52170 /* HTTPDNSAliYunTest.m in Sources */, 443 | CBDFBC751D193F0B00D52170 /* HTTPDNSDNSPodTest.m in Sources */, 444 | CB7E82DB1D17876800767E10 /* HTTPDNSUtilTest.m in Sources */, 445 | ); 446 | runOnlyForDeploymentPostprocessing = 0; 447 | }; 448 | CB7E82CB1D1786CB00767E10 /* Sources */ = { 449 | isa = PBXSourcesBuildPhase; 450 | buildActionMask = 2147483647; 451 | files = ( 452 | CBE7548E1E0236AF004BFE61 /* HTTPDNSGoogleTest.m in Sources */, 453 | CB7E82DC1D17876800767E10 /* HTTPDNSUtilTest.m in Sources */, 454 | CBDFBC761D193F0B00D52170 /* HTTPDNSDNSPodTest.m in Sources */, 455 | CBDFBC791D1946AA00D52170 /* HTTPDNSAliYunTest.m in Sources */, 456 | ); 457 | runOnlyForDeploymentPostprocessing = 0; 458 | }; 459 | /* End PBXSourcesBuildPhase section */ 460 | 461 | /* Begin PBXTargetDependency section */ 462 | CB7E82C71D1786A700767E10 /* PBXTargetDependency */ = { 463 | isa = PBXTargetDependency; 464 | target = CB45C1EC1CA809D30018439A /* HTTPDNS_iOS */; 465 | targetProxy = CB7E82C61D1786A700767E10 /* PBXContainerItemProxy */; 466 | }; 467 | CB7E82D61D1786CB00767E10 /* PBXTargetDependency */ = { 468 | isa = PBXTargetDependency; 469 | target = CB14D4CC1D095A0000EB35C9 /* HTTPDNS_OSX */; 470 | targetProxy = CB7E82D51D1786CB00767E10 /* PBXContainerItemProxy */; 471 | }; 472 | /* End PBXTargetDependency section */ 473 | 474 | /* Begin XCBuildConfiguration section */ 475 | CB14D4D31D095A0000EB35C9 /* Debug */ = { 476 | isa = XCBuildConfiguration; 477 | buildSettings = { 478 | CODE_SIGN_IDENTITY = "-"; 479 | COMBINE_HIDPI_IMAGES = YES; 480 | DEFINES_MODULE = YES; 481 | DYLIB_COMPATIBILITY_VERSION = 1; 482 | DYLIB_CURRENT_VERSION = 1; 483 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 484 | FRAMEWORK_VERSION = A; 485 | INFOPLIST_FILE = HTTPDNS/Info.plist; 486 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 487 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 488 | MACOSX_DEPLOYMENT_TARGET = 10.11; 489 | PRODUCT_BUNDLE_IDENTIFIER = com.yourtion.HTTPDNS; 490 | PRODUCT_MODULE_NAME = "$(PRODUCT_NAME:c99extidentifier)"; 491 | PRODUCT_NAME = HTTPDNS; 492 | SDKROOT = macosx; 493 | SKIP_INSTALL = YES; 494 | }; 495 | name = Debug; 496 | }; 497 | CB14D4D41D095A0000EB35C9 /* Release */ = { 498 | isa = XCBuildConfiguration; 499 | buildSettings = { 500 | CODE_SIGN_IDENTITY = "-"; 501 | COMBINE_HIDPI_IMAGES = YES; 502 | DEFINES_MODULE = YES; 503 | DYLIB_COMPATIBILITY_VERSION = 1; 504 | DYLIB_CURRENT_VERSION = 1; 505 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 506 | FRAMEWORK_VERSION = A; 507 | INFOPLIST_FILE = HTTPDNS/Info.plist; 508 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 509 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 510 | MACOSX_DEPLOYMENT_TARGET = 10.11; 511 | PRODUCT_BUNDLE_IDENTIFIER = com.yourtion.HTTPDNS; 512 | PRODUCT_MODULE_NAME = "$(PRODUCT_NAME:c99extidentifier)"; 513 | PRODUCT_NAME = HTTPDNS; 514 | SDKROOT = macosx; 515 | SKIP_INSTALL = YES; 516 | }; 517 | name = Release; 518 | }; 519 | CB45C1F31CA809D30018439A /* Debug */ = { 520 | isa = XCBuildConfiguration; 521 | buildSettings = { 522 | ALWAYS_SEARCH_USER_PATHS = NO; 523 | CLANG_ANALYZER_NONNULL = YES; 524 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 525 | CLANG_CXX_LIBRARY = "libc++"; 526 | CLANG_ENABLE_MODULES = YES; 527 | CLANG_ENABLE_OBJC_ARC = YES; 528 | CLANG_WARN_BOOL_CONVERSION = YES; 529 | CLANG_WARN_CONSTANT_CONVERSION = YES; 530 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 531 | CLANG_WARN_EMPTY_BODY = YES; 532 | CLANG_WARN_ENUM_CONVERSION = YES; 533 | CLANG_WARN_INFINITE_RECURSION = YES; 534 | CLANG_WARN_INT_CONVERSION = YES; 535 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 536 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 537 | CLANG_WARN_UNREACHABLE_CODE = YES; 538 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 539 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 540 | COPY_PHASE_STRIP = NO; 541 | CURRENT_PROJECT_VERSION = 1; 542 | DEBUG_INFORMATION_FORMAT = dwarf; 543 | ENABLE_STRICT_OBJC_MSGSEND = YES; 544 | ENABLE_TESTABILITY = YES; 545 | GCC_C_LANGUAGE_STANDARD = gnu99; 546 | GCC_DYNAMIC_NO_PIC = NO; 547 | GCC_NO_COMMON_BLOCKS = YES; 548 | GCC_OPTIMIZATION_LEVEL = 0; 549 | GCC_PREPROCESSOR_DEFINITIONS = ( 550 | "DEBUG=1", 551 | "$(inherited)", 552 | ); 553 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 554 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 555 | GCC_WARN_UNDECLARED_SELECTOR = YES; 556 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 557 | GCC_WARN_UNUSED_FUNCTION = YES; 558 | GCC_WARN_UNUSED_VARIABLE = YES; 559 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 560 | MACOSX_DEPLOYMENT_TARGET = 10.10; 561 | MTL_ENABLE_DEBUG_INFO = YES; 562 | ONLY_ACTIVE_ARCH = YES; 563 | SDKROOT = iphoneos; 564 | TARGETED_DEVICE_FAMILY = "1,2"; 565 | VERSIONING_SYSTEM = "apple-generic"; 566 | VERSION_INFO_PREFIX = ""; 567 | }; 568 | name = Debug; 569 | }; 570 | CB45C1F41CA809D30018439A /* Release */ = { 571 | isa = XCBuildConfiguration; 572 | buildSettings = { 573 | ALWAYS_SEARCH_USER_PATHS = NO; 574 | CLANG_ANALYZER_NONNULL = YES; 575 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 576 | CLANG_CXX_LIBRARY = "libc++"; 577 | CLANG_ENABLE_MODULES = YES; 578 | CLANG_ENABLE_OBJC_ARC = YES; 579 | CLANG_WARN_BOOL_CONVERSION = YES; 580 | CLANG_WARN_CONSTANT_CONVERSION = YES; 581 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 582 | CLANG_WARN_EMPTY_BODY = YES; 583 | CLANG_WARN_ENUM_CONVERSION = YES; 584 | CLANG_WARN_INFINITE_RECURSION = YES; 585 | CLANG_WARN_INT_CONVERSION = YES; 586 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 587 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 588 | CLANG_WARN_UNREACHABLE_CODE = YES; 589 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 590 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 591 | COPY_PHASE_STRIP = NO; 592 | CURRENT_PROJECT_VERSION = 1; 593 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 594 | ENABLE_NS_ASSERTIONS = NO; 595 | ENABLE_STRICT_OBJC_MSGSEND = YES; 596 | GCC_C_LANGUAGE_STANDARD = gnu99; 597 | GCC_NO_COMMON_BLOCKS = YES; 598 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 599 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 600 | GCC_WARN_UNDECLARED_SELECTOR = YES; 601 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 602 | GCC_WARN_UNUSED_FUNCTION = YES; 603 | GCC_WARN_UNUSED_VARIABLE = YES; 604 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 605 | MACOSX_DEPLOYMENT_TARGET = 10.10; 606 | MTL_ENABLE_DEBUG_INFO = NO; 607 | SDKROOT = iphoneos; 608 | TARGETED_DEVICE_FAMILY = "1,2"; 609 | VALIDATE_PRODUCT = YES; 610 | VERSIONING_SYSTEM = "apple-generic"; 611 | VERSION_INFO_PREFIX = ""; 612 | }; 613 | name = Release; 614 | }; 615 | CB45C1F61CA809D30018439A /* Debug */ = { 616 | isa = XCBuildConfiguration; 617 | buildSettings = { 618 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 619 | DEFINES_MODULE = YES; 620 | DYLIB_COMPATIBILITY_VERSION = 1; 621 | DYLIB_CURRENT_VERSION = 1; 622 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 623 | INFOPLIST_FILE = HTTPDNS/Info.plist; 624 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 625 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 626 | PRODUCT_BUNDLE_IDENTIFIER = com.yourtion.HTTPDNS; 627 | PRODUCT_NAME = HTTPDNS; 628 | SKIP_INSTALL = YES; 629 | }; 630 | name = Debug; 631 | }; 632 | CB45C1F71CA809D30018439A /* Release */ = { 633 | isa = XCBuildConfiguration; 634 | buildSettings = { 635 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 636 | DEFINES_MODULE = YES; 637 | DYLIB_COMPATIBILITY_VERSION = 1; 638 | DYLIB_CURRENT_VERSION = 1; 639 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 640 | INFOPLIST_FILE = HTTPDNS/Info.plist; 641 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 642 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 643 | PRODUCT_BUNDLE_IDENTIFIER = com.yourtion.HTTPDNS; 644 | PRODUCT_NAME = HTTPDNS; 645 | SKIP_INSTALL = YES; 646 | }; 647 | name = Release; 648 | }; 649 | CB7E82C81D1786A700767E10 /* Debug */ = { 650 | isa = XCBuildConfiguration; 651 | buildSettings = { 652 | INFOPLIST_FILE = HTTPDNSTests/Info.plist; 653 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 654 | PRODUCT_BUNDLE_IDENTIFIER = com.yourtion.HTTPDNSTests; 655 | PRODUCT_NAME = "$(TARGET_NAME)"; 656 | }; 657 | name = Debug; 658 | }; 659 | CB7E82C91D1786A700767E10 /* Release */ = { 660 | isa = XCBuildConfiguration; 661 | buildSettings = { 662 | INFOPLIST_FILE = HTTPDNSTests/Info.plist; 663 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 664 | PRODUCT_BUNDLE_IDENTIFIER = com.yourtion.HTTPDNSTests; 665 | PRODUCT_NAME = "$(TARGET_NAME)"; 666 | }; 667 | name = Release; 668 | }; 669 | CB7E82D81D1786CB00767E10 /* Debug */ = { 670 | isa = XCBuildConfiguration; 671 | buildSettings = { 672 | CODE_SIGN_IDENTITY = "-"; 673 | COMBINE_HIDPI_IMAGES = YES; 674 | INFOPLIST_FILE = HTTPDNSTests/Info.plist; 675 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 676 | MACOSX_DEPLOYMENT_TARGET = 10.11; 677 | PRODUCT_BUNDLE_IDENTIFIER = com.yourtion.HTTPDNSTests; 678 | PRODUCT_NAME = "$(TARGET_NAME)"; 679 | SDKROOT = macosx; 680 | }; 681 | name = Debug; 682 | }; 683 | CB7E82D91D1786CB00767E10 /* Release */ = { 684 | isa = XCBuildConfiguration; 685 | buildSettings = { 686 | CODE_SIGN_IDENTITY = "-"; 687 | COMBINE_HIDPI_IMAGES = YES; 688 | INFOPLIST_FILE = HTTPDNSTests/Info.plist; 689 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 690 | MACOSX_DEPLOYMENT_TARGET = 10.11; 691 | PRODUCT_BUNDLE_IDENTIFIER = com.yourtion.HTTPDNSTests; 692 | PRODUCT_NAME = "$(TARGET_NAME)"; 693 | SDKROOT = macosx; 694 | }; 695 | name = Release; 696 | }; 697 | /* End XCBuildConfiguration section */ 698 | 699 | /* Begin XCConfigurationList section */ 700 | CB14D4D21D095A0000EB35C9 /* Build configuration list for PBXNativeTarget "HTTPDNS_OSX" */ = { 701 | isa = XCConfigurationList; 702 | buildConfigurations = ( 703 | CB14D4D31D095A0000EB35C9 /* Debug */, 704 | CB14D4D41D095A0000EB35C9 /* Release */, 705 | ); 706 | defaultConfigurationIsVisible = 0; 707 | defaultConfigurationName = Release; 708 | }; 709 | CB45C1E71CA809D30018439A /* Build configuration list for PBXProject "HTTPDNS" */ = { 710 | isa = XCConfigurationList; 711 | buildConfigurations = ( 712 | CB45C1F31CA809D30018439A /* Debug */, 713 | CB45C1F41CA809D30018439A /* Release */, 714 | ); 715 | defaultConfigurationIsVisible = 0; 716 | defaultConfigurationName = Release; 717 | }; 718 | CB45C1F51CA809D30018439A /* Build configuration list for PBXNativeTarget "HTTPDNS_iOS" */ = { 719 | isa = XCConfigurationList; 720 | buildConfigurations = ( 721 | CB45C1F61CA809D30018439A /* Debug */, 722 | CB45C1F71CA809D30018439A /* Release */, 723 | ); 724 | defaultConfigurationIsVisible = 0; 725 | defaultConfigurationName = Release; 726 | }; 727 | CB7E82CA1D1786A700767E10 /* Build configuration list for PBXNativeTarget "HTTPDNSTests_iOS" */ = { 728 | isa = XCConfigurationList; 729 | buildConfigurations = ( 730 | CB7E82C81D1786A700767E10 /* Debug */, 731 | CB7E82C91D1786A700767E10 /* Release */, 732 | ); 733 | defaultConfigurationIsVisible = 0; 734 | defaultConfigurationName = Release; 735 | }; 736 | CB7E82D71D1786CB00767E10 /* Build configuration list for PBXNativeTarget "HTTPDNSTests_OSX" */ = { 737 | isa = XCConfigurationList; 738 | buildConfigurations = ( 739 | CB7E82D81D1786CB00767E10 /* Debug */, 740 | CB7E82D91D1786CB00767E10 /* Release */, 741 | ); 742 | defaultConfigurationIsVisible = 0; 743 | defaultConfigurationName = Release; 744 | }; 745 | /* End XCConfigurationList section */ 746 | }; 747 | rootObject = CB45C1E41CA809D30018439A /* Project object */; 748 | } 749 | -------------------------------------------------------------------------------- /HTTPDNS.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /HTTPDNS.xcodeproj/xcshareddata/xcschemes/HTTPDNS_OSX.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 34 | 40 | 41 | 42 | 43 | 44 | 50 | 51 | 52 | 53 | 54 | 55 | 65 | 66 | 72 | 73 | 74 | 75 | 76 | 77 | 83 | 84 | 90 | 91 | 92 | 93 | 95 | 96 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /HTTPDNS.xcodeproj/xcshareddata/xcschemes/HTTPDNS_iOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 34 | 40 | 41 | 42 | 43 | 44 | 50 | 51 | 52 | 53 | 54 | 55 | 65 | 66 | 72 | 73 | 74 | 75 | 76 | 77 | 83 | 84 | 90 | 91 | 92 | 93 | 95 | 96 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /HTTPDNS.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /HTTPDNS/HTTPDNS.h: -------------------------------------------------------------------------------- 1 | // 2 | // HTTPDNS.h 3 | // HTTPDNS 4 | // 5 | // Created by YourtionGuo on 6/9/16. 6 | // Copyright © 2016 Yourtion. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for HTTPDNS. 12 | FOUNDATION_EXPORT double HTTPDNSVersionNumber; 13 | 14 | //! Project version string for HTTPDNS. 15 | FOUNDATION_EXPORT const unsigned char HTTPDNSVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | #import "HTTPDNSRecord.h" 20 | #import "HTTPDNSClient.h" 21 | -------------------------------------------------------------------------------- /HTTPDNS/HTTPDNSAliYun.h: -------------------------------------------------------------------------------- 1 | // 2 | // HTTPDNSAliYun.h 3 | // HTTPDNS 4 | // 5 | // Created by YourtionGuo on 6/14/16. 6 | // Copyright © 2016 Yourtion. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "HTTPDNSBase.h" 11 | 12 | @interface HTTPDNSAliYun : HTTPDNSBase 13 | 14 | - (instancetype)initWithAccountId:(NSString *)account; 15 | 16 | - (void)disableHTTPS; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /HTTPDNS/HTTPDNSAliYun.m: -------------------------------------------------------------------------------- 1 | // 2 | // HTTPDNSAliYun.m 3 | // HTTPDNS 4 | // 5 | // Created by YourtionGuo on 6/14/16. 6 | // Copyright © 2016 Yourtion. All rights reserved. 7 | // 8 | 9 | #import "HTTPDNSAliYun.h" 10 | 11 | @implementation HTTPDNSAliYun 12 | { 13 | NSString *_accountId; 14 | NSString *_server; 15 | } 16 | 17 | - (instancetype)initWithAccountId:(NSString *)account 18 | { 19 | self = [super init]; 20 | if (self) { 21 | _accountId = account; 22 | _server = [NSString stringWithFormat:@"https://%@/", kHTTPDNS_ALIYUN_SERVER_ADDRESS]; 23 | } 24 | return self; 25 | } 26 | 27 | -(void)disableHTTPS { 28 | _server = [NSString stringWithFormat:@"http://%@/", kHTTPDNS_ALIYUN_SERVER_ADDRESS]; 29 | } 30 | 31 | -(NSString *)getRequestString:(NSString *)domain { 32 | return [NSString stringWithFormat:@"%@%@/d?host=%@", _server, _accountId, domain]; 33 | } 34 | 35 | -(HTTPDNSRecord *)parseResult:(NSData *)data { 36 | NSError *jsonError; 37 | NSDictionary *jsonDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:&jsonError]; 38 | if (jsonError) { 39 | return nil; 40 | } 41 | NSArray *ipArray = [jsonDic objectForKey:@"ips"]; 42 | int ttl = [[jsonDic objectForKey:@"ttl"] intValue]; 43 | if (ipArray && ttl) { 44 | return [[HTTPDNSRecord alloc] init:ipArray ttl:ttl]; 45 | } 46 | return nil; 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /HTTPDNS/HTTPDNSBase.h: -------------------------------------------------------------------------------- 1 | // 2 | // HTTPDNSBase.h 3 | // HTTPDNS 4 | // 5 | // Created by YourtionGuo on 6/12/16. 6 | // Copyright © 2016 Yourtion. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "HTTPDNSRecord.h" 11 | 12 | const static NSString *kHTTPDNS_DNSPOD_SERVER_ADDRESS = @"119.29.29.29"; 13 | const static NSString *kHTTPDNS_ALIYUN_SERVER_ADDRESS = @"203.107.1.1"; 14 | const static NSString *kHTTPDNS_GOOGLE_SERVER_ADDRESS = @"dns.google.com"; 15 | 16 | @protocol HTTPDNSBaseProtocol 17 | 18 | @required 19 | - (HTTPDNSRecord *)parseResult:(NSData *)data; 20 | - (NSString *)getRequestString:(NSString *)domain; 21 | 22 | @end 23 | 24 | @interface HTTPDNSBase : NSObject 25 | 26 | - (void)requsetRecord:(NSString *)domain callback:(HTTPDNSCallback)callback; 27 | - (HTTPDNSRecord *)requsetRecordSync:(NSString *)domain; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /HTTPDNS/HTTPDNSBase.m: -------------------------------------------------------------------------------- 1 | // 2 | // HTTPDNSBase.m 3 | // HTTPDNS 4 | // 5 | // Created by YourtionGuo on 6/12/16. 6 | // Copyright © 2016 Yourtion. All rights reserved. 7 | // 8 | 9 | #import "HTTPDNSBase.h" 10 | 11 | @implementation HTTPDNSBase 12 | 13 | -(NSString *) getRequestString:(NSString *)domain { 14 | return @""; 15 | } 16 | 17 | -(HTTPDNSRecord *)parseResult:(NSData *)data { 18 | return nil; 19 | } 20 | 21 | - (void)requsetRecord:(NSString *)domain callback:(HTTPDNSCallback)callback { 22 | NSString *urlString = [self getRequestString:domain]; 23 | NSURL *url = [NSURL URLWithString:urlString]; 24 | 25 | [[[NSURLSession sharedSession] dataTaskWithURL:url completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { 26 | HTTPDNSRecord *res = [self parseResult:data]; 27 | callback(res); 28 | }] resume]; 29 | } 30 | 31 | -(HTTPDNSRecord *)requsetRecordSync:(NSString *)domain { 32 | NSString *urlString = [self getRequestString:domain]; 33 | NSURL *url = [NSURL URLWithString:urlString]; 34 | NSData *data = [NSData dataWithContentsOfURL:url]; 35 | HTTPDNSRecord *res = [self parseResult:data]; 36 | return res; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /HTTPDNS/HTTPDNSClient.h: -------------------------------------------------------------------------------- 1 | // 2 | // HTTPDNSClient.h 3 | // HTTPDNS 4 | // 5 | // Created by YourtionGuo on 6/6/16. 6 | // Copyright © 2016 Yourtion. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "HTTPDNSRecord.h" 11 | 12 | /** 13 | * HTTP DNS Client 14 | */ 15 | @interface HTTPDNSClient : NSObject 16 | 17 | /** 18 | * HTTPDNSClient sharedInstance 19 | */ 20 | + (HTTPDNSClient *)sharedInstance; 21 | 22 | /** 23 | * Clean record cache 24 | */ 25 | - (void)cleanAllCache; 26 | 27 | /** 28 | * Use DNSPod Provider 29 | */ 30 | - (void)useDNSPod; 31 | 32 | /** 33 | * Use Google DNS-over-HTTP Provider 34 | */ 35 | - (void)useGoogle; 36 | 37 | /** 38 | * Use AliYun Provider 39 | * 40 | * @param key accound id from aliyun 41 | */ 42 | - (void)useAliYunWithKey:(NSString *)key; 43 | 44 | /** 45 | * Use DNSPod Pro Provider 46 | * 47 | * @param account account id in DNSpod 48 | * @param key account key in DNSPod 49 | */ 50 | - (void)useDNSPodProWithAccount:(NSString *)account Key:(NSString *)key; 51 | 52 | /** 53 | * Get record from domain (nil if err or can't get) 54 | * 55 | * @param domain domain to request 56 | * @param callback HTTPDNS callback 57 | */ 58 | - (void)getRecord:(NSString *)domain callback:(HTTPDNSCallback)callback; 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /HTTPDNS/HTTPDNSClient.m: -------------------------------------------------------------------------------- 1 | // 2 | // HTTPDNSClient.m 3 | // HTTPDNS 4 | // 5 | // Created by YourtionGuo on 6/6/16. 6 | // Copyright © 2016 Yourtion. All rights reserved. 7 | // 8 | 9 | #import "HTTPDNSClient.h" 10 | #import "HTTPDNSUtil.h" 11 | #import "HTTPDNSDNSPod.h" 12 | #import "HTTPDNSAliYun.h" 13 | #import "HTTPDNSGoogle.h" 14 | 15 | @implementation HTTPDNSClient 16 | { 17 | NSMutableDictionary *_cache; 18 | HTTPDNSBase *_provider; 19 | } 20 | 21 | - (instancetype)init 22 | { 23 | @throw [NSException exceptionWithName:@"Do not init HTTPDNSClient" 24 | reason:@"You should use [HTTPDNSClient sharedInstance]" 25 | userInfo:nil]; 26 | return nil; 27 | } 28 | 29 | + (HTTPDNSClient *)sharedInstance 30 | { 31 | static HTTPDNSClient*_sharedInstance = nil; 32 | static dispatch_once_t oncePredicate; 33 | dispatch_once(&oncePredicate, ^{ 34 | _sharedInstance = [[HTTPDNSClient alloc] initPrivate]; 35 | }); 36 | return _sharedInstance; 37 | } 38 | 39 | - (instancetype)initPrivate { 40 | self = [super init]; 41 | if (self) { 42 | _cache = [[NSMutableDictionary alloc] init]; 43 | _provider = [[HTTPDNSDNSPod alloc] init]; 44 | } 45 | return self; 46 | } 47 | 48 | - (void)cleanAllCache { 49 | [_cache removeAllObjects]; 50 | } 51 | 52 | - (void)useDNSPod { 53 | [self cleanAllCache]; 54 | _provider = [[HTTPDNSDNSPod alloc] init]; 55 | } 56 | 57 | - (void)useGoogle { 58 | [self cleanAllCache]; 59 | _provider = [[HTTPDNSGoogle alloc] init]; 60 | } 61 | 62 | 63 | - (void)useAliYunWithKey:(NSString *)key { 64 | if (key) { 65 | [self cleanAllCache]; 66 | _provider = [[HTTPDNSAliYun alloc] initWithAccountId:key]; 67 | } 68 | } 69 | 70 | - (void)useAliYunWithoutHTTPSWithKey:(NSString *)key { 71 | if (key) { 72 | [self cleanAllCache]; 73 | HTTPDNSAliYun *dns = [[HTTPDNSAliYun alloc] initWithAccountId:key]; 74 | [dns disableHTTPS]; 75 | _provider = dns; 76 | } 77 | } 78 | 79 | - (void)useDNSPodProWithAccount:(NSString *)account Key:(NSString *)key { 80 | if (account && key) { 81 | [self cleanAllCache]; 82 | _provider = [[HTTPDNSDNSPod alloc] initWithAccountId:account andKey:key]; 83 | } 84 | } 85 | 86 | - (void)getRecord:(NSString *)domain callback:(HTTPDNSCallback)callback { 87 | if (![HTTPDNSUtil isHTTPEnable]) return callback(nil); 88 | HTTPDNSRecord *record = [_cache objectForKey:domain]; 89 | if (record) { 90 | if (record.timeout > [[NSDate date] timeIntervalSince1970]) { 91 | return callback(record); 92 | } else { 93 | [_cache removeObjectForKey:domain]; 94 | } 95 | } 96 | [_provider requsetRecord:domain callback:^(HTTPDNSRecord *ret) { 97 | if (ret && [ret.ips count] > 0) { 98 | [_cache setObject:[ret copy] forKey:domain]; 99 | [ret setCached:NO]; 100 | callback(ret); 101 | } else { 102 | callback(nil); 103 | } 104 | }]; 105 | } 106 | 107 | @end 108 | -------------------------------------------------------------------------------- /HTTPDNS/HTTPDNSCryptor.h: -------------------------------------------------------------------------------- 1 | // 2 | // HTTPDNSCryptor.h 3 | // HTTPDNS 4 | // 5 | // Created by YourtionGuo on 6/18/16. 6 | // Copyright © 2016 Yourtion. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | HTTPDNS Cryptor (Now for DNSPod pro) 13 | 14 | - returns: Cryptor instance 15 | */ 16 | @interface HTTPDNSCryptor : NSObject 17 | 18 | /** 19 | * init for instance 20 | * 21 | * @param key encrypt or decrypt key 22 | * 23 | * @return Cryptor instance 24 | */ 25 | - (instancetype)initWithKey:(NSString *)key; 26 | 27 | /** 28 | * Encrypt Data 29 | * 30 | * @param data data to encrypt 31 | * 32 | * @return Encrypted data 33 | */ 34 | - (NSData *)encrypt:(NSData *)data; 35 | 36 | /** 37 | * Decrpyt Data 38 | * 39 | * @param data data to decrpyt 40 | * 41 | * @return Decrpyted data 42 | */ 43 | - (NSData *)decrpyt:(NSData *)data; 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /HTTPDNS/HTTPDNSCryptor.m: -------------------------------------------------------------------------------- 1 | // 2 | // HTTPDNSCryptor.m 3 | // HTTPDNS 4 | // 5 | // Created by YourtionGuo on 6/18/16. 6 | // Copyright © 2016 Yourtion. All rights reserved. 7 | // 8 | 9 | #import "HTTPDNSCryptor.h" 10 | #import 11 | 12 | @implementation HTTPDNSCryptor 13 | { 14 | NSData *_key; 15 | } 16 | 17 | - (instancetype)initWithKey:(NSString *)key { 18 | if (!key || [key isEqualToString:@""]) { 19 | return nil; 20 | } 21 | if (self = [super init]) { 22 | _key = [key dataUsingEncoding:NSUTF8StringEncoding]; 23 | } 24 | return self; 25 | } 26 | 27 | - (NSData *)encrypt:(NSData *)data { 28 | return [self cryptoOperation:kCCEncrypt data:data]; 29 | } 30 | 31 | - (NSData *)decrpyt:(NSData *)data { 32 | return [self cryptoOperation:kCCDecrypt data:data]; 33 | } 34 | 35 | -(NSData *)cryptoOperation:(CCOperation)opt data:(NSData *)data { 36 | const void *input = data.bytes; 37 | size_t inputSize = data.length; 38 | size_t bufferSize = 1024; 39 | 40 | if (opt == kCCEncrypt) { 41 | bufferSize = (inputSize + kCCBlockSize3DES) & ~(kCCBlockSize3DES - 1); 42 | } 43 | 44 | uint8_t *buffer = malloc(bufferSize * sizeof(uint8_t)); 45 | 46 | memset((void *)buffer, 0x0, bufferSize); 47 | size_t movedBytes = 0; 48 | 49 | const void *vkey = _key.bytes; 50 | 51 | CCCryptorStatus ccStatus = CCCrypt(opt, 52 | kCCAlgorithmDES, 53 | kCCOptionECBMode | kCCOptionPKCS7Padding, 54 | vkey, 55 | kCCKeySizeDES, 56 | NULL, 57 | input, 58 | inputSize, 59 | (void *)buffer, 60 | bufferSize, 61 | &movedBytes); 62 | 63 | if (ccStatus != kCCSuccess) { 64 | NSLog(@"error code %d", ccStatus); 65 | free(buffer); 66 | return nil; 67 | } 68 | 69 | NSData *result = [NSData dataWithBytes:(const void *)buffer length:(NSUInteger)movedBytes]; 70 | free(buffer); 71 | return result; 72 | } 73 | 74 | @end 75 | -------------------------------------------------------------------------------- /HTTPDNS/HTTPDNSDNSPod.h: -------------------------------------------------------------------------------- 1 | // 2 | // HTTPDNSDNSPod.h 3 | // HTTPDNS 4 | // 5 | // Created by YourtionGuo on 6/12/16. 6 | // Copyright © 2016 Yourtion. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "HTTPDNSBase.h" 11 | 12 | @interface HTTPDNSDNSPod : HTTPDNSBase 13 | 14 | - (instancetype)initWithAccountId:(NSString *)account andKey:(NSString *)key; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /HTTPDNS/HTTPDNSDNSPod.m: -------------------------------------------------------------------------------- 1 | // 2 | // HTTPDNSDNSPod.m 3 | // HTTPDNS 4 | // 5 | // Created by YourtionGuo on 6/12/16. 6 | // Copyright © 2016 Yourtion. All rights reserved. 7 | // 8 | 9 | #import "HTTPDNSDNSPod.h" 10 | #import "HTTPDNSCryptor.h" 11 | #import "HTTPDNSUtil.h" 12 | 13 | @implementation HTTPDNSDNSPod 14 | { 15 | BOOL _isEnterprise; 16 | NSString *_id; 17 | NSString *_server; 18 | HTTPDNSCryptor *_cryptor; 19 | } 20 | 21 | - (instancetype)init 22 | { 23 | self = [super init]; 24 | if (self) { 25 | _isEnterprise = NO; 26 | _id = nil; 27 | _cryptor = nil; 28 | _server = [NSString stringWithFormat:@"http://%@/", kHTTPDNS_DNSPOD_SERVER_ADDRESS]; 29 | } 30 | return self; 31 | } 32 | 33 | - (instancetype)initWithAccountId:(NSString *)account andKey:(NSString *)key 34 | { 35 | self = [super init]; 36 | if (self) { 37 | _isEnterprise = YES; 38 | _id = account; 39 | _cryptor = [[HTTPDNSCryptor alloc] initWithKey:key]; 40 | _server = [NSString stringWithFormat:@"http://%@/", kHTTPDNS_DNSPOD_SERVER_ADDRESS]; 41 | } 42 | return self; 43 | } 44 | 45 | -(NSString *)getRequestString:(NSString *)domain { 46 | if (_isEnterprise) { 47 | NSString *enc = [HTTPDNSUtil encrypt:domain withCryptor:_cryptor]; 48 | return [NSString stringWithFormat:@"%@d?dn=%@&id=%@&ttl=1",_server, enc, _id]; 49 | } 50 | return [NSString stringWithFormat:@"%@d?dn=%@&ttl=1",_server, domain]; 51 | } 52 | 53 | -(HTTPDNSRecord *)parseResult:(NSData *)data { 54 | NSString *result; 55 | if (_isEnterprise) { 56 | result = [HTTPDNSUtil decrypt:data withCryptor:_cryptor]; 57 | } else { 58 | result = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; 59 | } 60 | 61 | NSArray *resArray = [result componentsSeparatedByString:@","]; 62 | if ([resArray count] < 2) { 63 | return nil; 64 | } 65 | 66 | NSString *ipStr = resArray[0]; 67 | NSArray *ipArray = [ipStr componentsSeparatedByString:@";"]; 68 | int ttl = [resArray[1] intValue]; 69 | return [[HTTPDNSRecord alloc] init:ipArray ttl:ttl]; 70 | } 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /HTTPDNS/HTTPDNSGoogle.h: -------------------------------------------------------------------------------- 1 | // 2 | // HTTPDNSAliYun.h 3 | // HTTPDNS 4 | // 5 | // Created by YourtionGuo on 6/14/16. 6 | // Copyright © 2016 Yourtion. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "HTTPDNSBase.h" 11 | 12 | @interface HTTPDNSGoogle : HTTPDNSBase 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /HTTPDNS/HTTPDNSGoogle.m: -------------------------------------------------------------------------------- 1 | // 2 | // HTTPDNSAliYun.m 3 | // HTTPDNS 4 | // 5 | // Created by YourtionGuo on 6/14/16. 6 | // Copyright © 2016 Yourtion. All rights reserved. 7 | // 8 | 9 | #import "HTTPDNSGoogle.h" 10 | 11 | @implementation HTTPDNSGoogle 12 | { 13 | NSString *_server; 14 | } 15 | 16 | - (instancetype)init 17 | { 18 | self = [super init]; 19 | if (self) { 20 | _server = [NSString stringWithFormat:@"https://%@", kHTTPDNS_GOOGLE_SERVER_ADDRESS]; 21 | } 22 | return self; 23 | } 24 | 25 | -(NSString *)getRequestString:(NSString *)domain { 26 | return [NSString stringWithFormat:@"%@/resolve?type=1&name=%@", _server, domain]; 27 | } 28 | 29 | -(HTTPDNSRecord *)parseResult:(NSData *)data { 30 | NSError *jsonError; 31 | NSDictionary *jsonDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:&jsonError]; 32 | if (jsonError) { 33 | return nil; 34 | } 35 | NSArray *answerArray = [jsonDic objectForKey:@"Answer"]; 36 | NSMutableArray *ipArray = [[NSMutableArray alloc] init]; 37 | int ttl = 0; 38 | for (NSDictionary *answer in answerArray) { 39 | if([[answer objectForKey:@"type"] isEqual: @1]) { 40 | ttl = [[answer objectForKey:@"TTL"] intValue]; 41 | [ipArray addObject:[answer objectForKey:@"data"]]; 42 | } 43 | } 44 | if ([ipArray count] > 0 && ttl > 0) { 45 | return [[HTTPDNSRecord alloc] init:ipArray ttl:ttl]; 46 | } 47 | return nil; 48 | } 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /HTTPDNS/HTTPDNSHex.h: -------------------------------------------------------------------------------- 1 | // 2 | // HTTPDNSHex.h 3 | // HTTPDNS 4 | // 5 | // Created by YourtionGuo on 6/18/16. 6 | // Copyright © 2016 Yourtion. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | * HTTPDNS NSData and Hex convert 13 | */ 14 | @interface HTTPDNSHex : NSObject 15 | 16 | /** 17 | * Encode hex from data 18 | * 19 | * @param data data to encode 20 | * 21 | * @return encoded string 22 | */ 23 | + (NSString *)encodeHexData:(NSData *)data; 24 | 25 | /** 26 | * Encode hex from string 27 | * 28 | * @param str string to encode 29 | * 30 | * @return encoded string 31 | */ 32 | + (NSString *)encodeHexString:(NSString *)str; 33 | 34 | 35 | /** 36 | * Decode hex from string 37 | * 38 | * @param hex string to decode 39 | * 40 | * @return decoded data 41 | */ 42 | + (NSData *)decodeHexString:(NSString *)hex; 43 | 44 | /** 45 | * Decode hex to string 46 | * 47 | * @param hex string to decode 48 | * 49 | * @return decoded string 50 | */ 51 | + (NSString *)decodeHexToString:(NSString *)hex; 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /HTTPDNS/HTTPDNSHex.m: -------------------------------------------------------------------------------- 1 | // 2 | // HTTPDNSHex.m 3 | // HTTPDNS 4 | // 5 | // Created by YourtionGuo on 6/18/16. 6 | // Copyright © 2016 Yourtion. All rights reserved. 7 | // 8 | 9 | #import "HTTPDNSHex.h" 10 | 11 | static char DIGITS_UPPER[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; 12 | //static char DIGITS_LOWER[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; 13 | 14 | static int hexDigit(char c) { 15 | int result = -1; 16 | if ('0' <= c && c <= '9') { 17 | result = c - '0'; 18 | } else if ('a' <= c && c <= 'f') { 19 | result = 10 + (c - 'a'); 20 | } else if ('A' <= c && c <= 'F') { 21 | result = 10 + (c - 'A'); 22 | } 23 | return result; 24 | } 25 | 26 | static char *decodeHex(const char *data, int size) { 27 | if ((size & 0x01) != 0) { 28 | return NULL; 29 | } 30 | char *output = malloc(size / 2); 31 | int outLimit = 0; 32 | for (int i = 0, j = 0; j < size; i++) { 33 | int f = hexDigit(data[j]); 34 | if (f < 0) { 35 | outLimit = 1; 36 | break; 37 | } 38 | j++; 39 | int f2 = hexDigit(data[j]); 40 | if (f2 < 0) { 41 | outLimit = 1; 42 | break; 43 | } 44 | f = (f << 4) | f2; 45 | j++; 46 | output[i] = (char)(f & 0xff); 47 | } 48 | if (outLimit) { 49 | free(output); 50 | return NULL; 51 | } 52 | return output; 53 | } 54 | 55 | static char *encodeHexInternal(char *output_buf, const char *data, int size, char hexTable[]) { 56 | for (int i = 0, j = 0; i < size; i++) { 57 | output_buf[j++] = hexTable[((0XF0 & data[i]) >> 4) & 0X0F]; 58 | output_buf[j++] = hexTable[((0X0F & data[i])) & 0X0F]; 59 | } 60 | return output_buf; 61 | } 62 | 63 | static char *encodeHex(const char *data, int size, char hexTable[]) { 64 | char *output = malloc(size * 2); 65 | return encodeHexInternal(output, data, size, hexTable); 66 | } 67 | 68 | @implementation HTTPDNSHex 69 | 70 | + (NSString *)encodeHexData:(NSData *)data { 71 | char *e = encodeHex(data.bytes, (int)data.length, DIGITS_UPPER); 72 | NSString *str = [[NSString alloc] initWithBytes:e length:data.length * 2 encoding:NSASCIIStringEncoding]; 73 | free(e); 74 | return str; 75 | } 76 | 77 | + (NSString *)encodeHexString:(NSString *)str { 78 | return [HTTPDNSHex encodeHexData:[str dataUsingEncoding:NSUTF8StringEncoding]]; 79 | } 80 | 81 | + (NSData *)decodeHexString:(NSString *)hex { 82 | char *d = decodeHex(hex.UTF8String, (int)hex.length); 83 | if (d == NULL) { 84 | return nil; 85 | } 86 | NSData *data = [NSData dataWithBytes:d length:hex.length / 2]; 87 | free(d); 88 | return data; 89 | } 90 | 91 | + (NSString *)decodeHexToString:(NSString *)hex { 92 | NSData *data = [HTTPDNSHex decodeHexString:hex]; 93 | if (data == nil) { 94 | return nil; 95 | } 96 | return [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; 97 | } 98 | 99 | @end 100 | -------------------------------------------------------------------------------- /HTTPDNS/HTTPDNSRecord.h: -------------------------------------------------------------------------------- 1 | // 2 | // HTTPDNSRecord.h 3 | // HTTPDNS 4 | // 5 | // Created by YourtionGuo on 6/6/16. 6 | // Copyright © 2016 Yourtion. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | * HTTP DNS Record 13 | */ 14 | @interface HTTPDNSRecord : NSObject 15 | /// IP address 16 | @property (nonatomic, strong, readonly) NSString *ip; 17 | /// IP array 18 | @property (nonatomic, readonly) NSArray *ips; 19 | /// timeout 20 | @property (nonatomic, readonly) NSTimeInterval timeout; 21 | /// is Cached 22 | @property (nonatomic, readonly) BOOL cached; 23 | 24 | /** 25 | * Init 26 | * 27 | * @param ips IP array 28 | * @param ttl Time To Live 29 | * 30 | * @return DNSRecord 31 | */ 32 | - (instancetype)init:(NSArray *)ips ttl:(int)ttl; 33 | 34 | /** 35 | * Set record is cached 36 | * 37 | * @param cached isCached 38 | */ 39 | - (void) setCached:(BOOL)cached; 40 | 41 | /** 42 | * Get record info 43 | * 44 | * @return description for record 45 | */ 46 | - (NSString *)description; 47 | 48 | @end 49 | 50 | /** 51 | * HTTPDNS Callback block 52 | * 53 | * @param record Result (nil if didn't have) 54 | */ 55 | typedef void(^HTTPDNSCallback)(HTTPDNSRecord *record); 56 | -------------------------------------------------------------------------------- /HTTPDNS/HTTPDNSRecord.m: -------------------------------------------------------------------------------- 1 | // 2 | // HTTPDNSRecord.m 3 | // HTTPDNS 4 | // 5 | // Created by YourtionGuo on 6/6/16. 6 | // Copyright © 2016 Yourtion. All rights reserved. 7 | // 8 | 9 | #import "HTTPDNSRecord.h" 10 | #import "HTTPDNSUtil.h" 11 | 12 | @implementation HTTPDNSRecord 13 | 14 | - (instancetype)init:(NSArray *)ips ttl:(int)ttl { 15 | if (self = [super init]) { 16 | if ([ips count] > 0) { 17 | _ip = ips[0]; 18 | _ips = ips; 19 | _timeout = ttl * 1000 + [[NSDate date] timeIntervalSince1970]; 20 | _cached = YES; 21 | } 22 | } 23 | return self; 24 | } 25 | 26 | - (instancetype)init:(NSArray *)ips timeout:(NSTimeInterval)timeout { 27 | if (self = [super init]) { 28 | if ([ips count] > 0) { 29 | _ip = ips[0]; 30 | _ips = ips; 31 | _timeout = timeout; 32 | _cached = YES; 33 | } 34 | } 35 | return self; 36 | } 37 | 38 | -(void)setCached:(BOOL)cached { 39 | _cached = cached; 40 | } 41 | 42 | - (NSString *)description { 43 | NSString *cached = _cached ? @"Cached" : @""; 44 | NSString *ips = [_ips componentsJoinedByString:@" | "]; 45 | return [NSString stringWithFormat:@"%@ %@ : %f in [ %@ ]",cached, _ip, _timeout, ips]; 46 | } 47 | 48 | - (instancetype)copyWithZone:(NSZone *)zone { 49 | HTTPDNSRecord *copy = [[[self class] allocWithZone:zone] init:_ips timeout:_timeout]; 50 | return copy; 51 | } 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /HTTPDNS/HTTPDNSUtil.h: -------------------------------------------------------------------------------- 1 | // 2 | // HTTPDNSUtil.h 3 | // HTTPDNS 4 | // 5 | // Created by YourtionGuo on 6/6/16. 6 | // Copyright © 2016 Yourtion. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "HTTPDNSCryptor.h" 11 | 12 | /** 13 | * HTTPDNS Utils 14 | */ 15 | @interface HTTPDNSUtil : NSObject 16 | 17 | /** 18 | * check app is enable http 19 | * 20 | * @return http enable 21 | */ 22 | + (BOOL)isHTTPEnable; 23 | 24 | 25 | /** 26 | * Encrypt domain for request 27 | * 28 | * @param domain domain to encrypt 29 | * @param cryptor HTTPDNSCryptor with key init first 30 | * 31 | * @return encrypted string 32 | */ 33 | + (NSString *)encrypt:(NSString *)domain withCryptor:(HTTPDNSCryptor *)cryptor; 34 | 35 | 36 | /** 37 | * Decrypt request data 38 | * 39 | * @param raw HTTP requset data 40 | * @param cryptor HTTPDNSCryptor with key init first 41 | * 42 | * @return decrypted string 43 | */ 44 | + (NSString *)decrypt:(NSData *)raw withCryptor:(HTTPDNSCryptor *)cryptor; 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /HTTPDNS/HTTPDNSUtil.m: -------------------------------------------------------------------------------- 1 | // 2 | // HTTPDNSUtil.m 3 | // HTTPDNS 4 | // 5 | // Created by YourtionGuo on 6/6/16. 6 | // Copyright © 2016 Yourtion. All rights reserved. 7 | // 8 | 9 | #import "HTTPDNSUtil.h" 10 | #import "HTTPDNSHex.h" 11 | #import "HTTPDNSCryptor.h" 12 | 13 | #if TARGET_OS_IPHONE 14 | #import 15 | #endif 16 | 17 | @implementation HTTPDNSUtil 18 | 19 | + (BOOL)needTransportSecurity { 20 | #if TARGET_OS_IPHONE 21 | if([[[UIDevice currentDevice] systemVersion] compare:@"9.0" options:NSNumericSearch] != NSOrderedAscending){ 22 | return YES; 23 | } 24 | #elif TARGET_OS_MAC 25 | NSDictionary *systemVersionDictionary = [NSDictionary dictionaryWithContentsOfFile:@"/System/Library/CoreServices/SystemVersion.plist"]; 26 | if([[systemVersionDictionary objectForKey:@"ProductVersion"] compare:@"10.11" options:NSNumericSearch] != NSOrderedAscending){ 27 | return YES; 28 | } 29 | #endif 30 | return NO; 31 | } 32 | 33 | + (BOOL)isHTTPEnable { 34 | if([HTTPDNSUtil needTransportSecurity]){ 35 | NSDictionary *infoDict = [[NSBundle mainBundle] infoDictionary]; 36 | return [[[infoDict objectForKey:@"NSAppTransportSecurity"] objectForKey:@"NSAllowsArbitraryLoads"] boolValue]; 37 | } 38 | return YES; 39 | } 40 | 41 | + (NSString *)encrypt:(NSString *)domain withCryptor:(HTTPDNSCryptor *)cryptor { 42 | if (!domain || !cryptor) return nil; 43 | NSData *data = [cryptor encrypt:[domain dataUsingEncoding:NSUTF8StringEncoding]]; 44 | if (data == nil) { 45 | return nil; 46 | } 47 | NSString *str = [HTTPDNSHex encodeHexData:data]; 48 | return str; 49 | } 50 | 51 | + (NSString *)decrypt:(NSData *)raw withCryptor:(HTTPDNSCryptor *)cryptor { 52 | if (!raw || !cryptor) return nil; 53 | NSData *enc = [HTTPDNSHex decodeHexString:[[NSString alloc] initWithData:raw 54 | encoding:NSUTF8StringEncoding]]; 55 | if (enc == nil) { 56 | return nil; 57 | } 58 | NSData *data = [cryptor decrpyt:enc]; 59 | if (data == nil) { 60 | return nil; 61 | } 62 | return [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; 63 | } 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /HTTPDNS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSHumanReadableCopyright 24 | Copyright © 2016 Yourtion. All rights reserved. 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /HTTPDNSTests/HTTPDNSAliYunTest.m: -------------------------------------------------------------------------------- 1 | // 2 | // HTTPDNSAliYunTest.m 3 | // HTTPDNS 4 | // 5 | // Created by YourtionGuo on 6/21/16. 6 | // Copyright © 2016 Yourtion. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "HTTPDNSAliYun.h" 11 | 12 | @interface HTTPDNSAliYunTest : XCTestCase 13 | 14 | @end 15 | 16 | @implementation HTTPDNSAliYunTest 17 | 18 | static NSString *domain = @"blog.yourtion.com"; 19 | static NSString *account = @"GYX"; 20 | 21 | - (void)setUp { 22 | [super setUp]; 23 | // Put setup code here. This method is called before the invocation of each test method in the class. 24 | } 25 | 26 | - (void)tearDown { 27 | // Put teardown code here. This method is called after the invocation of each test method in the class. 28 | [super tearDown]; 29 | } 30 | 31 | - (void)testGetRequestString { 32 | NSString *requestString = [[[HTTPDNSAliYun alloc] initWithAccountId:account] getRequestString:domain]; 33 | XCTAssertEqualObjects(requestString, @"https://203.107.1.1/GYX/d?host=blog.yourtion.com"); 34 | } 35 | 36 | - (void)testGetRequestStringWithoutHTTPS { 37 | HTTPDNSAliYun *dns = [[HTTPDNSAliYun alloc] initWithAccountId:account]; 38 | [dns disableHTTPS]; 39 | NSString *requestString = [dns getRequestString:domain]; 40 | XCTAssertEqualObjects(requestString, @"http://203.107.1.1/GYX/d?host=blog.yourtion.com"); 41 | } 42 | 43 | - (void)testParseResult { 44 | NSData *resultData = [@"{\"host\":\"yourtion.com\",\"ips\":[\"192.243.118.110\",\"192.243.118.111\",\"192.243.118.112\"],\"ttl\":600}" dataUsingEncoding:kCFStringEncodingUTF8]; 45 | 46 | HTTPDNSRecord *result = [[[HTTPDNSAliYun alloc] initWithAccountId:account] parseResult:resultData]; 47 | XCTAssertEqualObjects(result.ip, @"192.243.118.110"); 48 | XCTAssertEqual([result.ips count], 3); 49 | XCTAssertEqualObjects(result.ips[0], @"192.243.118.110"); 50 | XCTAssertEqualObjects(result.ips[1], @"192.243.118.111"); 51 | XCTAssertEqualObjects(result.ips[2], @"192.243.118.112"); 52 | XCTAssertLessThan(result.timeout, [[NSDate date] timeIntervalSince1970] + 601 * 1000); 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /HTTPDNSTests/HTTPDNSDNSPodTest.m: -------------------------------------------------------------------------------- 1 | // 2 | // HTTPDNSDNSPodTest.m 3 | // HTTPDNS 4 | // 5 | // Created by YourtionGuo on 6/21/16. 6 | // Copyright © 2016 Yourtion. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "HTTPDNSDNSPod.h" 11 | 12 | @interface HTTPDNSDNSPodTest : XCTestCase 13 | 14 | @end 15 | 16 | @implementation HTTPDNSDNSPodTest 17 | 18 | static NSString *domain = @"blog.yourtion.com"; 19 | static NSString *account = @"GYX"; 20 | static NSString *key = @"yourtion"; 21 | 22 | - (void)setUp { 23 | [super setUp]; 24 | // Put setup code here. This method is called before the invocation of each test method in the class. 25 | } 26 | 27 | - (void)tearDown { 28 | // Put teardown code here. This method is called after the invocation of each test method in the class. 29 | [super tearDown]; 30 | } 31 | 32 | - (void)testGetRequestString { 33 | NSString *requestString = [[[HTTPDNSDNSPod alloc] init] getRequestString:domain]; 34 | XCTAssertEqualObjects(requestString, @"http://119.29.29.29/d?dn=blog.yourtion.com&ttl=1"); 35 | } 36 | 37 | - (void)testGetRequestStringPro { 38 | NSString *requestStringPro = [[[HTTPDNSDNSPod alloc] initWithAccountId:account andKey:key] getRequestString:domain]; 39 | XCTAssertEqualObjects(requestStringPro, @"http://119.29.29.29/d?dn=25243230D4554613E0D0E91E4437A611B5BC287DDBD2DF4E&id=GYX&ttl=1"); 40 | } 41 | 42 | - (void)testParseResult { 43 | NSData *resultData = [@"192.243.118.110;192.243.118.111;192.243.118.112,600" dataUsingEncoding:kCFStringEncodingUTF8]; 44 | 45 | HTTPDNSRecord *result = [[[HTTPDNSDNSPod alloc] init] parseResult:resultData]; 46 | XCTAssertEqualObjects(result.ip, @"192.243.118.110"); 47 | XCTAssertEqual([result.ips count], 3); 48 | XCTAssertEqualObjects(result.ips[0], @"192.243.118.110"); 49 | XCTAssertEqualObjects(result.ips[1], @"192.243.118.111"); 50 | XCTAssertEqualObjects(result.ips[2], @"192.243.118.112"); 51 | XCTAssertLessThan(result.timeout, [[NSDate date] timeIntervalSince1970] + 601 * 1000); 52 | } 53 | 54 | - (void)testParseResultPro { 55 | NSData *encResultData = [@"17741E1445969076C83EDB701E15A32F17741E14459690769A33F3B9E2E8F4A617741E144596907647F0E551E5B6E1AA8B88FEC2CF35449E" dataUsingEncoding:kCFStringEncodingUTF8]; 56 | 57 | HTTPDNSRecord *result = [[[HTTPDNSDNSPod alloc] initWithAccountId:account andKey:key] parseResult:encResultData]; 58 | XCTAssertEqualObjects(result.ip, @"192.243.118.110"); 59 | XCTAssertEqual([result.ips count], 3); 60 | XCTAssertEqualObjects(result.ips[0], @"192.243.118.110"); 61 | XCTAssertEqualObjects(result.ips[1], @"192.243.118.111"); 62 | XCTAssertEqualObjects(result.ips[2], @"192.243.118.112"); 63 | XCTAssertLessThan(result.timeout, [[NSDate date] timeIntervalSince1970] + 601 * 1000); 64 | } 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /HTTPDNSTests/HTTPDNSGoogleTest.m: -------------------------------------------------------------------------------- 1 | // 2 | // HTTPDNSAliYunTest.m 3 | // HTTPDNS 4 | // 5 | // Created by YourtionGuo on 6/21/16. 6 | // Copyright © 2016 Yourtion. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "HTTPDNSGoogle.h" 11 | 12 | @interface HTTPDNSGoogleTest : XCTestCase 13 | 14 | @end 15 | 16 | @implementation HTTPDNSGoogleTest 17 | 18 | static NSString *domain = @"blog.yourtion.com"; 19 | static NSString *account = @"GYX"; 20 | 21 | - (void)setUp { 22 | [super setUp]; 23 | // Put setup code here. This method is called before the invocation of each test method in the class. 24 | } 25 | 26 | - (void)tearDown { 27 | // Put teardown code here. This method is called after the invocation of each test method in the class. 28 | [super tearDown]; 29 | } 30 | 31 | - (void)testGetRequestString { 32 | NSString *requestString = [[[HTTPDNSGoogle alloc] init] getRequestString:domain]; 33 | XCTAssertEqualObjects(requestString, @"https://dns.google.com/resolve?type=1&name=blog.yourtion.com"); 34 | } 35 | 36 | - (void)testParseResult { 37 | NSData *resultData = [@"{\"Status\":0,\"TC\":false,\"RD\":true,\"RA\":true,\"AD\":false,\"CD\":false,\"Question\":[{\"name\":\"apple.com.\",\"type\":1}],\"Answer\":[{\"name\":\"apple.com.\",\"type\":1,\"TTL\":2365,\"data\":\"17.172.224.47\"},{\"name\":\"apple.com.\",\"type\":1,\"TTL\":2365,\"data\":\"17.178.96.59\"},{\"name\":\"apple.com.\",\"type\":1,\"TTL\":2365,\"data\":\"17.142.160.59\"}]}" dataUsingEncoding:kCFStringEncodingUTF8]; 38 | 39 | HTTPDNSRecord *result = [[[HTTPDNSGoogle alloc] init] parseResult:resultData]; 40 | XCTAssertEqualObjects(result.ip, @"17.172.224.47"); 41 | XCTAssertEqual([result.ips count], 3); 42 | XCTAssertEqualObjects(result.ips[0], @"17.172.224.47"); 43 | XCTAssertEqualObjects(result.ips[1], @"17.178.96.59"); 44 | XCTAssertEqualObjects(result.ips[2], @"17.142.160.59"); 45 | XCTAssertLessThan(result.timeout, [[NSDate date] timeIntervalSince1970] + 2365 * 1000); 46 | } 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /HTTPDNSTests/HTTPDNSUtilTest.m: -------------------------------------------------------------------------------- 1 | // 2 | // HTTPDNSUtilTest.m 3 | // HTTPDNS 4 | // 5 | // Created by YourtionGuo on 6/20/16. 6 | // Copyright © 2016 Yourtion. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "HTTPDNSHex.h" 11 | #import "HTTPDNSUtil.h" 12 | 13 | @interface HTTPDNSUtilTest : XCTestCase 14 | 15 | @end 16 | 17 | @implementation HTTPDNSUtilTest 18 | 19 | - (void)setUp { 20 | [super setUp]; 21 | // Put setup code here. This method is called before the invocation of each test method in the class. 22 | } 23 | 24 | - (void)tearDown { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testHex { 30 | NSString *string = @"YourtionGuo"; 31 | NSString *en_str = [HTTPDNSHex encodeHexString:string]; 32 | NSData *de_data = [HTTPDNSHex decodeHexString:en_str]; 33 | NSString *en_data_str = [HTTPDNSHex encodeHexData:de_data]; 34 | XCTAssertEqualObjects(en_str, en_data_str); 35 | NSString *de_str = [HTTPDNSHex decodeHexToString:en_data_str]; 36 | XCTAssertEqualObjects(de_str, string); 37 | } 38 | 39 | - (void)testCryptor { 40 | NSString *key = @"YourtionGuo"; 41 | NSData *string_data = [@"yourtion@gmail.com" dataUsingEncoding:kCFStringEncodingUTF8]; 42 | HTTPDNSCryptor *cryptor = [[HTTPDNSCryptor alloc] initWithKey:key]; 43 | XCTAssertNotNil(cryptor); 44 | NSData *en_data = [cryptor encrypt:string_data]; 45 | XCTAssertNotNil(en_data); 46 | NSData *de_data = [cryptor decrpyt:en_data]; 47 | XCTAssertNotNil(de_data); 48 | XCTAssertEqualObjects(de_data, string_data); 49 | } 50 | 51 | - (void)testEncryptAndDecrypt { 52 | NSString *key = @"yourtion"; 53 | NSString *domain = @"blog.yourtion.com"; 54 | NSString *en_result = [@"25243230d4554613e0d0e91e4437a611b5bc287ddbd2df4e" uppercaseString]; 55 | HTTPDNSCryptor *cryptor = [[HTTPDNSCryptor alloc] initWithKey:key]; 56 | XCTAssertNotNil(cryptor); 57 | NSString *en_str = [HTTPDNSUtil encrypt:domain withCryptor:cryptor]; 58 | XCTAssertNotNil(en_str); 59 | XCTAssertEqualObjects(en_str, en_result); 60 | NSData *en_data = [en_str dataUsingEncoding:kCFStringEncodingUTF8]; 61 | NSString *de_str = [HTTPDNSUtil decrypt:en_data withCryptor:cryptor]; 62 | XCTAssertNotNil(de_str); 63 | XCTAssertEqualObjects(de_str, domain); 64 | } 65 | 66 | -(void)testNil { 67 | HTTPDNSCryptor *cryptor = [[HTTPDNSCryptor alloc] initWithKey:nil]; 68 | XCTAssertNil(cryptor); 69 | NSString *en_str = [HTTPDNSUtil encrypt:nil withCryptor:cryptor]; 70 | XCTAssertNil(en_str); 71 | NSData *en_data = [en_str dataUsingEncoding:kCFStringEncodingUTF8]; 72 | NSString *de_str = [HTTPDNSUtil decrypt:en_data withCryptor:cryptor]; 73 | XCTAssertNil(de_str); 74 | NSString *key = @"yourtion"; 75 | cryptor = [[HTTPDNSCryptor alloc] initWithKey:key]; 76 | XCTAssertNotNil(cryptor); 77 | en_str = [HTTPDNSUtil encrypt:nil withCryptor:cryptor]; 78 | XCTAssertNil(en_str); 79 | en_data = [en_str dataUsingEncoding:kCFStringEncodingUTF8]; 80 | de_str = [HTTPDNSUtil decrypt:en_data withCryptor:cryptor]; 81 | XCTAssertNil(de_str); 82 | } 83 | 84 | @end 85 | -------------------------------------------------------------------------------- /HTTPDNSTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 郭宇翔 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 | # HTTPDNS 2 | 3 | [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) 4 | [![Version](https://img.shields.io/cocoapods/v/HTTPDNS.svg?style=flat)](http://cocoapods.org/pods/HTTPDNS) 5 | [![License](https://img.shields.io/cocoapods/l/HTTPDNS.svg?style=flat)](http://cocoapods.org/pods/HTTPDNS) 6 | [![Platform](https://img.shields.io/cocoapods/p/HTTPDNS.svg?style=flat)](http://cocoapods.org/pods/HTTPDNS) 7 | [![Build Status](https://travis-ci.org/yourtion/HTTPDNS-OC.svg?branch=master)](https://travis-ci.org/yourtion/HTTPDNS-OC) 8 | 9 | HTTPDNS 库 Objdctive-C 实现。 10 | 11 | 支持 DNSPod、DNSPod 企业版、AliYunDNS、Google 等(方便扩展) 12 | 13 | ## 安装 14 | 15 | ### CocoaPod 16 | 17 | 在 `Podfile` 中添加: 18 | 19 | ``` 20 | platform :ios, '8.0' 21 | 22 | pod 'HTTPDNS' 23 | ``` 24 | 25 | ### Carthage 26 | 27 | ``` 28 | github "yourtion/HTTPDNS-OC" 29 | ``` 30 | 31 | ## 使用方法 32 | 33 | ### 解析域名 34 | 35 | ```objc 36 | #import 37 | 38 | // 解析记录 39 | [[HTTPDNSClient sharedInstance] getRecord:@"www.taobao.com" callback:^(HTTPDNSRecord *record) { 40 | NSLog(@"IP : %@", record.ip); 41 | NSLog(@"description : %@", record.description); 42 | }]; 43 | 44 | // 清除缓存 45 | [[HTTPDNSClient sharedInstance] cleanAllCache]; 46 | ``` 47 | 48 | ### 切换 HTTPDNS 服务提供方 49 | 50 | ```objc 51 | // 使用 DNSPod 52 | [[HTTPDNSClient sharedInstance] useDNSPod]; 53 | 54 | // 使用 DNSPod 企业版 55 | [[HTTPDNSClient sharedInstance] useDNSPodProWithAccount:@"Your DNSPod pro accound id" Key:@"Your DNSPod pro key"]; 56 | 57 | // 使用阿里云 HTTPDNS 58 | [[HTTPDNSClient sharedInstance] useAliYunWithKey:@"Your Aliyun HTTPNDS accound id"]; 59 | 60 | // 使用 Google DNS-over-HTTP 61 | [[HTTPDNSClient sharedInstance] useGoogle]; 62 | ``` 63 | 64 | ## TODO 65 | 66 | - [x] 实现 DNSPod 免费版功能 67 | - [x] 实现 DNSPod 企业版功能(认证接入) 68 | - [x] 实现 AliYun HTTPDNS 69 | - [x] 实现 AliYun HTTPDNS With HTTPS 70 | - [x] 实现 Google DNS-over-HTTP 71 | - [x] 提供清除缓存方法 72 | - [ ] 提供自定义解析器方法 73 | --------------------------------------------------------------------------------