webview 运行时更新

JonaNorman 45a2342c47 source fix há 1 ano atrás
app 45a2342c47 source fix há 1 ano atrás
core 45a2342c47 source fix há 1 ano atrás
download-source 45a2342c47 source fix há 1 ano atrás
gradle df3e0241df 修改download-source há 1 ano atrás
local-source df3e0241df 修改download-source há 1 ano atrás
preview 6679b25c57 兼容x86 há 1 ano atrás
.gitignore 0b63d349b4 Initial commit há 1 ano atrás
LICENSE 0b63d349b4 Initial commit há 1 ano atrás
README-EN.md 9a875e7748 update readme há 1 ano atrás
README.md a5bcea44d0 Merge branch 'main' of github.com:JonaNorman/WebViewUpgrade há 1 ano atrás
build.gradle df3e0241df 修改download-source há 1 ano atrás
gradle.properties df3e0241df 修改download-source há 1 ano atrás
gradlew 9ca620f967 add file há 1 ano atrás
gradlew.bat 9ca620f967 add file há 1 ano atrás
settings.gradle df3e0241df 修改download-source há 1 ano atrás

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