-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle failures to parse system WebView version #17441
Handle failures to parse system WebView version #17441
Conversation
Important Maintainers: This PR contains Strings changes
|
I was tempted to say "this was mostly for developers using really old emulators that can't update so just let it pass if we can't parse it" but then I saw that one of them was actually out of date - our minimum is 77 and this was M74:
Which is kind of crazy. So I think experimentation with Brayan's suggestion is really worthwhile - we can likely not crash and only allow webviews that are actually new enough There's a compat API that allows us to use longVersionCode for all APIs As an incremental improvement - that may be sufficient without any ability to suppress+continue so could be cherry-picked easily if it was in one nice commit As a feature, the ability to suppress + continue seems nice but strings are hard to cherry-pick across branches so that would be better as a 2.20 commit and it would need to be separate |
I used the first stable WebView versionCode that I could find, corresponding to version 77.0.3865.73. See https://www.apkmirror.com/apk/google-inc/android-system-webview/android-system-webview-77-0-3865-73-release/ The code will still display the app version to the user if it's available or 0 otherwise with the dialog's text to be modified in the future.
451a138
to
0b2715a
Compare
I switched to using the compat longVersionCode that Brayan suggested. Hope the version code I found is ok, see commit message. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAICT, the webview version code is alright. It looks like it follows a pattern and starts with the third element in the version name.
e.g. 119.0.6045.193
→ 6045193
26
Purpose / Description
There are several reports in acra about crashes in checkWebviewVersion() when parsing the system WebView version. It seems some of those versions appear as "Developer Build" and not a simple number like we expect.
https://ankidroid.org/acra/app/1/bug/256775/report/e8bb99dc-2cb8-4a73-ab66-3491c1e2752f
https://ankidroid.org/acra/app/1/bug/253230/report/6d761065-e7d6-498a-9323-84a68f7fbfd4
Stacktrace:
The fix consists in catching exceptions from version parsing and displaying a dialog about the minimum WebView version. I also added a checkbox to this dialog to hide the dialog on future runs, if the users have a developer build it seems reasonable to expect it's above our minimum WebView version requirements.
The dialog:
I added the Review High Priority label because I think these users can't access the DeckPicker.
How Has This Been Tested?
Not tested, just opened the dialog to see how it looks.
Checklist