Skip to content

Commit e27100e

Browse files
authored
Release 0.4.2-beta (#119)
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
2 parents 80a563f + 21a7981 commit e27100e

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

+785
-633
lines changed

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Linux is currently the best supported platform (tested with Ubuntu 20.04/22.04 L
6262

6363
## Officially supported devices
6464

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

6767

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

150150
Vendor | Device Name | CodeName | Models | Status
151151
---|---|---|---|---
152+
OnePlus | One | [bacon](https://wiki.lineageos.org/devices/bacon/) | A0001 | tested
152153
OnePlus | 5 | [cheeseburger](https://wiki.lineageos.org/devices/cheeseburger/) | | tested
153154
OnePlus | 5T | [dumpling](https://wiki.lineageos.org/devices/dumpling/) | | tested
154155
OnePlus | 6 | [enchilada](https://wiki.lineageos.org/devices/enchilada/) | | tested
@@ -185,19 +186,21 @@ All kinds of contributions are welcome. These include:
185186

186187
### How to contribute your own installation configurations
187188

188-
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.
189+
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.
189190

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

192193
#### Content of a config file
193194

194-
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.
195+
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.
195196

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

203206
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.
@@ -213,7 +216,7 @@ Every step in the config file corresponds to one view in the application. These
213216
- `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.
214217
- `link_button_with_confirm`: Display a button that opens a browser with a given link, confirm afterwards. Link is given in `link`.
215218
- `content`: str; The content text displayed alongside the action of the step. Used to inform the user about whats going on.
216-
- `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`.
219+
- `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`.
217220
- `img`: [OPTIONAL] Display an image on the left pane of the step view. Images are loaded from `openandroidinstaller/assets/imgs/`.
218221
- `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.
219222
- `link`: [OPTIONAL] Link to use for the link button if type is `link_button_with_confirm`.

openandroidinstaller/app_state.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ def __init__(
4343
self.config = None
4444
self.image_path = None
4545
self.recovery_path = None
46-
self.is_ab = None
4746

4847
# store views
4948
self.default_views: List = []
@@ -67,5 +66,5 @@ def load_config(self, device_code: str):
6766
self.config = _load_config(device_code, self.config_path)
6867
if self.config:
6968
self.steps = copy.deepcopy(self.config.unlock_bootloader) + copy.deepcopy(
70-
self.config.flash_recovery
69+
self.config.boot_recovery
7170
)

openandroidinstaller/assets/configs/FP2.yaml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
metadata:
22
maintainer: Tobias Sterbak (tsterbak)
3-
devicename: Fairphone 2
4-
devicecode: FP2
3+
device_name: Fairphone 2
4+
is_ab_device: false
5+
device_code: FP2
6+
supported_device_codes:
7+
- FP2
58
steps:
69
unlock_bootloader:
7-
flash_recovery:
10+
boot_recovery:
811
- type: confirm_button
912
content: >
10-
Now you need to flash a custom recovery system on the phone. A recovery is a small subsystem on your phone, that manages updating,
13+
Now you need to boot a custom recovery system on the phone. A recovery is a small subsystem on your phone, that manages updating,
1114
adapting and repairing of the operating system.
1215
- type: call_button
1316
content: Once the device is fully booted, you need to reboot into the bootloader again by pressing 'Confirm and run' here. Then continue.
1417
command: adb_reboot_bootloader
1518
- type: call_button
16-
content: Flash a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
17-
command: fastboot_flash_recovery
19+
content: Boot a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
20+
command: fastboot_boot_recovery
1821
- type: confirm_button
1922
content: >
2023
Now reboot into recovery to verify the installation. Do not reboot into the existing OS, since it will overwrite the recovery you just installed!

openandroidinstaller/assets/configs/FP3.yaml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
metadata:
22
maintainer: Tobias Sterbak (tsterbak)
3-
devicename: Fairphone 3
4-
devicecode: FP3
3+
device_name: Fairphone 3
4+
is_ab_device: true
5+
device_code: FP3
6+
supported_device_codes:
7+
- FP3
58
steps:
69
unlock_bootloader:
710
- type: link_button_with_confirm
@@ -29,17 +32,17 @@ steps:
2932
command: fastboot_reboot
3033
- type: confirm_button
3134
content: The bootloader is now unlocked. Since the device resets completely, you will need to re-enable USB debugging to continue.
32-
flash_recovery:
35+
boot_recovery:
3336
- type: confirm_button
3437
content: >
35-
Now you need to flash a custom recovery system on the phone. A recovery is a small subsystem on your phone, that manages updating,
38+
Now you need to boot a custom recovery system on the phone. A recovery is a small subsystem on your phone, that manages updating,
3639
adapting and repairing of the operating system.
3740
- type: call_button
3841
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.
3942
command: adb_reboot_bootloader
4043
- type: call_button
4144
content: Once the device is in fastboot mode, flash the custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
42-
command: fastboot_flash_recovery
45+
command: fastboot_boot_recovery
4346
- type: confirm_button
4447
content: >
4548
Now reboot into recovery to verify the installation. Do not reboot into the existing OS, since it will overwrite the recovery you just installed!

openandroidinstaller/assets/configs/FP4.yaml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
metadata:
22
maintainer: Tobias Sterbak (tsterbak)
3-
devicename: Fairphone 4
4-
devicecode: FP4
3+
device_name: Fairphone 4
4+
is_ab_device: true
5+
device_code: FP4
6+
supported_device_codes:
7+
- FP4
58
steps:
69
unlock_bootloader:
710
- type: link_button_with_confirm
@@ -29,17 +32,17 @@ steps:
2932
command: fastboot_reboot
3033
- type: confirm_button
3134
content: The bootloader is now unlocked. Since the device resets completely, you will need to re-enable USB debugging to continue.
32-
flash_recovery:
35+
boot_recovery:
3336
- type: confirm_button
3437
content: >
35-
Now you need to flash a custom recovery system on the phone. A recovery is a small subsystem on your phone, that manages updating,
38+
Now you need to boot a custom recovery system on the phone. A recovery is a small subsystem on your phone, that manages updating,
3639
adapting and repairing of the operating system.
3740
- type: call_button
3841
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.
3942
command: adb_reboot_bootloader
4043
- type: call_button
41-
content: Once the device is in fastboot mode, flash the custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
42-
command: fastboot_flash_recovery
44+
content: Once the device is in fastboot mode, boot the custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
45+
command: fastboot_boot_recovery
4346
- type: confirm_button
4447
content: >
4548
Now reboot into recovery to verify the installation. Do not reboot into the existing OS, since it will overwrite the recovery you just installed!

openandroidinstaller/assets/configs/a3y17lte.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
metadata:
22
maintainer: Tobias Sterbak (tsterbak)
3-
devicename: Samsung Galaxy A3 (2017)
4-
devicecode: a3y17lte
3+
device_name: Samsung Galaxy A3 (2017)
4+
is_ab_device: false
5+
device_code: a3y17lte
6+
supported_device_codes:
7+
- a3y17lte
58
steps:
69
unlock_bootloader:
7-
flash_recovery:
10+
boot_recovery:
811
- type: call_button
912
content: >
1013
As a first step, you need to boot into the bootloader. A bootloader is the piece of software,
@@ -13,7 +16,7 @@ steps:
1316
command: adb_reboot_download
1417
- type: call_button
1518
content: >
16-
In this step, you need to flash a custom recovery on your device.
19+
In this step, you need to boot a custom recovery on your device.
1720
Press 'Confirm and run' to start the process. Confirm afterwards to continue.
1821
command: heimdall_flash_recovery
1922
- type: confirm_button

openandroidinstaller/assets/configs/a5xelte.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
metadata:
22
maintainer: Tobias Sterbak (tsterbak)
3-
devicename: Samsung Galaxy A5 (2016)
4-
devicecode: a5xelte
3+
device_name: Samsung Galaxy A5 (2016)
4+
is_ab_device: false
5+
device_code: a5xelte
6+
supported_device_codes:
7+
- a5xelte
58
steps:
69
unlock_bootloader:
7-
flash_recovery:
10+
boot_recovery:
811
- type: call_button
912
content: >
1013
As a first step, you need to boot into the bootloader. A bootloader is the piece of software,
1114
that tells your phone who to start and run an operating system (like Android). Your device should be turned on.
1215
Then press 'Confirm and run' to reboot into the bootloader. Continue once it's done.
1316
command: adb_reboot_download
1417
- type: call_button
15-
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+
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.
1619
command: heimdall_flash_recovery
1720
- type: confirm_button
1821
img: samsung-buttons.png

openandroidinstaller/assets/configs/a72q.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
metadata:
22
maintainer: Tobias Sterbak (tsterbak)
3-
devicename: Samsung Galaxy A72
4-
devicecode: a72q
3+
device_name: Samsung Galaxy A72
4+
is_ab_device: false
5+
device_code: a72q
6+
supported_device_codes:
7+
- a72q
58
steps:
69
unlock_bootloader:
7-
flash_recovery:
10+
boot_recovery:
811
- type: call_button
912
content: >
1013
As a first step, you need to boot into the bootloader. A bootloader is the piece of software,
1114
that tells your phone who to start and run an operating system (like Android). Your device should be turned on.
1215
Then press 'Confirm and run' to reboot into the bootloader. Continue once it's done.
1316
command: adb_reboot_download
1417
- type: call_button
15-
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+
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.
1619
command: heimdall_flash_recovery
1720
- type: confirm_button
1821
img: samsung-buttons.png

openandroidinstaller/assets/configs/a7xelte.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
metadata:
22
maintainer: Tobias Sterbak (tsterbak)
3-
devicename: Samsung Galaxy A7 (2016)
4-
devicecode: a7xelte
3+
device_name: Samsung Galaxy A7 (2016)
4+
is_ab_device: false
5+
device_code: a7xelte
6+
supported_device_codes:
7+
- a7xelte
58
steps:
69
unlock_bootloader:
7-
flash_recovery:
10+
boot_recovery:
811
- type: call_button
912
content: >
1013
As a first step, you need to boot into the bootloader. A bootloader is the piece of software,
1114
that tells your phone who to start and run an operating system (like Android). Your device should be turned on.
1215
Then press 'Confirm and run' to reboot into the bootloader. Continue once it's done.
1316
command: adb_reboot_download
1417
- type: call_button
15-
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+
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.
1619
command: heimdall_flash_recovery
1720
- type: confirm_button
1821
img: samsung-buttons.png

openandroidinstaller/assets/configs/akari.yaml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
metadata:
22
maintainer: Tobias Sterbak (tsterbak)
3-
devicename: Sony Xperia XZ2
4-
devicecode: akari
3+
device_name: Sony Xperia XZ2
4+
is_ab_device: true
5+
device_code: akari
6+
supported_device_codes:
7+
- akari
58
requirements:
69
android: 10
710
steps:
@@ -33,15 +36,15 @@ steps:
3336
Press the button to reboot. Since the device resets completely, you will need to re-enable USB debugging to continue.
3437
Connect your device to your PC via USB. Then confirm here to continue.
3538
command: fastboot_reboot
36-
flash_recovery:
39+
boot_recovery:
3740
- type: call_button
3841
content: >
39-
Now you need to flash a custom recovery system on the phone. A recovery is a small subsystem on your phone, that manages updating,
42+
Now you need to boot a custom recovery system on the phone. A recovery is a small subsystem on your phone, that manages updating,
4043
adapting and repairing of the operating system.
4144
Make sure your device is turned on. You need to reboot into the bootloader again by pressing 'Confirm and run' here. Then continue.
4245
command: adb_reboot_bootloader
4346
- type: call_button
44-
content: Flash a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
47+
content: Boot a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
4548
command: fastboot_flash_boot
4649
- type: call_button
4750
command: adb_twrp_copy_partitions

0 commit comments

Comments
 (0)