├── AppleDNS.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── xjbeta.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── xjbeta.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── AppleDNS.xcscheme │ └── xcschememanagement.plist ├── AppleDNS ├── AppDelegate.swift ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Apple DNSMacHuge_512pt.png │ │ ├── Apple DNSMacHuge_512pt@2x.png │ │ ├── Apple DNSMacLarge_256pt.png │ │ ├── Apple DNSMacLarge_256pt@2x.png │ │ ├── Apple DNSMacMedium_128pt.png │ │ ├── Apple DNSMacMedium_128pt@2x.png │ │ ├── Apple DNSMacMicro_16pt.png │ │ ├── Apple DNSMacMicro_16pt@2x.png │ │ ├── Apple DNSMacSmall_32pt.png │ │ ├── Apple DNSMacSmall_32pt@2x.png │ │ └── Contents.json │ └── Contents.json ├── Base.lproj │ └── Main.storyboard ├── DownloadFiles.swift ├── Info.plist ├── MainWindow.swift ├── Task.swift └── ViewController.swift └── README.md /AppleDNS.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 011329381CB763C900502326 /* Task.swift in Sources */ = {isa = PBXBuildFile; fileRef = 011329371CB763C900502326 /* Task.swift */; }; 11 | 0131AF551DFBF63700C1FB11 /* MainWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0131AF541DFBF63700C1FB11 /* MainWindow.swift */; }; 12 | 01649E221CB649F000740E9E /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01649E211CB649F000740E9E /* AppDelegate.swift */; }; 13 | 01649E241CB649F000740E9E /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01649E231CB649F000740E9E /* ViewController.swift */; }; 14 | 01649E261CB649F000740E9E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 01649E251CB649F000740E9E /* Assets.xcassets */; }; 15 | 01649E291CB649F000740E9E /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 01649E271CB649F000740E9E /* Main.storyboard */; }; 16 | 01649E311CB6521600740E9E /* DownloadFiles.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01649E301CB6521600740E9E /* DownloadFiles.swift */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXFileReference section */ 20 | 011329371CB763C900502326 /* Task.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Task.swift; sourceTree = ""; }; 21 | 0131AF541DFBF63700C1FB11 /* MainWindow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainWindow.swift; sourceTree = ""; }; 22 | 01649E1E1CB649F000740E9E /* AppleDNS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AppleDNS.app; sourceTree = BUILT_PRODUCTS_DIR; }; 23 | 01649E211CB649F000740E9E /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 24 | 01649E231CB649F000740E9E /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 25 | 01649E251CB649F000740E9E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 26 | 01649E281CB649F000740E9E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 27 | 01649E2A1CB649F000740E9E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 28 | 01649E301CB6521600740E9E /* DownloadFiles.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DownloadFiles.swift; sourceTree = ""; }; 29 | /* End PBXFileReference section */ 30 | 31 | /* Begin PBXFrameworksBuildPhase section */ 32 | 01649E1B1CB649F000740E9E /* Frameworks */ = { 33 | isa = PBXFrameworksBuildPhase; 34 | buildActionMask = 2147483647; 35 | files = ( 36 | ); 37 | runOnlyForDeploymentPostprocessing = 0; 38 | }; 39 | /* End PBXFrameworksBuildPhase section */ 40 | 41 | /* Begin PBXGroup section */ 42 | 01649E151CB649F000740E9E = { 43 | isa = PBXGroup; 44 | children = ( 45 | 01649E201CB649F000740E9E /* AppleDNS */, 46 | 01649E1F1CB649F000740E9E /* Products */, 47 | ); 48 | sourceTree = ""; 49 | }; 50 | 01649E1F1CB649F000740E9E /* Products */ = { 51 | isa = PBXGroup; 52 | children = ( 53 | 01649E1E1CB649F000740E9E /* AppleDNS.app */, 54 | ); 55 | name = Products; 56 | sourceTree = ""; 57 | }; 58 | 01649E201CB649F000740E9E /* AppleDNS */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | 01649E271CB649F000740E9E /* Main.storyboard */, 62 | 0131AF541DFBF63700C1FB11 /* MainWindow.swift */, 63 | 01649E211CB649F000740E9E /* AppDelegate.swift */, 64 | 01649E231CB649F000740E9E /* ViewController.swift */, 65 | 01649E301CB6521600740E9E /* DownloadFiles.swift */, 66 | 011329371CB763C900502326 /* Task.swift */, 67 | 01649E251CB649F000740E9E /* Assets.xcassets */, 68 | 01649E2A1CB649F000740E9E /* Info.plist */, 69 | ); 70 | path = AppleDNS; 71 | sourceTree = ""; 72 | }; 73 | /* End PBXGroup section */ 74 | 75 | /* Begin PBXNativeTarget section */ 76 | 01649E1D1CB649F000740E9E /* AppleDNS */ = { 77 | isa = PBXNativeTarget; 78 | buildConfigurationList = 01649E2D1CB649F000740E9E /* Build configuration list for PBXNativeTarget "AppleDNS" */; 79 | buildPhases = ( 80 | 01649E1A1CB649F000740E9E /* Sources */, 81 | 01649E1B1CB649F000740E9E /* Frameworks */, 82 | 01649E1C1CB649F000740E9E /* Resources */, 83 | ); 84 | buildRules = ( 85 | ); 86 | dependencies = ( 87 | ); 88 | name = AppleDNS; 89 | productName = AppleDNS; 90 | productReference = 01649E1E1CB649F000740E9E /* AppleDNS.app */; 91 | productType = "com.apple.product-type.application"; 92 | }; 93 | /* End PBXNativeTarget section */ 94 | 95 | /* Begin PBXProject section */ 96 | 01649E161CB649F000740E9E /* Project object */ = { 97 | isa = PBXProject; 98 | attributes = { 99 | LastSwiftUpdateCheck = 0730; 100 | LastUpgradeCheck = 0810; 101 | ORGANIZATIONNAME = xjbeta; 102 | TargetAttributes = { 103 | 01649E1D1CB649F000740E9E = { 104 | CreatedOnToolsVersion = 7.3; 105 | LastSwiftMigration = 0810; 106 | }; 107 | }; 108 | }; 109 | buildConfigurationList = 01649E191CB649F000740E9E /* Build configuration list for PBXProject "AppleDNS" */; 110 | compatibilityVersion = "Xcode 3.2"; 111 | developmentRegion = English; 112 | hasScannedForEncodings = 0; 113 | knownRegions = ( 114 | en, 115 | Base, 116 | ); 117 | mainGroup = 01649E151CB649F000740E9E; 118 | productRefGroup = 01649E1F1CB649F000740E9E /* Products */; 119 | projectDirPath = ""; 120 | projectRoot = ""; 121 | targets = ( 122 | 01649E1D1CB649F000740E9E /* AppleDNS */, 123 | ); 124 | }; 125 | /* End PBXProject section */ 126 | 127 | /* Begin PBXResourcesBuildPhase section */ 128 | 01649E1C1CB649F000740E9E /* Resources */ = { 129 | isa = PBXResourcesBuildPhase; 130 | buildActionMask = 2147483647; 131 | files = ( 132 | 01649E261CB649F000740E9E /* Assets.xcassets in Resources */, 133 | 01649E291CB649F000740E9E /* Main.storyboard in Resources */, 134 | ); 135 | runOnlyForDeploymentPostprocessing = 0; 136 | }; 137 | /* End PBXResourcesBuildPhase section */ 138 | 139 | /* Begin PBXSourcesBuildPhase section */ 140 | 01649E1A1CB649F000740E9E /* Sources */ = { 141 | isa = PBXSourcesBuildPhase; 142 | buildActionMask = 2147483647; 143 | files = ( 144 | 011329381CB763C900502326 /* Task.swift in Sources */, 145 | 01649E311CB6521600740E9E /* DownloadFiles.swift in Sources */, 146 | 0131AF551DFBF63700C1FB11 /* MainWindow.swift in Sources */, 147 | 01649E241CB649F000740E9E /* ViewController.swift in Sources */, 148 | 01649E221CB649F000740E9E /* AppDelegate.swift in Sources */, 149 | ); 150 | runOnlyForDeploymentPostprocessing = 0; 151 | }; 152 | /* End PBXSourcesBuildPhase section */ 153 | 154 | /* Begin PBXVariantGroup section */ 155 | 01649E271CB649F000740E9E /* Main.storyboard */ = { 156 | isa = PBXVariantGroup; 157 | children = ( 158 | 01649E281CB649F000740E9E /* Base */, 159 | ); 160 | name = Main.storyboard; 161 | sourceTree = ""; 162 | }; 163 | /* End PBXVariantGroup section */ 164 | 165 | /* Begin XCBuildConfiguration section */ 166 | 01649E2B1CB649F000740E9E /* Debug */ = { 167 | isa = XCBuildConfiguration; 168 | buildSettings = { 169 | ALWAYS_SEARCH_USER_PATHS = NO; 170 | CLANG_ANALYZER_NONNULL = YES; 171 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 172 | CLANG_CXX_LIBRARY = "libc++"; 173 | CLANG_ENABLE_MODULES = YES; 174 | CLANG_ENABLE_OBJC_ARC = YES; 175 | CLANG_WARN_BOOL_CONVERSION = YES; 176 | CLANG_WARN_CONSTANT_CONVERSION = YES; 177 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 178 | CLANG_WARN_EMPTY_BODY = YES; 179 | CLANG_WARN_ENUM_CONVERSION = YES; 180 | CLANG_WARN_INFINITE_RECURSION = YES; 181 | CLANG_WARN_INT_CONVERSION = YES; 182 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 183 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 184 | CLANG_WARN_UNREACHABLE_CODE = YES; 185 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 186 | CODE_SIGN_IDENTITY = "-"; 187 | COPY_PHASE_STRIP = NO; 188 | DEBUG_INFORMATION_FORMAT = dwarf; 189 | ENABLE_STRICT_OBJC_MSGSEND = YES; 190 | ENABLE_TESTABILITY = YES; 191 | GCC_C_LANGUAGE_STANDARD = gnu99; 192 | GCC_DYNAMIC_NO_PIC = NO; 193 | GCC_NO_COMMON_BLOCKS = YES; 194 | GCC_OPTIMIZATION_LEVEL = 0; 195 | GCC_PREPROCESSOR_DEFINITIONS = ( 196 | "DEBUG=1", 197 | "$(inherited)", 198 | ); 199 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 200 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 201 | GCC_WARN_UNDECLARED_SELECTOR = YES; 202 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 203 | GCC_WARN_UNUSED_FUNCTION = YES; 204 | GCC_WARN_UNUSED_VARIABLE = YES; 205 | MACOSX_DEPLOYMENT_TARGET = 10.11; 206 | MTL_ENABLE_DEBUG_INFO = YES; 207 | ONLY_ACTIVE_ARCH = YES; 208 | SDKROOT = macosx; 209 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 210 | }; 211 | name = Debug; 212 | }; 213 | 01649E2C1CB649F000740E9E /* Release */ = { 214 | isa = XCBuildConfiguration; 215 | buildSettings = { 216 | ALWAYS_SEARCH_USER_PATHS = NO; 217 | CLANG_ANALYZER_NONNULL = YES; 218 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 219 | CLANG_CXX_LIBRARY = "libc++"; 220 | CLANG_ENABLE_MODULES = YES; 221 | CLANG_ENABLE_OBJC_ARC = YES; 222 | CLANG_WARN_BOOL_CONVERSION = YES; 223 | CLANG_WARN_CONSTANT_CONVERSION = YES; 224 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 225 | CLANG_WARN_EMPTY_BODY = YES; 226 | CLANG_WARN_ENUM_CONVERSION = YES; 227 | CLANG_WARN_INFINITE_RECURSION = YES; 228 | CLANG_WARN_INT_CONVERSION = YES; 229 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 230 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 231 | CLANG_WARN_UNREACHABLE_CODE = YES; 232 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 233 | CODE_SIGN_IDENTITY = "-"; 234 | COPY_PHASE_STRIP = NO; 235 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 236 | ENABLE_NS_ASSERTIONS = NO; 237 | ENABLE_STRICT_OBJC_MSGSEND = YES; 238 | GCC_C_LANGUAGE_STANDARD = gnu99; 239 | GCC_NO_COMMON_BLOCKS = YES; 240 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 241 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 242 | GCC_WARN_UNDECLARED_SELECTOR = YES; 243 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 244 | GCC_WARN_UNUSED_FUNCTION = YES; 245 | GCC_WARN_UNUSED_VARIABLE = YES; 246 | MACOSX_DEPLOYMENT_TARGET = 10.11; 247 | MTL_ENABLE_DEBUG_INFO = NO; 248 | SDKROOT = macosx; 249 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 250 | }; 251 | name = Release; 252 | }; 253 | 01649E2E1CB649F000740E9E /* Debug */ = { 254 | isa = XCBuildConfiguration; 255 | buildSettings = { 256 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 257 | COMBINE_HIDPI_IMAGES = YES; 258 | INFOPLIST_FILE = AppleDNS/Info.plist; 259 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 260 | MACOSX_DEPLOYMENT_TARGET = 10.10; 261 | PRODUCT_BUNDLE_IDENTIFIER = "xjbeta.tiny-gmail.com.AppleDNS"; 262 | PRODUCT_NAME = "$(TARGET_NAME)"; 263 | SWIFT_VERSION = 3.0; 264 | }; 265 | name = Debug; 266 | }; 267 | 01649E2F1CB649F000740E9E /* Release */ = { 268 | isa = XCBuildConfiguration; 269 | buildSettings = { 270 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 271 | COMBINE_HIDPI_IMAGES = YES; 272 | INFOPLIST_FILE = AppleDNS/Info.plist; 273 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 274 | MACOSX_DEPLOYMENT_TARGET = 10.10; 275 | PRODUCT_BUNDLE_IDENTIFIER = "xjbeta.tiny-gmail.com.AppleDNS"; 276 | PRODUCT_NAME = "$(TARGET_NAME)"; 277 | SWIFT_VERSION = 3.0; 278 | }; 279 | name = Release; 280 | }; 281 | /* End XCBuildConfiguration section */ 282 | 283 | /* Begin XCConfigurationList section */ 284 | 01649E191CB649F000740E9E /* Build configuration list for PBXProject "AppleDNS" */ = { 285 | isa = XCConfigurationList; 286 | buildConfigurations = ( 287 | 01649E2B1CB649F000740E9E /* Debug */, 288 | 01649E2C1CB649F000740E9E /* Release */, 289 | ); 290 | defaultConfigurationIsVisible = 0; 291 | defaultConfigurationName = Release; 292 | }; 293 | 01649E2D1CB649F000740E9E /* Build configuration list for PBXNativeTarget "AppleDNS" */ = { 294 | isa = XCConfigurationList; 295 | buildConfigurations = ( 296 | 01649E2E1CB649F000740E9E /* Debug */, 297 | 01649E2F1CB649F000740E9E /* Release */, 298 | ); 299 | defaultConfigurationIsVisible = 0; 300 | defaultConfigurationName = Release; 301 | }; 302 | /* End XCConfigurationList section */ 303 | }; 304 | rootObject = 01649E161CB649F000740E9E /* Project object */; 305 | } 306 | -------------------------------------------------------------------------------- /AppleDNS.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AppleDNS.xcodeproj/project.xcworkspace/xcuserdata/xjbeta.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xjbeta/AppleDNS-GUI/38ffdf213a470a317b7b571a655535f60f78d1b6/AppleDNS.xcodeproj/project.xcworkspace/xcuserdata/xjbeta.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /AppleDNS.xcodeproj/xcuserdata/xjbeta.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /AppleDNS.xcodeproj/xcuserdata/xjbeta.xcuserdatad/xcschemes/AppleDNS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /AppleDNS.xcodeproj/xcuserdata/xjbeta.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | AppleDNS.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 01649E1D1CB649F000740E9E 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /AppleDNS/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // AppleDNS 4 | // 5 | // Created by xjbeta on 16/4/7. 6 | // Copyright © 2016年 xjbeta. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | @NSApplicationMain 12 | class AppDelegate: NSObject, NSApplicationDelegate { 13 | 14 | @IBAction func about(_ sender: AnyObject) { 15 | if let url = URL(string: "https://github.com/gongjianhui/AppleDNS") { 16 | NSWorkspace.shared().open(url) 17 | } 18 | } 19 | func applicationDidFinishLaunching(_ aNotification: Notification) { 20 | // Insert code here to initialize your application 21 | } 22 | 23 | func applicationWillTerminate(_ aNotification: Notification) { 24 | // Insert code here to tear down your application 25 | } 26 | 27 | 28 | } 29 | 30 | -------------------------------------------------------------------------------- /AppleDNS/Assets.xcassets/AppIcon.appiconset/Apple DNSMacHuge_512pt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xjbeta/AppleDNS-GUI/38ffdf213a470a317b7b571a655535f60f78d1b6/AppleDNS/Assets.xcassets/AppIcon.appiconset/Apple DNSMacHuge_512pt.png -------------------------------------------------------------------------------- /AppleDNS/Assets.xcassets/AppIcon.appiconset/Apple DNSMacHuge_512pt@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xjbeta/AppleDNS-GUI/38ffdf213a470a317b7b571a655535f60f78d1b6/AppleDNS/Assets.xcassets/AppIcon.appiconset/Apple DNSMacHuge_512pt@2x.png -------------------------------------------------------------------------------- /AppleDNS/Assets.xcassets/AppIcon.appiconset/Apple DNSMacLarge_256pt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xjbeta/AppleDNS-GUI/38ffdf213a470a317b7b571a655535f60f78d1b6/AppleDNS/Assets.xcassets/AppIcon.appiconset/Apple DNSMacLarge_256pt.png -------------------------------------------------------------------------------- /AppleDNS/Assets.xcassets/AppIcon.appiconset/Apple DNSMacLarge_256pt@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xjbeta/AppleDNS-GUI/38ffdf213a470a317b7b571a655535f60f78d1b6/AppleDNS/Assets.xcassets/AppIcon.appiconset/Apple DNSMacLarge_256pt@2x.png -------------------------------------------------------------------------------- /AppleDNS/Assets.xcassets/AppIcon.appiconset/Apple DNSMacMedium_128pt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xjbeta/AppleDNS-GUI/38ffdf213a470a317b7b571a655535f60f78d1b6/AppleDNS/Assets.xcassets/AppIcon.appiconset/Apple DNSMacMedium_128pt.png -------------------------------------------------------------------------------- /AppleDNS/Assets.xcassets/AppIcon.appiconset/Apple DNSMacMedium_128pt@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xjbeta/AppleDNS-GUI/38ffdf213a470a317b7b571a655535f60f78d1b6/AppleDNS/Assets.xcassets/AppIcon.appiconset/Apple DNSMacMedium_128pt@2x.png -------------------------------------------------------------------------------- /AppleDNS/Assets.xcassets/AppIcon.appiconset/Apple DNSMacMicro_16pt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xjbeta/AppleDNS-GUI/38ffdf213a470a317b7b571a655535f60f78d1b6/AppleDNS/Assets.xcassets/AppIcon.appiconset/Apple DNSMacMicro_16pt.png -------------------------------------------------------------------------------- /AppleDNS/Assets.xcassets/AppIcon.appiconset/Apple DNSMacMicro_16pt@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xjbeta/AppleDNS-GUI/38ffdf213a470a317b7b571a655535f60f78d1b6/AppleDNS/Assets.xcassets/AppIcon.appiconset/Apple DNSMacMicro_16pt@2x.png -------------------------------------------------------------------------------- /AppleDNS/Assets.xcassets/AppIcon.appiconset/Apple DNSMacSmall_32pt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xjbeta/AppleDNS-GUI/38ffdf213a470a317b7b571a655535f60f78d1b6/AppleDNS/Assets.xcassets/AppIcon.appiconset/Apple DNSMacSmall_32pt.png -------------------------------------------------------------------------------- /AppleDNS/Assets.xcassets/AppIcon.appiconset/Apple DNSMacSmall_32pt@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xjbeta/AppleDNS-GUI/38ffdf213a470a317b7b571a655535f60f78d1b6/AppleDNS/Assets.xcassets/AppIcon.appiconset/Apple DNSMacSmall_32pt@2x.png -------------------------------------------------------------------------------- /AppleDNS/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "Apple DNSMacMicro_16pt.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "Apple DNSMacMicro_16pt@2x.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "Apple DNSMacSmall_32pt.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "Apple DNSMacSmall_32pt@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "Apple DNSMacMedium_128pt.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "Apple DNSMacMedium_128pt@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "Apple DNSMacLarge_256pt.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "Apple DNSMacLarge_256pt@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "Apple DNSMacHuge_512pt.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "Apple DNSMacHuge_512pt@2x.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /AppleDNS/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /AppleDNS/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 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 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 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | -------------------------------------------------------------------------------- /AppleDNS/DownloadFiles.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DownloadFiles.swift 3 | // AppleDNS 4 | // 5 | // Created by xjbeta on 16/4/7. 6 | // Copyright © 2016年 xjbeta. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class DownloadFiles: NSObject { 12 | 13 | static let shared = DownloadFiles() 14 | 15 | fileprivate override init() { 16 | } 17 | 18 | 19 | var path = NSTemporaryDirectory() + "AppleDNS" 20 | 21 | let queue = DispatchQueue(label: "com.AppleDNS.background", attributes: []) 22 | 23 | var success: (() -> Void)? 24 | 25 | var error: (() -> Void)? 26 | 27 | var notification: ((String) -> Void)? 28 | 29 | var export: ((String) -> Void)? 30 | 31 | var unzipSuccess: (() -> Void)? 32 | 33 | var pingTerminated: (() -> Void)? 34 | 35 | 36 | 37 | 38 | 39 | func unzip() { 40 | 41 | let task = Task(launchPath: "/usr/bin/unzip", 42 | arguments: ["-o", path + "/master"], 43 | currentDirectoryPath: path) 44 | task.setNotification() 45 | task.launch() 46 | self.unzipSuccess!() 47 | } 48 | 49 | func setPath() { 50 | queue.sync { 51 | do { 52 | try FileManager.default.createDirectory(atPath: self.path, withIntermediateDirectories: true, attributes: nil) 53 | } catch { 54 | print("createDirectoryAtPath fail") 55 | } 56 | } 57 | } 58 | 59 | 60 | 61 | func clearFiles() { 62 | queue.sync { 63 | do { 64 | try FileManager.default.removeItem(atPath: self.path) 65 | } catch { 66 | print("without file") 67 | } 68 | } 69 | } 70 | 71 | 72 | 73 | 74 | func downloadFile() { 75 | 76 | queue.async { 77 | 78 | let url = "https://codeload.github.com/gongjianhui/AppleDNS/zip/master" 79 | 80 | if let url = URL(string: url) { 81 | 82 | let fileUrl = URL(fileURLWithPath: self.path) 83 | 84 | let destinationUrl = fileUrl.appendingPathComponent(url.lastPathComponent) 85 | 86 | if FileManager().fileExists(atPath: destinationUrl.path) { 87 | print("文件重复") 88 | } else { 89 | if let myAudioDataFromUrl = try? Data(contentsOf: url){ 90 | if (try? myAudioDataFromUrl.write(to: destinationUrl, options: [.atomic])) != nil { 91 | self.success!() 92 | } else { 93 | self.error!() 94 | } 95 | } 96 | } 97 | } 98 | 99 | } 100 | 101 | 102 | 103 | 104 | } 105 | 106 | 107 | 108 | func ping(_ title1: String, title2: String) { 109 | 110 | queue.sync { 111 | 112 | let task = Task(launchPath: "/usr/bin/python", 113 | arguments: ["fetch-timeout.py", "\(title2).json"], 114 | currentDirectoryPath: self.path + "/AppleDNS-master/") 115 | task.setNotification() 116 | task.notification = { str in 117 | self.notification!(str) 118 | } 119 | task.terminated = { 120 | self.export(title1) 121 | } 122 | 123 | task.launch() 124 | 125 | 126 | 127 | } 128 | 129 | 130 | 131 | 132 | 133 | 134 | } 135 | 136 | 137 | func export(_ title1: String) { 138 | queue.sync { 139 | let task = Task(launchPath: "/usr/bin/python", 140 | arguments: ["export-configure.py", title1], 141 | currentDirectoryPath: self.path + "/AppleDNS-master/") 142 | task.setNotification() 143 | task.notification = { str in 144 | self.export!(str) 145 | } 146 | task.terminated = { 147 | 148 | } 149 | task.launch() 150 | } 151 | 152 | } 153 | 154 | } 155 | -------------------------------------------------------------------------------- /AppleDNS/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.4 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | $(MACOSX_DEPLOYMENT_TARGET) 27 | NSHumanReadableCopyright 28 | Copyright © 2016年 xjbeta. All rights reserved. 29 | NSMainStoryboardFile 30 | Main 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /AppleDNS/MainWindow.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MainWindow.swift 3 | // AppleDNS 4 | // 5 | // Created by xjbeta on 2016/12/10. 6 | // Copyright © 2016年 xjbeta. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class MainWindow: NSWindowController { 12 | @IBOutlet var runButton: NSToolbarItem! 13 | @IBAction func runButton(_ sender: NSToolbarItem) { 14 | if let title1 = selectButton.titleOfSelectedItem, 15 | let title2 = selectNetworkButton.titleOfSelectedItem { 16 | DownloadFiles.shared.ping(title1, title2: title2) 17 | } 18 | 19 | 20 | } 21 | @IBOutlet var cleanDNSButton: NSButton! 22 | @IBAction func cleanDNSButton(_ sender: NSToolbarItem) { 23 | cleanDNS() 24 | } 25 | @IBOutlet var selectButton: NSPopUpButton! 26 | @IBOutlet var selectNetworkButton: NSPopUpButton! 27 | 28 | var downloadFiles: DownloadFiles! 29 | override func windowDidLoad() { 30 | super.windowDidLoad() 31 | initWindow() 32 | runButton.isEnabled = false 33 | DownloadFiles.shared.clearFiles() 34 | DownloadFiles.shared.setPath() 35 | DownloadFiles.shared.downloadFile() 36 | } 37 | 38 | func initWindow() { 39 | window?.titlebarAppearsTransparent = true 40 | window?.titleVisibility = .hidden 41 | window?.isMovableByWindowBackground = true 42 | 43 | window?.backgroundColor = NSColor(calibratedRed: 0.35, green: 0.85, blue: 1, alpha: 1) 44 | window?.contentView?.wantsLayer = true 45 | } 46 | 47 | func cleanDNS() { 48 | 49 | switch floor(NSAppKitVersionNumber) { 50 | case Double(NSAppKitVersionNumber10_10)...Double(NSAppKitVersionNumber10_10_3): 51 | doScriptWithAdmin("sudo discoveryutil mdnsflushcache") 52 | case 0.. Void)? 17 | var terminated: (() -> Void)? 18 | 19 | init(launchPath: String, arguments: [String], currentDirectoryPath: String) { 20 | super.init() 21 | task.launchPath = launchPath 22 | task.arguments = arguments 23 | task.currentDirectoryPath = currentDirectoryPath 24 | task.standardOutput = self.pipe 25 | 26 | } 27 | 28 | func setNotification() { 29 | let outHandle = pipe.fileHandleForReading 30 | outHandle.waitForDataInBackgroundAndNotify() 31 | var obs1 : NSObjectProtocol! 32 | obs1 = NotificationCenter.default.addObserver(forName: NSNotification.Name.NSFileHandleDataAvailable, object: outHandle, queue: nil) { notification in 33 | let data = outHandle.availableData 34 | if data.count > 0 { 35 | if let str = NSString(data: data, encoding: String.Encoding.utf8.rawValue) { 36 | print("got output: \(str)") 37 | 38 | self.notification!(str as String) 39 | 40 | } 41 | outHandle.waitForDataInBackgroundAndNotify() 42 | } else { 43 | print("EOF on stdout from process") 44 | NotificationCenter.default.removeObserver(obs1) 45 | } 46 | } 47 | 48 | var obs2 : NSObjectProtocol! 49 | obs2 = NotificationCenter.default.addObserver(forName: Process.didTerminateNotification, object: task, queue: nil) { notification in 50 | self.terminated!() 51 | 52 | NotificationCenter.default.removeObserver(obs2) 53 | } 54 | } 55 | 56 | func launch() { 57 | task.launch() 58 | } 59 | 60 | 61 | 62 | 63 | } 64 | -------------------------------------------------------------------------------- /AppleDNS/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // AppleDNS 4 | // 5 | // Created by xjbeta on 16/4/7. 6 | // Copyright © 2016年 xjbeta. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class ViewController: NSViewController { 12 | 13 | @IBOutlet var text: NSTextView! 14 | 15 | override func viewDidLoad() { 16 | super.viewDidLoad() 17 | downloadFilesHandle() 18 | } 19 | 20 | 21 | func downloadFilesHandle() { 22 | var text = "Downloading master from Github" + "\n" 23 | self.text.string = text 24 | DownloadFiles.shared.success = { 25 | text += "Download Success" + "\n" 26 | 27 | DispatchQueue.main.async { 28 | self.text.string = text 29 | } 30 | DownloadFiles.shared.unzip() 31 | } 32 | DownloadFiles.shared.error = { 33 | text += "Download Error" + "\n" 34 | DispatchQueue.main.async { 35 | self.text.string = text 36 | } 37 | } 38 | 39 | 40 | DownloadFiles.shared.notification = { str in 41 | text += str + "\n" 42 | DispatchQueue.main.async { 43 | self.text.string = text 44 | self.text.scrollRangeToVisible(NSMakeRange((self.text.string?.characters.count)!, 0)) 45 | } 46 | } 47 | 48 | DownloadFiles.shared.export = { str in 49 | DispatchQueue.main.async { 50 | self.text.string = str 51 | } 52 | } 53 | 54 | 55 | 56 | DownloadFiles.shared.unzipSuccess = { 57 | text += "unzip Success" + "\n" 58 | DispatchQueue.main.async { 59 | self.text.string = text 60 | if let items = self.view.window?.toolbar?.items { 61 | for i in items { 62 | i.isEnabled = true 63 | } 64 | } 65 | } 66 | 67 | } 68 | } 69 | 70 | } 71 | 72 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AppleDNS-GUI 2 | 3 | ## 推荐使用[此方法](https://sspai.com/post/35741)解决网络问题 4 | 5 | 6 | #### [下载](https://github.com/xjbeta/AppleDNS-GUI/releases) 7 | #### 请熟读[AppleDNS](https://github.com/gongjianhui/AppleDNS)相关内容后再使用本APP 8 | 9 | #### 给[AppleDNS](https://github.com/gongjianhui/AppleDNS) 的python 命令行套个壳 10 | #### 解压后放入 应用程序(application) 文件夹 11 | #### 仅供测试,不保证能正常运行。 12 | --------------------------------------------------------------------------------