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 "cloudStructuredDataSyncEnabled", 135 "configuration", 136 "assetAccessGroups", 137 "startMode", 138 "appPreloadPhase" 139 ] 140 } 141 }, 142 "else": { 143 "propertyNames": { 144 "enum": [ 145 "bundleName", 146 "debug", 147 "bundleType", 148 "icon", 149 "label", 150 "description", 151 "vendor", 152 "versionCode", 153 "versionName", 154 "minCompatibleVersionCode", 155 "minAPIVersion", 156 "targetAPIVersion", 157 "apiReleaseType", 158 "distributedNotificationEnabled", 159 "entityType", 160 "keepAlive", 161 "removable", 162 "singleton", 163 "userDataClearable", 164 "accessible", 165 "multiProjects", 166 "asanEnabled", 167 "default", 168 "tablet", 169 "tv", 170 "wearable", 171 "car", 172 "targetBundleName", 173 "targetPriority", 174 "generateBuildHash", 175 "2in1", 176 "GWPAsanEnabled", 177 "tsanEnabled", 178 "ubsanEnabled", 179 "appEnvironments", 180 "maxChildProcess", 181 "hwasanEnabled", 182 "cloudFileSyncEnabled", 183 "cloudStructuredDataSyncEnabled", 184 "configuration", 185 "assetAccessGroups", 186 "startMode" 187 ] 188 } 189 }, 190 "properties": { 191 "bundleName": { 192 "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.", 193 "type": "string", 194 "maxLength": 128, 195 "minLength": 7, 196 "pattern": "^(?:[a-zA-Z](?:\\w*[0-9a-zA-Z])?)(?:\\.[0-9a-zA-Z](?:\\w*[0-9a-zA-Z])?){2,}$" 197 }, 198 "bundleType": { 199 "description": "Indicates the type of bundle", 200 "type": "string", 201 "enum": [ 202 "app", 203 "atomicService", 204 "shared", 205 "appService", 206 "appPlugin" 207 ] 208 }, 209 "debug": { 210 "description": "Identify whether the application can be debugged.", 211 "type": "boolean", 212 "default": false 213 }, 214 "label": { 215 "description": "Indicates the label of the application.", 216 "type": "string", 217 "maxLength": 63, 218 "pattern": "^[$]string:[0-9a-zA-Z_.]+|(?=.*[{])(?=.*[}])[0-9a-zA-Z_.{}]+$" 219 }, 220 "icon": { 221 "description": "Indicates the index to the application icon file, in the format of \"$media:application_icon\".This label can be left blank by default.", 222 "type": "string", 223 "pattern": "^[$]media:[0-9a-zA-Z_.]+|(?=.*[{])(?=.*[}])[0-9a-zA-Z_.{}]$" 224 }, 225 "description": { 226 "description": "Describes the application", 227 "type": "string", 228 "maxLength": 255 229 }, 230 "vendor": { 231 "description": "Describes the application vendor.", 232 "type": "string", 233 "maxLength": 255 234 }, 235 "versionCode": { 236 "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.", 237 "type": "integer", 238 "minimum": 0, 239 "maximum": 2147483647 240 }, 241 "versionName": { 242 "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.", 243 "type": "string", 244 "maxLength": 127, 245 "pattern": "^[0-9.]+|(?=.*[{])(?=.*[}])[0-9a-zA-Z_.{}]+$" 246 }, 247 "minCompatibleVersionCode": { 248 "description": "Indicates the lowest compatible historical version number, used for cross-device compatibility judgment", 249 "type": "integer", 250 "minimum": 0, 251 "maximum": 2147483647 252 }, 253 "minAPIVersion": { 254 "description": "Indicates the minimum API version required for running an application.", 255 "type": "integer", 256 "minimum": 0, 257 "maximum": 2147483647 258 }, 259 "targetAPIVersion": { 260 "description": "This tag identifies the target API version required for application running. The value is an integer.", 261 "type": "integer", 262 "minimum": 0, 263 "maximum": 2147483647 264 }, 265 "apiReleaseType": { 266 "description": "This tag identifies the type of the target API version required for application running. The tag is a string.", 267 "type": "string", 268 "pattern": "^(Canary[1-9]\\d*)|(Beta[1-9]\\d*)|(Release[1-9]\\d*)$" 269 }, 270 "distributedNotificationEnabled": { 271 "description": "Describes whether the application has distributed notifications.", 272 "type": "boolean", 273 "deprecationMessage": "Deprecated since api 9.", 274 "default": false 275 }, 276 "entityType": { 277 "description": "Describes the application type.", 278 "type": "string", 279 "deprecationMessage": "Deprecated since api 9.", 280 "enum": [ 281 "game", 282 "media", 283 "communication", 284 "news", 285 "travel", 286 "utility", 287 "shopping", 288 "education", 289 "kids", 290 "business", 291 "photography", 292 "unspecified" 293 ], 294 "default": "unspecified" 295 }, 296 "keepAlive": { 297 "description": "Specifies whether the application will keep alive. This attribute takes effect only when the system application or privilege application is used.@deprecated", 298 "type": "boolean", 299 "deprecationMessage": "Deprecated since api 9.", 300 "default": false 301 }, 302 "removable": { 303 "description": "Describes the application can remove or not. This attribute takes effect only when the system application or privilege application is used.@deprecated", 304 "type": "boolean", 305 "deprecationMessage": "Deprecated since api 9.", 306 "default": true 307 }, 308 "singleton": { 309 "description": "Describes whether the application is singleton mode. This attribute takes effect only when the system application or privilege application is used.@deprecated", 310 "type": "boolean", 311 "deprecationMessage": "Deprecated since api 9.", 312 "default": false 313 }, 314 "userDataClearable": { 315 "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", 316 "type": "boolean", 317 "deprecationMessage": "Deprecated since api 9.", 318 "default": true 319 }, 320 "accessible": { 321 "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", 322 "type": "boolean", 323 "default": false 324 }, 325 "multiProjects": { 326 "description": "Indicates whether current project supports multiple project.", 327 "type": "boolean", 328 "default": false 329 }, 330 "asanEnabled": { 331 "description": "Indicates whether to support asan.", 332 "type": "boolean", 333 "default": false 334 }, 335 "default": { 336 "$ref": "#/definitions/default" 337 }, 338 "tablet": { 339 "$ref": "#/definitions/default" 340 }, 341 "tv": { 342 "$ref": "#/definitions/default" 343 }, 344 "wearable": { 345 "$ref": "#/definitions/default" 346 }, 347 "car": { 348 "$ref": "#/definitions/default" 349 }, 350 "2in1": { 351 "$ref": "#/definitions/default" 352 }, 353 "targetBundleName": { 354 "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.", 355 "type": "string", 356 "maxLength": 128, 357 "minLength": 7, 358 "pattern": "^(?:[a-zA-Z](?:\\w*[0-9a-zA-Z])?)(?:\\.[0-9a-zA-Z](?:\\w*[0-9a-zA-Z])?){2,}$" 359 }, 360 "targetPriority": { 361 "description": "Indicates the priority of the overlay module. 1 to 100, default value is 1.", 362 "type": "integer", 363 "minimum": 1, 364 "maximum": 100 365 }, 366 "generateBuildHash": { 367 "description": "Indicates whether the hash value of hap or hsp is filed with in module.json.", 368 "type": "boolean", 369 "default": false 370 }, 371 "GWPAsanEnabled": { 372 "description": "Indicates whether to support GWP asan.", 373 "type": "boolean", 374 "default": false 375 }, 376 "tsanEnabled": { 377 "description": "Indicates whether to support tsan.", 378 "type": "boolean", 379 "default": false 380 }, 381 "ubsanEnabled": { 382 "description": "Indicates whether to support ubsan.", 383 "type": "boolean", 384 "default": false 385 }, 386 "appEnvironments": { 387 "description": "Indicates the environment value of app.", 388 "type": "array", 389 "items": { 390 "type": "object", 391 "propertyNames": { 392 "enum": [ 393 "name", 394 "value" 395 ] 396 }, 397 "properties": { 398 "name": { 399 "description": "Indicates the key of a environment element. The value is a string with a maximum of 4096 bytes.", 400 "type": "string", 401 "maxLength": 4096 402 }, 403 "value": { 404 "description": "Indicates the value of a environment element. The value is a string with a maximum of 4096 bytes.", 405 "type": "string", 406 "maxLength": 4096 407 } 408 } 409 } 410 }, 411 "maxChildProcess": { 412 "description": "Indicates the max number of child process that can be created. 0 to 512.", 413 "type": "integer", 414 "minimum": 0, 415 "maximum": 512 416 }, 417 "multiAppMode": { 418 "description": "Indicates the application multiple open mode.", 419 "type": "object", 420 "propertyNames": { 421 "enum": [ 422 "multiAppModeType", 423 "maxCount" 424 ] 425 }, 426 "required": [ 427 "multiAppModeType", 428 "maxCount" 429 ], 430 "properties": { 431 "multiAppModeType": { 432 "description": "Indicates the type of application multiple open mode.", 433 "type": "string", 434 "enum": [ 435 "multiInstance", 436 "appClone" 437 ] 438 } 439 }, 440 "if": { 441 "properties": { 442 "multiAppModeType": { 443 "const": "multiInstance" 444 } 445 } 446 }, 447 "then": { 448 "properties": { 449 "maxCount": { 450 "description": "Indicates the max count of multiple open application.", 451 "type": "integer", 452 "minimum": 1, 453 "maximum": 10 454 } 455 } 456 }, 457 "else": { 458 "properties": { 459 "maxCount": { 460 "description": "Indicates the max count of multiple open application.", 461 "type": "integer", 462 "minimum": 1, 463 "maximum": 5 464 } 465 } 466 } 467 }, 468 "hwasanEnabled": { 469 "description": "Indicates whether to support hwasan.", 470 "type": "boolean", 471 "default": false 472 }, 473 "cloudFileSyncEnabled": { 474 "description": "Indicates whether the application enables cloud file sync.", 475 "type": "boolean", 476 "default": false 477 }, 478 "cloudStructuredDataSyncEnabled": { 479 "description": "Indicates whether the application enables cloud structured data sync.", 480 "type": "boolean", 481 "default": false 482 }, 483 "configuration": { 484 "description": "Indicates the configuration of the application, in the format of \"$profile:configuration\".This configuration can be left blank by default.", 485 "type": "string", 486 "pattern": "^[$]profile:[0-9a-zA-Z_.]+$", 487 "maxLength": 255 488 }, 489 "assetAccessGroups": { 490 "description": "Indicates the asset access groups of the application.", 491 "type": "array", 492 "maxItems": 512, 493 "uniqueItems": true, 494 "items": { 495 "type": "string", 496 "maxLength": 127, 497 "minLength": 7, 498 "pattern": "^[a-zA-Z][0-9a-zA-Z_.]+$" 499 } 500 }, 501 "startMode": { 502 "description": "Describes the application start mode.", 503 "type": "string", 504 "enum": [ 505 "mainTask", 506 "recentTask" 507 ], 508 "default": "mainTask" 509 }, 510 "appPreloadPhase": { 511 "description": "Indicates the app preload phase for the application. if not configured, the app will not be preload.", 512 "type": "string", 513 "enum": [ 514 "processCreated", 515 "abilityStageCreated", 516 "windowStageCreated" 517 ] 518 } 519 } 520 } 521 } 522} 523