diff --git a/README.md b/README.md index a49b1a4a..bea6ab57 100644 --- a/README.md +++ b/README.md @@ -215,6 +215,7 @@ Every config file should have `metadata` with the following fields: - `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 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. diff --git a/openandroidinstaller/installer_config.py b/openandroidinstaller/installer_config.py index 2a857d83..cf41617a 100644 --- a/openandroidinstaller/installer_config.py +++ b/openandroidinstaller/installer_config.py @@ -166,6 +166,7 @@ def validate_config(config: str) -> bool: "device_code": str, "supported_device_codes": [str], schema.Optional("twrp-link"): str, + schema.Optional("notes"): str, }, schema.Optional("requirements"): { schema.Optional("android"): schema.Or(str, int), diff --git a/openandroidinstaller/views/select_view.py b/openandroidinstaller/views/select_view.py index 442fa98b..a83ae0fe 100644 --- a/openandroidinstaller/views/select_view.py +++ b/openandroidinstaller/views/select_view.py @@ -144,6 +144,20 @@ def build(self): # text row to show infos during the process self.info_field = Row() + + # Device specific notes + if "notes" in self.state.config.metadata: + self.right_view.controls.extend( + [ + Text( + "Important notes for your device", + style="titleSmall", + color=colors.RED, + weight="bold", + ), + Markdown(f"""{self.state.config.metadata['notes']}"""), + ] + ) # if there is an available download, show the button to the page if self.download_link: twrp_download_link = f"https://dl.twrp.me/{self.state.config.twrp_link if self.state.config.twrp_link else self.state.config.device_code}"