Skip to content

Commit 282160d

Browse files
committed
Fix IPv6 Problem.
1 parent fa26186 commit 282160d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ android {
1717

1818
defaultConfig {
1919
applicationId "com.vm.shadowsocks"
20-
minSdkVersion 14
20+
minSdkVersion 15
2121
targetSdkVersion 25
2222
versionCode 1
2323
versionName "1.1"

app/src/main/java/com/vm/shadowsocks/core/LocalVpnService.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,10 @@ private ParcelFileDescriptor establishVPN() throws Exception {
379379
String value = (String) method.invoke(null, name);
380380
if (value != null && !"".equals(value) && !servers.contains(value)) {
381381
servers.add(value);
382-
builder.addRoute(value, 32);
382+
if (value.replaceAll("\\d", "").length() == 3){//防止IPv6地址导致问题
383+
System.out.println(value);
384+
builder.addRoute(value, 32);
385+
}
383386
if (ProxyConfig.IS_DEBUG)
384387
System.out.printf("%s=%s\n", name, value);
385388
}

0 commit comments

Comments
 (0)