Compare commits

..

No commits in common. "main" and "1.6.0-beta.1" have entirely different histories.

8 changed files with 46 additions and 128 deletions

View file

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

View file

@ -1,89 +0,0 @@
# 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,7 +21,11 @@
] ]
}, },
"prioritizeKeepingFunctionOutputTogether" : true, "prioritizeKeepingFunctionOutputTogether" : true,
"reflowMultilineStringLiterals" : "never", "reflowMultilineStringLiterals" : {
"never" : {
}
},
"respectsExistingLineBreaks" : true, "respectsExistingLineBreaks" : true,
"rules" : { "rules" : {
"AllPublicDeclarationsHaveDocumentation" : false, "AllPublicDeclarationsHaveDocumentation" : false,

View file

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

View file

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

View file

@ -85,11 +85,6 @@ extension DetailView: View {
} }
} }
.navigationTitle(self.server.name) .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 { @ViewBuilder private var serverConfigurationSections: some View {

View file

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

View file

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