From e1930528b94b5ddf379359b2168a2f4e599541cf Mon Sep 17 00:00:00 2001 From: riolurs Date: Wed, 1 Nov 2023 21:13:33 +0800 Subject: [PATCH] fix: find process mode override --- .../clash/core/model/ConfigurationOverride.kt | 15 +++++++++++-- .../clash/design/MetaFeatureSettingsDesign.kt | 22 ++++++++++++++----- design/src/main/res/values-ja-rJP/strings.xml | 5 ++++- design/src/main/res/values-ko-rKR/strings.xml | 5 ++++- design/src/main/res/values-ru/strings.xml | 5 ++++- design/src/main/res/values-zh-rHK/strings.xml | 5 ++++- design/src/main/res/values-zh-rTW/strings.xml | 5 ++++- design/src/main/res/values-zh/strings.xml | 5 ++++- design/src/main/res/values/strings.xml | 6 ++++- 9 files changed, 59 insertions(+), 14 deletions(-) diff --git a/core/src/main/java/com/github/kr328/clash/core/model/ConfigurationOverride.kt b/core/src/main/java/com/github/kr328/clash/core/model/ConfigurationOverride.kt index 8961065e2..9fe4f2c63 100644 --- a/core/src/main/java/com/github/kr328/clash/core/model/ConfigurationOverride.kt +++ b/core/src/main/java/com/github/kr328/clash/core/model/ConfigurationOverride.kt @@ -53,8 +53,8 @@ data class ConfigurationOverride( @SerialName("tcp-concurrent") var tcpConcurrent: Boolean? = null, - @SerialName("enable-process") - var enableProcess: Boolean? = null, + @SerialName("find-process-mode") + var findProcessMode: FindProcessMode? = null, @SerialName("dns") val dns: Dns = Dns(), @@ -128,6 +128,17 @@ data class ConfigurationOverride( var appendSystemDns: Boolean? = null ) + @Serializable + enum class FindProcessMode { + @SerialName("off") + Off, + + @SerialName("strict") + Strict, + + @SerialName("always") + Always, + } @Serializable enum class DnsEnhancedMode { @SerialName("normal") diff --git a/design/src/main/java/com/github/kr328/clash/design/MetaFeatureSettingsDesign.kt b/design/src/main/java/com/github/kr328/clash/design/MetaFeatureSettingsDesign.kt index 099bf9a2a..87f675fd1 100644 --- a/design/src/main/java/com/github/kr328/clash/design/MetaFeatureSettingsDesign.kt +++ b/design/src/main/java/com/github/kr328/clash/design/MetaFeatureSettingsDesign.kt @@ -87,11 +87,23 @@ class MetaFeatureSettingsDesign( ) selectableList( - value = configuration::enableProcess, - values = booleanValues, - valuesText = booleanValuesText, - title = R.string.enable_process, - ) + value = configuration::findProcessMode, + values = arrayOf( + null, + ConfigurationOverride.FindProcessMode.Off, + ConfigurationOverride.FindProcessMode.Strict, + ConfigurationOverride.FindProcessMode.Always + ), + valuesText = arrayOf( + R.string.dont_modify, + R.string.off, + R.string.strict, + R.string.always, + ), + title = R.string.find_process_mode, + ) { + + } category(R.string.dns) diff --git a/design/src/main/res/values-ja-rJP/strings.xml b/design/src/main/res/values-ja-rJP/strings.xml index b3c384a67..f5c6735f4 100644 --- a/design/src/main/res/values-ja-rJP/strings.xml +++ b/design/src/main/res/values-ja-rJP/strings.xml @@ -148,6 +148,9 @@ 強制的に有効 Real-IPをドメインマッピング Fake-IPをドメインマッピング + OFF + Strict + Always システムアプリ フィルタ パッケージ名 @@ -220,7 +223,7 @@ Unified Delay Geodata Mode TCP Concurrent - Enable Process + Find Process Mode Sniffer Setting Sniffer Sniffer Mode diff --git a/design/src/main/res/values-ko-rKR/strings.xml b/design/src/main/res/values-ko-rKR/strings.xml index 036f01ea3..04756bf3f 100644 --- a/design/src/main/res/values-ko-rKR/strings.xml +++ b/design/src/main/res/values-ko-rKR/strings.xml @@ -148,6 +148,9 @@ 강제 활성화 Real-IP - 도메인 매핑 Fake-IP - 도메인 매핑 + 강제 종료 + 구성 설정에 따름 + 강제로 켜기 시스템 앱 필터 패키지 이름 @@ -220,7 +223,7 @@ Unified Delay Geodata 모드 TCP Concorrent - 프로세스 실행 + 프로세스 모드 찾기 Sniffer 설정 Sniffer Sniffer 모드 diff --git a/design/src/main/res/values-ru/strings.xml b/design/src/main/res/values-ru/strings.xml index 6535a3386..1c0051b03 100644 --- a/design/src/main/res/values-ru/strings.xml +++ b/design/src/main/res/values-ru/strings.xml @@ -180,6 +180,9 @@ Сопоставление реальных IP доменам Сопоставление подставных IP доменам + Принудительно закрыть + Следовать настройкам конфигурации + Принудительно включить Системные приложения Фильтр @@ -280,7 +283,7 @@ Унифицированная задержка Режим геоданных Многопоточный TCP - Использовать процессы в правилах + Найти режим процесса Настройки перехвата доменов Перехват доменов diff --git a/design/src/main/res/values-zh-rHK/strings.xml b/design/src/main/res/values-zh-rHK/strings.xml index 2940af654..cedc12aed 100644 --- a/design/src/main/res/values-zh-rHK/strings.xml +++ b/design/src/main/res/values-zh-rHK/strings.xml @@ -131,6 +131,9 @@ 使用內置 Real-IP 至 域名映射 Fake-IP 至 域名映射 + 強制關閉 + 跟隨配置設定 + 強制開啟 排序 佈局 單列 @@ -216,7 +219,7 @@ Unified Delay Geodata Mode TCP Concurrent - Enable Process + Find Process Mode Sniffer Setting Sniffer Sniffer Mode diff --git a/design/src/main/res/values-zh-rTW/strings.xml b/design/src/main/res/values-zh-rTW/strings.xml index 3980aad02..e33880994 100644 --- a/design/src/main/res/values-zh-rTW/strings.xml +++ b/design/src/main/res/values-zh-rTW/strings.xml @@ -131,6 +131,9 @@ 使用內建 Real-IP 至域名映射 Fake-IP 至域名映射 + 強制關閉 + 跟隨配置設定 + 強制開啟 排序 佈局 單欄 @@ -216,7 +219,7 @@ Unified Delay Geodata Mode TCP Concurrent - Enable Process + Find Process Mode Sniffer Setting Sniffer Sniffer Mode diff --git a/design/src/main/res/values-zh/strings.xml b/design/src/main/res/values-zh/strings.xml index 9d17afcf1..186d414f4 100644 --- a/design/src/main/res/values-zh/strings.xml +++ b/design/src/main/res/values-zh/strings.xml @@ -132,6 +132,9 @@ 使用内置 Real-IP 至 域名映射 Fake-IP 至 域名映射 + OFF + Strict + Always 排序 布局 单列 @@ -219,7 +222,7 @@ Unified Delay Geodata Mode TCP Concurrent - Enable Process + Find Process Mode Sniffer Setting Sniffer Sniffer Mode diff --git a/design/src/main/res/values/strings.xml b/design/src/main/res/values/strings.xml index ec0c98191..90bc23417 100644 --- a/design/src/main/res/values/strings.xml +++ b/design/src/main/res/values/strings.xml @@ -181,6 +181,10 @@ Real-IP to domain mapping Fake-IP to domain mapping + OFF + Strict + Always + System Apps Filter Package Name @@ -280,7 +284,7 @@ Unified Delay Geodata Mode TCP Concurrent - Enable Process + Find Process Mode Sniffer Setting Sniffer