sync

# Wait until we see some android processes to consider boot is more or less complete (credits to AndiP71)
while ! /system/bin/pgrep -f com.android ; do
  sleep 1
done

rm /data/.arter97/bootdone

# Wait until bootanimation, dexopt ends (arter97)

sleep 5

while /system/bin/pgrep bootanimation ; do
  sleep 1
done

sleep 5

while /system/bin/pgrep dexopt ; do
  sleep 1
done

# Wait just a bit more . . .
sleep 10

# boost-boot (arter97) - 2
sync
