use simple list for Kitkat's broken VPNService

This commit is contained in:
Max Lv
2013-11-23 17:34:03 +08:00
parent d68d64f0ab
commit 75d9e57753
2 changed files with 858 additions and 2 deletions
@@ -189,7 +189,6 @@ class ShadowVpnService extends VpnService {
config = Extra.get(intent)
spawn {
if (config.proxy == "198.199.101.152") {
val container = getApplication.asInstanceOf[ShadowsocksApplication].tagContainer
try {
@@ -264,7 +263,13 @@ class ShadowVpnService extends VpnService {
if (InetAddressUtils.isIPv6Address(config.proxy)) {
builder.addRoute("0.0.0.0", 0)
} else if (config.isGFWList) {
val gfwList = getResources.getStringArray(R.array.gfw_list)
val gfwList = {
if (Build.VERSION.SDK_INT == 19) {
getResources.getStringArray(R.array.simple_list)
} else {
getResources.getStringArray(R.array.gfw_list)
}
}
gfwList.foreach(cidr => {
val net = new SubnetUtils(cidr).getInfo
if (!net.isInRange(proxy_address)) {