forked from HuskyDG/magic_overlayfs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
32 lines (26 loc) · 800 Bytes
/
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
#!/usr/bin/env bash
set -euo pipefail
build_mode="${1:-release}"
cd "$(dirname "$0")"
plugin() {
rm -rf "$1"
git clone "$2" "$1"
}
# <DIRECTORY> <PLUG-IN LINK>
plugin ./native/jni/libcxx http://github.com/huskydg/libcxx || exit 1
plugin ./native/jni/external/selinux https://github.com/topjohnwu/selinux || exit 1
plugin ./native/jni/external/pcre https://android.googlesource.com/platform/external/pcre || exit 1
pushd native
rm -fr libs obj
debug_mode=1
if [[ "$build_mode" == "release" ]]; then
debug_mode=0
fi
ndk-build -j4 NDK_DEBUG=$debug_mode
popd
rm -rf out
mkdir -p out
cp -af magisk-module out
cp -af README.md out/magisk-module
cp -af native/libs/* out/magisk-module/libs
zip -r9 out/magisk-module-release.zip out/magisk-module