Skip to content

Commit 55f25d3

Browse files
committed
disable NAT mode on lollipop for now
1 parent 93273cb commit 55f25d3

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import android.Dependencies.{apklib,aar}
44

55
android.Plugin.androidBuild
66

7-
platformTarget in Android := "android-19"
7+
platformTarget in Android := "android-21"
88

99
name := "shadowsocks"
1010

src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
<uses-sdk
1818
android:minSdkVersion="16"
19-
android:targetSdkVersion="19"/>
19+
android:targetSdkVersion="21"/>
2020

2121
<application
2222
android:allowBackup="true"

src/main/scala/com/github/shadowsocks/Shadowsocks.scala

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,6 @@ class Shadowsocks
755755
}
756756

757757
private def setPreferenceEnabled(enabled: Boolean) {
758-
val isRoot = status.getBoolean(Key.isRoot, false)
759758
for (name <- Shadowsocks.PROXY_PREFS) {
760759
val pref = findPreference(name)
761760
if (pref != null) {
@@ -767,7 +766,7 @@ class Shadowsocks
767766
if (pref != null) {
768767
if (Seq(Key.isGlobalProxy, Key.isTrafficStat, Key.proxyedApps)
769768
.contains(name)) {
770-
pref.setEnabled(enabled && isRoot)
769+
pref.setEnabled(enabled && !isVpnEnabled)
771770
} else {
772771
pref.setEnabled(enabled)
773772
}
@@ -875,8 +874,8 @@ class Shadowsocks
875874

876875
def isVpnEnabled: Boolean = {
877876
if (vpnEnabled < 0) {
878-
vpnEnabled = if (Build.VERSION.SDK_INT
879-
>= Build.VERSION_CODES.ICE_CREAM_SANDWICH && !status.getBoolean(Key.isRoot, false)) {
877+
vpnEnabled = if (Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP
878+
|| !status.getBoolean(Key.isRoot, false)) {
880879
1
881880
} else {
882881
0

0 commit comments

Comments
 (0)