Skip to content

Commit e8ec5d0

Browse files
committed
Structure the steps of configs, allow skipping unlocking the bootloader, add download button for officially supported LOS images
1 parent 7194358 commit e8ec5d0

9 files changed

Lines changed: 235 additions & 110 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ If you wish to backup the TA partition first, you can find tutorials related to
3131
Vendor | Device Name | CodeName | Models | Status
3232
---|---|---|---|---
3333
Samsung | Galaxy A3 2017 | a3y17lte | SM-A320FL | tested
34-
Samsung | Galaxy A5 2016 | a5xelte | | tested
34+
Samsung | Galaxy A5 2016 | a5xelte | SM-A510F | tested
3535
Samsung | Galaxy S7 | herolte | | planned
3636
Google | Pixel 3a | sargo | sargo | tested
3737
Sony | Xperia Z | yuga | C6603 | tested

openandroidinstaller/assets/configs/FP2.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
metadata:
22
maintainer: Tobias Sterbak (tsterbak)
33
devicename: Fairphone 2
4+
devicecode: FP2
45
requirements:
56
steps:
67
- title: "Flash a custom recovery"

openandroidinstaller/assets/configs/a3y17lte.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
metadata:
22
maintainer: Tobias Sterbak (tsterbak)
33
devicename: Samsung Galaxy A3 (2017)
4+
devicecode: a3y17lte
45
requirements:
56
- heimdall
67
steps:

openandroidinstaller/assets/configs/a5xelte.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
metadata:
22
maintainer: Tobias Sterbak (tsterbak)
33
devicename: Samsung Galaxy A5 (2016)
4+
devicecode: a5xelte
45
requirements:
56
- heimdall
67
steps:
Lines changed: 77 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,82 @@
11
metadata:
22
maintainer: Tobias Sterbak (tsterbak)
33
devicename: Pixel 3a
4+
devicecode: sargo
45
requirements:
56
steps:
6-
- title: "Unlock the bootloader"
7-
type: confirm_button
8-
content: "As a first step, you need to unlock 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."
9-
- title: "Unlock the bootloader"
10-
type: call_button
11-
content: "Press 'Confirm and run' to reboot into the bootloader."
12-
command: "adb reboot bootloader"
13-
- title: "Unlock the bootloader"
14-
type: confirm_button
15-
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."
16-
- title: "Unlock the bootloader"
17-
type: call_button
18-
content: "In this step you actually unlock the bootloader. Just press 'Confirm and run' here. Once it's done, press continue here."
19-
command: "fastboot flashing unlock"
20-
allow_skip: True
21-
- title: "Unlock the bootloader"
22-
type: confirm_button
23-
content: "At this point the device may display on-screen prompts which will require interaction to continue the process of unlocking the bootloader. Please take whatever actions the device asks you to to proceed."
24-
- title: "Unlock the bootloader"
25-
type: call_button
26-
content: "To finish the unlocking, the phone needs to reboot. Just press 'Confirm and run' here to reboot. Then continue."
27-
command: "fastboot reboot"
28-
- title: "Unlock the bootloader"
29-
type: confirm_button
30-
content: "The bootloader is now unlocked. Since the device resets completely, you will need to re-enable USB debugging to continue."
31-
- title: "Flash a custom recovery"
32-
type: confirm_button
33-
content: "Now you need to flash 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."
34-
- title: "Flash a custom recovery"
35-
type: call_button
36-
content: "Once the device is fully booted, you need to reboot into the bootloader again by pressing 'Confirm and run' here. Then continue."
37-
command: "adb reboot bootloader"
38-
- title: "Flash a custom recovery"
39-
type: confirm_button
40-
content: "Select 'Restart bootloader' on your smartphone screen. Then confirm to continue."
41-
- title: "Flash a custom recovery"
42-
type: call_button
43-
content: "Flash a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue."
44-
command: "fastboot flash boot <recovery>"
45-
- title: "Flash LineageOS"
46-
type: confirm_button
47-
content: "In this step, you finally flash LineageOS. Confirm to continue."
48-
- title: "Flash LineageOS"
49-
type: confirm_button
50-
content: "Select 'Recovery Mode' on your smartphone screen and press the Start-Button to confirm. Then confirm here."
51-
- title: "Flash LineageOS"
52-
type: confirm_button
53-
content: "Now tap Factory Reset, then Format data / Factory reset on your phone screen and continue with the formatting process. This will remove encryption and delete all files stored in the internal storage, as well as format your cache partition (if you have one)."
54-
- title: "Flash LineageOS"
55-
type: confirm_button
56-
content: "Return to the main menu on the phone."
57-
- title: "Flash LineageOS"
58-
type: confirm_button
59-
content: "On the device, select “Apply Update”, then “Apply from ADB” to begin sideload. Then confirm here."
60-
- title: "Flash LineageOS"
61-
type: call_button
62-
content: "Now it's time to flash the LineageOS image. Don't remove the USB-Cable and press 'Confirm and run' to start! This might take a while. Confirm after it's done."
63-
command: "adb sideload <image>"
64-
- title: "Flash LineageOS"
65-
type: confirm_button
66-
content: "Flashing finished. Now press 'back' (arrow) and then 'Reboot system now' on the phone screen to finish the installation."
7+
unlock_bootloader:
8+
- title: "Unlock the bootloader"
9+
type: confirm_button
10+
content: >
11+
As a first step, you need to unlock the bootloader. A bootloader is the piece of software, that tells your phone
12+
how to start and run an operating system (like Android). Your device should be turned on.
13+
- title: "Unlock the bootloader"
14+
type: call_button
15+
content: "Press 'Confirm and run' to reboot into the bootloader."
16+
command: "adb reboot bootloader"
17+
- title: "Unlock the bootloader"
18+
type: confirm_button
19+
content: >
20+
Select 'Restart bootloader' on your smartphone screen by pressing the volume button and the confirm by pushing the power button.
21+
Then press 'Confirm and continue' here.
22+
- title: "Unlock the bootloader"
23+
type: call_button
24+
content: "In this step you actually unlock the bootloader. Just press 'Confirm and run' here. Once it's done, press continue here."
25+
command: "fastboot flashing unlock"
26+
allow_skip: True
27+
- title: "Unlock the bootloader"
28+
type: confirm_button
29+
content: >
30+
At this point the device may display on-screen prompts which will require interaction to continue the process of unlocking the bootloader.
31+
Please take whatever actions the device asks you to to proceed.
32+
- title: "Unlock the bootloader"
33+
type: call_button
34+
content: "To finish the unlocking, the phone needs to reboot. Just press 'Confirm and run' here to reboot. Then continue."
35+
command: "fastboot reboot"
36+
- title: "Unlock the bootloader"
37+
type: confirm_button
38+
content: "The bootloader is now unlocked. Since the device resets completely, you will need to re-enable USB debugging to continue."
39+
flash_recovery:
40+
- title: "Flash a custom recovery"
41+
type: confirm_button
42+
content: >
43+
Now you need to flash a custom recovery system on the phone. A recovery is a small subsystem on your phone, that manages updating,
44+
adapting and repairing of the operating system.
45+
- title: "Flash a custom recovery"
46+
type: call_button
47+
content: "Once the device is fully booted, you need to reboot into the bootloader again by pressing 'Confirm and run' here. Then continue."
48+
command: "adb reboot bootloader"
49+
- title: "Flash a custom recovery"
50+
type: confirm_button
51+
content: "Select 'Restart bootloader' on your smartphone screen. Then confirm to continue."
52+
- title: "Flash a custom recovery"
53+
type: call_button
54+
content: "Flash a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue."
55+
command: "fastboot flash boot <recovery>"
56+
install_os:
57+
- title: "Flash LineageOS"
58+
type: confirm_button
59+
content: "In this step, you finally flash LineageOS. Confirm to continue."
60+
- title: "Flash LineageOS"
61+
type: confirm_button
62+
content: "Select 'Recovery Mode' on your smartphone screen and press the Start-Button to confirm. Then confirm here."
63+
- title: "Flash LineageOS"
64+
type: confirm_button
65+
content: >
66+
Now tap Factory Reset, then Format data / Factory reset on your phone screen and continue with the formatting process.
67+
This will remove encryption and delete all files stored in the internal storage, as well as format your cache partition (if you have one).
68+
- title: "Flash LineageOS"
69+
type: confirm_button
70+
content: "Return to the main menu on the phone."
71+
- title: "Flash LineageOS"
72+
type: confirm_button
73+
content: "On the device, select “Apply Update”, then “Apply from ADB” to begin sideload. Then confirm here."
74+
- title: "Flash LineageOS"
75+
type: call_button
76+
content: >
77+
Now it's time to flash the LineageOS image. Don't remove the USB-Cable and press 'Confirm and run' to start!
78+
This might take a while. Confirm after it's done.
79+
command: "adb sideload <image>"
80+
- title: "Flash LineageOS"
81+
type: confirm_button
82+
content: "Flashing finished. Now press 'back' (arrow) and then 'Reboot system now' on the phone screen to finish the installation."

openandroidinstaller/assets/configs/yuga.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
metadata:
22
maintainer: Tobias Sterbak (tsterbak)
33
devicename: Sony Xperia Z
4+
devicecode: yuga
45
requirements:
56
steps:
67
- title: "Unlock the bootloader"

openandroidinstaller/installer_config.py

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
# If not, see <https://www.gnu.org/licenses/>."""
1414
# Author: Tobias Sterbak
1515

16-
from typing import List, Optional
1716
from pathlib import Path
18-
from loguru import logger
17+
from typing import List, Optional
1918

2019
import yaml
20+
from loguru import logger
2121

2222

2323
class Step:
@@ -39,8 +39,16 @@ def __init__(
3939

4040

4141
class InstallerConfig:
42-
def __init__(self, steps: List[Step], metadata: dict):
43-
self.steps = steps
42+
def __init__(
43+
self,
44+
unlock_bootloader: List[Step],
45+
flash_recovery: List[Step],
46+
install_os: List[Step],
47+
metadata: dict,
48+
):
49+
self.unlock_bootloader = unlock_bootloader
50+
self.flash_recovery = flash_recovery
51+
self.install_os = install_os
4452
self.metadata = metadata
4553

4654
@classmethod
@@ -54,14 +62,18 @@ def from_file(cls, path):
5462
except yaml.YAMLError as exc:
5563
logger.info(exc)
5664

57-
steps = [Step(**raw_step) for raw_step in raw_steps]
58-
return cls(steps, metadata)
65+
unlock_bootloader = [
66+
Step(**raw_step) for raw_step in raw_steps["unlock_bootloader"]
67+
]
68+
flash_recovery = [Step(**raw_step) for raw_step in raw_steps["flash_recovery"]]
69+
install_os = [Step(**raw_step) for raw_step in raw_steps["install_os"]]
70+
return cls(unlock_bootloader, flash_recovery, install_os, metadata)
5971

6072

6173
def _load_config(device_code: str, config_path: Path) -> Optional[InstallerConfig]:
6274
"""
6375
Function to load a function from given path and directory path.
64-
76+
6577
Try to load local file in the same directory as the executable first, then load from assets.
6678
"""
6779
# try loading a custom local file first

0 commit comments

Comments
 (0)