Skip to content

Commit

Permalink
Fix #23
Browse files Browse the repository at this point in the history
  • Loading branch information
mywalkb committed Nov 1, 2023
1 parent 1cef079 commit b4f4baf
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions magisk-loader/magisk_module/cli
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit b4f4baf

Please sign in to comment.