1# Internal Structure of the module Tag 2 3 4The **module** tag contains the HAP configuration. 5 6 **Table 1** Internal structure of the module tag 7 8| Name| Description| Data Type| Initial Value Allowed| 9| -------- | -------- | -------- | -------- | 10| mainAbility | Ability whose icon is displayed in the Service Center. When the resident process is started, the **mainAbility** is started.| String| Yes (initial value: left empty)| 11| package | Package name of the HAP file, which must be unique in the application. The value is a string with a maximum of 127 bytes, in the reverse domain name notation. It is recommended that the value be the same as the project directory of the HAP file. | String| No| 12| name | Class name of the HAP file. The value is a string with a maximum of 255 bytes, in the reverse domain name notation. The prefix must be the same as the **package** value specified for this module. Alternatively, the value can start with a period (.) followed by the class name.| String| Yes (initial value: left empty)| 13| description | Description of the HAP file. The value is a string with a maximum of 255 bytes. If the value exceeds the limit or needs to support multiple languages, you can use a resource index to the description.| String| Yes (initial value: left empty)| 14| supportedModes | Modes supported by the application. Currently, only the **drive** mode is defined. This attribute applies only to head units.| String array| Yes (initial value: left empty)| 15|deviceType | Type of device on which the ability can run. The device types predefined in the system include **tablet**, **tv**, **car**, and **wearable**.| String array| No| 16|distro | Distribution description of the HAP file.| Object| No| 17|metaData | Metadata of the HAP file.| Object| Yes (initial value: left empty)| 18| abilities | All abilities in the current module. The value is an array of objects, each of which represents an ability.| Object array| Yes (initial value: left empty)| 19| js | A set of JS modules developed using ArkUI. The value is an array of objects, each of which represents a JS module.| Object array| Yes (initial value: left empty)| 20| shortcuts | Shortcuts of the application. The value is an array of objects, each of which represents a shortcut object.| Object array| Yes (initial value: left empty)| 21| reqPermissions | Permissions that the application requests from the system when it is running.| Object array| Yes (initial value: left empty)| 22| colorMode | Color mode of the application. The options are as follows:<br>- **dark**: Resources applicable for the dark mode are used.<br>- **light**: Resources applicable for the light mode are used.<br>- **auto**: Resources are used based on the color mode of the system.| String| Yes (initial value: **auto**)| 23| distributionFilter | Distribution rules of the application. This attribute defines the rules for distributing HAP files based on different device specifications, so that precise matching can be performed when the application market distributes applications. Distribution rules cover three factors: API version, screen shape, and screen resolution. During distribution, a unique HAP is determined based on the mapping between **deviceType** and these three factors.| Object| Yes (initial value: left empty) Set this attribute when an application has multiple entry modules.| 24|commonEvents | Information about the common event static subscriber, which must contain the subscriber name, required permissions, and list of the common events subscribed to. When a subscribed event is sent, the static subscriber is started. Unlike the dynamic subscriber, the static subscriber does not need to proactively call the common event subscription API in the service code, and may not be running when the common event is published.| Object array| Yes (initial value: left empty)| 25| entryTheme | Keyword of an OpenHarmony internal theme. Set it to the resource index of the name.| String| Yes (initial value: left empty)| 26|testRunner | Test runner configuration.| Object| Yes (initial value: left empty)| 27 28Example of the **module** tag structure: 29 30```json 31{ 32 "module": { 33 "mainAbility": ".EntryAbility", 34 "deviceType": [ 35 "default", 36 "tablet" 37 ], 38 "abilities": [ 39 { 40 "skills": [ 41 { 42 "entities": [ 43 "entity.system.home" 44 ], 45 "actions": [ 46 "action.system.home" 47 ] 48 } 49 ], 50 "orientation": "unspecified", 51 "visible": true, 52 "srcPath": "EntryAbility", 53 "name": ".EntryAbility", 54 "srcLanguage": "ets", 55 "icon": "$media:icon", 56 "description": "$string:MainAbility_desc", 57 "formsEnabled": false, 58 "label": "$string:MainAbility_label", 59 "type": "page", 60 "launchType": "standard" 61 } 62 ], 63 "distro": { 64 "moduleType": "entry", 65 "installationFree": false, 66 "deliveryWithInstall": true, 67 "moduleName": "entry" 68 }, 69 "package": "com.example.entry", 70 "srcPath": "", 71 "name": ".entry", 72 "js": [ 73 { 74 "mode": { 75 "syntax": "ets", 76 "type": "pageAbility" 77 }, 78 "pages": [ 79 "pages/Index" 80 ], 81 "name": ".EntryAbility", 82 "window": { 83 "designWidth": 720, 84 "autoDesignWidth": false 85 } 86 } 87 ] 88 } 89} 90``` 91 92## Internal Structure of the distro Attribute 93 94**Table 2** Internal structure of the distro attribute 95 96| Name| Description| Data Type| Initial Value Allowed| 97| -------- | -------- | -------- | -------- | 98| moduleName | Name of the HAP file. The maximum length is 31 bytes.| String| No| 99| moduleType | Type of the HAP file, which can **entry**, **feature**, or **har**.| String| No| 100| installationFree | Whether the HAP file supports the installation-free feature. **true**: The HAP file supports the installation-free feature and meets installation-free constraints. **false**: The HAP file does not support the installation-free feature. If this tag is set to **true** for an entry-type HAP file (**entry.hap**), it must also be set to **true** for feature-type HAP files (**feature.hap**) of the same application. If this tag is set to **false** for an entry-type HAP file, it can be set to **true** or **false** for feature-type modules of the same application based on service requirements.| Boolean| No| 101| deliveryWithInstall | Whether the HAP file will be installed when the user installs the application. **true**: The HAP file will be installed when the user installs the application. **false**: The HAP file will not be installed when the user installs the application.| Boolean| No| 102 103 104Example of the **distro** attribute structure: 105 106```json 107"distro": { 108 "moduleName": "ohos_entry", 109 "moduleType": "entry", 110 "installationFree": true, 111 "deliveryWithInstall": true 112} 113``` 114 115## Internal Structure of the metadata Attribute 116 117**Table 3** Internal structure of the metadata attribute 118 119| Name| Description| Data Type| Initial Value Allowed| 120| -------- | -------- | -------- | -------- | 121| parameters | Metadata of the parameters to be passed for calling the ability. The metadata of each parameter consists of the **description**, **name**, and **type** sub-attributes.| Object array| Yes (initial value: left empty)| 122| results | Metadata of the ability return value. The metadata of each return value consists of the **description**, **name**, and **type** sub-attributes.| Object array| Yes (initial value: left empty)| 123| customizeData | Custom metadata of the parent component. **parameters** and **results** cannot be configured in **application**.| Object array| Yes (initial value: left empty)| 124 125## Internal Structure of the parameters Attribute 126 127**Table 4** Internal structure of the parameters attribute 128 129| Name| Description| Data Type| Initial Value Allowed| 130| -------- | -------- | -------- | -------- | 131| description | Description of the parameter. The value can be a string or a resource index to descriptions in multiple languages. The value can contain a maximum of 255 characters.| String| Yes (initial value: left empty)| 132| name | Name of the parameter passed for calling the ability. The value can contain a maximum of 255 bytes.| String| No| 133| type | Type of the parameter passed for calling the ability, for example, **Integer**.| String| No| 134 135## Internal Structure of the results Attribute 136 137**Table 5** Internal structure of the results attribute 138 139| Name| Description| Data Type| Initial Value Allowed| 140| -------- | -------- | -------- | -------- | 141| description | Description of the return value. The value can be a string or a resource index to descriptions in multiple languages. The value can contain a maximum of 255 characters.| String| Yes (initial value: left empty)| 142| name | Name of the return value. The value can contain a maximum of 255 characters.| String| Yes (initial value: left empty)| 143| type | Type of the return value, for example, **Integer**.| String| No| 144 145## Internal Structure of the customizeData Attribute 146 147**Table 6** Internal structure of the customizeData attribute 148 149| Name| Description| Data Type| Initial Value Allowed| 150| -------- | -------- | -------- | -------- | 151| name | Key of the data element. The value is a string with a maximum of 255 bytes.| String| Yes (initial value: left empty)| 152| value | Value of the data element. The value is a string with a maximum of 255 bytes.| String| Yes (initial value: left empty)| 153| extra | Custom format of the data element. The value is a resource index that identifies the data.| String| Yes (initial value: left empty)| 154 155 156Example of the metadata attribute: 157 158```json 159"metaData": { 160 "parameters" : [{ 161 "name" : "a test for metadata parameter", 162 "type" : "Float", 163 // "$string:parameters_description" is a file resource index. 164 "description" : "$string:parameters_description" 165 }], 166 "results" : [{ 167 "name" : "a test for metadata result", 168 "type" : "Float", 169 "description" : "$string:results_description" 170 }], 171 "customizeData" : [{ 172 "name" : "a customizeData", 173 "value" : "string", 174 "extra" : "$string:customizeData_description" 175 }] 176} 177``` 178 179## deviceType Attribute 180 181**Table 7** Values of the deviceType attribute 182 183| Device Type| Value| Description| 184| -------- | -------- | -------- | 185| Tablet| tablet | - | 186| Smart TV| tv | - | 187| Smart watch| wearable | Watch that provides call features.| 188| Head unit| car | - | 189| Default device| default | OpenHarmony device that provides full access to system capabilities.| 190 191## Internal Structure of the abilities Attribute 192 193**By default, application icons cannot be hidden from the home screen in OpenHarmony.** 194 195The OpenHarmony system imposes a strict rule on the presence of application icons. If no icon is configured in the HAP file of an application, the system creates a default icon for the application and displays it on the home screen. 196 197Touching this icon will direct the user to the application details screen in **Settings**, as shown in Figure 1. 198 199To hide an application icon from the home screen, you must configure the **AllowAppDesktopIconHide** privilege. For details, see [Application Privilege Configuration Guide](../../device-dev/subsystems/subsys-app-privilege-config-guide.md). 200 201**Objectives**: 202 203This requirement on application icons is intended to prevent malicious applications from deliberately configuring no icon to block uninstallation attempts. 204 205**Setting the application icon to be displayed on the home screen**: 206 207Set **icon**, **label**, and **skills** under **abilities** in the **config.json** file. In addition, make sure the **skills** configuration contains **ohos.want.action.home** and **entity.system.home**. 208 209``` 210{ 211 "module":{ 212 213 ... 214 215 "abilities": [{ 216 "icon": "$media:icon", 217 "label": "Login", 218 "skills": [{ 219 "actions": ["ohos.want.action.home"], 220 "entities": ["entity.system.home"], 221 "uris": [] 222 }] 223 }], 224 225 ... 226 227 } 228} 229``` 230 231**Display rules of application icons and labels on the home screen:** 232* The HAP file contains Page ability configuration. 233 * The application icon on the home screen is set under **abilities** in the **config.json** file. 234 * The application does not have the privilege to hide its icon from the home screen. 235 * The application icon displayed on the home screen is the icon configured for the Page ability. 236 * The application label displayed on the home screen is the label configured for the Page ability. If no label is configured, the bundle name is returned. 237 * The name of the Page ability is displayed. 238 * When the user touches the home screen icon, the home screen of the Page ability is displayed. 239 * The application has the privilege to hide its icon from the home screen. 240 * The information about the application is not returned during home screen information query, and the icon of the application is not displayed on the home screen. 241 * The application icon on the home screen is not set under **abilities** in the **config.json** file. 242 * The application does not have the privilege to hide its icon from the home screen. 243 * The application icon displayed on the home screen is the default icon. 244 * The application label displayed on the home screen is the bundle name of the application. 245 * Touching the application icon on the home screen will direct the user to the application details screen shown in Figure 1. 246 * The application has the privilege to hide its icon from the home screen. 247 * The information about the application is not returned during home screen information query, and the icon of the application is not displayed on the home screen. 248* The HAP file does not contain Page ability configuration. 249 * The application does not have the privilege to hide its icon from the home screen. 250 * The application icon displayed on the home screen is the default icon. 251 * The application label displayed on the home screen is the bundle name of the application. 252 * Touching the application icon on the home screen will direct the user to the application details screen shown in Figure 1. 253 * The application has the privilege to hide its icon from the home screen. 254 * The information about the application is not returned during home screen information query, and the icon of the application is not displayed on the home screen. 255 256Note: The label displayed on the application details screen may be different from that displayed on the home screen. For non-Page abilities, it is the entry label set (if any).<br><br> 257 258**Figure 1** Application details screen 259 260![Application details screen](figures/application_details.jpg) 261 262 263**Table 8** Internal structure of the abilities attribute 264 265| Name| Description| Data Type| Initial Value Allowed| 266| -------- | -------- | -------- | -------- | 267| process | Name of the process running the application or ability. If the **process** attribute is configured in the **deviceConfig** tag, all abilities of the application run in this process. You can set the **process** attribute for a specific ability in the **abilities** attribute, so that the ability can run in the particular process. If this attribute is set to the name of the process running other applications, all these applications can run in the same process, provided they have the same unified user ID and the same signature. The value can contain a maximum of 31 bytes.| String| Yes (initial value: left empty)| 268| name | Ability name. The value can be a reverse domain name, in the format of "*bundleName*.*className*", for example, **"com.example.myapplication.EntryAbility"**. Alternatively, the value can start with a period (.) followed by the class name, for example, **".EntryAbility"**.<br>The ability name must be unique in an application. Note: If you use DevEco Studio to create the project, an ability named **EntryAbility** will be created by default, and its configuration will be saved to the **config.json** file. If you use other IDEs, the value of this attribute can be customized. The value can contain a maximum of 127 bytes.| String| No| 269| description | Description of the ability. The value can be a string or a resource index to descriptions in multiple languages. The value can contain a maximum of 255 bytes.| String| Yes (initial value: left empty)| 270| icon | Index to the ability icon file. Example value: **$media:ability_icon**. In the **skills** attribute of the ability, if the **actions** value contains **action.system.home** and the **entities** value contains **entity.system.home**, the icon of the ability is also used as the icon of the application. If multiple abilities address this condition, the icon of the first candidate ability is used as the application icon.<br>Note: The **icon** and **label** values of an application are visible to users. Ensure that at least one of them is different from any existing icons or labels.| String| Yes (initial value: left empty)| 271| label | Ability name displayed to users. The value can be a name string or a resource index to names in multiple languages, for example, **$string:ability_label**. In the **skills** attribute of the ability, if the **actions** value contains **action.system.home** and the **entities** value contains **entity.system.home**, the label of the ability is also used as the label of the application. If multiple abilities address this condition, the label of the first candidate ability is used as the application label.<br>Note: The **icon** and **label** values of an application are visible to users. Ensure that at least one of them is different from any existing icons or labels. The value can be a reference to a string defined in a resource file or a string enclosed in brackets ({}). The value can contain a maximum of 255 characters.| String| Yes (initial value: left empty)| 272| uri | Uniform Resource Identifier (URI) of the ability. The value can contain a maximum of 255 bytes.| String| Yes (No for abilities using the Data template)| 273| launchType | Launch type of the ability. The value can be **standard** or **singleton**.<br>**standard**: Multiple **Ability** instances can be created during startup. Most abilities can use this type.<br>**singleton**: Only a single **Ability** instance can be created across all task stacks during startup. For example, a globally unique incoming call screen uses the singleton launch type. This attribute applies only to the default, tablet, smart TV, head unit, and wearable device types.| String| Yes (initial value: **"singleton"**)| 274| visible | Whether the ability can be called by other applications.<br>**true**: The ability can be called by other applications.<br>**false**: The ability cannot be called by other applications.| Boolean| Yes (initial value: **false**)| 275| permissions | Permissions required for abilities of another application to call the current ability. The value is an array of permission names predefined by the system, generally in the reverse domain name notation. It contains a maximum of 255 bytes.| String array| Yes (initial value: left empty)| 276|skills | Types of the **want** that can be accepted by the ability.| Object array| Yes (initial value: left empty)| 277| deviceCapability | Device capabilities required to run the ability. The value is an array of up to 512 elements, each of which contains a maximum of 64 bytes.| String array| Yes (initial value: left empty)| 278| metaData | Metadata.| Object| Yes (initial value: left empty)| 279| type | Ability type. The options are as follows:<br>**page**: FA developed using the Page template to provide the capability of interacting with users.<br>**service**: PA developed using the Service template to provide the capability of running tasks in the background.<br>**data**: PA developed using the Data template to provide unified data access for external systems.<br>**CA**: ability that can be started by other applications as a window.| String| No| 280| orientation | Display orientations of the ability. This attribute applies only to the ability using the Page template. The options are as follows:<br>**unspecified**: indicates that the system automatically determines the display orientation of the ability.<br>**landscape**: indicates the landscape orientation.<br>**portrait**: indicates the portrait orientation.<br>**followRecent**: indicates that the orientation follows the most recent application in the stack.| String| Yes (initial value: **"unspecified"**)| 281| backgroundModes | Background service type of the ability. You can assign multiple background service types to a specific ability. This field applies only to the ability using the Service template. The options are as follows:<br>**dataTransfer**: service for downloading, backing up, sharing, or transferring data from the network or peer devices.<br>**audioPlayback**: audio playback service.<br>**audioRecording**: audio recording service.<br>**pictureInPicture**: picture in picture (PiP) and small-window video playback services.<br>**voip**: voice/video call and VoIP services.<br>**location**: location and navigation services.<br>**bluetoothInteraction**: Bluetooth scanning, connection, and transmission services.<br>**wifiInteraction**: WLAN scanning, connection, and transmission services.<br>**screenFetch**: screen recording and screenshot services.<br>**multiDeviceConnection**: multi-device interconnection service.| String array| Yes (initial value: left empty)| 282| grantPermission | Whether permissions can be granted for any data in the ability.| Boolean| Yes (initial value: left empty)| 283| readPermission | Permission required for reading data in the ability. This attribute applies only to the ability using the Data template. The value is a string with a maximum of 255 bytes. This attribute applies only to the default, tablet, smart TV, head unit, and wearable device types.| String| Yes (initial value: left empty)| 284| writePermission | Permission required for writing data to the ability. This attribute applies only to the ability using the Data template. The value is a string with a maximum of 255 bytes.| String| Yes (initial value: left empty)| 285| configChanges | System configurations that the ability concerns. Upon any changes on the concerned configurations, the **onConfigurationUpdated** callback will be invoked to notify the ability. The options are as follows:<br>**mcc**: indicates that the mobile country code (MCC) of the IMSI is changed. Typical scenario: A SIM card is detected, and the MCC is updated.<br>**mnc**: indicates that the mobile network code (MNC) of the IMSI is changed. Typical scenario: A SIM card is detected, and the MNC is updated.<br>**locale**: indicates that the locale is changed. Typical scenario: The user selects a new language for the text display of the device.<br>**layout**: indicates that the screen layout is changed. Typical scenario: Currently, different display forms are all in the active state.<br>**fontSize**: indicates that font size is changed. Typical scenario: A new global font size is set.<br>**orientation**: indicates that the screen orientation is changed. Typical scenario: The user rotates the device.<br>**density**: indicates that the display density is changed. Typical scenario: The user may specify different display ratios, or different display forms are active at the same time.<br>**size**: indicates that the size of the display window is changed.<br>**smallestSize**: indicates that the length of the shorter side of the display window is changed.<br>**colorMode**: indicates that the color mode is changed.| String array| Yes (initial value: left empty)| 286| mission | Task stack of the ability. This attribute applies only to the ability using the Page template. By default, all abilities in an application belong to the same task stack.| String| Yes (initial value: bundle name of the application)| 287| targetAbility | Target ability that this ability alias points to. This attribute applies only to the ability using the Page template. If the **targetAbility** attribute is set, only **name**, **icon**, **label**, **visible**, **permissions**, and **skills** take effect in the current ability (ability alias). Other attributes use the values of the **targetAbility** attribute. The target ability must belong to the same application as the alias and must be declared in **config.json** ahead of the alias.| String| Yes (initial value: left empty, indicating that the current ability is not an alias)| 288| formsEnabled | Whether the ability can provide widgets. This attribute applies only to the ability using the Page template.<br>**true**: This ability can provide widgets.<br>**false**: This ability cannot provide widgets.| Boolean| Yes (initial value: **false**)| 289| forms | Information about the widgets used by the ability. This attribute is valid only when **formsEnabled** is set to **true**.| Object array| Yes (initial value: left empty)| 290| srcLanguage | Programming language of the ability, which you can specify when creating the project.| String| Yes (initial value: **"js"**)| 291| srcPath | JS code path corresponding to the ability. The value can contain a maximum of 127 bytes.| String| No| 292| uriPermission | Application data that the ability can access. This attribute consists of the **mode** and **path** sub-attributes. This attribute is valid only for the capability of the type provider.| Object| Yes (initial value: left empty)| 293| startWindowIcon | Index to the icon file of the ability startup page. This attribute applies only to the ability using the Page template. Example: **$media:icon**.| String| Yes (initial value: left empty)| 294| startWindowBackground | Index to the background color resource file of the ability startup page. This attribute applies only to the ability using the Page template. Example: **$color:red**.| String| Yes (initial value: left empty)| 295| removeMissionAfterTerminate | Whether to remove the relevant task from the task list after the ability is destroyed. This attribute applies only to the ability using the Page template. The value **true** means to remove the relevant task from the task list after the ability is destroyed, and **false** means the opposite.| Boolean| Yes (initial value: **false**)| 296 297## Internal Structure of the uriPermission Attribute 298 299**Table 9** Internal structure of the uriPermission attribute 300 301| Name| Description| Data Type| Initial Value Allowed| 302| -------- | -------- | -------- | -------- | 303| path | Path. The value can contain maximum of 255 bytes.| String| No| 304| mode | Matching mode.| String| Yes (initial value: **default**)| 305 306 307Example of the **abilities** attribute structure: 308 309```json 310"abilities": [ 311 { 312 "name": ".EntryAbility", 313 "description": "test main ability", 314 // $media:ic_launcher is a media resource. 315 "icon": "$media:ic_launcher", 316 // $string:example is a string resource. 317 "label": "$string:example", 318 "launchType": "standard", 319 "orientation": "unspecified", 320 "permissions": [], 321 "visible": true, 322 "skills": [ 323 { 324 "actions": [ 325 "action.system.home" 326 ], 327 "entities": [ 328 "entity.system.home" 329 ] 330 } 331 ], 332 "configChanges": [ 333 "locale", 334 "layout", 335 "fontSize", 336 "orientation" 337 ], 338 "type": "page", 339 "startWindowIcon": "$media:icon", 340 "startWindowBackground": "$color:red", 341 "removeMissionAfterTerminate": true 342 }, 343 { 344 "name": ".PlayService", 345 "description": "example play ability", 346 "icon": "$media:ic_launcher", 347 "label": "$string:example", 348 "launchType": "standard", 349 "orientation": "unspecified", 350 "visible": false, 351 "skills": [ 352 { 353 "actions": [ 354 "action.play.music", 355 "action.stop.music" 356 ], 357 "entities": [ 358 "entity.audio" 359 ] 360 } 361 ], 362 "type": "service", 363 "backgroundModes": [ 364 "audioPlayback" 365 ] 366 }, 367 { 368 "name": ".UserADataAbility", 369 "type": "data", 370 "uri": "dataability://com.example.world.test.UserADataAbility", 371 "visible": true 372 } 373] 374``` 375## Internal Structure of the skills Attribute 376 377**Table 10** Internal structure of the skills attribute 378 379| Name| Description| Data Type| Initial Value Allowed| 380| -------- | -------- | -------- | -------- | 381| actions | Actions of the **want** that can be accepted by the ability. Generally, the value is an **action** value predefined in the system.| String array| Yes (initial value: left empty)| 382| entities | Entities of the **want** that can be accepted by the ability, such as video and home applications.| String array| Yes (initial value: left empty)| 383| uris | Data specifications to be added to the want filter. The specification is a data type (using the **mimeType** attribute), a URI, or both a data type and a URI.<br>The URI is specified by separate attributes of each part: <scheme>://<host>:<port>[<path>\|<pathStartWith>\|<pathRegex>]. <br>**scheme** is mandatory when the specification is of the URI type and is optional when the specification is a data type. | Object array| Yes (initial value: left empty)| 384 385## Internal Structure of the uris Attribute 386 387**Table 11** Internal structure of the uris attribute 388 389| Name| Description| Data Type| Initial Value Allowed| 390| -------- | -------- | -------- | -------- | 391| scheme | Scheme of the URI.| String| No| 392| host | Host value of the URI.| String| Yes (initial value: left empty)| 393| port | Port number of the URI.| String| Yes (initial value: left empty)| 394| pathStartWith | **pathStartWith** value of the URI.| String| Yes (initial value: left empty)| 395| path | **path** value of the URI.| String| Yes (initial value: left empty)| 396| pathRegx | **pathRegx** value of the URI.| String| Yes (initial value: left empty)| 397| type | **type** value of the URI. The value is a MIME type. Typical values include **"audio/aac"** and **"text/css"**.| String| Yes (initial value: left empty)| 398 399 400Example of the **skills** attribute structure: 401 402```json 403"skills": [ 404 { 405 "actions": [ 406 "action.system.home" 407 ], 408 "entities": [ 409 "entity.system.home" 410 ], 411 "uris": [ 412 { 413 "scheme": "http", 414 "host": "www.example.com", 415 "port": "8080", 416 "path": "query/student/name", 417 "type": "text/*" 418 } 419 ] 420 } 421] 422``` 423 424## Internal Structure of the reqPermissions Attribute 425 426**Table 12** Internal structure of the reqPermissions attribute 427 428| Name| Description| Data Type| Initial Value Allowed| 429| -------- | -------- | -------- | -------- | 430| name | Name of the permission to request.| String| No| 431| reason | Reason for requesting the permission. Multi-language adaptation is required.| String| No if the permission to request is **user_grant**, yes in other cases (initial value: left empty)<br>If the permission to request is **user_grant** this attribute is required for the application to be released to the application market, and multi-language adaptation is required.| 432| usedScene | Scene under which the permission is used. It consists of the **abilities** and **when** sub-attributes.<br>- **ability**: ability name. Multiple ability names can be configured.<br>- **when**: time for using the permission. The options are **inuse** and **always**.| Object| Yes (initial value: left empty)<br>**when**: initial value (**inuse**) allowed| 433 434## Internal Structure of the usedScene Attribute 435 436**Table 13** Internal structure of the usedScene attribute 437 438| Name| Description| Data Type| Initial Value Allowed| 439| -------- | -------- | -------- | -------- | 440| ability | Names of abilities that require the permission.| String array| Yes (initial value: all ability names)| 441| when | Time when the permission is used.<br>**inuse**: The permission is required when the ability is in use.<br>**always**: The permission is required at all times.| Value| Yes (initial value: left empty)| 442 443## Internal Structure of the js Attribute 444 445**Table 14** Internal structure of the js attribute 446 447| Name| Description| Data Type| Initial Value Allowed| 448| -------- | -------- | -------- | -------- | 449| name | Name of the JS component. The default value is **default**.| String| No| 450| pages | Route information about all pages in the JavaScript component, including the page path and page name. The value is an array, in which each element represents a page. The first element in the array represents the home page of the JS FA.| String array| No| 451| window | Window-related configurations.| Object| Yes (initial value: see Table 15)| 452| type | Type of the JS component. The options are as follows:<br>**normal**: indicates an application instance.<br>**form**: indicates a widget instance.| String| Yes (initial value: **"normal"**)| 453|mode | Development mode of the JS component.| Object| Yes (initial value: left empty)| 454 455## Internal Structure of the window Attribute 456 457**Table 15** Internal structure of the window attribute 458 459| Name| Description| Data Type| Initial Value Allowed| 460| -------- | -------- | -------- | -------- | 461| designWidth | Baseline width for page design. The size of an element is scaled by the actual device width.| Number| Yes (initial value: 720px)| 462| autoDesignWidth | Whether to automatically calculate the baseline width for page design. If it is set to **true**, the **designWidth** attribute becomes invalid. The baseline width is calculated based on the device width and screen density.| Boolean| Yes (initial value: **false**)| 463 464## Internal Structure of the mode Attribute 465 466**Table 16** Internal structure of the mode attribute 467 468| Name| Description| Data Type| Initial Value Allowed| 469| -------- | -------- | -------- | -------- | 470| type | Type of the JS component. The value can be **pageAbility** or **form**.| String| Yes (initial value: **pageAbility**)| 471| syntax | Syntax type of the JS component. The value can be **"hml"** or **"ets"**.| String| Yes (initial value: **"hml"**)| 472 473 474Example of the **js** attribute structure: 475 476```json 477"js": [ 478 { 479 "name": "default", 480 "pages": [ 481 "pages/index/index", 482 "pages/detail/detail" 483 ], 484 "window": { 485 "designWidth": 720, 486 "autoDesignWidth": false 487 }, 488 "type": "form" 489 } 490] 491``` 492 493## Internal Structure of the shortcuts Attribute 494 495**Table 17** Internal structure of the shortcuts attribute 496 497| Name| Description| Data Type| Initial Value Allowed| 498| -------- | -------- | -------- | -------- | 499| shortcutId | ID of the shortcut. The value is a string with a maximum of 63 bytes.| String| No| 500| label | Label of the shortcut, that is, the text description displayed for the shortcut. The value can be a string or a resource index to the label. The value is a string with a maximum of 63 bytes.| String| Yes (initial value: left empty)| 501| icon | Icon of the shortcut. The value is a resource index to the description.| String| Yes (initial value: left empty)| 502| intents | Wants to which the shortcut points. The attribute consists of the **targetClass** and **targetBundle** sub-attributes.| Object array| Yes (initial value: left empty)| 503 504## Internal Structure of the intents Attribute 505 506**Table 18** Internal structure of the intents attribute 507 508| Name| Description| Data Type| Initial Value Allowed| 509| -------- | -------- | -------- | -------- | 510| targetClass | Target class of the shortcut.| String| Yes (initial value: left empty)| 511| targetBundle | Application bundle name for the target ability of the shortcut.| String| Yes (initial value: left empty)| 512 513 514Example of the **shortcuts** attribute structure: 515 516```json 517"shortcuts": [ 518 { 519 "shortcutId": "id", 520 // $string:shortcut is a string resource index. 521 "label": "$string:shortcut", 522 "intents": [ 523 { 524 "targetBundle": "com.example.world.test", 525 "targetClass": "com.example.world.test.entry.EntryAbility" 526 } 527 ] 528 } 529] 530``` 531 532## Internal Structure of the forms Attribute 533 534**Table 19** Internal structure of the forms attribute 535 536| Name| Description| Data Type| Initial Value Allowed| 537| -------- | -------- | -------- | -------- | 538| name | Class name of the widget. The value is a string with a maximum of 127 bytes.| String| No| 539| description | Description of the widget. The value can be a string or a resource index to descriptions in multiple languages. The value is a string with a maximum of 255 bytes.| String| Yes (initial value: left empty)| 540| isDefault | Whether the widget is a default one. Each ability has only one default widget.<br>**true**: The widget is the default one.<br>**false**: The widget is not the default one.| Boolean| No| 541| type | Type of the widget. The options are as follows:<br>**JS**: indicates a JavaScript-programmed widget.| String| No| 542| colorMode | Color mode of the widget. The options are as follows:<br>**auto**: The widget adopts the auto-adaptive color mode.<br>**dark**: The widget adopts the dark color mode.<br>**light**: The widget adopts the light color mode.| String| Yes (initial value: **auto**)| 543| supportDimensions | Grid styles supported by the widget. Available values are as follows:<br>**1 * 2**: indicates a grid with one row and two columns.<br>**2 * 1**: indicates a grid with two rows and one column.<br>**2 * 2**: indicates a grid with two rows and two columns.<br>**2 * 4**: indicates a grid with two rows and four columns.<br>**4 * 4**: indicates a grid with four rows and four columns.| String array| No| 544| defaultDimension | Default grid style of the widget. The value must be from the **supportDimensions** array of the widget.| String| No| 545| updateEnabled | Whether the widget can be updated periodically. Available values are as follows:<br>**true**: The widget can be updated at a specified interval (**updateDuration**) or at the scheduled time (**scheduledUpdateTime**). **updateDuration** takes precedence over **scheduledUpdateTime**.<br>**false**: The widget cannot be updated periodically.| Boolean| No| 546| scheduledUpdateTime | Scheduled time to update the widget. The value is in 24-hour format and accurate to minute.| String| Yes (initial value: **"0:0"**)| 547| updateDuration | Interval to update the widget. The value is a natural number, in the unit of 30 minutes.<br>If the value is **0**, this attribute does not take effect.<br>If the value is a positive integer *N*, the interval is calculated by multiplying *N* and 30 minutes.| Number| Yes (initial value: **0**)| 548| formConfigAbility | Name of the ability used to adjust the widget.| String| Yes (initial value: left empty)| 549| jsComponentName | Component name of the widget. The value is a string with a maximum of 127 bytes. This attribute is required only by JavaScript-programmed widgets.| String| No| 550| metaData | Metadata of the widget. This attribute contains the array of the **customizeData** attribute.| Object| Yes (initial value: left empty)| 551| customizeData | Custom information of the widget.| Object array| Yes (initial value: left empty)| 552 553## Internal Structure of the customizeData Attribute 554 555**Table 20** Internal structure of the customizeData attribute 556 557| Name| Description| Data Type| Initial Value Allowed| 558| -------- | -------- | -------- | -------- | 559| name | Key name that identifies a data item. The value is a string with a maximum of 255 bytes.| String| Yes (initial value: left empty)| 560| value | Value of the data item. The value is a string with a maximum of 255 bytes.| String| Yes (initial value: left empty)| 561| extra | Format of the current custom data. The value is the resource value of **extra**.| String| Yes (initial value: left empty)| 562 563 564Example of the **forms** attribute structure: 565 566```json 567"forms": [ 568 { 569 "name": "Form_Js", 570 "description": "It's Js Form", 571 "type": "JS", 572 "jsComponentName": "card", 573 "colorMode": "auto", 574 "isDefault": true, 575 "updateEnabled": true, 576 "scheduledUpdateTime": "11:00", 577 "updateDuration": 1, 578 "defaultDimension": "2*2", 579 "supportDimensions": [ 580 "2*2", 581 "2*4", 582 "4*4" 583 ] 584 }, 585 { 586 "name": "Form_Js", 587 "description": "It's JS Form", 588 "type": "Js", 589 "colorMode": "auto", 590 "isDefault": false, 591 "updateEnabled": true, 592 "scheduledUpdateTime": "21:05", 593 "updateDuration": 1, 594 "defaultDimension": "1*2", 595 "supportDimensions": [ 596 "1*2" 597 ], 598 "landscapeLayouts": [ 599 "$layout:ability_form" 600 ], 601 "portraitLayouts": [ 602 "$layout:ability_form" 603 ], 604 "formConfigAbility": "ability://com.example.myapplication.fa/.EntryAbility", 605 "metaData": { 606 "customizeData": [ 607 { 608 "name": "originWidgetName", 609 "value": "com.example.weather.testWidget" 610 } 611 ] 612 } 613 } 614] 615``` 616 617## Internal Structure of the distributionFilter Attribute 618 619**Table 21** Internal structure of the distributionFilter attribute 620 621| Name| Description| Data Type| Initial Value Allowed| 622| -------- | -------- | -------- | -------- | 623| apiVersion | Supported API versions.| Object array| Yes (initial value: left empty)| 624|screenShape | Supported screen shapes.| Object array| Yes (initial value: left empty)| 625| screenWindow | Supported window resolutions for when the application is running. This attribute applies only to the lite wearables.| Object array| Yes (initial value: left empty)| 626|screenDensity | Pixel density of the screen, in dots per inch (DPI).| Object array| Yes (initial value: left empty)| 627| countryCode | Country code used for distributing the application. For details, see the ISO-3166-1 standard. Multiple enumerated values of countries and regions are supported.| Object array| Yes (initial value: left empty)| 628 629## Internal Structure of the apiVersion Attribute 630 631**Table 22** Internal structure of the apiVersion attribute 632 633| Name| Description| Data Type| Initial Value Allowed| 634| -------- | -------- | -------- | -------- | 635| policy | Rule for the sub-attribute value. Set this attribute to **exclude** or **include**.<br>- **exclude**: Exclude the matches of the sub-attribute value.<br>- **include**: Include the matches of the sub-attribute value.| String| No| 636| value | API versions, for example, 4, 5, or 6. Example: If an application comes with two versions developed using API version 5 and API version 6 for the same device model, two installation packages of the entry type can be released for the application.| Array| No| 637 638## Internal Structure of the screenShape Attribute 639 640**Table 23** Internal structure of the screenShape attribute 641 642| Name| Description| Data Type| Initial Value Allowed| 643| -------- | -------- | -------- | -------- | 644| policy | Rule for the sub-attribute value. Set this attribute to **exclude** or **include**.<br>- **exclude**: Exclude the matches of the sub-attribute value.<br>- **include**: Include the matches of the sub-attribute value.| String| No| 645| value | API versions, for example, 4, 5, or 6. Example: If an application comes with two versions developed using API version 5 and API version 6 for the same device model, two installation packages of the entry type can be released for the application.| Array| No| 646 647## Internal Structure of the screenWindow Attribute 648 649**Table 24** Internal structure of the screenWindow attribute 650 651| Name| Description| Data Type| Initial Value Allowed| 652| -------- | -------- | -------- | -------- | 653| policy | Rule for the sub-attribute value. Set this attribute to **exclude** or **include**.<br>- **exclude**: Exclude the matches of the sub-attribute value.<br>- **include**: Include the matches of the sub-attribute value.| String| No| 654| value | API versions, for example, 4, 5, or 6. Example: If an application comes with two versions developed using API version 5 and API version 6 for the same device model, two installation packages of the entry type can be released for the application.| Array| No| 655 656## Internal Structure of the screenDensity Attribute 657 658**Table 25** Internal structure of the screenDensity attribute 659 660| Name| Description| Data Type| Initial Value Allowed| 661| -------- | -------- | -------- | -------- | 662| policy | Rule for the sub-attribute value. Set this attribute to **exclude** or **include**.<br>- **exclude**: Exclude the matches of the sub-attribute value.<br>- **include**: Include the matches of the sub-attribute value.| String| No| 663| value | Pixel density of the screen, in dots per inch (DPI). The options are as follows:<br>**sdpi**: small-scale DPI. This value is applicable to devices with a DPI range of (0, 120].<br>**mdpi**: medium-scale DPI. This value is applicable to devices with a DPI range of (120, 160].<br>**ldpi**: large-scale DPI. This value is applicable to devices with a DPI range of (160, 240].<br>**xldpi**: extra-large-scale DPI. This value is applicable to devices with a DPI range of (240, 320].<br>**xxldpi**: extra-extra-large-scale DPI. This value is applicable to devices with a DPI range of (320, 480].<br>**xxxldpi**: extra-extra-extra-large-scale DPI. This value is applicable to devices with a DPI range of (480, 640].| Array| No| 664 665## Internal Structure of the countryCode attribute 666 667**Table 26** Internal structure of the countryCode attribute 668 669| Name| Description| Data Type| Initial Value Allowed| 670| -------- | -------- | -------- | -------- | 671| policy | Rule for the sub-attribute value. Set this attribute to **exclude** or **include**.<br>- **exclude**: Exclude the matches of the sub-attribute value.<br>- **include**: Include the matches of the sub-attribute value.| String| No| 672| value | Country code of the area to which the application is to be distributed. The value is a string array, of which each substring indicates a country or region. The substring consists of two uppercase letters.| String array| No| 673 674 675Example of the **distributionFilter** attribute structure: 676 677```json 678"distributionFilter": { 679 "apiVersion": { 680 "policy": "include", 681 "value": [4,5] 682 }, 683 "screenShape": { 684 "policy": "include", 685 "value": ["circle","rect"] 686 }, 687 "screenWindow": { 688 "policy": "include", 689 "value": ["454*454","466*466"] 690 }, 691 "screenDensity":{ 692 "policy": "exclude", 693 "value": ["ldpi","xldpi"] 694 }, 695 "countryCode": { 696 "policy":"include", 697 "value":["CN","HK"] 698 } 699} 700``` 701 702## Internal Structure of the commonEvents Attribute 703 704**Table 27** Internal structure of the commonEvents attribute 705 706| Name| Description| Data Type| Initial Value Allowed| 707| -------- | -------- | -------- | -------- | 708| name | Name of the static common event. The value can contain a maximum of 127 bytes.| String| No| 709| permission | Permission required to implement static common events. The value can contain a maximum of 255 bytes.| String| Yes (initial value: left empty)| 710| data | Additional data array to be carried by the current static common event.| String array| Yes (initial value: left empty)| 711| type | Type array of the current static common event.| String array| Yes (initial value: left empty)| 712| events | A set of events for the wants that can be received. The value can be system predefined or custom.| String array| No| 713 714 715Example of the **commonEvents** attribute structure: 716 717```json 718"commonEvents": [ 719 { 720 "name": ".EntryAbility", 721 "permission": "ohos.permission.GET_BUNDLE_INFO", 722 "data": [ 723 "com.example.demo", 724 "100" 725 ], 726 "events": [ 727 "install", 728 "update" 729 ] 730 } 731] 732``` 733 734## Internal Structure of the testRunner Attribute 735 736**Table 28** Internal structure of the testRunner attribute 737 738| Name| Description| Data Type| Initial Value Allowed| 739| -------- | -------- | -------- | -------- | 740| name | Name of the test runner object. The value can contain a maximum of 255 bytes.| String| No| 741| srcPath | Code path of the test runner. The maximum length of this tag is 255 bytes.| String| No| 742 743```json 744"testRunner": { 745 "name": "myTestRunnerName", 746 "srcPath": "etc/test/TestRunner.ts" 747} 748``` 749 750 751**definePermission** applies only to system applications and does not take effect for third-party applications. 752 753## Internal Structure of the definePermissions Attribute 754**Table 29** Internal structure of the definePermissions attribute 755 756| Name| Description| Data Type| Initial Value Allowed| 757| -------- | -------- | -------- | -------- | 758| name | Name of a permission. The value can contain a maximum of 255 bytes.| String| No| 759| grantMode | Permission grant mode. The options are as follows:<br>- **system_grant**: The permission is automatically granted by the system after the application is installed.<br>- **user_grant**: The permission is dynamically requested when needed and must be granted by the user.| String| Yes (initial value: **"system_grant"**)| 760| availableLevel | Permission type. The options are as follows:<br>- **system_core**: system core permission.<br>- **system_basic**: basic system permission.<br>- **normal**: normal permission, which can be requested by all applications.| String| Yes (initial value: **"normal"**)| 761| provisionEnable | Whether the permission can be requested in provision mode, including high-level permissions. The value **true** means that the permission can be requested in provision mode.| Boolean| Yes (initial value: **true**)| 762| distributedSceneEnabled | Whether the permission can be used in distributed scenarios.| Boolean| Yes (initial value: **false**)| 763| label | Brief description of the permission. The value is a resource index to the description.| String| Yes (initial value: left empty)| 764| description | Detailed description of the permission. The value is a string with a maximum of 255 bytes or a string resource index.| String| Yes (initial value: left empty)| 765