diff --git a/mobile/src/main/scala/com/github/shadowsocks/ShadowsocksVpnService.scala b/mobile/src/main/scala/com/github/shadowsocks/ShadowsocksVpnService.scala index 8092d488..1efe035f 100644 --- a/mobile/src/main/scala/com/github/shadowsocks/ShadowsocksVpnService.scala +++ b/mobile/src/main/scala/com/github/shadowsocks/ShadowsocksVpnService.scala @@ -159,13 +159,12 @@ class ShadowsocksVpnService extends VpnService with BaseService { def startShadowsocksDaemon() { val cmd = ArrayBuffer[String](getApplicationInfo.nativeLibraryDir + "/libss-local.so", "-V", + "-u", "-b", "127.0.0.1", "-l", profile.localPort.toString, "-t", "600", "-c", buildShadowsocksConfig("ss-local-vpn.conf")) - if (profile.udpdns) cmd += "-u" - if (profile.route != Acl.ALL) { cmd += "--acl" cmd += Acl.getFile(profile.route).getAbsolutePath @@ -242,9 +241,9 @@ class ShadowsocksVpnService extends VpnService with BaseService { if (profile.ipv6) cmd += ("--netif-ip6addr", PRIVATE_VLAN6.formatLocal(Locale.ENGLISH, "2")) - if (profile.udpdns) - cmd += "--enable-udprelay" - else + cmd += "--enable-udprelay" + + if (!profile.udpdns) cmd += ("--dnsgw", "%s:%d".formatLocal(Locale.ENGLISH, PRIVATE_VLAN.formatLocal(Locale.ENGLISH, "1"), profile.localPort + 53))