Skip to content

Commit 6d7a56f

Browse files
- Add logic to prevent the daemon from restarting twice.
- Description: Supports more states
1 parent 9960bc6 commit 6d7a56f

10 files changed

Lines changed: 27 additions & 7 deletions

File tree

changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 2.2.4 (22400)
2+
- Add logic to prevent the daemon from restarting twice.
3+
- Description: Supports more states
14
# 2.2.3 (22300)
25
- enhanced eta display
36
# 2.2.2 (22200)

latest_build.zip

443 Bytes
Binary file not shown.

src/action.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33

44
MODDIR=${0%/*}
55
. "$MODDIR/utils.sh" # import utils
6+
if [ -e "$REBOOT_FLAG" ]; then
7+
echo -e "Reboot is pending, skipping..."
8+
exit
9+
fi
610
# restart daemon
711
if [ ! -e "$DAEMON_PID" ]; then
812
echo -e "Daemon is not running, restarting..."

src/daemon.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33

44
MODDIR=${0%/*}
55
. "$MODDIR/utils.sh" # import utils
6+
if [ -e "$DAEMON_PID" ]; then
7+
echo -e "Daemon is already running."
8+
exit
9+
fi
610
write_daemon_pid # write daemon pid to file
711

812
export DAEMON_STARTUP=1

src/module.prop

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
id=fix_data
22
name=Fix Data Missing
3-
version=2.2.3
4-
versionCode=22300
3+
version=2.2.4
4+
versionCode=22400
55
author=HelloWorld
66
description=[🤔 A reboot is pending.] \nFix Android/data, Android/obb, Android/media is missing.
77
updateJson=https://raw.githubusercontent.com/helloworld2540/FixDataMissing/refs/heads/main/update.json

src/post-fs-data.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/system/bin/sh
2+
# post-fs-data.sh
3+
4+
# tools variable
5+
MODDIR=${0%/*}
6+
"$MODDIR/refresh_description.sh" & # refresh description and not stuck boot

src/refresh_description.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ MODDIR=${0%/*}
77

88
# original description
99
ORIDES="Fix Android/data, Android/obb, Android/media is missing."
10-
11-
if [ -e "$REBOOT_FLAG" ]; then
10+
if [ -e "$DISABLE_FLAG" ]; then
11+
NEW_DES="[❌ Disabled] \\n"
12+
elif [ -e "$REBOOT_FLAG" ]; then
1213
NEW_DES="[🤔 A reboot is pending.] \\n"
1314
elif [ -e "$DAEMON_PID" ]; then
1415
local PID_DAEMON="$(cat "$DAEMON_PID")"
@@ -27,7 +28,7 @@ elif [ -e "$DAEMON_PID" ]; then
2728
fi
2829
else
2930
NEW_DES="[❌ Deamon is not running.] \\n"
30-
NEW_DES="$NEW_DES- Click 'action' to restart deamon.\\n"
31+
NEW_DES="$NEW_DES Click 'action' to restart deamon.\\n"
3132
fi
3233
NEW_DES="$NEW_DES$ORIDES"
3334
STATIC_PROPS=$(grep -v "^description=" "$PROP")

src/service.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ MODDIR=${0%/*}
88
wait_until_login # wait for system ready
99
rm -f "$REBOOT_FLAG" # clear reboot flag
1010
rm -f "$LOCK_FILE" # clear lock file
11+
rm -f "$DAEMON_PID" # clear daemon pid
1112
"$MODDIR"/daemon.sh & # start daemon in background

src/utils.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ PROP="$MODDIR/module.prop"
77
REBOOT_FLAG="$MODDIR/.reboot"
88
NEXT_TIME="$MODDIR/.next_time"
99
LOCK_FILE="$MODDIR/.lock"
10+
DISABLE_FLAG="$MODDIR/.disable"
1011

1112
ROOT="/storage/emulated/0"
1213
ANDROID="$ROOT/Android"

update.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"version": "2.2.3",
3-
"versionCode": 22300,
2+
"version": "2.2.4",
3+
"versionCode": 22400,
44
"zipUrl": "https://raw.githubusercontent.com/helloworld2540/FixDataMissing/refs/heads/main/latest_build.zip",
55
"changelog": "https://raw.githubusercontent.com/helloworld2540/FixDataMissing/refs/heads/main/changelog.md"
66
}

0 commit comments

Comments
 (0)