From ca7fe0a3dcdcec7d0cfa77bcff26409e84a9fa9a Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Wed, 4 Jun 2014 12:54:49 +0200 Subject: 4.4.3 should fix the bug where two open tun devices wreck the VPN stack --- .../main/java/de/blinkt/openvpn/core/OpenVpnService.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'main') diff --git a/main/src/main/java/de/blinkt/openvpn/core/OpenVpnService.java b/main/src/main/java/de/blinkt/openvpn/core/OpenVpnService.java index b1f9dbd4..550429a1 100644 --- a/main/src/main/java/de/blinkt/openvpn/core/OpenVpnService.java +++ b/main/src/main/java/de/blinkt/openvpn/core/OpenVpnService.java @@ -740,12 +740,17 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac public String getTunReopenStatus() { String currentConfiguration = getTunConfigString(); - if (currentConfiguration.equals(mLastTunCfg)) + if (currentConfiguration.equals(mLastTunCfg)) { return "NOACTION"; - else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) - return "OPEN_AFTER_CLOSE"; - else - return "OPEN_BEFORE_CLOSE"; + } else { + String release = Build.VERSION.RELEASE; + if (Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT && !release.startsWith("4.4.3") + && !release.startsWith("4.4.4") && !release.startsWith("4.4.5")) + // There will be probably no 4.4.4 or 4.4.5 version, so don't waste effort to do parsing here + return "OPEN_AFTER_CLOSE"; + else + return "OPEN_BEFORE_CLOSE"; + } } public class LocalBinder extends Binder { -- cgit v1.2.3