From b4f4baf2f8de9010a08f9a3989f337d4411ed257 Mon Sep 17 00:00:00 2001 From: mywalk <66966897+mywalkb@users.noreply.github.com> Date: Wed, 1 Nov 2023 14:27:16 +0100 Subject: [PATCH] Fix #23 --- magisk-loader/magisk_module/cli | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/magisk-loader/magisk_module/cli b/magisk-loader/magisk_module/cli index f4069dd65..0cfb7b4a8 100644 --- a/magisk-loader/magisk_module/cli +++ b/magisk-loader/magisk_module/cli @@ -1,15 +1,19 @@ #!/system/bin/sh -if ! which magisk >/dev/null; then - dex_path="/data/adb/modules" -else - dex_path="$(magisk --path)/.magisk/modules" -fi -if [ -d "$dex_path/riru_lsposed" ]; then - dex_path="$dex_path/riru_lsposed" -elif [ -d "$dex_path/zygisk_lsposed" ]; then - dex_path="$dex_path/zygisk_lsposed" -else +dex_path="" +for DEXDIR in /data/adb/modules $(magisk --path)/.magisk/modules +do + if [ -d "$DEXDIR/riru_lsposed" ]; then + dex_path="$DEXDIR/riru_lsposed" + break + elif [ -d "$DEXDIR/zygisk_lsposed" ]; then + dex_path="$DEXDIR/zygisk_lsposed" + break + fi +done + +if [ -z "$dex_path" ] +then echo "No lsposed module path found" exit 1 fi