diff options
author | Arne Schwabe <arne@rfc2549.org> | 2017-05-30 19:21:51 +0200 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2017-05-30 19:21:51 +0200 |
commit | f65cdd5f66430088d29f96a05d86583f2bd9e37c (patch) | |
tree | f68807dcd2397a9c29d0a16c7685cc1d1e67488b | |
parent | 7ee11eff189eb999c5ecf8f726113df63d783739 (diff) |
Decode url parts for internal storage
-rw-r--r-- | main/src/main/java/de/blinkt/openvpn/activities/ConfigConverter.java | 9 |
1 files changed, 9 insertions, 0 deletions
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)); } |