From 5c217e6d58163a930a720195e3e708f784ca527e Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Tue, 16 Feb 2016 14:01:13 +0100 Subject: Support OpenVPN 2.2 in profile generation (don't ask) --- main/src/main/java/de/blinkt/openvpn/VpnProfile.java | 12 ++++++++---- .../java/de/blinkt/openvpn/core/OpenVpnManagementThread.java | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'main') diff --git a/main/src/main/java/de/blinkt/openvpn/VpnProfile.java b/main/src/main/java/de/blinkt/openvpn/VpnProfile.java index fe282f33..f52a0ad7 100644 --- a/main/src/main/java/de/blinkt/openvpn/VpnProfile.java +++ b/main/src/main/java/de/blinkt/openvpn/VpnProfile.java @@ -155,11 +155,14 @@ public class VpnProfile implements Serializable, Cloneable { public boolean mAllowedAppsVpnAreDisallowed = true; public String mProfileCreator; - /* Options no long used in new profiles */ + + public boolean mPushPeerInfo=false; + public static final boolean mIsOpenVPN22 = false; + + /* Options no longer used in new profiles */ public String mServerName = "openvpn.blinkt.de"; public String mServerPort = "1194"; public boolean mUseUdp = true; - public boolean mPushPeerInfo=false; public VpnProfile(String name) { mUuid = UUID.randomUUID(); @@ -302,7 +305,8 @@ public class VpnProfile implements Serializable, Cloneable { mConnectRetry = "5"; - cfg += "connect-retry " + mConnectRetry + "\n"; + if (!mIsOpenVPN22 || !mUseUdp) + cfg += "connect-retry " + mConnectRetry + "\n"; cfg += "resolv-retry 60\n"; @@ -509,7 +513,7 @@ public class VpnProfile implements Serializable, Cloneable { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); boolean usesystemproxy = prefs.getBoolean("usesystemproxy", true); - if (usesystemproxy) { + if (usesystemproxy && !mIsOpenVPN22) { cfg += "# Use system proxy setting\n"; cfg += "management-query-proxy\n"; } diff --git a/main/src/main/java/de/blinkt/openvpn/core/OpenVpnManagementThread.java b/main/src/main/java/de/blinkt/openvpn/core/OpenVpnManagementThread.java index 6f14325f..44426e97 100644 --- a/main/src/main/java/de/blinkt/openvpn/core/OpenVpnManagementThread.java +++ b/main/src/main/java/de/blinkt/openvpn/core/OpenVpnManagementThread.java @@ -452,7 +452,7 @@ public class OpenVpnManagementThread implements Runnable, OpenVPNManagement { break; default: - Log.e(TAG, "Unkown needok command " + argument); + Log.e(TAG, "Unknown needok command " + argument); return; } -- cgit v1.2.3