Skip to content

Commit

Permalink
Update build.sh.
Browse files Browse the repository at this point in the history
Use local module-installer.sh, as well as produce packages for both /product and /vendor.
  • Loading branch information
lss4 committed Oct 12, 2023
1 parent a373362 commit dce87a8
Showing 1 changed file with 32 additions and 6 deletions.
38 changes: 32 additions & 6 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,34 @@ fi
echo "Building overlay APK"
( cd build && ./build.sh ../MulchWebView/Android.mk )

echo "Building flashable package (zip)"
## vendor/overlay (A12 and before)

echo "Building flashable package (vendor/overlay)"
mkdir -p build/.temp
mkdir -p build/.temp/META-INF/com/google/android
cp update-binary build/.temp/META-INF/com/google/android
echo "# Dummy file; update-binary is a shell script." > build/.temp/META-INF/com/google/android/updater-script
mkdir -p build/.temp/system/addon.d
cp 99-mulch-webview.sh build/.temp/system/addon.d
mkdir -p build/.temp/vendor/overlay
cp build/treble-overlay-mulch-webview.apk build/.temp/vendor/overlay
( cd build/.temp && zip -r - . > ../MulchSystemWebViewOverlay-vendor.zip . ) &> /dev/null
rm -r build/.temp

echo "Building Magisk module (vendor/overlay)"
mkdir -p build/.temp
mkdir -p build/.temp/META-INF/com/google/android
cp module_installer.sh build/.temp/META-INF/com/google/android/update-binary
echo "#MAGISK" > build/.temp/META-INF/com/google/android/updater-script
mkdir -p build/.temp/system/vendor/overlay
cp build/treble-overlay-mulch-webview.apk build/.temp/system/vendor/overlay
cp module.prop build/.temp/
( cd build/.temp && zip -r - . > ../MulchSystemWebViewMagisk-vendor.zip . ) &> /dev/null
rm -r build/.temp

## product/overlay (A13 and onwards)

echo "Building flashable package (product/overlay)"
mkdir -p build/.temp
mkdir -p build/.temp/META-INF/com/google/android
cp update-binary build/.temp/META-INF/com/google/android
Expand All @@ -19,17 +46,16 @@ mkdir -p build/.temp/system/addon.d
cp 99-mulch-webview.sh build/.temp/system/addon.d
mkdir -p build/.temp/product/overlay
cp build/treble-overlay-mulch-webview.apk build/.temp/product/overlay
( cd build/.temp && zip -r - . > ../MulchSystemWebViewOverlay.zip . ) &> /dev/null
( cd build/.temp && zip -r - . > ../MulchSystemWebViewOverlay-product.zip . ) &> /dev/null
rm -r build/.temp

echo "Building Magisk module (zip)"
echo "Building Magisk module (product/overlay)"
mkdir -p build/.temp
mkdir -p build/.temp/META-INF/com/google/android
curl -sL https://github.com/topjohnwu/Magisk/raw/master/scripts/module_installer.sh > build/.temp/META-INF/com/google/android/update-binary
test -s build/.temp/META-INF/com/google/android/update-binary
cp module_installer.sh build/.temp/META-INF/com/google/android/update-binary
echo "#MAGISK" > build/.temp/META-INF/com/google/android/updater-script
mkdir -p build/.temp/system/product/overlay
cp build/treble-overlay-mulch-webview.apk build/.temp/system/product/overlay
cp module.prop build/.temp/
( cd build/.temp && zip -r - . > ../MulchSystemWebViewMagisk.zip . ) &> /dev/null
( cd build/.temp && zip -r - . > ../MulchSystemWebViewMagisk-product.zip . ) &> /dev/null
rm -r build/.temp

0 comments on commit dce87a8

Please sign in to comment.