Skip to content

Commit 1cdeafa

Browse files
committed
Add config for moto g5 (cedric)
1 parent 872a727 commit 1cdeafa

6 files changed

Lines changed: 61 additions & 7 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Sony | Xperia Z3 | [z3](https://wiki.lineageos.org/devices/z3/) | | tested
5353
Sony | Xperia ZX | kagura | | planned
5454
Fairphone | Fairphone 2 | [FP2](https://wiki.lineageos.org/devices/FP2/) | | tested
5555
Fairphone | Fairphone 3 | [FP3](https://wiki.lineageos.org/devices/FP3/) | | tested
56-
Motorola | moto G5 | cedric | | planned
56+
Motorola | moto G5 | [cedric](https://wiki.lineageos.org/devices/cedric/) | | tested
5757
Motorola | moto g7 power | [ocean](https://wiki.lineageos.org/devices/ocean/) | | tested
5858
OnePlus | 6 | enchilada | | under development
5959
OnePlus | 6T | fajita | | under development
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
metadata:
2+
maintainer: Tobias Sterbak (tsterbak)
3+
devicename: Moto G5
4+
devicecode: cedric
5+
steps:
6+
unlock_bootloader:
7+
- type: call_button
8+
command: adb_reboot_bootloader
9+
content: >
10+
As a first step, you need to unlock the bootloader of your device. A bootloader is the piece of software, that tells your phone
11+
how to start and run an operating system (like Android). You need to boot into fastboot mode by pressing the 'Confirm and run' button. Then continue.
12+
- type: call_button
13+
command: fastboot_get_unlock_data
14+
content: >
15+
Now you need to get your device ID to get an unlock code from Motorola. Press 'Confirm and run' to get the ID. (You need to toggle 'Advanced Output' here to see it.)
16+
Copy it to a separate file to use it in the next step.
17+
- type: link_button_with_confirm
18+
content: >
19+
Click on the button to open the instructions on Motorola's official unlocking website to generate an unlock code for your bootloader.
20+
Copy the code from the last step to the website and follow the instructions there. Then continue here.
21+
link: https://motorola-global-portal.custhelp.com/app/standalone/bootloader/unlock-your-device-a
22+
- type: confirm_button
23+
content: Connect the device to your PC via USB. And confirm to continue.
24+
- type: call_button_with_input
25+
content: >
26+
Use your code to unlock the bootloader of your device. Type in the full 21 character code you received by email (Example: 5RTSQCYL7ZJKL4NN35MY). Then confirm an run. Afterwards you can continue.
27+
command: fastboot_unlock_with_code
28+
- type: call_button_with_input
29+
content: >
30+
You need to perform the last command again, so reenter the code and run again. Afterwards you can continue.
31+
command: fastboot_unlock_with_code
32+
- type: call_button
33+
content: >
34+
Press the button to reboot. Since the device resets completely, you will need to re-enable USB debugging to continue.
35+
Connect your device to your PC via USB. Then confirm here to continue.
36+
command: fastboot_reboot
37+
flash_recovery:
38+
- type: call_button
39+
content: >
40+
Now you need to flash a custom recovery system on the phone. A recovery is a small subsystem on your phone, that manages updating,
41+
adapting and repairing of the operating system.
42+
Make sure your device is turned on. You need to reboot into the bootloader again by pressing 'Confirm and run' here. Then continue.
43+
command: adb_reboot_bootloader
44+
- type: call_button
45+
content: Flash a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
46+
command: fastboot_flash_recovery
47+
install_os:
48+
- type: call_button
49+
content: >
50+
In this last step, you finally flash the selected OS image.
51+
Wait until the TWRP screen appears. Then run the command.
52+
This step will format your phone and wipe all the data. It will also remove encryption and delete all files stored
53+
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.
54+
command: adb_twrp_wipe_and_install

openandroidinstaller/installer_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def validate_config(config: str) -> bool:
136136
),
137137
"content": str,
138138
schema.Optional("command"): Regex(
139-
r"adb_reboot|adb_reboot_bootloader|adb_reboot_download|adb_sideload|adb_twrp_wipe_and_install|adb_twrp_copy_partitions|fastboot_flash_recovery|fastboot_unlock_with_code|fastboot_get_unlock_data|fastboot_unlock|fastboot_oem_unlock|fastboot_reboot|heimdall_flash_recovery"
139+
r"adb_reboot|adb_reboot_bootloader|adb_reboot_download|adb_sideload|adb_twrp_wipe_and_install|adb_twrp_copy_partitions|fastboot_flash_recovery|fastboot_unlock_with_code|fastboot_get_unlock_data|fastboot_unlock|fastboot_oem_unlock|fastboot_reboot|heimdall_flash_recovery"
140140
),
141141
schema.Optional("allow_skip"): bool,
142142
schema.Optional("img"): str,

openandroidinstaller/openandroidinstaller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
logger.add("openandroidinstaller.log")
4747

4848
# Toggle to True for development purposes
49-
DEVELOPMENT = False
49+
DEVELOPMENT = False
5050
DEVELOPMENT_CONFIG = "sargo" # "a3y17lte" # "sargo"
5151

5252

openandroidinstaller/tooling.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,7 @@ def adb_twrp_copy_partitions(bin_path: Path, config_path: Path):
139139
return True
140140

141141

142-
def adb_twrp_wipe_and_install(
143-
bin_path: Path, target: str, config_path: Path
144-
) -> bool:
142+
def adb_twrp_wipe_and_install(bin_path: Path, target: str, config_path: Path) -> bool:
145143
"""Wipe and format data with twrp, then flash os image with adb.
146144
147145
Only works for twrp recovery.

openandroidinstaller/views/step_view.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,9 @@ def call_to_phone(self, e, command: str):
202202
target=self.state.image_path,
203203
config_path=self.state.config_path,
204204
),
205-
"adb_twrp_copy_partitions": partial(adb_twrp_copy_partitions, config_path=self.state.config_path),
205+
"adb_twrp_copy_partitions": partial(
206+
adb_twrp_copy_partitions, config_path=self.state.config_path
207+
),
206208
"fastboot_unlock": fastboot_unlock,
207209
"fastboot_unlock_with_code": partial(
208210
fastboot_unlock_with_code, unlock_code=self.inputtext.value

0 commit comments

Comments
 (0)