Skip to content

Commit 48dcb12

Browse files
authored
Merge pull request #11 from arovlad/development
added magisk module
2 parents 02d120a + ce48bc8 commit 48dcb12

File tree

3 files changed

+42
-16
lines changed

3 files changed

+42
-16
lines changed

README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
In order for Bromite SystemWebView to be [installed](https://github.com/bromite/bromite/wiki/Installing-SystemWebView), it must be one of the supported webviews hardcoded in the framework package. Since ROMs typically don't include Bromite SystemWebView among them, the community has developed some methods that allow the framework to be patched in order to include it.
44

5-
This package makes use of a [resource overlay](https://source.android.com/docs/core/architecture/rros) to replace the list of hardcoded webviews with one that also includes the Bromite WebView. I personally find this method more straightforward and elegant, as it does not require root access nor the tedious process of installing Magisk modules or patching the system framework itself manually — if anything breaks the package can simply be removed. Moreover, the WebView itself does not need to be installed as a system app and has no potential risk of breaking SafetyNet.
5+
This package makes use of a [resource overlay](https://source.android.com/docs/core/architecture/rros) to replace the list of hardcoded webviews with one that also includes the Bromite WebView. This method is more straightforward and elegant, as it does not require a rooted device nor the tedious process of installing Magisk modules or patching the system framework itself manually — if anything breaks the package can simply be removed. Moreover, the WebView itself does not need to be installed as a system app and has no potential risk of breaking SafetyNet — e.g. you can install it directly from F-Droid.
6+
7+
Some users have experienced issues with this installation process, so an overlay packaged as a [Magisk module](#magisk) is also provided. It is included for convenience only, and undergoes less frequent testing as the main developer does not endorse Magisk. The officially-endorsed and tested installation method still remains [installing via recovery](#installation).
68

79
![The WebView implementation settings with the Bromite SystemWebView Overlay installed](screenshot.png)
810

9-
Although this method should work on all Android versions that support Bromite and it's WebView, **currently testing has only been done on LineageOS 19.1 for MicroG based on Android 12.1**.
11+
Although this method should work on all Android versions that support Bromite and its WebView, **currently testing has only been done on LineageOS 19.1 for MicroG based on Android 12.1**.
1012

1113
## Prerequisites
1214

@@ -59,6 +61,14 @@ To ensure that the package is installed for both profiles install the package vi
5961
* If everything is ok, you should see the following message:
6062
`org.bromite.webview is NOT installed.`
6163

64+
### Magisk
65+
66+
`BromiteSystemWebViewMagisk.zip` can be installed directly as a Magisk module. Simply copy it on your device, then install it via the normal Magisk UI.
67+
68+
Its main use case is for when you have Magisk already installed, where it works around an issue where some ROMs — in particular MicroG ROMs — do not have enough reserved partition space to install addons. This makes the previous installation options fail, sometimes in non-obvious ways. (Details in arovlad/bromite-webview-overlay#5 and lineageos4microg/docker-lineage-cicd#358)
69+
70+
It performs steps similar to the above, i.e. installs `treble-overlay-bromite-webview.apk` into `/vendor/overlay`, but as a Magisk module. The overlay is performed dynamically by Magisk at boot time, instead of directly modifying the vendor partition (until the next system update overwrites these changes). The OTA survival script is therefore not needed, as Magisk modules are not overwritten by system updates.
71+
6272
## Building
6373

6474
The following dependencies are required:
@@ -76,6 +86,3 @@ Alternatively, you can read a more in-depth guide [here](https://github.com/phhu
7686
## Credits
7787

7888
* [Pierre-Hugues Husson](https://github.com/phhusson) for the guide and toolkit
79-
80-
81-

build.sh

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,35 @@
11
#!/bin/bash
2+
set -e
23

4+
if [ ! -f build/build.sh ]; then
35
echo "Downloading toolkit"
4-
mv .git .git.bak &> /dev/null
5-
git init &> /dev/null
6-
git remote add origin https://github.com/phhusson/vendor_hardware_overlay.git &> /dev/null
7-
git fetch --depth=1 &> /dev/null
8-
git checkout origin/pie build &> /dev/null
9-
rm -f -r .git
10-
mv .git.bak .git &> /dev/null
11-
build/build.sh
12-
echo "Building flashable package"
6+
git clone --depth=1 https://github.com/phhusson/vendor_hardware_overlay.git
7+
( cd vendor_hardware_overlay && git checkout origin/pie build && mv build .. )
8+
fi
9+
10+
echo "Building overlay APK"
11+
( cd build && ./build.sh ../BromiteWebView/Android.mk )
12+
13+
echo "Building flashable package (zip)"
1314
mkdir build/.temp
1415
mkdir -p build/.temp/META-INF/com/google/android
1516
cp update-binary build/.temp/META-INF/com/google/android
16-
echo "# Dummy file; update-binary is a shell script." > build/.temp/META-INF/com/google/android/update-script
17+
echo "# Dummy file; update-binary is a shell script." > build/.temp/META-INF/com/google/android/updater-script
1718
mkdir -p build/.temp/system/addon.d
1819
cp 99-bromite-webview.sh build/.temp/system/addon.d
1920
mkdir -p build/.temp/vendor/overlay
2021
cp build/treble-overlay-bromite-webview.apk build/.temp/vendor/overlay
21-
( cd build/.temp && zip -r ../BromiteSystemWebViewOverlay.zip . ) &> /dev/null
22+
( cd build/.temp && zip -r - . > ../BromiteSystemWebViewOverlay.zip . ) &> /dev/null
23+
rm -r build/.temp
24+
25+
echo "Building Magisk module (zip)"
26+
mkdir build/.temp
27+
mkdir -p build/.temp/META-INF/com/google/android
28+
curl -sL https://github.com/topjohnwu/Magisk/raw/master/scripts/module_installer.sh > build/.temp/META-INF/com/google/android/update-binary
29+
test -s build/.temp/META-INF/com/google/android/update-binary
30+
echo "#MAGISK" > build/.temp/META-INF/com/google/android/updater-script
31+
mkdir -p build/.temp/system/vendor/overlay
32+
cp build/treble-overlay-bromite-webview.apk build/.temp/system/vendor/overlay
33+
cp module.prop build/.temp/
34+
( cd build/.temp && zip -r - . > ../BromiteSystemWebViewMagisk.zip . ) &> /dev/null
2235
rm -r build/.temp

module.prop

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
id=bromite-system-webview
2+
name=Bromite System WebView Overlay
3+
version=v0.3
4+
versionCode=00003
5+
author=arovlad
6+
description=Enable the use of Bromite as the system WebView

0 commit comments

Comments
 (0)