Skip to content

Commit 5fb50d3

Browse files
authored
Device code as list (#118)
This PR adds: - Supported device codes for a config are now a list; config is loaded based on this
2 parents a49cae3 + cd1436e commit 5fb50d3

Some content is hidden

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

64 files changed

+286
-194
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ All kinds of contributions are welcome. These include:
186186

187187
### How to contribute your own installation configurations
188188

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 `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.
190190

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

@@ -197,8 +197,9 @@ A config file consists of two parts. The first part are some metadata about the
197197
##### How to write Metadata
198198
Every config file should have metadata with the following fields:
199199
- `maintainer`: str; Maintainer and author of the config file.
200-
- `devicename`: str; Name of the device.
201-
- `devicecode`: str; The official device code.
200+
- `device_name`: str; Name of the device.
201+
- `device_code`: str; The official device code.
202+
- `supported_device_codes`: List[str]; A list of supported device codes for the config. The config will be loaded based on this field.
202203
- `twrp-link`: [OPTIONAL] str; name of the corresponding twrp page.
203204

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

openandroidinstaller/assets/configs/FP2.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
metadata:
22
maintainer: Tobias Sterbak (tsterbak)
3-
devicename: Fairphone 2
4-
devicecode: FP2
3+
device_name: Fairphone 2
4+
device_code: FP2
5+
supported_device_codes:
6+
- FP2
57
steps:
68
unlock_bootloader:
79
boot_recovery:

openandroidinstaller/assets/configs/FP3.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
metadata:
22
maintainer: Tobias Sterbak (tsterbak)
3-
devicename: Fairphone 3
4-
devicecode: FP3
3+
device_name: Fairphone 3
4+
device_code: FP3
5+
supported_device_codes:
6+
- FP3
57
steps:
68
unlock_bootloader:
79
- type: link_button_with_confirm

openandroidinstaller/assets/configs/FP4.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
metadata:
22
maintainer: Tobias Sterbak (tsterbak)
3-
devicename: Fairphone 4
4-
devicecode: FP4
3+
device_name: Fairphone 4
4+
device_code: FP4
5+
supported_device_codes:
6+
- FP4
57
steps:
68
unlock_bootloader:
79
- type: link_button_with_confirm

openandroidinstaller/assets/configs/a3y17lte.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
metadata:
22
maintainer: Tobias Sterbak (tsterbak)
3-
devicename: Samsung Galaxy A3 (2017)
4-
devicecode: a3y17lte
3+
device_name: Samsung Galaxy A3 (2017)
4+
device_code: a3y17lte
5+
supported_device_codes:
6+
- a3y17lte
57
steps:
68
unlock_bootloader:
79
boot_recovery:

openandroidinstaller/assets/configs/a5xelte.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
metadata:
22
maintainer: Tobias Sterbak (tsterbak)
3-
devicename: Samsung Galaxy A5 (2016)
4-
devicecode: a5xelte
3+
device_name: Samsung Galaxy A5 (2016)
4+
device_code: a5xelte
5+
supported_device_codes:
6+
- a5xelte
57
steps:
68
unlock_bootloader:
79
boot_recovery:

openandroidinstaller/assets/configs/a72q.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
metadata:
22
maintainer: Tobias Sterbak (tsterbak)
3-
devicename: Samsung Galaxy A72
4-
devicecode: a72q
3+
device_name: Samsung Galaxy A72
4+
device_code: a72q
5+
supported_device_codes:
6+
- a72q
57
steps:
68
unlock_bootloader:
79
boot_recovery:

openandroidinstaller/assets/configs/a7xelte.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
metadata:
22
maintainer: Tobias Sterbak (tsterbak)
3-
devicename: Samsung Galaxy A7 (2016)
4-
devicecode: a7xelte
3+
device_name: Samsung Galaxy A7 (2016)
4+
device_code: a7xelte
5+
supported_device_codes:
6+
- a7xelte
57
steps:
68
unlock_bootloader:
79
boot_recovery:

openandroidinstaller/assets/configs/akari.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
metadata:
22
maintainer: Tobias Sterbak (tsterbak)
3-
devicename: Sony Xperia XZ2
4-
devicecode: akari
3+
device_name: Sony Xperia XZ2
4+
device_code: akari
5+
supported_device_codes:
6+
- akari
57
requirements:
68
android: 10
79
steps:

openandroidinstaller/assets/configs/akatsuki.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
metadata:
22
maintainer: Tobias Sterbak (tsterbak)
3-
devicename: Sony Xperia XZ3
4-
devicecode: akatsuki
3+
device_name: Sony Xperia XZ3
4+
device_code: akatsuki
5+
supported_device_codes:
6+
- akatsuki
57
requirements:
68
android: 10
79
steps:

0 commit comments

Comments
 (0)