1{ 2 "title": "JSON schema for app.json", 3 "$schema": "http://json-schema.org/draft-07/schema#", 4 "type": "object", 5 "additionalProperties": true, 6 "definitions": { 7 "default": { 8 "description": "The configuration in the default tag is applicable to all devices. If the configuration is different for other device types, you need to configure the configuration under the configuration tag of the device type.", 9 "type": "object", 10 "propertyNames": { 11 "enum": [ 12 "minAPIVersion", 13 "distributedNotificationEnabled", 14 "keepAlive", 15 "removable", 16 "singleton", 17 "userDataClearable", 18 "accessible" 19 ] 20 }, 21 "properties": { 22 "minAPIVersion": { 23 "description": "Indicates the minimum API version required for running an application. This label is an integer and can be defaulted.", 24 "type": "integer", 25 "minimum": 0, 26 "maximum": 2147483647 27 }, 28 "distributedNotificationEnabled": { 29 "description": "Describes whether the application has distributed notifications.", 30 "type": "boolean", 31 "deprecationMessage": "Deprecated since api 9.", 32 "default": false 33 }, 34 "keepAlive": { 35 "description": "Specifies whether the application will keep alive. This attribute takes effect only when the system application or privilege application is used.@deprecated", 36 "type": "boolean", 37 "deprecationMessage": "Deprecated since api 9.", 38 "default": false 39 }, 40 "removable": { 41 "description": "Describes the application can remove or not. This attribute takes effect only when the system application or privilege application is used.@deprecated", 42 "type": "boolean", 43 "deprecationMessage": "Deprecated since api 9.", 44 "default": true 45 }, 46 "singleton": { 47 "description": "Describes whether the application is singleton mode. This attribute takes effect only when the system application or privilege application is used.@deprecated", 48 "type": "boolean", 49 "deprecationMessage": "Deprecated since api 9.", 50 "default": false 51 }, 52 "userDataClearable": { 53 "description": "Describes whether to allow the application to clear user data. This attribute takes effect only when the system application or privilege application is used.@deprecated", 54 "type": "boolean", 55 "deprecationMessage": "Deprecated since api 9.", 56 "default": true 57 }, 58 "accessible": { 59 "description": "Describes whether to visit the application install catalogue. This attribute takes effect only when the system application or privilege application is used. And the aplpication must be a stage module", 60 "type": "boolean", 61 "default": false 62 } 63 } 64 } 65 }, 66 "required": [ 67 "app" 68 ], 69 "propertyNames": { 70 "enum": [ 71 "app" 72 ] 73 }, 74 "properties": { 75 "app": { 76 "description": "Indicates the global configuration of an application. Different .hap files of the same application must use the same app configuration.", 77 "type": "object", 78 "required": [ 79 "bundleName", 80 "icon", 81 "label", 82 "versionCode", 83 "versionName" 84 ], 85 "if": { 86 "properties": { 87 "bundleType": { 88 "const": "app" 89 } 90 } 91 }, 92 "then": { 93 "propertyNames": { 94 "enum": [ 95 "bundleName", 96 "debug", 97 "bundleType", 98 "icon", 99 "label", 100 "description", 101 "vendor", 102 "versionCode", 103 "versionName", 104 "minCompatibleVersionCode", 105 "minAPIVersion", 106 "targetAPIVersion", 107 "apiReleaseType", 108 "distributedNotificationEnabled", 109 "entityType", 110 "keepAlive", 111 "removable", 112 "singleton", 113 "userDataClearable", 114 "accessible", 115 "multiProjects", 116 "asanEnabled", 117 "default", 118 "tablet", 119 "tv", 120 "wearable", 121 "car", 122 "targetBundleName", 123 "targetPriority", 124 "generateBuildHash", 125 "2in1", 126 "GWPAsanEnabled", 127 "tsanEnabled", 128 "ubsanEnabled", 129 "appEnvironments", 130 "maxChildProcess", 131 "multiAppMode", 132 "hwasanEnabled", 133 "cloudFileSyncEnabled", 134 "configuration" 135 ] 136 } 137 }, 138 "else": { 139 "propertyNames": { 140 "enum": [ 141 "bundleName", 142 "debug", 143 "bundleType", 144 "icon", 145 "label", 146 "description", 147 "vendor", 148 "versionCode", 149 "versionName", 150 "minCompatibleVersionCode", 151 "minAPIVersion", 152 "targetAPIVersion", 153 "apiReleaseType", 154 "distributedNotificationEnabled", 155 "entityType", 156 "keepAlive", 157 "removable", 158 "singleton", 159 "userDataClearable", 160 "accessible", 161 "multiProjects", 162 "asanEnabled", 163 "default", 164 "tablet", 165 "tv", 166 "wearable", 167 "car", 168 "targetBundleName", 169 "targetPriority", 170 "generateBuildHash", 171 "2in1", 172 "GWPAsanEnabled", 173 "tsanEnabled", 174 "ubsanEnabled", 175 "appEnvironments", 176 "maxChildProcess", 177 "hwasanEnabled", 178 "cloudFileSyncEnabled", 179 "configuration" 180 ] 181 } 182 }, 183 "properties": { 184 "bundleName": { 185 "description": "Indicates the bundle name of the application. It uniquely identifies the application. The value is a string with 7 to 128 bytes of a reverse domain name, for example, com.huawei.himusic. It is recommended that the first label of this attribute is the top-level domain com, the second label is the vendor or individual name, and the third label is the application name. This label is a string type and cannot be defaulted.", 186 "type": "string", 187 "maxLength": 128, 188 "minLength": 7, 189 "pattern": "^[a-zA-Z][0-9a-zA-Z_.]+$" 190 }, 191 "bundleType": { 192 "description": "Indicates the type of bundle", 193 "type":"string", 194 "enum": [ 195 "app", 196 "atomicService", 197 "shared", 198 "appService" 199 ] 200 }, 201 "debug": { 202 "description": "Identify whether the application can be debugged.", 203 "type": "boolean", 204 "default": false 205 }, 206 "label": { 207 "description": "Indicates the label of the application.", 208 "type": "string", 209 "maxLength": 63, 210 "pattern": "^[$]string:[0-9a-zA-Z_.]+|(?=.*[{])(?=.*[}])[0-9a-zA-Z_.{}]+$" 211 }, 212 "icon": { 213 "description": "Indicates the index to the application icon file, in the format of \"$media:application_icon\".This label can be left blank by default.", 214 "type": "string", 215 "pattern": "^[$]media:[0-9a-zA-Z_.]+|(?=.*[{])(?=.*[}])[0-9a-zA-Z_.{}]$" 216 }, 217 "description": { 218 "description": "Describes the application", 219 "type": "string", 220 "maxLength": 255 221 }, 222 "vendor": { 223 "description": "Describes the application vendor.", 224 "type": "string", 225 "maxLength": 255 226 }, 227 "versionCode": { 228 "description": "Indicates the versionCode number of the application. The value is an integer greater than 0. A larger value generally represents a later version.The system determines the application version based on the tag value.This label cannot be left blank.", 229 "type": "integer", 230 "minimum": 0, 231 "maximum": 2147483647 232 }, 233 "versionName": { 234 "description": "Indicates the text description of the application version.Used for displaying to users.A string can contain a maximum of 127 bytes.This label cannot be left blank.", 235 "type": "string", 236 "maxLength": 127, 237 "pattern": "^[0-9.]+|(?=.*[{])(?=.*[}])[0-9a-zA-Z_.{}]+$" 238 }, 239 "minCompatibleVersionCode": { 240 "description": "Indicates the lowest compatible historical version number, used for cross-device compatibility judgment", 241 "type": "integer", 242 "minimum": 0, 243 "maximum": 2147483647 244 }, 245 "minAPIVersion": { 246 "description": "Indicates the minimum API version required for running an application.", 247 "type": "integer", 248 "minimum": 0, 249 "maximum": 2147483647 250 }, 251 "targetAPIVersion": { 252 "description": "This tag identifies the target API version required for application running. The value is an integer.", 253 "type": "integer", 254 "minimum": 0, 255 "maximum": 2147483647 256 }, 257 "apiReleaseType": { 258 "description": "This tag identifies the type of the target API version required for application running. The tag is a string.", 259 "type": "string", 260 "pattern": "^(Canary[1-9]\\d*)|(Beta[1-9]\\d*)|(Release[1-9]\\d*)$" 261 }, 262 "distributedNotificationEnabled": { 263 "description": "Describes whether the application has distributed notifications.", 264 "type": "boolean", 265 "deprecationMessage": "Deprecated since api 9.", 266 "default": false 267 }, 268 "entityType": { 269 "description": "Describes the application type.", 270 "type": "string", 271 "deprecationMessage": "Deprecated since api 9.", 272 "enum": [ 273 "game", 274 "media", 275 "communication", 276 "news", 277 "travel", 278 "utility", 279 "shopping", 280 "education", 281 "kids", 282 "business", 283 "photography", 284 "unspecified" 285 ], 286 "default": "unspecified" 287 }, 288 "keepAlive": { 289 "description": "Specifies whether the application will keep alive. This attribute takes effect only when the system application or privilege application is used.@deprecated", 290 "type": "boolean", 291 "deprecationMessage": "Deprecated since api 9.", 292 "default": false 293 }, 294 "removable": { 295 "description": "Describes the application can remove or not. This attribute takes effect only when the system application or privilege application is used.@deprecated", 296 "type": "boolean", 297 "deprecationMessage": "Deprecated since api 9.", 298 "default": true 299 }, 300 "singleton": { 301 "description": "Describes whether the application is singleton mode. This attribute takes effect only when the system application or privilege application is used.@deprecated", 302 "type": "boolean", 303 "deprecationMessage": "Deprecated since api 9.", 304 "default": false 305 }, 306 "userDataClearable": { 307 "description": "Describes whether to allow the application to clear user data. This attribute takes effect only when the system application or privilege application is used.@deprecated", 308 "type": "boolean", 309 "deprecationMessage": "Deprecated since api 9.", 310 "default": true 311 }, 312 "accessible": { 313 "description": "Describes whether to visit the application install catalogue. This attribute takes effect only when the system application or privilege application is used. And the aplpication must be a stage module", 314 "type": "boolean", 315 "default": false 316 }, 317 "multiProjects": { 318 "description": "Indicates whether current project supports multiple project.", 319 "type": "boolean", 320 "default": false 321 }, 322 "asanEnabled": { 323 "description": "Indicates whether to support asan.", 324 "type": "boolean", 325 "default": false 326 }, 327 "default": { 328 "$ref": "#/definitions/default" 329 }, 330 "tablet": { 331 "$ref": "#/definitions/default" 332 }, 333 "tv": { 334 "$ref": "#/definitions/default" 335 }, 336 "wearable": { 337 "$ref": "#/definitions/default" 338 }, 339 "car": { 340 "$ref": "#/definitions/default" 341 }, 342 "2in1": { 343 "$ref": "#/definitions/default" 344 }, 345 "targetBundleName": { 346 "description": "Indicates the target bundle name of an overlay application. It uniquely identifies the application. The value is a string with 7 to 128 bytes of a reverse domain name, for example, com.huawei.himusic. It is recommended that the first label of this attribute is the top-level domain com, the second label is the vendor or individual name, and the third label is the application name. This label is a string type and cannot be defaulted.", 347 "type": "string", 348 "maxLength": 128, 349 "minLength": 7, 350 "pattern": "^[a-zA-Z][0-9a-zA-Z_.]+$" 351 }, 352 "targetPriority": { 353 "description": "Indicates the priority of the overlay module. 1 to 100, default value is 1.", 354 "type": "integer", 355 "minimum": 1, 356 "maximum": 100 357 }, 358 "generateBuildHash": { 359 "description": "Indicates whether the hash value of hap or hsp is filed with in module.json.", 360 "type": "boolean", 361 "default": false 362 }, 363 "GWPAsanEnabled": { 364 "description": "Indicates whether to support GWP asan.", 365 "type": "boolean", 366 "default": false 367 }, 368 "tsanEnabled": { 369 "description": "Indicates whether to support tsan.", 370 "type": "boolean", 371 "default": false 372 }, 373 "ubsanEnabled": { 374 "description": "Indicates whether to support ubsan.", 375 "type": "boolean", 376 "default": false 377 }, 378 "appEnvironments": { 379 "description": "Indicates the environment value of app.", 380 "type": "array", 381 "items": { 382 "type": "object", 383 "propertyNames": { 384 "enum": [ 385 "name", 386 "value" 387 ] 388 }, 389 "properties": { 390 "name": { 391 "description": "Indicates the key of a environment element. The value is a string with a maximum of 4096 bytes.", 392 "type": "string", 393 "maxLength": 4096 394 }, 395 "value": { 396 "description": "Indicates the value of a environment element. The value is a string with a maximum of 4096 bytes.", 397 "type": "string", 398 "maxLength": 4096 399 } 400 } 401 } 402 }, 403 "maxChildProcess": { 404 "description": "Indicates the max number of child process that can be created. 0 to 512.", 405 "type": "integer", 406 "minimum": 0, 407 "maximum": 512 408 }, 409 "multiAppMode": { 410 "description": "Indicates the application multiple open mode.", 411 "type": "object", 412 "propertyNames": { 413 "enum": [ 414 "multiAppModeType", 415 "maxCount" 416 ] 417 }, 418 "required": [ 419 "multiAppModeType", 420 "maxCount" 421 ], 422 "properties": { 423 "multiAppModeType": { 424 "description": "Indicates the type of application multiple open mode.", 425 "type": "string", 426 "enum": [ 427 "multiInstance", 428 "appClone" 429 ] 430 } 431 }, 432 "if": { 433 "properties": { 434 "multiAppModeType": { 435 "const": "multiInstance" 436 } 437 } 438 }, 439 "then": { 440 "properties": { 441 "maxCount": { 442 "description": "Indicates the max count of multiple open application.", 443 "type": "integer", 444 "minimum": 1, 445 "maximum": 10 446 } 447 } 448 }, 449 "else": { 450 "properties": { 451 "maxCount": { 452 "description": "Indicates the max count of multiple open application.", 453 "type": "integer", 454 "minimum": 1, 455 "maximum": 5 456 } 457 } 458 } 459 }, 460 "hwasanEnabled": { 461 "description": "Indicates whether to support hwasan.", 462 "type": "boolean", 463 "default": false 464 }, 465 "cloudFileSyncEnabled": { 466 "description": "Indicates whether the application enables cloud file sync.", 467 "type": "boolean", 468 "default": false 469 }, 470 "configuration": { 471 "description": "Indicates the configuration of the application, in the format of \"$profile:configuration\".This configuration can be left blank by default.", 472 "type": "string", 473 "pattern": "^[$]profile:[0-9a-zA-Z_.]+$", 474 "maxLength": 255 475 } 476 } 477 } 478 } 479} 480 481