Skip to content

Commit

Permalink
Fix some issues with flashing addons
Browse files Browse the repository at this point in the history
  • Loading branch information
tsterbak committed Feb 6, 2023
1 parent 386a927 commit 69b35c0
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 8 deletions.
22 changes: 22 additions & 0 deletions openandroidinstaller/assets/configs/heroltexx.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
metadata:
maintainer: Tobias Sterbak (tsterbak)
devicename: Samsung Galaxy S7
devicecode: herolte
steps:
unlock_bootloader:
flash_recovery:
- type: call_button
content: >
As a first step, you need to boot into the bootloader. A bootloader is the piece of software,
that tells your phone who to start and run an operating system (like Android). Your device should be turned on.
Then press 'Confirm and run' to reboot into the bootloader. Continue once it's done.
command: adb_reboot_download
- type: call_button
content: In this step, you need to flash a custom recovery on your device. Press 'Confirm and run' to start the process. Confirm afterwards to continue.
command: heimdall_flash_recovery
- type: confirm_button
img: samsung-buttons.png
content: >
Unplug the USB cable from your device. Then manually reboot into recovery by pressing the *Volume Down* + *Power buttons* for 8~10 seconds
until the screen turns black & release the buttons immediately when it does, then boot to recovery with the device powered off,
hold *Volume Up* + *Home* + *Power button*.
14 changes: 6 additions & 8 deletions openandroidinstaller/tooling.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,9 @@ def adb_twrp_install_addons(bin_path: Path, addons: List[str], is_ab: bool) -> b
Only works for twrp recovery.
"""
logger.info("Install addons with twrp.")
if is_ab:
sleep(7)
sleep(5)
logger.info("Sideload and install addons.")
for addon in addons:
# activate sideload
logger.info("Activate sideload.")
for line in run_command("adb", ["shell", "twrp", "sideload"], bin_path):
Expand All @@ -276,20 +277,17 @@ def adb_twrp_install_addons(bin_path: Path, addons: List[str], is_ab: bool) -> b
logger.error("Activating sideload failed.")
yield False
return

# now flash os image
sleep(5)
logger.info("Sideload and install addons.")
for addon in addons:
sleep(2)
# now flash os image
for line in run_command("adb", ["sideload", f"{addon}"], bin_path):
yield line
if (type(line) == bool) and not line:
logger.error(f"Sideloading {addon} failed.")
# TODO: this might sometimes think it failed, but actually it's fine. So skip for now.
# yield False
# return
sleep(7)
# finally reboot into os
sleep(7)
if is_ab:
# reboot into the bootloader again
logger.info("Rebooting device into bootloader with adb.")
Expand Down

0 comments on commit 69b35c0

Please sign in to comment.