Check for broken WebView

This commit is contained in:
M66B 2024-05-30 21:50:31 +02:00
parent efb3b41c6d
commit 41a0097df8
1 changed files with 6 additions and 0 deletions

View File

@ -130,6 +130,7 @@ import androidx.preference.PreferenceManager;
import androidx.recyclerview.selection.SelectionTracker;
import androidx.recyclerview.widget.RecyclerView;
import androidx.viewpager.widget.PagerAdapter;
import androidx.webkit.WebViewCompat;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.google.android.material.snackbar.Snackbar;
@ -563,6 +564,11 @@ public class Helper {
private static boolean _hasWebView(Context context) {
try {
// Canary 127.0.6510.0 is broken
PackageInfo pkg = WebViewCompat.getCurrentWebViewPackage(context);
if (pkg != null && pkg.getLongVersionCode() == 651000033)
return false;
PackageManager pm = context.getPackageManager();
if (pm.hasSystemFeature(PackageManager.FEATURE_WEBVIEW)) {
WebView view = new WebView(context);