From c2c7cabbaf7c64349cef94c75feb272a931d6ea1 Mon Sep 17 00:00:00 2001 From: Max Lv Date: Thu, 30 Jul 2015 13:35:04 +0800 Subject: [PATCH] refine dns resolve --- gfwlist/gen.py | 26 +++++++++++---------- src/main/AndroidManifest.xml | 4 ++-- src/main/jni/shadowsocks-libev | 2 +- src/main/res/values/arrays.xml | 41 ++++++++++++++++++++++++++++++++-- 4 files changed, 56 insertions(+), 17 deletions(-) diff --git a/gfwlist/gen.py b/gfwlist/gen.py index 791c4831aa..de19789ee9 100644 --- a/gfwlist/gen.py +++ b/gfwlist/gen.py @@ -10,20 +10,21 @@ def main(): china_list_set = IPy.IPSet() - for line in sys.stdin: - line_params = line.split("|") - if len(line_params) < 5 or line_params[2] != "ipv4" or line_params[1] != "CN": - continue - ip_addr = line_params[3] - ip_length = float(line_params[4]) - ip_mask = 32 - int(math.ceil(math.log(ip_length, 2))) - china_list_set.add(IPy.IP("%s/%d" % (ip_addr, ip_mask))) + # for line in sys.stdin: + # line_params = line.split("|") + # if len(line_params) < 5 or line_params[2] != "ipv4" or line_params[1] != "CN": + # continue + # ip_addr = line_params[3] + # ip_length = float(line_params[4]) + # ip_mask = 32 - int(math.ceil(math.log(ip_length, 2))) + # china_list_set.add(IPy.IP("%s/%d" % (ip_addr, ip_mask))) # 添加内网地址 internal_list = IPy.IPSet(map(IPy.IP, [ "0.0.0.0/8", "10.0.0.0/8", "100.64.0.0/10", + "114.114.114.0/24", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", @@ -34,6 +35,7 @@ def main(): "198.18.0.0/15", "198.51.100.0/24", "203.0.113.0/24", + "223.5.5.0/24", "224.0.0.0/4", "240.0.0.0/4", ])) @@ -45,10 +47,10 @@ def main(): for ip in china_list_set: all.discard(ip) - filter = itertools.ifilter(lambda x: len(x) <= 65536, all) - for ip in filter: - all.discard(ip) - all.add(IPy.IP(ip.strNormal(0)).make_net('255.255.0.0')) + # filter = itertools.ifilter(lambda x: len(x) <= 65536, all) + # for ip in filter: + # all.discard(ip) + # all.add(IPy.IP(ip.strNormal(0)).make_net('255.255.0.0')) # 输出结果 for ip in all: diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml index 57ae4ce952..1c36a6e476 100644 --- a/src/main/AndroidManifest.xml +++ b/src/main/AndroidManifest.xml @@ -1,7 +1,7 @@ + android:versionCode="112" + android:versionName="2.7.4"> diff --git a/src/main/jni/shadowsocks-libev b/src/main/jni/shadowsocks-libev index 3af591c565..23ff3bf96a 160000 --- a/src/main/jni/shadowsocks-libev +++ b/src/main/jni/shadowsocks-libev @@ -1 +1 @@ -Subproject commit 3af591c5657c1c2c30a69cab3ca0e5d1f4e3d084 +Subproject commit 23ff3bf96aec807a2e3e31d4a80fcab6e56c11f2 diff --git a/src/main/res/values/arrays.xml b/src/main/res/values/arrays.xml index b82f3c16d5..88fcabaa44 100644 --- a/src/main/res/values/arrays.xml +++ b/src/main/res/values/arrays.xml @@ -85,7 +85,25 @@ 101.0.0.0/8 102.0.0.0/7 104.0.0.0/5 - 112.0.0.0/5 + 112.0.0.0/7 + 114.0.0.0/10 + 114.64.0.0/11 + 114.96.0.0/12 + 114.112.0.0/15 + 114.114.0.0/18 + 114.114.64.0/19 + 114.114.96.0/20 + 114.114.112.0/23 + 114.114.115.0/24 + 114.114.116.0/22 + 114.114.120.0/21 + 114.114.128.0/17 + 114.115.0.0/16 + 114.116.0.0/14 + 114.120.0.0/13 + 114.128.0.0/9 + 115.0.0.0/8 + 116.0.0.0/6 120.0.0.0/6 124.0.0.0/7 126.0.0.0/8 @@ -190,6 +208,25 @@ 203.64.0.0/10 203.128.0.0/9 204.0.0.0/6 - 208.0.0.0/4 + 208.0.0.0/5 + 216.0.0.0/6 + 220.0.0.0/7 + 222.0.0.0/8 + 223.0.0.0/14 + 223.4.0.0/16 + 223.5.0.0/22 + 223.5.4.0/24 + 223.5.6.0/23 + 223.5.8.0/21 + 223.5.16.0/20 + 223.5.32.0/19 + 223.5.64.0/18 + 223.5.128.0/17 + 223.6.0.0/15 + 223.8.0.0/13 + 223.16.0.0/12 + 223.32.0.0/11 + 223.64.0.0/10 + 223.128.0.0/9