mirror of https://github.com/M66B/FairEmail.git
Refactoring
This commit is contained in:
parent
faf1993482
commit
798fd32c19
|
@ -336,18 +336,6 @@ public class UriHelper {
|
||||||
Uri result = (s > 0 ? Uri.parse(path.substring(s + 1)) : null);
|
Uri result = (s > 0 ? Uri.parse(path.substring(s + 1)) : null);
|
||||||
changed = (result != null && isHyperLink(result));
|
changed = (result != null && isHyperLink(result));
|
||||||
url = (changed ? result : uri);
|
url = (changed ? result : uri);
|
||||||
} else if (uri.getQueryParameter("redirectUrl") != null) {
|
|
||||||
// https://.../link-tracker?redirectUrl=<base64>&sig=...&iat=...&a=...&account=...&email=...&s=...&i=...
|
|
||||||
Uri result = null;
|
|
||||||
try {
|
|
||||||
byte[] bytes = Base64.decode(uri.getQueryParameter("redirectUrl"), Base64.URL_SAFE);
|
|
||||||
String u = URLDecoder.decode(new String(bytes), StandardCharsets.UTF_8.name());
|
|
||||||
result = Uri.parse(u);
|
|
||||||
} catch (Throwable ex) {
|
|
||||||
Log.i(ex);
|
|
||||||
}
|
|
||||||
changed = (result != null && isHyperLink(result));
|
|
||||||
url = (changed ? result : uri);
|
|
||||||
} else {
|
} else {
|
||||||
Uri result = null;
|
Uri result = null;
|
||||||
|
|
||||||
|
@ -408,6 +396,17 @@ public class UriHelper {
|
||||||
Log.e(ex);
|
Log.e(ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (result == null &&
|
||||||
|
uri.getQueryParameter("redirectUrl") != null)
|
||||||
|
// https://.../link-tracker?redirectUrl=<base64>&sig=...&iat=...&a=...&account=...&email=...&s=...&i=...
|
||||||
|
try {
|
||||||
|
byte[] bytes = Base64.decode(uri.getQueryParameter("redirectUrl"), Base64.URL_SAFE);
|
||||||
|
String u = URLDecoder.decode(new String(bytes), StandardCharsets.UTF_8.name());
|
||||||
|
result = Uri.parse(u);
|
||||||
|
} catch (Throwable ex) {
|
||||||
|
Log.i(ex);
|
||||||
|
}
|
||||||
|
|
||||||
changed = (result != null && isHyperLink(result));
|
changed = (result != null && isHyperLink(result));
|
||||||
url = (changed ? result : uri);
|
url = (changed ? result : uri);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue