How to Replace WebView on Android Devices
Replacing WebView on Android devices can help resolve issues caused by outdated versions. However, the process involves risks and requires careful handling. This guide explains the steps to replace WebView, including recommendations, limitations, and troubleshooting methods.
Table of Contents
Compatibility
- Check WebView Compatibility: Make sure to check which kind of WebView (System/Bromium/Chromium/Google) your device uses before trying to update.
- You can check what kind of and which version of WebView the device has in Screen info.
- Physical Access Recommended: WebView replacements can fail, so ensure you have physical access to the device for repairs if needed.
- Stable Internet Connection Required: An unstable connection will cause the replacement process to fail with errors such as:
Error in REPLACE_SYSTEM_WEB_VIE_INITIAL! Reason: Unable to download System WebView application
- Rooted Devices Only: Replacing WebView requires rooted devices.
- Unsupported Platforms: The following platforms do not support WebView replacement or updates:
- Qbic
- Philips
- Vestel
- Sony
- Vendor Restrictions: Custom builds provided by manufacturers may prevent successful updates.
How to Replace WebView
For Version 3.0.x and Later
-
Verify WebView Version:
- Check the current WebView version in Screen Info.
- Ensure compatibility with the replacement WebView type.
-
Choose the Appropriate Command Based on WebView Compatibility:
-
To update the System WebView without manually downloading and hosting the WebView apk yourself:
{"user_command":"ReplaceWebView", "command_data":{"type":"SYSTEM_WEB_VIEW"}}
If there is no
webview.apk
uploaded to your server, or you are unsure what version it is please contact support. -
To replace the Chromium WebView using a custom APK URL:
{"user_command":"ReplaceWebView", "command_data":{"type":"CHROME", "url":"[APK_URL]"}}
-
To replace the Google System WebView using a custom APK URL:
{"user_command":"ReplaceWebView", "command_data":{"type":"GOOGLE_SYSTEM_WEB_VIEW", "url":"[APK_URL]"}}
-
-
Access Command Panel: by navigating to Send Command.
-
Initiate Replacement:
- Send the appropriate command. The device will download the new WebView, reboot to apply changes, and then reboot again after replacing WebView.
For Version 2.21.06.x and Earlier
- Use the following command to replace WebView:
{ "user_command" : "ReplaceWebView" }
How to Repair Device After WebView Replacement Failed?
Repair Locally via ADB
-
Connect to the device using ADB:
- Install ADB tools (Setup Guide).
- Use
adb shell
to access the device's terminal.
-
Gain Superuser Privileges:
- Run
su
for superuser access.
- Run
-
Remount the System Partition:
- Use
mount -o rw,remount /system
. - For Android 9.0 and higher, use
mount -o rw,remount /
.
- Use
-
Delete the Old WebView:
- Navigate to
/system/app
bycd /system/app
. - Check for the WebView folder using
ls -l
. - Remove it using
rm -rf webview
.
- Navigate to
-
Install the New WebView:
-
Move the New WebView to the System Folder:
- Open the shell again
- Navigate to
cd /data/app
to locate the installed WebView incom.android.webview
- Remount the System Partition:
- Use
mount -o rw,remount /system
. - For Android 9.0 and higher, use
mount -o rw,remount /
.
- Use
- Move the installed WebView from the
/data/app
to/system/app
usingmv /data/app/<your-webview> /system/app
. - Rename the folder to
webview
and set permissions to755
using:chown -R root:root webview/
chmod -R 755 webview/
-
Rename the WebView apk file
- Navigate to
cd webview
- Rename the .apk file to
apk mv <old apk name> webview.apk
- Set its permissions to
644
chmod 644 webview.apk
- Navigate to
-
Reboot the Device:
- Restart the device and clear the WebView application data in
Settings > Apps > <Your app name> > Clear data
.
- Restart the device and clear the WebView application data in
Repair Remotely with Terminal Emulator
- Install Terminal Emulator:
- Copy the APK installer for Terminal Emulator to the device.
- Install it via remote connection tools like TeamViewer.
- Perform the Same Steps as ADB:
- Use the Terminal Emulator to gain superuser access (
su
) and remount the system partition. - Follow the same steps to delete, install, and move the WebView APK.
- Use the Terminal Emulator to gain superuser access (
- Reboot and Clear Data:
- Restart the device and clear WebView data to ensure proper functionality.