Skip to content

Commit 780fcc6

Browse files
committed
WIP - now detect a/b devices and pick different install paths; change recovery commands for sony devices
1 parent 474d8bb commit 780fcc6

16 files changed

Lines changed: 197 additions & 152 deletions

openandroidinstaller/app_state.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def __init__(
4242
self.config = None
4343
self.image_path = None
4444
self.recovery_path = None
45+
self.is_ab = None
4546

4647
# is this still needed?
4748
self.steps = None

openandroidinstaller/assets/configs/akari.yaml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,13 @@ steps:
4242
command: adb_reboot_bootloader
4343
- type: call_button
4444
content: Flash a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
45-
command: fastboot_flash_recovery
45+
command: fastboot_flash_boot
4646
- type: call_button
4747
command: adb_twrp_copy_partitions
4848
content: >
4949
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.
5050
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.
5151
- type: call_button
52-
command: fastboot_flash_recovery
52+
command: fastboot_flash_boot
5353
content: >
54-
Now we need to boot into recovery again. Press run and when you see the TWRP screen you can continue.
55-
install_os:
56-
- type: call_button
57-
content: >
58-
In the next steps, you finally flash the selected OS image.
59-
Connect your device with your computer with the USB-Cable.
60-
This step will format your phone and wipe all the data. It will also remove encryption and delete all files stored
61-
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.
62-
command: adb_twrp_wipe_and_install
54+
Now we need to boot into recovery again. Press run and when you see the TWRP screen you can continue.

openandroidinstaller/assets/configs/akatsuki.yaml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,13 @@ steps:
4242
command: adb_reboot_bootloader
4343
- type: call_button
4444
content: Flash a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
45-
command: fastboot_flash_recovery
45+
command: fastboot_flash_boot
4646
- type: call_button
4747
command: adb_twrp_copy_partitions
4848
content: >
4949
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.
5050
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.
5151
- type: call_button
52-
command: fastboot_flash_recovery
52+
command: fastboot_flash_boot
5353
content: >
54-
Now we need to boot into recovery again. Press run and when you see the TWRP screen you can continue.
55-
install_os:
56-
- type: call_button
57-
content: >
58-
In the next steps, you finally flash the selected OS image.
59-
Connect your device with your computer with the USB-Cable.
60-
This step will format your phone and wipe all the data. It will also remove encryption and delete all files stored
61-
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.
62-
command: adb_twrp_wipe_and_install
54+
Now we need to boot into recovery again. Press run and when you see the TWRP screen you can continue.

openandroidinstaller/assets/configs/kirin.yaml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,13 @@ steps:
4040
command: adb_reboot_bootloader
4141
- type: call_button
4242
content: Flash a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
43-
command: fastboot_flash_recovery
43+
command: fastboot_flash_boot
4444
- type: call_button
4545
command: adb_twrp_copy_partitions
4646
content: >
4747
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.
4848
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.
4949
- type: call_button
50-
command: fastboot_flash_recovery
50+
command: fastboot_flash_boot
5151
content: >
52-
Now we need to boot into recovery again. Press run and when you see the TWRP screen you can continue.
53-
install_os:
54-
- type: call_button
55-
content: >
56-
In the next steps, you finally flash the selected OS image.
57-
Connect your device with your computer with the USB-Cable.
58-
This step will format your phone and wipe all the data. It will also remove encryption and delete all files stored
59-
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.
60-
command: adb_twrp_wipe_and_install
52+
Now we need to boot into recovery again. Press run and when you see the TWRP screen you can continue.

openandroidinstaller/assets/configs/mermaid.yaml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,13 @@ steps:
4040
command: adb_reboot_bootloader
4141
- type: call_button
4242
content: Flash a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
43-
command: fastboot_flash_recovery
43+
command: fastboot_flash_boot
4444
- type: call_button
4545
command: adb_twrp_copy_partitions
4646
content: >
4747
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.
4848
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.
4949
- type: call_button
50-
command: fastboot_flash_recovery
50+
command: fastboot_flash_boot
5151
content: >
52-
Now we need to boot into recovery again. Press run and when you see the TWRP screen you can continue.
53-
install_os:
54-
- type: call_button
55-
content: >
56-
In the next steps, you finally flash the selected OS image.
57-
Connect your device with your computer with the USB-Cable.
58-
This step will format your phone and wipe all the data. It will also remove encryption and delete all files stored
59-
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.
60-
command: adb_twrp_wipe_and_install
52+
Now we need to boot into recovery again. Press run and when you see the TWRP screen you can continue.

openandroidinstaller/assets/configs/pioneer.yaml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,11 @@ steps:
4444
content: Flash a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
4545
command: fastboot_flash_recovery
4646
- type: call_button
47-
command: adb_twrp_copy_partitions
47+
command: adb_twrp_copy_boot
4848
content: >
4949
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.
5050
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.
5151
- type: call_button
52-
command: fastboot_flash_recovery
53-
content: >
54-
Now we need to boot into recovery again. Press run and when you see the TWRP screen you can continue.
55-
install_os:
56-
- type: call_button
52+
command: fastboot_flash_boot
5753
content: >
58-
In the next steps, you finally flash the selected OS image.
59-
Connect your device with your computer with the USB-Cable.
60-
This step will format your phone and wipe all the data. It will also remove encryption and delete all files stored
61-
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.
62-
command: adb_twrp_wipe_and_install
54+
Now we need to boot into recovery again. Press run and when you see the TWRP screen you can continue.

openandroidinstaller/assets/configs/yuga.yaml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,4 @@ steps:
3737
command: adb_reboot_bootloader
3838
- type: call_button
3939
content: Next, you need to flash a custom recovery image. Press the button to flash the selected image. Then continue.
40-
command: fastboot_flash_recovery
41-
install_os:
42-
- type: call_button
43-
content: >
44-
In the next steps, you finally flash the selected OS image.
45-
Connect your device with your computer with the USB-Cable.
46-
This step will format your phone and wipe all the data. It will also remove encryption and delete all files stored
47-
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.
48-
command: adb_twrp_wipe_and_install
40+
command: fastboot_flash_boot

openandroidinstaller/assets/configs/z3.yaml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,4 @@ steps:
3939
command: adb_reboot_bootloader
4040
- type: call_button
4141
content: Next, you need to flash a custom recovery image. Press the button to flash the selected image. Then continue.
42-
command: fastboot_flash_recovery
43-
install_os:
44-
- type: call_button
45-
content: >
46-
In the next steps, you finally flash the selected OS image.
47-
Connect your device with your computer with the USB-Cable.
48-
This step will format your phone and wipe all the data. It will also remove encryption and delete all files stored
49-
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.
50-
command: adb_twrp_wipe_and_install
42+
command: fastboot_flash_boot

openandroidinstaller/installer_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def validate_config(config: str) -> bool:
152152
),
153153
"content": str,
154154
schema.Optional("command"): Regex(
155-
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"
155+
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"
156156
),
157157
schema.Optional("allow_skip"): bool,
158158
schema.Optional("img"): str,

openandroidinstaller/openandroidinstaller.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -124,23 +124,11 @@ def __init__(self, state: AppState):
124124

125125
# initialize the addon view
126126
self.select_addon_view = AddonsView(on_confirm=self.to_next_view, state=self.state)
127-
self.flash_recovery_view = StepView(
128-
step=Step(
129-
title="Flash custom recovery",
130-
type="call_button",
131-
content="Flash a custom recovery (temporarily) by pressing 'Confirm and run'. Once your phone screen looks like the picture on the left, continue.",
132-
command="fastboot_flash_recovery",
133-
img="twrp-start.jpeg",
134-
),
135-
state=self.state,
136-
on_confirm=self.to_next_view,
137-
)
138127
self.install_addons_view = InstallAddonsView(
139128
on_confirm=self.to_next_view, state=self.state
140129
)
141130
self.state.addon_views = [
142131
self.install_addons_view,
143-
self.flash_recovery_view,
144132
self.select_addon_view,
145133
]
146134

0 commit comments

Comments
 (0)