Skip to content

Commit ea4e8d3

Browse files
utilize resetprop wait mode in boot scripts
1 parent c594d0c commit ea4e8d3

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

magiskmodule/service.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ cd "$(dirname "$0")"
44
source ./constants.sh
55

66
waitUntilBootCompleted() {
7-
while [ $(getprop sys.boot_completed) -ne 1 ] || [ "$(getprop init.svc.bootanim | tr '[:upper:]' '[:lower:]')" != "stopped" ]; do
7+
resetprop -w sys.boot_completed 0 && return
8+
while [ $(getprop sys.boot_completed) -eq 0 ]; do
89
sleep 10
910
done
1011
}

magiskmodule/uninstall.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,15 @@
22
cd "$(dirname "$0")"
33
source ./constants.sh
44

5-
(
6-
while [ $(getprop sys.boot_completed) -ne 1 ] || [ "$(getprop init.svc.bootanim | tr '[:upper:]' '[:lower:]')" != "stopped" ]; do
7-
sleep 1
5+
waitUntilBootCompleted() {
6+
resetprop -w sys.boot_completed 0 && return
7+
while [ $(getprop sys.boot_completed) -eq 0 ]; do
8+
sleep 10
89
done
10+
}
11+
12+
(
13+
waitUntilBootCompleted
914
sleep 10
1015
pm uninstall -k "$VIPERFXPACKAGE"
1116
) &

0 commit comments

Comments
 (0)