Add VPN bypass LAN option

https://github.com/2dust/v2rayNG/pull/4208
This commit is contained in:
2dust
2025-01-01 16:43:48 +08:00
parent daca0831a4
commit 833a1e06f0
15 changed files with 92 additions and 1 deletions
@@ -117,6 +117,14 @@ object SettingsManager {
}
fun routingRulesetsBypassLan(): Boolean {
val vpnBypassLan = MmkvManager.decodeSettingsString(AppConfig.PREF_VPN_BYPASS_LAN) ?: "0"
if (vpnBypassLan == "1") {
return true
} else if (vpnBypassLan == "2") {
return false
}
//Follow config
val guid = MmkvManager.getSelectServer() ?: return false
val config = MmkvManager.decodeServerConfig(guid) ?: return false
if (config.configType == EConfigType.CUSTOM) {
@@ -133,7 +141,7 @@ object SettingsManager {
it.domain?.contains(GEOSITE_PRIVATE) == true || it.ip?.contains(GEOIP_PRIVATE) == true
}
return exist == true
}
}
fun swapRoutingRuleset(fromPosition: Int, toPosition: Int) {
val rulesetList = MmkvManager.decodeRoutingRulesets()