Compare commits

...

51 commits

Author SHA1 Message Date
Kenta Kubo
5d7446ca80
Merge pull request #186 from kkebo/dependabot/github_actions/github/codeql-action-4.32.6
Some checks failed
ci / lint (push) Has been cancelled
ci / yamllint (push) Has been cancelled
CodeQL Advanced / Analyze (swift) (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
2026-03-09 12:13:09 +09:00
dependabot[bot]
866aa6bd90
ci: bump github/codeql-action from 4.32.4 to 4.32.6
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.32.4 to 4.32.6.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](89a39a4e59...0d579ffd05)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.32.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-09 02:55:55 +00:00
Kenta Kubo
5ab07664d3
Merge pull request #185 from kkebo/dependabot/github_actions/github/codeql-action-4.32.4
Some checks failed
ci / lint (push) Has been cancelled
ci / yamllint (push) Has been cancelled
CodeQL Advanced / Analyze (swift) (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
ci: bump github/codeql-action from 4.32.3 to 4.32.4
2026-02-23 12:25:45 +09:00
dependabot[bot]
38f3de8942
ci: bump github/codeql-action from 4.32.3 to 4.32.4
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.32.3 to 4.32.4.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](9e907b5e64...89a39a4e59)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.32.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-23 02:56:47 +00:00
Kenta Kubo
32433ed572
Merge pull request #184 from kkebo/dependabot/github_actions/github/codeql-action-4.32.3
Some checks failed
ci / lint (push) Has been cancelled
ci / yamllint (push) Has been cancelled
CodeQL Advanced / Analyze (swift) (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
2026-02-16 12:56:41 +09:00
dependabot[bot]
e28aa08cd7
ci: bump github/codeql-action from 4.32.2 to 4.32.3
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.32.2 to 4.32.3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](45cbd0c69e...9e907b5e64)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.32.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-16 02:56:21 +00:00
Kenta Kubo
57d1ac26cb
Merge pull request #182 from kkebo/dependabot/github_actions/github/codeql-action-4.32.2
Some checks failed
ci / lint (push) Has been cancelled
ci / yamllint (push) Has been cancelled
CodeQL Advanced / Analyze (swift) (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
2026-02-09 13:00:05 +09:00
dependabot[bot]
656c1cdf55
ci: bump github/codeql-action from 4.32.0 to 4.32.2
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.32.0 to 4.32.2.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](b20883b0cd...45cbd0c69e)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.32.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-09 02:56:57 +00:00
Kenta Kubo
a95157e7da
Merge pull request #179 from kkebo/dependabot/github_actions/github/codeql-action-4.32.0
Some checks failed
ci / lint (push) Has been cancelled
ci / yamllint (push) Has been cancelled
CodeQL Advanced / Analyze (swift) (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
2026-02-02 13:26:02 +09:00
dependabot[bot]
aeaa69df28
ci: bump github/codeql-action from 4.31.11 to 4.32.0
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.11 to 4.32.0.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](19b2f06db2...b20883b0cd)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.32.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-02 02:56:24 +00:00
Kenta Kubo
6bd8827961
Merge pull request #178 from kkebo/dependabot/github_actions/actions/checkout-6.0.2
Some checks failed
ci / lint (push) Has been cancelled
ci / yamllint (push) Has been cancelled
CodeQL Advanced / Analyze (swift) (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
2026-01-26 12:36:30 +09:00
dependabot[bot]
959492944b
ci: bump actions/checkout from 6.0.1 to 6.0.2
Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.1 to 6.0.2.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](8e8c483db8...de0fac2e45)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-26 03:16:17 +00:00
Kenta Kubo
27a2c48bf2
Merge pull request #177 from kkebo/dependabot/github_actions/github/codeql-action-4.31.11 2026-01-26 12:15:22 +09:00
dependabot[bot]
37a53acf0e
ci: bump github/codeql-action from 4.31.10 to 4.31.11
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.10 to 4.31.11.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](cdefb33c0f...19b2f06db2)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.31.11
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-26 02:57:41 +00:00
Kenta Kubo
0a2c6d4531
Merge pull request #176 from kkebo/dependabot/github_actions/github/codeql-action-4.31.10 2026-01-19 12:54:42 +09:00
dependabot[bot]
bcda3a46e1
ci: bump github/codeql-action from 4.31.9 to 4.31.10
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.9 to 4.31.10.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](5d4e8d1aca...cdefb33c0f)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.31.10
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-19 03:08:55 +00:00
Kenta Kubo
0c1ca9b3d8
Merge pull request #175 from kkebo/happy-new-year-2026 2026-01-08 00:20:22 +09:00
Kenta Kubo
e2c37d9417
chore: happy new year! 2026-01-04 21:36:30 +09:00
Kenta Kubo
e6af1fa26f
Merge pull request #174 from kkebo/bump-version-to-1.6.2
chore: bump version to 1.6.2
2025-12-28 21:56:54 +09:00
Kenta Kubo
7ddca0724b
chore: bump version to 1.6.2 2025-12-28 21:40:58 +09:00
Kenta Kubo
7c419fcccf
Merge pull request #173 from kkebo/show-instructions-on-iphone 2025-12-28 21:38:46 +09:00
Kenta Kubo
29adf98043
feat: revive "Instructions" row when the app is not active and its layout is a single column 2025-12-28 04:28:39 +09:00
Kenta Kubo
c8015a381d
Merge pull request #171 from kkebo/dependabot/github_actions/github/codeql-action-4.31.9 2025-12-22 13:40:30 +09:00
dependabot[bot]
07f5247e5b
ci: bump github/codeql-action from 4.31.8 to 4.31.9
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.8 to 4.31.9.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](1b168cd394...5d4e8d1aca)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.31.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-22 02:20:19 +00:00
Kenta Kubo
2c5fac8da4
Merge pull request #170 from kkebo/dependabot/github_actions/github/codeql-action-4.31.8 2025-12-15 12:51:25 +09:00
dependabot[bot]
153e51bf66
ci: bump github/codeql-action from 4.31.7 to 4.31.8
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.7 to 4.31.8.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](cf1bb45a27...1b168cd394)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.31.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-15 02:22:53 +00:00
Kenta Kubo
d0e1425f42
Merge pull request #169 from kkebo/dependabot/github_actions/actions/checkout-6.0.1 2025-12-08 13:15:16 +09:00
dependabot[bot]
b4414f4845
ci: bump actions/checkout from 6.0.0 to 6.0.1
Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.0 to 6.0.1.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v6...8e8c483db84b4bee98b60c0593521ed34d9990e8)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-08 02:23:48 +00:00
Kenta Kubo
0ea4f2743e
Merge pull request #168 from kkebo/codeql 2025-12-08 00:26:23 +09:00
Kenta Kubo
54860148b4
ci: add codeql.yml
Updated CodeQL workflow to modify build modes and action versions.
2025-12-07 23:09:38 +09:00
Kenta Kubo
65bc5ba39a
Merge pull request #167 from kkebo/refactor-package.swift
refactor: refactor Package.swift
2025-11-28 02:50:57 +09:00
Kenta Kubo
6a19c36e83
refactor: refactor Package.swift 2025-11-28 02:47:51 +09:00
Kenta Kubo
c9f1bb633a
Merge pull request #166 from kkebo/dependabot/github_actions/actions/checkout-6.0.0 2025-11-24 14:40:12 +09:00
dependabot[bot]
032ec025ac
ci: bump actions/checkout from 5.0.0 to 6.0.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 5.0.0 to 6.0.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](08c6903cd8...1af3b93b68)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-24 02:28:52 +00:00
Kenta Kubo
0bb8fdad23
Merge pull request #164 from kkebo/set-euo-pipefail 2025-10-18 03:02:38 +09:00
Kenta Kubo
b79afcfd3e
ci: set -euo pipefail 2025-10-18 02:30:27 +09:00
Kenta Kubo
e3878d4d3a
Merge pull request #162 from kkebo/bump-version-1.6.1
chore: bump version to 1.6.1
2025-10-14 18:48:10 +09:00
Kenta Kubo
f1fe1c06f8
chore: bump version to 1.6.1 2025-10-14 18:42:39 +09:00
Kenta Kubo
9fe66c693a
Merge pull request #160 from kkebo/fix-typos
fix: fix typos in log messages
2025-10-14 18:37:02 +09:00
Kenta Kubo
f41b114632 fix: fix typos in log messages 2025-10-14 18:31:36 +09:00
Kenta Kubo
e4775b3d44
Merge pull request #161 from kkebo/fix-missing-sidebar-issue
fix: fix missing sidebar issue
2025-10-14 18:31:25 +09:00
Kenta Kubo
21cb297b3b
fix: fix missing sidebar issue
fixes #158
2025-10-14 18:15:44 +09:00
Kenta Kubo
87a00a8c3e
Merge pull request #157 from kkebo/gh-actions-explicit-permissions 2025-10-12 12:10:56 +09:00
Kenta Kubo
e8426f1465
ci: restrict permissions 2025-10-11 22:18:27 +09:00
Kenta Kubo
fbc9514922
Merge pull request #151 from kkebo/sha-pinning 2025-10-01 01:41:57 +09:00
Kenta Kubo
f587bdf722
ci: pin GitHub Actions dependencies to commit SHA
This is a defense against supply chain attacks. Moreover, GitHub
[recommends SHA
pinning](https://github.blog/changelog/2025-08-15-github-actions-policy-now-supports-blocking-and-sha-pinning-actions/) these days. Even with this change, dependabot should continue to function.
2025-10-01 00:59:08 +09:00
Kenta Kubo
92090b4fcd
Merge pull request #150 from kkebo/update-swift-format 2025-09-19 01:22:12 +09:00
Kenta Kubo
e102e47f50 ci: bump Swift to 6.2 2025-09-19 00:53:54 +09:00
Kenta Kubo
08101f9766 chore: update .swift-format to match the default in Swift 6.2 2025-09-19 00:53:54 +09:00
Kenta Kubo
e5c25ad31d
Merge pull request #149 from kkebo/127-deactivate-on-editing
fix: deactivate the active server when it's modified
2025-09-08 23:10:23 +09:00
Kenta Kubo
87c6069581
fix: deactivate the active server when it's modified
fixes #127
2025-09-08 23:02:58 +09:00
8 changed files with 128 additions and 46 deletions

View file

@ -4,16 +4,24 @@ on:
branches: ["main"]
pull_request:
branches: ["main"]
permissions: {}
defaults:
run:
shell: bash -euo pipefail {0}
jobs:
lint:
runs-on: ubuntu-24.04-arm
container: swift:6.1
container: swift:6.2
permissions:
contents: read
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- run: swift format lint -rsp .
yamllint:
runs-on: ubuntu-24.04-arm
permissions:
contents: read
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- run: yamllint --version
- run: yamllint --strict --config-file .yamllint.yml .

89
.github/workflows/codeql.yml vendored Normal file
View file

@ -0,0 +1,89 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL Advanced"
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
schedule:
- cron: '40 19 * * 3'
jobs:
analyze:
name: Analyze (${{ matrix.language }})
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
permissions:
# required for all workflows
security-events: write
# required to fetch internal or private CodeQL packs
packages: read
# only required for workflows in private repositories
actions: read
contents: read
strategy:
fail-fast: false
matrix:
include:
- language: actions
build-mode: none
- language: swift
build-mode: manual
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
# Add any setup steps before running the `github/codeql-action/init` action.
# This includes steps like installing compilers or runtimes (`actions/setup-node`
# or others). This is typically only required for manual builds.
# - name: Setup runtime (example)
# uses: actions/setup-example@v1
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@0d579ffd059c29b07949a3cce3983f0780820c98 # v4.32.6
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- name: Run manual build steps
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
if: matrix.build-mode == 'manual'
shell: bash
env:
DEVELOPER_DIR: /Applications/Xcode_26.1.1.app
run: xcodebuild build -project DNSecure.xcodeproj -scheme DNSecure -destination "platform=iOS Simulator,name=iPad Pro 13-inch (M5),OS=26.1" -quiet -showBuildTimingSummary
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@0d579ffd059c29b07949a3cce3983f0780820c98 # v4.32.6
with:
category: "/language:${{matrix.language}}"

View file

@ -21,11 +21,7 @@
]
},
"prioritizeKeepingFunctionOutputTogether" : true,
"reflowMultilineStringLiterals" : {
"never" : {
}
},
"reflowMultilineStringLiterals" : "never",
"respectsExistingLineBreaks" : true,
"rules" : {
"AllPublicDeclarationsHaveDocumentation" : false,

View file

@ -442,7 +442,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.6.0;
MARKETING_VERSION = 1.6.2;
PRODUCT_BUNDLE_IDENTIFIER = xyz.kebo.DNSecure;
PRODUCT_NAME = "$(TARGET_NAME)";
STRING_CATALOG_GENERATE_SYMBOLS = YES;
@ -480,7 +480,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.6.0;
MARKETING_VERSION = 1.6.2;
PRODUCT_BUNDLE_IDENTIFIER = xyz.kebo.DNSecure;
PRODUCT_NAME = "$(TARGET_NAME)";
STRING_CATALOG_GENERATE_SYMBOLS = YES;

View file

@ -9,7 +9,6 @@
import SwiftUI
struct ContentView {
@Environment(\.scenePhase) private var scenePhase
@Environment(\.horizontalSizeClass) private var hSizeClass
@Binding var servers: Resolvers
@Binding var usedID: String?
@ -126,7 +125,7 @@ struct ContentView {
self.removeSettings()
return
}
logger.debug("DNS settings was saved")
logger.debug("The DNS settings were saved")
}
#endif
}
@ -152,7 +151,7 @@ struct ContentView {
self.alert("Remove Error", removeError.localizedDescription)
return
}
logger.debug("DNS settings was removed")
logger.debug("The DNS settings were removed")
}
#endif
}
@ -181,6 +180,9 @@ extension ContentView: View {
private var modernBody: some View {
NavigationSplitView {
List(selection: self.$selection) {
if !self.isActivated && self.hSizeClass == .compact {
NavigationLink("Instructions", value: -1)
}
Section("Servers") {
ForEach(0..<self.servers.count, id: \.self) { i in
NavigationLink(value: i) {
@ -222,12 +224,12 @@ extension ContentView: View {
// Workaround for https://github.com/kkebo/DNSecure/issues/139
.environment(\.editMode, self.$detailEditMode)
#endif
} else if !self.isActivated {
} else if !self.isActivated || self.selection == -1 {
HowToActivateView()
.navigationBarTitleDisplayMode(self.navigationBarTitleDisplayMode)
} else {
Text("Select a server on the sidebar")
.navigationBarHidden(true)
.navigationBarTitleDisplayMode(self.navigationBarTitleDisplayMode)
}
}
.onAppear(perform: self.updateStatus)
@ -239,25 +241,21 @@ extension ContentView: View {
self.updateStatus()
}
}
.onChange(of: self.scenePhase) { phase in
if phase == .background {
// FIXME: This is a workaround for self.$severs[i].
// That cannot save settings as soon as it is modified.
guard let id = self.usedID,
let uuid = UUID(uuidString: id),
let server = self.servers.find(by: uuid)
else {
return
}
self.saveSettings(of: server)
}
}
}
@available(iOS, deprecated: 16)
private var legacyBody: some View {
NavigationView {
List {
if !self.isActivated && self.hSizeClass == .compact {
NavigationLink(
"Instructions",
tag: -1,
selection: self.$selection
) {
HowToActivateView()
}
}
Section("Servers") {
ForEach(0..<self.servers.count, id: \.self) { i in
if self.hSizeClass == .compact {
@ -291,11 +289,10 @@ extension ContentView: View {
if let i = self.selection, i >= 0 {
self.detailView(at: i)
} else if !self.isActivated {
} else if !self.isActivated || self.selection == -1 {
HowToActivateView()
} else {
Text("Select a server on the sidebar")
.navigationBarHidden(true)
}
}
.onAppear(perform: self.updateStatus)
@ -307,19 +304,6 @@ extension ContentView: View {
self.updateStatus()
}
}
.onChange(of: self.scenePhase) { phase in
if phase == .background {
// FIXME: This is a workaround for self.$severs[i].
// That cannot save settings as soon as it is modified.
guard let id = self.usedID,
let uuid = UUID(uuidString: id),
let server = self.servers.find(by: uuid)
else {
return
}
self.saveSettings(of: server)
}
}
}
@ToolbarContentBuilder private var toolbarContent: some ToolbarContent {

View file

@ -85,6 +85,11 @@ extension DetailView: View {
}
}
.navigationTitle(self.server.name)
.onChange(of: self.server) { [oldValue = self.server] newValue in
guard self.isSelected, oldValue.id == newValue.id else { return }
// When the selected server's configuration is modified, the server will be deactivated or deselected so that the user can save the changes by toggling the Use This Server switch again.
self.isSelected = false
}
}
@ViewBuilder private var serverConfigurationSections: some View {

View file

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2020-2025 Kenta Kubo
Copyright (c) 2020-2026 Kenta Kubo
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View file

@ -18,7 +18,7 @@ let package = Package(
targets: ["DNSecure"],
bundleIdentifier: "xyz.kebo.DNSecure",
teamIdentifier: "X4678G5DL2",
displayVersion: "1.6.0",
displayVersion: "1.6.2",
bundleVersion: "1",
appIcon: .asset("AppIcon-legacy"),
accentColor: .asset("AccentColor"),
@ -43,7 +43,7 @@ let package = Package(
.testTarget(
name: "DNSecureTests",
dependencies: [
"DNSecure"
.target(name: "DNSecure")
],
path: "DNSecureTests"
),