|
|
@ -5500,6 +5500,30 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
!TextUtils.isEmpty(uri.getQueryParameter("url"))) {
|
|
|
|
!TextUtils.isEmpty(uri.getQueryParameter("url"))) {
|
|
|
|
changed = true;
|
|
|
|
changed = true;
|
|
|
|
url = Uri.parse(uri.getQueryParameter("url"));
|
|
|
|
url = Uri.parse(uri.getQueryParameter("url"));
|
|
|
|
|
|
|
|
} else if ("https".equals(uri.getScheme()) &&
|
|
|
|
|
|
|
|
"www.google.com".equals(uri.getHost()) &&
|
|
|
|
|
|
|
|
uri.getPath() != null &&
|
|
|
|
|
|
|
|
uri.getPath().startsWith("/amp/")) {
|
|
|
|
|
|
|
|
// https://blog.amp.dev/2017/02/06/whats-in-an-amp-url/
|
|
|
|
|
|
|
|
Uri result = null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String u = uri.toString();
|
|
|
|
|
|
|
|
u = u.replace("https://www.google.com/amp/", "");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int p = u.indexOf("/");
|
|
|
|
|
|
|
|
while (p > 0) {
|
|
|
|
|
|
|
|
String segment = u.substring(0, p);
|
|
|
|
|
|
|
|
if (segment.contains(".")) {
|
|
|
|
|
|
|
|
result = Uri.parse("https://" + u);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
u = u.substring(p + 1);
|
|
|
|
|
|
|
|
p = u.indexOf("/");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
changed = (result != null);
|
|
|
|
|
|
|
|
url = (result == null ? uri : result);
|
|
|
|
} else
|
|
|
|
} else
|
|
|
|
url = uri;
|
|
|
|
url = uri;
|
|
|
|
|
|
|
|
|
|
|
|