Skip to content

Commit

Permalink
**v2021.8.9.1 (202108091)**
Browse files Browse the repository at this point in the history
- Rewritten daemon logic for better efficiency and reliability.
- Updated documentation
  • Loading branch information
VR-25 committed Aug 9, 2021
1 parent 3d0dbe8 commit 93138fe
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 38 deletions.
26 changes: 9 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ Notes
- All commands return either 0 (success/running) or 1 (failure/stopped).
- djs-status prints the daemon's process ID (PID).
- Special shell characters (e.g., "|", ";", "&") must be quoted or escaped. For the sake of simplicity and consistency, single-quote all arguments as a whole (e.g., djsc -a '2200 reboot -p').
- PATH starts with /data/adb/vr25/bin:/dev/.vr25/busybox.
This means schedules don't require additional busybox setup.
The first directory holds user executables.
```

---
Expand Down Expand Up @@ -178,23 +181,6 @@ Open issues on GitHub or contact the developer on Telegram/XDA (linked below). A
## LATEST CHANGES


**v2019.10.18 (201910180)**

- `: --boot` and `: --delete` flags
- Attribute back-end files ownership to front-end app
- Automatically copy installation log to <front-end app data>/files/logs/
- Back-end can be upgraded from Magisk Manager, EX/FK Kernel Manager, and similar apps
- `bundle.sh` - bundler for front-end app
- `djs-version`: prints `versionCode` (integer)
- Fixed schedule deletion and busybox handling issues
- Flashable uninstaller: `/sdcard/djs-uninstaller.zip`
- Major optimizations
- Prioritize `nano -l` for text editing
- Richer installation and initialization logs (/data/adb/djs-data/logs/)
- Updated `build.sh` and documentation
- Workaround for front-end autostart blockage (Magisk service.d script)


**v2021.7.28 (202107280)**

- Fixed issues.
Expand All @@ -205,3 +191,9 @@ Open issues on GitHub or contact the developer on Telegram/XDA (linked below). A
**v2021.8.2 (202108020)**

- Fixed AccA related issues.


**v2021.8.9.1 (202108091)**

- Rewritten daemon logic for better efficiency and reliability.
- Updated documentation
4 changes: 4 additions & 0 deletions djs/djs-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ Usage: djsc|djs-config OPTION ARGS
-l|--list 'PATTERN' (default ".", meaning "all lines")
e.g., djsc -l '^boot'
Note: PATH starts with /data/adb/vr25/bin:/dev/.vr25/busybox.
This means schedules don't require additional busybox setup.
The first directory holds user executables.
CAT
;;
esac
Expand Down
40 changes: 21 additions & 19 deletions djs/djs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
exec > /dev/null 2>&1

set -u
IFS=$(printf '\t\n')
tmpDir=/dev/.vr25/djs
execDir=/data/adb/vr25/djs
config=${execDir}-data/config.txt
Expand Down Expand Up @@ -72,27 +71,30 @@ ln -sf $execDir/djs-version.sh /dev/djs-version


# boot schedules
for schedule in $(getv '^boot | : --boot'); do
if ! grep -q "$schedule" $tmpDir/boot 2>/dev/null; then
echo "$schedule" >> $tmpDir/boot
(unset IFS; set +u; eval "$(echo "$schedule" | sed 's#^.... ##')" &) &
fi
done
if [ ! -f $tmpDir/boot.sh ]; then
echo "#!/system/bin/sh" > $tmpDir/boot.sh
grep '^boot | : --boot' $config | sed 's/^.... //' >> $tmpDir/boot.sh
echo 'exit $?' >> $tmpDir/boot.sh
chmod u+x $tmpDir/boot.sh
start-stop-daemon -bx $tmpDir/boot.sh -S --
grep -q '^boot .* : --delete' $config && sed -i '/^boot .* : --delete/d' $config
fi

# HH:MM schedules
while :; do
# HH:MM schedules
for schedule in $(getv '^[0-2].[0-5][0-9]'); do
if [ $(date +%H%M) -eq $(echo "$schedule" | grep -o '^.... ') ]; then
if ! grep -q "$schedule" $tmpDir/HH:MM 2>/dev/null; then
echo "$schedule" >> $tmpDir/HH:MM
(unset IFS; set +u; eval "$(echo "$schedule" | sed 's#^.... ##')" &) &
(sleep 60; sed -i "\#$schedule#d" $tmpDir/HH:MM &) &
echo "$schedule" | grep -q ' : --delete' && sed -i "\#$schedule#d" $config
sleep 1
fi
fi
time=$(date +%H%M)
echo "#!/system/bin/sh" > $tmpDir/${time}.sh
if grep "^$time " $config | sed 's/^.... //' >> $tmpDir/${time}.sh; then
echo 'rm $0' >> $tmpDir/${time}.sh
echo 'exit $?' >> $tmpDir/${time}.sh
chmod u+x $tmpDir/${time}.sh
grep -q ' : --delete' $tmpDir/${time}.sh && sed -i "/^$time .* : --delete/d" $config
start-stop-daemon -bx $tmpDir/${time}.sh -S --
fi
sleep 40
while [ $(date +%H%M) -eq $time ]; do
sleep 10
done
sleep 20
done

exit $?
4 changes: 2 additions & 2 deletions module.prop
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
id=djs
name=Daily Job Scheduler (DJS)
version=2021.8.2
versionCode=202108020
version=v2021.8.9.1
versionCode=202108091
author=VR25
description=Runs commands and scripts on boot and at HH:MM. Any root solution is supported. The installation is always "system-less", whether or not the system is rooted with Magisk.

0 comments on commit 93138fe

Please sign in to comment.