mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-23 06:31:17 +00:00
Decode Sophos Email Appliance proxy links
This commit is contained in:
parent
86ae66c88a
commit
c71664fcda
1 changed files with 19 additions and 0 deletions
|
@ -41,6 +41,7 @@ import android.text.TextWatcher;
|
||||||
import android.text.method.LinkMovementMethod;
|
import android.text.method.LinkMovementMethod;
|
||||||
import android.text.style.ForegroundColorSpan;
|
import android.text.style.ForegroundColorSpan;
|
||||||
import android.text.style.StyleSpan;
|
import android.text.style.StyleSpan;
|
||||||
|
import android.util.Base64;
|
||||||
import android.util.Pair;
|
import android.util.Pair;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
|
@ -65,6 +66,8 @@ import androidx.preference.PreferenceManager;
|
||||||
|
|
||||||
import java.net.IDN;
|
import java.net.IDN;
|
||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -569,6 +572,22 @@ public class FragmentDialogOpenLink extends FragmentDialogBase {
|
||||||
p = u.indexOf("/");
|
p = u.indexOf("/");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
changed = (result != null);
|
||||||
|
url = (result == null ? uri : result);
|
||||||
|
} else if (uri.getQueryParameterNames().size() == 1) {
|
||||||
|
// Sophos Email Appliance
|
||||||
|
Uri result = null;
|
||||||
|
String key = uri.getQueryParameterNames().iterator().next();
|
||||||
|
if (TextUtils.isEmpty(uri.getQueryParameter(key)))
|
||||||
|
try {
|
||||||
|
String data = new String(Base64.decode(key, Base64.DEFAULT));
|
||||||
|
int u = data.indexOf("&&url=");
|
||||||
|
if (u > 0)
|
||||||
|
result = Uri.parse(URLDecoder.decode(data.substring(u + 6), StandardCharsets.UTF_8.name()));
|
||||||
|
} catch (Throwable ex) {
|
||||||
|
Log.w(ex);
|
||||||
|
}
|
||||||
|
|
||||||
changed = (result != null);
|
changed = (result != null);
|
||||||
url = (result == null ? uri : result);
|
url = (result == null ? uri : result);
|
||||||
} else
|
} else
|
||||||
|
|
Loading…
Reference in a new issue