Skip to content

Commit

Permalink
Dev (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsterbak authored Oct 27, 2022
2 parents e50b2a9 + 656fcda commit 6bae742
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 17 deletions.
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Sony | Xperia Z | yuga | C6603 | tested
Sony | Xperia Z3 | z3 | | under development
Sony | Xperia ZX | kagura | | planned
Fairphone | Fairphone 2 | FP2 | | under development
Fairphone | Fairphone 3 | FP3 | | planned
Fairphone | Fairphone 3 | FP3 | | under development
Motorola | Moto G5 | cedric | | planned
Motorola | moto g7 power | ocean | | under development

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

### How to contribute your own installation configurations

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).
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.

**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.

#### Content of a config file

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

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.

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.

### How to build the application for your platform

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.
Expand Down
13 changes: 4 additions & 9 deletions openandroidinstaller/assets/configs/FP2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,11 @@ steps:
content: Flash a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
command: "fastboot flash recovery <recovery>"
- title: "Flash temporary recovery"
type: call_button
content: Press the button to reboot. Then confirm here to continue.
command: "fastboot reboot"
install_os:
- title: "Flash LineageOS"
type: confirm_button
content: In this step, you finally flash LineageOS. Confirm to continue.
- title: "Flash LineageOS"
type: confirm_button
content: Select 'Recovery Mode' on your smartphone screen and press the Start-Button to confirm. Then confirm here.
content: >
Now reboot into recovery to verify the installation. Do not reboot into the existing OS, since it will overwrite the recovery you just installed!
With the device powered off, hold 'Volume Up + Power'. Release when boot logo appears.
install_os:
- title: "Flash LineageOS"
type: confirm_button
content: >
Expand Down
52 changes: 52 additions & 0 deletions openandroidinstaller/assets/configs/FP3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
metadata:
maintainer: Tobias Sterbak (tsterbak)
devicename: Fairphone 3
devicecode: FP3
steps:
unlock_bootloader:
- title: "Unlock the bootloader"
type: link_button_with_confirm
content: >
Click on the button to open the instructions on the Fairphone Support official unlocking website to generate an unlock code for your device.
Once you done that, continue.
link: https://www.fairphone.com/en/bootloader-unlocking-code-for-fairphone-3/
flash_recovery:
- title: "Flash a custom recovery"
type: confirm_button
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.
- title: "Flash a custom recovery"
type: call_button
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.
command: "adb reboot bootloader"
- title: "Flash a custom recovery"
type: call_button
content: Once the device is in fastboot mode, flash the custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
command: "fastboot flash boot <recovery>"
- title: "Flash temporary recovery"
type: confirm_button
content: >
Now reboot into recovery to verify the installation. Do not reboot into the existing OS, since it will overwrite the recovery you just installed!
With the device powered off, hold 'Volume Up + Power'. Release when boot logo appears.
install_os:
- title: "Flash LineageOS"
type: confirm_button
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).
- title: "Flash LineageOS"
type: confirm_button
content: Return to the main menu on the phone.
- title: "Flash LineageOS"
type: confirm_button
content: On the device, select “Apply Update”, then “Apply from ADB” to begin sideload. Then confirm here.
- title: "Flash LineageOS"
type: call_button
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.
command: "adb sideload <image>"
- title: "Flash LineageOS"
type: confirm_button
content: Flashing finished. Now press 'back' (arrow) and then 'Reboot system now' on the phone screen to finish the installation. Then confirm here.
2 changes: 1 addition & 1 deletion openandroidinstaller/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

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

0 comments on commit 6bae742

Please sign in to comment.