From 827e59fe139e6378a99517d82e06c8e296b5c65c Mon Sep 17 00:00:00 2001 From: Arcadius Ahouansou Date: Wed, 17 May 2023 23:53:33 +0100 Subject: [PATCH 1/3] Support for Amazon Fire https://github.com/ionic-team/capacitor/issues/6602 --- .../src/main/java/com/getcapacitor/Bridge.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/android/capacitor/src/main/java/com/getcapacitor/Bridge.java b/android/capacitor/src/main/java/com/getcapacitor/Bridge.java index 532afadb6e..1ddfb6745d 100644 --- a/android/capacitor/src/main/java/com/getcapacitor/Bridge.java +++ b/android/capacitor/src/main/java/com/getcapacitor/Bridge.java @@ -359,10 +359,26 @@ public boolean isMinimumWebViewInstalled() { Logger.warn("Unable to get package info for 'com.android.webview'" + ex.toString()); } + final int amazonFireMajorWebViewVersion = extractWebViewMajorVersion(pm, "com.amazon.webview.chromium"); + if (amazonFireMajorWebViewVersion >= config.getMinWebViewVersion()) { + return true; + } + // Could not detect any webview, return false return false; } + private int extractWebViewMajorVersion(final PackageManager pm, final String webViewPackageName) { + try { + final PackageInfo info = InternalUtils.getPackageInfo(pm, webViewPackageName); + final String majorVersionStr = info.versionName.split("\\.")[0]; + final int majorVersion = Integer.parseInt(majorVersionStr); + return majorVersion; + } catch (Exception ex) { + Logger.warn(String.format("Unable to get package info for '%s' with err '%s'", webViewPackageName, ex)); + } + return 0; + } public boolean launchIntent(Uri url) { /* * Give plugins the chance to handle the url From 3cc575abd442b5715ecd999a0fb982181b87c3cb Mon Sep 17 00:00:00 2001 From: Mark Anderson Date: Tue, 14 Nov 2023 12:25:58 -0500 Subject: [PATCH 2/3] style: fmt --- android/capacitor/src/main/java/com/getcapacitor/Bridge.java | 1 + 1 file changed, 1 insertion(+) diff --git a/android/capacitor/src/main/java/com/getcapacitor/Bridge.java b/android/capacitor/src/main/java/com/getcapacitor/Bridge.java index b46fdb8a07..29fd92de4c 100644 --- a/android/capacitor/src/main/java/com/getcapacitor/Bridge.java +++ b/android/capacitor/src/main/java/com/getcapacitor/Bridge.java @@ -349,6 +349,7 @@ private int extractWebViewMajorVersion(final PackageManager pm, final String web } return 0; } + public boolean launchIntent(Uri url) { /* * Give plugins the chance to handle the url From 7cf3fe2238b8ab880342fde02dd6d67ffc20b845 Mon Sep 17 00:00:00 2001 From: Mark Anderson Date: Tue, 28 Nov 2023 13:57:40 -0500 Subject: [PATCH 3/3] style: fmt --- android/capacitor/src/main/java/com/getcapacitor/Bridge.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/capacitor/src/main/java/com/getcapacitor/Bridge.java b/android/capacitor/src/main/java/com/getcapacitor/Bridge.java index 29fd92de4c..f46f684dba 100644 --- a/android/capacitor/src/main/java/com/getcapacitor/Bridge.java +++ b/android/capacitor/src/main/java/com/getcapacitor/Bridge.java @@ -349,7 +349,7 @@ private int extractWebViewMajorVersion(final PackageManager pm, final String web } return 0; } - + public boolean launchIntent(Uri url) { /* * Give plugins the chance to handle the url