Skip to content

Commit

Permalink
Config formatting (#130)
Browse files Browse the repository at this point in the history
I reformatted the configs for more consistency, removed an unneeded
reboot instructions for the FPs and added the TWRP image to every
config. (It needs to be updated - outdated version)
  • Loading branch information
tsterbak committed Apr 23, 2023
2 parents 3b75594 + 6b973e8 commit e3291c9
Show file tree
Hide file tree
Showing 59 changed files with 404 additions and 226 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,15 +198,15 @@ If you want to use the tool for a non-supported smartphone, the fastest way is t
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:
Every config file should have `metadata` with the following fields:
- `maintainer`: str; Maintainer and author of the config file.
- `device_name`: str; Name of the device.
- `is_ab_device`: bool; A boolean to determine if the device is a/b-partitioned or not.
- `device_code`: str; The official device code.
- `supported_device_codes`: List[str]; A list of supported device codes for the config. The config will be loaded based on this field.
- `twrp-link`: [OPTIONAL] str; name of the corresponding twrp page.

In addition to these metadata, every config can have optional requirements. If these are set, the user is asked to check if they are meet.
In addition to these metadata, every config can have optional `requirements`. If these are set, the user is asked to check if they are meet.
- `android`: [OPTIONAL] int|str; Android version to install prior to installing a custom ROM.
- `firmware`: [OPTIONAL] str; specific firmware version to install before installing a custom ROM.

Expand All @@ -218,13 +218,13 @@ Every step in the config file corresponds to one view in the application. These
- `call_button`: Display the content text and a button that runs a given command. After the command is run, a confirm button is displayed to allow the user to move to the next step.
- `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_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.
- `content`: str; The content text displayed alongside the action of the step. Used to inform the user about whats going on. For consistency and better readability the text should be moved into the next line using `>`.
- `link`: [OPTIONAL] Link to use for the link button if type is `link_button_with_confirm`.
- `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`.
- `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.

You can also use the `requirements` field in the yaml, to specify `firmware` or `android` version requirements. The user will then be prompted if these requirements are satisfied.
**Please try to retain this order of these fields in your config to ensure consistency.**

## How to build the application for your platform

Expand Down
11 changes: 5 additions & 6 deletions openandroidinstaller/assets/configs/FP2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@ steps:
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.
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: Boot a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
command: fastboot_boot_recovery
- type: confirm_button
img: twrp-start.jpeg
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.
Boot a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
command: fastboot_boot_recovery
23 changes: 13 additions & 10 deletions openandroidinstaller/assets/configs/FP3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,38 @@ steps:
Once you've done that, continue.
link: https://www.fairphone.com/en/bootloader-unlocking-code-for-fairphone-3/
- type: call_button
content: Press 'Confirm and run' to reboot into the bootloader.
content: >
Press 'Confirm and run' to reboot into the bootloader.
command: adb_reboot_bootloader
- type: confirm_button
content: >
Select 'Restart bootloader' on your smartphone screen by pressing the volume button and the confirm by pushing the power button.
Then press 'Confirm and continue' here.
- type: call_button
content: In this step you actually unlock the bootloader. Just press 'Confirm and run' here. Once it's done, press continue here.
content: >
In this step you actually unlock the bootloader. Just press 'Confirm and run' here. Once it's done, press continue here.
command: fastboot_unlock
- type: confirm_button
content: >
Follow the instructions on the Fairphone screen. This command will wipe all the personal data on your phone.
- type: call_button
content: To finish the unlocking, the phone needs to reboot. Just press 'Confirm and run' here to reboot. Then continue.
content: >
To finish the unlocking, the phone needs to reboot. Just press 'Confirm and run' here to reboot. Then continue.
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.
content: >
The bootloader is now unlocked. Since the device resets completely, you will need to re-enable USB debugging to continue.
boot_recovery:
- type: confirm_button
content: >
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.
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_boot_recovery
- type: confirm_button
img: twrp-start.jpeg
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.
Once the device is in fastboot mode, flash the custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
command: fastboot_boot_recovery
23 changes: 13 additions & 10 deletions openandroidinstaller/assets/configs/FP4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,38 @@ steps:
Once you've done that, continue.
link: https://support.fairphone.com/hc/en-us/articles/4405858258961-FP4-Manage-the-bootloader
- type: call_button
content: Press 'Confirm and run' to reboot into the bootloader.
content: >
Press 'Confirm and run' to reboot into the bootloader.
command: adb_reboot_bootloader
- type: confirm_button
content: >
Select 'Restart bootloader' on your smartphone screen by pressing the volume button and the confirm by pushing the power button.
Then press 'Confirm and continue' here.
- type: call_button
content: In this step you actually unlock the bootloader. Just press 'Confirm and run' here. Once it's done, press continue here.
content: >
In this step you actually unlock the bootloader. Just press 'Confirm and run' here. Once it's done, press continue here.
command: fastboot_unlock
- type: confirm_button
content: >
Follow the instructions on the Fairphone screen. This command will wipe all the personal data on your phone.
- type: call_button
content: To finish the unlocking, the phone needs to reboot. Just press 'Confirm and run' here to reboot. Then continue.
content: >
To finish the unlocking, the phone needs to reboot. Just press 'Confirm and run' here to reboot. Then continue.
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.
content: >
The bootloader is now unlocked. Since the device resets completely, you will need to re-enable USB debugging to continue.
boot_recovery:
- type: confirm_button
content: >
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.
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, boot the custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
command: fastboot_boot_recovery
- type: confirm_button
img: twrp-start.jpeg
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.
Once the device is in fastboot mode, boot the 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/a3y17lte.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ steps:
- 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.
that tells your phone how 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 boot a custom recovery on your device.
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.
command: heimdall_flash_recovery
- type: confirm_button
Expand Down
6 changes: 4 additions & 2 deletions openandroidinstaller/assets/configs/a5xelte.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ steps:
- 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.
that tells your phone how 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 boot 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 flash 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: 4 additions & 2 deletions openandroidinstaller/assets/configs/a72q.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ steps:
- 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.
that tells your phone how 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 boot 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 flash 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: 4 additions & 2 deletions openandroidinstaller/assets/configs/a7xelte.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ steps:
- 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.
that tells your phone how 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 boot 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 flash 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
21 changes: 13 additions & 8 deletions openandroidinstaller/assets/configs/akari.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ requirements:
steps:
unlock_bootloader:
- type: confirm_button
content: As a first step, you need to unlock the bootloader of your device. On the device, dial *#*#7378423#*#* (*#*#SERVICE#*#*) to launch the service menu.
content: >
As a first step, you need to unlock the bootloader of your device. On the device, dial *#*#7378423#*#* (*#*#SERVICE#*#*) to launch the service menu.
- type: confirm_button
content: Go to service info > configuration and check rooting status - you can only continue if it says 'Bootloader unlock allowed":" Yes.'
content: >
Go to service info > configuration and check rooting status - you can only continue if it says 'Bootloader unlock allowed":" Yes.'
- type: confirm_button
content: >
Now go to Settings 'About the phone' and then Status. Write down the IMEI of your device. You will need it in the next step.
Expand All @@ -22,9 +24,11 @@ steps:
Once you got the code write it down somewhere and continue to input the code.
link: https://developer.sonymobile.com/unlockbootloader/unlock-yourboot-loader/
- type: confirm_button
content: Connect the device to your PC via USB. And confirm to continue.
content: >
Connect the device to your PC via USB. And confirm to continue.
- type: call_button
content: Press the button to reboot into the bootloader now. When the notification light turns blue, confirm to continue.
content: >
Press the button to reboot into the bootloader now. When the notification light turns blue, confirm to continue.
command: adb_reboot_bootloader
- type: call_button_with_input
content: >
Expand All @@ -44,14 +48,15 @@ steps:
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: Boot 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
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.
command: adb_twrp_copy_partitions
- type: call_button
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.
Now we need to boot into recovery again. Press run and when you see the TWRP screen you can continue.
command: fastboot_flash_boot

0 comments on commit e3291c9

Please sign in to comment.