Skip to content

Commit 812bb51

Browse files
author
rudu
committed
Update notes, add brand and untested metadata.
1 parent 62be5c3 commit 812bb51

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,12 +210,14 @@ A config file consists of two parts. The first part are some metadata about the
210210
##### How to write Metadata
211211
Every config file should have `metadata` with the following fields:
212212
- `maintainer`: str; Maintainer and author of the config file.
213+
- `brand`: [OPTIONAL] str; Name of the brand. Can be used to make brand specific actions.
213214
- `device_name`: str; Name of the device.
214215
- `is_ab_device`: bool; A boolean to determine if the device is a/b-partitioned or not.
215216
- `device_code`: str; The official device code.
216217
- `supported_device_codes`: List[str]; A list of supported device codes for the config. The config will be loaded based on this field.
217218
- `twrp-link`: [OPTIONAL] str; name of the corresponding twrp page.
218-
- `notes`: [OPTIONAL] str; specific phone information, showed before choosing ROM / recovery
219+
- `notes`: [OPTIONAL] List[str]; specific phone information, showed before choosing ROM / recovery
220+
- `untested`: [OPTIONAL] bool; If `true`, a warning message is showed during installation process.
219221

220222
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.
221223
- `android`: [OPTIONAL] int|str; Android version to install prior to installing a custom ROM.

openandroidinstaller/views/select_view.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,13 @@ def build(self):
147147

148148
# Device specific notes
149149
if "notes" in self.state.config.metadata:
150+
notes = ""
151+
if "brand" in self.state.config.metadata and (self.state.config.metadata['brand'] == "xiaomi" or self.state.config.metadata['brand'] == "poco"):
152+
notes += "- If something goes wrong, you can reinstall MiUI here :\n<https://xiaomifirmwareupdater.com/miui/lavender/>\n\n"
153+
if "untested" in self.state.config.metadata and self.state.config.metadata['untested'] == True:
154+
notes += "- **This device has never been tested with OpenAndroidInstaller.** The installation can go wrong. You may have to finish the installation process with command line. If you test, please report the result on GitHub.\n\n"
155+
for note in self.state.config.metadata['notes']:
156+
notes += "- " + note + "\n\n"
150157
self.right_view.controls.extend(
151158
[
152159
Text(
@@ -155,7 +162,7 @@ def build(self):
155162
color=colors.RED,
156163
weight="bold",
157164
),
158-
Markdown(f"""{self.state.config.metadata['notes']}"""),
165+
Markdown(f"""{notes}"""),
159166
]
160167
)
161168
# if there is an available download, show the button to the page

0 commit comments

Comments
 (0)