From 843730fdcab280cd727a40ef18b5ba71bfa97987 Mon Sep 17 00:00:00 2001 From: Tobias Sterbak Date: Wed, 7 Feb 2024 21:03:34 +0000 Subject: [PATCH] Add hack to also run Ofox recoveries --- openandroidinstaller/tooling.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/openandroidinstaller/tooling.py b/openandroidinstaller/tooling.py index 9fb01d2b..b8736190 100644 --- a/openandroidinstaller/tooling.py +++ b/openandroidinstaller/tooling.py @@ -1,4 +1,5 @@ """This module contains functions to deal with tools like adb, fastboot and heimdall.""" + # This file is part of OpenAndroidInstaller. # OpenAndroidInstaller is free software: you can redistribute it and/or modify it under the terms of # the GNU General Public License as published by the Free Software Foundation, @@ -124,8 +125,15 @@ def adb_sideload(bin_path: Path, target: str) -> TerminalResponse: @add_logging("Activate sideloading in TWRP.", return_if_fail=True) def activate_sideload(bin_path: Path) -> TerminalResponse: """Activate sideload with adb shell in twrp.""" + # try to activate sideload (should work for TWRP) for line in run_command("adb shell twrp sideload", bin_path): yield line + # if it fails, try to activate sideload with a hack for OrangeFox recovery + if isinstance(line, bool) and not line: + # unclear why this works, but it does + for line in run_command("adb shell twrp sideload help", bin_path): + yield line + # wait for the sideload to become available for line in adb_wait_for_sideload(bin_path=bin_path): yield line