webview 运行时更新

JonaNorman 85a92d7bd3 修复webview被禁用的手机上status表示失败,status字段被隐藏不能反射,用Parcel方式绕过去 1 yıl önce
app 85a92d7bd3 修复webview被禁用的手机上status表示失败,status字段被隐藏不能反射,用Parcel方式绕过去 1 yıl önce
core 85a92d7bd3 修复webview被禁用的手机上status表示失败,status字段被隐藏不能反射,用Parcel方式绕过去 1 yıl önce
download-source 07969d11a6 加入发布maven gradle 1 yıl önce
gradle df3e0241df 修改download-source 1 yıl önce
local-source df3e0241df 修改download-source 1 yıl önce
preview 6679b25c57 兼容x86 1 yıl önce
.gitignore 0b63d349b4 Initial commit 1 yıl önce
LICENSE 0b63d349b4 Initial commit 1 yıl önce
README-EN.md 9a875e7748 update readme 1 yıl önce
README.md a5bcea44d0 Merge branch 'main' of github.com:JonaNorman/WebViewUpgrade 1 yıl önce
build.gradle df3e0241df 修改download-source 1 yıl önce
gradle.properties 07969d11a6 加入发布maven gradle 1 yıl önce
gradlew 9ca620f967 add file 1 yıl önce
gradlew.bat 9ca620f967 add file 1 yıl önce
publish.gradle 07969d11a6 加入发布maven gradle 1 yıl önce
settings.gradle df3e0241df 修改download-source 1 yıl önce

README-EN.md

WebViewUpgrade

English | 简体中文

This library implements the functionality of upgrading the WebView kernel on Android without installation.

After Android 5.0, upgrading WebView requires installing an APK from Google Play, and even after installation, it may not work as expected. For special device models like Huawei and Amazon, the Chromium version of WebView is generally lower, making it impossible to use Google's WebView instead of the device's own WebView.

I encountered a situation on Huawei devices where H265 video playback was not possible due to the Chromium version of the WebView kernel being lower than 107. To address this issue, H265 playback can be implemented using JavaScript, but this approach may lead to performance issues. At this point, I wondered if WebView could utilize the APK within the application as its kernel. The image below shows the before and after effects of upgrading the WebView kernel:

preview

Before the upgrade, the WebView kernel package name on Huawei devices was com.huawei.webview, with a version of 14.0.0.331. The Chromium version in the UserAgent was actually 99.0.4844.88, as shown in the image below, which does not support H265 playback as it is less than 107:

After successfully upgrading the kernel using the code provided below, H265 video playback becomes possible:

The WebView kernel selection page looks like the image below:

After a successful upgrade, the package name of the WebView kernel changes to com.google.android.webview, and the Chromium version in the UserAgent also changes to 122.0.6261.64:

Compatibility

Android devices vary greatly. The following features and device models have been tested. Contributions through issue submissions and Merge Requests to this project are welcomed.

Feature Characteristics

WebView Package Name System Version
com.google.android.webview 122.0.6261.64
com.android.webview 113.0.5672.136
com.huawei.webview 14.0.0.331
com.android.chrome 122.0.6261.43
com.amazon.webview.chromium 118-5993-tv.5993.155.51

Device Models

Manufacturer System Version
Huawei Mate30 12
Xiaomi 10 11
VIVO NEX A 10
OPPO FIND X5 14

Upcoming Features

  • Multi-process
  • Dynamic Switching

⭐ Star History

Star History Chart

Special Thanks

Stargazers Forkers