Skip to content

Commit 3790585

Browse files
authored
Release Alpha v.0.3.0 (#37)
This PR adds: Fixes: - Fairphone3 now uses flashing unlock to unlock the bootloader - fix bootloader unlock issue with fastboot Features: - Disable callbutton while command is running; clean error text at retry - another steptype for requirements and get them from config. - restructure welcome page to make it better - a bit more default pictures for steps - let advanced view toggle in every step independently - Enable copy_partitions sideloading Chores: - Major refactoring of views - test search device function in tooling - refactor call_to_phone method - refactored terminal box - test for TerminalBox 11 New devices: - Motorola moto g7 power (ocean) - Motorola moto g5 (cedric) - Samsung Galaxy Note 9 (crownlte) - Samsung Galaxy Note 10 (d1) - oneplus 6 - oneplus 6T - oneplus 7 - oneplus 7 Pro - oneplus 7T - oneplus 7T Pro - OnePlus Nord N200
2 parents 1202bb1 + 7d6e722 commit 3790585

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+2081
-757
lines changed

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,13 @@ install:
88
export:
99
poetry export -f requirements.txt --output requirements.txt
1010

11+
lint:
12+
poetry run ruff openandroidinstaller/ --ignore E501
13+
1114
test:
12-
poetry run pytest tests/
15+
poetry run black .
16+
poetry run ruff openandroidinstaller/ --ignore E501
17+
PYTHONPATH=openandroidinstaller:$(PYTHONPATH) poetry run pytest --cov=openandroidinstaller tests/
1318

1419
app:
1520
poetry run python openandroidinstaller/openandroidinstaller.py

README.md

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -38,26 +38,32 @@ Vendor | Device Name | CodeName | Models | Status
3838
---|---|---|---|---
3939
Samsung | Galaxy J7 2015 | j7elte | | tested
4040
Samsung | Galaxy A3 2017 | a3y17lte | SM-A320FL | tested
41-
Samsung | Galaxy A5 2016 | a5xelte | SM-A510F | tested
41+
Samsung | Galaxy A5 2016 | [a5xelte](https://wiki.lineageos.org/devices/a5xelte/) | SM-A510F | tested
4242
Samsung | Galaxy A7 2016 | a7xelte | | tested
43-
Samsung | Galaxy S7 | herolte | SM-G930F | tested
44-
Samsung | Galaxy S9 | starlte | | tested
45-
Samsung | Galaxy S10 | beyond1lte | | tested
46-
Google | Pixel 3a | sargo | sargo | tested
47-
Google | Pixel 4 | flame | flame | tested
48-
Google | Pixel 4a | sunfish | sunfish | tested
49-
Google | Pixel 5 | redfin | redfin | tested
50-
Google | Pixel 5a | barbet | barbet | tested
51-
Sony | Xperia Z | yuga | C6603 | tested
52-
Sony | Xperia Z3 | z3 | | tested
43+
Samsung | Galaxy S7 | [herolte](https://wiki.lineageos.org/devices/herolte/) | SM-G930F | tested
44+
Samsung | Galaxy S9 | [starlte](https://wiki.lineageos.org/devices/starlte/) | | tested
45+
Samsung | Galaxy Note 9 | [crownlte](https://wiki.lineageos.org/devices/crownlte/) | | tested
46+
Samsung | Galaxy S10 | [beyond1lte](https://wiki.lineageos.org/devices/beyond1lte/) | | tested
47+
Samsung | Galaxy Note 10 | [d1](https://wiki.lineageos.org/devices/d1/) | | tested
48+
Google | Pixel 3a | [sargo](https://wiki.lineageos.org/devices/sargo/) | sargo | tested
49+
Google | Pixel 4 | [flame](https://wiki.lineageos.org/devices/flame/) | flame | tested
50+
Google | Pixel 4a | [sunfish](https://wiki.lineageos.org/devices/sunfish/) | sunfish | tested
51+
Google | Pixel 5 | [redfin](https://wiki.lineageos.org/devices/redfin/) | redfin | tested
52+
Google | Pixel 5a | [barbet](https://wiki.lineageos.org/devices/barbet/) | barbet | tested
53+
Sony | Xperia Z | [yuga](https://wiki.lineageos.org/devices/yuga/) | C6603 | tested
54+
Sony | Xperia Z3 | [z3](https://wiki.lineageos.org/devices/z3/) | | tested
5355
Sony | Xperia ZX | kagura | | planned
54-
Fairphone | Fairphone 2 | FP2 | | tested
55-
Fairphone | Fairphone 3 | FP3 | | tested
56-
Motorola | moto G5 | cedric | | planned
57-
Motorola | moto g7 power | ocean | | under development
58-
OnePlus | 6 | enchilada | | under development
59-
OnePlus | 6T | fajita | | under development
60-
OnePlus | 7T | hotdogb | | under development
56+
Fairphone | Fairphone 2 | [FP2](https://wiki.lineageos.org/devices/FP2/) | | tested
57+
Fairphone | Fairphone 3 | [FP3](https://wiki.lineageos.org/devices/FP3/) | | tested
58+
Motorola | moto G5 | [cedric](https://wiki.lineageos.org/devices/cedric/) | | tested
59+
Motorola | moto g7 power | [ocean](https://wiki.lineageos.org/devices/ocean/) | | tested
60+
OnePlus | 6 | [enchilada](https://wiki.lineageos.org/devices/enchilada/) | | tested
61+
OnePlus | 6T | [fajita](https://wiki.lineageos.org/devices/fajita/) | | tested
62+
OnePlus | 7 | [guacamoleb](https://wiki.lineageos.org/devices/guacamoleb/) | | tested
63+
OnePlus | 7 Pro | [guacamole](https://wiki.lineageos.org/devices/guacamole/) | | tested
64+
OnePlus | 7T | [hotdogb](https://wiki.lineageos.org/devices/hotdogb/) | | tested
65+
OnePlus | 7T Pro | [hotdog](https://wiki.lineageos.org/devices/hotdog/) | | tested
66+
OnePlus | Nord N200 | [dre](https://wiki.lineageos.org/devices/dre/) | | tested
6167
OnePlus | 9 | lemonade | | under development
6268

6369

@@ -105,11 +111,13 @@ Every step in the config file corresponds to one view in the application. These
105111
- `call_button_with_input`: Display the content text, an input field and a button that runs a given command. The inputtext, can be used in the command by using the `<inputtext>` placeholder in the command field. After the command is run, a confirm button is displayed to allow the user to move to the next step.
106112
- `link_button_with_confirm`: Display a button that opens a browser with a given link, confirm afterwards. Link is given in `link`.
107113
- `content`: str; The content text displayed alongside the action of the step. Used to inform the user about whats going on.
108-
- `command`: [ONLY for call_button* steps] str; The command to run. One of `adb_reboot`, `adb_reboot_bootloader`, `adb_reboot_download`, `adb_sideload`, `adb_twrp_wipe_and_install`, `fastboot_flash_recovery`, `fastboot_unlock_with_code`, `fastboot_unlock`, `fastboot_oem_unlock`, `fastboot_reboot`, `heimdall_flash_recovery`.
114+
- `command`: [ONLY for call_button* steps] str; The command to run. One of `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_unlock`, `fastboot_oem_unlock`, `fastboot_get_unlock_data`, `fastboot_reboot`, `heimdall_flash_recovery`.
109115
- `img`: [OPTIONAL] Display an image on the left pane of the step view. Images are loaded from `openandroidinstaller/assets/imgs/`.
110116
- `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.
111117
- `link`: [OPTIONAL] Link to use for the link button if type is `link_button_with_confirm`.
112118

119+
You can also use the `requirements` field in the yaml, to specify `firmware` or `android` version requirements. The user will then be prompted if these requirements are satisfied.
120+
113121
### How to build the application for your platform
114122

115123
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.
@@ -128,6 +136,7 @@ Other phone vendors stops allowing to unlock the bootloader all together. There
128136
- The [Android SDK Platform Tools](https://developer.android.com/studio/releases/platform-tools) (such as adb and fastboot) are [Apache](https://android.googlesource.com/platform/system/adb/+/refs/heads/master/NOTICE)-licensed universal Android utilities
129137
- [Heimdall](https://gitlab.com/BenjaminDobell/Heimdall/) is an [MIT](https://gitlab.com/BenjaminDobell/Heimdall/-/blob/master/LICENSE)-licensed replacement for the leaked ODIN tool to flash Samsung devices.
130138
- [libusb-1.0](https://github.com/libusb/libusb) is a [LGPL-2.1](https://github.com/libusb/libusb/blob/master/COPYING)-licensed library for USB device access from Linux, macOS, Windows and others.
139+
- [copy-partitions-20220613-signed.zip](https://mirrorbits.lineageos.org/tools/copy-partitions-20220613-signed.zip) The copy-partitions script was created by LineageOS developer erfanoabdi and filipepferraz and released under LGPL. It is used when the partitions need to be copied before flashing.
131140

132141

133142
## Acknowledgements

openandroidinstaller/__init__.py

Whitespace-only changes.

openandroidinstaller/app_state.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
from flet import ProgressBar
1919
from installer_config import _load_config
20-
from loguru import logger
2120

2221

2322
class AppState:
@@ -67,6 +66,6 @@ def load_config(self, device_code: str):
6766
def increment_progressbar(self):
6867
"""Increment the progressbar and step counter."""
6968
self.progressbar.value = (self.num_steps - 1) / (
70-
self.num_total_steps + 2
69+
self.num_total_steps + 3
7170
) # don't show on the first step
7271
self.num_steps += 1 # increase the step counter

openandroidinstaller/assets/configs/FP3.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ steps:
2020
Then press 'Confirm and continue' here.
2121
- type: call_button
2222
content: In this step you actually unlock the bootloader. Just press 'Confirm and run' here. Once it's done, press continue here.
23-
command: fastboot_oem_unlock
23+
command: fastboot_unlock
2424
- type: confirm_button
2525
content: >
2626
Follow the instructions on the Fairphone screen. This command will wipe all the personal data on your phone.

openandroidinstaller/assets/configs/barbet.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ metadata:
22
maintainer: Tobias Sterbak (tsterbak)
33
devicename: Pixel 5a
44
devicecode: barbet
5+
requirements:
6+
android: 12.1.0
57
steps:
68
unlock_bootloader:
79
- type: confirm_button

openandroidinstaller/assets/configs/beyond1lte.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ metadata:
22
maintainer: Tobias Sterbak (tsterbak)
33
devicename: Samsung Galaxy S10
44
devicecode: beyond1lte
5+
requirements:
6+
android: 12
57
steps:
68
unlock_bootloader:
79
flash_recovery:
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: Motorola 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
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
metadata:
2+
maintainer: Tobias Sterbak (tsterbak)
3+
devicename: Samsung Galaxy Note 9
4+
devicecode: crownlte
5+
requirements:
6+
android: 10
7+
steps:
8+
unlock_bootloader:
9+
flash_recovery:
10+
- type: call_button
11+
content: >
12+
As a first step, you need to boot into the bootloader. A bootloader is the piece of software,
13+
that tells your phone who to start and run an operating system (like Android). Your device should be turned on.
14+
Then press 'Confirm and run' to reboot into the bootloader. Continue once it's done.
15+
command: adb_reboot_download
16+
- type: call_button
17+
content: In this step, you need to flash a custom recovery on your device. Press 'Confirm and run' to start the process. Confirm afterwards to continue.
18+
command: heimdall_flash_recovery
19+
- type: confirm_button
20+
img: samsung-buttons.png
21+
content: >
22+
Unplug the USB cable from your device. Then manually reboot into recovery by pressing the *Volume Down* + *Bixby* for 8~10 seconds
23+
until the screen turns black & release the buttons immediately when it does, then boot to recovery with the device powered off,
24+
hold *Volume Up* + *Bixby* + *Power button*.
25+
install_os:
26+
- type: call_button
27+
content: >
28+
In the next steps, you finally flash the selected OS image.
29+
Connect your device with your computer with the USB-Cable.
30+
This step will format your phone and wipe all the data. It will also remove encryption and delete all files stored
31+
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.
32+
command: adb_twrp_wipe_and_install
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
metadata:
2+
maintainer: Tobias Sterbak (tsterbak)
3+
devicename: Samsung Galaxy Note 10
4+
devicecode: d1
5+
requirements:
6+
android: 12
7+
steps:
8+
unlock_bootloader:
9+
flash_recovery:
10+
- type: call_button
11+
content: >
12+
As a first step, you need to boot into the bootloader. A bootloader is the piece of software,
13+
that tells your phone who to start and run an operating system (like Android). Your device should be turned on.
14+
Then press 'Confirm and run' to reboot into the bootloader. Continue once it's done.
15+
command: adb_reboot_download
16+
- type: call_button
17+
content: In this step, you need to flash a custom recovery on your device. Press 'Confirm and run' to start the process. Confirm afterwards to continue.
18+
command: heimdall_flash_recovery
19+
- type: confirm_button
20+
img: samsung-buttons.png
21+
content: >
22+
Unplug the USB cable from your device. Then manually reboot into recovery by pressing the *Volume Down* + *Bixby* for 8~10 seconds
23+
until the screen turns black & release the buttons immediately when it does, then boot to recovery with the device powered off,
24+
hold *Volume Up* + *Bixby* + *Power button*.
25+
install_os:
26+
- type: call_button
27+
content: >
28+
In the next steps, you finally flash the selected OS image.
29+
Connect your device with your computer with the USB-Cable.
30+
This step will format your phone and wipe all the data. It will also remove encryption and delete all files stored
31+
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.
32+
command: adb_twrp_wipe_and_install

0 commit comments

Comments
 (0)