Skip to content

Commit be8ef3f

Browse files
authored
Specific functions for tool commands (#33)
This PR adds: - Simplify config files - Popup enabled again - Make enabeling developer options clearer, better design hierarchy - Use twrp scripting - Use specific functions to run commands with tools - Write logs to file
2 parents 28e89d3 + 17264d7 commit be8ef3f

File tree

15 files changed

+432
-431
lines changed

15 files changed

+432
-431
lines changed

README.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ Sony | Xperia Z | yuga | C6603 | tested
4545
Sony | Xperia Z3 | z3 | | under development
4646
Sony | Xperia ZX | kagura | | planned
4747
Fairphone | Fairphone 2 | FP2 | | under development
48-
Fairphone | Fairphone 3 | FP3 | | under development
49-
Motorola | Moto G5 | cedric | | planned
48+
Fairphone | Fairphone 3 | FP3 | | tested
49+
Motorola | moto G5 | cedric | | planned
5050
Motorola | moto g7 power | ocean | | under development
5151

5252

@@ -87,18 +87,14 @@ If you want to use the tool for a non-supported smartphone, the fastest way is t
8787
#### Content of a config file
8888

8989
Every step in the config file corresponds to one view in the application. These steps should contain the following fields:
90-
- `title`: str; Describing the overall goal of the step. Will be displayed in the header of the view.
9190
- `type`: str; Corresponds to the type of view to generate. There are the following options:
9291
- `text`: Just display the text given in content.
9392
- `confirm_button`: Display the content, as well as a button to allow the user to go to the next step.
9493
- `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.
9594
- `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.
9695
- `link_button_with_confirm`: Display a button that opens a browser with a given link, confirm afterwards. Link is given in `link`.
9796
- `content`: str; The content text displayed alongside the action of the step. Used to inform the user about whats going on.
98-
- `command`: [ONLY for call_button* steps] str; This is a terminal command run in a shell. (For example fastboot or adb). There are three types of placeholders supported, that will be filled by the tool as soon as information is given.
99-
- `<image>`: The path of the ROM image file.
100-
- `<recovery>`: The path of the recovery file.
101-
- `<inputtext>`: Text from the user input from `call_button_with_input` views.
97+
- `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`, `fastboot_flash_recovery`, `fastboot_unlock_with_code`, `fastboot_unlock`, `fastboot_oem_unlock`, `fastboot_reboot`, `heimdall_flash_recovery`.
10298
- `img`: [OPTIONAL] Display an image on the left pane of the step view. Images are loaded from `openandroidinstaller/assets/imgs/`.
10399
- `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.
104100
- `link`: [OPTIONAL] Link to use for the link button if type is `link_button_with_confirm`.

openandroidinstaller/assets/configs/FP2.yaml

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,42 +5,33 @@ metadata:
55
steps:
66
unlock_bootloader:
77
flash_recovery:
8-
- title: "Flash a custom recovery"
9-
type: confirm_button
8+
- type: confirm_button
109
content: >
1110
Now you need to flash a custom recovery system on the phone. A recovery is a small subsystem on your phone, that manages updating,
1211
adapting and repairing of the operating system.
13-
- title: "Flash a custom recovery"
14-
type: call_button
12+
- type: call_button
1513
content: Once the device is fully booted, you need to reboot into the bootloader again by pressing 'Confirm and run' here. Then continue.
16-
command: "adb reboot bootloader"
17-
- title: "Flash a custom recovery"
18-
type: call_button
14+
command: adb_reboot_bootloader
15+
- type: call_button
1916
content: Flash a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
20-
command: "fastboot flash recovery <recovery>"
21-
- title: "Flash temporary recovery"
22-
type: confirm_button
17+
command: fastboot_flash_recovery
18+
- type: confirm_button
2319
content: >
2420
Now reboot into recovery to verify the installation. Do not reboot into the existing OS, since it will overwrite the recovery you just installed!
2521
With the device powered off, hold 'Volume Up + Power'. Release when boot logo appears.
2622
install_os:
27-
- title: "Flash LineageOS"
28-
type: confirm_button
23+
- type: confirm_button
2924
content: >
3025
Now tap Factory Reset, then Format data / Factory reset on your phone screen and continue with the formatting process.
3126
This will remove encryption and delete all files stored in the internal storage, as well as format your cache partition (if you have one).
32-
- title: "Flash LineageOS"
33-
type: confirm_button
34-
content: Return to the main menu on the phone.
35-
- title: "Flash LineageOS"
36-
type: confirm_button
37-
content: On the device, select “Apply Update”, then “Apply from ADB” to begin sideload. Then confirm here.
38-
- title: "Flash LineageOS"
39-
type: call_button
27+
- type: confirm_button
28+
content: >
29+
Return to the main menu on the phone by pressing the back button on the screen.
30+
On the device, select “Apply Update”, then “Apply from ADB” to begin sideload. Then confirm here.
31+
- type: call_button
4032
content: >
4133
Now it's time to flash the LineageOS image. Don't remove the USB-Cable and press 'Confirm and run' to start!
4234
This might take a while. Confirm after it's done.
43-
command: "adb sideload <image>"
44-
- title: "Flash LineageOS"
45-
type: confirm_button
35+
command: adb_sideload
36+
- type: confirm_button
4637
content: Flashing finished. Now press 'back' (arrow) and then 'Reboot system now' on the phone screen to finish the installation.

openandroidinstaller/assets/configs/FP3.yaml

Lines changed: 36 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,49 +4,59 @@ metadata:
44
devicecode: FP3
55
steps:
66
unlock_bootloader:
7-
- title: "Unlock the bootloader"
8-
type: link_button_with_confirm
7+
- type: link_button_with_confirm
98
content: >
9+
As a first step, you need to unlock the bootloader. A bootloader is the piece of software, that tells your phone
10+
how to start and run an operating system (like Android). Your device should be turned on.
1011
Click on the button to open the instructions on the Fairphone Support official unlocking website to generate an unlock code for your device.
11-
Once you done that, continue.
12+
Once you've done that, continue.
1213
link: https://www.fairphone.com/en/bootloader-unlocking-code-for-fairphone-3/
14+
- type: call_button
15+
content: Press 'Confirm and run' to reboot into the bootloader.
16+
command: adb_reboot_bootloader
17+
- type: confirm_button
18+
content: >
19+
Select 'Restart bootloader' on your smartphone screen by pressing the volume button and the confirm by pushing the power button.
20+
Then press 'Confirm and continue' here.
21+
- type: call_button
22+
content: In this step you actually unlock the bootloader. Just press 'Confirm and run' here. Once it's done, press continue here.
23+
command: fastboot_oem_unlock
24+
- type: confirm_button
25+
content: >
26+
Follow the instructions on the Fairphone screen. This command will wipe all the personal data on your phone.
27+
- type: call_button
28+
content: To finish the unlocking, the phone needs to reboot. Just press 'Confirm and run' here to reboot. Then continue.
29+
command: fastboot_reboot
30+
- type: confirm_button
31+
content: The bootloader is now unlocked. Since the device resets completely, you will need to re-enable USB debugging to continue.
1332
flash_recovery:
14-
- title: "Flash a custom recovery"
15-
type: confirm_button
33+
- type: confirm_button
1634
content: >
1735
Now you need to flash a custom recovery system on the phone. A recovery is a small subsystem on your phone, that manages updating,
1836
adapting and repairing of the operating system.
19-
- title: "Flash a custom recovery"
20-
type: call_button
37+
- type: call_button
2138
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.
22-
command: "adb reboot bootloader"
23-
- title: "Flash a custom recovery"
24-
type: call_button
39+
command: adb_reboot_bootloader
40+
- type: call_button
2541
content: Once the device is in fastboot mode, flash the custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
26-
command: "fastboot flash boot <recovery>"
27-
- title: "Flash temporary recovery"
28-
type: confirm_button
42+
command: fastboot_flash_recovery
43+
- type: confirm_button
2944
content: >
3045
Now reboot into recovery to verify the installation. Do not reboot into the existing OS, since it will overwrite the recovery you just installed!
3146
With the device powered off, hold 'Volume Up + Power'. Release when boot logo appears.
3247
install_os:
33-
- title: "Flash LineageOS"
34-
type: confirm_button
48+
- type: confirm_button
3549
content: >
3650
Now tap 'Factory Reset', then 'Format data / Factory reset' on your phone screen and continue with the formatting process.
3751
This will remove encryption and delete all files stored in the internal storage, as well as format your cache partition (if you have one).
38-
- title: "Flash LineageOS"
39-
type: confirm_button
40-
content: Return to the main menu on the phone.
41-
- title: "Flash LineageOS"
42-
type: confirm_button
43-
content: On the device, select “Apply Update”, then “Apply from ADB” to begin sideload. Then confirm here.
44-
- title: "Flash LineageOS"
45-
type: call_button
52+
- type: confirm_button
53+
content: >
54+
Return to the main menu on the phone by pressing the back button.
55+
On the device, select “Apply Update”, then “Apply from ADB” to begin sideload. Then confirm here.
56+
- type: call_button
4657
content: >
4758
Now it's time to flash the LineageOS image. Don't remove the USB-Cable and press 'Confirm and run' to start!
4859
This might take a while. Confirm after it's done.
49-
command: "adb sideload <image>"
50-
- title: "Flash LineageOS"
51-
type: confirm_button
60+
command: adb_sideload
61+
- type: confirm_button
5262
content: Flashing finished. Now press 'back' (arrow) and then 'Reboot system now' on the phone screen to finish the installation. Then confirm here.

openandroidinstaller/assets/configs/a3y17lte.yaml

Lines changed: 12 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,51 +5,28 @@ metadata:
55
steps:
66
unlock_bootloader:
77
flash_recovery:
8-
- title: "Boot into bootloader"
9-
type: call_button
8+
- type: call_button
109
content: >
1110
As a first step, you need to boot into the bootloader. A bootloader is the piece of software,
1211
that tells your phone who to start and run an operating system (like Android). Your device should be turned on.
1312
Then press 'Confirm and run' to reboot into the bootloader. Continue once it's done.
14-
command: "adb reboot download"
15-
- title: "Flash custom recovery"
16-
type: call_button
13+
command: adb_reboot_download
14+
- type: call_button
1715
content: >
1816
In this step, you need to flash a custom recovery on your device.
1917
Press 'Confirm and run' to start the process. Confirm afterwards to continue.
20-
command: "heimdall flash --no-reboot --RECOVERY <recovery>"
21-
- title: "Boot into recovery"
22-
type: confirm_button
18+
command: heimdall_flash_recovery
19+
- type: confirm_button
2320
img: samsung-buttons.png
2421
content: >
2522
Unplug the USB cable from your device. Then manually reboot into recovery by pressing the *Volume Down* + *Power buttons* for
2623
8~10 seconds until the screen turns black & release the buttons immediately when it does, then boot to recovery with the device powered off,
27-
hold *Volume Up* + *Home* + *Power*.
24+
hold *Volume Up* + *Home* + *Power*. Confirm when the recovery screen appears.
2825
install_os:
29-
- title: "Flash LineageOS"
30-
type: confirm_button
26+
- type: call_button
3127
content: >
32-
Now swipe right to allow modifications then tap 'Wipe' on your phone. Next tap 'Format Data' and follow
33-
the instructions on your phone to continue with the formatting process. This will remove encryption and delete all files stored
34-
in the internal storage. Confirm to continue once you are done.
35-
- title: "Flash LineageOS"
36-
type: confirm_button
37-
content: >
38-
Return to the previous menu on your phone by going back two times.
39-
Them tap 'Advanced Wipe', and select the 'Cache' and 'System' partitions and then 'Swipe to Wipe'.
40-
Confirm to continue once you are done.
41-
- title: "Flash LineageOS"
42-
type: confirm_button
43-
content: >
44-
Now connect the phone to the computer again with the USB-cable. On the device, go back three times and select “Advanced”,
45-
then “ADB Sideload”. Select 'Wipe cache' and 'Wipe dalvik cache', then swipe to begin sideload. Then confirm here.
46-
- title: "Flash LineageOS"
47-
type: call_button
48-
content: >
49-
Now it's time to flash the LineageOS image. Don't remove the USB-Cable and press 'Confirm and run' to start!
50-
This might take a while. Confirm after it's done.
51-
command: "adb sideload <image>"
52-
- title: "Reboot into LineageOS"
53-
type: call_button
54-
content: As a final step, reboot into LineageOS to finish the installation by pressing the button.
55-
command: "adb reboot"
28+
In the next steps, you finally flash the selected OS image.
29+
Connect your device with your computer with the USB-Cable.
30+
This step will format your phone and wipe all the data. It will also remove encryption and delete all files stored
31+
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.
32+
command: adb_twrp_wipe_and_install

openandroidinstaller/assets/configs/a5xelte.yaml

Lines changed: 11 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,49 +5,26 @@ metadata:
55
steps:
66
unlock_bootloader:
77
flash_recovery:
8-
- title: "Boot into bootloader"
9-
type: call_button
8+
- type: call_button
109
content: >
1110
As a first step, you need to boot into the bootloader. A bootloader is the piece of software,
1211
that tells your phone who to start and run an operating system (like Android). Your device should be turned on.
1312
Then press 'Confirm and run' to reboot into the bootloader. Continue once it's done.
14-
command: "adb reboot download"
15-
- title: "Flash custom recovery"
16-
type: call_button
13+
command: adb_reboot_download
14+
- type: call_button
1715
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.
18-
command: "heimdall flash --no-reboot --RECOVERY <recovery>"
19-
- title: "Boot into recovery"
20-
type: confirm_button
16+
command: heimdall_flash_recovery
17+
- type: confirm_button
2118
img: samsung-buttons.png
2219
content: >
2320
Unplug the USB cable from your device. Then manually reboot into recovery by pressing the *Volume Down* + *Power buttons* for 8~10 seconds
2421
until the screen turns black & release the buttons immediately when it does, then boot to recovery with the device powered off,
2522
hold *Volume Up* + *Home* + *Power button*.
2623
install_os:
27-
- title: "Flash LineageOS"
28-
type: confirm_button
24+
- type: call_button
2925
content: >
30-
Now swipe right to allow modifications then tap 'Wipe' on your phone.
31-
Next tap 'Format Data' and follow the instructions on your phone to continue with the formatting process.
32-
This will remove encryption and delete all files stored in the internal storage. Confirm to continue once you are done.
33-
- title: "Flash LineageOS"
34-
type: confirm_button
35-
content: >
36-
Return to the previous menu on your phone by going back two times.
37-
Them tap 'Advanced Wipe', and select the 'Cache' and 'System' partitions and then 'Swipe to Wipe'.
38-
Confirm to continue once you are done.
39-
- title: "Flash LineageOS"
40-
type: confirm_button
41-
content: >
42-
Now connect the phone to the computer again with the USB-cable. On the device, go back three times and select “Advanced”,
43-
then “ADB Sideload”. Select 'Wipe cache' and 'Wipe dalvik cache', then swipe to begin sideload. Then confirm here.
44-
- title: "Flash LineageOS"
45-
type: call_button
46-
content: >
47-
Now it's time to flash the LineageOS image. Don't remove the USB-Cable and press 'Confirm and run' to start!
48-
This might take a while. Confirm after it's done.
49-
command: "adb sideload <image>"
50-
- title: "Reboot into LineageOS"
51-
type: call_button
52-
content: As a final step, reboot into LineageOS to finish the installation by pressing the button.
53-
command: "adb reboot"
26+
In the next steps, you finally flash the selected OS image.
27+
Connect your device with your computer with the USB-Cable.
28+
This step will format your phone and wipe all the data. It will also remove encryption and delete all files stored
29+
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.
30+
command: adb_twrp_wipe_and_install

0 commit comments

Comments
 (0)