From c842f7fd41007b4c0ad848881d8730f9bd3ea2ff Mon Sep 17 00:00:00 2001 From: Max Lv Date: Mon, 3 Oct 2016 19:47:53 +0800 Subject: [PATCH] Bump version --- src/main/AndroidManifest.xml | 4 ++-- src/main/jni/pdnsd | 2 +- src/main/scala/com/github/shadowsocks/BaseService.scala | 1 + .../com/github/shadowsocks/ShadowsocksNatService.scala | 6 +++--- .../com/github/shadowsocks/ShadowsocksVpnService.scala | 9 +++++---- .../scala/com/github/shadowsocks/utils/Constants.scala | 2 ++ 6 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml index 2e7a57ea..b7e55726 100644 --- a/src/main/AndroidManifest.xml +++ b/src/main/AndroidManifest.xml @@ -1,7 +1,7 @@ + android:versionCode="163" + android:versionName="3.2.3"> diff --git a/src/main/jni/pdnsd b/src/main/jni/pdnsd index eb5c47e5..960c1c64 160000 --- a/src/main/jni/pdnsd +++ b/src/main/jni/pdnsd @@ -1 +1 @@ -Subproject commit eb5c47e5bd6b81ac048686b9826b8e0cda7aa9d4 +Subproject commit 960c1c6469fee0eadc4de86e8e326d6dc787202a diff --git a/src/main/scala/com/github/shadowsocks/BaseService.scala b/src/main/scala/com/github/shadowsocks/BaseService.scala index de5f6bce..e3c620b6 100644 --- a/src/main/scala/com/github/shadowsocks/BaseService.scala +++ b/src/main/scala/com/github/shadowsocks/BaseService.scala @@ -70,6 +70,7 @@ trait BaseService extends Service { var callbacksCount: Int = _ lazy val handler = new Handler(getMainLooper) lazy val restartHanlder = new Handler(getMainLooper) + lazy val protectPath = getApplicationInfo.dataDir + "/protect_path" private val closeReceiver: BroadcastReceiver = (context: Context, intent: Intent) => { Toast.makeText(context, R.string.stopping, Toast.LENGTH_SHORT).show() diff --git a/src/main/scala/com/github/shadowsocks/ShadowsocksNatService.scala b/src/main/scala/com/github/shadowsocks/ShadowsocksNatService.scala index 5743f41b..317feeff 100644 --- a/src/main/scala/com/github/shadowsocks/ShadowsocksNatService.scala +++ b/src/main/scala/com/github/shadowsocks/ShadowsocksNatService.scala @@ -187,17 +187,17 @@ class ShadowsocksNatService extends BaseService { val conf = profile.route match { case Route.BYPASS_CHN | Route.BYPASS_LAN_CHN | Route.GFWLIST => { - ConfigUtils.PDNSD_DIRECT.formatLocal(Locale.ENGLISH, getApplicationInfo.dataDir, + ConfigUtils.PDNSD_DIRECT.formatLocal(Locale.ENGLISH, "", getApplicationInfo.dataDir, "127.0.0.1", profile.localPort + 53, "1.2.4.8, 114.114.114.114", getBlackList, reject, profile.localPort + 63, reject) } case Route.CHINALIST => { - ConfigUtils.PDNSD_DIRECT.formatLocal(Locale.ENGLISH, getApplicationInfo.dataDir, + ConfigUtils.PDNSD_DIRECT.formatLocal(Locale.ENGLISH, "", getApplicationInfo.dataDir, "127.0.0.1", profile.localPort + 53, "8.8.8.8, 208.67.222.222", "", reject, profile.localPort + 63, reject) } case _ => { - ConfigUtils.PDNSD_LOCAL.formatLocal(Locale.ENGLISH, getApplicationInfo.dataDir, + ConfigUtils.PDNSD_LOCAL.formatLocal(Locale.ENGLISH, "", getApplicationInfo.dataDir, "127.0.0.1", profile.localPort + 53, profile.localPort + 63, reject) } } diff --git a/src/main/scala/com/github/shadowsocks/ShadowsocksVpnService.scala b/src/main/scala/com/github/shadowsocks/ShadowsocksVpnService.scala index 81a3de4e..e4da6b5f 100644 --- a/src/main/scala/com/github/shadowsocks/ShadowsocksVpnService.scala +++ b/src/main/scala/com/github/shadowsocks/ShadowsocksVpnService.scala @@ -193,7 +193,7 @@ class ShadowsocksVpnService extends VpnService with BaseService { val cmd = ArrayBuffer(getApplicationInfo.dataDir + "/kcptun" , "-r", profile.host + ":" + profile.kcpPort , "-l", "127.0.0.1:" + (profile.localPort + 90) - , "--path", getApplicationInfo.dataDir + "/protect_path") + , "--path", protectPath) try cmd ++= Utils.translateCommandline(profile.kcpcli) catch { case exc: Exception => throw KcpcliParseException(exc) } @@ -302,19 +302,20 @@ class ShadowsocksVpnService extends VpnService with BaseService { def startDnsDaemon() { val reject = if (profile.ipv6) "224.0.0.0/3" else "224.0.0.0/3, ::/0" + val protect = "protect = \"" + protectPath +"\";" val conf = profile.route match { case Route.BYPASS_CHN | Route.BYPASS_LAN_CHN | Route.GFWLIST => { - ConfigUtils.PDNSD_DIRECT.formatLocal(Locale.ENGLISH, getApplicationInfo.dataDir, + ConfigUtils.PDNSD_DIRECT.formatLocal(Locale.ENGLISH, protect, getApplicationInfo.dataDir, "0.0.0.0", profile.localPort + 53, "114.114.114.114, 119.29.29.29, 1.2.4.8", getBlackList, reject, profile.localPort + 63, reject) } case Route.CHINALIST => { - ConfigUtils.PDNSD_DIRECT.formatLocal(Locale.ENGLISH, getApplicationInfo.dataDir, + ConfigUtils.PDNSD_DIRECT.formatLocal(Locale.ENGLISH, protect, getApplicationInfo.dataDir, "0.0.0.0", profile.localPort + 53, "8.8.8.8, 8.8.4.4, 208.67.222.222", "", reject, profile.localPort + 63, reject) } case _ => { - ConfigUtils.PDNSD_LOCAL.formatLocal(Locale.ENGLISH, getApplicationInfo.dataDir, + ConfigUtils.PDNSD_LOCAL.formatLocal(Locale.ENGLISH, protect, getApplicationInfo.dataDir, "0.0.0.0", profile.localPort + 53, profile.localPort + 63, reject) } } diff --git a/src/main/scala/com/github/shadowsocks/utils/Constants.scala b/src/main/scala/com/github/shadowsocks/utils/Constants.scala index db8bf0a1..e39b7fcd 100644 --- a/src/main/scala/com/github/shadowsocks/utils/Constants.scala +++ b/src/main/scala/com/github/shadowsocks/utils/Constants.scala @@ -69,6 +69,7 @@ object ConfigUtils { """ |global { | perm_cache = 2048; + | %s | cache_dir = "%s"; | server_ip = %s; | server_port = %d; @@ -101,6 +102,7 @@ object ConfigUtils { """ |global { | perm_cache = 2048; + | %s | cache_dir = "%s"; | server_ip = %s; | server_port = %d;