Skip to content

Commit

Permalink
WIP - now detect a/b devices and pick different install paths; change…
Browse files Browse the repository at this point in the history
… recovery commands for sony devices
  • Loading branch information
tsterbak committed Feb 6, 2023
1 parent 474d8bb commit 780fcc6
Show file tree
Hide file tree
Showing 16 changed files with 197 additions and 152 deletions.
1 change: 1 addition & 0 deletions openandroidinstaller/app_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def __init__(
self.config = None
self.image_path = None
self.recovery_path = None
self.is_ab = None

# is this still needed?
self.steps = None
Expand Down
14 changes: 3 additions & 11 deletions openandroidinstaller/assets/configs/akari.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,13 @@ steps:
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
command: fastboot_flash_boot
- 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_flash_boot
content: >
Now we need to boot into recovery again. Press run and when you see the TWRP screen you can continue.
install_os:
- type: call_button
content: >
In the next steps, you finally flash the selected OS image.
Connect your device with your computer with the USB-Cable.
This step will format your phone and wipe all the data. It will also remove encryption and delete all files stored
in the internal storage. Then the OS image will be installed. Confirm to run. This might take a while. At the end your phone will boot into the new OS.
command: adb_twrp_wipe_and_install
Now we need to boot into recovery again. Press run and when you see the TWRP screen you can continue.
14 changes: 3 additions & 11 deletions openandroidinstaller/assets/configs/akatsuki.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,13 @@ steps:
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
command: fastboot_flash_boot
- 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_flash_boot
content: >
Now we need to boot into recovery again. Press run and when you see the TWRP screen you can continue.
install_os:
- type: call_button
content: >
In the next steps, you finally flash the selected OS image.
Connect your device with your computer with the USB-Cable.
This step will format your phone and wipe all the data. It will also remove encryption and delete all files stored
in the internal storage. Then the OS image will be installed. Confirm to run. This might take a while. At the end your phone will boot into the new OS.
command: adb_twrp_wipe_and_install
Now we need to boot into recovery again. Press run and when you see the TWRP screen you can continue.
14 changes: 3 additions & 11 deletions openandroidinstaller/assets/configs/kirin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,13 @@ steps:
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
command: fastboot_flash_boot
- 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_flash_boot
content: >
Now we need to boot into recovery again. Press run and when you see the TWRP screen you can continue.
install_os:
- type: call_button
content: >
In the next steps, you finally flash the selected OS image.
Connect your device with your computer with the USB-Cable.
This step will format your phone and wipe all the data. It will also remove encryption and delete all files stored
in the internal storage. Then the OS image will be installed. Confirm to run. This might take a while. At the end your phone will boot into the new OS.
command: adb_twrp_wipe_and_install
Now we need to boot into recovery again. Press run and when you see the TWRP screen you can continue.
14 changes: 3 additions & 11 deletions openandroidinstaller/assets/configs/mermaid.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,13 @@ steps:
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
command: fastboot_flash_boot
- 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_flash_boot
content: >
Now we need to boot into recovery again. Press run and when you see the TWRP screen you can continue.
install_os:
- type: call_button
content: >
In the next steps, you finally flash the selected OS image.
Connect your device with your computer with the USB-Cable.
This step will format your phone and wipe all the data. It will also remove encryption and delete all files stored
in the internal storage. Then the OS image will be installed. Confirm to run. This might take a while. At the end your phone will boot into the new OS.
command: adb_twrp_wipe_and_install
Now we need to boot into recovery again. Press run and when you see the TWRP screen you can continue.
14 changes: 3 additions & 11 deletions openandroidinstaller/assets/configs/pioneer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,11 @@ steps:
content: Flash a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
command: fastboot_flash_recovery
- type: call_button
command: adb_twrp_copy_partitions
command: adb_twrp_copy_boot
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
content: >
Now we need to boot into recovery again. Press run and when you see the TWRP screen you can continue.
install_os:
- type: call_button
command: fastboot_flash_boot
content: >
In the next steps, you finally flash the selected OS image.
Connect your device with your computer with the USB-Cable.
This step will format your phone and wipe all the data. It will also remove encryption and delete all files stored
in the internal storage. Then the OS image will be installed. Confirm to run. This might take a while. At the end your phone will boot into the new OS.
command: adb_twrp_wipe_and_install
Now we need to boot into recovery again. Press run and when you see the TWRP screen you can continue.
10 changes: 1 addition & 9 deletions openandroidinstaller/assets/configs/yuga.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,4 @@ steps:
command: adb_reboot_bootloader
- type: call_button
content: Next, you need to flash a custom recovery image. Press the button to flash the selected image. Then continue.
command: fastboot_flash_recovery
install_os:
- type: call_button
content: >
In the next steps, you finally flash the selected OS image.
Connect your device with your computer with the USB-Cable.
This step will format your phone and wipe all the data. It will also remove encryption and delete all files stored
in the internal storage. Then the OS image will be installed. Confirm to run. This might take a while. At the end your phone will boot into the new OS.
command: adb_twrp_wipe_and_install
command: fastboot_flash_boot
10 changes: 1 addition & 9 deletions openandroidinstaller/assets/configs/z3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,4 @@ steps:
command: adb_reboot_bootloader
- type: call_button
content: Next, you need to flash a custom recovery image. Press the button to flash the selected image. Then continue.
command: fastboot_flash_recovery
install_os:
- type: call_button
content: >
In the next steps, you finally flash the selected OS image.
Connect your device with your computer with the USB-Cable.
This step will format your phone and wipe all the data. It will also remove encryption and delete all files stored
in the internal storage. Then the OS image will be installed. Confirm to run. This might take a while. At the end your phone will boot into the new OS.
command: adb_twrp_wipe_and_install
command: fastboot_flash_boot
2 changes: 1 addition & 1 deletion openandroidinstaller/installer_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def validate_config(config: str) -> bool:
),
"content": str,
schema.Optional("command"): Regex(
r"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_get_unlock_data|fastboot_unlock|fastboot_oem_unlock|fastboot_reboot|heimdall_flash_recovery"
r"adb_reboot|adb_reboot_bootloader|adb_reboot_download|adb_sideload|adb_twrp_wipe_and_install|adb_twrp_copy_partitions|fastboot_flash_recovery|fastboot_flash_boot|fastboot_unlock_with_code|fastboot_get_unlock_data|fastboot_unlock|fastboot_oem_unlock|fastboot_reboot|heimdall_flash_recovery"
),
schema.Optional("allow_skip"): bool,
schema.Optional("img"): str,
Expand Down
12 changes: 0 additions & 12 deletions openandroidinstaller/openandroidinstaller.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,23 +124,11 @@ def __init__(self, state: AppState):

# initialize the addon view
self.select_addon_view = AddonsView(on_confirm=self.to_next_view, state=self.state)
self.flash_recovery_view = StepView(
step=Step(
title="Flash custom recovery",
type="call_button",
content="Flash a custom recovery (temporarily) by pressing 'Confirm and run'. Once your phone screen looks like the picture on the left, continue.",
command="fastboot_flash_recovery",
img="twrp-start.jpeg",
),
state=self.state,
on_confirm=self.to_next_view,
)
self.install_addons_view = InstallAddonsView(
on_confirm=self.to_next_view, state=self.state
)
self.state.addon_views = [
self.install_addons_view,
self.flash_recovery_view,
self.select_addon_view,
]

Expand Down
Loading

0 comments on commit 780fcc6

Please sign in to comment.