Fix UDP forward

This commit is contained in:
Max Lv
2016-08-07 10:43:25 +08:00
parent 03c857536d
commit 4817539ca2
3 changed files with 19 additions and 17 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" package="com.github.shadowsocks"
android:versionCode="143"
android:versionName="3.0.1">
android:versionCode="144"
android:versionName="3.0.2">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
@@ -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")