-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from dawn-lc/main
修复 magisk busybox 路径错误
- Loading branch information
Showing
2 changed files
with
23 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,31 @@ | ||
|
||
#!/system/bin/sh | ||
if [ "$BOOTMODE" != true ]; then | ||
ui_print "-----------------------------------------------------------" | ||
ui_print "! Please install in Magisk Manager or KernelSU Manager or APatch Manager" | ||
ui_print "! Install from recovery is NOT supported" | ||
abort "-----------------------------------------------------------" | ||
fi | ||
|
||
cd ${MODPATH} | ||
cronDataDir='/data/adb/crond' | ||
crontabCmd="${MODPATH}/system/xbin/crontab" | ||
|
||
if [ ! -d ${cronDataDir} ];then | ||
ui_print "mkdir ${cronDataDir}" | ||
mkdir -p ${cronDataDir} | ||
touch ${cronDataDir}/root | ||
fi | ||
|
||
ui_print "- Installed crontab cmd to ${crontabCmd}" | ||
echo '#!/system/bin/sh' >${crontabCmd} | ||
|
||
if [ "$KSU" = true ]; then | ||
ui_print "- kernelSU version: $KSU_VER ($KSU_VER_CODE)" | ||
echo '/data/adb/ksu/bin/busybox crontab -c '${cronDataDir}' $@' >> ${crontabCmd} | ||
elif [ "$APATCH" = true ]; then | ||
ui_print "- APatch version: $APATCH_VER ($APATCH_VER_CODE)" | ||
echo '/data/adb/ap/bin/busybox crontab -c '${cronDataDir}' $@' >> ${crontabCmd} | ||
else | ||
ui_print "- Magisk version: $MAGISK_VER ($MAGISK_VER_CODE)" | ||
echo '/data/adb/magisk/bin/busybox crontab -c '${cronDataDir}' $@' >> ${crontabCmd} | ||
if [ ! -d "${cronDataDir}" ]; then | ||
ui_print "- Creating ${cronDataDir}" | ||
mkdir -p "${cronDataDir}" && touch "${cronDataDir}/root" | ||
fi | ||
|
||
ui_print "set_perm" | ||
|
||
set_perm ${crontabCmd} 0 0 0755 | ||
set_perm $MODPATH/service.sh 0 0 0755 | ||
set_perm $MODPATH/uninstall.sh 0 0 0755 | ||
|
||
ui_print "done" | ||
ui_print "- Installing crontab command" | ||
mkdir -p "${MODPATH}/system/xbin" | ||
{ | ||
echo "#!/system/bin/sh" | ||
if [ "$KSU" = true ]; then | ||
echo "/data/adb/ksu/bin/busybox crontab -c '${cronDataDir}' $@" | ||
elif [ "$APATCH" = true ]; then | ||
echo "/data/adb/ap/bin/busybox crontab -c '${cronDataDir}' $@" | ||
else | ||
echo "/data/adb/magisk/busybox crontab -c '${cronDataDir}' $@" | ||
fi | ||
} > "${MODPATH}/system/xbin/crontab" | ||
|
||
ui_print "- Setting permissions" | ||
set_perm "${MODPATH}/system/xbin/crontab" 0 0 0755 | ||
set_perm "${MODPATH}/service.sh" 0 0 0755 | ||
set_perm "${MODPATH}/uninstall.sh" 0 0 0755 |