Skip to content

Commit

Permalink
Switched from flashing to booting TWRP (#111)
Browse files Browse the repository at this point in the history
OAI now only boots into TWRP instead of flashing and overwriting the
existing recovery, which can cause problems with the bootloader not
being able to communicate with the recovery.

related to
#98 (comment)
  • Loading branch information
tsterbak committed Mar 24, 2023
2 parents 306c789 + dd1c897 commit ecd5019
Show file tree
Hide file tree
Showing 64 changed files with 217 additions and 221 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ If you want to use the tool for a non-supported smartphone, the fastest way is t

#### Content of a config file

A config file consists of two parts. The first part are some metadata about the device and the second parts are the steps to unlock the bootloader, flash a recovery and install the ROMs.
A config file consists of two parts. The first part are some metadata about the device and the second parts are the steps to unlock the bootloader, boot a recovery and install the ROMs.

##### How to write Metadata
Every config file should have metadata with the following fields:
Expand All @@ -213,7 +213,7 @@ Every step in the config file corresponds to one view in the application. These
- `call_button_with_input`: Display the content text, an input field and a button that runs a given command. The inputtext, can be used in the command by using the `<inputtext>` placeholder in the command field. After the command is run, a confirm button is displayed to allow the user to move to the next step.
- `link_button_with_confirm`: Display a button that opens a browser with a given link, confirm afterwards. Link is given in `link`.
- `content`: str; The content text displayed alongside the action of the step. Used to inform the user about whats going on.
- `command`: [ONLY for call_button* steps] str; The command to run. One of `adb_reboot`, `adb_reboot_bootloader`, `adb_reboot_download`, `adb_sideload`, `adb_twrp_wipe_and_install`, `adb_twrp_copy_partitions`, `fastboot_flash_recovery`, `fastboot_unlock_with_code`, `fastboot_unlock`, `fastboot_oem_unlock`, `fastboot_get_unlock_data`, `fastboot_reboot`, `heimdall_flash_recovery`.
- `command`: [ONLY for call_button* steps] str; The command to run. One of `adb_reboot`, `adb_reboot_bootloader`, `adb_reboot_download`, `adb_sideload`, `adb_twrp_wipe_and_install`, `adb_twrp_copy_partitions`, `fastboot_boot_recovery`, `fastboot_unlock_with_code`, `fastboot_unlock`, `fastboot_oem_unlock`, `fastboot_get_unlock_data`, `fastboot_reboot`, `heimdall_flash_recovery`.
- `img`: [OPTIONAL] Display an image on the left pane of the step view. Images are loaded from `openandroidinstaller/assets/imgs/`.
- `allow_skip`: [OPTIONAL] boolean; If a skip button should be displayed to allow skipping this step. Can be useful when the bootloader is already unlocked.
- `link`: [OPTIONAL] Link to use for the link button if type is `link_button_with_confirm`.
Expand Down
2 changes: 1 addition & 1 deletion openandroidinstaller/app_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,5 @@ def load_config(self, device_code: str):
self.config = _load_config(device_code, self.config_path)
if self.config:
self.steps = copy.deepcopy(self.config.unlock_bootloader) + copy.deepcopy(
self.config.flash_recovery
self.config.boot_recovery
)
8 changes: 4 additions & 4 deletions openandroidinstaller/assets/configs/FP2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ metadata:
devicecode: FP2
steps:
unlock_bootloader:
flash_recovery:
boot_recovery:
- type: confirm_button
content: >
Now you need to flash a custom recovery system on the phone. A recovery is a small subsystem on your phone, that manages updating,
Now you need to boot a custom recovery system on the phone. A recovery is a small subsystem on your phone, that manages updating,
adapting and repairing of the operating system.
- type: call_button
content: 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: Flash a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
command: fastboot_flash_recovery
content: Boot a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
command: fastboot_boot_recovery
- type: confirm_button
content: >
Now reboot into recovery to verify the installation. Do not reboot into the existing OS, since it will overwrite the recovery you just installed!
Expand Down
6 changes: 3 additions & 3 deletions openandroidinstaller/assets/configs/FP3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ steps:
command: fastboot_reboot
- type: confirm_button
content: The bootloader is now unlocked. Since the device resets completely, you will need to re-enable USB debugging to continue.
flash_recovery:
boot_recovery:
- type: confirm_button
content: >
Now you need to flash a custom recovery system on the phone. A recovery is a small subsystem on your phone, that manages updating,
Now you need to boot a custom recovery system on the phone. A recovery is a small subsystem on your phone, that manages updating,
adapting and repairing of the operating system.
- type: call_button
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.
command: fastboot_flash_recovery
command: fastboot_boot_recovery
- type: confirm_button
content: >
Now reboot into recovery to verify the installation. Do not reboot into the existing OS, since it will overwrite the recovery you just installed!
Expand Down
6 changes: 3 additions & 3 deletions openandroidinstaller/assets/configs/FP4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ steps:
command: fastboot_reboot
- type: confirm_button
content: The bootloader is now unlocked. Since the device resets completely, you will need to re-enable USB debugging to continue.
flash_recovery:
boot_recovery:
- type: confirm_button
content: >
Now you need to flash a custom recovery system on the phone. A recovery is a small subsystem on your phone, that manages updating,
Now you need to boot a custom recovery system on the phone. A recovery is a small subsystem on your phone, that manages updating,
adapting and repairing of the operating system.
- type: call_button
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.
command: fastboot_flash_recovery
command: fastboot_boot_recovery
- type: confirm_button
content: >
Now reboot into recovery to verify the installation. Do not reboot into the existing OS, since it will overwrite the recovery you just installed!
Expand Down
4 changes: 2 additions & 2 deletions openandroidinstaller/assets/configs/a3y17lte.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
devicecode: a3y17lte
steps:
unlock_bootloader:
flash_recovery:
boot_recovery:
- type: call_button
content: >
As a first step, you need to boot into the bootloader. A bootloader is the piece of software,
Expand All @@ -13,7 +13,7 @@ steps:
command: adb_reboot_download
- type: call_button
content: >
In this step, you need to flash a custom recovery on your device.
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.
command: heimdall_flash_recovery
- type: confirm_button
Expand Down
4 changes: 2 additions & 2 deletions openandroidinstaller/assets/configs/a5xelte.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ metadata:
devicecode: a5xelte
steps:
unlock_bootloader:
flash_recovery:
boot_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.
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.
command: heimdall_flash_recovery
- type: confirm_button
img: samsung-buttons.png
Expand Down
4 changes: 2 additions & 2 deletions openandroidinstaller/assets/configs/a72q.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ metadata:
devicecode: a72q
steps:
unlock_bootloader:
flash_recovery:
boot_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.
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.
command: heimdall_flash_recovery
- type: confirm_button
img: samsung-buttons.png
Expand Down
4 changes: 2 additions & 2 deletions openandroidinstaller/assets/configs/a7xelte.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ metadata:
devicecode: a7xelte
steps:
unlock_bootloader:
flash_recovery:
boot_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.
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.
command: heimdall_flash_recovery
- type: confirm_button
img: samsung-buttons.png
Expand Down
6 changes: 3 additions & 3 deletions openandroidinstaller/assets/configs/akari.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ steps:
Press the button to reboot. Since the device resets completely, you will need to re-enable USB debugging to continue.
Connect your device to your PC via USB. Then confirm here to continue.
command: fastboot_reboot
flash_recovery:
boot_recovery:
- type: call_button
content: >
Now you need to flash a custom recovery system on the phone. A recovery is a small subsystem on your phone, that manages updating,
Now you need to boot a custom recovery system on the phone. A recovery is a small subsystem on your phone, that manages updating,
adapting and repairing of the operating system.
Make sure your device is turned on. You need to reboot into the bootloader again by pressing 'Confirm and run' here. Then continue.
command: adb_reboot_bootloader
- type: call_button
content: Flash a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
content: Boot a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
command: fastboot_flash_boot
- type: call_button
command: adb_twrp_copy_partitions
Expand Down
6 changes: 3 additions & 3 deletions openandroidinstaller/assets/configs/akatsuki.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ steps:
Press the button to reboot. Since the device resets completely, you will need to re-enable USB debugging to continue.
Connect your device to your PC via USB. Then confirm here to continue.
command: fastboot_reboot
flash_recovery:
boot_recovery:
- type: call_button
content: >
Now you need to flash a custom recovery system on the phone. A recovery is a small subsystem on your phone, that manages updating,
Now you need to boot a custom recovery system on the phone. A recovery is a small subsystem on your phone, that manages updating,
adapting and repairing of the operating system.
Make sure your device is turned on. You need to reboot into the bootloader again by pressing 'Confirm and run' here. Then continue.
command: adb_reboot_bootloader
- type: call_button
content: Flash a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
content: Boot a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
command: fastboot_flash_boot
- type: call_button
command: adb_twrp_copy_partitions
Expand Down
10 changes: 5 additions & 5 deletions openandroidinstaller/assets/configs/avicii.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@ steps:
command: fastboot_reboot
- type: confirm_button
content: The bootloader is now unlocked. Since the device resets completely, you will need to re-enable Developer Options and USB debugging to continue.
flash_recovery:
boot_recovery:
- type: call_button
content: >
Now you need to flash a custom recovery system on the phone. A recovery is a small subsystem on your phone, that manages updating,
Now you need to boot a custom recovery system on the phone. A recovery is a small subsystem on your phone, that manages updating,
adapting and repairing of the operating system.
Make sure your device is turned on. You need to reboot into the bootloader again by pressing 'Confirm and run' here. Then continue.
command: adb_reboot_bootloader
- type: call_button
content: Flash a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
command: fastboot_flash_recovery
content: Boot a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
command: fastboot_boot_recovery
- type: call_button
command: adb_twrp_copy_partitions
content: >
In some cases, the inactive slot can be unpopulated or contain much older firmware than the active slot, leading to various issues including a potential hard-brick.
We can ensure none of that will happen by copying the contents of the active slot to the inactive slot. Press 'confirm and run' to to this. Once you are in the bootloader again, continue.
- type: call_button
command: fastboot_flash_recovery
command: fastboot_boot_recovery
content: >
Now we need to boot into recovery again. Press run and when you see the TWRP screen you can continue.
8 changes: 4 additions & 4 deletions openandroidinstaller/assets/configs/barbet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ steps:
command: fastboot_reboot
- type: confirm_button
content: The bootloader is now unlocked. Since the device resets completely, you will need to re-enable USB debugging to continue.
flash_recovery:
boot_recovery:
- type: confirm_button
content: >
Now you need to flash a custom recovery system on the phone. A recovery is a small subsystem on your phone, that manages updating,
Now you need to boot a custom recovery system on the phone. A recovery is a small subsystem on your phone, that manages updating,
adapting and repairing of the operating system.
- type: call_button
content: 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: confirm_button
content: Select 'Restart bootloader' on your smartphone screen. Then confirm to continue.
- type: call_button
content: Flash a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
command: fastboot_flash_recovery
content: Boot a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
command: fastboot_boot_recovery
4 changes: 2 additions & 2 deletions openandroidinstaller/assets/configs/beyond0lte.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ steps:
content: >
The bootloader is now unlocked. Go through Android Setup skipping everything you can, then connect the device to a Wi-Fi network.
Since the device resets completely, you will need to re-enable Developer Options and USB debugging to continue.
flash_recovery:
boot_recovery:
- type: call_button
content: >
Now plug the USB-cable to your device. As a first step, you need to boot into download mode. Your device should be turned on.
Then press 'Confirm and run' to reboot into download mode. 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.
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.
command: heimdall_flash_recovery
- type: confirm_button
img: samsung-buttons-bixby.png
Expand Down
4 changes: 2 additions & 2 deletions openandroidinstaller/assets/configs/beyond1lte.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ steps:
content: >
The bootloader is now unlocked. Go through Android Setup skipping everything you can, then connect the device to a Wi-Fi network.
Since the device resets completely, you will need to re-enable Developer Options and USB debugging to continue.
flash_recovery:
boot_recovery:
- type: call_button
content: >
Now plug the USB-cable to your device. As a first step, you need to boot into download mode. Your device should be turned on.
Then press 'Confirm and run' to reboot into download mode. 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.
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.
command: heimdall_flash_recovery
- type: confirm_button
img: samsung-buttons-bixby.png
Expand Down
4 changes: 2 additions & 2 deletions openandroidinstaller/assets/configs/beyond2lte.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ steps:
content: >
The bootloader is now unlocked. Go through Android Setup skipping everything you can, then connect the device to a Wi-Fi network.
Since the device resets completely, you will need to re-enable Developer Options and USB debugging to continue.
flash_recovery:
boot_recovery:
- type: call_button
content: >
Now plug the USB-cable to your device. As a first step, you need to boot into download mode. Your device should be turned on.
Then press 'Confirm and run' to reboot into download mode. 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.
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.
command: heimdall_flash_recovery
- type: confirm_button
img: samsung-buttons-bixby.png
Expand Down
Loading

0 comments on commit ecd5019

Please sign in to comment.