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 "default": false 38 }, 39 "removable": { 40 "description": "Describes the application can remove or not. This attribute takes effect only when the system application or privilege application is used.@deprecated", 41 "type": "boolean", 42 "default": true 43 }, 44 "singleton": { 45 "description": "Describes whether the application is singleton mode. This attribute takes effect only when the system application or privilege application is used.@deprecated", 46 "type": "boolean", 47 "default": false 48 }, 49 "userDataClearable": { 50 "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", 51 "type": "boolean", 52 "default": true 53 }, 54 "accessible": { 55 "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", 56 "type": "boolean", 57 "default": false 58 } 59 } 60 } 61 }, 62 "required": [ 63 "app" 64 ], 65 "propertyNames": { 66 "enum": [ 67 "app" 68 ] 69 }, 70 "properties": { 71 "app": { 72 "description": "Indicates the global configuration of an application. Different .hap files of the same application must use the same app configuration.", 73 "type": "object", 74 "required": [ 75 "bundleName", 76 "icon", 77 "label", 78 "versionCode", 79 "versionName" 80 ], 81 "propertyNames": { 82 "enum": [ 83 "bundleName", 84 "debug", 85 "bundleType", 86 "icon", 87 "label", 88 "description", 89 "vendor", 90 "versionCode", 91 "versionName", 92 "minCompatibleVersionCode", 93 "minAPIVersion", 94 "targetAPIVersion", 95 "apiReleaseType", 96 "distributedNotificationEnabled", 97 "entityType", 98 "keepAlive", 99 "removable", 100 "singleton", 101 "userDataClearable", 102 "accessible", 103 "multiProjects", 104 "asanEnabled", 105 "default", 106 "tablet", 107 "tv", 108 "wearable", 109 "car", 110 "targetBundleName", 111 "targetPriority", 112 "generateBuildHash", 113 "2in1" 114 ] 115 }, 116 "properties": { 117 "bundleName": { 118 "description": "Indicates the bundle name of the application. It uniquely identifies the application. The value is a string with 7 to 127 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.", 119 "type": "string", 120 "maxLength": 127, 121 "minLength": 7, 122 "pattern": "^[a-zA-Z][0-9a-zA-Z_.]+$" 123 }, 124 "bundleType": { 125 "description": "Indicates the type of bundle", 126 "type":"string", 127 "enum": [ 128 "app", 129 "atomicService", 130 "shared" 131 ] 132 }, 133 "debug": { 134 "description": "Identify whether the application can be debugged.", 135 "type": "boolean", 136 "default": false 137 }, 138 "label": { 139 "description": "Indicates the label of the application.", 140 "type": "string", 141 "maxLength": 63, 142 "pattern": "^[$]string:[0-9a-zA-Z_.]+|(?=.*[{])(?=.*[}])[0-9a-zA-Z_.{}]+$" 143 }, 144 "icon": { 145 "description": "Indicates the index to the application icon file, in the format of \"$media:application_icon\".This label can be left blank by default.", 146 "type": "string", 147 "pattern": "^[$]media:[0-9a-zA-Z_.]+|(?=.*[{])(?=.*[}])[0-9a-zA-Z_.{}]$" 148 }, 149 "description": { 150 "description": "Describes the application", 151 "type": "string", 152 "maxLength": 255 153 }, 154 "vendor": { 155 "description": "Describes the application vendor.", 156 "type": "string", 157 "maxLength": 255 158 }, 159 "versionCode": { 160 "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.", 161 "type": "integer", 162 "minimum": 0, 163 "maximum": 2147483647 164 }, 165 "versionName": { 166 "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.", 167 "type": "string", 168 "maxLength": 127, 169 "pattern": "^[0-9.]+|(?=.*[{])(?=.*[}])[0-9a-zA-Z_.{}]+$" 170 }, 171 "minCompatibleVersionCode": { 172 "description": "Indicates the lowest compatible historical version number, used for cross-device compatibility judgment", 173 "type": "integer", 174 "minimum": 0, 175 "maximum": 2147483647 176 }, 177 "minAPIVersion": { 178 "description": "Indicates the minimum API version required for running an application.", 179 "type": "integer", 180 "minimum": 0, 181 "maximum": 2147483647 182 }, 183 "targetAPIVersion": { 184 "description": "This tag identifies the target API version required for application running. The value is an integer.", 185 "type": "integer", 186 "minimum": 0, 187 "maximum": 2147483647 188 }, 189 "apiReleaseType": { 190 "description": "This tag identifies the type of the target API version required for application running. The tag is a string.", 191 "type": "string", 192 "pattern": "^(Canary[1-9]d*)|(Beta[1-9]d*)|(Release[1-9]d*)$" 193 }, 194 "distributedNotificationEnabled": { 195 "description": "Describes whether the application has distributed notifications.", 196 "type": "boolean", 197 "deprecationMessage": "Deprecated since api 9.", 198 "default": false 199 }, 200 "entityType": { 201 "description": "Describes the application type.", 202 "type": "string", 203 "deprecationMessage": "Deprecated since api 9.", 204 "enum": [ 205 "game", 206 "media", 207 "communication", 208 "news", 209 "travel", 210 "utility", 211 "shopping", 212 "education", 213 "kids", 214 "business", 215 "photography", 216 "unspecified" 217 ], 218 "default": "unspecified" 219 }, 220 "keepAlive": { 221 "description": "Specifies whether the application will keep alive. This attribute takes effect only when the system application or privilege application is used.@deprecated", 222 "type": "boolean", 223 "default": false 224 }, 225 "removable": { 226 "description": "Describes the application can remove or not. This attribute takes effect only when the system application or privilege application is used.@deprecated", 227 "type": "boolean", 228 "default": true 229 }, 230 "singleton": { 231 "description": "Describes whether the application is singleton mode. This attribute takes effect only when the system application or privilege application is used.@deprecated", 232 "type": "boolean", 233 "default": false 234 }, 235 "userDataClearable": { 236 "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", 237 "type": "boolean", 238 "default": true 239 }, 240 "accessible": { 241 "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", 242 "type": "boolean", 243 "default": false 244 }, 245 "multiProjects": { 246 "description": "Indicates whether current project supports multiple project.", 247 "type": "boolean", 248 "default": false 249 }, 250 "asanEnabled": { 251 "description": "Indicates whether to support asan. Release version is not configurable", 252 "type": "boolean", 253 "default": false 254 }, 255 "default": { 256 "$ref": "#/definitions/default" 257 }, 258 "tablet": { 259 "$ref": "#/definitions/default" 260 }, 261 "tv": { 262 "$ref": "#/definitions/default" 263 }, 264 "wearable": { 265 "$ref": "#/definitions/default" 266 }, 267 "car": { 268 "$ref": "#/definitions/default" 269 }, 270 "2in1": { 271 "$ref": "#/definitions/default" 272 }, 273 "targetBundleName": { 274 "description": "Indicates the target bundle name of an overlay application. It uniquely identifies the application. The value is a string with 7 to 127 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.", 275 "type": "string", 276 "maxLength": 127, 277 "minLength": 7, 278 "pattern": "^[a-zA-Z][0-9a-zA-Z_.]+$" 279 }, 280 "targetPriority": { 281 "description": "Indicates the priority of the overlay module. 1 to 100, default value is 1.", 282 "type": "integer", 283 "minimum": 1, 284 "maximum": 100 285 }, 286 "generateBuildHash": { 287 "description": "Indicates whether the hash value of hap or hsp is filed with in module.json.", 288 "type": "boolean", 289 "default": false 290 } 291 } 292 } 293 } 294} 295 296