Skip to content

Commit

Permalink
fix(android): proper app url check for launching intents (#6451)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile committed Mar 30, 2023
1 parent 5dc164d commit 6f8d1ad
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion android/capacitor/src/main/java/com/getcapacitor/Bridge.java
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,11 @@ public boolean launchIntent(Uri url) {
}
}

if (!url.toString().startsWith(appUrl) && !appAllowNavigationMask.matches(url.getHost())) {
Uri appUri = Uri.parse(appUrl);
if (
!(url.getHost().equals(appUri.getHost()) && url.getScheme().equals(appUri.getScheme())) &&
!appAllowNavigationMask.matches(url.getHost())
) {
try {
Intent openIntent = new Intent(Intent.ACTION_VIEW, url);
getContext().startActivity(openIntent);
Expand Down

0 comments on commit 6f8d1ad

Please sign in to comment.