From ea4442e01467b41060fef671c9c3cf198a08cd1e Mon Sep 17 00:00:00 2001 From: Thomas Date: Sat, 4 Apr 2020 12:10:59 +0200 Subject: [PATCH] Fix issue #8 - Support for amp share --- .../java/app/fedilab/nitterizeme/TransformActivity.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/app/fedilab/nitterizeme/TransformActivity.java b/app/src/main/java/app/fedilab/nitterizeme/TransformActivity.java index dbf2010..e3227cb 100644 --- a/app/src/main/java/app/fedilab/nitterizeme/TransformActivity.java +++ b/app/src/main/java/app/fedilab/nitterizeme/TransformActivity.java @@ -282,8 +282,8 @@ public class TransformActivity extends Activity { forwardToBrowser(intent); } } - //AMP URLs (containing /amp/s like Google AMP links) - else if (url.contains("/amp/s")) { + //AMP URLs (containing /amp/s/ like Google AMP links) + else if (url.contains("/amp/s/")) { Intent delegate = new Intent(Intent.ACTION_VIEW); Matcher matcher = ampExtract.matcher(url); String transformedURL = null; @@ -634,6 +634,11 @@ public class TransformActivity extends Activity { } } } + } else if (url.contains("/amp/s/")) { + Matcher matcher = ampExtract.matcher(url); + while (matcher.find()) { + newUrl = "https://" + matcher.group(1); + } } else if (Arrays.asList(youtube_domains).contains(host)) { //Youtube URL boolean invidious_enabled = sharedpreferences.getBoolean(SET_INVIDIOUS_ENABLED, true); if (invidious_enabled) {