mirror of
https://github.com/MetaCubeX/ClashMetaForAndroid.git
synced 2024-11-16 04:42:17 +08:00
Improve: remove loopback block & add allow bypass
This commit is contained in:
parent
5224fa656c
commit
094815a098
|
@ -71,9 +71,9 @@ class NetworkSettingsDesign(
|
|||
)
|
||||
|
||||
switch(
|
||||
value = srvStore::blockLoopback,
|
||||
title = R.string.block_loopback,
|
||||
summary = R.string.block_loopback_summary,
|
||||
value = srvStore::allowBypass,
|
||||
title = R.string.allow_bypass,
|
||||
summary = R.string.allow_bypass_summary,
|
||||
configure = vpnDependencies::add,
|
||||
)
|
||||
|
||||
|
|
|
@ -214,4 +214,6 @@
|
|||
<string name="block_loopback">阻止本地回环</string>
|
||||
<string name="block_loopback_summary">阻止本地回环连接</string>
|
||||
<string name="geoip_fallback_code">GeoIP Fallback 区域代码</string>
|
||||
<string name="allow_bypass">允许应用绕过</string>
|
||||
<string name="allow_bypass_summary">允许其他应用绕过 VPN</string>
|
||||
</resources>
|
|
@ -122,6 +122,8 @@
|
|||
<string name="dns_hijacking_summary">Handle all dns packet</string>
|
||||
<string name="block_loopback">Block Loopback</string>
|
||||
<string name="block_loopback_summary">Block loopback connections</string>
|
||||
<string name="allow_bypass">Allow Bypass</string>
|
||||
<string name="allow_bypass_summary">Allows all apps to bypass this VPN connection</string>
|
||||
<string name="system_proxy">System Proxy</string>
|
||||
<string name="system_proxy_summary">Attach http proxy to VpnService</string>
|
||||
<string name="access_control_mode">Access Control Mode</string>
|
||||
|
|
|
@ -200,9 +200,8 @@ class TunService : VpnService(), CoroutineScope by CoroutineScope(Dispatchers.De
|
|||
}
|
||||
}
|
||||
|
||||
val blocking = mutableListOf("$TUN_GATEWAY/$TUN_SUBNET_PREFIX")
|
||||
if (store.blockLoopback) {
|
||||
blocking.add(NET_SUBNET_LOOPBACK)
|
||||
if (store.allowBypass) {
|
||||
allowBypass()
|
||||
}
|
||||
|
||||
TunModule.TunDevice(
|
||||
|
|
|
@ -46,8 +46,8 @@ class ServiceStore(context: Context) {
|
|||
defaultValue = true
|
||||
)
|
||||
|
||||
var blockLoopback by store.boolean(
|
||||
key = "block_loopback",
|
||||
var allowBypass by store.boolean(
|
||||
key = "allow_bypass",
|
||||
defaultValue = true
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user