Skip to content

Commit 598671f

Browse files
authored
Release/0.4.0 beta (#74)
This Release adds: - install view and allow to circle back to flash a recovery - enable selecting addons - enable installing addons - download buttons for Google apps, f-droid and microg Improvements: - typehints - better views handling Fixes: - remove error messages after retry
2 parents cfef18f + 78c2ad3 commit 598671f

Some content is hidden

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

79 files changed

+1422
-865
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ format:
1414
lint:
1515
poetry run ruff openandroidinstaller/ --ignore E501
1616

17+
typing:
18+
poetry run mypy openandroidinstaller/. --ignore-missing-imports
19+
1720
test: format lint
1821
PYTHONPATH=openandroidinstaller:$(PYTHONPATH) poetry run pytest --cov=openandroidinstaller tests/
1922

README.md

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
</p>
2727
</div>
2828

29-
> **Warning**: This application is currently in alpha state, so use at your own risk! While many people tested the application so far and we heard of no bricked devices, thinks might still go wrong.
29+
> **Warning**: This application is currently in beta state, so use at your own risk! While many people tested the application so far and we heard of no bricked devices, thinks might still go wrong.
3030
3131
> **Note**: Unlocking the bootloader will erase all data on your device!
3232
This also includes your DRM keys, which are stored in the Trim Area partition (also called TA).
@@ -40,16 +40,23 @@ Linux is currently the best supported platform (tested with Ubuntu 20.04/22.04 L
4040

4141
1. Download the AppImage, .exe or appropriate executable file for your OS. You might need to change permissions to run the executable.
4242
- On Windows also [install the Universal USB Drivers](https://adb.clockworkmod.com/) and other potentially drivers needed for your device.
43-
2. Download the custom ROM image and the TWRP recovery image for your device. A source for files can be found on the following websites:
44-
- some custom ROMs:
45-
- [LineageOS](https://wiki.lineageos.org/devices/)
46-
- [/e/OS](https://doc.e.foundation/devices)
47-
- [LineageOS for microg](https://download.lineage.microg.org/)
48-
- [BlissRoms](https://blissroms.org/)
49-
- [PixelExperience](https://download.pixelexperience.org/)
50-
- TWRP Recovery:
51-
- [TWRP recovery](https://twrp.me/Devices/)
52-
- or you can just search the web or the [xda-developers forum](https://forum.xda-developers.com) for an appropriate version for your device.
43+
2. Download the custom ROM image and the TWRP recovery image for your device and optionally some addons. A source for files can be found on the following websites:
44+
- some custom ROMs:
45+
- [LineageOS](https://wiki.lineageos.org/devices/)
46+
- [/e/OS](https://doc.e.foundation/devices)
47+
- [LineageOS for microg](https://download.lineage.microg.org/)
48+
- [BlissRoms](https://blissroms.org/)
49+
- [PixelExperience](https://download.pixelexperience.org/)
50+
- TWRP Recovery:
51+
- [TWRP recovery](https://twrp.me/Devices/)
52+
- Optional Addons:
53+
- There are different packages of *Google Apps* available.
54+
- [MindTheGapps](https://wiki.lineageos.org/gapps#downloads)
55+
- [NikGApps](https://nikgapps.com/)
56+
- [MicroG](https://microg.org/)
57+
- The recommended way to install MicroG is to use the zip file provided here: [https://github.com/FriendlyNeighborhoodShane/MinMicroG_releases/releases](https://github.com/FriendlyNeighborhoodShane/MinMicroG_releases/releases).
58+
- [F-Droid App-Store](https://f-droid.org/en/packages/org.fdroid.fdroid.privileged.ota/).
59+
- or you can just search the web or the [xda-developers forum](https://forum.xda-developers.com) for an appropriate version for your device.
5360
3. Start the desktop app and follow the instructions.
5461

5562

@@ -218,7 +225,7 @@ If you build the application for your platform and want to contribute the build,
218225
#### On unlocking the bootloader
219226
Devices by *Samsung*, *Google* and *Fairphone* make it fairly easy to unlock the bootloader and receive good support in the installer.
220227

221-
Some devices with require manual steps to unlock the bootloader. In general you will need to create an account at a vendor website and receive some code from there. OpenAndroidInstaller will try to guide you as far as possible. These vendors include *Sony, Motorola, Xiaomi* among others.
228+
Some devices with require manual steps to unlock the bootloader. In general you will need to create an account at a vendor website and receive some code from there. OpenAndroidInstaller will try to guide you as far as possible. These vendors include *Sony, Motorola, Xiaomi* and *OnePlus* among others.
222229

223230
Other phone vendors stops allowing to unlock the bootloader all together. There is nothing to be done if you didn't unlock your device in time. These vendors include *Huawei and LG* among others. Support for these vendors will always be very limited.
224231

openandroidinstaller/app_state.py

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

16+
import copy
1617
from pathlib import Path
18+
from typing import List, Optional
1719

1820
from installer_config import _load_config
1921

@@ -27,7 +29,7 @@ def __init__(
2729
config_path: Path,
2830
bin_path: Path,
2931
test: bool = False,
30-
test_config: str = None,
32+
test_config: Optional[str] = None,
3133
):
3234
self.platform = platform
3335
self.config_path = config_path
@@ -37,19 +39,33 @@ def __init__(
3739

3840
# placeholders
3941
self.advanced = False
42+
self.install_addons = False
4043
self.config = None
4144
self.image_path = None
4245
self.recovery_path = None
46+
self.is_ab = None
4347

44-
# is this still needed?
45-
self.steps = None
48+
# store views
49+
self.default_views: List = []
50+
self.addon_views: List = []
51+
self.final_default_views: List = []
52+
53+
def add_default_views(self, views: List):
54+
"""Add default views to store"""
55+
self.default_views.extend(views)
56+
57+
def add_addon_views(self, views: List):
58+
"""Add addon views to store"""
59+
self.addon_views.extend(views)
60+
61+
def add_final_default_views(self, views: List):
62+
"""Add final default views to store"""
63+
self.final_default_views.extend(views)
4664

4765
def load_config(self, device_code: str):
4866
"""Load the config from file to state by device code."""
4967
self.config = _load_config(device_code, self.config_path)
5068
if self.config:
51-
self.steps = (
52-
self.config.unlock_bootloader
53-
+ self.config.flash_recovery
54-
+ self.config.install_os
69+
self.steps = copy.deepcopy(self.config.unlock_bootloader) + copy.deepcopy(
70+
self.config.flash_recovery
5571
)

openandroidinstaller/assets/configs/FP2.yaml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,4 @@ steps:
1818
- type: confirm_button
1919
content: >
2020
Now reboot into recovery to verify the installation. Do not reboot into the existing OS, since it will overwrite the recovery you just installed!
21-
With the device powered off, hold 'Volume Up + Power'. Release when boot logo appears.
22-
install_os:
23-
- type: call_button
24-
content: >
25-
In the next steps, you finally flash the selected OS image.
26-
Wait until the TWRP screen appears. Then run the command.
27-
This step will format your phone and wipe all the data. It will also remove encryption and delete all files stored
28-
in the internal storage. Then the OS image will be installed. This might take a while. At the end your phone will boot into the new OS.
29-
command: adb_twrp_wipe_and_install
21+
With the device powered off, hold 'Volume Up + Power'. Release when boot logo appears.

openandroidinstaller/assets/configs/FP3.yaml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,4 @@ steps:
4343
- type: confirm_button
4444
content: >
4545
Now reboot into recovery to verify the installation. Do not reboot into the existing OS, since it will overwrite the recovery you just installed!
46-
With the device powered off, hold 'Volume Up + Power'. Release when boot logo appears.
47-
install_os:
48-
- type: call_button
49-
content: >
50-
In the next steps, 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. This might take a while. At the end your phone will boot into the new OS.
54-
command: adb_twrp_wipe_and_install
46+
With the device powered off, hold 'Volume Up + Power'. Release when boot logo appears.

openandroidinstaller/assets/configs/FP4.yaml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,4 @@ steps:
4343
- type: confirm_button
4444
content: >
4545
Now reboot into recovery to verify the installation. Do not reboot into the existing OS, since it will overwrite the recovery you just installed!
46-
With the device powered off, hold 'Volume Up + Power'. Release when boot logo appears.
47-
install_os:
48-
- type: call_button
49-
content: >
50-
In the next steps, 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. This might take a while. At the end your phone will boot into the new OS.
54-
command: adb_twrp_wipe_and_install
46+
With the device powered off, hold 'Volume Up + Power'. Release when boot logo appears.

openandroidinstaller/assets/configs/a3y17lte.yaml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,4 @@ steps:
2121
content: >
2222
Unplug the USB cable from your device. Then manually reboot into recovery by pressing the *Volume Down* + *Power buttons* for
2323
8~10 seconds 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* + *Home* + *Power*. Confirm when the recovery screen appears.
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
24+
hold *Volume Up* + *Home* + *Power*. Confirm when the recovery screen appears.

openandroidinstaller/assets/configs/a5xelte.yaml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,4 @@ steps:
1919
content: >
2020
Unplug the USB cable from your device. Then manually reboot into recovery by pressing the *Volume Down* + *Power buttons* for 8~10 seconds
2121
until the screen turns black & release the buttons immediately when it does, then boot to recovery with the device powered off,
22-
hold *Volume Up* + *Home* + *Power button*.
23-
install_os:
24-
- type: call_button
25-
content: >
26-
In the next steps, you finally flash the selected OS image.
27-
Connect your device with your computer with the USB-Cable.
28-
This step will format your phone and wipe all the data. It will also remove encryption and delete all files stored
29-
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.
30-
command: adb_twrp_wipe_and_install
22+
hold *Volume Up* + *Home* + *Power button*.

openandroidinstaller/assets/configs/a72q.yaml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,4 @@ steps:
1919
content: >
2020
Unplug the USB cable from your device. Then manually reboot into recovery by pressing the *Volume Down* + *Power* for 8~10 seconds
2121
until the screen turns black & release the buttons immediately when it does, then boot to recovery with the device powered off,
22-
hold *Volume Up* + *Power button*.
23-
install_os:
24-
- type: call_button
25-
content: >
26-
In the next steps, you finally flash the selected OS image.
27-
Connect your device with your computer with the USB-Cable.
28-
This step will format your phone and wipe all the data. It will also remove encryption and delete all files stored
29-
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.
30-
command: adb_twrp_wipe_and_install
22+
hold *Volume Up* + *Power button*.

openandroidinstaller/assets/configs/a7xelte.yaml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,4 @@ steps:
1919
content: >
2020
Unplug the USB cable from your device. Then manually reboot into recovery by pressing the *Volume Down* + *Power buttons* for 8~10 seconds
2121
until the screen turns black & release the buttons immediately when it does, then boot to recovery with the device powered off,
22-
hold *Volume Up* + *Home* + *Power button*.
23-
install_os:
24-
- type: call_button
25-
content: >
26-
In the next steps, you finally flash the selected OS image.
27-
Connect your device with your computer with the USB-Cable.
28-
This step will format your phone and wipe all the data. It will also remove encryption and delete all files stored
29-
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.
30-
command: adb_twrp_wipe_and_install
22+
hold *Volume Up* + *Home* + *Power button*.

0 commit comments

Comments
 (0)