Skip to content

Commit

Permalink
Unified install step & install addons (#65)
Browse files Browse the repository at this point in the history
- Add an install view and allow to circle back to flash a recovery
- Enable selecting addons
- Enable installing addons
- Add download buttons for Google apps, f-droid and microg
  • Loading branch information
tsterbak committed Feb 8, 2023
2 parents 1f73a79 + 649830e commit 4d5dd10
Show file tree
Hide file tree
Showing 62 changed files with 989 additions and 520 deletions.
9 changes: 5 additions & 4 deletions openandroidinstaller/app_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# If not, see <https://www.gnu.org/licenses/>."""
# Author: Tobias Sterbak

import copy
from pathlib import Path

from installer_config import _load_config
Expand All @@ -37,9 +38,11 @@ def __init__(

# placeholders
self.advanced = False
self.install_addons = False
self.config = None
self.image_path = None
self.recovery_path = None
self.is_ab = None

# is this still needed?
self.steps = None
Expand All @@ -48,8 +51,6 @@ def load_config(self, device_code: str):
"""Load the config from file to state by device code."""
self.config = _load_config(device_code, self.config_path)
if self.config:
self.steps = (
self.config.unlock_bootloader
+ self.config.flash_recovery
+ self.config.install_os
self.steps = copy.deepcopy(self.config.unlock_bootloader) + copy.deepcopy(
self.config.flash_recovery
)
10 changes: 1 addition & 9 deletions openandroidinstaller/assets/configs/FP2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,4 @@ steps:
- 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!
With the device powered off, hold 'Volume Up + Power'. Release when boot logo appears.
install_os:
- type: call_button
content: >
In the next steps, you finally flash the selected OS image.
Wait until the TWRP screen appears. Then run the command.
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. This might take a while. At the end your phone will boot into the new OS.
command: adb_twrp_wipe_and_install
With the device powered off, hold 'Volume Up + Power'. Release when boot logo appears.
10 changes: 1 addition & 9 deletions openandroidinstaller/assets/configs/FP3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,4 @@ steps:
- 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!
With the device powered off, hold 'Volume Up + Power'. Release when boot logo appears.
install_os:
- type: call_button
content: >
In the next steps, you finally flash the selected OS image.
Wait until the TWRP screen appears. Then run the command.
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. This might take a while. At the end your phone will boot into the new OS.
command: adb_twrp_wipe_and_install
With the device powered off, hold 'Volume Up + Power'. Release when boot logo appears.
10 changes: 1 addition & 9 deletions openandroidinstaller/assets/configs/FP4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,4 @@ steps:
- 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!
With the device powered off, hold 'Volume Up + Power'. Release when boot logo appears.
install_os:
- type: call_button
content: >
In the next steps, you finally flash the selected OS image.
Wait until the TWRP screen appears. Then run the command.
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. This might take a while. At the end your phone will boot into the new OS.
command: adb_twrp_wipe_and_install
With the device powered off, hold 'Volume Up + Power'. Release when boot logo appears.
10 changes: 1 addition & 9 deletions openandroidinstaller/assets/configs/a3y17lte.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,4 @@ steps:
content: >
Unplug the USB cable from your device. Then manually reboot into recovery by pressing the *Volume Down* + *Power buttons* for
8~10 seconds until the screen turns black & release the buttons immediately when it does, then boot to recovery with the device powered off,
hold *Volume Up* + *Home* + *Power*. Confirm when the recovery screen appears.
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
hold *Volume Up* + *Home* + *Power*. Confirm when the recovery screen appears.
10 changes: 1 addition & 9 deletions openandroidinstaller/assets/configs/a5xelte.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,4 @@ steps:
content: >
Unplug the USB cable from your device. Then manually reboot into recovery by pressing the *Volume Down* + *Power buttons* for 8~10 seconds
until the screen turns black & release the buttons immediately when it does, then boot to recovery with the device powered off,
hold *Volume Up* + *Home* + *Power button*.
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
hold *Volume Up* + *Home* + *Power button*.
10 changes: 1 addition & 9 deletions openandroidinstaller/assets/configs/a72q.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,4 @@ steps:
content: >
Unplug the USB cable from your device. Then manually reboot into recovery by pressing the *Volume Down* + *Power* for 8~10 seconds
until the screen turns black & release the buttons immediately when it does, then boot to recovery with the device powered off,
hold *Volume Up* + *Power button*.
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
hold *Volume Up* + *Power button*.
10 changes: 1 addition & 9 deletions openandroidinstaller/assets/configs/a7xelte.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,4 @@ steps:
content: >
Unplug the USB cable from your device. Then manually reboot into recovery by pressing the *Volume Down* + *Power buttons* for 8~10 seconds
until the screen turns black & release the buttons immediately when it does, then boot to recovery with the device powered off,
hold *Volume Up* + *Home* + *Power button*.
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
hold *Volume Up* + *Home* + *Power button*.
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.
10 changes: 1 addition & 9 deletions openandroidinstaller/assets/configs/avicii.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,4 @@ steps:
- 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
content: >
In this last step, you finally flash the selected OS image.
Wait until the TWRP screen appears. Then run the command.
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/barbet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,4 @@ steps:
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
install_os:
- type: call_button
content: >
In the next steps, you finally flash the selected OS image.
Wait until the TWRP screen appears. Then run the command.
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_recovery
10 changes: 1 addition & 9 deletions openandroidinstaller/assets/configs/beyond1lte.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,4 @@ steps:
content: >
Unplug the USB cable from your device. Then manually reboot into recovery by pressing the *Volume Down* + *Bixby* for 8~10 seconds
until the screen turns black & release the buttons immediately when it does, then boot to recovery with the device powered off,
hold *Volume Up* + *Bixby* + *Power button*.
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
hold *Volume Up* + *Bixby* + *Power button*.
10 changes: 1 addition & 9 deletions openandroidinstaller/assets/configs/blueline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,4 @@ steps:
- 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
install_os:
- type: call_button
content: >
In the next steps, you finally flash the selected OS image.
Wait until the TWRP screen appears. Then run the command.
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
img: twrp-start.jpeg
10 changes: 1 addition & 9 deletions openandroidinstaller/assets/configs/bonito.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,4 @@ steps:
- 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
install_os:
- type: call_button
content: >
In the next steps, you finally flash the selected OS image.
Wait until the TWRP screen appears. Then run the command.
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
img: twrp-start.jpeg
10 changes: 1 addition & 9 deletions openandroidinstaller/assets/configs/cedric.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,4 @@ 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
install_os:
- type: call_button
content: >
In this last step, you finally flash the selected OS image.
Wait until the TWRP screen appears. Then run the command.
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_recovery
10 changes: 1 addition & 9 deletions openandroidinstaller/assets/configs/coral.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,4 @@ steps:
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
install_os:
- type: call_button
content: >
In the next steps, you finally flash the selected OS image.
Wait until the TWRP screen appears. Then run the command.
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_recovery
10 changes: 1 addition & 9 deletions openandroidinstaller/assets/configs/crosshatch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,4 @@ steps:
- 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
install_os:
- type: call_button
content: >
In the next steps, you finally flash the selected OS image.
Wait until the TWRP screen appears. Then run the command.
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
img: twrp-start.jpeg
10 changes: 1 addition & 9 deletions openandroidinstaller/assets/configs/crownlte.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,4 @@ steps:
content: >
Unplug the USB cable from your device. Then manually reboot into recovery by pressing the *Volume Down* + *Bixby* for 8~10 seconds
until the screen turns black & release the buttons immediately when it does, then boot to recovery with the device powered off,
hold *Volume Up* + *Bixby* + *Power button*.
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
hold *Volume Up* + *Bixby* + *Power button*.
Loading

0 comments on commit 4d5dd10

Please sign in to comment.