Commit 056bd56d authored by Max Lv's avatar Max Lv

fix the build

parent 1beb1759
This diff is collapsed.
...@@ -113,9 +113,9 @@ class ShadowsocksVpnService extends VpnService with BaseService { ...@@ -113,9 +113,9 @@ class ShadowsocksVpnService extends VpnService with BaseService {
version version
} }
def isByass(info: SubnetUtils.SubnetInfo): Boolean = { def isByass(util: SubnetUtils): Boolean = {
info.isInRange(config.proxy) || info.isInRange("114.114.114.114") val info = util.getInfo
|| info.isInRange("114.114.115.115") info.isInRange(config.proxy) || info.isInRange("114.114.114.114") || info.isInRange("114.114.115.115")
} }
def startVpn() { def startVpn() {
...@@ -138,7 +138,7 @@ class ShadowsocksVpnService extends VpnService with BaseService { ...@@ -138,7 +138,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
} }
} }
gfwList.foreach(cidr => { gfwList.foreach(cidr => {
val net = new SubnetUtils(cidr).getInfo val net = new SubnetUtils(cidr)
if (!isByass(net)) { if (!isByass(net)) {
val addr = cidr.split('/') val addr = cidr.split('/')
builder.addRoute(addr(0), addr(1).toInt) builder.addRoute(addr(0), addr(1).toInt)
...@@ -149,7 +149,7 @@ class ShadowsocksVpnService extends VpnService with BaseService { ...@@ -149,7 +149,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
if (i != 26 && i != 127) { if (i != 26 && i != 127) {
val addr = i.toString + ".0.0.0" val addr = i.toString + ".0.0.0"
val cidr = addr + "/8" val cidr = addr + "/8"
val net = new SubnetUtils(cidr).getInfo val net = new SubnetUtils(cidr)
if (!isByass(net)) { if (!isByass(net)) {
if (!InetAddress.getByName(addr).isSiteLocalAddress) { if (!InetAddress.getByName(addr).isSiteLocalAddress) {
...@@ -159,7 +159,7 @@ class ShadowsocksVpnService extends VpnService with BaseService { ...@@ -159,7 +159,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
for (j <- 0 to 255) { for (j <- 0 to 255) {
val subAddr = i.toString + "." + j.toString + ".0.0" val subAddr = i.toString + "." + j.toString + ".0.0"
val subCidr = subAddr + "/16" val subCidr = subAddr + "/16"
val subNet = new SubnetUtils(subCidr).getInfo val subNet = new SubnetUtils(subCidr)
if (!isByass(subNet)) { if (!isByass(subNet)) {
if (!InetAddress.getByName(subAddr).isSiteLocalAddress) { if (!InetAddress.getByName(subAddr).isSiteLocalAddress) {
builder.addRoute(subAddr, 16) builder.addRoute(subAddr, 16)
......
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