forked from ubports/installer-configs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_device.schema.json
279 lines (279 loc) · 10.9 KB
/
_device.schema.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://raw.githubusercontent.com/ubports/installer-configs/master/v1/_device.schema.json",
"title": "Device",
"description": "Device configuration for the UBports Installer",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The human-readable name under which the device was marketed. This includes the name of the manufacturer if it makes sense. I.e. you would not refer to the 'Oneplus One' as 'One', but you would not call the 'iPhone 9' 'Apple iPhone 9'. Use common sense."
},
"codename": {
"type": "string",
"description": "A short codename that is used internally to identify the device. This (with the extension '.json') should also be the filename. If there are multiple codenames in use for the exact same device, only create a single one with the most prominent one and add the correct aliases to aliases.json."
},
"user_actions": {
"type": "object",
"description": "Object that contains instructions for the user for later reference.",
"patternProperties": {
"\\w": {
"type": "object",
"description": "Instruction that can be referenced and presented to the user. Eg key combinations to reboot to recovery or bootloader.",
"properties": {
"title": {
"type": "string",
"description": "Identifier of the step. Eg. 'Enable USB-debugging'"
},
"description": {
"type": "string",
"description": "Short description of the step. For simple tasks, the full instructions can be put here."
},
"image": {
"type": "string",
"description": "String referring to a picture in the installer.",
"enum": [
"phone_power_up",
"phone_power_down"
]
},
"button": {
"type": "boolean",
"description": "Specify whether there should be a done-button displayed."
},
"link": {
"type": "string",
"description": "A link to a more extensive tutorial."
}
},
"required": [
"title",
"description"
]
}
}
},
"unlock": {
"type": "array",
"description": "An array of strings referring to user_actions defined above that are needed to unlock the device. This might include simple things like enabling adb access or bigger steps like using a leaked oem tool to flash highly questionable images that unlock the bootloader. Whatever is needed to make installations possible.",
"uniqueItems": true,
"items": {
"type": "string"
}
},
"operating_systems": {
"type": "array",
"description": "An array of objects describing operating systems available for installation.",
"uniqueItems": true,
"items": {
"type": "object",
"description": "An operating system available for installation",
"properties": {
"name": {
"type": "string",
"description": "Human-readable name of the operating system."
},
"options": {
"type": "array",
"description": "Options for the installation.",
"items": {
"type": "object",
"description": "Option for the installation.",
"properties": {
"var": {
"type": "string",
"description": "Variable the setting will be stored in."
},
"name": {
"type": "string",
"description": "Human-readable identifier of the setting."
},
"tooltip": {
"type": "string",
"description": "A very short help text describing the setting."
},
"link": {
"type": "string",
"description": "A link to the docs describing the setting."
},
"type": {
"type": "string",
"description": "Describes what values are accepted by the setting and how they are provided.",
"enum": [
"checkbox",
"input",
"select"
]
},
"remote_values": {
"type": "object",
"description": "If the values can be generated from a remote source like the systemimage api, this provides the required information for that.",
"properties": {
"type": {
"type": "string",
"enum": ["systemimagechannels"]
}
}
},
"value": {
"description": "Default value of the option"
},
"values": {
"type": "array",
"description": "List of values for the select."
}
},
"required": [
"var",
"name",
"type"
]
}
},
"prerequisites": {
"type": "array",
"description": "An array of strings referring to user_actions defined above that are needed before the installation. This should not include the steps from the generic unlock block, but actions specific to the installation of this operating system.",
"values": {
"type": "string",
"description": "Reference to user_action that's needed before the installation of this OS. Steps required for every OS should be put in the generic unlock block instead."
}
},
"steps": {
"type": "array",
"description": "An ordered array of objects describing steps required to install the operating system.",
"items": {
"type": "object",
"description": "Installation step.",
"properties": {
"type": {
"type": "string",
"description": "Type of installation step.",
"enum": [
"user_action",
"fastboot:reboot_bootloader",
"fastboot:update",
"systemimage",
"fastboot:boot",
"fastboot:reboot",
"fastboot:continue",
"fastboot:erase",
"fastboot:format",
"fastboot:flash",
"fastboot:set_active",
"adb:reboot",
"adb:format",
"adb:sideload",
"download",
"unpack",
"manual_download"
]
},
"optional": {
"type": "boolean",
"description": "If true, errors in this step will be ignored"
},
"fallback_user_action": {
"type": "string",
"description": "Reference to a user_action that can be used if the step fails."
},
"condition": {
"type": "object",
"description": "Query an installation option to determine if the step should be run",
"properties": {
"var": {
"type": "string",
"description": "Reference to an option defined for this operating system"
},
"value": {
"description": "Value to expect"
}
},
"required": ["var", "value"]
},
"group": {
"type": "string",
"description": "[type: download] [required] Group of files."
},
"files": {
"type": "array",
"description": "[type: download] [required] Array of files to download.",
"items": {
"type": "object",
"properties": {
"url": {
"type": "string",
"description": "URL of the file to download"
},
"checksum": {
"type": "object",
"properties": {
"sum": {
"type": "string",
"description": "Checksum of the file to download"
},
"algorithm": {
"type": "string",
"description": "Hashing algorithm to use to calculate the checksum"
}
}
}
}
}
},
"partition": {
"type": "string",
"description": "[type: adb:format] [required] Partition to format."
},
"to_state": {
"type": "string",
"description": "[type: adb:reboot] [required] State to rebot to.",
"enum": ["recovery", "system", "bootloader"]
}
},
"required": ["type"]
}
},
"slideshow": {
"type": "array",
"description": "An array of slides presenting the operating system's most compelling features.",
"items": {
"type": "object",
"description": "Slide about the operating system",
"properties": {
"title": {
"type": "string",
"description": "Title of the slide"
},
"text": {
"type": "string",
"description": "Text body of the slide, Markdown supported here."
},
"image": {
"type": "string",
"description": "Image displayed on the slide."
}
}
}
},
"video": {
"type": "string",
"description": "A video introducing the user to the operating system they just installed."
},
"donate": {
"type": "string",
"description": "A link to donate to the developer of the operating system."
},
"get_involved": {
"type": "string",
"description": "A link to the OSs get involved page."
}
}
}
}
},
"required": [
"name",
"codename",
"operating_systems"
]
}