diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 261df31e81..95e93bd147 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -40,6 +40,11 @@
android:name="android.app.shortcuts"
android:resource="@xml/shortcuts" />
+
() {
binding = MainActivityBinding.inflate(layoutInflater)
- // Enforce WebView availability
- if (!WebViewUtil.supportsWebView(this)) {
- toast(R.string.information_webview_required, Toast.LENGTH_LONG)
- finishAndRemoveTask()
- }
-
// Do not let the launcher create a new activity http://stackoverflow.com/questions/16283079
if (!isTaskRoot) {
finish()
diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/system/WebViewUtil.kt b/app/src/main/java/eu/kanade/tachiyomi/util/system/WebViewUtil.kt
index 3eeb60bc3a..6eaf6bc9f5 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/util/system/WebViewUtil.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/util/system/WebViewUtil.kt
@@ -2,6 +2,7 @@ package eu.kanade.tachiyomi.util.system
import android.content.Context
import android.content.pm.PackageManager
+import android.webkit.CookieManager
import android.webkit.WebView
object WebViewUtil {
@@ -9,9 +10,17 @@ object WebViewUtil {
Regex(""".*Chrome/(\d+)\..*""")
}
- const val MINIMUM_WEBVIEW_VERSION = 79
+ const val MINIMUM_WEBVIEW_VERSION = 80
fun supportsWebView(context: Context): Boolean {
+ try {
+ // May throw android.webkit.WebViewFactory$MissingWebViewPackageException if WebView
+ // is not installed
+ CookieManager.getInstance()
+ } catch (e: Exception) {
+ return false
+ }
+
return context.packageManager.hasSystemFeature(PackageManager.FEATURE_WEBVIEW)
}
}