mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-11-03 23:58:55 +01:00 
			
		
		
		
	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:
		@@ -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,
 | 
			
		||||
 
 | 
			
		||||
@@ -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 {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user