Skip to content

Commit

Permalink
Release 0.4.2-beta (#119)
Browse files Browse the repository at this point in the history
This release adds:
- Switched from flashing to booting TWRP (only flashed for samsung
devices now)
- Supported device codes for a config are now a list; config is loaded
based on this
- Add is_ab_partitioned device to config
- config for OnePlus One (`bacon`)
- Support for OnePlus6TSingle under fajita
- selectable text and markdown elements in the app
- if there are no instructions to unlock the bootloader, assume there is
nothing to do and toggle automatically

Fixes:
- Updated contribute_link
- Moved feedback to app header
- Fixes a bug where there is waited for fastboot to early
- Fix device code issue for zerolte
- Removing extra reboot step
- Check a different url if lineageos exists
  • Loading branch information
tsterbak authored Mar 27, 2023
2 parents 80a563f + 21a7981 commit e27100e
Show file tree
Hide file tree
Showing 79 changed files with 785 additions and 633 deletions.
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Linux is currently the best supported platform (tested with Ubuntu 20.04/22.04 L

## Officially supported devices

Currently, the **we support 56 devices** by various vendors and working on adding more soon!
Currently, the **we support 57 devices** by various vendors and working on adding more soon!


Support for these devices is provided as best effort, but things might still go wrong.
Expand Down Expand Up @@ -149,6 +149,7 @@ Motorola | moto z | [griffin](https://wiki.lineageos.org/devices/griffin/) | | t

Vendor | Device Name | CodeName | Models | Status
---|---|---|---|---
OnePlus | One | [bacon](https://wiki.lineageos.org/devices/bacon/) | A0001 | tested
OnePlus | 5 | [cheeseburger](https://wiki.lineageos.org/devices/cheeseburger/) | | tested
OnePlus | 5T | [dumpling](https://wiki.lineageos.org/devices/dumpling/) | | tested
OnePlus | 6 | [enchilada](https://wiki.lineageos.org/devices/enchilada/) | | tested
Expand Down Expand Up @@ -185,19 +186,21 @@ 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). 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.
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 official `device code` of the device. Add the code output by `adb shell getprop | grep ro.product.device` (when the devices is connected to the computer) as well as the official device code to the `supported_device_codes` list in the config. 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

A config file consists of two parts. The first part are some metadata about the device and the second parts are the steps to unlock the bootloader, flash a recovery and install the ROMs.
A config file consists of two parts. The first part are some metadata about the device and the second parts are the steps to unlock the bootloader, boot a recovery and install the ROMs.

##### How to write Metadata
Every config file should have metadata with the following fields:
- `maintainer`: str; Maintainer and author of the config file.
- `devicename`: str; Name of the device.
- `devicecode`: str; The official device code.
- `device_name`: str; Name of the device.
- `is_ab_device`: bool; A boolean to determine if the device is a/b-partitioned or not.
- `device_code`: str; The official device code.
- `supported_device_codes`: List[str]; A list of supported device codes for the config. The config will be loaded based on this field.
- `twrp-link`: [OPTIONAL] str; name of the corresponding twrp page.

In addition to these metadata, every config can have optional requirements. If these are set, the user is asked to check if they are meet.
Expand All @@ -213,7 +216,7 @@ Every step in the config file corresponds to one view in the application. These
- `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.
- `link_button_with_confirm`: Display a button that opens a browser with a given link, confirm afterwards. Link is given in `link`.
- `content`: str; The content text displayed alongside the action of the step. Used to inform the user about whats going on.
- `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`.
- `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_boot_recovery`, `fastboot_unlock_with_code`, `fastboot_unlock`, `fastboot_oem_unlock`, `fastboot_get_unlock_data`, `fastboot_reboot`, `heimdall_flash_recovery`.
- `img`: [OPTIONAL] Display an image on the left pane of the step view. Images are loaded from `openandroidinstaller/assets/imgs/`.
- `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`.
Expand Down
3 changes: 1 addition & 2 deletions openandroidinstaller/app_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def __init__(
self.config = None
self.image_path = None
self.recovery_path = None
self.is_ab = None

# store views
self.default_views: List = []
Expand All @@ -67,5 +66,5 @@ def load_config(self, device_code: str):
self.config = _load_config(device_code, self.config_path)
if self.config:
self.steps = copy.deepcopy(self.config.unlock_bootloader) + copy.deepcopy(
self.config.flash_recovery
self.config.boot_recovery
)
15 changes: 9 additions & 6 deletions openandroidinstaller/assets/configs/FP2.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
metadata:
maintainer: Tobias Sterbak (tsterbak)
devicename: Fairphone 2
devicecode: FP2
device_name: Fairphone 2
is_ab_device: false
device_code: FP2
supported_device_codes:
- FP2
steps:
unlock_bootloader:
flash_recovery:
boot_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,
Now you need to boot 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.
- type: call_button
content: 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
- type: call_button
content: Flash a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
command: fastboot_flash_recovery
content: Boot a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
command: fastboot_boot_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!
Expand Down
13 changes: 8 additions & 5 deletions openandroidinstaller/assets/configs/FP3.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
metadata:
maintainer: Tobias Sterbak (tsterbak)
devicename: Fairphone 3
devicecode: FP3
device_name: Fairphone 3
is_ab_device: true
device_code: FP3
supported_device_codes:
- FP3
steps:
unlock_bootloader:
- type: link_button_with_confirm
Expand Down Expand Up @@ -29,17 +32,17 @@ steps:
command: fastboot_reboot
- type: confirm_button
content: The bootloader is now unlocked. Since the device resets completely, you will need to re-enable USB debugging to continue.
flash_recovery:
boot_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,
Now you need to boot 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.
- 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
- 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_recovery
command: fastboot_boot_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!
Expand Down
15 changes: 9 additions & 6 deletions openandroidinstaller/assets/configs/FP4.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
metadata:
maintainer: Tobias Sterbak (tsterbak)
devicename: Fairphone 4
devicecode: FP4
device_name: Fairphone 4
is_ab_device: true
device_code: FP4
supported_device_codes:
- FP4
steps:
unlock_bootloader:
- type: link_button_with_confirm
Expand Down Expand Up @@ -29,17 +32,17 @@ steps:
command: fastboot_reboot
- type: confirm_button
content: The bootloader is now unlocked. Since the device resets completely, you will need to re-enable USB debugging to continue.
flash_recovery:
boot_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,
Now you need to boot 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.
- 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
- 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_recovery
content: Once the device is in fastboot mode, boot the custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
command: fastboot_boot_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!
Expand Down
11 changes: 7 additions & 4 deletions openandroidinstaller/assets/configs/a3y17lte.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
metadata:
maintainer: Tobias Sterbak (tsterbak)
devicename: Samsung Galaxy A3 (2017)
devicecode: a3y17lte
device_name: Samsung Galaxy A3 (2017)
is_ab_device: false
device_code: a3y17lte
supported_device_codes:
- a3y17lte
steps:
unlock_bootloader:
flash_recovery:
boot_recovery:
- type: call_button
content: >
As a first step, you need to boot into the bootloader. A bootloader is the piece of software,
Expand All @@ -13,7 +16,7 @@ steps:
command: adb_reboot_download
- type: call_button
content: >
In this step, you need to flash a custom recovery on your device.
In this step, you need to boot a custom recovery on your device.
Press 'Confirm and run' to start the process. Confirm afterwards to continue.
command: heimdall_flash_recovery
- type: confirm_button
Expand Down
11 changes: 7 additions & 4 deletions openandroidinstaller/assets/configs/a5xelte.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
metadata:
maintainer: Tobias Sterbak (tsterbak)
devicename: Samsung Galaxy A5 (2016)
devicecode: a5xelte
device_name: Samsung Galaxy A5 (2016)
is_ab_device: false
device_code: a5xelte
supported_device_codes:
- a5xelte
steps:
unlock_bootloader:
flash_recovery:
boot_recovery:
- type: call_button
content: >
As a first step, you need to boot into the bootloader. A bootloader is the piece of software,
that tells your phone who to start and run an operating system (like Android). Your device should be turned on.
Then press 'Confirm and run' to reboot into the bootloader. Continue once it's done.
command: adb_reboot_download
- type: call_button
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.
content: In this step, you need to boot a custom recovery on your device. Press 'Confirm and run' to start the process. Confirm afterwards to continue.
command: heimdall_flash_recovery
- type: confirm_button
img: samsung-buttons.png
Expand Down
11 changes: 7 additions & 4 deletions openandroidinstaller/assets/configs/a72q.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
metadata:
maintainer: Tobias Sterbak (tsterbak)
devicename: Samsung Galaxy A72
devicecode: a72q
device_name: Samsung Galaxy A72
is_ab_device: false
device_code: a72q
supported_device_codes:
- a72q
steps:
unlock_bootloader:
flash_recovery:
boot_recovery:
- type: call_button
content: >
As a first step, you need to boot into the bootloader. A bootloader is the piece of software,
that tells your phone who to start and run an operating system (like Android). Your device should be turned on.
Then press 'Confirm and run' to reboot into the bootloader. Continue once it's done.
command: adb_reboot_download
- type: call_button
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.
content: In this step, you need to boot a custom recovery on your device. Press 'Confirm and run' to start the process. Confirm afterwards to continue.
command: heimdall_flash_recovery
- type: confirm_button
img: samsung-buttons.png
Expand Down
11 changes: 7 additions & 4 deletions openandroidinstaller/assets/configs/a7xelte.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
metadata:
maintainer: Tobias Sterbak (tsterbak)
devicename: Samsung Galaxy A7 (2016)
devicecode: a7xelte
device_name: Samsung Galaxy A7 (2016)
is_ab_device: false
device_code: a7xelte
supported_device_codes:
- a7xelte
steps:
unlock_bootloader:
flash_recovery:
boot_recovery:
- type: call_button
content: >
As a first step, you need to boot into the bootloader. A bootloader is the piece of software,
that tells your phone who to start and run an operating system (like Android). Your device should be turned on.
Then press 'Confirm and run' to reboot into the bootloader. Continue once it's done.
command: adb_reboot_download
- type: call_button
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.
content: In this step, you need to boot a custom recovery on your device. Press 'Confirm and run' to start the process. Confirm afterwards to continue.
command: heimdall_flash_recovery
- type: confirm_button
img: samsung-buttons.png
Expand Down
13 changes: 8 additions & 5 deletions openandroidinstaller/assets/configs/akari.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
metadata:
maintainer: Tobias Sterbak (tsterbak)
devicename: Sony Xperia XZ2
devicecode: akari
device_name: Sony Xperia XZ2
is_ab_device: true
device_code: akari
supported_device_codes:
- akari
requirements:
android: 10
steps:
Expand Down Expand Up @@ -33,15 +36,15 @@ steps:
Press the button to reboot. Since the device resets completely, you will need to re-enable USB debugging to continue.
Connect your device to your PC via USB. Then confirm here to continue.
command: fastboot_reboot
flash_recovery:
boot_recovery:
- type: call_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,
Now you need to boot 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.
Make sure your device is turned on. You need to reboot into the bootloader again by pressing 'Confirm and run' here. Then continue.
command: adb_reboot_bootloader
- type: call_button
content: Flash a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
content: Boot a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
command: fastboot_flash_boot
- type: call_button
command: adb_twrp_copy_partitions
Expand Down
13 changes: 8 additions & 5 deletions openandroidinstaller/assets/configs/akatsuki.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
metadata:
maintainer: Tobias Sterbak (tsterbak)
devicename: Sony Xperia XZ3
devicecode: akatsuki
device_name: Sony Xperia XZ3
is_ab_device: true
device_code: akatsuki
supported_device_codes:
- akatsuki
requirements:
android: 10
steps:
Expand Down Expand Up @@ -33,15 +36,15 @@ steps:
Press the button to reboot. Since the device resets completely, you will need to re-enable USB debugging to continue.
Connect your device to your PC via USB. Then confirm here to continue.
command: fastboot_reboot
flash_recovery:
boot_recovery:
- type: call_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,
Now you need to boot 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.
Make sure your device is turned on. You need to reboot into the bootloader again by pressing 'Confirm and run' here. Then continue.
command: adb_reboot_bootloader
- type: call_button
content: Flash a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
content: Boot a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
command: fastboot_flash_boot
- type: call_button
command: adb_twrp_copy_partitions
Expand Down
Loading

0 comments on commit e27100e

Please sign in to comment.