From f328be209a2d7e40508b536b15e6629db60886c2 Mon Sep 17 00:00:00 2001 From: Tyler Nijmeh Date: Wed, 5 Aug 2020 18:50:51 -0700 Subject: [PATCH] Sleep until boot completes properly Signed-off-by: Tyler Nijmeh --- service.sh | 8 -------- system/bin/ktweak | 7 +++++++ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/service.sh b/service.sh index d7bf429..f31cc77 100644 --- a/service.sh +++ b/service.sh @@ -1,13 +1,5 @@ #!/system/bin/sh # Written by Draco (tytydraco @ GitHub) -# Wait 60s into boot before applying changes -echo "[*] Waiting for 60s of uptime." -while [[ `cat /proc/uptime | awk '{print $1}' | awk -F. '{print $1}'` -lt 60 ]] -do - sleep 1 -done -echo "[*] Done waiting." - # Setup tweaks ktweak diff --git a/system/bin/ktweak b/system/bin/ktweak index f6aacc4..7a122ac 100644 --- a/system/bin/ktweak +++ b/system/bin/ktweak @@ -110,6 +110,13 @@ while getopts ":ds" opt; do done shift $((OPTIND-1)) +# Wait for boot to finish completely +dbg "Sleeping until boot completes." +while [[ `getprop sys.boot_completed` -ne 1 ]] +do + sleep 1 +done + # Print device information prior to execution dbg "----- Device Information -----" # Kernel and device information