From 1ca341bed17dd092a728c17f2816b7c6facf0542 Mon Sep 17 00:00:00 2001 From: Tobias Sterbak Date: Fri, 24 Mar 2023 18:50:22 +0000 Subject: [PATCH] minor fixes --- openandroidinstaller/assets/configs/FP4.yaml | 2 +- openandroidinstaller/assets/configs/starlte.yaml | 2 +- openandroidinstaller/tooling.py | 8 +++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/openandroidinstaller/assets/configs/FP4.yaml b/openandroidinstaller/assets/configs/FP4.yaml index fafeb33a..ebf59f4f 100644 --- a/openandroidinstaller/assets/configs/FP4.yaml +++ b/openandroidinstaller/assets/configs/FP4.yaml @@ -40,7 +40,7 @@ steps: content: Turn on your device. Once the device is fully booted, you need to reboot into the bootloader again by pressing 'Confirm and run' here. Then continue. command: adb_reboot_bootloader - type: call_button - content: Once the device is in fastboot mode, flash the custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue. + content: Once the device is in fastboot mode, boot the custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue. command: fastboot_boot_recovery - type: confirm_button content: > diff --git a/openandroidinstaller/assets/configs/starlte.yaml b/openandroidinstaller/assets/configs/starlte.yaml index d3caa9e0..71c6f7f2 100644 --- a/openandroidinstaller/assets/configs/starlte.yaml +++ b/openandroidinstaller/assets/configs/starlte.yaml @@ -16,7 +16,7 @@ steps: 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 boot a custom recovery on your device. Press 'Confirm and run' to start the process. Confirm afterwards to continue. + 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 content: > diff --git a/openandroidinstaller/tooling.py b/openandroidinstaller/tooling.py index ecd98115..097c35e6 100644 --- a/openandroidinstaller/tooling.py +++ b/openandroidinstaller/tooling.py @@ -271,6 +271,8 @@ def adb_twrp_install_addons( """ logger.info("Install addons with twrp.") sleep(0.5) + if is_ab: + adb_wait_for_recovery(bin_path=bin_path) logger.info("Sideload and install addons.") for addon in addons: # activate sideload @@ -358,6 +360,7 @@ def fastboot_boot_recovery( bin_path: Path, recovery: str, is_ab: bool = True ) -> TerminalResponse: """Temporarily, boot custom recovery with fastboot.""" + # TODO: this can be unified now if is_ab: logger.info("Boot custom recovery with fastboot.") for line in run_command( @@ -387,7 +390,7 @@ def fastboot_flash_boot(bin_path: Path, recovery: str) -> TerminalResponse: """Temporarily, flash custom recovery with fastboot to boot partition.""" logger.info("Flash custom recovery with fastboot.") for line in run_command( - "fastboot flash boot", target="f{recovery}", bin_path=bin_path + "fastboot flash boot", target=f"{recovery}", bin_path=bin_path ): yield line if (type(line) == bool) and not line: @@ -424,8 +427,7 @@ def heimdall_flash_recovery(bin_path: Path, recovery: str) -> TerminalResponse: for line in run_command( "heimdall flash --no-reboot --RECOVERY", target=f"{recovery}", bin_path=bin_path ): - boot_recovery - yield line + yield line def search_device(platform: str, bin_path: Path) -> Optional[str]: