Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for OrangeFox recovery #448

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions openandroidinstaller/tooling.py
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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

Expand Down