From ccc0a61158b0e1792fe38faae62d15e4fb514890 Mon Sep 17 00:00:00 2001 From: arkon Date: Fri, 31 Jul 2020 14:27:35 -0400 Subject: [PATCH] Shift WebView checks to necessary places only to allow for basic usage --- app/src/main/AndroidManifest.xml | 5 ---- app/src/main/java/eu/kanade/tachiyomi/App.kt | 10 ------- .../network/CloudflareInterceptor.kt | 12 +++++++- .../tachiyomi/ui/main/ForceCloseActivity.kt | 28 ------------------- .../tachiyomi/ui/webview/WebViewActivity.kt | 11 ++++++-- 5 files changed, 20 insertions(+), 46 deletions(-) delete mode 100644 app/src/main/java/eu/kanade/tachiyomi/ui/main/ForceCloseActivity.kt diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 8b77b9172f..8dc22accba 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -39,11 +39,6 @@ android:name="android.app.shortcuts" android:resource="@xml/shortcuts" /> - () { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) + if (!WebViewUtil.supportsWebView(this)) { + toast(R.string.information_webview_required, Toast.LENGTH_LONG) + finish() + } + try { binding = WebviewActivityBinding.inflate(layoutInflater) setContentView(binding.root) } catch (e: Exception) { // Potentially throws errors like "Error inflating class android.webkit.WebView" - ForceCloseActivity.closeApp(this) + toast(R.string.information_webview_required, Toast.LENGTH_LONG) + finish() } title = intent.extras?.getString(TITLE_KEY)