-
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.
- Loading branch information
0 parents
commit ce378fa
Showing
7 changed files
with
118 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/sbin/sh | ||
|
||
################# | ||
# Initialization | ||
################# | ||
|
||
umask 022 | ||
|
||
# echo before loading util_functions | ||
ui_print() { echo "$1"; } | ||
|
||
require_new_magisk() { | ||
ui_print "*******************************" | ||
ui_print " Please install Magisk v20.4+! " | ||
ui_print "*******************************" | ||
exit 1 | ||
} | ||
|
||
######################### | ||
# Load util_functions.sh | ||
######################### | ||
|
||
OUTFD=$2 | ||
ZIPFILE=$3 | ||
|
||
mount /data 2>/dev/null | ||
|
||
[ -f /data/adb/magisk/util_functions.sh ] && { | ||
. /data/adb/magisk/util_functions.sh | ||
[ $MAGISK_VER_CODE -lt 20400 ] && require_new_magisk | ||
install_module | ||
exit 0 | ||
} |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
#MAGISK |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# crond4Android | ||
|
||
支持 KernelSU、APatch、Magisk下运行。调用对应框架busybox实现crond定时。 | ||
|
||
## 数据目录 | ||
|
||
日志: `/data/adb/crond/run.log` | ||
|
||
任务数据: `/data/adb/crond/` | ||
|
||
crontab: `/system/xbin/crontab` | ||
`注意:如果替换了root实现方案,记得修改这个脚本,或者重新安装一次,不然无法执行。` | ||
## 使用样例 | ||
|
||
```shell | ||
# 创建任务 (也可以直接编辑文件) | ||
echo '53 * * * * command' >> /data/adb/crond/root # for root user | ||
# 查看任务 | ||
crontab -c /data/adb/crond -l | ||
``` |
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
|
||
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 | ||
|
||
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} | ||
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" |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
id=crond4android | ||
name=Crond for Android | ||
version=1.0.0 | ||
versionCode=100 | ||
author=powerAn2020 | ||
description=Busybox Crond with service scripts for Android |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/system/bin/sh | ||
|
||
cronDataDir='/data/adb/crond' | ||
args="crond -b -c ${cronDataDir} -L ${cronDataDir}/run.log" | ||
# check version | ||
if [ "$KSU" = true ]; then | ||
echo "- kernelSU version: $KSU_VER ($KSU_VER_CODE)" | ||
/data/adb/ksu/bin/busybox $args | ||
elif [ "$APATCH" = true ]; then | ||
echo "- APatch version: $APATCH_VER ($APATCH_VER_CODE)" | ||
/data/adb/ap/bin/busybox $args | ||
else | ||
echo "- Magisk version: $MAGISK_VER ($MAGISK_VER_CODE)" | ||
/data/adb/magisk/busybox $args | ||
fi |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/system/bin/sh | ||
|
||
if [ ! -f "/data/adb/crond/KEEP_ON_UNINSTALL" ]; then | ||
rm -rf /data/adb/crond | ||
fi |