From f65cdd5f66430088d29f96a05d86583f2bd9e37c Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Tue, 30 May 2017 19:21:51 +0200 Subject: Decode url parts for internal storage --- .../main/java/de/blinkt/openvpn/activities/ConfigConverter.java | 9 +++++++++ 1 file changed, 9 insertions(+) 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 b1b38189..e3eed074 100644 --- a/main/src/main/java/de/blinkt/openvpn/activities/ConfigConverter.java +++ b/main/src/main/java/de/blinkt/openvpn/activities/ConfigConverter.java @@ -48,6 +48,8 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -492,9 +494,16 @@ public class ConfigConverter extends BaseActivity implements FileSelectCallback, if (path.indexOf(':') != -1 && path.lastIndexOf('/') > path.indexOf(':')) { String possibleDir = path.substring(path.indexOf(':') + 1, path.length()); + // Unquote chars in the path + try { + possibleDir = URLDecoder.decode(possibleDir, "UTF-8"); + } catch (UnsupportedEncodingException ignored) {} + possibleDir = possibleDir.substring(0, possibleDir.lastIndexOf('/')); + + dirlist.add(new File(sdcard, possibleDir)); } -- cgit v1.2.3