Android system Webview installed but not used by apps


Question

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.


Answer

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.


Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes