Using the system AOSP
compiled by the project Android
, you will find that when some APP
web pages are loaded using the browser kernel that comes with the system, an error will be reported, and the web page cannot be loaded. In fact, this is caused by the WebView
built-in browser 浏览器内核版本太旧
. Just update to a newer one. The browser kernel version will do.
1. Environmental preparation
(1) Android system source code compilation environment (Android9.0)
2. Download the new version of WebView browser
(1). 注意科学上网
, download the non-beta version here, the beta version may be unstable, here I download 101.0.4951.61
the version WebView
, download address
(2). The downloading process is cumbersome, and it still needs to be carried out Google账号的登录
. And 浏览器插件的安装
, at the end of the article, I will attach a relatively new one that has been downloaded WebView
(it is actually an apk file after downloading). What I want to compile is the arm64
architecture Android
system. Therefore, download the corresponding version of apk
the file
3. Replace the WebView browser kernel
(1). \aosp\external\chromium-webview\prebuilt\
Replace the file arm
with arm64
the architecture under the path. As for whether to replace it or not, it depends on whether you want to compile the system of the architecture . Here I don’t need to compile the system of the architecture , so ignore it . (2). Modify the configuration file , because The package name of the higher version has changed, so it needs to be modified and will be modified toapk
x86
x86_64
x86
Android
x86
Android
\aosp\frameworks\base\core\res\res\xml\config_webview_packages.xml
WebView
com.android.webview
com.google.android.webview
<webviewproviders>
<!-- The default WebView implementation -->
<!-- <webviewprovider description="Android WebView" packageName="com.android.webview" availableByDefault="true"> -->
<webviewprovider description="Android WebView" packageName="com.google.android.webview" availableByDefault="true">
</webviewprovider>
</webviewproviders>
Fourth, recompile
(1). Execute the command to recompile the Android system
source build/envsetup.sh
lunch 22
make -j32
(2). Brush into the phone
./fastboot flashall
5. Verification
Open the settings of the phone and enter the developer mode to check WebView的实现
whether it is 101.0.4951.61
the versionWebView
6. Related file download
WebView browser kernel apk file_0 point download
asjhan for Android reverse