From 3b4ce6d5588c87bcc621a0054166c81de31d63aa Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Wed, 20 Nov 2019 17:48:31 +0100 Subject: Implement importing profiles from Access Server --- .../java/de/blinkt/openvpn/core/ConfigParser.java | 8 +- main/src/main/res/layout/import_as_config.xml | 9 +- main/src/main/res/values/strings.xml | 1 + .../blinkt/openvpn/activities/ConfigConverter.kt | 40 ++- .../de/blinkt/openvpn/fragments/ImportASConfig.kt | 327 +++++++++++++++++++++ .../blinkt/openvpn/fragments/VPNProfileList.java | 277 ++++++++--------- 6 files changed, 499 insertions(+), 163 deletions(-) create mode 100644 main/src/ui/java/de/blinkt/openvpn/fragments/ImportASConfig.kt (limited to 'main/src') 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 88336581..340853d3 100644 --- a/main/src/main/java/de/blinkt/openvpn/core/ConfigParser.java +++ b/main/src/main/java/de/blinkt/openvpn/core/ConfigParser.java @@ -725,9 +725,11 @@ public class ConfigParser { } // Parse OpenVPN Access Server extra - Vector friendlyname = meta.get("FRIENDLY_NAME"); - if (friendlyname != null && friendlyname.size() > 1) - np.mName = friendlyname.get(1); + for (String as_name_directive: new String[]{"PROFILE", "FRIENDLY_NAME"}) { + Vector friendlyname = meta.get(as_name_directive); + if (friendlyname != null && friendlyname.size() > 1) + np.mName = friendlyname.get(1); + } Vector ocusername = meta.get("USERNAME"); diff --git a/main/src/main/res/layout/import_as_config.xml b/main/src/main/res/layout/import_as_config.xml index 27ef3de3..d9651db8 100644 --- a/main/src/main/res/layout/import_as_config.xml +++ b/main/src/main/res/layout/import_as_config.xml @@ -7,6 +7,7 @@ @@ -19,7 +20,7 @@ android:layout_marginRight="4dp" android:layout_marginBottom="4dp" android:hint="@string/as_servername" - android:inputType="textPassword" /> + android:inputType="textUri" /> - -