diff --git a/src/main/java/org/torproject/android/service/vpn/OrbotVpnManager.java b/src/main/java/org/torproject/android/service/vpn/OrbotVpnManager.java index 1e46ce6fa982a1dc2c53772c2988fd06c18049f7..94a32321d5fd9479f75a0ae9068b87c975b169ae 100644 --- a/src/main/java/org/torproject/android/service/vpn/OrbotVpnManager.java +++ b/src/main/java/org/torproject/android/service/vpn/OrbotVpnManager.java @@ -275,8 +275,11 @@ public class OrbotVpnManager implements Handler.Callback { builder.setSession(vpnName); - //route all traffic through VPN (we might offer country specific exclude lists in the future) - builder.addRoute(defaultRoute, 0); + for (String route : mService.getApplicationContext().getResources() + .getStringArray(R.array.all_routes_except_excluded)) { + String[] splitRoute = route.split("/"); + builder.addRoute(splitRoute[0], Integer.parseInt(splitRoute[1])); + } builder.addDnsServer(dummyDNS); builder.addRoute(dummyDNS, 32); diff --git a/src/main/res/values/arrays.xml b/src/main/res/values/arrays.xml new file mode 100644 index 0000000000000000000000000000000000000000..916de8b7ba1493f0e2d76f72f4db97b8968857d9 --- /dev/null +++ b/src/main/res/values/arrays.xml @@ -0,0 +1,133 @@ + + + + 0.0.0.0/5 + 8.0.0.0/7 + 11.0.0.0/8 + 12.0.0.0/6 + 16.0.0.0/4 + 32.0.0.0/3 + 64.0.0.0/7 + 66.0.0.0/10 + 66.64.0.0/12 + 66.80.0.0/13 + 66.88.0.0/14 + 66.92.0.0/15 + 66.94.0.0/23 + 66.94.3.0/24 + 66.94.4.0/23 + 66.94.12.0/22 + 66.94.16.0/20 + 66.94.32.0/19 + 66.94.64.0/18 + 66.94.128.0/17 + 66.95.0.0/16 + 66.96.0.0/11 + 66.128.0.0/11 + 66.160.0.0/13 + 66.168.0.0/14 + 66.172.0.0/15 + 66.175.0.0/16 + 66.176.0.0/12 + 66.192.0.0/10 + 67.0.0.0/8 + 68.0.0.0/8 + 69.0.0.0/10 + 69.64.0.0/12 + 69.80.0.0/15 + 69.84.0.0/14 + 69.88.0.0/13 + 69.104.0.0/13 + 69.112.0.0/12 + 69.128.0.0/9 + 70.0.0.0/9 + 70.128.0.0/10 + 70.224.0.0/11 + 71.0.0.0/8 + 72.128.0.0/9 + 73.0.0.0/8 + 74.0.0.0/8 + 75.0.0.0/9 + 76.0.0.0/6 + 80.0.0.0/4 + 96.0.0.0/8 + 97.64.0.0/10 + 98.0.0.0/7 + 100.0.0.0/6 + 104.0.0.0/5 + 112.0.0.0/4 + 128.0.0.0/3 + 160.0.0.0/5 + 168.0.0.0/8 + 169.0.0.0/9 + 169.128.0.0/10 + 169.192.0.0/11 + 169.224.0.0/12 + 169.240.0.0/13 + 169.248.0.0/14 + 169.252.0.0/15 + 169.255.0.0/16 + 170.0.0.0/7 + 172.0.0.0/12 + 172.32.0.0/11 + 172.64.0.0/10 + 172.128.0.0/9 + 173.0.0.0/8 + 174.0.0.0/9 + 174.128.0.0/10 + 175.0.0.0/8 + 176.0.0.0/4 + 192.0.0.0/9 + 192.128.0.0/11 + 192.160.0.0/13 + 192.169.0.0/16 + 192.170.0.0/15 + 192.172.0.0/14 + 192.176.0.0/12 + 192.192.0.0/10 + 193.0.0.0/8 + 194.0.0.0/7 + 196.0.0.0/6 + 200.0.0.0/5 + 208.0.0.0/11 + 208.32.0.0/12 + 208.48.0.0/14 + 208.52.0.0/15 + 208.55.0.0/16 + 208.56.0.0/13 + 208.64.0.0/10 + 208.128.0.0/9 + 209.0.0.0/8 + 210.0.0.0/7 + 212.0.0.0/6 + 216.0.0.0/5 + 240.0.0.0/5 + 248.0.0.0/6 + 252.0.0.0/7 + 254.0.0.0/8 + 255.0.0.0/9 + 255.128.0.0/10 + 255.192.0.0/11 + 255.224.0.0/12 + 255.240.0.0/13 + 255.248.0.0/14 + 255.252.0.0/15 + 255.254.0.0/16 + 255.255.0.0/17 + 255.255.128.0/18 + 255.255.192.0/19 + 255.255.224.0/20 + 255.255.240.0/21 + 255.255.248.0/22 + 255.255.252.0/23 + 255.255.254.0/24 + 255.255.255.0/25 + 255.255.255.128/26 + 255.255.255.192/27 + 255.255.255.224/28 + 255.255.255.240/29 + 255.255.255.248/30 + 255.255.255.252/31 + 255.255.255.254/32 + + \ No newline at end of file