diff --git a/kcptun/go b/kcptun/go index 3549a9d374..f3e7e7b69f 160000 --- a/kcptun/go +++ b/kcptun/go @@ -1 +1 @@ -Subproject commit 3549a9d3740b5cd9d284cdad1d101bd14888cc85 +Subproject commit f3e7e7b69f0fd0c22858d09b4dd3764ed703d140 diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml index 68658f53ff..ebb17b4ffd 100644 --- a/src/main/AndroidManifest.xml +++ b/src/main/AndroidManifest.xml @@ -1,7 +1,7 @@ + android:versionCode="144" + android:versionName="3.0.2"> diff --git a/src/main/scala/com/github/shadowsocks/ShadowsocksVpnService.scala b/src/main/scala/com/github/shadowsocks/ShadowsocksVpnService.scala index c340400067..c9902f56d5 100644 --- a/src/main/scala/com/github/shadowsocks/ShadowsocksVpnService.scala +++ b/src/main/scala/com/github/shadowsocks/ShadowsocksVpnService.scala @@ -182,25 +182,25 @@ class ShadowsocksVpnService extends VpnService with BaseService { /** Called when the activity is first created. */ def handleConnection: Boolean = { - if (!profile.udpdns) { - startDnsDaemon() - startDnsTunnel() + val fd = startVpn() + if (!sendFd(fd)) return false + + if (profile.kcp) { + startKcptunDaemon() } startShadowsocksDaemon() - if (profile.udpdns) { + if (profile.udpdns && profile.kcp) { startShadowsocksUDPDaemon() } - val fd = startVpn() - val ret = sendFd(fd) - - if (ret && profile.kcp) { - startKcptunDaemon() + if (!profile.udpdns) { + startDnsDaemon() + startDnsTunnel() } - ret + true } def startKcptunDaemon() { @@ -274,6 +274,8 @@ class ShadowsocksVpnService extends VpnService with BaseService { if (profile.auth) cmd += "-A" + if (profile.udpdns && !profile.kcp) cmd += "-u" + if (profile.route != Route.ALL) { cmd += "--acl" cmd += (getApplicationInfo.dataDir + "/acl.list")