Skip to content

Commit 0f6f6f0

Browse files
committed
Probably first working version of addons
1 parent f54b51d commit 0f6f6f0

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

openandroidinstaller/tooling.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def adb_twrp_wipe_and_install(
214214
yield False
215215
return
216216
break
217-
# finally reboot into os
217+
# finally reboot into os or to fastboot for flashing addons
218218
sleep(7)
219219
if install_addons:
220220
# TODO: Fix the process for samsung devices
@@ -226,7 +226,7 @@ def adb_twrp_wipe_and_install(
226226
logger.error("Reboot into bootloader failed.")
227227
yield False
228228
return
229-
sleep(7)
229+
sleep(3)
230230
else:
231231
logger.info("Reboot into OS.")
232232
for line in run_command("adb", ["reboot"], bin_path): # "shell", "twrp",
@@ -265,26 +265,27 @@ def adb_twrp_install_addons(bin_path: Path, config_path: Path, addons: List[str]
265265
# TODO: this might sometimes think it failed, but actually it's fine. So skip for now.
266266
# yield False
267267
# return
268-
# reboot into fastboot
269-
sleep(5)
270-
logger.info("Boot into fastboot")
268+
# finally reboot into os
269+
sleep(7)
270+
# reboot into the bootloader again
271+
logger.info("Rebooting device into bootloader with adb.")
271272
for line in run_command("adb", ["reboot", "bootloader"], bin_path):
272273
yield line
273274
if (type(line) == bool) and not line:
274-
logger.error("Booting to fastboot failed.")
275+
logger.error("Reboot into bootloader failed.")
275276
yield False
276277
return
278+
sleep(3)
277279
# switch active boot partition
278-
sleep(7)
279280
logger.info("Switch active boot partition")
280281
for line in run_command("fastboot", ["set_active", "other"], bin_path):
281282
yield line
282283
if (type(line) == bool) and not line:
283284
logger.error("Switching boot partition failed.")
284285
yield False
285286
return
286-
# finally reboot into os
287-
sleep(7)
287+
sleep(1)
288+
# reboot with fastboot
288289
logger.info("Reboot into OS.")
289290
for line in run_command("fastboot", ["reboot"], bin_path):
290291
yield line

0 commit comments

Comments
 (0)