Add the guide that describes how to activate DNSecure

Fixes #1
This commit is contained in:
Kenta Kubo 2020-09-27 20:23:29 +09:00
parent bdfb6b373b
commit 59496f5e21
16 changed files with 238 additions and 2 deletions

View file

@ -18,6 +18,7 @@
8940026924ACBE4900EBE74B /* NetworkExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8940026824ACBE4900EBE74B /* NetworkExtension.framework */; };
8963FDFB251DF1BC00E3DFE7 /* BundleExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8963FDFA251DF1BC00E3DFE7 /* BundleExtensions.swift */; };
8986CDCF251D9B3400D947CD /* Resolver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8986CDCE251D9B3400D947CD /* Resolver.swift */; };
89CB922125209DD100B6983C /* HowToActivateView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89CB922025209DD100B6983C /* HowToActivateView.swift */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@ -57,6 +58,7 @@
8940026824ACBE4900EBE74B /* NetworkExtension.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NetworkExtension.framework; path = System/Library/Frameworks/NetworkExtension.framework; sourceTree = SDKROOT; };
8963FDFA251DF1BC00E3DFE7 /* BundleExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BundleExtensions.swift; sourceTree = "<group>"; };
8986CDCE251D9B3400D947CD /* Resolver.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Resolver.swift; sourceTree = "<group>"; };
89CB922025209DD100B6983C /* HowToActivateView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HowToActivateView.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -113,6 +115,7 @@
8940026624ACBE4900EBE74B /* DNSecure.entitlements */,
8940023B24ACBD2700EBE74B /* DNSecureApp.swift */,
8940023D24ACBD2700EBE74B /* ContentView.swift */,
89CB922025209DD100B6983C /* HowToActivateView.swift */,
8963FDFA251DF1BC00E3DFE7 /* BundleExtensions.swift */,
890B80DE251DC6B50046BAA0 /* Presets.swift */,
890B80D4251DC3A20046BAA0 /* DetailView.swift */,
@ -288,6 +291,7 @@
buildActionMask = 2147483647;
files = (
8986CDCF251D9B3400D947CD /* Resolver.swift in Sources */,
89CB922125209DD100B6983C /* HowToActivateView.swift in Sources */,
890B80D5251DC3A20046BAA0 /* DetailView.swift in Sources */,
8940023E24ACBD2700EBE74B /* ContentView.swift in Sources */,
890B80DF251DC6B50046BAA0 /* Presets.swift in Sources */,

View file

@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

View file

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "IMG_0259.jpg",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

View file

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "IMG_0261.jpg",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

View file

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "IMG_0257.jpg",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 573 KiB

View file

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "IMG_0256.jpg",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

View file

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "IMG_0262.jpg",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View file

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "IMG_0255.jpg",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

View file

@ -16,6 +16,7 @@ struct ContentView {
@State var alertIsPresented = false
@State var alertTitle = ""
@State var alertMessage = ""
@State var guideIsPresented = false
func addNewDoTServer() {
self.servers.append(
@ -155,11 +156,16 @@ extension ContentView: View {
.foregroundColor(self.isEnabled ? .green : .secondary)
Text(self.isEnabled ? "Active" : "Inactive")
}
.onAppear(perform: self.updateStatus)
if !self.isEnabled {
Link("Activate", destination: URL(string: "App-prefs:root=General&path=Network/VPN")!)
Button("How to Activate") {
self.guideIsPresented = true
}
.sheet(isPresented: self.$guideIsPresented) {
HowToActivateView(isSheet: true)
}
}
}
.onAppear(perform: self.updateStatus)
}
}
.alert(isPresented: self.$alertIsPresented) {
@ -168,6 +174,8 @@ extension ContentView: View {
message: Text(self.alertMessage)
)
}
HowToActivateView(isSheet: false)
}
}
}

View file

@ -0,0 +1,92 @@
//
// HowToActivateView.swift
// DNSecure
//
// Created by Kenta Kubo on 9/27/20.
//
import SwiftUI
struct HowToActivateView {
@Environment(\.presentationMode) var presentationMode
@State var isSheet: Bool
}
extension HowToActivateView: View {
var body: some View {
VStack {
if self.isSheet {
Text("How to Activate")
.font(.title)
Spacer()
}
ScrollView {
VStack(alignment: .leading) {
VStack(alignment: .leading) {
Text("1. Select a DNS server you like, or add another one")
Image("SelectServer")
.resizable()
.scaledToFit()
.frame(maxHeight: 200)
}
VStack(alignment: .leading) {
Text("2. Enable \"Use This Server\"")
Image("UseThisServer")
.resizable()
.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) {
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)
}
}
}
if self.isSheet {
Spacer()
Button {
self.presentationMode.wrappedValue.dismiss()
} label: {
Text("Dismiss")
.padding()
.foregroundColor(.white)
.background(Color.blue)
.cornerRadius(10)
}
}
}
.padding()
.navigationTitle("How to Activate")
}
}
struct HowToActivateView_Previews: PreviewProvider {
static var previews: some View {
HowToActivateView(isSheet: true)
}
}