1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-27 02:07:12 +00:00

Small fix

This commit is contained in:
M66B 2022-10-03 12:18:18 +02:00
parent cacb8e09f9
commit 8ba5669ee4

View file

@ -313,7 +313,7 @@ public class UriHelper {
uri.getQueryParameter("p") != null) {
try {
// Mandrill
String p = new String(Base64.decode(uri.getQueryParameter("p"), Base64.DEFAULT));
String p = new String(Base64.decode(uri.getQueryParameter("p"), Base64.URL_SAFE));
JSONObject json = new JSONObject(p);
json = new JSONObject(json.getString("p"));
Uri result = Uri.parse(json.getString("url"));
@ -330,7 +330,7 @@ public class UriHelper {
String key = uri.getQueryParameterNames().iterator().next();
if (TextUtils.isEmpty(uri.getQueryParameter(key)))
try {
String data = new String(Base64.decode(key, Base64.DEFAULT));
String data = new String(Base64.decode(key, Base64.URL_SAFE));
int v = data.indexOf("ver=");
int u = data.indexOf("&&url=");
if (v == 0 && u > 0)
@ -344,7 +344,7 @@ public class UriHelper {
} 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);
byte[] bytes = Base64.decode(uri.getQueryParameter("redirectUrl"), Base64.URL_SAFE);
String u = URLDecoder.decode(new String(bytes), StandardCharsets.UTF_8.name());
Uri result = Uri.parse(u);
changed = (result != null);