From 71f2f590a7f8e35bc92eb502532bf68c0b5acd0e Mon Sep 17 00:00:00 2001 From: Hadi Norouzi Date: Tue, 12 Sep 2023 22:20:28 +0330 Subject: [PATCH 01/14] build a version from auto update subscription --- V2rayNG/app/build.gradle | 4 ++-- V2rayNG/app/src/main/AndroidManifest.xml | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/V2rayNG/app/build.gradle b/V2rayNG/app/build.gradle index 228e433d..4d19f0c2 100644 --- a/V2rayNG/app/build.gradle +++ b/V2rayNG/app/build.gradle @@ -17,8 +17,8 @@ android { minSdkVersion 21 targetSdkVersion Integer.parseInt("$targetSdkVer") multiDexEnabled true - versionCode 518 - versionName "1.8.6" + versionCode 519 + versionName "1.8.7" } buildTypes { diff --git a/V2rayNG/app/src/main/AndroidManifest.xml b/V2rayNG/app/src/main/AndroidManifest.xml index daa511a3..abc6af43 100644 --- a/V2rayNG/app/src/main/AndroidManifest.xml +++ b/V2rayNG/app/src/main/AndroidManifest.xml @@ -190,6 +190,18 @@ + + + + + From 23e9d7fde54b415a9e3212027c4dd6678adb30b3 Mon Sep 17 00:00:00 2001 From: yuhan6665 <1588741+yuhan6665@users.noreply.github.com> Date: Sun, 5 Nov 2023 14:21:35 -0500 Subject: [PATCH 02/14] Add menu options for Mux --- .../main/kotlin/com/v2ray/ang/AppConfig.kt | 3 + .../kotlin/com/v2ray/ang/dto/V2rayConfig.kt | 5 +- .../com/v2ray/ang/ui/SettingsActivity.kt | 34 ++++++++- .../com/v2ray/ang/util/V2rayConfigUtil.kt | 13 +++- .../v2ray/ang/viewmodel/SettingsViewModel.kt | 9 ++- .../app/src/main/res/values-ar/strings.xml | 9 ++- .../app/src/main/res/values-fa/strings.xml | 9 ++- .../app/src/main/res/values-ru/strings.xml | 9 ++- .../app/src/main/res/values-vi/strings.xml | 10 ++- .../src/main/res/values-zh-rCN/strings.xml | 11 ++- .../src/main/res/values-zh-rTW/strings.xml | 11 ++- V2rayNG/app/src/main/res/values/arrays.xml | 6 ++ V2rayNG/app/src/main/res/values/strings.xml | 9 ++- .../app/src/main/res/xml/pref_settings.xml | 75 +++++++++++-------- 14 files changed, 168 insertions(+), 45 deletions(-) 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 1dfa3b2b..ee5d58ff 100644 --- a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/AppConfig.kt +++ b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/AppConfig.kt @@ -40,6 +40,9 @@ object AppConfig { const val PREF_BYPASS_APPS = "pref_bypass_apps" const val PREF_CONFIRM_REMOVE = "pref_confirm_remove" const val PREF_START_SCAN_IMMEDIATE = "pref_start_scan_immediate" + const val PREF_MUX_ENABLED = "pref_mux_enabled" + const val PREF_MUX_XUDP_CONCURRENCY = "pref_mux_xudp_concurency" + const val PREF_MUX_XUDP_QUIC = "pref_mux_xudp_quic" const val HTTP_PROTOCOL: String = "http://" const val HTTPS_PROTOCOL: String = "https://" 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 cc46410a..a97ee012 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 @@ -292,7 +292,10 @@ data class V2rayConfig( } } - data class MuxBean(var enabled: Boolean, var concurrency: Int = 8) + data class MuxBean(var enabled: Boolean, + var concurrency: Int = 8, + var xudpConcurrency: Int = 8, + var xudpProxyUDP443: String = "",) fun getServerAddress(): String? { if (protocol.equals(EConfigType.VMESS.name, true) 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 06569046..b07d5c7a 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 @@ -29,6 +29,10 @@ class SettingsActivity : BaseActivity() { private val fakeDns by lazy { findPreference(AppConfig.PREF_FAKE_DNS_ENABLED) } private val localDnsPort by lazy { findPreference(AppConfig.PREF_LOCAL_DNS_PORT) } private val vpnDns by lazy { findPreference(AppConfig.PREF_VPN_DNS) } + private val mux by lazy { findPreference(AppConfig.PREF_MUX_ENABLED) } + private val muxXudpConcurrency by lazy { findPreference(AppConfig.PREF_MUX_XUDP_CONCURRENCY) } + private val muxXudpQuic by lazy { findPreference(AppConfig.PREF_MUX_XUDP_QUIC) } + // val autoRestart by lazy { findPreference(PREF_AUTO_RESTART) as CheckBoxPreference } private val remoteDns by lazy { findPreference(AppConfig.PREF_REMOTE_DNS) } private val domesticDns by lazy { findPreference(AppConfig.PREF_DOMESTIC_DNS) } @@ -119,6 +123,14 @@ class SettingsActivity : BaseActivity() { } mode?.dialogLayoutResource = R.layout.preference_with_help_link //loglevel.summary = "LogLevel" + mux?.setOnPreferenceChangeListener { _, newValue -> + updateMux(newValue as Boolean) + true + } + muxXudpConcurrency?.setOnPreferenceChangeListener { _, newValue -> + updateMuxConcurrency(newValue as String) + true + } } override fun onStart() { @@ -127,10 +139,11 @@ class SettingsActivity : BaseActivity() { updateMode(defaultSharedPreferences.getString(AppConfig.PREF_MODE, "VPN")) var remoteDnsString = defaultSharedPreferences.getString(AppConfig.PREF_REMOTE_DNS, "") domesticDns?.summary = defaultSharedPreferences.getString(AppConfig.PREF_DOMESTIC_DNS, "") - localDnsPort?.summary = defaultSharedPreferences.getString(AppConfig.PREF_LOCAL_DNS_PORT, AppConfig.PORT_LOCAL_DNS) socksPort?.summary = defaultSharedPreferences.getString(AppConfig.PREF_SOCKS_PORT, AppConfig.PORT_SOCKS) httpPort?.summary = defaultSharedPreferences.getString(AppConfig.PREF_HTTP_PORT, AppConfig.PORT_HTTP) + updateMux(defaultSharedPreferences.getBoolean(AppConfig.PREF_MUX_ENABLED, false)) + muxXudpConcurrency?.summary = defaultSharedPreferences.getString(AppConfig.PREF_MUX_XUDP_CONCURRENCY, "8") if (TextUtils.isEmpty(remoteDnsString)) { remoteDnsString = AppConfig.DNS_AGENT @@ -172,6 +185,25 @@ class SettingsActivity : BaseActivity() { localDnsPort?.isEnabled = enabled vpnDns?.isEnabled = !enabled } + + private fun updateMux(enabled: Boolean) { + val defaultSharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity()) + muxXudpConcurrency?.isEnabled = enabled + muxXudpQuic?.isEnabled = enabled + if (enabled) { + updateMuxConcurrency(defaultSharedPreferences.getString(AppConfig.PREF_MUX_XUDP_CONCURRENCY, "8")) + } + } + + private fun updateMuxConcurrency(value: String?) { + if (value == null) { + muxXudpQuic?.isEnabled = true + } else { + val concurrency = value.toIntOrNull() ?: 8 + muxXudpConcurrency?.summary = concurrency.toString() + muxXudpQuic?.isEnabled = concurrency >= 0 + } + } } fun onModeHelpClicked(view: View) { 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 a16027b0..b8cf2f54 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 @@ -64,7 +64,7 @@ object V2rayConfigUtil { inbounds(v2rayConfig) - httpRequestObject(outbound) + updateOutboundWithGlobalSettings(outbound) v2rayConfig.outbounds[0] = outbound @@ -399,8 +399,17 @@ object V2rayConfigUtil { return true } - private fun httpRequestObject(outbound: V2rayConfig.OutboundBean): Boolean { + private fun updateOutboundWithGlobalSettings(outbound: V2rayConfig.OutboundBean): Boolean { try { + if (settingsStorage?.decodeBool(AppConfig.PREF_MUX_ENABLED) == true) { + outbound.mux?.enabled = true + outbound.mux?.concurrency = 8 + outbound.mux?.xudpConcurrency = settingsStorage?.decodeInt(AppConfig.PREF_MUX_XUDP_CONCURRENCY) ?: 8 + outbound.mux?.xudpProxyUDP443 = settingsStorage?.decodeString(AppConfig.PREF_MUX_XUDP_QUIC) ?: "reject" + } else { + outbound.mux?.enabled = false + } + if (outbound.streamSettings?.network == DEFAULT_NETWORK && outbound.streamSettings?.tcpSettings?.header?.type == HTTP) { val path = outbound.streamSettings?.tcpSettings?.header?.request?.path 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 d2c7e913..0d34c0bb 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 @@ -39,7 +39,8 @@ class SettingsViewModel(application: Application) : AndroidViewModel(application AppConfig.PREF_ROUTING_MODE, AppConfig.PREF_V2RAY_ROUTING_AGENT, AppConfig.PREF_V2RAY_ROUTING_BLOCKED, - AppConfig.PREF_V2RAY_ROUTING_DIRECT, -> { + AppConfig.PREF_V2RAY_ROUTING_DIRECT, + AppConfig.PREF_MUX_XUDP_QUIC, -> { settingsStorage?.encode(key, sharedPreferences.getString(key, "")) } AppConfig.PREF_SPEED_ENABLED, @@ -51,12 +52,16 @@ class SettingsViewModel(application: Application) : AndroidViewModel(application AppConfig.PREF_PER_APP_PROXY, AppConfig.PREF_BYPASS_APPS, AppConfig.PREF_CONFIRM_REMOVE, - AppConfig.PREF_START_SCAN_IMMEDIATE, -> { + AppConfig.PREF_START_SCAN_IMMEDIATE, + AppConfig.PREF_MUX_ENABLED, -> { settingsStorage?.encode(key, sharedPreferences.getBoolean(key, false)) } AppConfig.PREF_SNIFFING_ENABLED -> { settingsStorage?.encode(key, sharedPreferences.getBoolean(key, true)) } + AppConfig.PREF_MUX_XUDP_CONCURRENCY -> { + settingsStorage?.encode(key, sharedPreferences.getString(key, "8")?.toIntOrNull() ?: 8) + } AppConfig.PREF_PER_APP_PROXY_SET -> { settingsStorage?.encode(key, sharedPreferences.getStringSet(key, setOf())) } diff --git a/V2rayNG/app/src/main/res/values-ar/strings.xml b/V2rayNG/app/src/main/res/values-ar/strings.xml index 77547473..e4473a13 100644 --- a/V2rayNG/app/src/main/res/values-ar/strings.xml +++ b/V2rayNG/app/src/main/res/values-ar/strings.xml @@ -97,7 +97,14 @@ وكيل لكل تطبيق عام: التطبيق المحدد هو الوكيل، الاتصال غير المحدد مباشر؛ \nوضع التجاوز: التطبيق المحدد متصل مباشرة، الوكيل غير المحدد. \nالخيار لتحديد التطبيق الوكيل تلقائيا في القائمة تمكين Mux - التمكين قد يسرع الشبكة والتبديل بين الشبكات قد يكون فلاش + حركة مرور TCP مع 8 اتصالات افتراضية، قم بتخصيص كيفية التعامل مع UDP وQUIC أدناهn\أسرع، لكنه قد يسبب اتصالاً غير مستقر + اتصالات XUDP (النطاق من -1 إلى 1024) + التعامل مع QUIC في نفق مكس + + يرفض + مسموح + يتخطى + تمكين عرض السرعة عرض السرعة الحالية في الإشعار.\nسيتغير رمز الإشعار استنادًا إلى الاستخدام. تمكين Sniffing diff --git a/V2rayNG/app/src/main/res/values-fa/strings.xml b/V2rayNG/app/src/main/res/values-fa/strings.xml index a0be571f..5b1331a8 100644 --- a/V2rayNG/app/src/main/res/values-fa/strings.xml +++ b/V2rayNG/app/src/main/res/values-fa/strings.xml @@ -98,7 +98,14 @@ عمومی: برنامه بررسی شده پروکسی است، اتصال مستقیم بدون بررسی است. \nحالت bypass: برنامه بررسی شده مستقیما متصل است، پراکسی بررسی نشده است. \nگزینه‌ای برای انتخاب خودکار پروکسی برنامه در منو است فعال کردن Mux - فعال کردن شاید سرعت بخشیدن به شبکه و تغییر شبکه شاید فلش، بهبود کند + سریعتر است، اما ممکن است باعث اتصال ناپایدار شود\nمخزن ترافیک TCP با 8 اتصال پیش‌فرض، نحوه مدیریت UDP و QUIC را در زیر سفارشی کنید + اتصالات XUDP (محدوده -1 تا 1024) + مدیریت QUIC در تونل mux + + رد کردن + مجاز + جست و خیز کردن + فعال کردن نمایش سرعت نمایش سرعت فعلی در قسمت آگاه‌سازی. \nآیکون آگاه‌سازی بر اساس استفاده تغییر می‌کند. diff --git a/V2rayNG/app/src/main/res/values-ru/strings.xml b/V2rayNG/app/src/main/res/values-ru/strings.xml index 7592c653..efc771cf 100644 --- a/V2rayNG/app/src/main/res/values-ru/strings.xml +++ b/V2rayNG/app/src/main/res/values-ru/strings.xml @@ -103,7 +103,14 @@ Основной: выделенное приложение соединяется через прокси, не выделенное — напрямую; \n\nРежим обхода: выделенное приложение соединяется напрямую, не выделенное — через прокси.\n\nЕсть возможность автоматического выбора проксируемых приложений в меню. Использовать мультиплексирование - Включение может ускорить работу и переключение сети + Быстрее, но это может привести к нестабильному соединению\nМультиплексор TCP-трафика с 8 соединениями по умолчанию, ниже можно настроить обработку UDP и QUIC. + XUDP-соединения (диапазон от -1 до 1024) + Обработка QUIC в мультиплексорном туннеле + + отклонять + допустимый + пропускать + Отображение скорости Показывать текущую скорость в уведомлении.\nЗначок будет меняться в зависимости от использования. diff --git a/V2rayNG/app/src/main/res/values-vi/strings.xml b/V2rayNG/app/src/main/res/values-vi/strings.xml index 65184899..d2399c78 100644 --- a/V2rayNG/app/src/main/res/values-vi/strings.xml +++ b/V2rayNG/app/src/main/res/values-vi/strings.xml @@ -97,7 +97,15 @@ - Chung: Ứng dụng đã chọn sẽ kết nối Proxy, chưa lựa chọn sẽ kết nối trực tiếp. \n- Bỏ qua kết nối: Ứng dụng được chọn sẽ trực tiếp kết nối, không lựa chọn sẽ kết nối qua Proxy. \n- Lựa chọn để tự động chọn ứng dụng Proxy trong Menu. Cho phép Mux - Bật lên có thể làm tăng tốc độ mạng và chuyển mạng nhanh hơn. + Nhanh hơn nhưng có thể khiến kết nối không ổn định\nMux lưu lượng TCP với 8 kết nối mặc định, tùy chỉnh cách xử lý UDP và QUIC bên dưới + Kết nối XUDP (phạm vi -1 đến 1024) + Xử lý QUIC trong đường hầm mux + + từ chối + cho phép + nhảy + + Cho phép hiển thị tốc độ mạng Hiển thị tốc độ mạng hiện tại trên thanh thông báo.\nBiểu tượng trên thanh trạng thái có thể thay đổi tùy vào mức sử dụng. 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 c86b8a7c..346ea0b6 100644 --- a/V2rayNG/app/src/main/res/values-zh-rCN/strings.xml +++ b/V2rayNG/app/src/main/res/values-zh-rCN/strings.xml @@ -96,8 +96,15 @@ 分应用代理 常规:勾选的App被代理,未勾选的直连;\n绕行模式:勾选的App直连,未勾选的被代理.\n不明白者在菜单中选择自动选中需代理应用 - 启用Mux多路复用 - 开启可能会加速,关闭可能会减少断流 + 启用 Mux 多路复用 + 减低延时 但可能会断流\nTCP 默认复用 8 个子链接,UDP 及 QUIC 流量处理方式下方可选 + XUDP 复用子链接数(可填 -1 至 1024) + QUIC 流量处理方式 + + 不代理 + 多路复用 + 原生 + 启用速度显示 在通知中显示当前速度\n小图标显示流量的路由情况 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 07296e20..d2ff9e90 100644 --- a/V2rayNG/app/src/main/res/values-zh-rTW/strings.xml +++ b/V2rayNG/app/src/main/res/values-zh-rTW/strings.xml @@ -96,8 +96,15 @@ Proxy 個別應用程式 常規:勾選的 App 啟用 Proxy,未勾選的直接連線;\n繞行模式:勾選的 App 直接連線,未勾選的啟用 Proxy。\n可在選單中選擇自動選中需 Proxy 應用 - 啟用 Mux - 啟用或許會加快網路速度,切換或許會閃爍 + 啟用 Mux 多路復用 + 減低延時 但可能會斷流\nTCP 默認復用 8 個子鏈接,UDP 及 QUIC 流量處理方式下方可選 + XUDP 復用子鏈接數(可填 -1 至 1024) + QUIC 流量處理方式 + + 不代理 + 多路復用 + 原生 + 啟用速度顯示 在通知中顯示當前速度\n小圖示顯示流量的轉送狀況 diff --git a/V2rayNG/app/src/main/res/values/arrays.xml b/V2rayNG/app/src/main/res/values/arrays.xml index 48fe13f5..7a64ed02 100644 --- a/V2rayNG/app/src/main/res/values/arrays.xml +++ b/V2rayNG/app/src/main/res/values/arrays.xml @@ -179,4 +179,10 @@ fa ar + + + reject + allow + skip + diff --git a/V2rayNG/app/src/main/res/values/strings.xml b/V2rayNG/app/src/main/res/values/strings.xml index eb3c42ab..218301db 100644 --- a/V2rayNG/app/src/main/res/values/strings.xml +++ b/V2rayNG/app/src/main/res/values/strings.xml @@ -103,7 +103,14 @@ General: Checked App is proxy, unchecked direct connection; \nbypass mode: checked app directly connected, unchecked proxy. \nThe option to automatically select the proxy application in the menu Enable Mux - Enable maybe speed up network and switch network maybe flash + Faster, but it may cause unstable connectivity\nTCP traffic mux with default 8 connections,customize how to handle UDP and QUIC below + XUDP connections(range -1 to 1024) + Handling of QUIC in mux tunnel + + reject + allow + skip + Enable speed display Display current speed in the notification.\nNotification icon would change based on diff --git a/V2rayNG/app/src/main/res/xml/pref_settings.xml b/V2rayNG/app/src/main/res/xml/pref_settings.xml index 660f77c7..2ab9ccf1 100644 --- a/V2rayNG/app/src/main/res/xml/pref_settings.xml +++ b/V2rayNG/app/src/main/res/xml/pref_settings.xml @@ -1,9 +1,5 @@ - + + + + + + - - - - + + + + + + + + + + + - - - - - - - - - - From c7ff23e3d54bbbd8577aaf79780666a87d0c9edd Mon Sep 17 00:00:00 2001 From: Hossin Asaadi Date: Wed, 8 Nov 2023 16:30:04 +0400 Subject: [PATCH 03/14] Update ServerActivity.kt fix trojan, shadowsocks password toast --- .../app/src/main/kotlin/com/v2ray/ang/ui/ServerActivity.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/ServerActivity.kt b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/ServerActivity.kt index 2a8f03be..ddfa4985 100644 --- a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/ServerActivity.kt +++ b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/ServerActivity.kt @@ -304,7 +304,11 @@ class ServerActivity : BaseActivity() { } val config = MmkvManager.decodeServerConfig(editGuid) ?: ServerConfig.create(createConfigType) if (config.configType != EConfigType.SOCKS && TextUtils.isEmpty(et_id.text.toString())) { - toast(R.string.server_lab_id) + if (config.configType == EConfigType.TROJAN || config.configType == EConfigType.SHADOWSOCKS) { + toast(R.string.server_lab_id3) + }else{ + toast(R.string.server_lab_id) + } return false } sp_stream_security?.let { From 7177d88144ee236a23846f62dac25966d1ced33a Mon Sep 17 00:00:00 2001 From: solokot Date: Fri, 10 Nov 2023 19:48:26 +0300 Subject: [PATCH 04/14] Russian translation Fix Google translate --- V2rayNG/app/src/main/res/values-ru/strings.xml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/V2rayNG/app/src/main/res/values-ru/strings.xml b/V2rayNG/app/src/main/res/values-ru/strings.xml index efc771cf..3e4a8b83 100644 --- a/V2rayNG/app/src/main/res/values-ru/strings.xml +++ b/V2rayNG/app/src/main/res/values-ru/strings.xml @@ -103,12 +103,12 @@ Основной: выделенное приложение соединяется через прокси, не выделенное — напрямую; \n\nРежим обхода: выделенное приложение соединяется напрямую, не выделенное — через прокси.\n\nЕсть возможность автоматического выбора проксируемых приложений в меню. Использовать мультиплексирование - Быстрее, но это может привести к нестабильному соединению\nМультиплексор TCP-трафика с 8 соединениями по умолчанию, ниже можно настроить обработку UDP и QUIC. + Быстрее, но это может привести к нестабильному соединению.\nМультиплексирование TCP-трафика с 8 соединениями по умолчанию, ниже можно настроить обработку UDP и QUIC. XUDP-соединения (диапазон от -1 до 1024) - Обработка QUIC в мультиплексорном туннеле + Обработка QUIC в мультиплексном туннеле отклонять - допустимый + разрешать пропускать @@ -217,6 +217,9 @@ Подключено, нажмите для проверки Не подключено + Подписка импортирована + Невозможно импортировать подписку + QR-код Экспорт в буфер обмена @@ -246,7 +249,5 @@ VPN Только прокси - Подписка импортирована - Подписка не импортирована From 13f855e3c41de9433b061a5e2f3328f71dbe3548 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Mon, 13 Nov 2023 12:42:57 +0800 Subject: [PATCH 05/14] remove android.intent.category.LEANBACK_LAUNCHER --- V2rayNG/app/src/main/AndroidManifest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/V2rayNG/app/src/main/AndroidManifest.xml b/V2rayNG/app/src/main/AndroidManifest.xml index bdec513e..24d7d2bd 100644 --- a/V2rayNG/app/src/main/AndroidManifest.xml +++ b/V2rayNG/app/src/main/AndroidManifest.xml @@ -50,7 +50,7 @@ - + From 6b28208044543721282891e7b5249dce57b77a1d Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Mon, 13 Nov 2023 18:00:00 +0800 Subject: [PATCH 06/14] Fix Automatic update subscriptions --- .../main/kotlin/com/v2ray/ang/AppConfig.kt | 4 +- .../com/v2ray/ang/ui/SettingsActivity.kt | 14 ++- .../v2ray/ang/viewmodel/SettingsViewModel.kt | 2 + V2rayNG/app/src/main/res/values/strings.xml | 6 +- .../app/src/main/res/xml/pref_settings.xml | 102 +++++++----------- 5 files changed, 53 insertions(+), 75 deletions(-) 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 8a3be9e0..2012818a 100644 --- a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/AppConfig.kt +++ b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/AppConfig.kt @@ -94,7 +94,7 @@ object AppConfig { // subscription settings const val SUBSCRIPTION_AUTO_UPDATE = "pref_auto_update_subscription" const val SUBSCRIPTION_AUTO_UPDATE_INTERVAL = "pref_auto_update_interval" - const val DEFAULT_UPDATE_INTERVAL = "1440" // 24 hours - const val UPDATE_TASK_NAME = "subscription-updater" + const val SUBSCRIPTION_DEFAULT_UPDATE_INTERVAL = "1440" // 24 hours + const val SUBSCRIPTION_UPDATE_TASK_NAME = "subscription_updater" } 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 e2420ce3..70da3308 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 @@ -14,13 +14,10 @@ import androidx.work.multiprocess.RemoteWorkManager import com.v2ray.ang.AngApplication import com.v2ray.ang.AppConfig import com.v2ray.ang.R -import com.v2ray.ang.dto.AngConfig import com.v2ray.ang.service.SubscriptionUpdater import com.v2ray.ang.util.Utils import com.v2ray.ang.viewmodel.SettingsViewModel -import java.sql.Time import java.util.concurrent.TimeUnit -import kotlin.time.toDuration class SettingsActivity : BaseActivity() { private val settingsViewModel: SettingsViewModel by viewModels() @@ -81,7 +78,7 @@ class SettingsActivity : BaseActivity() { autoUpdateInterval?.setOnPreferenceChangeListener { _, any -> val nval = any as String autoUpdateInterval?.summary = - if (TextUtils.isEmpty(nval) or (nval.toLong() < 15)) AppConfig.DEFAULT_UPDATE_INTERVAL else nval + if (TextUtils.isEmpty(nval) or (nval.toLong() < 15)) AppConfig.SUBSCRIPTION_DEFAULT_UPDATE_INTERVAL else nval configureUpdateTask(nval.toLong()) false } @@ -180,7 +177,7 @@ class SettingsActivity : BaseActivity() { httpPort?.summary = defaultSharedPreferences.getString(AppConfig.PREF_HTTP_PORT, AppConfig.PORT_HTTP) updateMux(defaultSharedPreferences.getBoolean(AppConfig.PREF_MUX_ENABLED, false)) muxXudpConcurrency?.summary = defaultSharedPreferences.getString(AppConfig.PREF_MUX_XUDP_CONCURRENCY, "8") - autoUpdateInterval?.summary = defaultSharedPreferences.getString(AppConfig.SUBSCRIPTION_AUTO_UPDATE_INTERVAL,AppConfig.DEFAULT_UPDATE_INTERVAL) + autoUpdateInterval?.summary = defaultSharedPreferences.getString(AppConfig.SUBSCRIPTION_AUTO_UPDATE_INTERVAL,AppConfig.SUBSCRIPTION_DEFAULT_UPDATE_INTERVAL) if (TextUtils.isEmpty(remoteDnsString)) { remoteDnsString = AppConfig.DNS_AGENT @@ -233,9 +230,9 @@ class SettingsActivity : BaseActivity() { private fun configureUpdateTask(interval: Long) { val rw = RemoteWorkManager.getInstance(AngApplication.application) - rw.cancelUniqueWork(AppConfig.UPDATE_TASK_NAME) + rw.cancelUniqueWork(AppConfig.SUBSCRIPTION_UPDATE_TASK_NAME) rw.enqueueUniquePeriodicWork( - AppConfig.UPDATE_TASK_NAME, + AppConfig.SUBSCRIPTION_UPDATE_TASK_NAME, ExistingPeriodicWorkPolicy.UPDATE, PeriodicWorkRequest.Builder( SubscriptionUpdater.UpdateTask::class.java, @@ -255,7 +252,8 @@ class SettingsActivity : BaseActivity() { private fun cancelUpdateTask() { val rw = RemoteWorkManager.getInstance(AngApplication.application) - rw.cancelUniqueWork(AppConfig.UPDATE_TASK_NAME) + rw.cancelUniqueWork(AppConfig.SUBSCRIPTION_UPDATE_TASK_NAME) + } private fun updateMux(enabled: Boolean) { val defaultSharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity()) 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 0d34c0bb..4fa407e8 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 @@ -40,6 +40,7 @@ class SettingsViewModel(application: Application) : AndroidViewModel(application AppConfig.PREF_V2RAY_ROUTING_AGENT, AppConfig.PREF_V2RAY_ROUTING_BLOCKED, AppConfig.PREF_V2RAY_ROUTING_DIRECT, + AppConfig.SUBSCRIPTION_AUTO_UPDATE_INTERVAL, AppConfig.PREF_MUX_XUDP_QUIC, -> { settingsStorage?.encode(key, sharedPreferences.getString(key, "")) } @@ -53,6 +54,7 @@ class SettingsViewModel(application: Application) : AndroidViewModel(application AppConfig.PREF_BYPASS_APPS, AppConfig.PREF_CONFIRM_REMOVE, AppConfig.PREF_START_SCAN_IMMEDIATE, + AppConfig.SUBSCRIPTION_AUTO_UPDATE, AppConfig.PREF_MUX_ENABLED, -> { settingsStorage?.encode(key, sharedPreferences.getBoolean(key, false)) } diff --git a/V2rayNG/app/src/main/res/values/strings.xml b/V2rayNG/app/src/main/res/values/strings.xml index 6214b267..4e792fd1 100644 --- a/V2rayNG/app/src/main/res/values/strings.xml +++ b/V2rayNG/app/src/main/res/values/strings.xml @@ -172,6 +172,10 @@ Promotion Promotion,click for details(Donation can be removed) + Automatic update subscriptions + Update your subscriptions automatically with an interval in background + Subscription Auto Update Interval (Minutes) + Log Level Mode Click me for more help @@ -190,7 +194,7 @@ remarks Optional URL enable update - Auto update + Automatic update Update subscription Tcping all configuration Real delay all configuration diff --git a/V2rayNG/app/src/main/res/xml/pref_settings.xml b/V2rayNG/app/src/main/res/xml/pref_settings.xml index a14314d5..21c1751d 100644 --- a/V2rayNG/app/src/main/res/xml/pref_settings.xml +++ b/V2rayNG/app/src/main/res/xml/pref_settings.xml @@ -2,10 +2,10 @@ + android:defaultValue="true" + android:key="pref_sniffing_enabled" + android:summary="@string/summary_pref_sniffing_enabled" + android:title="@string/title_pref_sniffing_enabled" /> + android:key="pref_local_dns_enabled" + android:summary="@string/summary_pref_local_dns_enabled" + android:title="@string/title_pref_local_dns_enabled" /> + android:key="pref_fake_dns_enabled" + android:summary="@string/summary_pref_fake_dns_enabled" + android:title="@string/title_pref_fake_dns_enabled" /> + android:key="pref_local_dns_port" + android:summary="10853" + android:inputType="number" + android:title="@string/title_pref_local_dns_port" /> + android:key="pref_vpn_dns" + android:summary="@string/summary_pref_remote_dns" + android:title="@string/title_pref_vpn_dns" /> @@ -78,6 +78,18 @@ + + + + + + android:key="pref_domestic_dns" + android:summary="@string/summary_pref_domestic_dns" + android:title="@string/title_pref_domestic_dns" /> - - - - - - - - - - - - - - - - - - + android:title="@string/title_mode" /> - - + \ No newline at end of file From 3dde6b0ca31a41e8b891548c31fbc112368b5863 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Tue, 14 Nov 2023 09:32:05 +0800 Subject: [PATCH 07/14] Fix Automatic update subscriptions --- .../app/src/main/kotlin/com/v2ray/ang/ui/SettingsActivity.kt | 5 +++-- V2rayNG/app/src/main/res/values-zh-rCN/strings.xml | 5 +++++ V2rayNG/app/src/main/res/values-zh-rTW/strings.xml | 5 +++++ 3 files changed, 13 insertions(+), 2 deletions(-) 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 70da3308..452f0983 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 @@ -78,9 +78,9 @@ class SettingsActivity : BaseActivity() { autoUpdateInterval?.setOnPreferenceChangeListener { _, any -> val nval = any as String autoUpdateInterval?.summary = - if (TextUtils.isEmpty(nval) or (nval.toLong() < 15)) AppConfig.SUBSCRIPTION_DEFAULT_UPDATE_INTERVAL else nval + if (TextUtils.isEmpty(nval) or (nval.toLong() < 1)) AppConfig.SUBSCRIPTION_DEFAULT_UPDATE_INTERVAL else nval configureUpdateTask(nval.toLong()) - false + true } // licenses.onClick { @@ -178,6 +178,7 @@ class SettingsActivity : BaseActivity() { updateMux(defaultSharedPreferences.getBoolean(AppConfig.PREF_MUX_ENABLED, false)) muxXudpConcurrency?.summary = defaultSharedPreferences.getString(AppConfig.PREF_MUX_XUDP_CONCURRENCY, "8") autoUpdateInterval?.summary = defaultSharedPreferences.getString(AppConfig.SUBSCRIPTION_AUTO_UPDATE_INTERVAL,AppConfig.SUBSCRIPTION_DEFAULT_UPDATE_INTERVAL) + autoUpdateInterval?.isEnabled = defaultSharedPreferences.getBoolean(AppConfig.SUBSCRIPTION_AUTO_UPDATE, false) if (TextUtils.isEmpty(remoteDnsString)) { remoteDnsString = AppConfig.DNS_AGENT 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 346ea0b6..4ceb4ad0 100644 --- a/V2rayNG/app/src/main/res/values-zh-rCN/strings.xml +++ b/V2rayNG/app/src/main/res/values-zh-rCN/strings.xml @@ -164,6 +164,10 @@ 推广 一些推广,点击查看详情(捐赠可去除) + 自动更新订阅 + 在后台按一定时间间隔自动更新您的订阅 + 订阅自动更新间隔(分钟) + 日志级别 模式 点此查看更多帮助 @@ -182,6 +186,7 @@ 备注 可选地址(url) 启用更新 + 自动更新 更新订阅 测试全部配置Tcping 测试全部配置真连接 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 d2ff9e90..c1050ae8 100644 --- a/V2rayNG/app/src/main/res/values-zh-rTW/strings.xml +++ b/V2rayNG/app/src/main/res/values-zh-rTW/strings.xml @@ -164,6 +164,10 @@ 推廣 一些推廣,輕觸以檢視 (捐贈可去除) + 自動更新訂閱 + 在後台以一定時間間隔自動更新您的訂閱 + 訂閱自動更新間隔(分鐘) + 記錄層級 模式 輕觸以檢視說明 @@ -182,6 +186,7 @@ 備註 Optional URL 啟用更新 + 自動更新 更新訂閱 偵測所有組態 Tcping 偵測所有組態真延遲 From 0ae7f2f7b389c97f35041fb5796bc786c914a21a Mon Sep 17 00:00:00 2001 From: Eken Chan Date: Tue, 14 Nov 2023 15:42:00 +0800 Subject: [PATCH 08/14] fix mux not working --- .../main/kotlin/com/v2ray/ang/util/V2rayConfigUtil.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 b8cf2f54..abbcf1d9 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 @@ -402,10 +402,11 @@ object V2rayConfigUtil { private fun updateOutboundWithGlobalSettings(outbound: V2rayConfig.OutboundBean): Boolean { try { if (settingsStorage?.decodeBool(AppConfig.PREF_MUX_ENABLED) == true) { - outbound.mux?.enabled = true - outbound.mux?.concurrency = 8 - outbound.mux?.xudpConcurrency = settingsStorage?.decodeInt(AppConfig.PREF_MUX_XUDP_CONCURRENCY) ?: 8 - outbound.mux?.xudpProxyUDP443 = settingsStorage?.decodeString(AppConfig.PREF_MUX_XUDP_QUIC) ?: "reject" + outbound.mux = V2rayConfig.OutboundBean.MuxBean(enabled = true, + concurrency = 8, + xudpConcurrency = Utils.parseInt(settingsStorage?.decodeString(AppConfig.PREF_MUX_XUDP_CONCURRENCY), 8), + xudpProxyUDP443 = settingsStorage?.decodeString(AppConfig.PREF_MUX_XUDP_QUIC) ?: "reject" + ) } else { outbound.mux?.enabled = false } From 29848053a44b113465308cd168b0b22b284a8aff Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Wed, 15 Nov 2023 14:17:21 +0800 Subject: [PATCH 09/14] Revert "Merge pull request #2603 from maskedeken/fix-mux" This reverts commit 0d9856919e144008bc8025b6f72303dd8baf5589, reversing changes made to 3dde6b0ca31a41e8b891548c31fbc112368b5863. --- .../main/kotlin/com/v2ray/ang/util/V2rayConfigUtil.kt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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 abbcf1d9..b8cf2f54 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 @@ -402,11 +402,10 @@ object V2rayConfigUtil { private fun updateOutboundWithGlobalSettings(outbound: V2rayConfig.OutboundBean): Boolean { try { if (settingsStorage?.decodeBool(AppConfig.PREF_MUX_ENABLED) == true) { - outbound.mux = V2rayConfig.OutboundBean.MuxBean(enabled = true, - concurrency = 8, - xudpConcurrency = Utils.parseInt(settingsStorage?.decodeString(AppConfig.PREF_MUX_XUDP_CONCURRENCY), 8), - xudpProxyUDP443 = settingsStorage?.decodeString(AppConfig.PREF_MUX_XUDP_QUIC) ?: "reject" - ) + outbound.mux?.enabled = true + outbound.mux?.concurrency = 8 + outbound.mux?.xudpConcurrency = settingsStorage?.decodeInt(AppConfig.PREF_MUX_XUDP_CONCURRENCY) ?: 8 + outbound.mux?.xudpProxyUDP443 = settingsStorage?.decodeString(AppConfig.PREF_MUX_XUDP_QUIC) ?: "reject" } else { outbound.mux?.enabled = false } From f25c0cc8902874b76c710de9340708550955b0ff Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Wed, 15 Nov 2023 15:27:53 +0800 Subject: [PATCH 10/14] Fix Automatic update subscriptions --- .../v2ray/ang/service/SubscriptionUpdater.kt | 26 +++++------ .../com/v2ray/ang/ui/SettingsActivity.kt | 6 +-- .../src/main/res/layout/activity_sub_edit.xml | 43 ++++++++++--------- .../src/main/res/values-zh-rCN/strings.xml | 4 +- .../src/main/res/values-zh-rTW/strings.xml | 4 +- V2rayNG/app/src/main/res/values/strings.xml | 6 +-- 6 files changed, 40 insertions(+), 49 deletions(-) diff --git a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/service/SubscriptionUpdater.kt b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/service/SubscriptionUpdater.kt index 4eeaaa7e..acbe0040 100644 --- a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/service/SubscriptionUpdater.kt +++ b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/service/SubscriptionUpdater.kt @@ -1,29 +1,24 @@ package com.v2ray.ang.service -import android.Manifest import android.annotation.SuppressLint import android.app.NotificationChannel import android.app.NotificationManager import android.content.Context -import android.content.pm.PackageManager import android.os.Build import android.util.Log -import androidx.core.app.ActivityCompat import androidx.core.app.NotificationCompat import androidx.core.app.NotificationManagerCompat import androidx.work.CoroutineWorker import androidx.work.WorkerParameters import com.v2ray.ang.AppConfig import com.v2ray.ang.R -import com.v2ray.ang.extension.toast import com.v2ray.ang.util.AngConfigManager import com.v2ray.ang.util.MmkvManager import com.v2ray.ang.util.Utils -import kotlinx.coroutines.delay object SubscriptionUpdater { - const val notificationChannel = "update-subscription-channel" + const val notificationChannel = "subscription_update_channel" class UpdateTask(context: Context, params: WorkerParameters) : CoroutineWorker(context, params) { @@ -31,23 +26,20 @@ object SubscriptionUpdater { private val notificationManager = NotificationManagerCompat.from(applicationContext) private val notification = NotificationCompat.Builder(applicationContext, notificationChannel) - .setWhen(0) .setTicker("Update") - .setContentTitle("Subscription Update") + .setContentTitle(context.getString(R.string.title_pref_auto_update_subscription)) .setSmallIcon(R.drawable.ic_stat_name) .setCategory(NotificationCompat.CATEGORY_SERVICE) - .setPriority(NotificationCompat.PRIORITY_MIN) + .setPriority(NotificationCompat.PRIORITY_DEFAULT) @SuppressLint("MissingPermission") override suspend fun doWork(): Result { - Log.d(AppConfig.ANG_PACKAGE, "start updating subscriptions") - + Log.d(AppConfig.ANG_PACKAGE, "subscription automatic update starting") val subs = MmkvManager.decodeSubscriptions().filter { it.second.autoUpdate } for (i in subs) { - val subscription = i.second if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { @@ -61,7 +53,10 @@ object SubscriptionUpdater { notificationManager.createNotificationChannel(channel) } notificationManager.notify(3, notification.build()) - Log.d(AppConfig.ANG_PACKAGE, "update: ${subscription.remarks} subscription") + Log.d( + AppConfig.ANG_PACKAGE, + "subscription automatic update: ---${subscription.remarks}" + ) val configs = Utils.getUrlContentWithCustomUserAgent(subscription.url) importBatchConfig(configs, i.first) notification.setContentText("Updating ${subscription.remarks}") @@ -72,10 +67,9 @@ object SubscriptionUpdater { } fun importBatchConfig(server: String?, subid: String = "") { + val append = subid.isEmpty() - val append = subid.isNullOrEmpty() - - var count = AngConfigManager.importBatchConfig(server, subid, append) + val count = AngConfigManager.importBatchConfig(server, subid, append) if (count <= 0) { AngConfigManager.importBatchConfig(Utils.decode(server!!), subid, append) } 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 452f0983..c93fae00 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 @@ -243,11 +243,7 @@ class SettingsActivity : BaseActivity() { .apply { setInitialDelay(interval, TimeUnit.MINUTES) } - .setConstraints( - Constraints( - NetworkType.CONNECTED, - ) - ).build() + .build() ) } diff --git a/V2rayNG/app/src/main/res/layout/activity_sub_edit.xml b/V2rayNG/app/src/main/res/layout/activity_sub_edit.xml index d61169cf..1bf37ac7 100644 --- a/V2rayNG/app/src/main/res/layout/activity_sub_edit.xml +++ b/V2rayNG/app/src/main/res/layout/activity_sub_edit.xml @@ -69,6 +69,28 @@ + + + + + + + + + - - - - - - - - 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 4ceb4ad0..b07c2c55 100644 --- a/V2rayNG/app/src/main/res/values-zh-rCN/strings.xml +++ b/V2rayNG/app/src/main/res/values-zh-rCN/strings.xml @@ -165,7 +165,7 @@ 一些推广,点击查看详情(捐赠可去除) 自动更新订阅 - 在后台按一定时间间隔自动更新您的订阅 + 在后台按一定时间间隔自动更新您的订阅。受设备影响,此功能不一定总是有效 订阅自动更新间隔(分钟) 日志级别 @@ -186,7 +186,7 @@ 备注 可选地址(url) 启用更新 - 自动更新 + 启用自动更新 更新订阅 测试全部配置Tcping 测试全部配置真连接 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 c1050ae8..2fbd228a 100644 --- a/V2rayNG/app/src/main/res/values-zh-rTW/strings.xml +++ b/V2rayNG/app/src/main/res/values-zh-rTW/strings.xml @@ -165,7 +165,7 @@ 一些推廣,輕觸以檢視 (捐贈可去除) 自動更新訂閱 - 在後台以一定時間間隔自動更新您的訂閱 + 在後台以一定時間間隔自動更新您的訂閱。受設備影響,此功能不一定總是有效 訂閱自動更新間隔(分鐘) 記錄層級 @@ -186,7 +186,7 @@ 備註 Optional URL 啟用更新 - 自動更新 + 啟用自動更新 更新訂閱 偵測所有組態 Tcping 偵測所有組態真延遲 diff --git a/V2rayNG/app/src/main/res/values/strings.xml b/V2rayNG/app/src/main/res/values/strings.xml index 4e792fd1..a27d1398 100644 --- a/V2rayNG/app/src/main/res/values/strings.xml +++ b/V2rayNG/app/src/main/res/values/strings.xml @@ -173,7 +173,7 @@ Promotion,click for details(Donation can be removed) Automatic update subscriptions - Update your subscriptions automatically with an interval in background + Update your subscriptions automatically with an interval in background. Depending on the device, this feature may not always work Subscription Auto Update Interval (Minutes) Log Level @@ -193,8 +193,8 @@ Subscription group setting remarks Optional URL - enable update - Automatic update + Enable update + Enable automatic update Update subscription Tcping all configuration Real delay all configuration From 74171e26db55a4543adefa3713358fefca643ef9 Mon Sep 17 00:00:00 2001 From: solokot Date: Wed, 15 Nov 2023 11:20:55 +0300 Subject: [PATCH 11/14] Update Russian translation Automatic update subscriptions --- V2rayNG/app/src/main/res/values-ru/strings.xml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/V2rayNG/app/src/main/res/values-ru/strings.xml b/V2rayNG/app/src/main/res/values-ru/strings.xml index 3e4a8b83..4989238b 100644 --- a/V2rayNG/app/src/main/res/values-ru/strings.xml +++ b/V2rayNG/app/src/main/res/values-ru/strings.xml @@ -32,7 +32,7 @@ Ручной ввод профиля Trojan Пользовательский профиль Импорт из буфера обмена - Импорт с устройства + Импорт из файла Импорт из URL Импорт сканированием URL Подтверждаете удаление? @@ -170,6 +170,10 @@ Содействие Содействие, нажмите для получения подробной информации (пожертвование может быть удалено) + Автоматическое обновление подписок + Автоматическое обновление подписок в фоновом режиме с указанным интервалом. В зависимости от устройства эта функция может работать не всегда. + Интервал автообновления (мин.) + Подробность ведения журнала Режим Нажмите для получения дополнительной информации @@ -182,12 +186,13 @@ Перезапуск службы Удалить все профили Удалить дубликаты профилей - Удалить сбойные профили (после проверки) + Удалить нерабочие профили (после проверки) Экспорт всех профилей в буфер обмена Группы примечания URL (необязательно) - использовать обновление + Использовать обновление + Использовать автоматическое обновление Обновить подписку Проверка доступности профилей Время отклика профилей @@ -206,7 +211,7 @@ Очистить Сканировать и заменить Сканировать и добавить - Правила по умолчанию + Правила по умолчанию Проверить подключение Проверка… From 84fc909339e168a3de96162eb26163ba4ad8e466 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Wed, 15 Nov 2023 17:22:16 +0800 Subject: [PATCH 12/14] Adjust UI --- .../com/v2ray/ang/ui/MainRecyclerAdapter.kt | 3 ++- .../main/res/layout/item_recycler_main.xml | 19 ++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/MainRecyclerAdapter.kt b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/MainRecyclerAdapter.kt index 86e648fe..9891568c 100644 --- a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/MainRecyclerAdapter.kt +++ b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/MainRecyclerAdapter.kt @@ -96,7 +96,8 @@ class MainRecyclerAdapter(val activity: MainActivity) : RecyclerView.Adapter diff --git a/V2rayNG/app/src/main/res/layout/item_recycler_main.xml b/V2rayNG/app/src/main/res/layout/item_recycler_main.xml index 2dc83fb9..b2fbd63d 100644 --- a/V2rayNG/app/src/main/res/layout/item_recycler_main.xml +++ b/V2rayNG/app/src/main/res/layout/item_recycler_main.xml @@ -41,7 +41,12 @@ android:orientation="vertical" android:paddingStart="9dp"> - + + - + + android:textAppearance="@style/TextAppearance.AppCompat.Small" + android:textSize="12sp"/> From 683362f0ee75d22c0901b57955a4fbead3163e87 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Wed, 15 Nov 2023 19:17:02 +0800 Subject: [PATCH 13/14] Fix mux enabled --- .../com/v2ray/ang/util/V2rayConfigUtil.kt | 26 ++++++++++++++++--- .../src/main/res/values-zh-rCN/strings.xml | 2 +- 2 files changed, 23 insertions(+), 5 deletions(-) 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 b8cf2f54..4e0df222 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 @@ -401,17 +401,35 @@ object V2rayConfigUtil { private fun updateOutboundWithGlobalSettings(outbound: V2rayConfig.OutboundBean): Boolean { try { - if (settingsStorage?.decodeBool(AppConfig.PREF_MUX_ENABLED) == true) { + var muxEnabled = settingsStorage?.decodeBool(AppConfig.PREF_MUX_ENABLED, false) + + val protocol = outbound.protocol + if (protocol.equals(EConfigType.SHADOWSOCKS.name, true) + || protocol.equals(EConfigType.SOCKS.name, true) + || protocol.equals(EConfigType.TROJAN.name, true) + ) { + muxEnabled = false + } else if (protocol.equals(EConfigType.VLESS.name, true) + && outbound.settings?.vnext?.get(0)?.users?.get(0)?.flow?.isNotEmpty() == true + ) { + muxEnabled = false + } + + if (muxEnabled == true) { outbound.mux?.enabled = true outbound.mux?.concurrency = 8 - outbound.mux?.xudpConcurrency = settingsStorage?.decodeInt(AppConfig.PREF_MUX_XUDP_CONCURRENCY) ?: 8 - outbound.mux?.xudpProxyUDP443 = settingsStorage?.decodeString(AppConfig.PREF_MUX_XUDP_QUIC) ?: "reject" + outbound.mux?.xudpConcurrency = + settingsStorage?.decodeInt(AppConfig.PREF_MUX_XUDP_CONCURRENCY) ?: 8 + outbound.mux?.xudpProxyUDP443 = + settingsStorage?.decodeString(AppConfig.PREF_MUX_XUDP_QUIC) ?: "reject" } else { outbound.mux?.enabled = false + outbound.mux?.concurrency = -1 } if (outbound.streamSettings?.network == DEFAULT_NETWORK - && outbound.streamSettings?.tcpSettings?.header?.type == HTTP) { + && outbound.streamSettings?.tcpSettings?.header?.type == HTTP + ) { val path = outbound.streamSettings?.tcpSettings?.header?.request?.path val host = outbound.streamSettings?.tcpSettings?.header?.request?.headers?.Host 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 b07c2c55..45879449 100644 --- a/V2rayNG/app/src/main/res/values-zh-rCN/strings.xml +++ b/V2rayNG/app/src/main/res/values-zh-rCN/strings.xml @@ -97,7 +97,7 @@ 常规:勾选的App被代理,未勾选的直连;\n绕行模式:勾选的App直连,未勾选的被代理.\n不明白者在菜单中选择自动选中需代理应用 启用 Mux 多路复用 - 减低延时 但可能会断流\nTCP 默认复用 8 个子链接,UDP 及 QUIC 流量处理方式下方可选 + 减低延时,但可能会断流,建议不要启用。\nTCP 默认复用 8 个子链接,UDP 及 QUIC 流量处理方式下方可选。 XUDP 复用子链接数(可填 -1 至 1024) QUIC 流量处理方式 From 6351ce59912a15eaa123af24b5662b69e80adcd0 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Wed, 15 Nov 2023 19:35:16 +0800 Subject: [PATCH 14/14] up 1.8.10 --- V2rayNG/app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/V2rayNG/app/build.gradle b/V2rayNG/app/build.gradle index 00cc729b..733784a0 100644 --- a/V2rayNG/app/build.gradle +++ b/V2rayNG/app/build.gradle @@ -17,8 +17,8 @@ android { minSdkVersion 21 targetSdkVersion Integer.parseInt("$targetSdkVer") multiDexEnabled true - versionCode 523 - versionName "1.8.9" + versionCode 526 + versionName "1.8.10" } buildTypes {