Android upgrade WebView browser kernel version

Using the system AOSPcompiled by the project Android, you will find that when some APPweb 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 WebViewbuilt-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.61the version WebView, download address

insert image description here
(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 arm64architecture Androidsystem. Therefore, download the corresponding version of apkthe file
insert image description here

3. Replace the WebView browser kernel

(1). \aosp\external\chromium-webview\prebuilt\Replace the file armwith arm64the 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 toapkx86x86_64x86Androidx86Android
insert image description here
insert image description here
\aosp\frameworks\base\core\res\res\xml\config_webview_packages.xmlWebViewcom.android.webviewcom.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.61the versionWebView

6. Related file download

WebView browser kernel apk file_0 point download


asjhan for Android reverse

Guess you like

Origin blog.csdn.net/qq_35993502/article/details/125094948