1

I have some idea on creating Android WebView with custom behavior: https://www.chromium.org/developers/androidwebview/android-webview-beta

How can i create my WebView that can be set as default at system level by users? It seems that this is about replacing of system WebView (and i need to add my WebView to options list, not replace the system one). How can it be distributed and updated (does it require some special signing) without rooting?

There is a one time device set up to remove the existing webview. This is needed because it is not possible to install over the existing apk due to mismatched signing key.

Will it work if i just change the package and install it as regular apk? Can such apk be distributed in Google Play?

PS. I have experience in building of Chromium and creating Chromium fork.

4ntoine
  • 19,816
  • 21
  • 96
  • 220
  • 1
    It's gonna be tricky if not impossible - replacing `WebView` provider is an internal API. If you wanna dive into that, You might need to spend some time sifting through AOSP source code. You might want to start at [package for picking WebView implementation](https://android.googlesource.com/platform/packages/apps/Settings/+/master/src/com/android/settings/webview) in developer settings. – Pawel Nov 23 '18 at 18:32
  • >replacing WebView provider is an internal API. Sorry, i did not catch it - want to let the user decide what actual WebView implementation is used. As far as i can see it's available on production Galaxy s7 with Android 8 (after developer options are enabled). – 4ntoine Nov 23 '18 at 18:46
  • Do you mean selection in developer settings? Because I'm not aware of any app that can be added to that list. – Pawel Nov 23 '18 at 18:49
  • Yes, i'm about that. But thanks for the link - it can help to understand how the suitable packages are found: https://android.googlesource.com/platform/packages/apps/Settings/+/master/src/com/android/settings/webview/WebViewAppPicker.java#71 – 4ntoine Nov 23 '18 at 18:52
  • It looks here is how they are listed: https://android.googlesource.com/platform/frameworks/base/+/master/services/core/java/com/android/server/webkit/SystemImpl.java#82 – 4ntoine Nov 23 '18 at 19:06
  • is it correct that every device manufacture has it's own (or default) `config_webview_packages.xml` and lists suitable packages? eg. https://android.googlesource.com/platform/frameworks/base/+/master/core/res/res/xml/config_webview_packages.xml or https://github.com/opengapps/aosp_build/blob/master/overlay/webview/24/frameworks/base/core/res/res/xml/config_webview_packages.xml – 4ntoine Nov 23 '18 at 19:10

0 Answers0