diff --git a/.gitignore b/.gitignore index 511b34c53..2db99cd82 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ build/ local.properties /app/libs/ /app/src/main/assets/v2ray +/app/src/main/assets/sing-box /service_account_credentials.json jniLibs/ /library/libcore_build/ diff --git a/app/src/main/java/io/nekohasekai/sagernet/Constants.kt b/app/src/main/java/io/nekohasekai/sagernet/Constants.kt index 7ba0eb583..20247fa7d 100644 --- a/app/src/main/java/io/nekohasekai/sagernet/Constants.kt +++ b/app/src/main/java/io/nekohasekai/sagernet/Constants.kt @@ -54,7 +54,7 @@ object Key { const val RESOLVE_DESTINATION = "resolveDestination" const val BYPASS_LAN = "bypassLan" - const val BYPASS_LAN_IN_CORE_ONLY = "bypassLanInCoreOnly" + const val BYPASS_LAN_IN_CORE = "bypassLanInCore" const val SOCKS_PORT = "socksPort" const val ALLOW_ACCESS = "allowAccess" diff --git a/app/src/main/java/io/nekohasekai/sagernet/bg/VpnService.kt b/app/src/main/java/io/nekohasekai/sagernet/bg/VpnService.kt index 99f00cb59..d0e8e9f69 100644 --- a/app/src/main/java/io/nekohasekai/sagernet/bg/VpnService.kt +++ b/app/src/main/java/io/nekohasekai/sagernet/bg/VpnService.kt @@ -182,7 +182,7 @@ class VpnService : BaseVpnService(), builder.addAddress(PRIVATE_VLAN6_CLIENT, 126) } - if (DataStore.bypassLan && !DataStore.bypassLanInCoreOnly) { + if (DataStore.bypassLan) { resources.getStringArray(R.array.bypass_private_route).forEach { val subnet = Subnet.fromString(it)!! builder.addRoute(subnet.address.hostAddress!!, subnet.prefixSize) diff --git a/app/src/main/java/io/nekohasekai/sagernet/database/DataStore.kt b/app/src/main/java/io/nekohasekai/sagernet/database/DataStore.kt index e908cb765..181a42686 100644 --- a/app/src/main/java/io/nekohasekai/sagernet/database/DataStore.kt +++ b/app/src/main/java/io/nekohasekai/sagernet/database/DataStore.kt @@ -112,7 +112,7 @@ object DataStore : OnPreferenceDataStoreChangeListener { var mtu by configurationStore.stringToInt(Key.MTU) { 9000 } var bypassLan by configurationStore.boolean(Key.BYPASS_LAN) - var bypassLanInCoreOnly by configurationStore.boolean(Key.BYPASS_LAN_IN_CORE_ONLY) + var bypassLanInCore by configurationStore.boolean(Key.BYPASS_LAN_IN_CORE) var allowAccess by configurationStore.boolean(Key.ALLOW_ACCESS) var speedInterval by configurationStore.stringToInt(Key.SPEED_INTERVAL) diff --git a/app/src/main/java/io/nekohasekai/sagernet/fmt/ConfigBuilder.kt b/app/src/main/java/io/nekohasekai/sagernet/fmt/ConfigBuilder.kt index 4c52f46f1..1e23830ea 100644 --- a/app/src/main/java/io/nekohasekai/sagernet/fmt/ConfigBuilder.kt +++ b/app/src/main/java/io/nekohasekai/sagernet/fmt/ConfigBuilder.kt @@ -313,7 +313,7 @@ fun buildV2RayConfig( rules.addAll(wsRules.values) - if (!forTest && DataStore.bypassLan && (requireHttp || DataStore.bypassLanInCoreOnly)) { + if (!forTest && (requireHttp || DataStore.bypassLanInCore)) { rules.add(RoutingObject.RuleObject().apply { type = "field" outboundTag = TAG_BYPASS diff --git a/app/src/main/java/io/nekohasekai/sagernet/fmt/hysteria/HysteriaBean.java b/app/src/main/java/io/nekohasekai/sagernet/fmt/hysteria/HysteriaBean.java index b32557f8d..3da6b84e0 100644 --- a/app/src/main/java/io/nekohasekai/sagernet/fmt/hysteria/HysteriaBean.java +++ b/app/src/main/java/io/nekohasekai/sagernet/fmt/hysteria/HysteriaBean.java @@ -153,6 +153,11 @@ public String displayAddress() { return super.displayAddress(); } + @Override + public boolean canTCPing() { + return false; + } + @NotNull @Override public HysteriaBean clone() { diff --git a/app/src/main/java/io/nekohasekai/sagernet/fmt/tuic/TuicBean.java b/app/src/main/java/io/nekohasekai/sagernet/fmt/tuic/TuicBean.java index 63a15d5a6..1213c2a62 100644 --- a/app/src/main/java/io/nekohasekai/sagernet/fmt/tuic/TuicBean.java +++ b/app/src/main/java/io/nekohasekai/sagernet/fmt/tuic/TuicBean.java @@ -94,6 +94,11 @@ public void deserialize(ByteBufferInput input) { } } + @Override + public boolean canTCPing() { + return false; + } + @NotNull @Override public TuicBean clone() { diff --git a/app/src/main/java/io/nekohasekai/sagernet/fmt/wireguard/WireGuardBean.java b/app/src/main/java/io/nekohasekai/sagernet/fmt/wireguard/WireGuardBean.java index 4f09a47ff..2036e7e67 100644 --- a/app/src/main/java/io/nekohasekai/sagernet/fmt/wireguard/WireGuardBean.java +++ b/app/src/main/java/io/nekohasekai/sagernet/fmt/wireguard/WireGuardBean.java @@ -71,6 +71,11 @@ public void deserialize(ByteBufferInput input) { } } + @Override + public boolean canTCPing() { + return false; + } + @NotNull @Override public WireGuardBean clone() { diff --git a/app/src/main/java/io/nekohasekai/sagernet/ui/SettingsPreferenceFragment.kt b/app/src/main/java/io/nekohasekai/sagernet/ui/SettingsPreferenceFragment.kt index 635639842..2e32ddd29 100644 --- a/app/src/main/java/io/nekohasekai/sagernet/ui/SettingsPreferenceFragment.kt +++ b/app/src/main/java/io/nekohasekai/sagernet/ui/SettingsPreferenceFragment.kt @@ -135,14 +135,7 @@ class SettingsPreferenceFragment : PreferenceFragmentCompat() { val tcpKeepAliveInterval = findPreference(Key.TCP_KEEP_ALIVE_INTERVAL)!! val bypassLan = findPreference(Key.BYPASS_LAN)!! - val bypassLanInCoreOnly = findPreference(Key.BYPASS_LAN_IN_CORE_ONLY)!! - - bypassLanInCoreOnly.isEnabled = bypassLan.isChecked - bypassLan.setOnPreferenceChangeListener { _, newValue -> - bypassLanInCoreOnly.isEnabled = newValue as Boolean - needReload() - true - } + val bypassLanInCore = findPreference(Key.BYPASS_LAN_IN_CORE)!! val remoteDns = findPreference(Key.REMOTE_DNS)!! val directDns = findPreference(Key.DIRECT_DNS)!! @@ -268,7 +261,8 @@ class SettingsPreferenceFragment : PreferenceFragmentCompat() { trafficSniffing.onPreferenceChangeListener = reloadListener muxConcurrency.onPreferenceChangeListener = reloadListener tcpKeepAliveInterval.onPreferenceChangeListener = reloadListener - bypassLanInCoreOnly.onPreferenceChangeListener = reloadListener + bypassLan.onPreferenceChangeListener = reloadListener + bypassLanInCore.onPreferenceChangeListener = reloadListener mtu.onPreferenceChangeListener = reloadListener remoteDns.onPreferenceChangeListener = reloadListener diff --git a/app/src/main/res/menu/main_drawer_menu.xml b/app/src/main/res/menu/main_drawer_menu.xml index 28c702d81..32c4a6c6c 100644 --- a/app/src/main/res/menu/main_drawer_menu.xml +++ b/app/src/main/res/menu/main_drawer_menu.xml @@ -45,8 +45,8 @@ android:checkableBehavior="single"> + android:icon="@drawable/ic_social_share" + android:title="@string/ads" /> أساسي Trojan مزود إعدادات البروتوكول - إذا لم يعمل Lineage\'s السماح لعملاء نقطة الاتصال باستخدام شبكات VPN، فجرّب ذلك. - تجاوز LAN في النواة فقط سيتم استخدام بروکسی HTTP مباشرة من (المتصفح/ بعض التطبيقات المدعومة)، دون المرور عبر جهاز NIC الافتراضي (Android 10+) إلحاق بروکسی HTTP ب VPN نفذ الوقت diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 6c9ca4c88..6de940d89 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -330,10 +330,8 @@ Inalcanzable Se acabó el tiempo Añadir proxy HTTP a la VPN - El proxy HTTP se utilizará directamente desde (navegador/algunas aplicaciones compatibles), sin pasar por el dispositivo NIC virtual (Android 10+) - Omitir LAN solo en núcleo - Si la opción "Permitir que los clientes de hotspot usen VPN" de Lineage no funciona, intente esto. - Ajustes de protocolo + El proxy HTTP se utilizará directamente desde (navegador/algunas aplicaciones compatibles), sin pasar por el dispositivo NIC virtual (Android 10+) + Ajustes de protocolo Proveedor Trojan Básico Ajustes de grupo diff --git a/app/src/main/res/values-fa/strings.xml b/app/src/main/res/values-fa/strings.xml index 9df528274..6ab18366f 100644 --- a/app/src/main/res/values-fa/strings.xml +++ b/app/src/main/res/values-fa/strings.xml @@ -311,8 +311,6 @@ تایم اوت پروکسی HTTP را به VPN اضافه کنید پروکسی HTTP مستقیماً از (مرورگر/برخی برنامه‌های پشتیبانی‌شده) بدون استفاده از دستگاه NIC مجازی (Android 10+) استفاده می‌شود. - دور زدن LAN در Core - اگر Lineage \"اجازه دادن به سرویس گیرندگان هات اسپات برای استفاده از VPN\" کار نمی کند، این را امتحان کنید. تنظیمات پروتکل ارائه دهنده تروجان پایه ای diff --git a/app/src/main/res/values-nb-rNO/strings.xml b/app/src/main/res/values-nb-rNO/strings.xml index 21bde2b8d..52eb85a3b 100644 --- a/app/src/main/res/values-nb-rNO/strings.xml +++ b/app/src/main/res/values-nb-rNO/strings.xml @@ -146,8 +146,6 @@ Grunnleggende Trojansk leverandør Protokollinnstillinger - Hvis Lineage\'s Tillat hotspot -klienter å bruke VPN -er ikke fungerer, kan du prøve dette. - Omgå LAN i Core bare HTTP -proxy brukes direkte fra (nettleser/ noen støttede apper), uten å gå gjennom den virtuelle NIC -enheten (Android 10+) Legg til HTTP -proxy til VPN Uoppnåelig diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 699480672..987fd2d5c 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -161,8 +161,6 @@ Базовый Провайдер Trojan Настройки протокола - Если в LineageOS не работает функция \"Разрешить клиентам точки доступа использовать VPN\", попробуйте включить эту настройку. - Обход LAN только в ядре HTTP-прокси будет использоваться напрямую из (браузера / некоторых поддерживаемых приложений), без использования виртуального сетевого интерфейса (Android 10+) Добавить HTTP-прокси к VPN Тайм-аут diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index 03e7c1284..bb2579291 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -148,8 +148,6 @@ QUIC Akış Alım Penceresi Duplex sonlandırma sinyalini VMess kullanırken TCP bağlantısı için yollama. Bu bazı uygulamaları bozacaktır. Güncelleme yaparken bütün alan adlarının IP adreslerini çöz. Mümkünse sunucu ve SNI otomatik olarak eklenir - Eğer Lineage\'in Hotspot istemcilerinin VPN kullanmasına izin ver özelliği çalışmıyorsa bunu deneyin. - Yerel Ağı Sadece Çekirdekte Atlat Yapılandırma kartının üzerinde her zaman sunucu adresini göster Dengeleyici gözlem aralığı Qv2ray Geliştirici Topluluğu Tarafından Sağlanmıştır diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 5daaae811..b0ea68d51 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -296,8 +296,6 @@ 追加 HTTP 代理至 VPN 浏览器 / 一些支持的应用 将直接使用 HTTP 代理, 而不经过虚拟网卡设备 (Android 10+) ICMPing 不可用 - 仅在 Core 中绕过局域网 - 如果 Lineage 之 \"允许热点客户端使用 VPN\" 无法使用, 尝试启用此项. 协议设置 Trojan 提供程序 基本 @@ -469,6 +467,7 @@ 这是 GFWReport 针对 GFW 上观察到的类似随机流的协议阻塞行为提出的对策。 这个选项将 IV 的前 6 个字节重新映射为可打印的字符,启用后,特权网络路径上的任何人都有可能识别该协议。 首选插件提供者 创建快捷方式 + 订阅最低 TLS 版本 端口跳跃间隔(秒) DNS 查询类型 禁用 SNI @@ -478,4 +477,8 @@ 拥塞控制 UDP 转发模式 令牌 + 像 SagerNet 一样显示底栏 + uTLS 指纹 + 在核心中绕过 LAN + 推广 \ No newline at end of file diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index a7b7c7b86..2d759470a 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -301,8 +301,6 @@ 逾時 為 VPN 附加 HTTP 代理 HTTP 代理將直接被支援的瀏覽器/應用程式使用,而無需經過虛擬網路卡(Android 10+) - 僅在 Core 中繞過區域網路 - 如果 LineageOS 的“允許熱點客戶端使用此裝置的 VPN”無法使用,嘗試啟用此選項。 Trojan 提供程式 協議設定 基本 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 3fc92052d..86ded7079 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -334,8 +334,6 @@ Timeout Append HTTP Proxy to VPN HTTP proxy will be used directly from (browser/ some supported apps), without going through the virtual NIC device (Android 10+) - Bypass LAN in Core Only - If Lineage\'s "Allow hotspot clients to use VPNs" does not work, try this. Protocol Settings Trojan Provider Basic @@ -521,5 +519,7 @@ Anyone can write advanced plugins, which can control Matsuri. please download an DNS query type Show bottom bar like SagerNet uTLS fingerprint + Bypass LAN in Core + Ads \ No newline at end of file diff --git a/app/src/main/res/xml/global_preferences.xml b/app/src/main/res/xml/global_preferences.xml index e0fd2b402..6d989bfaf 100644 --- a/app/src/main/res/xml/global_preferences.xml +++ b/app/src/main/res/xml/global_preferences.xml @@ -86,9 +86,8 @@ app:key="bypassLan" app:title="@string/route_opt_bypass_lan" /> + app:key="bypassLanInCore" + app:title="@string/bypass_lan_in_core" />