From 805c22a68754d184e74ebe72db5e4c6b118379ea Mon Sep 17 00:00:00 2001 From: j-hc Date: Thu, 23 Mar 2023 14:08:39 +0300 Subject: [PATCH] module: fix kernelsu mount --- README.md | 1 + build.sh | 5 ++++- config-rv-ex.toml | 1 - config.toml | 1 - scripts/customize.sh | 6 +++++- scripts/service.sh | 3 +-- scripts/uninstall.sh | 3 --- 7 files changed, 11 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index d5f5cee..ea73455 100755 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ Get the [latest CI release](https://github.com/j-hc/revanced-magisk-module/relea * receive updates from Magisk app * do not break safetynet or trigger root detections * handle installation of the correct version of the stock app and all that + * support Magisk and KernelSU #### **Note that the [CI workflow](../../actions/workflows/ci.yml) is scheduled to build the modules and APKs everyday using GitHub Actions if there is a change in ReVanced patches. You may want to disable it.** diff --git a/build.sh b/build.sh index 3d62351..d86b950 100755 --- a/build.sh +++ b/build.sh @@ -33,7 +33,9 @@ if [ "$BUILD_MINDETACH_MODULE" = true ] && [ ! -f "mindetach-magisk/mindetach/de pr "mindetach module was not found." BUILD_MINDETACH_MODULE=false fi -PARALLEL_JOBS=$(toml_get "$main_config_t" parallel-jobs) || PARALLEL_JOBS=1 +if ! PARALLEL_JOBS=$(toml_get "$main_config_t" parallel-jobs); then + if [ "$OS" = Android ]; then PARALLEL_JOBS=1; else PARALLEL_JOBS=$(nproc); fi +fi LOGGING_F=$(toml_get "$main_config_t" logging-to-file) && vtf "$LOGGING_F" "logging-to-file" || LOGGING_F=false CONF_PATCHES_VER=$(toml_get "$main_config_t" patches-version) || CONF_PATCHES_VER= CONF_INTEGRATIONS_VER=$(toml_get "$main_config_t" integrations-version) || CONF_INTEGRATIONS_VER= @@ -115,6 +117,7 @@ for table_name in $(toml_get_table_names); do done wait rm -rf temp/tmp.* +if [ -z "$(ls -A1 ${BUILD_DIR})" ]; then abort "All builds failed."; fi if [ "$BUILD_MINDETACH_MODULE" = true ]; then pr "Building mindetach module" diff --git a/config-rv-ex.toml b/config-rv-ex.toml index c9f434d..9777772 100644 --- a/config-rv-ex.toml +++ b/config-rv-ex.toml @@ -2,7 +2,6 @@ compression-level = 9 # compression level for module zips. between 1 and 9 logging-to-file = true # enables logging of every patch process to a seperate file enable-magisk-update = true # set this to false if you do not want to receive updates for the module in magisk app -parallel-jobs = 1 # max number of concurrent building jobs build-mindetach-module = true # extended diff --git a/config.toml b/config.toml index 415b509..505a679 100755 --- a/config.toml +++ b/config.toml @@ -1,7 +1,6 @@ compression-level = 9 # compression level for module zips. between 1 and 9 logging-to-file = true # enables logging of every patch process to a seperate file enable-magisk-update = true # set this to false if you do not want to receive updates for the module in magisk app -parallel-jobs = 1 # max number of concurrent building jobs build-mindetach-module = true # add 'enabled = false' for not patching a specific app or remove its entry diff --git a/scripts/customize.sh b/scripts/customize.sh index 04daabc..a7bc79d 100755 --- a/scripts/customize.sh +++ b/scripts/customize.sh @@ -18,7 +18,7 @@ nsenter -t1 -m -- grep __PKGNAME /proc/mounts | while read -r line; do ui_print "* Un-mount" mp=${line#* } mp=${mp%% *} - nsenter -t1 -m -- umount -l ${mp%%\\*} + nsenter -t1 -m -- umount -l "${mp%%\\*}" done am force-stop __PKGNAME @@ -92,6 +92,10 @@ nohup cmd package compile --reset __PKGNAME >/dev/null 2>&1 & ui_print "* Cleanup" rm -rf $MODPATH/bin $MODPATH/__PKGNAME.apk +for s in "uninstall.sh" "service.sh"; do + sed -i "2 i\NVBASE=${NVBASE}" $MODPATH/$s +done + ui_print "* Done" ui_print " by j-hc (github.com/j-hc)" ui_print " " diff --git a/scripts/service.sh b/scripts/service.sh index d6a70a6..8520c3a 100755 --- a/scripts/service.sh +++ b/scripts/service.sh @@ -1,8 +1,7 @@ #!/system/bin/sh # shellcheck disable=SC2086 MODDIR=${0%/*} -MODULES=${MODDIR%/*} -RVPATH=${MODULES%/*}/rvhc/__PKGNAME_rv.apk +RVPATH=${NVBASE}/rvhc/__PKGNAME_rv.apk until [ "$(getprop sys.boot_completed)" = 1 ]; do sleep 1; done while diff --git a/scripts/uninstall.sh b/scripts/uninstall.sh index 8d991e7..20fa257 100755 --- a/scripts/uninstall.sh +++ b/scripts/uninstall.sh @@ -1,8 +1,5 @@ #!/system/bin/sh { - MODDIR=${0%/*} - MODULES=${MODDIR%/*} - NVBASE=${MODULES%/*} rm $NVBASE/rvhc/__PKGNAME_rv.apk rmdir $NVBASE/rvhc if __ISBNDL :; then