Commit edda3179 authored by Max Lv's avatar Max Lv

Add China List, close #886

parent 1d799906
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" package="com.github.shadowsocks"
android:versionCode="156"
android:versionName="3.1.4">
android:versionCode="157"
android:versionName="3.1.5">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
......
......@@ -110,7 +110,8 @@
<item>绕过局域网地址</item>
<item>绕过中国大陆地址</item>
<item>绕过局域网及中国大陆地址</item>
<item>仅代理国内无法访问的地址</item>
<item>仅代理中国大陆无法访问的地址</item>
<item>仅代理中国大陆地址</item>
</string-array>
<string name="action_apply_all">应用设置到所有配置文件</string>
......
......@@ -113,6 +113,7 @@
<item>略過中國大陸位址</item>
<item>略過區域網路及中國大陸位址</item>
<item>僅代理大陸屏蔽位址</item>
<item>僅代理大陸位址</item>
</string-array>
<string name="action_apply_all">應用設置到所有配置文件</string>
......
......@@ -44,6 +44,7 @@
<item>bypass-china</item>
<item>bypass-lan-china</item>
<item>gfwlist</item>
<item>china-list</item>
</string-array>
<string-array name="private_route">
......
......@@ -58,6 +58,7 @@
<item>Bypass China</item>
<item>Bypass LAN &amp; China</item>
<item>GFW List</item>
<item>China List</item>
</string-array>
<string name="proxied_apps">Per-App Proxy</string>
<string name="proxied_apps_summary">Set proxy for selected apps, requires NAT mode under Android 4.x</string>
......
......@@ -72,14 +72,16 @@ class ShadowsocksNatService extends BaseService {
def startShadowsocksDaemon() {
if (profile.route != Route.ALL && profile.route != Route.GFWLIST) {
val acl: Array[Array[String]] = profile.route match {
case Route.BYPASS_LAN => Array(getResources.getStringArray(R.array.private_route))
case Route.BYPASS_CHN => Array(getResources.getStringArray(R.array.chn_route))
val acl: Array[String] = profile.route match {
case Route.BYPASS_LAN => getResources.getStringArray(R.array.private_route)
case Route.BYPASS_CHN => getResources.getStringArray(R.array.chn_route)
case Route.BYPASS_LAN_CHN =>
Array(getResources.getStringArray(R.array.private_route), getResources.getStringArray(R.array.chn_route))
getResources.getStringArray(R.array.private_route) ++ getResources.getStringArray(R.array.chn_route)
case Route.CHINALIST =>
Array("[bypass_all]", "[white_list]") ++ getResources.getStringArray(R.array.chn_route)
}
Utils.printToFile(new File(getApplicationInfo.dataDir + "/acl.list"))(p => {
acl.flatten.foreach(p.println)
acl.foreach(p.println)
})
}
......
......@@ -227,14 +227,16 @@ class ShadowsocksVpnService extends VpnService with BaseService {
def startShadowsocksDaemon() {
if (profile.route != Route.ALL && profile.route != Route.GFWLIST) {
val acl: Array[Array[String]] = profile.route match {
case Route.BYPASS_LAN => Array(getResources.getStringArray(R.array.private_route))
case Route.BYPASS_CHN => Array(getResources.getStringArray(R.array.chn_route))
val acl: Array[String] = profile.route match {
case Route.BYPASS_LAN => getResources.getStringArray(R.array.private_route)
case Route.BYPASS_CHN => getResources.getStringArray(R.array.chn_route)
case Route.BYPASS_LAN_CHN =>
Array(getResources.getStringArray(R.array.private_route), getResources.getStringArray(R.array.chn_route))
getResources.getStringArray(R.array.private_route) ++ getResources.getStringArray(R.array.chn_route)
case Route.CHINALIST =>
Array("[bypass_all]", "[white_list]") ++ getResources.getStringArray(R.array.chn_route)
}
Utils.printToFile(new File(getApplicationInfo.dataDir + "/acl.list"))(p => {
acl.flatten.foreach(p.println)
acl.foreach(p.println)
})
}
......
......@@ -196,4 +196,5 @@ object Route {
val BYPASS_CHN = "bypass-china"
val BYPASS_LAN_CHN = "bypass-lan-china"
val GFWLIST = "gfwlist"
val CHINALIST = "china-list"
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment