diff --git a/kcptun/go b/kcptun/go index 3549a9d3..f3e7e7b6 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 68658f53..ebb17b4f 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 c3404000..c9902f56 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 = { + val fd = startVpn() + if (!sendFd(fd)) return false + + if (profile.kcp) { + startKcptunDaemon() + } + + startShadowsocksDaemon() + + if (profile.udpdns && profile.kcp) { + startShadowsocksUDPDaemon() + } + if (!profile.udpdns) { startDnsDaemon() startDnsTunnel() } - startShadowsocksDaemon() - - if (profile.udpdns) { - startShadowsocksUDPDaemon() - } - - val fd = startVpn() - val ret = sendFd(fd) - - if (ret && profile.kcp) { - startKcptunDaemon() - } - - 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")