Skip to content

Commit

Permalink
Probably first working version of addons
Browse files Browse the repository at this point in the history
  • Loading branch information
tsterbak committed Feb 1, 2023
1 parent f54b51d commit 0f6f6f0
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions openandroidinstaller/tooling.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def adb_twrp_wipe_and_install(
yield False
return
break
# finally reboot into os
# finally reboot into os or to fastboot for flashing addons
sleep(7)
if install_addons:
# TODO: Fix the process for samsung devices
Expand All @@ -226,7 +226,7 @@ def adb_twrp_wipe_and_install(
logger.error("Reboot into bootloader failed.")
yield False
return
sleep(7)
sleep(3)
else:
logger.info("Reboot into OS.")
for line in run_command("adb", ["reboot"], bin_path): # "shell", "twrp",
Expand Down Expand Up @@ -265,26 +265,27 @@ def adb_twrp_install_addons(bin_path: Path, config_path: Path, addons: List[str]
# TODO: this might sometimes think it failed, but actually it's fine. So skip for now.
# yield False
# return
# reboot into fastboot
sleep(5)
logger.info("Boot into fastboot")
# finally reboot into os
sleep(7)
# reboot into the bootloader again
logger.info("Rebooting device into bootloader with adb.")
for line in run_command("adb", ["reboot", "bootloader"], bin_path):
yield line
if (type(line) == bool) and not line:
logger.error("Booting to fastboot failed.")
logger.error("Reboot into bootloader failed.")
yield False
return
sleep(3)
# switch active boot partition
sleep(7)
logger.info("Switch active boot partition")
for line in run_command("fastboot", ["set_active", "other"], bin_path):
yield line
if (type(line) == bool) and not line:
logger.error("Switching boot partition failed.")
yield False
return
# finally reboot into os
sleep(7)
sleep(1)
# reboot with fastboot
logger.info("Reboot into OS.")
for line in run_command("fastboot", ["reboot"], bin_path):
yield line
Expand Down

0 comments on commit 0f6f6f0

Please sign in to comment.