mirror of
https://github.com/M66B/FairEmail.git
synced 2025-03-15 08:29:24 +00:00
Decode Mandrill tracking links
This commit is contained in:
parent
a1c3ead732
commit
f52f0b665c
1 changed files with 17 additions and 0 deletions
|
@ -29,6 +29,8 @@ import androidx.annotation.NonNull;
|
|||
import androidx.core.net.MailTo;
|
||||
import androidx.core.util.PatternsCompat;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
|
@ -306,6 +308,21 @@ public class UriHelper {
|
|||
Uri result = Uri.parse(uri.getQueryParameter("url"));
|
||||
changed = (result != null);
|
||||
url = (result == null ? uri : result);
|
||||
} else if (uri.getPath() != null &&
|
||||
uri.getPath().startsWith("/track/click") &&
|
||||
uri.getQueryParameter("p") != null) {
|
||||
try {
|
||||
// Mandrill
|
||||
String p = new String(Base64.decode(uri.getQueryParameter("p"), Base64.DEFAULT));
|
||||
JSONObject json = new JSONObject(p);
|
||||
json = new JSONObject(json.getString("p"));
|
||||
Uri result = Uri.parse(json.getString("url"));
|
||||
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;
|
||||
|
|
Loading…
Add table
Reference in a new issue