Added Sophos fail-safe

pull/205/head
M66B 3 years ago
parent fcead4b6b1
commit decf4dc9d8

@ -230,12 +230,14 @@ public class UriHelper {
} else if (uri.getQueryParameterNames().size() == 1) { } else if (uri.getQueryParameterNames().size() == 1) {
// Sophos Email Appliance // Sophos Email Appliance
Uri result = null; Uri result = null;
String key = uri.getQueryParameterNames().iterator().next(); String key = uri.getQueryParameterNames().iterator().next();
if (TextUtils.isEmpty(uri.getQueryParameter(key))) if (TextUtils.isEmpty(uri.getQueryParameter(key)))
try { try {
String data = new String(Base64.decode(key, Base64.DEFAULT)); String data = new String(Base64.decode(key, Base64.DEFAULT));
int v = data.indexOf("ver=");
int u = data.indexOf("&&url="); int u = data.indexOf("&&url=");
if (u > 0) if (v == 0 && u > 0)
result = Uri.parse(URLDecoder.decode(data.substring(u + 6), StandardCharsets.UTF_8.name())); result = Uri.parse(URLDecoder.decode(data.substring(u + 6), StandardCharsets.UTF_8.name()));
} catch (Throwable ex) { } catch (Throwable ex) {
Log.w(ex); Log.w(ex);

Loading…
Cancel
Save