Skip to content

Commit 51eef01

Browse files
committed
Add configs and config reader class
1 parent 2c7c646 commit 51eef01

File tree

4 files changed

+113
-1
lines changed

4 files changed

+113
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
steps:
2+
- title: "Unlock the bootloader"
3+
type: confirm_button
4+
content: "Turn on developer options and OEM Unlock on your phone."
5+
- title: "Boot into recovery"
6+
type: confirm_button
7+
content: "Turn on your device and wait until its fully booted."
8+
- title: "Boot into recovery"
9+
type: call_button
10+
content: "Reboot into bootloader"
11+
command: "adb reboot download"
12+
- title: "Boot into recovery"
13+
type: call_button
14+
content: "Flash custom recovery"
15+
command: "heimdall flash --no-reboot --RECOVERY recovery"
16+
- title: "Boot into recovery"
17+
type: confirm_button
18+
content: "Unplug the USB cable from your device. Manually reboot into recovery. Press 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."
19+
- title: "Flash LineageOS"
20+
type: confirm_button
21+
content: "Now tap 'Wipe'. Then tap 'Format Data' and continue with the formatting process. This will remove encryption and delete all files stored in the internal storage."
22+
- title: "Flash LineageOS"
23+
type: confirm_button
24+
content: "Return to the previous menu and tap 'Advanced Wipe', then select the 'Cache' and 'System' partitions and then 'Swipe to Wipe'."
25+
- title: "Flash LineageOS"
26+
type: confirm_button
27+
content: "On the device, go back and select “Advanced”, “ADB Sideload”, then swipe to begin sideload. Then confirm here"
28+
- title: "Flash LineageOS"
29+
type: call_button
30+
content: "Flash lineageOS image. Don't remove the USB-Cable!"
31+
command: "adb sideload image"
32+
- title: "Boot into recovery"
33+
type: call_button
34+
content: "Reboot into OS"
35+
command: "adb reboot"
36+
- title: "Successfully finished flashing"
37+
type: text
38+
content: "Have fun with LineageOS!"
+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
"""Class to load config files for the install procedure."""
2+
import yaml
3+
from typing import List
4+
5+
6+
class Step():
7+
8+
def __init__(self, title: str, type: str, content: str, command: str=None):
9+
self.title = title
10+
self.type = type
11+
self.content = content
12+
self.command = command
13+
14+
15+
class InstallerConfig():
16+
17+
def __init__(self, steps: List[Step]):
18+
self.steps = steps
19+
20+
@classmethod
21+
def from_file(cls, path):
22+
with open(path, "r") as stream:
23+
try:
24+
raw_steps = yaml.safe_load(stream)
25+
raw_steps = dict(raw_steps)["steps"]
26+
except yaml.YAMLError as exc:
27+
print(exc)
28+
29+
steps = [Step(**raw_step) for raw_step in raw_steps]
30+
return cls(raw_steps)

poetry.lock

+44-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ black = "^22.8.0"
1313
ruff = "^0.0.25"
1414
pyinstaller = "^5.3"
1515
Pillow = "^9.2.0"
16+
PyYAML = "^6.0"
1617

1718
[tool.poetry.dev-dependencies]
1819

0 commit comments

Comments
 (0)