Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
madeye authored and kaneawk committed Sep 28, 2016
1 parent b888b7c commit 9d624de
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -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="160"
android:versionName="3.2.0">
android:versionCode="161"
android:versionName="3.2.1">

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
Expand Down
1 change: 0 additions & 1 deletion src/main/res/values/arrays.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,5 @@
<item>196.0.0.0/6</item>
<item>200.0.0.0/5</item>
<item>208.0.0.0/4</item>
<item>224.0.0.0/3</item>
</string-array>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -178,18 +178,22 @@ class ShadowsocksNatService extends BaseService {

def startDnsDaemon() {

val reject = if (profile.ipv6) "224.0.0.0/3" else "224.0.0.0/3, ::/0"

val conf = profile.route match {
case Route.BYPASS_CHN | Route.BYPASS_LAN_CHN | Route.GFWLIST => {
ConfigUtils.PDNSD_DIRECT.formatLocal(Locale.ENGLISH, getApplicationInfo.dataDir,
"127.0.0.1", profile.localPort + 53, "1.2.4.8, 114.114.114.114", "", profile.localPort + 63, "")
"127.0.0.1", profile.localPort + 53, "1.2.4.8, 114.114.114.114",
reject, profile.localPort + 63, reject)
}
case Route.CHINALIST => {
ConfigUtils.PDNSD_DIRECT.formatLocal(Locale.ENGLISH, getApplicationInfo.dataDir,
"127.0.0.1", profile.localPort + 53, "8.8.8.8, 208.67.222.222", "", profile.localPort + 63, "")
"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,
"127.0.0.1", profile.localPort + 53, profile.localPort + 63, "")
"127.0.0.1", profile.localPort + 53, profile.localPort + 63, reject)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,19 +296,21 @@ class ShadowsocksVpnService extends VpnService with BaseService {
}

def startDnsDaemon() {
val ipv6 = if (profile.ipv6) "" else "reject = ::/0;"
val reject = if (profile.ipv6) "224.0.0.0/3" else "224.0.0.0/3, ::/0"
val conf = profile.route match {
case Route.BYPASS_CHN | Route.BYPASS_LAN_CHN | Route.GFWLIST => {
ConfigUtils.PDNSD_DIRECT.formatLocal(Locale.ENGLISH, getApplicationInfo.dataDir,
"0.0.0.0", profile.localPort + 53, "1.2.4.8, 114.114.114.114", ipv6, profile.localPort + 63, ipv6)
"0.0.0.0", profile.localPort + 53, "1.2.4.8, 114.114.114.114",
reject, profile.localPort + 63, reject)
}
case Route.CHINALIST => {
ConfigUtils.PDNSD_DIRECT.formatLocal(Locale.ENGLISH, getApplicationInfo.dataDir,
"0.0.0.0", profile.localPort + 53, "8.8.8.8, 208.67.222.222", ipv6, profile.localPort + 63, ipv6)
"0.0.0.0", 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,
"0.0.0.0", profile.localPort + 53, profile.localPort + 63, ipv6)
"0.0.0.0", profile.localPort + 53, profile.localPort + 63, reject)
}
}
Utils.printToFile(new File(getApplicationInfo.dataDir + "/pdnsd-vpn.conf"))(p => {
Expand Down
8 changes: 4 additions & 4 deletions src/main/scala/com/github/shadowsocks/utils/Constants.scala
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ object ConfigUtils {
| label = "local";
| ip = 127.0.0.1;
| port = %d;
| %s
| reject = %s;
| reject_policy = negate;
| reject_recursively = on;
|}
Expand Down Expand Up @@ -117,8 +117,8 @@ object ConfigUtils {
| ip = %s;
| timeout = 3;
| query_method = udp_only;
| %s
| reject_policy = negate;
| reject = %s;
| reject_policy = fail;
| reject_recursively = on;
|}
|
Expand All @@ -127,7 +127,7 @@ object ConfigUtils {
| ip = 127.0.0.1;
| query_method = tcp_only;
| port = %d;
| %s
| reject = %s;
| reject_policy = negate;
| reject_recursively = on;
|}
Expand Down

0 comments on commit 9d624de

Please sign in to comment.