Skip to content

Commit

Permalink
手机启动完毕后再执行
Browse files Browse the repository at this point in the history
  • Loading branch information
chase535 authored Sep 1, 2023
1 parent b18c6d6 commit bf1912d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion module/common/service.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
#!/system/bin/sh
MODDIR=${0%/*}
capacity_file=capacity_file_not_defined
nohup ${MODDIR}/accurate_battery ${capacity_file} &
echo "等待手机启动完毕,以确保时间准确。若只看到这一行内容,请立即联系模块作者!" > /data/adb/accurate_battery/log.txt
until [[ "$(getprop service.bootanim.exit)" == "1" ]]; do
sleep 1
done
echo "手机启动完毕" >> /data/adb/accurate_battery/log.txt
echo "" >> /data/adb/accurate_battery/log.txt
nohup ${MODDIR}/accurate_battery ${capacity_file} >> /data/adb/accurate_battery/log.txt 2>&1 &

0 comments on commit bf1912d

Please sign in to comment.