You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This fixes the verification of Huawei WebViews, which use a different version code
(com.huawei.webview)
In addition, this specifies a mechanism for a `PageFragment` to specify the minimum usable WebView
version
feat: verify webview version and prevent loading blank screen
refactor: use WebViewVersion and WebViewVersionCode value classes and use finish() in PageFragement.kt
refactor: rename checkWebviewVersion to showDialogIfWebViewOutdated and use Context instead of Activity
feat: replace requiresModernWebView() with minimumWebViewVersion property
test: update WebViewUtilsTest to use accurate webview version data
Fix: Add Unit tests and implement selective blocking during importing for outdated webviews
Fixes 19914
Copy file name to clipboardExpand all lines: AnkiDroid/src/test/java/com/ichi2/utils/WebViewUtilsTest.kt
+12-2Lines changed: 12 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ class WebViewUtilsTest {
28
28
checkWebViewVersionComponents(
29
29
"com.google.android.webview",
30
30
"53.0.2785.124",
31
-
OLDEST_WORKING_WEBVIEW_VERSION_CODE-1,
31
+
OLDEST_WORKING_WEBVIEW_VERSION_CODE.value-1,
32
32
"Mozilla/5.0 (Linux; Android 7.0; Android SDK built for arm64 Build/NYC; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/53.0.2785.124 Mobile Safari/537.36",
33
33
),
34
34
equalTo(53),
@@ -50,10 +50,20 @@ class WebViewUtilsTest {
50
50
checkWebViewVersionComponents(
51
51
"com.google.android.webview",
52
52
"74.0.0.0",
53
-
OLDEST_WORKING_WEBVIEW_VERSION_CODE-1,
53
+
OLDEST_WORKING_WEBVIEW_VERSION_CODE.value-1,
54
54
"Mozilla/5.0 (Linux; Android 9; SM-A730F Build/PPR1.180610.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/130.0.6723.102 Mobile Safari/537.36",
55
55
),
56
56
equalTo(null),
57
57
)
58
+
assertThat(
59
+
"Known old huawei webview determined correctly",
60
+
checkWebViewVersionComponents(
61
+
"com.huawei.webview",
62
+
"unknown",
63
+
356L,
64
+
"Mozilla/5.0 (Linux; Android 10; CDY-AN90 Build/HUAWEICDY-AN90; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/78.0.3904.108 Mobile Safari/537.36",
0 commit comments