diff --git a/DNSecure.xcodeproj/project.pbxproj b/DNSecure.xcodeproj/project.pbxproj index 24bb7e6..eb57d52 100644 --- a/DNSecure.xcodeproj/project.pbxproj +++ b/DNSecure.xcodeproj/project.pbxproj @@ -524,7 +524,7 @@ MARKETING_VERSION = 1.1.1; PRODUCT_BUNDLE_IDENTIFIER = xyz.kebo.DNSecure; PRODUCT_NAME = "$(TARGET_NAME)"; - SUPPORTS_MACCATALYST = NO; + SUPPORTS_MACCATALYST = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -550,7 +550,7 @@ MARKETING_VERSION = 1.1.1; PRODUCT_BUNDLE_IDENTIFIER = xyz.kebo.DNSecure; PRODUCT_NAME = "$(TARGET_NAME)"; - SUPPORTS_MACCATALYST = NO; + SUPPORTS_MACCATALYST = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; diff --git a/DNSecure/Assets.xcassets/HowToActivate/MakeServiceActive.imageset/Contents.json b/DNSecure/Assets.xcassets/HowToActivate/MakeServiceActive.imageset/Contents.json new file mode 100644 index 0000000..a7b497b --- /dev/null +++ b/DNSecure/Assets.xcassets/HowToActivate/MakeServiceActive.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "IMG_0244.jpg", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DNSecure/Assets.xcassets/HowToActivate/MakeServiceActive.imageset/IMG_0244.jpg b/DNSecure/Assets.xcassets/HowToActivate/MakeServiceActive.imageset/IMG_0244.jpg new file mode 100644 index 0000000..2246a0c Binary files /dev/null and b/DNSecure/Assets.xcassets/HowToActivate/MakeServiceActive.imageset/IMG_0244.jpg differ diff --git a/DNSecure/Assets.xcassets/HowToActivate/NetworkSettings.imageset/Contents.json b/DNSecure/Assets.xcassets/HowToActivate/NetworkSettings.imageset/Contents.json new file mode 100644 index 0000000..c32e378 --- /dev/null +++ b/DNSecure/Assets.xcassets/HowToActivate/NetworkSettings.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Screen Shot 2021-02-13 at 11.25.16 AM.jpg", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DNSecure/Assets.xcassets/HowToActivate/NetworkSettings.imageset/Screen Shot 2021-02-13 at 11.25.16 AM.jpg b/DNSecure/Assets.xcassets/HowToActivate/NetworkSettings.imageset/Screen Shot 2021-02-13 at 11.25.16 AM.jpg new file mode 100644 index 0000000..433f1ca Binary files /dev/null and b/DNSecure/Assets.xcassets/HowToActivate/NetworkSettings.imageset/Screen Shot 2021-02-13 at 11.25.16 AM.jpg differ diff --git a/DNSecure/Assets.xcassets/HowToActivate/NetworkSettingsApply.imageset/Contents.json b/DNSecure/Assets.xcassets/HowToActivate/NetworkSettingsApply.imageset/Contents.json new file mode 100644 index 0000000..7b86bdf --- /dev/null +++ b/DNSecure/Assets.xcassets/HowToActivate/NetworkSettingsApply.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Image 2-13-21 at 12.10 PM.jpg", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DNSecure/Assets.xcassets/HowToActivate/NetworkSettingsApply.imageset/Image 2-13-21 at 12.10 PM.jpg b/DNSecure/Assets.xcassets/HowToActivate/NetworkSettingsApply.imageset/Image 2-13-21 at 12.10 PM.jpg new file mode 100644 index 0000000..c9cf50c Binary files /dev/null and b/DNSecure/Assets.xcassets/HowToActivate/NetworkSettingsApply.imageset/Image 2-13-21 at 12.10 PM.jpg differ diff --git a/DNSecure/Assets.xcassets/HowToActivate/SystemPreferences.imageset/Contents.json b/DNSecure/Assets.xcassets/HowToActivate/SystemPreferences.imageset/Contents.json new file mode 100644 index 0000000..4e2bb5d --- /dev/null +++ b/DNSecure/Assets.xcassets/HowToActivate/SystemPreferences.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Screen Shot 2021-02-13 at 11.36.47 AM.jpg", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DNSecure/Assets.xcassets/HowToActivate/SystemPreferences.imageset/Screen Shot 2021-02-13 at 11.36.47 AM.jpg b/DNSecure/Assets.xcassets/HowToActivate/SystemPreferences.imageset/Screen Shot 2021-02-13 at 11.36.47 AM.jpg new file mode 100644 index 0000000..64d177d Binary files /dev/null and b/DNSecure/Assets.xcassets/HowToActivate/SystemPreferences.imageset/Screen Shot 2021-02-13 at 11.36.47 AM.jpg differ diff --git a/DNSecure/Assets.xcassets/HowToActivate/SystemPreferencesIcon.imageset/Contents.json b/DNSecure/Assets.xcassets/HowToActivate/SystemPreferencesIcon.imageset/Contents.json new file mode 100644 index 0000000..11eb740 --- /dev/null +++ b/DNSecure/Assets.xcassets/HowToActivate/SystemPreferencesIcon.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "IMG_0250.jpg", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DNSecure/Assets.xcassets/HowToActivate/SystemPreferencesIcon.imageset/IMG_0250.jpg b/DNSecure/Assets.xcassets/HowToActivate/SystemPreferencesIcon.imageset/IMG_0250.jpg new file mode 100644 index 0000000..bb1390b Binary files /dev/null and b/DNSecure/Assets.xcassets/HowToActivate/SystemPreferencesIcon.imageset/IMG_0250.jpg differ diff --git a/DNSecure/Views/ContentView.swift b/DNSecure/Views/ContentView.swift index 391d1f3..3e832b9 100644 --- a/DNSecure/Views/ContentView.swift +++ b/DNSecure/Views/ContentView.swift @@ -194,6 +194,10 @@ extension ContentView: View { .frame(width: 10, height: 10) .foregroundColor(self.isEnabled ? .green : .secondary) Text(self.isEnabled ? "Active" : "Inactive") + #if targetEnvironment(macCatalyst) + Text("-") + Button("Refresh", action: self.updateStatus) + #endif } if !self.isEnabled { Button("How to Activate") { @@ -220,6 +224,7 @@ extension ContentView: View { .navigationBarHidden(true) } } + .onAppear(perform: self.updateStatus) .onChange(of: self.scenePhase) { phase in if phase == .active { self.updateStatus() diff --git a/DNSecure/Views/HowToActivateView.swift b/DNSecure/Views/HowToActivateView.swift index 6e87cbc..f557d1f 100644 --- a/DNSecure/Views/HowToActivateView.swift +++ b/DNSecure/Views/HowToActivateView.swift @@ -36,35 +36,77 @@ extension HowToActivateView: View { .scaledToFit() .frame(maxHeight: 200) } - VStack(alignment: .leading) { - Text("3. Open the Settings") - Image("Settings") - .resizable() - .scaledToFit() - .frame(maxHeight: 200) - } - VStack(alignment: .leading) { - Text("4. Go to \"General\" > \"VPN & Network\" > \"DNS\"") - ScrollView(.horizontal) { + #if targetEnvironment(macCatalyst) + VStack(alignment: .leading) { + Text("3. Open the System Preferences") + Image("SystemPreferencesIcon") + .resizable() + .scaledToFit() + .frame(maxHeight: 200) + } + VStack(alignment: .leading) { + Text("4. Go to Network settings") + Image("SystemPreferences") + .resizable() + .scaledToFit() + .frame(maxHeight: 400) + } + VStack(alignment: .leading) { HStack { - Image("GeneralVPNNetwork") - .resizable() - .scaledToFit() - .frame(maxHeight: 200) - Image("DNS") - .resizable() - .scaledToFit() - .frame(maxHeight: 200) + Text("5. Select \"\(Bundle.main.displayName!)\" and click") + Image(systemName: "ellipsis.circle") + Text("button") + } + Image("NetworkSettings") + .resizable() + .scaledToFit() + .frame(maxHeight: 400) + } + VStack(alignment: .leading) { + Text("6. Click \"Make Service Active\"") + Image("MakeServiceActive") + .resizable() + .scaledToFit() + .frame(maxHeight: 200) + } + VStack(alignment: .leading) { + Text("7. Click \"Apply\" button") + Image("NetworkSettingsApply") + .resizable() + .scaledToFit() + .frame(maxHeight: 400) + } + #else + VStack(alignment: .leading) { + Text("3. Open the Settings") + Image("Settings") + .resizable() + .scaledToFit() + .frame(maxHeight: 200) + } + VStack(alignment: .leading) { + Text("4. Go to \"General\" > \"VPN & Network\" > \"DNS\"") + ScrollView(.horizontal) { + HStack { + Image("GeneralVPNNetwork") + .resizable() + .scaledToFit() + .frame(maxHeight: 200) + Image("DNS") + .resizable() + .scaledToFit() + .frame(maxHeight: 200) + } } } - } - VStack(alignment: .leading) { - Text("5. \"Automatic\" is selected by default, so select \"\(Bundle.main.displayName!)\"") - Image("DNSProvider") - .resizable() - .scaledToFit() - .frame(maxHeight: 200) - } + VStack(alignment: .leading) { + Text("5. \"Automatic\" is selected by default, so select \"\(Bundle.main.displayName!)\"") + Image("DNSProvider") + .resizable() + .scaledToFit() + .frame(maxHeight: 200) + } + #endif } } if self.isSheet { diff --git a/README.md b/README.md index c724f56..507f0a3 100644 --- a/README.md +++ b/README.md @@ -3,11 +3,11 @@ Download on the App Store or [TestFlight Beta](https://testflight.apple.com/join/A8GwCnq8) -iOS/iPadOS has supported encrypted DNS (e.g. DNS-over-TLS (DoT) and DNS-over-HTTPS (DoH)) since 14.0, but the Settings app doesn't have settings for using it. To solve that, DNSecure was created. DNSecure is a configuration tool of DoT and DoH. +iOS 14+, iPadOS 14+, and macOS 11+ have supported encrypted DNS (e.g. DNS-over-TLS (DoT) and DNS-over-HTTPS (DoH)), but they don't have a native UI for enabling it. To solve that, DNSecure was created. DNSecure is a configuration tool of DoT and DoH. -This app uses the new [DNS Settings API](https://developer.apple.com/documentation/networkextension/dns_settings), so it requires iOS 14, iPadOS 14, or later. +This app uses the new [DNS Settings API](https://developer.apple.com/documentation/networkextension/dns_settings), so it requires iOS 14+, iPadOS 14+, or macOS 11+. -## How to use +## How to use (iOS/iPadOS) 1. Select a DNS server you like, or add another one 1. Enable "Use This Server" @@ -15,6 +15,16 @@ This app uses the new [DNS Settings API](https://developer.apple.com/documentati 1. Go to "General" > "VPN & Network" > "DNS" 1. "Automatic" is selected by default, so select "DNSecure" +## How to use (macOS) + +1. Select a DNS server you like, or add another one +1. Enable "Use This Server" +1. Open the System Preferences +1. Go to Network settings +1. Select "DNSecure" and click "..." button on the bottom +1. Click "Make Service Active" +1. Click "Apply" button + ## References - https://developer.apple.com/documentation/networkextension/dns_settings