diff --git a/scripts/customize.sh b/scripts/customize.sh index a471a73..01b2aeb 100755 --- a/scripts/customize.sh +++ b/scripts/customize.sh @@ -66,15 +66,22 @@ RVPATH=$NVBASE/rvhc/__PKGNAME_rv.apk mv -f $MODPATH/base.apk $RVPATH if ! op=$(su -Mc mount -o bind $RVPATH $BASEPATH 2>&1); then - ui_print "ERROR: Mount failed!" ui_print "$op" - abort "Flash the module in official Magisk Manager app" + ui_print "WARNING: Mount failed! Trying in non-global mountspace mode" + if ! op=$(mount -o bind $RVPATH $BASEPATH 2>&1); then + ui_print "ERROR: $op" + abort "Try flasing the module in official Magisk Manager app" + fi fi am force-stop __PKGNAME ui_print "* Optimizing __PKGNAME" cmd package compile --reset __PKGNAME & +ui_print "* Cleanup" rm -rf $MODPATH/bin $MODPATH/__PKGNAME.apk $NVBASE/__PKGNAME_rv.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)" diff --git a/scripts/service.sh b/scripts/service.sh index 64ccc22..a5f63e9 100755 --- a/scripts/service.sh +++ b/scripts/service.sh @@ -1,7 +1,7 @@ #!/system/bin/sh # shellcheck disable=SC2086 MODDIR=${0%/*} -RVPATH=/data/adb/rvhc/__PKGNAME_rv.apk +RVPATH=${NVBASE}/rvhc/__PKGNAME_rv.apk until [ "$(getprop sys.boot_completed)" = 1 ]; do sleep 1; done until [ "$(getprop init.svc.bootanim)" = stopped ]; do sleep 1; done sleep 3 diff --git a/scripts/uninstall.sh b/scripts/uninstall.sh index d3638b5..9499899 100755 --- a/scripts/uninstall.sh +++ b/scripts/uninstall.sh @@ -1,7 +1,7 @@ #!/system/bin/sh { - rm /data/adb/rvhc/__PKGNAME_rv.apk - rmdir /data/adb/rvhc + rm ${NVBASE}/rvhc/__PKGNAME_rv.apk + rmdir ${NVBASE}/rvhc if __ISBNDL :; then until [ "$(getprop sys.boot_completed)" = 1 ]; do sleep 1; done until [ "$(getprop init.svc.bootanim)" = stopped ]; do sleep 1; done