Skip to content

Commit

Permalink
Update notes, add brand and untested metadata.
Browse files Browse the repository at this point in the history
  • Loading branch information
anon1892 committed Aug 2, 2023
1 parent 62be5c3 commit 812bb51
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,14 @@ A config file consists of two parts. The first part are some metadata about the
##### How to write Metadata
Every config file should have `metadata` with the following fields:
- `maintainer`: str; Maintainer and author of the config file.
- `brand`: [OPTIONAL] str; Name of the brand. Can be used to make brand specific actions.
- `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.
- `notes`: [OPTIONAL] str; specific phone information, showed before choosing ROM / recovery
- `notes`: [OPTIONAL] List[str]; specific phone information, showed before choosing ROM / recovery
- `untested`: [OPTIONAL] bool; If `true`, a warning message is showed during installation process.

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.
- `android`: [OPTIONAL] int|str; Android version to install prior to installing a custom ROM.
Expand Down
9 changes: 8 additions & 1 deletion openandroidinstaller/views/select_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,13 @@ def build(self):

# Device specific notes
if "notes" in self.state.config.metadata:
notes = ""
if "brand" in self.state.config.metadata and (self.state.config.metadata['brand'] == "xiaomi" or self.state.config.metadata['brand'] == "poco"):
notes += "- If something goes wrong, you can reinstall MiUI here :\n<https://xiaomifirmwareupdater.com/miui/lavender/>\n\n"
if "untested" in self.state.config.metadata and self.state.config.metadata['untested'] == True:
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"
for note in self.state.config.metadata['notes']:
notes += "- " + note + "\n\n"
self.right_view.controls.extend(
[
Text(
Expand All @@ -155,7 +162,7 @@ def build(self):
color=colors.RED,
weight="bold",
),
Markdown(f"""{self.state.config.metadata['notes']}"""),
Markdown(f"""{notes}"""),
]
)
# if there is an available download, show the button to the page
Expand Down

0 comments on commit 812bb51

Please sign in to comment.