From ec5f7245bf6816367bb19855c486677f3aa09201 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Mon, 25 Sep 2023 11:20:21 +0800 Subject: [PATCH 1/8] up 1.8.7 --- 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 92e03a810..8fb4a59cd 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 521 + versionName "1.8.7" } buildTypes { From 2341eceb65295be4eb8c5f66dd0b6b92979c96de Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Mon, 25 Sep 2023 11:32:57 +0800 Subject: [PATCH 2/8] up 1.8.8 --- 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 8fb4a59cd..8d3011958 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 521 - versionName "1.8.7" + versionCode 522 + versionName "1.8.8" } buildTypes { From 0672af98f8cfff74b321a6b403ed95b358770ac5 Mon Sep 17 00:00:00 2001 From: ibrahem Qasim Date: Thu, 28 Sep 2023 00:23:40 +0300 Subject: [PATCH 3/8] Update strings.xml --- V2rayNG/app/src/main/res/values-ar/strings.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/V2rayNG/app/src/main/res/values-ar/strings.xml b/V2rayNG/app/src/main/res/values-ar/strings.xml index 427e5b4d9..194839913 100644 --- a/V2rayNG/app/src/main/res/values-ar/strings.xml +++ b/V2rayNG/app/src/main/res/values-ar/strings.xml @@ -147,19 +147,19 @@ نسخ مسح إعادة تشغيل الخدمة - حذف كل التكوين - حذف التكوين المكرر - حذف التكوين غير الصالح (اختبر أولا) + حذف الكل (قبل أول خطوة) + حذف المكررات (2) + حذف العناوين العاطلة (بعد الاختبار؛ 4) تصدير التكوينات غير المخصصة إلى الحافظة إعدادات مجموعة الاشتراك ملاحظات URL اختياري تمكين التحديث - تحديث الاشتراك + تحديث الاشتراك (1) Tcping كل التكوين - تأخير الحقيقي لكل التكوين + اختبر كل العناوين (3) ملفات الأصول الجغرافية - الترتيب بناءً على نتائج الاختبار + ترتيب العناوين حسب نتائج الاختبار (5) تصفية ملف التكوين جميع مجموعات الاشتراك حذف %d من التكوينات المكررة From bed0fd00bd79dac3a960b53c2c8e810fc5ce0b9b Mon Sep 17 00:00:00 2001 From: ibrahem Qasim Date: Thu, 28 Sep 2023 00:32:18 +0300 Subject: [PATCH 4/8] Update strings.xml update arabic string --- V2rayNG/app/src/main/res/values-ar/strings.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/V2rayNG/app/src/main/res/values-ar/strings.xml b/V2rayNG/app/src/main/res/values-ar/strings.xml index 427e5b4d9..db8f3451f 100644 --- a/V2rayNG/app/src/main/res/values-ar/strings.xml +++ b/V2rayNG/app/src/main/res/values-ar/strings.xml @@ -192,9 +192,9 @@ تصدير إلى الحافظة - URL الوكيل أو IP - URL المباشر أو IP - URL المحظور أو IP + مسار وكيل أو IP + مسار مباشر أو IP + مسار محظور أو IP وكيل عالمي From 52416dd43de0af0dcdb0d48d04ae5394c5e5f0fe Mon Sep 17 00:00:00 2001 From: yuhan6665 <1588741+yuhan6665@users.noreply.github.com> Date: Fri, 29 Sep 2023 19:59:06 -0400 Subject: [PATCH 5/8] Unified base activity for status bar icon color --- .../src/main/kotlin/com/v2ray/ang/ui/BaseActivity.kt | 12 ++++++++++++ .../main/kotlin/com/v2ray/ang/ui/LogcatActivity.kt | 7 +++---- .../src/main/kotlin/com/v2ray/ang/ui/MainActivity.kt | 6 ------ .../kotlin/com/v2ray/ang/ui/PerAppProxyActivity.kt | 2 -- .../com/v2ray/ang/ui/RoutingSettingsActivity.kt | 1 - .../main/kotlin/com/v2ray/ang/ui/ScannerActivity.kt | 10 ---------- .../main/kotlin/com/v2ray/ang/ui/ServerActivity.kt | 1 - .../com/v2ray/ang/ui/ServerCustomConfigActivity.kt | 1 - .../main/kotlin/com/v2ray/ang/ui/SettingsActivity.kt | 2 -- .../main/kotlin/com/v2ray/ang/ui/SubEditActivity.kt | 1 - .../kotlin/com/v2ray/ang/ui/SubSettingActivity.kt | 2 -- .../kotlin/com/v2ray/ang/ui/UserAssetActivity.kt | 1 - 12 files changed, 15 insertions(+), 31 deletions(-) diff --git a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/BaseActivity.kt b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/BaseActivity.kt index 65a211f40..d079eb2f7 100644 --- a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/BaseActivity.kt +++ b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/BaseActivity.kt @@ -2,13 +2,25 @@ package com.v2ray.ang.ui import android.content.Context import android.os.Build +import android.os.Bundle import android.view.MenuItem import androidx.annotation.RequiresApi import androidx.appcompat.app.AppCompatActivity +import androidx.core.view.WindowCompat import com.v2ray.ang.util.MyContextWrapper import com.v2ray.ang.util.Utils abstract class BaseActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + supportActionBar?.setDisplayHomeAsUpEnabled(true) + if (!Utils.getDarkModeStatus(this)) { + WindowCompat.getInsetsController(window, window.decorView).apply { + isAppearanceLightStatusBars = true + } + } + } + override fun onOptionsItemSelected(item: MenuItem) = when (item.itemId) { android.R.id.home -> { onBackPressed() diff --git a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/LogcatActivity.kt b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/LogcatActivity.kt index 08d764909..06bc3e900 100644 --- a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/LogcatActivity.kt +++ b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/LogcatActivity.kt @@ -25,13 +25,12 @@ class LogcatActivity : BaseActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - binding = ActivityLogcatBinding.inflate(layoutInflater) - val view = binding.root - setContentView(view) + binding = ActivityLogcatBinding.inflate(layoutInflater) + val view = binding.root + setContentView(view) title = getString(R.string.title_logcat) - supportActionBar?.setDisplayHomeAsUpEnabled(true) logcat(false) } diff --git a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/MainActivity.kt b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/MainActivity.kt index adb6c50b4..4151a3e1d 100644 --- a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/MainActivity.kt +++ b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/MainActivity.kt @@ -25,7 +25,6 @@ import android.widget.Toast import androidx.activity.result.contract.ActivityResultContracts import androidx.activity.viewModels import androidx.appcompat.app.AlertDialog -import androidx.core.view.WindowCompat import androidx.lifecycle.lifecycleScope import com.tencent.mmkv.MMKV import com.v2ray.ang.AppConfig.ANG_PACKAGE @@ -66,11 +65,6 @@ class MainActivity : BaseActivity(), NavigationView.OnNavigationItemSelectedList setContentView(view) title = getString(R.string.title_server) setSupportActionBar(binding.toolbar) - if (!Utils.getDarkModeStatus(this)) { - WindowCompat.getInsetsController(window, window.decorView).apply { - isAppearanceLightStatusBars = true - } - } binding.fab.setOnClickListener { if (mainViewModel.isRunning.value == true) { diff --git a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/PerAppProxyActivity.kt b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/PerAppProxyActivity.kt index eabed93df..d6b217e4e 100644 --- a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/PerAppProxyActivity.kt +++ b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/PerAppProxyActivity.kt @@ -41,8 +41,6 @@ class PerAppProxyActivity : BaseActivity() { val view = binding.root setContentView(view) - supportActionBar?.setDisplayHomeAsUpEnabled(true) - val dividerItemDecoration = DividerItemDecoration(this, LinearLayoutManager.VERTICAL) binding.recyclerView.addItemDecoration(dividerItemDecoration) diff --git a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/RoutingSettingsActivity.kt b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/RoutingSettingsActivity.kt index 030e80ff1..194c397eb 100644 --- a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/RoutingSettingsActivity.kt +++ b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/RoutingSettingsActivity.kt @@ -21,7 +21,6 @@ class RoutingSettingsActivity : BaseActivity() { setContentView(view) title = getString(R.string.title_pref_routing_custom) - supportActionBar?.setDisplayHomeAsUpEnabled(true) val fragments = ArrayList() fragments.add(RoutingSettingsFragment().newInstance(AppConfig.PREF_V2RAY_ROUTING_AGENT)) diff --git a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/ScannerActivity.kt b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/ScannerActivity.kt index 33b7f685e..086c39f28 100644 --- a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/ScannerActivity.kt +++ b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/ScannerActivity.kt @@ -31,16 +31,6 @@ class ScannerActivity : BaseActivity(){ if (settingsStorage?.decodeBool(AppConfig.PREF_START_SCAN_IMMEDIATE) == true) { launchScan() } - - supportActionBar?.setDisplayHomeAsUpEnabled(true) - } - - public override fun onResume() { - super.onResume() - } - - public override fun onPause() { - super.onPause() } private fun launchScan(){ 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 6ab4f3e1d..2a8f03be4 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 @@ -175,7 +175,6 @@ class ServerActivity : BaseActivity() { } else { clearServer() } - supportActionBar?.setDisplayHomeAsUpEnabled(true) } /** diff --git a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/ServerCustomConfigActivity.kt b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/ServerCustomConfigActivity.kt index fabdccae9..4cef6eda8 100644 --- a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/ServerCustomConfigActivity.kt +++ b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/ServerCustomConfigActivity.kt @@ -49,7 +49,6 @@ class ServerCustomConfigActivity : BaseActivity() { } else { clearServer() } - supportActionBar?.setDisplayHomeAsUpEnabled(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 5284cc640..06569046b 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 @@ -20,8 +20,6 @@ class SettingsActivity : BaseActivity() { title = getString(R.string.title_settings) - supportActionBar?.setDisplayHomeAsUpEnabled(true) - settingsViewModel.startListenPreferenceChange() } diff --git a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/SubEditActivity.kt b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/SubEditActivity.kt index 5a5a8d442..124db66b4 100644 --- a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/SubEditActivity.kt +++ b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/SubEditActivity.kt @@ -36,7 +36,6 @@ class SubEditActivity : BaseActivity() { } else { clearServer() } - supportActionBar?.setDisplayHomeAsUpEnabled(true) } /** diff --git a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/SubSettingActivity.kt b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/SubSettingActivity.kt index 853a3878c..469af3be1 100644 --- a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/SubSettingActivity.kt +++ b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/SubSettingActivity.kt @@ -27,8 +27,6 @@ class SubSettingActivity : BaseActivity() { binding.recyclerView.setHasFixedSize(true) binding.recyclerView.layoutManager = LinearLayoutManager(this) binding.recyclerView.adapter = adapter - - supportActionBar?.setDisplayHomeAsUpEnabled(true) } override fun onResume() { diff --git a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/UserAssetActivity.kt b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/UserAssetActivity.kt index 7c1e3c18c..edc4e10ef 100644 --- a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/UserAssetActivity.kt +++ b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/UserAssetActivity.kt @@ -49,7 +49,6 @@ class UserAssetActivity : BaseActivity() { val view = binding.root setContentView(view) title = getString(R.string.title_user_asset_setting) - supportActionBar?.setDisplayHomeAsUpEnabled(true) binding.recyclerView.setHasFixedSize(true) binding.recyclerView.layoutManager = LinearLayoutManager(this) From bde37e38a784ae6630b150d182f1d12ca44e24b1 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Sat, 30 Sep 2023 16:29:37 +0800 Subject: [PATCH 6/8] up 1.8.9 --- 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 8d3011958..6243219a3 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 522 - versionName "1.8.8" + versionCode 523 + versionName "1.8.9" } buildTypes { 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 7/8] 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 1dfa3b2bc..ee5d58ff0 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 cc46410a6..a97ee0120 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 06569046b..b07d5c7a0 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 a16027b0b..b8cf2f541 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 d2c7e9138..0d34c0bb3 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 775474731..e4473a131 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 a0be571f8..5b1331a8e 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 7592c6533..efc771cf5 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 651848995..d2399c785 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 c86b8a7c2..346ea0b6a 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 07296e201..d2ff9e90c 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 48fe13f55..7a64ed029 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 eb3c42abd..218301db9 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 660f77c72..2ab9ccf14 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 8/8] 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 2a8f03be4..ddfa49859 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 {