Skip to content

Commit 6bae742

Browse files
authored
Dev (#26)
2 parents e50b2a9 + 656fcda commit 6bae742

File tree

4 files changed

+63
-17
lines changed

4 files changed

+63
-17
lines changed

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Sony | Xperia Z | yuga | C6603 | tested
4040
Sony | Xperia Z3 | z3 | | under development
4141
Sony | Xperia ZX | kagura | | planned
4242
Fairphone | Fairphone 2 | FP2 | | under development
43-
Fairphone | Fairphone 3 | FP3 | | planned
43+
Fairphone | Fairphone 3 | FP3 | | under development
4444
Motorola | Moto G5 | cedric | | planned
4545
Motorola | moto g7 power | ocean | | under development
4646

@@ -75,7 +75,11 @@ All kinds of contributions are welcome. These include:
7575

7676
### How to contribute your own installation configurations
7777

78-
If you want to use the tool for a non-supported smartphone, the fastest way is to adapt an [existing config file](https://github.com/openandroidinstaller-dev/openandroidinstaller/tree/main/openandroidinstaller/assets/configs).
78+
If you want to use the tool for a non-supported smartphone, the fastest way is to adapt an [existing config file](https://github.com/openandroidinstaller-dev/openandroidinstaller/tree/main/openandroidinstaller/assets/configs). The file should be named after the `device code` of your device. This is in general the output by `adb shell getprop | grep ro.product.device` when the devices is connected to the computer. You can also get the device code by connecting the device to the computer and run OpenAndroidInstaller to detect the device.
79+
80+
**To test your config file with the executable** without using the developer setup, place it in the same directory as the executable. There it will be detected by name. After you created a config file and it works fine, you can open a pull request to make the file available to other users. Please also add the device to the supported devices table above.
81+
82+
#### Content of a config file
7983

8084
Every step in the config file corresponds to one view in the application. These steps should contain the following fields:
8185
- `title`: str; Describing the overall goal of the step. Will be displayed in the header of the view.
@@ -94,11 +98,6 @@ Every step in the config file corresponds to one view in the application. These
9498
- `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.
9599
- `link`: [OPTIONAL] Link to use for the link button if type is `link_button_with_confirm`.
96100

97-
The file should be named after device name output by `adb shell getprop | grep ro.product.device` when the devices is connected to the computer. You can also get the device code by connecting the device to the computer and run OpenAndroidInstaller to detect the device.
98-
99-
To test your config file with the executable without using the developer setup, place it in the same directory as the executable. There it will be detected by name.
100-
After you created a config file and it works fine, you can open a pull request to make the file available to other users. Please also add the device to the supported devices table above.
101-
102101
### How to build the application for your platform
103102

104103
The executables for the OpenAndroidInstaller are build with [pyinstaller](https://pyinstaller.org/en/stable/index.html). You can create builds for MacOS or Linux with `make build-app`. For Windows the paths need to be modified. For now, you can have a look [here](https://github.com/openandroidinstaller-dev/openandroidinstaller/blob/v0.1.2-alpha/.github/workflows/manual-build-windows.yml#L22) on how it's done.

openandroidinstaller/assets/configs/FP2.yaml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,11 @@ steps:
1919
content: Flash a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
2020
command: "fastboot flash recovery <recovery>"
2121
- title: "Flash temporary recovery"
22-
type: call_button
23-
content: Press the button to reboot. Then confirm here to continue.
24-
command: "fastboot reboot"
25-
install_os:
26-
- title: "Flash LineageOS"
2722
type: confirm_button
28-
content: In this step, you finally flash LineageOS. Confirm to continue.
29-
- title: "Flash LineageOS"
30-
type: confirm_button
31-
content: Select 'Recovery Mode' on your smartphone screen and press the Start-Button to confirm. Then confirm here.
23+
content: >
24+
Now reboot into recovery to verify the installation. Do not reboot into the existing OS, since it will overwrite the recovery you just installed!
25+
With the device powered off, hold 'Volume Up + Power'. Release when boot logo appears.
26+
install_os:
3227
- title: "Flash LineageOS"
3328
type: confirm_button
3429
content: >
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
metadata:
2+
maintainer: Tobias Sterbak (tsterbak)
3+
devicename: Fairphone 3
4+
devicecode: FP3
5+
steps:
6+
unlock_bootloader:
7+
- title: "Unlock the bootloader"
8+
type: link_button_with_confirm
9+
content: >
10+
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+
link: https://www.fairphone.com/en/bootloader-unlocking-code-for-fairphone-3/
13+
flash_recovery:
14+
- title: "Flash a custom recovery"
15+
type: confirm_button
16+
content: >
17+
Now you need to flash a custom recovery system on the phone. A recovery is a small subsystem on your phone, that manages updating,
18+
adapting and repairing of the operating system.
19+
- title: "Flash a custom recovery"
20+
type: call_button
21+
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
25+
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
29+
content: >
30+
Now reboot into recovery to verify the installation. Do not reboot into the existing OS, since it will overwrite the recovery you just installed!
31+
With the device powered off, hold 'Volume Up + Power'. Release when boot logo appears.
32+
install_os:
33+
- title: "Flash LineageOS"
34+
type: confirm_button
35+
content: >
36+
Now tap 'Factory Reset', then 'Format data / Factory reset' on your phone screen and continue with the formatting process.
37+
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
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: "Flash LineageOS"
51+
type: confirm_button
52+
content: Flashing finished. Now press 'back' (arrow) and then 'Reboot system now' on the phone screen to finish the installation. Then confirm here.

openandroidinstaller/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
def get_download_link(devicecode: str) -> Optional[str]:
2424
"""Check if a lineageOS version for this device exists on lineageosroms.com and return the respective download link."""
25-
url = f"https://lineageosroms.com/{devicecode}/"
25+
url = f"https://lineageosroms.com/{devicecode.lower()}/"
2626
try:
2727
logger.info(f"Checking {url}")
2828
# Get Url

0 commit comments

Comments
 (0)