Commit e9e5c1c0 authored by Max Lv's avatar Max Lv

Fix #2361

parent 402c16e8
...@@ -183,14 +183,18 @@ class VpnService : BaseVpnService(), LocalDnsService.Interface { ...@@ -183,14 +183,18 @@ class VpnService : BaseVpnService(), LocalDnsService.Interface {
if (!profile.bypass) builder.addAllowedApplication(me) if (!profile.bypass) builder.addAllowedApplication(me)
} }
when (profile.route) { if (Build.VERSION.SDK_INT == 29) {
Acl.ALL, Acl.BYPASS_CHN, Acl.CUSTOM_RULES -> builder.addRoute("0.0.0.0", 0) builder.addRoute("0.0.0.0", 0)
else -> { } else {
resources.getStringArray(R.array.bypass_private_route).forEach { when (profile.route) {
val subnet = Subnet.fromString(it)!! Acl.ALL, Acl.BYPASS_CHN, Acl.CUSTOM_RULES -> builder.addRoute("0.0.0.0", 0)
builder.addRoute(subnet.address.hostAddress, subnet.prefixSize) else -> {
resources.getStringArray(R.array.bypass_private_route).forEach {
val subnet = Subnet.fromString(it)!!
builder.addRoute(subnet.address.hostAddress, subnet.prefixSize)
}
builder.addRoute(PRIVATE_VLAN4_ROUTER, 32)
} }
builder.addRoute(PRIVATE_VLAN4_ROUTER, 32)
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment