From 69b35c0ab819a1bf4655d2ceb11f2c0ee3639f67 Mon Sep 17 00:00:00 2001 From: Tobias Sterbak Date: Mon, 6 Feb 2023 12:04:25 +0000 Subject: [PATCH] Fix some issues with flashing addons --- .../assets/configs/heroltexx.yaml | 22 +++++++++++++++++++ openandroidinstaller/tooling.py | 14 +++++------- 2 files changed, 28 insertions(+), 8 deletions(-) create mode 100644 openandroidinstaller/assets/configs/heroltexx.yaml diff --git a/openandroidinstaller/assets/configs/heroltexx.yaml b/openandroidinstaller/assets/configs/heroltexx.yaml new file mode 100644 index 00000000..4dcf7f8b --- /dev/null +++ b/openandroidinstaller/assets/configs/heroltexx.yaml @@ -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*. \ No newline at end of file diff --git a/openandroidinstaller/tooling.py b/openandroidinstaller/tooling.py index 2e118ead..bca22a96 100644 --- a/openandroidinstaller/tooling.py +++ b/openandroidinstaller/tooling.py @@ -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): @@ -276,11 +277,8 @@ 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: @@ -288,8 +286,8 @@ def adb_twrp_install_addons(bin_path: Path, addons: List[str], is_ab: bool) -> b # 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.")