Require Android 8+

Given that the next stable version of Chrome (120) will require Android 8+, it's
inevitable that the WebView functionality will gradually break. As always, newer
OS versions are recommended for better support with evolving Internet technologies.

According to https://apilevels.com/, Android 8+ still covers 93.7% of Android users.
This commit is contained in:
arkon
2023-11-04 19:20:48 -04:00
parent 4146c4c31d
commit 64c50c1283
15 changed files with 84 additions and 143 deletions

View File

@ -1,7 +1,5 @@
package eu.kanade.tachiyomi.util.system
import android.annotation.TargetApi
import android.os.Build
import android.webkit.WebResourceError
import android.webkit.WebResourceRequest
import android.webkit.WebResourceResponse
@ -28,7 +26,6 @@ abstract class WebViewClientCompat : WebViewClient() {
) {
}
@TargetApi(Build.VERSION_CODES.N)
final override fun shouldOverrideUrlLoading(
view: WebView,
request: WebResourceRequest,

View File

@ -3,7 +3,6 @@ package eu.kanade.tachiyomi.util.system
import android.annotation.SuppressLint
import android.content.Context
import android.content.pm.PackageManager
import android.os.Build
import android.webkit.CookieManager
import android.webkit.WebSettings
import android.webkit.WebView
@ -35,15 +34,11 @@ object WebViewUtil {
}
fun getVersion(context: Context): String {
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val webView = WebView.getCurrentWebViewPackage() ?: return "how did you get here?"
val pm = context.packageManager
val label = webView.applicationInfo.loadLabel(pm)
val version = webView.versionName
"$label $version"
} else {
"Unknown"
}
val webView = WebView.getCurrentWebViewPackage() ?: return "how did you get here?"
val pm = context.packageManager
val label = webView.applicationInfo.loadLabel(pm)
val version = webView.versionName
return "$label $version"
}
fun supportsWebView(context: Context): Boolean {