• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 | 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| 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| Device Type| Value| Description|
186| -------- | -------- | -------- |
187| Tablet| tablet | - |
188| Smart TV| tv | - |
189| Smart watch| wearable | Watch that provides call features.|
190| Head unit| car | - |
191| Default device| default | Device that provides full access to system capabilities.|
192
193## Internal Structure of the abilities Attribute
194
195**Table 8** Internal structure of the abilities attribute
196
197| Name| Description| Data Type| Initial Value Allowed|
198| -------- | -------- | -------- | -------- |
199| 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)|
200| 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.<br>**NOTE**<br>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|
201| 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)|
202| 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)|
203| 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**<br>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)|
204| 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)|
205| 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, head unit, and wearable device types.| String| Yes (initial value: **"singleton"**)|
206| 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**)|
207| 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)|
208|skills | Types of the **want** that can be accepted by the ability.| Object array| Yes (initial value: left empty)|
209| 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)|
210| metaData | Metadata.| Object| Yes (initial value: left empty)|
211| 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|
212| 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"**)|
213| 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)|
214| grantPermission | Whether permissions can be granted for any data in the ability.| Boolean| Yes (initial value: left empty)|
215| 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)|
216| 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)|
217| 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)|
218| 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)|
219| 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)|
220| 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**)|
221| 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)|
222| 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"**)|
223| srcPath | JS code path corresponding to the ability. The value can contain a maximum of 127 bytes.| String| No|
224| 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)|
225| 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)|
226| 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)|
227| 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**)|
228
229
230**Application icons cannot be hidden from the home screen.**
231
232The system strictly controls applications without icons to prevent malicious applications from deliberately configuring no icon to block uninstall attempts.
233
234**Setting the application icon to be displayed on the home screen**:
235
236Set **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**.
237
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 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). 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**
286>
287> 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.
288
289## Internal Structure of the uriPermission Attribute
290
291**Table 9** Internal structure of the uriPermission attribute
292
293| Name| Description| Data Type| Initial Value Allowed|
294| -------- | -------- | -------- | -------- |
295| path | Path. The value can contain maximum of 255 bytes.| String| No|
296| mode | Matching mode.| String| Yes (initial value: **default**)|
297
298
299Example of the **abilities** attribute structure:
300
301```json
302"abilities": [
303  {
304    "name": ".EntryAbility",
305    "description": "test main ability",
306    // $media:ic_launcher is a media resource.
307    "icon": "$media:ic_launcher",
308    // $string:example is a string resource.
309    "label": "$string:example",
310    "launchType": "multiton",
311    "orientation": "unspecified",
312    "permissions": [],
313    "visible": true,
314    "skills": [
315      {
316        "actions": [
317          "action.system.home"
318        ],
319        "entities": [
320          "entity.system.home"
321        ]
322      }
323    ],
324    "configChanges": [
325      "locale",
326      "layout",
327      "fontSize",
328      "orientation"
329    ],
330    "type": "page",
331    "startWindowIcon": "$media:icon",
332    "startWindowBackground": "$color:red",
333    "removeMissionAfterTerminate": true
334  },
335  {
336    "name": ".PlayService",
337    "description": "example play ability",
338    "icon": "$media:ic_launcher",
339    "label": "$string:example",
340    "launchType": "multiton",
341    "orientation": "unspecified",
342    "visible": false,
343    "skills": [
344      {
345        "actions": [
346          "action.play.music",
347          "action.stop.music"
348        ],
349        "entities": [
350          "entity.audio"
351        ]
352      }
353    ],
354    "type": "service",
355    "backgroundModes": [
356      "audioPlayback"
357    ]
358  },
359  {
360    "name": ".UserADataAbility",
361    "type": "data",
362    "uri": "dataability://com.example.world.test.UserADataAbility",
363    "visible": true
364  }
365]
366```
367## Internal Structure of the skills Attribute
368
369**Table 10** Internal structure of the skills attribute
370
371| Name| Description| Data Type| Initial Value Allowed|
372| -------- | -------- | -------- | -------- |
373| 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)|
374| 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)|
375| 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)|
376
377## Internal Structure of the uris Attribute
378
379**Table 11** Internal structure of the uris attribute
380
381| Name| Description| Data Type| Initial Value Allowed|
382| -------- | -------- | -------- | -------- |
383| scheme | Scheme of the URI.| String| No|
384| host | Host value of the URI.| String| Yes (initial value: left empty)|
385| port | Port number of the URI.| String| Yes (initial value: left empty)|
386| pathStartWith | **pathStartWith** value of the URI.| String| Yes (initial value: left empty)|
387| path | **path** value of the URI.| String| Yes (initial value: left empty)|
388| pathRegx | **pathRegx** value of the URI.| String| Yes (initial value: left empty)|
389| 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)|
390
391
392Example of the **skills** attribute structure:
393
394```json
395"skills": [
396  {
397    "actions": [
398      "action.system.home"
399    ],
400    "entities": [
401      "entity.system.home"
402    ],
403    "uris": [
404      {
405        "scheme": "http",
406        "host": "www.example.com",
407        "port": "8080",
408        "path": "query/student/name",
409        "type": "text/*"
410      }
411    ]
412  }
413]
414```
415
416## Internal Structure of the reqPermissions Attribute
417
418**Table 12** Internal structure of the reqPermissions attribute
419
420| Name| Description| Data Type| Initial Value Allowed|
421| -------- | -------- | -------- | -------- |
422| name | Name of the permission to request.| String| No|
423| 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.|
424| 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|
425
426## Internal Structure of the usedScene Attribute
427
428**Table 13** Internal structure of the usedScene attribute
429
430| Name| Description| Data Type| Initial Value Allowed|
431| -------- | -------- | -------- | -------- |
432| ability | Names of abilities that require the permission.| String array| Yes (initial value: all ability names)|
433| 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)|
434
435## Internal Structure of the js Attribute
436
437**Table 14** Internal structure of the js attribute
438
439| Name| Description| Data Type| Initial Value Allowed|
440| -------- | -------- | -------- | -------- |
441| name | Name of the JavaScript component.| String| No|
442| 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|
443| window | Window-related configurations.| Object| Yes (initial value: see Table 15)|
444| 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"**)|
445|mode | Development mode of the JS component.| Object| Yes (initial value: left empty)|
446
447## Internal Structure of the window Attribute
448
449**Table 15** Internal structure of the window attribute
450
451| Name| Description| Data Type| Initial Value Allowed|
452| -------- | -------- | -------- | -------- |
453| designWidth | Baseline width for page design. The size of an element is scaled by the actual device width.| Number| Yes (initial value: 720px)|
454| 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**)|
455
456## Internal Structure of the mode Attribute
457
458**Table 16** Internal structure of the mode attribute
459
460| Name| Description| Data Type| Initial Value Allowed|
461| -------- | -------- | -------- | -------- |
462| type | Type of the JS component. The value can be **pageAbility** or **form**.| String| Yes (initial value: **pageAbility**)|
463| syntax | Syntax type of the JS component. The value can be **"hml"** or **"ets"**.| String| Yes (initial value: **"hml"**)|
464
465
466Example of the **js** attribute structure:
467
468```json
469"js": [
470  {
471    "name": ".EntryAbility",
472    "pages": [
473      "pages/index",
474      "pages/detail/detail"
475    ],
476    "window": {
477      "designWidth": 720,
478      "autoDesignWidth": false
479    },
480    "type": "form",
481    "mode": {
482      "syntax": "ets",
483      "type": "pageAbility"
484    }
485  }
486]
487```
488
489## Internal Structure of the shortcuts Attribute
490
491**Table 17** Internal structure of the shortcuts attribute
492
493| Name| Description| Data Type| Initial Value Allowed|
494| -------- | -------- | -------- | -------- |
495| shortcutId | ID of the shortcut. The value is a string with a maximum of 63 bytes.| String| No|
496| 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)|
497| icon | Icon of the shortcut. The value is a resource index to the description.| String| Yes (initial value: left empty)|
498| intents | Wants to which the shortcut points. The attribute consists of the **targetClass** and **targetBundle** sub-attributes.| Object array| Yes (initial value: left empty)|
499
500## Internal Structure of the intents Attribute
501
502**Table 18** Internal structure of the intents attribute
503
504| Name| Description| Data Type| Initial Value Allowed|
505| -------- | -------- | -------- | -------- |
506| targetClass | Target class of the shortcut.| String| Yes (initial value: left empty)|
507| targetBundle | Application bundle name for the target ability of the shortcut.| String| Yes (initial value: left empty)|
508
509
510Example of the **shortcuts** attribute structure:
511
512```json
513"shortcuts": [
514  {
515    "shortcutId": "id",
516    // $string:shortcut is a string resource index.
517    "label": "$string:shortcut",
518    "intents": [
519      {
520        "targetBundle": "com.example.world.test",
521        "targetClass": "com.example.world.test.entry.EntryAbility"
522      }
523    ]
524  }
525]
526```
527
528## Internal Structure of the forms Attribute
529
530**Table 19** Internal structure of the forms attribute
531
532| Name| Description| Data Type| Initial Value Allowed|
533| -------- | -------- | -------- | -------- |
534| name | Class name of the widget. The value is a string with a maximum of 127 bytes.| String| No|
535| 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)|
536| 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|
537| type | Type of the widget. The options are as follows:<br>**JS**: JavaScript widget.<br>**Java**: Java widget.| String| No|
538| 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**)|
539| 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|
540| defaultDimension | Default grid style of the widget. The value must be from the **supportDimensions** array of the widget.| String| No|
541| 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|
542| scheduledUpdateTime | Scheduled time to update the widget. The value is in 24-hour format and accurate to minute.| String| Yes (initial value: **"0:0"**)|
543| 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**)|
544| formConfigAbility | Name of the ability used to adjust the widget.| String| Yes (initial value: left empty)|
545| 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)|
546| metaData | Metadata of the widget. This attribute contains the array of the **customizeData** attribute.| Object| Yes (initial value: left empty)|
547| formVisibleNotify | Whether the widget is allowed to use the widget visibility notification.<br>**true**: allowed<br>**false**: not allowed| Boolean| Yes (initial value: **false**)|
548
549## Internal Structure of the customizeData Attribute
550
551**Table 20** Internal structure of the customizeData attribute
552
553| Name| Description| Data Type| Initial Value Allowed|
554| -------- | -------- | -------- | -------- |
555| 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)|
556| value | Value of the data item. The value is a string with a maximum of 255 bytes.| String| Yes (initial value: left empty)|
557| extra | Format of the current custom data. The value is the resource value of **extra**.| String| Yes (initial value: left empty)|
558
559
560Example of the **forms** attribute structure:
561
562```json
563"forms": [
564  {
565    "name": "Form_Js",
566    "description": "It's Js Form",
567    "type": "JS",
568    "jsComponentName": "card",
569    "colorMode": "auto",
570    "isDefault": true,
571    "updateEnabled": true,
572    "scheduledUpdateTime": "11:00",
573    "updateDuration": 1,
574    "defaultDimension": "2*2",
575    "supportDimensions": [
576      "2*2",
577      "2*4",
578      "4*4"
579    ]
580  },
581  {
582    "name": "Form_Js",
583    "description": "It's JS Form",
584    "type": "Js",
585    "colorMode": "auto",
586    "isDefault": false,
587    "updateEnabled": true,
588    "scheduledUpdateTime": "21:05",
589    "updateDuration": 1,
590    "defaultDimension": "1*2",
591    "supportDimensions": [
592      "1*2"
593    ],
594    "landscapeLayouts": [
595      "$layout:ability_form"
596    ],
597    "portraitLayouts": [
598      "$layout:ability_form"
599    ],
600    "formConfigAbility": "ability://com.example.myapplication.fa/.EntryAbility",
601    "metaData": {
602      "customizeData": [
603        {
604          "name": "originWidgetName",
605          "value": "com.example.weather.testWidget"
606        }
607      ]
608    }
609  }
610]
611```
612
613## Internal Structure of the distroFilter Attribute
614
615**Table 21** Internal structure of the distroFilter attribute
616
617| Name| Description| Data Type| Initial Value Allowed|
618| -------- | -------- | -------- | -------- |
619| apiVersion | Supported API versions.| Object array| Yes (initial value: left empty)|
620|screenShape | Supported screen shapes.| Object array| Yes (initial value: left empty)|
621| 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)|
622|screenDensity | Pixel density of the screen, in dots per inch (DPI).| Object array| Yes (initial value: left empty)|
623| 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)|
624
625## Internal Structure of the apiVersion Attribute
626
627**Table 22** Internal structure of the apiVersion attribute
628
629| Name| Description| Data Type| Initial Value Allowed|
630| -------- | -------- | -------- | -------- |
631| 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|
632| 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|
633
634## Internal Structure of the screenShape Attribute
635
636**Table 23** Internal structure of the screenShape attribute
637
638| Name| Description| Data Type| Initial Value Allowed|
639| -------- | -------- | -------- | -------- |
640| 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|
641| 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|
642
643## Internal Structure of the screenWindow Attribute
644
645**Table 24** Internal structure of the screenWindow attribute
646
647| Name| Description| Data Type| Initial Value Allowed|
648| -------- | -------- | -------- | -------- |
649| 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|
650| 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|
651
652## Internal Structure of the screenDensity Attribute
653
654**Table 25** Internal structure of the screenDensity attribute
655
656| Name| Description| Data Type| Initial Value Allowed|
657| -------- | -------- | -------- | -------- |
658| 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|
659| 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|
660
661## Internal Structure of the countryCode attribute
662
663**Table 26** Internal structure of the countryCode attribute
664
665| Name| Description| Data Type| Initial Value Allowed|
666| -------- | -------- | -------- | -------- |
667| 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|
668| 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|
669
670
671Example of the **distroFilter** attribute structure:
672
673```json
674"distroFilter":  {
675  "apiVersion": {
676    "policy": "include",
677    "value": [4,5]
678  },
679  "screenShape": {
680    "policy": "include",
681    "value": ["circle","rect"]
682  },
683  "screenWindow": {
684    "policy": "include",
685    "value": ["454*454","466*466"]
686  },
687  "screenDensity":{
688    "policy": "exclude",
689    "value": ["ldpi","xldpi"]
690  },
691  "countryCode": {
692    "policy":"include",
693    "value":["CN","HK"]
694  }
695}
696```
697
698## Internal Structure of the commonEvents Attribute
699
700**Table 27** Internal structure of the commonEvents attribute
701
702| Name| Description| Data Type| Initial Value Allowed|
703| -------- | -------- | -------- | -------- |
704| name | Name of the static common event. The value can contain a maximum of 127 bytes.| String| No|
705| permission | Permission required to implement static common events. The value can contain a maximum of 255 bytes.| String| Yes (initial value: left empty)|
706| data | Additional data array to be carried by the current static common event.| String array| Yes (initial value: left empty)|
707| type | Type array of the current static common event.| String array| Yes (initial value: left empty)|
708| events | A set of events for the wants that can be received. The value can be system predefined or custom.| String array| No|
709
710
711Example of the **commonEvents** attribute structure:
712
713```json
714"commonEvents": [
715  {
716    "name": ".EntryAbility",
717    "permission": "ohos.permission.GET_BUNDLE_INFO",
718    "data": [
719      "com.example.demo",
720      "100"
721    ],
722    "events": [
723      "install",
724      "update"
725    ]
726  }
727]
728```
729
730## Internal Structure of the testRunner Attribute
731
732**Table 28** Internal structure of the testRunner attribute
733
734| Name| Description| Data Type| Initial Value Allowed|
735| -------- | -------- | -------- | -------- |
736| name | Name of the test runner object. The value can contain a maximum of 255 bytes.| String| No|
737| srcPath | Code path of the test runner. The maximum length of this tag is 255 bytes.| String| No|
738
739```json
740"testRunner": {
741  "name": "myTestRunnerName",
742  "srcPath": "etc/test/TestRunner.ts"
743}
744```
745
746
747**definePermission** applies only to system applications and does not take effect for third-party applications.
748
749## Internal Structure of the definePermissions Attribute
750**Table 29** Internal structure of the definePermissions attribute
751
752| Name| Description| Data Type| Initial Value Allowed|
753| -------- | -------- | -------- | -------- |
754| name | Name of a permission. The value can contain a maximum of 255 bytes.| String| No|
755| 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"**)|
756| 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"**)|
757| 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**)|
758| distributedSceneEnabled | Whether the permission can be used in distributed scenarios.| Boolean| Yes (initial value: **false**)|
759| label | Brief description of the permission. The value is a resource index to the description.| String| Yes (initial value: left empty)|
760| 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)|
761