Skip to content

Commit e773926

Browse files
committed
API 29+ is web interface
1 parent 78ed57d commit e773926

File tree

1 file changed

+7
-22
lines changed

1 file changed

+7
-22
lines changed

app/src/main/java/com/jvdegithub/aiscatcher/MainActivity.java

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -444,29 +444,14 @@ public void onSourceChange () {
444444
updateUIonSource();
445445
}
446446

447-
private boolean shouldUseLegacyMode() {
448-
// Original API level check
449-
int currentApiVersion = android.os.Build.VERSION.SDK_INT;
450-
if (currentApiVersion < android.os.Build.VERSION_CODES.N) {
451-
return true;
452-
}
453447

454-
// Check WebView version for ES2022+ support
455-
try {
456-
PackageInfo webViewPackage = WebViewCompat.getCurrentWebViewPackage(this);
457-
if (webViewPackage != null) {
458-
String version = webViewPackage.versionName;
459-
// Chrome 66 and below don't support ES2022
460-
// Extract major version number and check
461-
if (version != null && version.startsWith("66.")) {
462-
return true; // Force legacy for old WebView
463-
}
448+
private boolean shouldUseLegacyMode() {
449+
// Original API level check
450+
int currentApiVersion = android.os.Build.VERSION.SDK_INT;
451+
if (currentApiVersion < Build.VERSION_CODES.Q) {
452+
return true;
464453
}
465-
} catch (Exception e) {
466-
// If we can't determine WebView version, play it safe
467-
return true;
468-
}
469454

470-
return false;
471-
}
455+
return false;
456+
}
472457
}

0 commit comments

Comments
 (0)