1# 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 telematics devices.| String array| Yes (initial value: left empty)|
15|deviceType | <!--RP1-->Type of device on which the ability can run. The device types predefined in the system include **tablet**, **tv**, **car**, and **wearable**.<!--RP1End--> | 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| distroFilter | Rules for distributing HAP files based on different device specifications, so that precise matching can be performed when the application market distributes applications. All sub-attributes under this attribute are optional. This attribute must be configured in the **/resource/profile** directory. During distribution, a unique HAP is determined based on the mapping between **deviceType** and attributes listed in the table below.| 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 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|generateBuildHash |Whether the hash value of the HAP or HSP file is generated by the packaging tool. The hash value (if any) is used to determine whether the application needs to be updated when the system is updated in OTA mode but the value of [code](#internal-structure-of-the-apiversion-attribute) in **version** of the application remains unchanged.**<br>NOTE<br>This tag applies only to system applications.**|Boolean|Yes (initial value: **false**)|
28|libIsolation |Whether to save the .so files of the current HAP to a separate folder (named after the module) in the **libs** directory. This is intended to avoid .so file conflicts between HAPs.<br>- **true**: The .so files of the current HAP are stored in a separate folder (named after the module) in the **libs** directory.<br>- **false**: The .so files of the current HAP are directly stored in the **libs** directory.|Boolean|Yes (initial value: **false**)|
29
30Example of the **module** tag structure:
31
32```json
33{
34  "module": {
35    "mainAbility": ".EntryAbility",
36    "deviceType": [
37      "default",
38      "tablet"
39    ],
40    "abilities": [
41      {
42        "skills": [
43          {
44            "entities": [
45              "entity.system.home"
46            ],
47            "actions": [
48              "action.system.home"
49            ]
50          }
51        ],
52        "orientation": "unspecified",
53        "visible": true,
54        "srcPath": "EntryAbility",
55        "name": ".EntryAbility",
56        "srcLanguage": "ets",
57        "icon": "$media:icon",
58        "description": "$string:MainAbility_desc",
59        "formsEnabled": false,
60        "label": "$string:MainAbility_label",
61        "type": "page",
62        "launchType": "multiton"
63      }
64    ],
65    "distro": {
66      "moduleType": "entry",
67      "installationFree": false,
68      "deliveryWithInstall": true,
69      "moduleName": "entry"
70    },
71    "package": "com.example.entry",
72    "srcPath": "",
73    "name": ".entry",
74    "js": [
75      {
76        "mode": {
77          "syntax": "ets",
78          "type": "pageAbility"
79        },
80        "pages": [
81          "pages/Index"
82        ],
83        "name": ".EntryAbility",
84        "window": {
85          "designWidth": 720,
86          "autoDesignWidth": false
87        }
88      }
89    ]
90  }
91}
92```
93
94## Internal Structure of the distro Attribute
95
96**Table 2** Internal structure of the distro attribute
97
98| Name| Description| Data Type| Initial Value Allowed|
99| -------- | -------- | -------- | -------- |
100| moduleName | Name of the HAP file. The maximum length is 31 bytes. This name can be changed during application update. However, if it is changed, you need to adapt the application to the migration of module-related directories. You can use the [file operation API](../reference/apis-core-file-kit/js-apis-file-fs.md#fscopydir10) for this purpose.| String| No|
101| moduleType | Type of the HAP file, which can **entry**, **feature**, or **har**.| String| No|
102| 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|
103| 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|
104
105
106Example of the **distro** attribute structure:
107
108```json
109"distro": {
110  "moduleName": "ohos_entry",
111  "moduleType": "entry",
112  "installationFree": true,
113  "deliveryWithInstall": true
114}
115```
116
117## Internal Structure of the metadata Attribute
118
119**Table 3** Internal structure of the metadata attribute
120
121| Name| Description| Data Type| Initial Value Allowed|
122| -------- | -------- | -------- | -------- |
123| 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)|
124| 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)|
125| customizeData | Custom metadata of the parent component. **parameters** and **results** cannot be configured in **application**.| Object array| Yes (initial value: left empty)|
126
127## Internal Structure of the parameters Attribute
128
129**Table 4** Internal structure of the parameters attribute
130
131| Name| Description| Data Type| Initial Value Allowed|
132| -------- | -------- | -------- | -------- |
133| 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 bytes.| String| Yes (initial value: left empty)|
134| name | Name of the parameter passed for calling the ability. The value can contain a maximum of 255 bytes.| String| No|
135| type | Type of the parameter passed for calling the ability, for example, **Integer**.| String| No|
136
137## Internal Structure of the results Attribute
138
139**Table 5** Internal structure of the results attribute
140
141| Name| Description| Data Type| Initial Value Allowed|
142| -------- | -------- | -------- | -------- |
143| 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 bytes.| String| Yes (initial value: left empty)|
144| name | Name of the return value. The value can contain a maximum of 255 bytes.| String| Yes (initial value: left empty)|
145| type | Type of the return value, for example, **Integer**.| String| No|
146
147## Internal Structure of the customizeData Attribute
148
149**Table 6** Internal structure of the customizeData attribute
150
151| Name| Description| Data Type| Initial Value Allowed|
152| -------- | -------- | -------- | -------- |
153| name | Key of the data element. The value is a string with a maximum of 255 bytes.| String| Yes (initial value: left empty)|
154| value | Value of the data element. The value is a string with a maximum of 255 bytes.| String| Yes (initial value: left empty)|
155| extra | Custom format of the data element. The value is a resource index that identifies the data.| String| Yes (initial value: left empty)|
156
157
158Example of the metadata attribute:
159
160```json
161"metaData": {
162  "parameters" : [{
163    "name" : "a test for metadata parameter",
164    "type" : "Float",
165    // "$string:parameters_description" is a file resource index.
166    "description" : "$string:parameters_description"
167  }],
168  "results" : [{
169    "name" : "a test for metadata result",
170    "type" : "Float",
171    "description" : "$string:results_description"
172  }],
173  "customizeData" : [{
174    "name" : "a customizeData",
175    "value" : "string",
176    "extra" : "$string:customizeData_description"
177  }]
178}
179```
180
181## deviceType Attribute
182
183**Table 7** Values of the deviceType attribute
184
185<!--RP2-->
186| Device Type| Value| Description|
187| -------- | -------- | -------- |
188| Tablet| tablet | - |
189| Smart TV| tv | - |
190| Smart watch| wearable | Watch that provides call features.|
191| Sports watch| litewearable | - |
192| Head unit| car | - |
193| Default device| default | Device that provides full access to system capabilities.|
194<!--RP2End-->
195
196## Internal Structure of the abilities Attribute
197
198**Table 8** Internal structure of the abilities attribute
199
200| Name| Description| Data Type| Initial Value Allowed|
201| -------- | -------- | -------- | -------- |
202| 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)|
203| 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|
204| 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)|
205| 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)|
206| 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 bytes.| String| Yes (initial value: left empty)|
207| 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)|
208| launchType | Launch type of the ability. The value can be **multiton** 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, a telematics device, and wearable device types.| String| Yes (initial value: **"singleton"**)|
209| 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, not even by aa commands.| Boolean| Yes (initial value: **false**)|
210| 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)|
211|skills | Types of the **want** that can be accepted by the ability.| Object array| Yes (initial value: left empty)|
212| 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)|
213| metaData | Metadata.| Object| Yes (initial value: left empty)|
214| 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|
215| 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"**)|
216| 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**: data transfer through the network or peer device, such as download, backup, and share<br>**audioPlayback**: audio playback<br>**audioRecording**: audio recording<br>**pictureInPicture**: video playback in picture-in-picture (PiP) mode or in a small window<br>**voip**: voice and video calls over VoIP<br>**location**: location and navigation<br>**bluetoothInteraction**: Bluetooth scanning, connection, and transmission<br>**wifiInteraction**: Wi-Fi scanning, connection, and transmission<br>**screenFetch**: screen recording and screenshot<br>**multiDeviceConnection**: multi-device connection| String array| Yes (initial value: left empty)|
217| grantPermission | Whether permissions can be granted for any data in the ability.| Boolean| Yes (initial value: left empty)|
218| 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, a telematics device, and wearable device types.| String| Yes (initial value: left empty)|
219| 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)|
220| 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)|
221| 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)|
222| 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)|
223| 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**)|
224| 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)|
225| srcLanguage | Programming language of the ability, which you can specify when creating the project. The options are **"js"**, **"ets"**, and **"java"**.| String| Yes (initial value: **"js"**)|
226| srcPath | JS code path corresponding to the ability. The value can contain a maximum of 127 bytes.| String| No|
227| 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)|
228| 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)|
229| 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)|
230| 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**)|
231
232
233**Application icons cannot be hidden from the home screen.**
234
235The system strictly controls applications without icons to prevent malicious applications from deliberately configuring no icon to block uninstall attempts.
236
237**Setting the application icon to be displayed on the home screen**:<br>Set **icon**, **label**, and **skills** under **abilities** in the **config.json** file. Make sure the **skills** configuration contains **ohos.want.action.home** and **entity.system.home**.
238```
239{
240  "module":{
241
242    ...
243
244    "abilities": [{
245      "icon": "$media:icon",
246      "label": "Login",
247      "skills": [{
248        "actions": ["ohos.want.action.home"],
249        "entities": ["entity.system.home"],
250        "uris": []
251      }]
252    }],
253
254    ...
255
256  }
257}
258```
259
260To hide an entry icon on the home screen, you must configure the **AllowAppDesktopIconHide** privilege.<!--Del--> For details, see [Application Privilege Configuration Guide](../../device-dev/subsystems/subsys-app-privilege-config-guide.md).<!--DelEnd--> The rules for displaying the entry icon and entry label are as follows:
261* The HAP file contains Page ability configuration.
262  * The application icon on the home screen is set under **abilities** in the **config.json** file.
263    * The application does not have the privilege to hide its icon from the home screen.
264      * The system uses the icon configured for the Page ability as the entry icon and displays it on the home screen. Touching this icon will direct the user to the home page of the Page ability.
265      * The system uses the label configured for the PageAbility as the entry label and displays it on the home screen. If no label is configured, the bundle name is returned.
266    * The application has the privilege to hide its icon from the home screen.
267      * The application information is not returned when the home screen queries the information, and the entry icon and label of the application are not displayed on the home screen.
268  * The application icon on the home screen is not set under **abilities** in the **config.json** file.
269    * The application does not have the privilege to hide its icon from the home screen.
270      * The system uses the default icon as the entry icon and displays it on the home screen. Touching this icon will direct the user to the application details screen under application management, as shown in Figure 1.
271      * The system uses the bundle name of the application as the entry label and displays it on the home screen.
272    * The application has the privilege to hide its icon from the home screen.
273      * The application information is not returned when the home screen queries the information, and the entry icon and label of the application are not displayed on the home screen.
274* The HAP file does not contain Page ability configuration.
275  * The application does not have the privilege to hide its icon from the home screen.
276    * The system uses the default icon as the entry icon and displays it on the home screen. Touching this icon will direct the user to the application details screen under application management, as shown in Figure 1.
277    * The system uses the bundle name of the application as the entry label and displays it on the home screen.
278  * The application has the privilege to hide its icon from the home screen.
279    * The application information is not returned when the home screen queries the information, and the entry icon and label of the application are not displayed on the home screen.
280
281**Figure 1** Application details screen
282
283![Application details screen](figures/application_details.jpg)
284
285**NOTE**<br>The label displayed on the application details screen may be different from the one displayed on the home screen. These two are the same if the entry icon and label are configured for the non-Page ability.<br>
286## Internal Structure of the uriPermission Attribute
287
288**Table 9** Internal structure of the uriPermission attribute
289
290| Name| Description| Data Type| Initial Value Allowed|
291| -------- | -------- | -------- | -------- |
292| path | Path. The value can contain maximum of 255 bytes.| String| No|
293| mode | Matching mode.| String| Yes (initial value: **default**)|
294
295
296Example of the **abilities** attribute structure:
297
298```json
299"abilities": [
300  {
301    "name": ".EntryAbility",
302    "description": "test main ability",
303    // $media:ic_launcher is a media resource.
304    "icon": "$media:ic_launcher",
305    // $string:example is a string resource.
306    "label": "$string:example",
307    "launchType": "multiton",
308    "orientation": "unspecified",
309    "permissions": [],
310    "visible": true,
311    "skills": [
312      {
313        "actions": [
314          "action.system.home"
315        ],
316        "entities": [
317          "entity.system.home"
318        ]
319      }
320    ],
321    "configChanges": [
322      "locale",
323      "layout",
324      "fontSize",
325      "orientation"
326    ],
327    "type": "page",
328    "startWindowIcon": "$media:icon",
329    "startWindowBackground": "$color:red",
330    "removeMissionAfterTerminate": true
331  },
332  {
333    "name": ".PlayService",
334    "description": "example play ability",
335    "icon": "$media:ic_launcher",
336    "label": "$string:example",
337    "launchType": "multiton",
338    "orientation": "unspecified",
339    "visible": false,
340    "skills": [
341      {
342        "actions": [
343          "action.play.music",
344          "action.stop.music"
345        ],
346        "entities": [
347          "entity.audio"
348        ]
349      }
350    ],
351    "type": "service",
352    "backgroundModes": [
353      "audioPlayback"
354    ]
355  },
356  {
357    "name": ".UserADataAbility",
358    "type": "data",
359    "uri": "dataability://com.example.world.test.UserADataAbility",
360    "visible": true
361  }
362]
363```
364## Internal Structure of the skills Attribute
365
366**Table 10** Internal structure of the skills attribute
367
368| Name| Description| Data Type| Initial Value Allowed|
369| -------- | -------- | -------- | -------- |
370| 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)|
371| 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)|
372| 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: &lt;scheme&gt;://&lt;host&gt;:&lt;port&gt;[&lt;path&gt;\|&lt;pathStartWith&gt;\|&lt;pathRegex&gt;].  <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)|
373
374## Internal Structure of the uris Attribute
375
376**Table 11** Internal structure of the uris attribute
377
378| Name| Description| Data Type| Initial Value Allowed|
379| -------- | -------- | -------- | -------- |
380| scheme | Scheme of the URI.| String| No|
381| host | Host value of the URI.| String| Yes (initial value: left empty)|
382| port | Port number of the URI.| String| Yes (initial value: left empty)|
383| pathStartWith | **pathStartWith** value of the URI.| String| Yes (initial value: left empty)|
384| path | **path** value of the URI.| String| Yes (initial value: left empty)|
385| pathRegx | **pathRegx** value of the URI.| String| Yes (initial value: left empty)|
386| type | **type** value of the URI. The value is a MIME type. Typical values include **"audio/aac"** and **"text/css"**.<br>The wildcard formats of ***/*** or **mainType/*** is supported but **mainType/subType.*** is not. The **mainType** is a standard media type.| String| Yes (initial value: left empty)|
387
388
389Example of the **skills** attribute structure:
390
391```json
392"skills": [
393  {
394    "actions": [
395      "action.system.home"
396    ],
397    "entities": [
398      "entity.system.home"
399    ],
400    "uris": [
401      {
402        "scheme": "http",
403        "host": "www.example.com",
404        "port": "8080",
405        "path": "query/student/name",
406        "type": "text/*"
407      }
408    ]
409  }
410]
411```
412
413## Internal Structure of the reqPermissions Attribute
414
415**Table 12** Internal structure of the reqPermissions attribute
416
417| Name| Description| Data Type| Initial Value Allowed|
418| -------- | -------- | -------- | -------- |
419| name | Name of the permission to request.| String| No|
420| 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.|
421| 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|
422
423## Internal Structure of the usedScene Attribute
424
425**Table 13** Internal structure of the usedScene attribute
426
427| Name| Description| Data Type| Initial Value Allowed|
428| -------- | -------- | -------- | -------- |
429| ability | Names of abilities that require the permission.| String array| Yes (initial value: all ability names)|
430| 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)|
431
432## Internal Structure of the js Attribute
433
434**Table 14** Internal structure of the js attribute
435
436| Name| Description| Data Type| Initial Value Allowed|
437| -------- | -------- | -------- | -------- |
438| name | Name of the JavaScript component.| String| No|
439| pages | Route information of pages in the JavaScript component, in the format of "Page path + Page name". The page path is based on the value of **srcPath** of the current ability. For example, if the value of **srcPath** is **EntryAbility**, the page path starts from the lower level of **EntryAbility**. The value is an array, the first element of which represents the home page of the JavaScript FA.| String array| No|
440| window | Window-related configurations.| Object| Yes (initial value: see Table 15)|
441| 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"**)|
442|mode | Development mode of the JS component.| Object| Yes (initial value: left empty)|
443
444## Internal Structure of the window Attribute
445
446**Table 15** Internal structure of the window attribute
447
448| Name| Description| Data Type| Initial Value Allowed|
449| -------- | -------- | -------- | -------- |
450| designWidth | Baseline width for page design. The size of an element is scaled by the actual device width.| Number| Yes (initial value: 720px)|
451| 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**)|
452
453## Internal Structure of the mode Attribute
454
455**Table 16** Internal structure of the mode attribute
456
457| Name| Description| Data Type| Initial Value Allowed|
458| -------- | -------- | -------- | -------- |
459| type | Type of the JS component. The value can be **pageAbility** or **form**.| String| Yes (initial value: **pageAbility**)|
460| syntax | Syntax type of the JS component. The value can be **"hml"** or **"ets"**.| String| Yes (initial value: **"hml"**)|
461
462
463Example of the **js** attribute structure:
464
465```json
466"js": [
467  {
468    "name": ".EntryAbility",
469    "pages": [
470      "pages/index",
471      "pages/detail/detail"
472    ],
473    "window": {
474      "designWidth": 720,
475      "autoDesignWidth": false
476    },
477    "type": "form",
478    "mode": {
479      "syntax": "ets",
480      "type": "pageAbility"
481    }
482  }
483]
484```
485
486## Internal Structure of the shortcuts Attribute
487
488**Table 17** Internal structure of the shortcuts attribute
489
490| Name| Description| Data Type| Initial Value Allowed|
491| -------- | -------- | -------- | -------- |
492| shortcutId | ID of the shortcut. The value is a string with a maximum of 63 bytes.| String| No|
493| 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)|
494| icon | Icon of the shortcut. The value is a resource index to the description.| String| Yes (initial value: left empty)|
495| intents | Wants to which the shortcut points. The attribute consists of the **targetClass** and **targetBundle** sub-attributes.| Object array| Yes (initial value: left empty)|
496
497## Internal Structure of the intents Attribute
498
499**Table 18** Internal structure of the intents attribute
500
501| Name| Description| Data Type| Initial Value Allowed|
502| -------- | -------- | -------- | -------- |
503| targetClass | Target class of the shortcut.| String| Yes (initial value: left empty)|
504| targetBundle | Application bundle name for the target ability of the shortcut.| String| Yes (initial value: left empty)|
505
506
507Example of the **shortcuts** attribute structure:
508
509```json
510"shortcuts": [
511  {
512    "shortcutId": "id",
513    // $string:shortcut is a string resource index.
514    "label": "$string:shortcut",
515    "intents": [
516      {
517        "targetBundle": "com.example.world.test",
518        "targetClass": "com.example.world.test.entry.EntryAbility"
519      }
520    ]
521  }
522]
523```
524
525## Internal Structure of the forms Attribute
526
527**Table 19** Internal structure of the forms attribute
528
529| Name| Description| Data Type| Initial Value Allowed|
530| -------- | -------- | -------- | -------- |
531| name | Class name of the widget. The value is a string with a maximum of 127 bytes.| String| No|
532| 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)|
533| 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|
534| type | Type of the widget. The options are as follows:<br>**JS**: JavaScript widget.<br>**Java**: Java widget.| String| No|
535| 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**)|
536| 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|
537| defaultDimension | Default grid style of the widget. The value must be from the **supportDimensions** array of the widget.| String| No|
538| 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|
539| scheduledUpdateTime | Scheduled time to update the widget. The value is in 24-hour format and accurate to minute.| String| Yes (initial value: **"0:0"**)|
540| 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**)|
541| formConfigAbility | Name of the ability used to adjust the widget.| String| Yes (initial value: left empty)|
542| 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| Yes (initial value: left empty)|
543| metaData | Metadata of the widget. This attribute contains the array of the **customizeData** attribute.| Object| Yes (initial value: left empty)|
544| formVisibleNotify | Whether the widget is allowed to use the widget visibility notification.<br>**true**: allowed<br>**false**: not allowed| Boolean| Yes (initial value: **false**)|
545
546## Internal Structure of the customizeData Attribute
547
548**Table 20** Internal structure of the customizeData attribute
549
550| Name| Description| Data Type| Initial Value Allowed|
551| -------- | -------- | -------- | -------- |
552| 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)|
553| value | Value of the data item. The value is a string with a maximum of 255 bytes.| String| Yes (initial value: left empty)|
554| extra | Format of the current custom data. The value is the resource value of **extra**.| String| Yes (initial value: left empty)|
555
556
557Example of the **forms** attribute structure:
558
559```json
560"forms": [
561  {
562    "name": "Form_Js",
563    "description": "It's Js Form",
564    "type": "JS",
565    "jsComponentName": "card",
566    "colorMode": "auto",
567    "isDefault": true,
568    "updateEnabled": true,
569    "scheduledUpdateTime": "11:00",
570    "updateDuration": 1,
571    "defaultDimension": "2*2",
572    "supportDimensions": [
573      "2*2",
574      "2*4",
575      "4*4"
576    ]
577  },
578  {
579    "name": "Form_Js",
580    "description": "It's JS Form",
581    "type": "Js",
582    "colorMode": "auto",
583    "isDefault": false,
584    "updateEnabled": true,
585    "scheduledUpdateTime": "21:05",
586    "updateDuration": 1,
587    "defaultDimension": "1*2",
588    "supportDimensions": [
589      "1*2"
590    ],
591    "landscapeLayouts": [
592      "$layout:ability_form"
593    ],
594    "portraitLayouts": [
595      "$layout:ability_form"
596    ],
597    "formConfigAbility": "ability://com.example.myapplication.fa/.EntryAbility",
598    "metaData": {
599      "customizeData": [
600        {
601          "name": "originWidgetName",
602          "value": "com.example.weather.testWidget"
603        }
604      ]
605    }
606  }
607]
608```
609
610## Internal Structure of the distroFilter Attribute
611
612**Table 21** Internal structure of the distroFilter attribute
613
614| Name| Description| Data Type| Initial Value Allowed|
615| -------- | -------- | -------- | -------- |
616| apiVersion | Supported API versions.| Object array| Yes (initial value: left empty)|
617|screenShape | Supported screen shapes.| Object array| Yes (initial value: left empty)|
618| 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)|
619|screenDensity | Pixel density of the screen, in dots per inch (DPI).| Object array| Yes (initial value: left empty)|
620| 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)|
621
622## Internal Structure of the apiVersion Attribute
623
624**Table 22** Internal structure of the apiVersion attribute
625
626| Name| Description| Data Type| Initial Value Allowed|
627| -------- | -------- | -------- | -------- |
628| 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|
629| 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|
630
631## Internal Structure of the screenShape Attribute
632
633**Table 23** Internal structure of the screenShape attribute
634
635| Name| Description| Data Type| Initial Value Allowed|
636| -------- | -------- | -------- | -------- |
637| 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|
638| 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|
639
640## Internal Structure of the screenWindow Attribute
641
642**Table 24** Internal structure of the screenWindow attribute
643
644| Name| Description| Data Type| Initial Value Allowed|
645| -------- | -------- | -------- | -------- |
646| 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|
647| 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|
648
649## Internal Structure of the screenDensity Attribute
650
651**Table 25** Internal structure of the screenDensity attribute
652
653| Name| Description| Data Type| Initial Value Allowed|
654| -------- | -------- | -------- | -------- |
655| 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|
656| value | 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|
657
658## Internal Structure of the countryCode attribute
659
660**Table 26** Internal structure of the countryCode attribute
661
662| Name| Description| Data Type| Initial Value Allowed|
663| -------- | -------- | -------- | -------- |
664| 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|
665| 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|
666
667
668Example of the **distroFilter** attribute structure:
669
670```json
671"distroFilter":  {
672  "apiVersion": {
673    "policy": "include",
674    "value": [4,5]
675  },
676  "screenShape": {
677    "policy": "include",
678    "value": ["circle","rect"]
679  },
680  "screenWindow": {
681    "policy": "include",
682    "value": ["454*454","466*466"]
683  },
684  "screenDensity":{
685    "policy": "exclude",
686    "value": ["ldpi","xldpi"]
687  },
688  "countryCode": {
689    "policy":"include",
690    "value":["CN","HK"]
691  }
692}
693```
694
695## Internal Structure of the commonEvents Attribute
696
697**Table 27** Internal structure of the commonEvents attribute
698
699| Name| Description| Data Type| Initial Value Allowed|
700| -------- | -------- | -------- | -------- |
701| name | Name of the static common event. The value can contain a maximum of 127 bytes.| String| No|
702| permission | Permission required to implement static common events. The value can contain a maximum of 255 bytes.| String| Yes (initial value: left empty)|
703| data | Additional data array to be carried by the current static common event.| String array| Yes (initial value: left empty)|
704| type | Type array of the current static common event.| String array| Yes (initial value: left empty)|
705| events | A set of events for the wants that can be received. The value can be system predefined or custom.| String array| No|
706
707
708Example of the **commonEvents** attribute structure:
709
710```json
711"commonEvents": [
712  {
713    "name": ".EntryAbility",
714    "permission": "ohos.permission.GET_BUNDLE_INFO",
715    "data": [
716      "com.example.demo",
717      "100"
718    ],
719    "events": [
720      "install",
721      "update"
722    ]
723  }
724]
725```
726
727## Internal Structure of the testRunner Attribute
728
729**Table 28** Internal structure of the testRunner attribute
730
731| Name| Description| Data Type| Initial Value Allowed|
732| -------- | -------- | -------- | -------- |
733| name | Name of the test runner object. The value can contain a maximum of 255 bytes.| String| No|
734| srcPath | Code path of the test runner. The maximum length of this tag is 255 bytes.| String| No|
735
736```json
737"testRunner": {
738  "name": "myTestRunnerName",
739  "srcPath": "etc/test/TestRunner.ts"
740}
741```
742
743
744**definePermission** applies only to system applications and does not take effect for third-party applications.
745
746## Internal Structure of the definePermissions Attribute
747**Table 29** Internal structure of the definePermissions attribute
748
749| Name| Description| Data Type| Initial Value Allowed|
750| -------- | -------- | -------- | -------- |
751| name | Name of a permission. The value can contain a maximum of 255 bytes.| String| No|
752| 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"**)|
753| 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"**)|
754| 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**)|
755| distributedSceneEnabled | Whether the permission can be used in distributed scenarios.| Boolean| Yes (initial value: **false**)|
756| label | Brief description of the permission. The value is a resource index to the description.| String| Yes (initial value: left empty)|
757| 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)|
758