diff --git a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/AppConfig.kt b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/AppConfig.kt index 996e3763..4151f5b8 100644 --- a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/AppConfig.kt +++ b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/AppConfig.kt @@ -15,6 +15,8 @@ object AppConfig { // Preferences mapped to MMKV const val PREF_SNIFFING_ENABLED = "pref_sniffing_enabled" + const val PREF_ROUTE_ONLY_ENABLED = "pref_route_only_enabled" + const val PREF_PER_APP_PROXY = "pref_per_app_proxy" const val PREF_PER_APP_PROXY_SET = "pref_per_app_proxy_set" const val PREF_BYPASS_APPS = "pref_bypass_apps" diff --git a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/dto/V2rayConfig.kt b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/dto/V2rayConfig.kt index 91ebb039..a7376498 100644 --- a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/dto/V2rayConfig.kt +++ b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/dto/V2rayConfig.kt @@ -60,7 +60,8 @@ data class V2rayConfig( data class SniffingBean(var enabled: Boolean, val destOverride: ArrayList, - val metadataOnly: Boolean? = null) + val metadataOnly: Boolean? = null, + var routeOnly: Boolean? = null) } data class OutboundBean(var tag: String = "proxy", diff --git a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/SettingsActivity.kt b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/SettingsActivity.kt index 691320c5..7b9e215a 100644 --- a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/SettingsActivity.kt +++ b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/SettingsActivity.kt @@ -230,6 +230,7 @@ class SettingsActivity : BaseActivity() { } listOf( + AppConfig.PREF_ROUTE_ONLY_ENABLED, AppConfig.PREF_BYPASS_APPS, AppConfig.PREF_SPEED_ENABLED, AppConfig.PREF_CONFIRM_REMOVE, diff --git a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/util/V2rayConfigUtil.kt b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/util/V2rayConfigUtil.kt index 25188a33..f4ad2da5 100644 --- a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/util/V2rayConfigUtil.kt +++ b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/util/V2rayConfigUtil.kt @@ -134,6 +134,7 @@ object V2rayConfigUtil { settingsStorage?.decodeBool(AppConfig.PREF_SNIFFING_ENABLED, true) ?: true v2rayConfig.inbounds[0].sniffing?.enabled = fakedns || sniffAllTlsAndHttp + v2rayConfig.inbounds[0].sniffing?.routeOnly = settingsStorage?.decodeBool(AppConfig.PREF_ROUTE_ONLY_ENABLED, false) if (!sniffAllTlsAndHttp) { v2rayConfig.inbounds[0].sniffing?.destOverride?.clear() } diff --git a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/viewmodel/SettingsViewModel.kt b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/viewmodel/SettingsViewModel.kt index 13e4a1ab..b13d24be 100644 --- a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/viewmodel/SettingsViewModel.kt +++ b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/viewmodel/SettingsViewModel.kt @@ -59,6 +59,7 @@ class SettingsViewModel(application: Application) : AndroidViewModel(application settingsStorage?.encode(key, sharedPreferences.getString(key, "")) } + AppConfig.PREF_ROUTE_ONLY_ENABLED, AppConfig.PREF_SPEED_ENABLED, AppConfig.PREF_PROXY_SHARING, AppConfig.PREF_LOCAL_DNS_ENABLED, diff --git a/V2rayNG/app/src/main/res/values-ar/strings.xml b/V2rayNG/app/src/main/res/values-ar/strings.xml index cb79a2af..b7e23f1e 100644 --- a/V2rayNG/app/src/main/res/values-ar/strings.xml +++ b/V2rayNG/app/src/main/res/values-ar/strings.xml @@ -125,6 +125,9 @@ عرض السرعة الحالية في الإشعار.\nسيتغير رمز الإشعار استنادًا إلى الاستخدام. تمكين Sniffing + Enable routeOnly + Use the sniffed domain name for routing only, and keep the target address as the IP address. + محاولة استخلاص النطاق من الحزمة (مشغلة افتراضيًا) تمكين DNS المحلي diff --git a/V2rayNG/app/src/main/res/values-fa/strings.xml b/V2rayNG/app/src/main/res/values-fa/strings.xml index 47179f25..892b273b 100644 --- a/V2rayNG/app/src/main/res/values-fa/strings.xml +++ b/V2rayNG/app/src/main/res/values-fa/strings.xml @@ -120,6 +120,9 @@ فعال کردن Sniffing دامنه sniff را از بسته امتحان کنید (پیش‌فرض روشن) + Enable routeOnly + Use the sniffed domain name for routing only, and keep the target address as the IP address. + فعال کردن DNS محلی DNS پردازش شده توسط ماژول DNS هسته (توصیه می‌شود، در صورت نیاز به دور زدن LAN و نشانی mainland) diff --git a/V2rayNG/app/src/main/res/values-ru/strings.xml b/V2rayNG/app/src/main/res/values-ru/strings.xml index 236d09b8..acba5867 100644 --- a/V2rayNG/app/src/main/res/values-ru/strings.xml +++ b/V2rayNG/app/src/main/res/values-ru/strings.xml @@ -123,6 +123,9 @@ Анализ пакетов Использовать анализ пакетов (по умолчанию включено) + Enable routeOnly + Use the sniffed domain name for routing only, and keep the target address as the IP address. + Использовать локальную DNS Обслуживание выполняется DNS-модулем ядра (в настройках маршрутизации рекомендуется выбрать режим «Все, кроме LAN и Китая») diff --git a/V2rayNG/app/src/main/res/values-vi/strings.xml b/V2rayNG/app/src/main/res/values-vi/strings.xml index 76a32e53..f0c10e07 100644 --- a/V2rayNG/app/src/main/res/values-vi/strings.xml +++ b/V2rayNG/app/src/main/res/values-vi/strings.xml @@ -122,6 +122,9 @@ Bật Sniffing Nhận diện tên miền từ gói tin để phục vụ định tuyến. \n(phải tắt để xài Zalo) + Enable routeOnly + Use the sniffed domain name for routing only, and keep the target address as the IP address. + Bật Local DNS DNS được xử lý bởi mô-đun DNS của xray-core (dùng nếu cần định tuyến bypass cho mạng LAN và địa chỉ nội địa) diff --git a/V2rayNG/app/src/main/res/values-zh-rCN/strings.xml b/V2rayNG/app/src/main/res/values-zh-rCN/strings.xml index c8006d91..338f900f 100644 --- a/V2rayNG/app/src/main/res/values-zh-rCN/strings.xml +++ b/V2rayNG/app/src/main/res/values-zh-rCN/strings.xml @@ -121,6 +121,8 @@ 启用流量探测 从流量中探测域名 (默认启用) + 启用 routeOnly + 将嗅探得到的域名仅用于路由,代理目标地址仍为 IP 启用本地DNS DNS 请求导入 core 由 DNS 模块处理(推荐启用 如果需要路由绕过局域网及大陆地址) diff --git a/V2rayNG/app/src/main/res/values-zh-rTW/strings.xml b/V2rayNG/app/src/main/res/values-zh-rTW/strings.xml index a6bf1ec9..d6638543 100644 --- a/V2rayNG/app/src/main/res/values-zh-rTW/strings.xml +++ b/V2rayNG/app/src/main/res/values-zh-rTW/strings.xml @@ -121,6 +121,9 @@ 啟用流量監聽 從流量中監聽網域 (預設啟用) + 啟用 routeOnly + 將嗅探得到的網域只用於路由,代理目標位址仍為 IP + 啟用本機 DNS DNS 請求匯入 core 由 DNS 模塊處理 (建議啟用,如果需要轉送略過區域網路及中國大陸) diff --git a/V2rayNG/app/src/main/res/values/strings.xml b/V2rayNG/app/src/main/res/values/strings.xml index 63659138..9a100f7d 100644 --- a/V2rayNG/app/src/main/res/values/strings.xml +++ b/V2rayNG/app/src/main/res/values/strings.xml @@ -133,6 +133,8 @@ Enable Sniffing Try sniff domain from the packet (default on) + Enable routeOnly + Use the sniffed domain name for routing only, and keep the target address as the IP address. Enable local DNS DNS processed by core‘s DNS module (Recommended, if need routing Bypassing LAN and diff --git a/V2rayNG/app/src/main/res/xml/pref_settings.xml b/V2rayNG/app/src/main/res/xml/pref_settings.xml index b1a7f5be..95399101 100644 --- a/V2rayNG/app/src/main/res/xml/pref_settings.xml +++ b/V2rayNG/app/src/main/res/xml/pref_settings.xml @@ -8,6 +8,12 @@ android:summary="@string/summary_pref_sniffing_enabled" android:title="@string/title_pref_sniffing_enabled" /> + +