File tree Expand file tree Collapse file tree
openandroidinstaller/views Expand file tree Collapse file tree Original file line number Diff line number Diff 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
211211Every 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
220222In 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.
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments