16

I downloaded and installed the latest version of android system WebView from the app store on my android tablet (running 5.0.2).

But apps still go on using the old webview version (39.0.0.0).

How can I get them to switch ?

For info, I've tried disabling the old one, and it get re-enabled when I open an app that uses webview.

  • 2
    Out of curiosity, how do you know which version of Webview an app is using? – DukeSilversJazz Mar 11 '16 at 21:29
  • 1
    I have been testing with several apps, such as Droidscript and WebView Browser and visited whatsmyuseragent – Clémentine Mar 11 '16 at 21:34
  • I've read through the Lollipop source, and this shouldn't be happening. It should use the latest unless the manufacturer has replaced the WebViewFactory class with their own. What exact device/model and manufacturer-supplied version are you running? – Mufasa Mar 21 '16 at 3:56
  • Hi Musafa why did you delete your answer? – Clémentine Mar 21 '16 at 14:56
  • I'm using low-cost tablets, and I tried on several brands (digiflip from flipkart, time2), I'm going to try on the lenovo TAB 2 A7 in the coming days – Clémentine Mar 21 '16 at 14:58
18

You can't change this without root.

The system framework is hard-coded to use a specific package for applications that request a WebView component. By default (in AOSP) it uses the value com.android.webview, which is the version that is compiled during the AOSP build process. On devices from manufacturers that modify this component, the package name may differ. Regardless, in order to replace the WebView that shipped with your device, you have to modify this value to instead be com.google.android.webview.

The "by hand" way of doing this would be to pull the framework-res.apk file from your device, de-compile it, and change the value of the config_webViewPackageName resource variable. It should be located at /res/values/strings.xml within the .apk. Once you've done this, you would need to re-package everything and push the new .apk to your device, replacing the old one.

An alternative method that you can attempt is to install the Xposed framework and then use the WebViewGoogle module. If you use a custom ROM, you may also be able to find a package that will permanently modify the necessary framework components (or it may be built to use Google's WebView by default).

My hypothesis would be that this restriction exists in part because the system relies on a WebView implementation existing in some form, so if it could be modified by a user it could break the system in odd ways. There would also be security implications to allowing apps to override the system WebView, such as a bad-actor attempting to provide a malicious one without the user knowing.

As a point of further explanation: the reason the System WebView is available in the Play Store to begin with is that Nexus devices (and possibly others) ship with it pre-installed, and configured to use it. It is, in effect, the system WebView for those devices.Thus, Google is able to provide WebView updates for these devices via the Play Store so that full system OTAs are not necessary just to update the browser/WebView. There are other components that Google has migrated to Play Store updating in a similar fashion, with the reasoning essentially being that it is faster. Phone and Contacts were two of the more recent ones, with the linked article providing some additional detail regarding why Google has taken this approach.

  • 1
    Thanks for this explaination.. but, what is the use of this android system webview app then? – Clémentine Mar 11 '16 at 21:46
  • 1
    @Clémentine Nexus devices (possibly others) ship with it pre-installed, and configured to use it. It is, in effect, the system WebView for those devices.Thus, Google is able to provide WebView updates for these devices via the Play Store so that full system OTAs are not necessary just to update the browser/WebView. There are other components that Google has migrated to Play Store updating in a similar fashion, with the reasoning essentially being that it is faster. – eldarerathis Mar 11 '16 at 21:48
  • 1
    why are all tablets running lollipop or newer OS not using this as their default system WebView, sounds like a waste! – Clémentine Mar 11 '16 at 21:54
  • 1
    @Clémentine Google's control over third-party manufacturers is somewhat limited. They probably could opt to use Google's closed-source WebView just as Nexus devices do, but they may choose not to for whatever reason. I'm not sure of the specifics regarding how Google licenses their closed-source applications to OEMs, but those terms (whatever they may be) could be a factor in the manufacturer's decision. – eldarerathis Mar 11 '16 at 21:59
  • Thanks for all this info. Shedding light on a lot of questions I had at the back of my mind. Will be looking for a tablet that has it pre-installed then. – Clémentine Mar 11 '16 at 22:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.