To get the current implementation and version of Android WebView , I created this method, which must be valid for each level of the API.
@SuppressLint("PrivateApi") @SuppressWarnings({"unchecked", "JavaReflectionInvocation"}) public @Nullable PackageInfo getCurrentWebViewPackageInfo() { PackageInfo pInfo = null; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
Then you can evaluate the result.
if (pInfo != null) { Log.d("WEBVIEW VERSION", pInfo.packageName + ", " + pInfo.versionName); }
Remember: immediately after updating the WebView application, a crash may appear as described here: fooobar.com/questions/68546 / ... , at this moment this line webViewFactory.getMethod("getLoadedPackageInfo") the above code will return zero. Actually there is nothing you can do to prevent this (this should not happen if the WebView implementation is taken from a Chrome application but not confirmed).
source share