Skip to content

Commit 6f8d1ad

Browse files
authored
fix(android): proper app url check for launching intents (#6451)
1 parent 5dc164d commit 6f8d1ad

File tree

1 file changed

+5
-1
lines changed
  • android/capacitor/src/main/java/com/getcapacitor

1 file changed

+5
-1
lines changed

android/capacitor/src/main/java/com/getcapacitor/Bridge.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,11 @@ public boolean launchIntent(Uri url) {
369369
}
370370
}
371371

372-
if (!url.toString().startsWith(appUrl) && !appAllowNavigationMask.matches(url.getHost())) {
372+
Uri appUri = Uri.parse(appUrl);
373+
if (
374+
!(url.getHost().equals(appUri.getHost()) && url.getScheme().equals(appUri.getScheme())) &&
375+
!appAllowNavigationMask.matches(url.getHost())
376+
) {
373377
try {
374378
Intent openIntent = new Intent(Intent.ACTION_VIEW, url);
375379
getContext().startActivity(openIntent);

0 commit comments

Comments
 (0)