-
Notifications
You must be signed in to change notification settings - Fork 11
/
build.sh
35 lines (31 loc) · 1.48 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
set -e
if [ ! -f build/build.sh ]; then
echo "Downloading toolkit"
git clone --depth=1 https://github.com/phhusson/vendor_hardware_overlay.git
( cd vendor_hardware_overlay && git checkout origin/pie build && mv build .. )
fi
echo "Building overlay APK"
( cd build && ./build.sh ../MulchWebView/Android.mk )
echo "Building flashable package (zip)"
mkdir 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.zip . ) &> /dev/null
rm -r build/.temp
echo "Building Magisk module (zip)"
mkdir 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
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.zip . ) &> /dev/null
rm -r build/.temp