From 8244abcbe099551794a26933301e4154ab87c61e Mon Sep 17 00:00:00 2001 From: Dimitris Dafnis <68849116+jim-daf@users.noreply.github.com> Date: Wed, 22 Apr 2026 20:47:24 +0200 Subject: [PATCH] Handle https://aw.app/openurl?url=... universal links The DeepLinkService only recognised the legacy lower case marker openURL?q= which is what awallet:// custom scheme links use. Universal links coming from the web (https://aw.app/openurl?url=...) were not unwrapped, so the embedded URL never reached the in app browser. Strip the AW_APP host prefix when present and accept the openurl?url= variant in addition to openURL?q=. Fixes #2411 --- .../alphawallet/app/service/DeepLinkService.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/src/main/java/com/alphawallet/app/service/DeepLinkService.java b/app/src/main/java/com/alphawallet/app/service/DeepLinkService.java index 4d7f61f684..192e4d98f7 100644 --- a/app/src/main/java/com/alphawallet/app/service/DeepLinkService.java +++ b/app/src/main/java/com/alphawallet/app/service/DeepLinkService.java @@ -24,6 +24,8 @@ public class DeepLinkService public static final String WC_COMMAND = "wc:"; public static final String AW_PREFIX = "awallet://"; public static final String OPEN_URL_PREFIX = "openURL?q="; + // Lower case variant produced by web pages that link to https://aw.app/openurl?url=... + public static final String OPEN_URL_PREFIX_WEB = "openurl?url="; public static DeepLinkRequest parseIntent(String importData, Intent startIntent) { @@ -39,11 +41,23 @@ public static DeepLinkRequest parseIntent(String importData, Intent startIntent) importData = importData.substring(AW_PREFIX.length()); } + // Universal links arrive as https://aw.app/openurl?url=... so strip the + // host part too before we look for the openURL marker. + if (importData.startsWith(AW_APP)) + { + importData = importData.substring(AW_APP.length()); + } + if (importData.startsWith(OPEN_URL_PREFIX)) { isOpenURL = true; importData = importData.substring(OPEN_URL_PREFIX.length()); } + else if (importData.startsWith(OPEN_URL_PREFIX_WEB)) + { + isOpenURL = true; + importData = importData.substring(OPEN_URL_PREFIX_WEB.length()); + } importData = Utils.universalURLDecode(importData);