Process redirectUrl in links

This commit is contained in:
M66B 2022-06-23 16:47:42 +02:00
parent 054d827bce
commit baef6153c3
1 changed files with 12 additions and 0 deletions

View File

@ -297,6 +297,18 @@ public class UriHelper {
changed = (result != null);
url = (result == null ? uri : result);
} else if (uri.getQueryParameter("redirectUrl") != null) {
// https://.../link-tracker?redirectUrl=<base64>&sig=...&iat=...&a=...&account=...&email=...&s=...&i=...
try {
byte[] bytes = Base64.decode(uri.getQueryParameter("redirectUrl"), 0);
String u = URLDecoder.decode(new String(bytes), StandardCharsets.UTF_8.name());
Uri result = Uri.parse(u);
changed = (result != null);
url = (result == null ? uri : result);
} catch (Throwable ex) {
Log.i(ex);
url = uri;
}
} else
url = uri;