Skip to content

Commit 056f142

Browse files
committed
Simplify config files
1 parent ea88b7f commit 056f142

File tree

4 files changed

+31
-56
lines changed

4 files changed

+31
-56
lines changed

openandroidinstaller/assets/configs/a3y17lte.yaml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,25 @@ 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.
1413
command: adb_reboot_download
15-
- title: "Flash custom recovery"
16-
type: call_button
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.
2018
command: heimdall_flash_recovery
21-
- title: "Boot into recovery"
22-
type: confirm_button
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,
2724
hold *Volume Up* + *Home* + *Power*. Confirm when the recovery screen appears.
2825
install_os:
29-
- title: "Flash LineageOS"
30-
type: call_button
26+
- type: call_button
3127
content: >
3228
Connect your device with your computer with the USB-Cable.
3329
This step will format your phone and wipe all the data. It will also remove encryption and delete all files stored

openandroidinstaller/assets/configs/sargo.yaml

Lines changed: 24 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -4,78 +4,59 @@ metadata:
44
devicecode: sargo
55
steps:
66
unlock_bootloader:
7-
- title: "Unlock the bootloader"
8-
type: confirm_button
7+
- type: confirm_button
98
content: >
109
As a first step, you need to unlock the bootloader. A bootloader is the piece of software, that tells your phone
1110
how to start and run an operating system (like Android). Your device should be turned on.
12-
- title: "Unlock the bootloader"
13-
type: call_button
11+
- type: call_button
1412
content: Press 'Confirm and run' to reboot into the bootloader.
15-
command: "adb reboot bootloader"
16-
- title: "Unlock the bootloader"
17-
type: confirm_button
13+
command: adb_reboot_bootloader
14+
- type: confirm_button
1815
content: >
1916
Select 'Restart bootloader' on your smartphone screen by pressing the volume button and the confirm by pushing the power button.
2017
Then press 'Confirm and continue' here.
21-
- title: "Unlock the bootloader"
22-
type: call_button
18+
- type: call_button
2319
content: In this step you actually unlock the bootloader. Just press 'Confirm and run' here. Once it's done, press continue here.
24-
command: "fastboot flashing unlock"
25-
allow_skip: True
26-
- title: "Unlock the bootloader"
27-
type: confirm_button
20+
command: fastboot_unlock
21+
- type: confirm_button
2822
content: >
2923
At this point the device may display on-screen prompts which will require interaction to continue the process of unlocking the bootloader.
3024
Please take whatever actions the device asks you to to proceed.
31-
- title: "Unlock the bootloader"
32-
type: call_button
25+
- type: call_button
3326
content: To finish the unlocking, the phone needs to reboot. Just press 'Confirm and run' here to reboot. Then continue.
34-
command: "fastboot reboot"
35-
- title: "Unlock the bootloader"
36-
type: confirm_button
27+
command: fastboot_reboot
28+
- type: confirm_button
3729
content: The bootloader is now unlocked. Since the device resets completely, you will need to re-enable USB debugging to continue.
3830
flash_recovery:
39-
- title: "Flash a custom recovery"
40-
type: confirm_button
31+
- type: confirm_button
4132
content: >
4233
Now you need to flash a custom recovery system on the phone. A recovery is a small subsystem on your phone, that manages updating,
4334
adapting and repairing of the operating system.
44-
- title: "Flash a custom recovery"
45-
type: call_button
35+
- type: call_button
4636
content: Once the device is fully booted, you need to reboot into the bootloader again by pressing 'Confirm and run' here. Then continue.
47-
command: "adb reboot bootloader"
48-
- title: "Flash a custom recovery"
49-
type: confirm_button
37+
command: adb_reboot_bootloader
38+
- type: confirm_button
5039
content: Select 'Restart bootloader' on your smartphone screen. Then confirm to continue.
51-
- title: "Flash a custom recovery"
52-
type: call_button
40+
- type: call_button
5341
content: Flash a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
54-
command: "fastboot flash boot <recovery>"
42+
command: fastboot_flash_recovery
5543
install_os:
56-
- title: "Flash LineageOS"
57-
type: confirm_button
44+
- type: confirm_button
5845
content: In this step, you finally flash LineageOS. Confirm to continue.
59-
- title: "Flash LineageOS"
60-
type: confirm_button
46+
- type: confirm_button
6147
content: Select 'Recovery Mode' on your smartphone screen and press the Start-Button to confirm. Then confirm here.
62-
- title: "Flash LineageOS"
63-
type: confirm_button
48+
- type: confirm_button
6449
content: >
6550
Now tap Factory Reset, then Format data / Factory reset on your phone screen and continue with the formatting process.
6651
This will remove encryption and delete all files stored in the internal storage, as well as format your cache partition (if you have one).
67-
- title: "Flash LineageOS"
68-
type: confirm_button
52+
- type: confirm_button
6953
content: Return to the main menu on the phone.
70-
- title: "Flash LineageOS"
71-
type: confirm_button
54+
- type: confirm_button
7255
content: On the device, select “Apply Update”, then “Apply from ADB” to begin sideload. Then confirm here.
73-
- title: "Flash LineageOS"
74-
type: call_button
56+
- type: call_button
7557
content: >
7658
Now it's time to flash the LineageOS image. Don't remove the USB-Cable and press 'Confirm and run' to start!
7759
This might take a while. Confirm after it's done.
78-
command: "adb sideload <image>"
79-
- title: "Flash LineageOS"
80-
type: confirm_button
60+
command: adb_sideload
61+
- type: confirm_button
8162
content: Flashing finished. Now press 'back' (arrow) and then 'Reboot system now' on the phone screen to finish the installation.

openandroidinstaller/installer_config.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,14 @@ def from_file(cls, path):
7373

7474
if raw_steps.get("unlock_bootloader") is not None:
7575
unlock_bootloader = [
76-
Step(**raw_step) for raw_step in raw_steps.get("unlock_bootloader")
76+
Step(**raw_step, title="Unlock the bootloader") for raw_step in raw_steps.get("unlock_bootloader")
7777
]
7878
else:
7979
unlock_bootloader = []
8080
flash_recovery = [
81-
Step(**raw_step) for raw_step in raw_steps.get("flash_recovery", [])
81+
Step(**raw_step, title="Flash custom recovery") for raw_step in raw_steps.get("flash_recovery", [])
8282
]
83-
install_os = [Step(**raw_step) for raw_step in raw_steps.get("install_os", [])]
83+
install_os = [Step(**raw_step, title="Install OS") for raw_step in raw_steps.get("install_os", [])]
8484
return cls(unlock_bootloader, flash_recovery, install_os, metadata)
8585

8686

@@ -115,7 +115,6 @@ def validate_config(config: str) -> bool:
115115
"""Validate the schema of the config."""
116116

117117
step_schema = {
118-
"title": str,
119118
"type": Regex(
120119
r"text|confirm_button|call_button|call_button_with_input|link_button_with_confirm"
121120
),

openandroidinstaller/openandroidinstaller.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
from installer_config import Step, _load_config
5353
from loguru import logger
5454
from tool_utils import (
55-
call_tool_with_command,
5655
search_device,
5756
adb_reboot,
5857
adb_reboot_bootloader,

0 commit comments

Comments
 (0)