Decode DHL/NL links

This commit is contained in:
M66B 2022-10-03 12:33:49 +02:00
parent 55b2125904
commit 06b34e0597
1 changed files with 12 additions and 0 deletions

View File

@ -330,6 +330,18 @@ public class UriHelper {
Uri result = (s > 0 ? Uri.parse(path.substring(s + 1)) : null);
changed = (result != null);
url = (result == null ? uri : result);
} else if (uri.getHost() != null && uri.getHost().equals("go.dhlparcel.nl")) {
try {
String path = uri.getPath();
int s = path.lastIndexOf('/');
String b = (s > 0 ? new String(Base64.decode(path.substring(s + 1), Base64.URL_SAFE)) : null);
Uri result = (b == null ? null : Uri.parse(b));
changed = (result != null);
url = (result == null ? uri : result);
} catch (Throwable ex) {
Log.i(ex);
url = uri;
}
} else if (uri.getQueryParameterNames().size() == 1) {
// Sophos Email Appliance
Uri result = null;