Skip to main content

How to replace WebView on Android devices

Please note

Webview replacements can fail, and it is advisable to have physical access to the device to repair it!

With the 2.x version of the Wallboard application, we started to use Google's WebView. This guide shows you how to replace the WebView on your Android device remotely through the Editor. Devices with outdated WebView version can malfunction.

You can check the WebView version of your device in the Screen info. We recommend replacing the WebView under version 60.

Can I update/replace webview on my device?

Android platform is large and we cannot say if a given device will be able to go through with the webview replace/update. Below are some rule of thumb pointers on what to look out for.

  • WebView replace / update requires rooted devices. If the device is not rooted the update/ replace will not work.
  • You will not be able to replace/update webview version on the following platforms:
    • Qbic
    • Philips
    • Vestel
    • Sony
  • Custom build provided by the vendors may prevent update/replacement to go through

Replace webview

Please note

Make sure the device has stable internet connection before starting the process. Otherwise, webview replace/update will fail!

Error in REPLACE_SYSTEM_WEB_VIE_INITIAL! Reason: Unable to download System WebView application

cant_download

To replace the WebView you need to send a command to the device from the editor.

Right click on the desired screen and go to Manage screens > Send command

send_command

Input one of the following command to the input field and press Send button.

command_modal

Version 3.0.x and up

Download the webview.apk from the CMS server and replaces the Android system WebView

Important

Make sure to check which WebView(System/Chromium/Google) your device uses before sending the command. You can check your WebView version by right clicking the screen in the editor and going to Screen info > Other section.

Please note

You can use the following command to update the System WebView without manually downloading and hosting the webview apk yourself.

{"user_command":"ReplaceWebView", "command_data":{"type":"SYSTEM_WEB_VIEW"}}

The devices will download the WebView from the server which they are connected to.

If there is no webview.apk uploaded to your server by us then the device will not update the WebView. In this case please contact support@wallboard.info.

Command to download the apk from the given URL and replace the Chromium WebView:

{"user_command":"ReplaceWebView", "command_data":{"type":"CHROME", "url":"[APK_URL]"}}

Command to download the apk from the given URL and replace the Google system WebView:

{"user_command":"ReplaceWebView", "command_data":{"type":"GOOGLE_SYSTEM_WEB_VIEW", "url":"[APK_URL]"}}

Your device will now download the new WebView. Once the download is complete the device will reboot.

Version 2.21.06.x and before

{ "user_command" : "ReplaceWebView" }

When the device reboots it will change the WebView and will reboot again.

How to repair device after WebView replace failed?

If the WebView replace failed on your device then you have to follow these steps:

Repair WebView locally through ADB

  1. Open a command prompt on your PC, and connect to your device via ADB. (https://developer.android.com/studio/command-line/adb/)

  2. Once you are connected, use the adb shell command to access the terminal on your device.

  3. First, type su to have superuser privileges.

  4. Remount the device's system partition with the mount -o rw,remount / system command (If your device's Android version is 9.0 or higher then use this command: mount -o rw,remount /)

  5. Then move to the WebView application folder cd /system/app

  6. Here check if there is a folder called WebView ls -l.

  7. If you find the WebView folder then remove it rm -rf webview. Now the WebView is permanently deleted from the device.

  8. Download the latest WebView application from here: https://www.bromite.org/

  9. Exit from the shell with the exit command (sometimes you have to use it twice to exit fully), and install the downloaded WebView application with adb install <path of your downloaded apk>.

  10. Open the shell again (2. And 3. step), and find the installed application's folder cd /data/app/, and if the install was successful then the com.android.webview folder will be there.

  11. Remount the device's system partition with the mount -o rw,remount /system command (If your device's Android version is 9.0 or higher then use this command: mount -o rw,remount /)

  12. Go to the /system/app folder and move the installed webview application from the /data/app folder to the /system/app folder with mv /data/app/<your webview>/system/app

  13. Rename the folder to webview mv <old directory name (which you have just moved here in the previous step)> webview and set its owner and group to root, and its permission to 755 chown -R root:root webview/,chmod -R 755 webview/

  14. Move into the WebView folder with the cd webview command, and rename the .apk file to apk mv <old apk name> webview.apk and set its permissions to 644. chmod 644 webview.apk

  15. Reboot your device.

  16. After the reboot clear the application data. Settings > Apps > <Your app name> > Clear data

Repair WebView remotely with Terminal Emulator

  1. Download Terminal Emulator software to your computer

  2. Connect to the device remotely with TeamViewer for example

  3. Copy the Terminal Emulator installer apk to the storage of the device

  4. Install Terminal Emulator and open it

  • First, type su to have superuser privileges.

  • Remount the device's system partition with the mount -o rw,remount / system command (If your device's Android version is 9.0 or higher then use this command: mount -o rw,remount /)

  • Then move to the WebView application folder cd /system/app

  • Here check if there is a folder called WebView ls -l.

  • If you find the WebView folder then remove it rm -rf webview. Now the WebView is permanently deleted from the device.

  1. Download the latest WebView application from here: https://www.bromite.org/ (arm64/arm/x86_SystemWebView.apk based on the device architecture)

  2. Copy the WebView installer apk to the storage of the device

  3. In Terminal Emulator

  • Install the downloaded WebView application with pm install <path of your downloaded apk>.

  • Open the shell again (2. And 3. step), and find the installed application's folder cd /data/app/, and if the install was successful then the com.android.webview folder will be there.

  • Remount the device's system partition with the mount -o rw,remount /system command (If your device's Android version is 9.0 or higher then use this command: mount -o rw,remount /)

  • Go to the /system/app folder and move the installed webview application from the /data/app folder to the /system/app folder with mv /data/app/<your webview>/system/app

  • Rename the folder to webview mv <old directory name (which you have just moved here in the previous step)> webview and set its owner and group to root, and its permission to 755 chown -R root:root webview/,chmod -R 755 webview/

  • Move into the WebView folder with the cd webview command, and rename the .apk file to apk mv <old apk name> webview.apk and set its permissions to 644. chmod 644 webview.apk

  1. Reboot your device

  2. After the reboot clear the application data. Settings > Apps > <Your app name> > Clear data

If all the steps are done correctly then if you start the application it will start normally.