diff --git a/src/main/scala/com/github/shadowsocks/ShadowsocksVpnService.scala b/src/main/scala/com/github/shadowsocks/ShadowsocksVpnService.scala index edd5c1ed..84e81243 100644 --- a/src/main/scala/com/github/shadowsocks/ShadowsocksVpnService.scala +++ b/src/main/scala/com/github/shadowsocks/ShadowsocksVpnService.scala @@ -72,6 +72,7 @@ class ShadowsocksVpnService extends VpnService with BaseService { var receiver: BroadcastReceiver = null var apps: Array[ProxiedApp] = null var config: Config = null + var dns = Utils.getDNS val handler: Handler = new Handler() @@ -91,7 +92,7 @@ class ShadowsocksVpnService extends VpnService with BaseService { Path.BASE + "ss-tunnel.pid") .format(config.proxy, config.remotePort, 8153, config.sitekey, config.encMethod) } else { - val conf = ConfigUtils.PDNSD.format("0.0.0.0", getString(R.string.exclude), Utils.getDNS) + val conf = ConfigUtils.PDNSD.format("0.0.0.0", getString(R.string.exclude), dns) ConfigUtils.printToFile(new File(Path.BASE + "pdnsd.conf"))(p => { p.println(conf) }) @@ -115,11 +116,13 @@ class ShadowsocksVpnService extends VpnService with BaseService { def isByass(util: SubnetUtils): Boolean = { val info = util.getInfo - info.isInRange(config.proxy) || info.isInRange("114.114.114.114") || info.isInRange(Utils.getDNS) + info.isInRange(config.proxy) || info.isInRange("114.114.114.114") || info.isInRange(dns) } def startVpn() { + dns = Utils.getDNS + val builder = new Builder() builder .setSession(config.profileName) diff --git a/src/main/scala/com/github/shadowsocks/utils/ConfigUtils.scala b/src/main/scala/com/github/shadowsocks/utils/ConfigUtils.scala index e89a43c8..7688f119 100644 --- a/src/main/scala/com/github/shadowsocks/utils/ConfigUtils.scala +++ b/src/main/scala/com/github/shadowsocks/utils/ConfigUtils.scala @@ -79,7 +79,7 @@ object ConfigUtils { | |server { | label = "google-servers"; - | ip = 8.8.8.8, 8.8.4.4; + | ip = 8.8.8.8, 8.8.4.4, 208.67.222.222, 208.67.220.220; | exclude = %s; | timeout = 5; |}