diff options
7 files changed, 23 insertions, 13 deletions
diff --git a/main/build.gradle b/main/build.gradle index 0dd71338..7aa6005d 100644 --- a/main/build.gradle +++ b/main/build.gradle @@ -21,13 +21,12 @@ dependencies { } android { - compileSdkVersion 23 - compileSdkVersion 'android-N' - buildToolsVersion '24.0.0-rc1' + compileSdkVersion 24 + buildToolsVersion '24.0.0' defaultConfig { - minSdkVersion 'N' - targetSdkVersion 'N' + minSdkVersion '14' + targetSdkVersion '24' versionCode = 136 versionName = "0.6.55" } diff --git a/main/src/main/java/de/blinkt/openvpn/VpnProfile.java b/main/src/main/java/de/blinkt/openvpn/VpnProfile.java index 31a52ec0..505406a9 100644 --- a/main/src/main/java/de/blinkt/openvpn/VpnProfile.java +++ b/main/src/main/java/de/blinkt/openvpn/VpnProfile.java @@ -71,7 +71,7 @@ public class VpnProfile implements Serializable, Cloneable { private static final long serialVersionUID = 7085688938959334563L; public static final int MAXLOGLEVEL = 4; public static final int CURRENT_PROFILE_VERSION = 6; - public static final int DEFAULT_MSSFIX_SIZE = 1450; + public static final int DEFAULT_MSSFIX_SIZE = 1280; public static String DEFAULT_DNS1 = "8.8.8.8"; public static String DEFAULT_DNS2 = "8.8.4.4"; diff --git a/main/src/main/java/de/blinkt/openvpn/activities/ConfigConverter.java b/main/src/main/java/de/blinkt/openvpn/activities/ConfigConverter.java index 462e7ee0..050555c6 100644 --- a/main/src/main/java/de/blinkt/openvpn/activities/ConfigConverter.java +++ b/main/src/main/java/de/blinkt/openvpn/activities/ConfigConverter.java @@ -425,12 +425,19 @@ public class ConfigConverter extends BaseActivity implements FileSelectCallback, if (foundfile == null && filename != null && !filename.equals("")) { log(R.string.import_could_not_open, filename); } - - addFileSelectDialog(fileType); + fileSelectMap.put(fileType, null); return foundfile; } + private void addMissingFileDialogs() + { + for (Map.Entry<Utils.FileType, FileSelectLayout> item: fileSelectMap.entrySet()) { + if (item.getValue()==null) + addFileSelectDialog(item.getKey()); + } + } + private void addFileSelectDialog(Utils.FileType type) { Pair<Integer, String> fileDialogInfo = getFileDialogInfo(type); @@ -586,7 +593,6 @@ public class ConfigConverter extends BaseActivity implements FileSelectCallback, mEmbeddedPwFile = embedFile(cp.getAuthUserPassFile(), Utils.FileType.USERPW_FILE, false); } - updateFileSelectDialogs(); } private void updateFileSelectDialogs() { @@ -737,6 +743,9 @@ public class ConfigConverter extends BaseActivity implements FileSelectCallback, @Override protected void onPostExecute(Integer errorCode) { mLogLayout.removeView(mProgress); + addMissingFileDialogs(); + updateFileSelectDialogs(); + if (errorCode == 0) { displayWarnings(); mResult.mName = getUniqueProfileName(possibleName); diff --git a/main/src/main/java/de/blinkt/openvpn/core/ConfigParser.java b/main/src/main/java/de/blinkt/openvpn/core/ConfigParser.java index 57635cf4..38161055 100644 --- a/main/src/main/java/de/blinkt/openvpn/core/ConfigParser.java +++ b/main/src/main/java/de/blinkt/openvpn/core/ConfigParser.java @@ -448,7 +448,7 @@ public class ConfigParser { throw new ConfigParseError("Argument to --mssfix has to be an integer"); } } else { - np.mMssFix = VpnProfile.DEFAULT_MSSFIX_SIZE; + np.mMssFix = 1450; // OpenVPN default size } } diff --git a/main/src/main/java/de/blinkt/openvpn/core/LogFileHandler.java b/main/src/main/java/de/blinkt/openvpn/core/LogFileHandler.java index dbcb13fc..6add8ae0 100644 --- a/main/src/main/java/de/blinkt/openvpn/core/LogFileHandler.java +++ b/main/src/main/java/de/blinkt/openvpn/core/LogFileHandler.java @@ -136,7 +136,7 @@ class LogFileHandler extends Handler { readCacheContents(new FileInputStream(logfile)); - } catch (java.io.IOException | java.lang.RuntimeException e) { + } catch (java.io.IOException | java.lang.RuntimeException e ) { VpnStatus.logError("Reading cached logfile failed"); VpnStatus.logException(e); e.printStackTrace(); diff --git a/main/src/main/java/de/blinkt/openvpn/fragments/Settings_IP.java b/main/src/main/java/de/blinkt/openvpn/fragments/Settings_IP.java index 7ce6dd1c..44f01296 100644 --- a/main/src/main/java/de/blinkt/openvpn/fragments/Settings_IP.java +++ b/main/src/main/java/de/blinkt/openvpn/fragments/Settings_IP.java @@ -59,7 +59,7 @@ public class Settings_IP extends OpenVpnPreferencesFragment implements OnPrefere @Override protected void loadSettings() { - + mUsePull.setChecked(mProfile.mUsePull); mIPv4.setText(mProfile.mIPv4Address); mIPv6.setText(mProfile.mIPv6Address); @@ -71,6 +71,8 @@ public class Settings_IP extends OpenVpnPreferencesFragment implements OnPrefere if (mProfile.mAuthenticationType == VpnProfile.TYPE_STATICKEYS) mUsePull.setChecked(false); + mUsePull.setEnabled(mProfile.mAuthenticationType == VpnProfile.TYPE_STATICKEYS); + // Sets Summary onPreferenceChange(mIPv4, mIPv4.getText()); onPreferenceChange(mIPv6, mIPv6.getText()); diff --git a/main/src/main/java/de/blinkt/openvpn/fragments/VPNProfileList.java b/main/src/main/java/de/blinkt/openvpn/fragments/VPNProfileList.java index 0323ba76..c3763334 100644 --- a/main/src/main/java/de/blinkt/openvpn/fragments/VPNProfileList.java +++ b/main/src/main/java/de/blinkt/openvpn/fragments/VPNProfileList.java @@ -112,7 +112,7 @@ public class VPNProfileList extends ListFragment implements OnClickListener, Vpn } private void startOrStopVPN(VpnProfile profile) { - if (VpnStatus.isVPNActive()) { + if (VpnStatus.isVPNActive() && ProfileManager.getLastConnectedVpn() == profile) { Intent disconnectVPN = new Intent(getActivity(), DisconnectVPN.class); startActivity(disconnectVPN); } else { |