• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# module.json5 Configuration File
2
3## Configuration File Example
4
5This topic gives an overview of the **module.json5** configuration file. To start with, let's go through an example of what this file contains.
6<!--RP1-->
7```json
8{
9  "module": {
10    "name": "entry",
11    "type": "entry",
12    "description": "$string:module_desc",
13    "srcEntry": "./ets/entryability/EntryAbility.ets",
14    "mainElement": "EntryAbility",
15    "deviceTypes": [
16      "default",
17      "tablet"
18    ],
19    "deliveryWithInstall": true,
20    "installationFree": false,
21    "pages": "$profile:main_pages",
22    "virtualMachine": "ark",
23    "appStartup": "$profile:app_startup_config",
24    "metadata": [
25      {
26        "name": "string",
27        "value": "string",
28        "resource": "$profile:distributionFilter_config"
29      }
30    ],
31    "abilities": [
32      {
33        "name": "EntryAbility",
34        "srcEntry": "./ets/entryability/EntryAbility.ets",
35        "description": "$string:EntryAbility_desc",
36        "icon": "$media:layered_image",
37        "label": "$string:EntryAbility_label",
38        "startWindow": "$profile:start_window",
39        "startWindowIcon": "$media:icon",
40        "startWindowBackground": "$color:start_window_background",
41        "exported": true,
42        "skills": [
43          {
44            "entities": [
45              "entity.system.home"
46            ],
47            "actions": [
48              "ohos.want.action.home"
49            ]
50          }
51        ],
52        "continueType": [
53          "continueType1"
54        ],
55        "continueBundleName": [
56          "com.example.myapplication1",
57          "com.example.myapplication2"
58        ]
59      }
60    ],
61    "definePermissions": [
62      {
63        "name": "ohos.abilitydemo.permission.PROVIDER",
64        "grantMode": "system_grant",
65        "availableLevel": "system_core",
66        "provisionEnable": true,
67        "distributedSceneEnable": false,
68        "label": "$string:EntryAbility_label"
69      }
70    ],
71    "requestPermissions": [
72      {
73        "name": "ohos.abilitydemo.permission.PROVIDER",
74        "reason": "$string:reason",
75        "usedScene": {
76          "abilities": [
77            "FormAbility"
78          ],
79          "when": "inuse"
80        }
81      }
82    ],
83    "targetModuleName": "feature",
84    "targetPriority": 50,
85    "querySchemes": [
86      "app1Scheme",
87      "app2Scheme"
88    ],
89    "routerMap": "$profile:router_map",
90    "appEnvironments": [
91      {
92        "name": "name1",
93        "value": "value1"
94      }
95    ],
96    "hnpPackages": [
97      {
98        "package": "hnpsample.hnp",
99        "type": "public"
100      }
101    ],
102    "fileContextMenu": "$profile:menu"
103  }
104}
105```
106<!--RP1End-->
107
108## Tags in the Configuration File
109
110As shown above, the **module.json5** file contains several tags.
111
112
113  **Table 1** Tags in the module.json5 file
114
115| Name| Description| Data Type| Initial Value Allowed|
116| -------- | -------- | -------- | -------- |
117| name | Name of the module. This name must be unique in the entire application. The value must comply with the following rules:<br>- Starts with a letter and consists of letters, digits, underscores (_).<br>- The maximum length is 31 bytes.<br>This name can be changed during application updates. However, if it is changed, directories related to the module must be migrated. You can use the [file operation API](../reference/apis-core-file-kit/js-apis-file-fs.md#fscopydir10) for migration.| String| No|
118| type | Type of the module. The options are as follows:<br>- **entry**: main module of the application.<br>- **feature**: feature module of the application.<br>- **har**: static shared module.<br>- **shared**: dynamic shared module.| String| No|
119| srcEntry | Code path of the entry UIAbility or ExtensionAbility of the module. The value must point to the same UIAbility or ExtensionAbility as the **mainElement** field. The value is a string of a maximum of 127 bytes.| String| Yes (initial value: left empty)|
120| description | Description of the module, used to describe the module functions. The value is a string of a maximum of 255 bytes. It can be a resource reference.| String| Yes (initial value: left empty)|
121| <!--DelRow-->process | Process name of the module. The value is a string with a maximum of 31 bytes. If **process** is configured under **HAP**, all UIAbilities, DataShareExtensionAbilities, and ServiceExtensionAbilities of the module will run in the specified process.<br>**NOTE**<br>The [device-specific application privileges](../../device-dev/subsystems/subsys-app-privilege-config-guide.md#device-specific-application-privileges) takes effect, but the third-party application configuration does not take effect.| String| Yes (initial value: value of **bundleName** under **app** in the **app.json5** file)|
122| mainElement | Name of the entry UIAbility or ExtensionAbility of the module. The value must point to the same UIAbility or ExtensionAbility as the **srcEntry** field. The value is a string with a maximum of 255 bytes.| String| Yes (initial value: left empty)|
123| [deviceTypes](#devicetypes) | Types of the devices on which the module can run.<br>**NOTE**<br>When there are multiple modules, the configuration of each module can be different, but the required device type must be included to ensure the proper running.| String array| No|
124| deliveryWithInstall | Whether the HAP of the module is installed together with the application.<br>- **true**: The HAP of the module is installed together with the application.<br>- **false**: The HAP of the module is not installed together with the application.| Boolean| No|
125| installationFree | Whether the module supports the installation-free feature.<br>- **true**: The module supports the installation-free feature and meets installation-free constraints.<br>- **false**: The module does not support the installation-free feature.<br>**NOTE**<br>If [bundleType](./app-configuration-file.md#tags-in-the-configuration-file) is set to **atomicService**, set this tag to **true**. Otherwise, set this tag to <b class="+ topic/ph hi-d/b " id="b1842016483597">false</b>.| Boolean| No|
126| virtualMachine | Type of the target virtual machine (VM) where the module can run. It is used for cloud distribution, such as distribution by the application market and distribution center. If the target VM type is ArkTS engine, the value is **ark**+*version number*.| String| Yes (initial value: automatically inserted when DevEco Studio builds the HAP file)|
127| [pages](#pages)| Profile that represents information about each page in the module. The value is a string with a maximum of 255 bytes.| String| No in the UIAbility scenario|
128| [metadata](#metadata)| Custom metadata of the module. You can configure [distributionFilter](#distributionfilter) and [shortcuts](#shortcuts) by referencing resources. The setting is effective only for the current module, UIAbility, and ExtensionAbility.| Object array| Yes (initial value: left empty)|
129| [abilities](#abilities) | UIAbility configuration of the module. The setting is effective only for the current UIAbility.| Object array| Yes (initial value: left empty)|
130| [extensionAbilities](#extensionabilities) | ExtensionAbility configuration of the module. The setting is effective only for the current ExtensionAbility.| Object array| Yes (initial value: left empty)|
131| [definePermissions](#definepermissions) | Permissions defined for the system resource HAP. Custom permissions are not supported.| Object array| Yes (initial value: left empty)|
132| [requestPermissions](../security/AccessToken/declare-permissions.md#declaring-permissions-in-the-configuration-file)| A set of permissions that the application needs to request from the system for running correctly.| Object array| Yes (initial value: left empty)|
133| [testRunner](#testrunner) | Test runner of the module.| Object| Yes (initial value: left empty)|
134| [atomicService](#atomicservice)| Atomic service configuration.| Object| Yes (initial value: left empty) |
135| [dependencies](#dependencies)| List of shared libraries on which the module depends during running.| Object array| Yes (initial value: left empty) |
136| targetModuleName | Target module name of the bundle. This name must be unique in the entire application. The value is a string with a maximum of 31 bytes. The module that has this tag set provides the overlay feature. This tag is applicable only to HSPs.|String|Yes (initial value: left empty)|
137| targetPriority | Priority of the module. The value ranges from 1 to 100. This tag is required only when **targetModuleName** is set. This tag is applicable only to HSPs.|Integer|Yes (initial value: **1**)|
138| [proxyData](#proxydata) | List of data proxies provided by the module.| Object array| Yes (initial value: left empty)|
139| isolationMode | Multi-process configuration of the module. The options are as follows:<br>- **nonisolationFirst**: The module preferentially runs in a non-independent process.<br>- **isolationFirst**: The module preferentially runs in an independent process.<br>- **isolationOnly**: The module runs only in an independent process.<br>- **nonisolationOnly**: The module runs only in a non-independent process.|String|Yes (initial value: **nonisolationFirst**)|
140| generateBuildHash |Whether the hash value of the HAP or HSP is generated by the packing 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 **versionCode** value of the application remains unchanged.<br>This tag is enabled only when the **generateBuildHash** tag in the [app.json5](./app-configuration-file.md) file is **false**.<br>**NOTE**<br>This tag applies only to system applications.|Boolean|Yes (initial value: **false**)|
141| compressNativeLibs | During HAP packaging, whether the **libs** libraries are packaged to HAP after being compressed.<br>- **true**: The **libs** libraries are packaged in the HAP file after being compressed.<br>- **false**: The **libs** libraries are stored without being compressed.| Boolean| Yes (During HAP packaging, initial value: **false**;|
142| libIsolation | Whether to save the .so files of the current HAP to a separate folder. 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**)|
143| fileContextMenu | Context menu of the current HAP. The value is a string with a maximum of 255 bytes.| String| Yes (initial value: left empty)|
144| querySchemes | URL schemes that the current application can query for redirection. This tag is only available for the entry modules. A maximum of 50 URL schemes can be configured, with each containing a maximum of 128 bytes.| String array| Yes (initial value: left empty)|
145| [routerMap](#routermap) | Path of the routing table for the current module. The value is a string with a maximum of 255 bytes.| String| Yes (initial value: left empty)|
146| [appEnvironments](#appenvironments) | Application environments for the current module. This tag is only available for the entry and feature modules.| Object array| Yes (initial value: left empty)|
147| appStartup | Configuration path of the current module startup framework, which takes effect in the entry-type HAP, HSP, and HAR.| String| Yes (initial value: left empty)|
148| [hnpPackages](#hnppackages) | Native software package information of the current application. This tag is only available for the entry modules.| Object array| Yes (initial value: left empty)|
149
150## deviceTypes
151
152  **Table 2** deviceTypes
153<!--RP2-->
154| Device Type| Value| Description|
155| -------- | -------- | -------- |
156| Tablet| tablet | - |
157| Smart TV| tv | - |
158| Smart watch| wearable | Watch that provides call features.|
159| Head unit| car | - |
160| PC/2-in-1 device| 2in1 | PC, mainly used for multi-window and multi-task interactions, and keyboard and mouse operations. It fully showcases the device productivity. In the OpenHarmony topics, "2-in-1" indicates PC/2-in-1 device.|
161| Default device| default | Device that provides full access to system capabilities.|
162<!--RP2End-->
163
164Example of the **deviceTypes** structure:
165
166
167```json
168{
169  "module": {
170    "name": "myHapName",
171    "type": "feature",
172    "deviceTypes" : [
173       "tablet"
174    ]
175  }
176}
177```
178
179
180## pages
181
182The **pages** tag is a profile that represents information about specified pages.
183
184
185```json
186{
187  "module": {
188    // ...
189    "pages": "$profile:main_pages", // Configured through the resource file in the profile
190  }
191}
192```
193
194Define the **main_pages.json** file under **resources/base/profile** in the development view. The file name (**main_pages** in this example) can be customized, but must be consistent with the information specified by the **pages** tag. The file lists the page information of the current application, including the route information and the window-related configuration.
195
196  **Table 3** pages
197
198| Name| Description| Data Type| Initial Value Allowed|
199| -------- | -------- | -------- | -------- |
200| src | Route information about all pages in the module, including the page path and page name. The page path is relative to the **src/main/ets** directory of the current module. The value is a string array, each element of which represents a page.| String array| No|
201| window | Window-related configuration.	 | Object| Yes (initial value: left empty)|
202
203
204  **Table 4** window
205
206| Name| Description| Data Type| Initial Value Allowed|
207| -------- | -------- | -------- | -------- |
208| designWidth | Baseline width for page design. The size of an element is scaled by the actual device width.| Number| Yes (initial value: **720px**)|
209| 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**)|
210
211```json
212{
213  "src": [
214    "pages/index/mainPage",
215    "pages/second/payment",
216    "pages/third/shopping_cart",
217    "pages/four/owner"
218  ],
219  "window": {
220    "designWidth": 720,
221    "autoDesignWidth": false
222  }
223}
224```
225
226
227## metadata
228
229The **metadata** tag represents the custom metadata of the HAP. The tag value is an array and contains three subtags: **name**, **value**, and **resource**.
230
231**Table 5** metadata
232
233| Name| Description| Data Type| Initial Value Allowed|
234| -------- | -------- | -------- | -------- |
235| name | Name of the data item. The value is a string with a maximum of 255 bytes.| String| Yes (initial value: left empty)|
236| value | Value of the data item. The value is a string with a maximum of 255 bytes.| String| Yes (initial value: left empty)|
237| resource | Custom data format. The value is a resource index. It contains a maximum of 255 bytes.| String| Yes (initial value: left empty)|
238
239The **metadata** tag can be used to configure the default size and position (in vp) of the main window in the format of alignment mode +/- offset. The name **ohos.ability.window.height** indicates the default height, **ohos.ability.window.width** indicates the default width, and **ohos.ability.window.left** indicates the default left position,|with alignment modes including **center**, **left** (default), and **right**. If the offset is **0**, this parameter can be omitted. The name **ohos.ability.window.top** indicates the position of the top, with alignment modes including **center**, **top** (default), and **bottom**. If both **weight** and **height** are omitted, the system default size is used.
240
241The **metadata** tag can be used to configure the enabling function of removing the startup page. The name **enable.remove.starting.window** can be set to **true** or **false**. If the value is left empty, the default value **false** is used.
242
243The value of **resource** is in the format of $profile:file name, where **\$profile** indicates that the resource is placed under **/resources/base/profile** in the project directory. For example, **\$profile:shortcuts_config** indicates the **/resources/base/profile/shortcuts_config.json** file.
244
245```json
246{
247  "module": {
248    "metadata": [{
249      "name": "module_metadata",
250      "value": "a test demo for module metadata",
251      "resource": "$profile:shortcuts_config"
252    }],
253
254    "abilities": [{
255      "metadata": [{
256        "name": "ability_metadata",
257        "value": "a test demo for ability",
258        "resource": "$profile:config_file"
259      },
260      {
261        "name": "ability_metadata_2",
262        "value": "a string test",
263        "resource": "$profile:config_file"
264      },
265      {
266        "name": "ohos.ability.window.height",
267        "value": "987"
268      },
269      {
270        "name": "ohos.ability.window.width",
271        "value": "1300"
272      },
273      {
274        "name": "ohos.ability.window.left",
275        "value": "right-50"
276      },
277      {
278        "name": "ohos.ability.window.top",
279        "value": "center+50"
280      },
281      {
282        "name": "enable.remove.starting.window",
283        "value": "true"
284      }],
285    }],
286
287    "extensionAbilities": [{
288      "metadata": [{
289        "name": "extensionAbility_metadata",
290        "value": "a test for extensionAbility",
291        "resource": "$profile:config_file"
292      },
293      {
294        "name": "extensionAbility_metadata_2",
295        "value": "a string test",
296        "resource": "$profile:config_file"
297      }],
298    }]
299  }
300}
301```
302
303
304## abilities
305
306The **abilities** tag represents the UIAbility configuration of the module, which is valid only for the current UIAbility component.
307
308  **Table 6** abilities
309
310| Name| Description| Data Type| Initial Value Allowed|
311| -------- | -------- | -------- | -------- |
312| name | Name of the UIAbility. This name must be unique in the entire application. The value is a string with a maximum of 127 bytes.| String| No|
313| srcEntry | Code path of the entry UIAbility. The value is a string with a maximum of 127 bytes.| String| No|
314| [launchType](../application-models/uiability-launch-type.md) | Launch type of the UIAbility. The options are as follows:<br>- **multiton**: A UIAbility instance is created each time the UIAbility is started.<br>- **singleton**: A UIAbility instance is created only when the UIAbility is started for the first time.<br>- **specified**: You can determine whether to create a UIAbility instance when the application is running.<br>- **standard**: original name of **multiton**. The effect is the same as that multition mode.| String| Yes (initial value: **"singleton"**)|
315| description | Description of the UIAbility component, used to describe the component functions. The value is a string with a maximum of 255 bytes. It must be a resource index to support multiple languages.| String| Yes (initial value: left empty)|
316| icon | [Icon](../application-models/application-component-configuration-stage.md#generation-mechanism) of the UIAbility component. The value is the index of the icon resource file.| String| Yes (initial value: left empty)|
317| label | [Name](../application-models/application-component-configuration-stage.md#generation-mechanism) of the UIAbility component displayed to users. The resource index of the name must be used to support multiple languages. The value is a string with a maximum of 255 bytes.| String| Yes (initial value: left empty)|
318| permissions | Permissions required for another application to access the UIAbility.<br>The value is generally in the reverse domain name notation and contains a maximum of 255 bytes. It is an array of predefined permission names.| String array| Yes (initial value: left empty)|
319| [metadata](#metadata)| Metadata information of the UIAbility component.| Object array| Yes (initial value: left empty)|
320| exported | Whether the UIAbility can be called by other applications.<br>- **true**: The ExtensionAbility can be called by other applications.<br>- **false**: The UIAbility cannot be called by other applications, not even by aa commands.| Boolean| Yes (initial value: **false**)|
321| continuable | Whether the UIAbility can be continued on another device.<br>- **true**: The UIAbility can be continued on another device.<br>- **false**: The UIAbility cannot be continued on another device.| Boolean| Yes (initial value: **false**)|
322| [skills](#skills) | A set of [wants](../application-models/want-overview.md) that can be received by the UIAbility or ExtensionAbility.<br>Configuration rules:<br>- For HAPs of the entry type, you can configure multiple **skills** attributes with the entry capability for an application. (A **skills** attribute with the entry capability is the one that has **ohos.want.action.home** and **entity.system.home** configured.)<br>- For HAPs of the feature type, you can configure the **skills** attribute with the entry capability for an application, but not for a service.| Object array| Yes (initial value: left empty)|
323| backgroundModes | Continuous tasks of the UIAbility.<br>Continuous tasks are classified into the following types:<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>- **location**: location and navigation<br>- **bluetoothInteraction**: Bluetooth scanning, connection, and transmission (wearables)<br>- **multiDeviceConnection**: multi-device connection<br>- **taskKeeping**: computing| String array| Yes (initial value: left empty)|
324| [startWindow](#startwindow)| Profile resource of the UIAbility startup page. The value is a string with a maximum of 255 bytes. If this field is set, the **startWindowIcon** and **startWindowBackground** fields do not take effect.| String| Yes (initial value: left empty)|
325| startWindowIcon | Index to the icon file of the UIAbility startup page. The value is a string with a maximum of 255 bytes.| String| No|
326| startWindowBackground | Index to the background color resource file of the UIAbility startup page. The value is a string with a maximum of 255 bytes.<br>Example: **$color:red**.| String| No|
327| removeMissionAfterTerminate | Whether to remove the relevant mission from the mission list after the UIAbility is destroyed.<br>- **true**: Remove the relevant mission from the mission list after the UIAbility is destroyed.<br>- **false**: Do not remove the relevant mission from the task mission list after the UIAbility is destroyed.| Boolean| Yes (initial value: **false**)|
328| orientation | Startup direction of the UIAbility component. The enum and startup direction resource index can be configured. The enum values are as follows:<br>- **unspecified**: automatically determined by the system.<br>- **landscape**: landscape mode.<br>- **portrait**: portrait mode.<br>- **follow_recent**: rotation mode following the background window.<br>- **landscape_inverted**: inverted landscape mode.<br>- **portrait_inverted**: inverted portrait mode.<br>- **auto_rotation**: determined by the sensor.<br>- **auto_rotation_landscape**: determined by the sensor in the horizontal direction, including landscape and inverted landscape modes.<br>- **auto_rotation_portrait**: determined by the sensor in the vertical direction, including portrait and inverted portrait modes.<br>- **auto_rotation_restricted**: determined by the sensor when the sensor switch is enabled.<br>- **auto_rotation_landscape_restricted**: determined by the sensor in the horizontal direction, including landscape and inverted landscape modes, when the sensor switch is enabled.<br>- **auto_rotation_portrait_restricted**: determined by the sensor in the vertical direction, including portrait and inverted portrait modes, when the sensor switch is enabled.<br>- **locked**: auto rotation disabled.<br>- **auto_rotation_unspecified**: auto rotation controlled by the switch and determined by the system.<br>- **follow_desktop**: following the orientation of the home screen.<br>&nbsp;When configuring the resource index in the startup direction, the value is a string with a maximum of 255 bytes.<br>&nbsp;Example: $string:orientation.| String| Yes (initial value: **"unspecified"**)|
329| supportWindowMode | Window mode supported by the UIAbility. The options are as follows:<br>- **fullscreen**: full-screen mode.<br>- **split**: split-screen mode.<br>- **floating**: floating window mode.| String array| Yes (initial value:<br>["fullscreen",&nbsp;"split",&nbsp;"floating"])|
330| <!--DelRow-->priority | Priority of the UIAbility component. In the case of [implicit query](../application-models/explicit-implicit-want-mappings.md), UIAbility components with a higher priority are at the higher place of the returned list. The value ranges from 0 to 10. The greater the value, the higher the priority.<br>**NOTE**<br>This configuration does not take effect in third-party applications but in system applications.| Integer| Yes (initial value: **0**)|
331| maxWindowRatio | Maximum aspect ratio supported by the UIAbility component. The minimum value is **0**.| Number| Yes (initial value: maximum aspect ratio supported by the platform)|
332| minWindowRatio | Minimum aspect ratio supported by the UIAbility component. The minimum value is **0**.| Number| Yes (initial value: minimum aspect ratio supported by the platform)|
333| maxWindowWidth | Maximum window width supported by the UIAbility, in vp.<br>The value cannot be less than the value of **minWindowWidth** or greater than the maximum window width allowed by the platform. For details about the window size, see [Constraints](../windowmanager/window-overview.md#constraints).| Number| Yes (initial value: maximum window width supported by the platform)|
334| minWindowWidth | Minimum window width supported by the UIAbility, in vp.<br>The value cannot be less than the minimum window width allowed by the platform or greater than the value of **maxWindowWidth**. For details about the window size, see [Constraints](../windowmanager/window-overview.md#constraints).| Number| Yes (initial value: minimum window width supported by the platform)|
335| maxWindowHeight | Maximum window height supported by the UIAbility, in vp.<br>The value cannot be less than the value of **minWindowHeight** or greater than the maximum window height allowed by the platform. For details about the window size, see [Constraints](../windowmanager/window-overview.md#constraints).| Number| Yes (initial value: maximum window height supported by the platform)|
336| minWindowHeight | Minimum window height supported by the UIAbility, in vp.<br>The value cannot be less than the minimum window height allowed by the platform or greater than the value of **maxWindowHeight**. For details about the window size, see [Constraints](../windowmanager/window-overview.md#constraints).| Number| Yes (initial value: minimum window height supported by the platform)|
337| <!--DelRow-->excludeFromMissions | Whether the UIAbility component is displayed in Recents.<br>- **true**: displayed in Recents.<br>- **false**: not displayed in Recents.<br>**NOTE**<br>This configuration does not take effect in third-party applications but in system applications. To enable the configuration in system applications, apply for the application privilege **AllowAbilityExcludeFromMissions**. For details, see [Application Privilege Configuration](../../device-dev/subsystems/subsys-app-privilege-config-guide.md).| Boolean| Yes (initial value: **false**)|
338| recoverable | Whether the application can be recovered to its previous state in case of faults.<br>- **true**: The application can be recovered to its previous state in case of faults.<br>- **false**: The application cannot be recovered to its previous state in case of faults.| Boolean| Yes (initial value: **false**)|
339| <!--DelRow-->unclearableMission | Whether the UIAbility is unclearable in Recents.<br>- **true**: The UIAbility is unclearable in Recents.<br>- **false**: The UIAbility is clearable in Recents.<br>**NOTE**<br>This configuration does not take effect in third-party applications but in system applications. To enable the configuration in system applications, apply for the application privilege **AllowMissionNotCleared**. For details, see [Application Privilege Configuration](../../device-dev/subsystems/subsys-app-privilege-config-guide.md).| Boolean| Yes (initial value: **false**)|
340| isolationProcess | Whether the component can run in an independent process.<br>- **true**: The component can run in an independent process.<br>- **false**: The component cannot run in an independent process.| Boolean| Yes (initial value: **false**)|
341| excludeFromDock | Whether the UIAbility can be hidden from the dock.<br>- **true**: The UIAbility can be hidden from the dock.<br>- **false**: The UIAbility cannot be hidden from the dock.| Boolean| Yes (initial value: **false**)|
342| preferMultiWindowOrientation | Multi-window orientation of the UIAbility.<br>- **default**: default value. Do not set this parameter to the default value. You are advised to set this parameter for other applications.<br>- **portrait**: portrait. This option is recommended for games in portrait mode.<br>- **landscape**: landscape. This option is recommended for games in landscape mode. With this option, the floating window and upper and lower split screens are supported in landscape mode.<br>- **landscape_auto**: automatically landscape. his option is recommended for games. It must be used together with the **enableLandScapeMultiWindow/disableLandScapeMultiWindow** API.| String| Yes (initial value: **default**)|
343| continueType | Continuation type of the UIAbility.| String array| Yes (initial value: name of the UIAbility)|
344| continueBundleName | List of other applications that support cross-device migration.<br>**NOTE**<br>This parameter cannot be set to the application bundle name. It is used only for migration with different bundle names.| String array| Yes (initial value: left empty)|
345| process | Process tag of a component.<br>**NOTE**<br>This tag is valid only on the [2-in-1](./module-configuration-file.md#devicetypes tag) device. The UIAbility component and the ExtensionAbility component whose type is embeddedUI run in the same process when their tags are the same.| String| Yes (initial value: left empty)|
346
347Example of the **abilities** structure:
348
349<!--RP3-->
350```json
351{
352  "abilities": [{
353    "name": "EntryAbility",
354    "srcEntry": "./ets/entryability/EntryAbility.ets",
355    "launchType":"singleton",
356    "description": "$string:description_main_ability",
357    "icon": "$media:layered_image",
358    "label": "Login",
359    "permissions": [],
360    "metadata": [],
361    "exported": true,
362    "continuable": true,
363    "skills": [{
364      "actions": ["ohos.want.action.home"],
365      "entities": ["entity.system.home"],
366      "uris": []
367    }],
368    "backgroundModes": [
369      "dataTransfer",
370      "audioPlayback",
371      "audioRecording",
372      "location",
373      "bluetoothInteraction",
374      "multiDeviceConnection",
375      "wifiInteraction",
376      "voip",
377      "taskKeeping"
378    ],
379    "startWindow": "$profile:start_window",
380    "startWindowIcon": "$media:icon",
381    "startWindowBackground": "$color:red",
382    "removeMissionAfterTerminate": true,
383    "orientation": "$string:orientation",
384    "supportWindowMode": ["fullscreen", "split", "floating"],
385    "maxWindowRatio": 3.5,
386    "minWindowRatio": 0.5,
387    "maxWindowWidth": 2560,
388    "minWindowWidth": 1400,
389    "maxWindowHeight": 300,
390    "minWindowHeight": 200,
391    "excludeFromMissions": false,
392    "unclearableMission": false,
393    "excludeFromDock": false,
394    "preferMultiWindowOrientation": "default",
395    "isolationProcess": false,
396    "continueType": [
397      "continueType1",
398      "continueType2"
399    ],
400    "continueBundleName": [
401      "com.example.myapplication1",
402      "com.example.myapplication2"
403    ],
404    "process": ":processTag"
405  }]
406}
407```
408<!--RP3End-->
409
410## skills
411
412The **skills** tag represents the feature set of [wants](../application-models/want-overview.md) that can be received by the UIAbility or ExtensionAbility component.
413
414  **Table 7** skills
415
416| Name| Description| Data Type| Initial Value Allowed|
417| -------- | -------- | -------- | -------- |
418| actions | Actions of wants that can be received, which can be predefined or customized.<br>You are not advised to configure multiple **actions** for a **skill**. Otherwise, the expected scenario may not be matched.| String array| Yes (initial value: left empty)|
419| entities | Entities of wants that can be received.<br>You are not advised to configure multiple **entities** for a **skill**. Otherwise, the expected scenario may not be matched.| String array| Yes (initial value: left empty)|
420| uris | URIs that match the wants. The maximum number of records in an array is **512**.| Object array| Yes (initial value: left empty)|
421| permissions | Permissions required for another application to access the UIAbility.<br>The value is generally in the reverse domain name notation and contains a maximum of 255 bytes. It is an array of predefined permission names.| String array| Yes (initial value: left empty)|
422| domainVerify | Whether to enable domain name verification.| Boolean| Yes (initial value: **false**)|
423
424
425  **Table 8** uris
426
427| Name| Description| Data Type| Initial Value Allowed|
428| -------- | -------- | -------- | -------- |
429| scheme | Scheme of the URI, such as HTTP, HTTPS, file, and FTP.<br>**NOTE**<br>This field is case-insensitive when it is used for implicit Want matching since API version 18.| String| Yes when only **type** is set in **uris** (initial value: left empty)|
430| host | Host address of the URI. This field is valid only when **scheme** is set. Common methods:<br>- domain name, for example, **example.com**.<br>- IP address, for example, **10.10.10.1**.<br>**NOTE**<br>This field is case-insensitive when it is used for implicit Want matching since API version 18.| String| Yes (initial value: left empty)|
431| port | Port number of the URI. For example, the default HTTP port number is 80, the default HTTPS port number is 443, and the default FTP port number is 21. This field is valid only when both **scheme** and **host** are set.| String| Yes (initial value: left empty)|
432| path&nbsp;\|&nbsp;pathStartWith&nbsp;\|&nbsp;pathRegex | Path of the URI. **path**, **pathStartWith**, and **pathRegex** represent different matching modes between the paths in the URI and the want. Set any one of them as needed. **path** indicates full matching, **pathStartWith** indicates prefix matching, and **pathRegex** indicates regular expression matching. This field is valid only when both **scheme** and **host** are set.| String| Yes (initial value: left empty)|
433| type | Data type that matches the want. The value complies with the Multipurpose Internet Mail Extensions (MIME) and [UniformDataType](../reference/apis-arkdata/js-apis-data-uniformTypeDescriptor.md) type specifications. This field can be configured together with **scheme** or be configured separately.| String| Yes (initial value: left empty)|
434| utd | [Uniform data types](../reference/apis-arkdata/js-apis-data-uniformTypeDescriptor.md) that match the wants. This field is applicable to scenarios such as sharing.| String| Yes (initial value: left empty)|
435| maxFileSupported | Maximum number of files of a specified type that can be received or opened at a time. This field is applicable to scenarios such as sharing and must be used together with **utd**.| Integer| Yes (initial value: **0**)|
436| linkFeature | Feature type provided by the URI. It is used to implement redirection between applications. The value is a string with a maximum of 127 bytes. The number of **linkFeature** declared in a bundle cannot exceed 150. For details, see [Description of linkFeature](../application-models/app-uri-config.md#description-of-linkfeature)| String| Yes (initial value: left empty)|
437
438Example of the **skills** structure:
439
440
441```json
442{
443  "abilities": [
444    {
445      "skills": [
446        {
447          "actions": [
448            "ohos.want.action.home"
449          ],
450          "entities": [
451            "entity.system.home"
452          ],
453          "uris": [
454            {
455              "scheme":"http",
456              "host":"example.com",
457              "port":"80",
458              "path":"path",
459              "type": "text/*",
460              "linkFeature": "Login"
461            }
462          ],
463          "permissions": [],
464          "domainVerify": false
465        }
466      ]
467    }
468  ]
469}
470```
471
472## extensionAbilities
473
474The **extensionAbilities** tag represents the configuration of ExtensionAbilities, which is valid only for the current ExtensionAbility.
475
476  **Table 9** extensionAbilities
477
478| Name| Description| Data Type| Initial Value Allowed|
479| -------- | -------- | -------- | -------- |
480| name | Name of the ExtensionAbility. This name must be unique in the entire application. The value is a string with a maximum of 127 bytes.| String| No|
481| srcEntry | Code path of the ExtensionAbility. The value is a string with a maximum of 127 bytes.| String| No|
482| description | Description of the ExtensionAbility component, used to describe the component functions. The value is a string with a maximum of 255 bytes. It can be a resource index to support multiple languages.| String| Yes (initial value: left empty)|
483| icon | Icon of the ExtensionAbility. The value is the index of the icon resource file. If **ExtensionAbility** is set to **MainElement** of the current module, this field is mandatory.| String| Yes (initial value: left empty)|
484| label | Name of the ExtensionAbility displayed to users. The value must be a resource index to support multiple languages. It contains a maximum of 255 bytes. If **ExtensionAbility** is set to **MainElement** of the current module, this field is mandatory and its value must be unique in the application.| String| Yes (initial value: left empty)|
485| type | Type of the ExtensionAbility. The options are as follows:<br>- **form**: ExtensionAbility of a widget.<br>- **workScheduler**: ExtensionAbility of a deferred task.<br>- **inputMethod**: ExtensionAbility of an input method.<!--Del--><br>- **service**: service component running in the background.<!--DelEnd--><br>- **accessibility**: ExtensionAbility of an accessibility feature.<!--Del--><br>- **fileAccess**: ExtensionAbility for public data access, allowing files and folders to be provided for file management applications to display.<br>- **dataShare**: ExtensionAbility for data sharing.<!--DelEnd--><br>- **staticSubscriber**: ExtensionAbility for static broadcast.<br>- **wallpaper**: ExtensionAbility of the wallpaper.<br>- **backup**: ExtensionAbility for data backup.<br>- **window**: ExtensionAbility of a window. This type of ExtensionAbility creates a window during startup for which you can develop the GUI. The GUI you develop is combined with the windows of other applications through the **UIExtensionComponent**.<br>- **thumbnail**: ExtensionAbility for obtaining file thumbnails. You can provide thumbnails for files of customized file types.<br>- **preview**: ExtensionAbility for preview. This type of ExtensionAbility can parse the file and display it in a window. You can combine the window with other application windows.<br>- **print**: ExtensionAbility for the print framework.<br>- **push**: ExtensionAbility for the push service.<br>- **driver**: ExtensionAbility for the driver framework.<br>- **remoteNotification**: ExtensionAbility for remote notifications.<br>- **remoteLocation**: ExtensionAbility for remote location.<br>- **voip**: ExtensionAbility for VoIP calls.<br>- **action**: ExtensionAbility for custom service operations, which provides custom service operation templates based on UIExtension.<!--Del--><br>- **adsService**: ExtensionAbility for the ad service, which provides the ad service framework.<!--DelEnd--><br>- **embeddedUI**: embedded UI extension, which allows for UI embedding across processes.<br>- **insightIntentUI**: APIs that enable applications to be called by Celia intents so as to be displayed in windows.<br>- **ads**: ExtensionAbility for the ad service, which is used with the AdComponent to display the ad page in other applications. This option is only available for device manufacturers.<br>- **photoEditor**: ExtensionAbility for the image editing service, which provides an image editing service template based on UIExtension.<br>- **appAccountAuthorization**: ExtensionAbility for application account authorization extension, which is used to process account authorization requests, for example, account login authorization.<br>- **autoFill/password**: ExtensionAbility for automatically filling in usernames and passwords.<br>- **hms/account**: ExtensionAbility for application account management.<!--Del--><br>- **sysDialog/atomicServicePanel**: ExtensionAbility that provides the basic capability for building an atomic service panel. It is implemented based on UIExtensionAbility.<br>- **sysDialog/userAuth**: ExtensionAbility for local user authentication.<br>- **sysDialog/common**: ExtensionAbility for common dialog boxes.<br>- **sysDialog/power**: ExtensionAbility for the shutdown and restart dialog boxes.<br>- **sysDialog/print**: ExtensionAbility for the print modals.<br>- **sysDialog/meetimeCall**: ExtensionAbility for MeeTime calls.<br>- **sysDialog/meetimeContact**: ExtensionAbility for MeeTime contacts.<br>- **sysPicker/meetimeMessage**: ExtensionAbility for MeeTime messages.<br>- **sysPicker/meetimeContact**: ExtensionAbility for the MeeTime contact list.<br>- **sysPicker/meetimeCallLog**: ExtensionAbility for the MeeTime call history.<br>- **sysPicker/share**: ExtensionAbility for sharing.<br>- **sysPicker/mediaControl**: ExtensionAbility for media control.<br>- **sysPicker/photoPicker**: ExtensionAbility that allows a third-party application to use the corresponding UIExtensionType to open the gallery photo picker.<br>- **sysPicker/filePicker**: ExtensionAbility for file download dialog boxes.<br>- **sysPicker/audioPicker**: ExtensionAbility for the audio management dialog box.<br>- **sysPicker/photoEditor**: ExtensionAbility for the photo editor.<br>- **sys/commonUI**: non-common ExtensionAbility, which provides embedded display or dialog boxes closely related to service attributes.<!--DelEnd--><br>- **autoFill/smart**: ExtensionAbility for scenario-specific autofill services.<br>- **uiService**: ExtensionAbility for pop-up window service, which creates a window during the startup and supports bidirectional communication.<br>- **statusBarView**: ExtensionAbility for one-step access.<br>- **recentPhoto**: ExtensionAbility for recommended recent photos.<!--Del--><br>- **fence**: ExtensionAbility for geofencing.<br>- **callerInfoQuery**: ExtensionAbility for enterprise contacts.<br>- **assetAcceleration**: ExtensionAbility for resource pre-download.<br>- **formEdit**: ExtensionAbility for widget editing.<br>**NOTE**<br>For **service**, **adsService**, **sys/commonUI**, **fileAccess**, **sysDialog**, **sysPicker**, **dataShare**, and **uiService** types, this configuration does not take effect in third-party applications but in system applications.<!--DelEnd--> | String| No|
486| permissions | Permissions required for another application to access the ExtensionAbility.<br>The value is generally in the reverse domain name notation and contains a maximum of 255 bytes. It is an array of [predefined permission names](../security/AccessToken/app-permissions.md).| String array| Yes (initial value: left empty)|
487| readPermission | Permission required for reading data in the ExtensionAbility. The value is a string with a maximum of 255 bytes. This field is available only when the type of the ExtensionAbility is set to **dataShare**.| String| Yes (initial value: left empty)|
488| writePermission | Permission required for writing data to the ExtensionAbility. The value is a string with a maximum of 255 bytes. This field is available only when the type of the ExtensionAbility is set to **dataShare**.| String| Yes (initial value: left empty)|
489| uri | Data URI provided by the ExtensionAbility. The value is a string with a maximum of 255 bytes, in the reverse domain name notation.<br>**NOTE**<br>This field is mandatory when the type of the ExtensionAbility is set to **dataShare**.| String| Yes (initial value: left empty)|
490|skills | A set of [wants](../application-models/want-overview.md) that can be received by the ExtensionAbility.<br>Configuration rule: In an entry package, you can configure multiple **skills** attributes with the entry capability. (A **skills** attribute with the entry capability is the one that has **ohos.want.action.home** and **entity.system.home** configured.) The label and icon of the first ExtensionAbility that has **skills** configured are used as the label and icon of the entire service/application.<br>**NOTE**<br>The **skills** attribute with the entry capability can be configured for the feature package of an application,<br>but not for a service.| Array| Yes (initial value: left empty)|
491| [metadata](#metadata)| Metadata of the ExtensionAbility component.<br>**NOTE**<br>When **type** is set to **form**, this tag cannot be left empty. In addition, an object value **ohos.extension.form** must exist. Its corresponding resource value cannot be left empty and is the level-2 resource reference of the widgets.| Object array| Yes (initial value: left empty)|
492| exported | Whether the ExtensionAbility can be called by other applications.<br>- **true**: The ExtensionAbility can be called by other applications.<br>- **false**: The UIAbility cannot be called by other applications, not even by aa commands.| Boolean| Yes (initial value: **false**)|
493| extensionProcessMode | Multi-process instance model of the ExtensionAbility. Currently, this field is effective only for UIExtensionAbilities and ExtensionAbilities extended from UIExtensionAbilities.<br>- **instance**: Each instance of the ExtensionAbility has a process.<br>- **type**: All instances of the ExtensionAbility run in the same process, separated from other ExtensionAbility instances.<br>- **bundle**: All instances of the ExtensionAbility run in the same process as instances of other ExtensionAbilities using the **bundle** model.<br>- **runWithMainProcess**: Only the ExtensionAbility for one-step access runs in the same process with the application main process.| String| Yes (initial value: left empty)|
494| dataGroupIds | Data group IDs of the ExtensionAbility. If the application where the current ExtensionAbility component is located also applies for a **dataGroupId** in the **groupIds** of the certificate applied by the AppGallery, the current ExtensionAbility component can share the directory generated by the **dataGroupId** with the application, therefore, the **dataGroupId** of the ExtensionAbility component takes effect only when it is configured in the **groupIds** field in the application certificate. In addition, this attribute is effective only when the ExtensionAbility has an independent sandbox directory. For details, see [dataGroupId Application Process](https://developer.huawei.com/consumer/en/doc/harmonyos-guides-V5/ime-kit-security-V5#section4219152220459).| String array| Yes (initial value: left empty)|
495| process | Process label of a component. This parameter can be set only when type is set to **embeddedUI**.<br>**NOTE**<br>This tag is valid only on the [2-in-1](./module-configuration-file.md#devicetypes tag) device. The UIAbility component and the ExtensionAbility component run in the same process when their tags are the same.| String| Yes (initial value: left empty)|
496
497Example of the **extensionAbilities** structure:
498
499
500```json
501{
502  "extensionAbilities": [
503    {
504      "name": "FormName",
505      "srcEntry": "./form/MyForm.ts",
506      "icon": "$media:icon",
507      "label" : "$string:extension_name",
508      "description": "$string:form_description",
509      "type": "form",
510      "permissions": ["ohos.abilitydemo.permission.PROVIDER"],
511      "readPermission": "",
512      "writePermission": "",
513      "exported": true,
514      "uri":"scheme://authority/path/query",
515      "skills": [{
516        "actions": [],
517        "entities": [],
518        "uris": [],
519        "permissions": []
520      }],
521      "metadata": [
522        {
523          "name": "ohos.extension.form",
524          "resource": "$profile:form_config",
525        }
526      ],
527      "extensionProcessMode": "instance",
528      "dataGroupIds": [
529        "testGroupId1"
530      ]
531    }
532  ]
533}
534```
535
536## shortcuts
537
538The **shortcuts** tag provides the shortcut information of an application. The value is an array and consists of four sub-attributes: **shortcutId**, **label**, **icon**, and **wants**.
539
540The **shortcut** information is identified in **metadata**, where:
541
542- **name** indicates the name of the shortcut, identified by **ohos.ability.shortcuts**.
543
544- **resource** indicates where the resources of the shortcut are stored.
545
546**Table 11** shortcuts
547
548| Name| Description| Data Type | Initial Value Allowed|
549| -------- | -------- | -------- | -------- |
550| shortcutId | ID of the shortcut. The value is a string with a maximum of 63 bytes. **This field cannot be configured using the resource index ($string).**| String| No|
551| label | Label of the shortcut, that is, the text description displayed for the shortcut. The value is a string with a maximum of 255 bytes. It can be descriptive content or a resource index.| String| Yes (initial value: left empty)|
552| icon | Icon of the shortcut. The value is the index of the icon resource file.| String| Yes (initial value: left empty)|
553| [wants](#wants) | Wants to which the shortcut points. If the **startShortcut** API of **launcherBundleManager** is called, the first target component in the wants is started. As such, you are advised to configure only one element for **wants**.| Object| Yes (initial value: left empty)|
554
555
5561. Configure the **shortcuts_config.json** file in **/resources/base/profile/**.
557
558   ```json
559   {
560     "shortcuts": [
561       {
562         "shortcutId": "id_test1",
563         "label": "$string:shortcut",
564         "icon": "$media:aa_icon",
565         "wants": [
566           {
567             "bundleName": "com.ohos.hello",
568             "moduleName": "entry",
569             "abilityName": "EntryAbility",
570             "parameters": {
571               "testKey": "testValue"
572             }
573           }
574         ]
575       }
576     ]
577   }
578   ```
579
5802. In the **abilities** tag of the **module.json5** file, configure the **metadata** tag for the UIAbility component to which a shortcut needs to be added so that the shortcut configuration file takes effect for the UIAbility.
581
582   ```json
583   {
584     "module": {
585       // ...
586       "abilities": [
587         {
588           "name": "EntryAbility",
589           "srcEntry": "./ets/entryability/EntryAbility.ets",
590           // ...
591           "skills": [
592             {
593               "entities": [
594                 "entity.system.home"
595               ],
596               "actions": [
597                 "ohos.want.action.home"
598               ]
599             }
600           ],
601           "metadata": [
602             {
603               "name": "ohos.ability.shortcuts",
604               "resource": "$profile:shortcuts_config"
605             }
606           ]
607         }
608       ]
609     }
610   }
611   ```
612### wants
613
614The **wants** tag provides wants information for a shortcut.
615
616**Table 11-1** wants
617
618| Name| Description| Data Type | Initial Value Allowed|
619| -------- | -------- | -------- | -------- |
620| bundleName | Target bundle name of the shortcut.| String| No|
621| moduleName | Target module name of the shortcut.| String| Yes|
622| abilityName| Target ability name of the shortcut.| String| No|
623| parameters | Custom data when the shortcut is started. The data must be strings. A key can contain a maximum of 1024 characters.| Object| Yes|
624
625Example of the **data** structure:
626
627```json
628{
629  "wants": [
630    {
631      "bundleName": "com.ohos.hello",
632      "moduleName": "entry",
633      "abilityName": "EntryAbility",
634      "parameters": {
635        "testKey": "testValue"
636      }
637    }
638  ]
639}
640```
641
642## distributionFilter
643
644The **distributionFilter** tag defines the rules for distributing HAP files based on different device specifications, so that precise matching can be performed when the application market distributes applications.
645
646> **NOTE**
647> This tag is supported since API version 10. In earlier versions, the **distroFilter** tag is used.
648
649- **Application scenario**: If a project has multiple entry-type modules and the values of **deviceType** configured for these modules overlap, you need to use this tag to distinguish the modules. In the following example, both entry-type modules support the tablet type, and therefore the **distributionFilter** tag is required.
650  ```json
651  // Device types supported by entry1
652  {
653    "module": {
654      "name": "entry1",
655      "type": "entry",
656      "deviceTypes" : [
657        "tv",
658        "tablet"
659      ]
660    }
661  }
662  ```
663  ```json
664  // Device types supported by entry2
665  {
666    "module": {
667      "name": "entry2",
668      "type": "entry",
669      "deviceTypes" : [
670        "car",
671        "tablet"
672      ]
673    }
674  }
675  ```
676
677- **Configuration rules**: This tag consists of four attributes: [screenShape](#screenshape), [screenWindow](#screenwindow), [screenDensity](#screendensity), and [countryCode](#countrycode).
678
679  During distribution, a unique HAP is determined based on the mapping between **deviceTypes** and the preceding attributes.
680
681  * When configuring this tag, include at least one of the attributes.
682  * If any one or more attributes are set for one entry-type module, the same attributes must be set for all other entry-type modules.
683  * The **screenShape** and **screenWindow** attributes are available only for lite wearables.
684
685- **Configuration**: This tag must be configured in the **/resources/base/profile** directory and be referenced in the **resource** field of **metadata**.
686
687
688**Table 12** distributionFilter
689
690| Name| Description| Data Type| Initial Value Allowed|
691| -------- | -------- | -------- | -------- |
692| [screenShape](#screenshape) | Supported screen shapes.| Object array| Yes (initial value: left empty)|
693| [screenWindow](#screenwindow) | Supported application window resolutions.| Object array| Yes (initial value: left empty)|
694| [screenDensity](#screendensity)| Pixel density of the screen, in dots per inch (DPI).| Object array| Yes (initial value: left empty)|
695| [countryCode](#countrycode)| Code of the country or region to which the application is to be distributed. The value is subject to the ISO-3166-1 standard. Enumerated definitions of multiple countries and regions are supported.| Object array| Yes (initial value: left empty)|
696
697### screenShape
698
699**Table 13** screenShape
700
701| Name| Description| Data Type| Initial Value Allowed|
702| -------- | -------- | -------- | -------- |
703| policy | Rule for the sub-attribute value.<br>- **exclude**: Exclude the matches of the sub-attribute value.<br>- **include**: Include the matches of the sub-attribute value.| String| No|
704| value | Screen shapes. The value can be **circle**, **rect**, or both. For example, different HAPs can be provided for a smart watch with a circular face and that with a rectangular face.| String array| No|
705
706### screenWindow
707
708**Table 14** screenWindow
709
710| Name| Description| Data Type| Initial Value Allowed|
711| -------- | -------- | -------- | -------- |
712| policy | Rule for the sub-attribute value. Currently, the value can only be **include**.<br>- **include**: Include the matches of the sub-attribute value.| String| No|
713| value | Screen width and height, in pixels. The value is an array of supported width and height pairs, each in the "width * height" format, for example, **"454 * 454"**.| String array| No|
714
715### screenDensity
716
717**Table 15** screenDensity
718
719| Name| Description| Data Type| Initial Value Allowed|
720| -------- | -------- | -------- | -------- |
721| policy | Rule for the sub-attribute value.<br>- **exclude**: Exclude the matches of the sub-attribute value.<br>- **include**: Include the matches of the sub-attribute value.| String| No|
722| value | Pixel density of the screen, in 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].| String array| No|
723
724### countryCode
725
726**Table 16** countryCode
727
728| Name| Description| Data Type| Initial Value Allowed|
729| -------- | -------- | -------- | -------- |
730| policy | Rule for the sub-attribute value.<br>- **exclude**: Exclude the matches of the sub-attribute value.<br>- **include**: Include the matches of the sub-attribute value.| String| No|
731| value | Code of the country or region to which the application is to be distributed.| String array| No|
732
733
734Example:
735
7361. Configure the **distributionFilter_config.json** file (this file name is customizable) in **resources/base/profile** under the development view.
737   ```json
738   {
739     "distributionFilter": {
740       "screenShape": {
741         "policy": "include",
742         "value": [
743           "circle",
744           "rect"
745         ]
746       },
747       "screenWindow": {
748         "policy": "include",
749         "value": [
750           "454*454",
751           "466*466"
752         ]
753       },
754       "screenDensity": {
755         "policy": "exclude",
756         "value": [
757           "ldpi",
758           "xldpi"
759         ]
760       },
761       "countryCode": {// Distribution in China is supported.
762         "policy": "include",
763         "value": [
764           "CN"
765         ]
766       }
767     }
768   }
769   ```
770
771
7722. Configure **metadata** in the **module** tag in the **module.json5** file.
773
774
775    ```json
776    {
777      "module": {
778        // ...
779        "metadata": [
780          {
781            "name": "ohos.module.distribution",
782            "resource": "$profile:distributionFilter_config",
783          }
784        ]
785      }
786    }
787    ```
788
789
790## testRunner
791
792The **testRunner** tag represents the supported test runner.
793
794**Table 17** testRunner
795
796| Name| Description| Data Type| Initial Value Allowed|
797| -------- | -------- | -------- | -------- |
798| name | Name of the test runner object. The value is a string with a maximum of 255 bytes.| String| No|
799| srcPath | Code path of the test runner. The value is a string with a maximum of 255 bytes.	| String| No|
800
801Example of the **testRunner** structure:
802
803
804```json
805{
806  "module": {
807    // ...
808    "testRunner": {
809      "name": "myTestRunnerName",
810      "srcPath": "etc/test/TestRunner.ts"
811    }
812  }
813}
814```
815
816## atomicService
817
818The **atomicService** tag represents the atomic service configuration. It is available only when **bundleType** is set to **atomicService** in the **app.json** file.
819
820**Table 18** atomicService
821
822| Name| Description| Data Type| Initial Value Allowed|
823| -------- | -------- | -------- | -------- |
824| preloads | List of modules to preload.| Object array| Yes (initial value: left empty)|
825
826
827**Table 19** preloads
828
829| Name| Description| Data Type| Initial Value Allowed|
830| -------- | -------- | -------- | -------- |
831| moduleName | Name of the module to be preloaded when the current module is loaded in the atomic service. The value must match an existing module other than the current one. It contains a maximum of 31 bytes.| String| No|
832
833
834Example of the **atomicService** structure:
835
836```json
837{
838  "module": {
839    "atomicService": {
840      "preloads":[
841        {
842          "moduleName":"feature"
843        }
844      ]
845    }
846  }
847}
848```
849
850## dependencies
851
852The **dependencies** tag identifies the list of shared libraries that the module depends on when it is running.
853
854**Table 20** dependencies
855
856| Name   | Description                          | Data Type| Initial Value Allowed|
857| ----------- | ------------------------------ | -------- | ---------- |
858| bundleName  | Name of the shared bundle on which the current module depends. The value is a string of 7 to 128 bytes.| String  | Yes (initial value: left empty)|
859| moduleName  | Module name of the shared bundle on which the current module depends. The value is a string with a maximum of 31 bytes.| String  | No|
860| versionCode | Version number of the shared bundle. The value ranges from 0 to 2147483647.| Number    | Yes (initial value: left empty)|
861
862Example of the **dependencies** structure:
863
864```json
865{
866  "module": {
867    "dependencies": [
868      {
869        "bundleName":"com.share.library",
870        "moduleName": "library",
871        "versionCode": 10001
872      }
873    ]
874  }
875}
876```
877
878## proxyData
879
880The **proxyDatas** tag provides the list of data proxies provided by the module. It can be configured only for entry and feature modules.
881
882**Table 21** proxyData
883| Name   | Description                          | Data Type| Initial Value Allowed|
884| ----------- | ------------------------------ | -------- | ---------- |
885| uri | URI of the data proxy. The URIs configured for different data proxies must be unique and must be in the *datashareproxy://Current application bundle name/xxx* format. The value is a string with a maximum of 255 bytes.| String  | No|
886| requiredReadPermission  | Permission required for reading data from the data proxy. If it is not specified, other applications will not be able to use the data proxy. For non-system applications, the level of the set permission must be **system_basic** or **system_core**. For system applications, the permission level is not limited. For details about the permission levels, see [Application Permissions](../security/AccessToken/app-permissions.md). The value is a string with a maximum of 255 bytes.| String  | Yes (initial value: left empty)|
887| requiredWritePermission | Permission required for writing data to the data proxy. If it is not specified, other applications will not be able to use the data proxy. For non-system applications, the level of the set permission must be **system_basic** or **system_core**. For system applications, the permission level is not limited. For details about the permission levels, see [Application Permissions](../security/AccessToken/app-permissions.md). The value is a string with a maximum of 255 bytes.| String  | Yes (initial value: left empty)|
888| [metadata](#metadata)| Metadata of the data proxy. Only the **name** and **resource** fields can be configured.| Object| Yes (initial value: left empty)|
889
890Example of the **proxyData** structure:
891
892```json
893{
894  "module": {
895    "proxyData": [
896      {
897        "uri":"datashareproxy://com.ohos.datashare/event/Meeting",
898        "requiredReadPermission": "ohos.permission.GET_BUNDLE_INFO",
899        "requiredWritePermission": "ohos.permission.GET_BUNDLE_INFO",
900        "metadata": {
901          "name": "datashare_metadata",
902          "resource": "$profile:datashare"
903        }
904      }
905    ]
906  }
907}
908```
909
910## routerMap
911
912The **routerMap** tag represents the path to the routing table for the module.
913
914The **routerMap** configuration file provides the routing table information of the module. The value of the **routerMap** tag is an array.
915
916**Table 22** routerMap
917
918| Name| Description| Data Type| Initial Value Allowed|
919| -------- | -------- | -------- | -------- |
920| name          | Name of the page to be redirected to. The value is a string with a maximum of 1023 bytes.| String | No      |
921| pageSourceFile| Path of the page in the module. The value is a string with a maximum of 255 bytes.| String| No |
922| buildFunction | Function decorated by @Builder. The function describes the UI of the page. The value is a string with a maximum of 1023 bytes.| String | No  |
923| [data](#data)  | Custom data of the string type. Each piece of custom data cannot exceed 128 bytes.| Object  | Yes (initial value: left empty)  |
924| [customData](#customdata)  | Custom data of any type. The value of the total length cannot exceed 4096 bytes. | Object  | Yes (initial value: left empty)  |
925
926Example:
927
9281. Define a routing table configuration file under **resources/base/profile** in the development view. The file name can be customized, for example, **router_map.json**.
929
930    ```json
931    {
932      "routerMap": [
933        {
934          "name": "DynamicPage1",
935          "pageSourceFile": "src/main/ets/pages/pageOne.ets",
936          "buildFunction": "myFunction",
937          "customData": {
938            "stringKey": "data1",
939            "numberKey": 123,
940            "booleanKey": true,
941            "objectKey": {
942              "name": "test"
943            },
944            "arrayKey": [
945              {
946                "id": 123
947              }
948            ]
949          }
950        },
951        {
952          "name": "DynamicPage2",
953          "pageSourceFile": "src/main/ets/pages/pageTwo.ets",
954          "buildFunction": "myBuilder",
955          "data": {
956            "key1": "data1",
957            "key2": "data2"
958          }
959        }
960      ]
961    }
962    ```
963
9642. Define the **routerMap** tag under **module** of the **module.json5** file, set it to point to the defined routing table configuration file, for example, set it to **"routerMap": "$profile:router_map"**.
965
966### data
967
968The **data** tag is used to configure custom string data in the routing table.
969
970Example of the **data** structure:
971
972```json
973{
974  "routerMap": [
975    {
976      "name": "DynamicPage",
977      "pageSourceFile": "src/main/ets/pages/pageOne.ets",
978      "buildFunction": "myBuilder",
979      "data": {
980        "key1": "data1",
981        "key2": "data2"
982      }
983    }
984  ]
985}
986```
987
988### customData
989
990The **data** tag represents custom data in the routing table.
991The **customData** tag is used to configure custom data of any type.
992
993Example of the **customData** structure:
994
995```json
996{
997  "routerMap": [
998    {
999      "name": "DynamicPage",
1000      "pageSourceFile": "src/main/ets/pages/pageOne.ets",
1001      "buildFunction": "myBuilder",
1002      "customData": {
1003        "stringKey": "data1",
1004        "numberKey": 123,
1005        "booleanKey": true,
1006        "objectKey": {
1007          "name": "test"
1008        },
1009        "arrayKey": [
1010          {
1011            "id": 123
1012          }
1013        ]
1014      }
1015    }
1016  ]
1017}
1018```
1019
1020## appEnvironments
1021
1022The **appEnvironments** tag represents the application environment variables configured for the module.
1023
1024**Table 23** appEnvironments
1025
1026| Name| Description| Data Type| Initial Value Allowed|
1027| -------- | -------- | -------- | -------- |
1028| name          | Name of the environment variable. The value is a string with a maximum of 4096 bytes.| String | Yes (initial value: left empty)|
1029| value         | Value of the environment variable. The value is a string with a maximum of 4096 bytes.      | String | Yes (initial value: left empty)|
1030
1031Example of the **appEnvironments** structure:
1032
1033```json
1034{
1035  "module": {
1036    "appEnvironments": [
1037      {
1038        "name":"name1",
1039        "value": "value1"
1040      }
1041    ]
1042  }
1043}
1044```
1045
1046## definePermissions
1047
1048The **definePermissions** tag represents a set of permissions defined for the system resource HAP, which cannot be custom permissions. For details, see the definition of system resource permissions in the [config.json](https://gitee.com/openharmony/utils_system_resources/blob/master/systemres/main/config.json) file.
1049
1050**Table 24** definePermissions
1051
1052| Name| Description| Data Type| Initial Value Allowed|
1053| -------- | -------- | -------- | -------- |
1054| name | Name of a permission. The value can contain a maximum of 255 bytes.| String| No|
1055| 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"**)|
1056| 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"**)|
1057| 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**)|
1058| distributedSceneEnabled | Whether the permission can be used in distributed scenarios.| Boolean| Yes (initial value: **false**)|
1059| label | Brief description of the permission. The value is a resource index to the description.| String| Yes (initial value: left empty)|
1060| description | Detailed description of the permission. The value is a string or a resource index to the description.| String| Yes (initial value: left empty)|
1061
1062Example of the **definePermissions** structure:
1063
1064```json
1065{
1066  "module" : {
1067    "definePermissions": [
1068      {
1069        "name": "ohos.abilitydemo.permission.PROVIDER",
1070        "grantMode": "system_grant",
1071        "availableLevel": "system_core",
1072        "provisionEnable": true,
1073        "distributedSceneEnable": false,
1074        "label": "$string:EntryAbility_label"
1075      }
1076    ]
1077  }
1078}
1079```
1080
1081## hnpPackages
1082
1083The **hnpPackages** tag provides information about the native software package contained in the application.
1084
1085**Table 25** hnpPackages
1086
1087| Name| Description| Data Type| Initial Value Allowed|
1088| -------- | -------- | -------- | -------- |
1089| package | Name of the native software package.| String| No|
1090| type | Type of the native software package. The options are as follows:<br>- **public**: public type.<br>- **private**: private type. | String| No|
1091
1092Example of the **hnpPackages** structure:
1093
1094
1095```json
1096{
1097  "module" : {
1098    "hnpPackages": [
1099      {
1100        "package": "hnpsample.hnp",
1101        "type": "public"
1102      }
1103    ]
1104  }
1105}
1106```
1107
1108## fileContextMenu
1109
1110The **fileContextMenu** tag provides configuration options for the context menu (displayed upon right-clicking) of the current HAP. It is a profile file that contains the context menu configuration registered by the application.
1111
1112Example of the **fileContextMenu** structure:
1113
1114```json
1115{
1116  "module": {
1117    // ...
1118    "fileContextMenu": "$profile:menu" // Configured through the resource file in the profile
1119  }
1120}
1121```
1122
1123Define the **menu.json** file under **resources/base/profile** in the development view. The file name (**menu.json** in this example) can be customized, but must be consistent with the information specified by the **fileContextMenu** tag. The file describes the items and response behavior of the context menu registered by the application.
1124The root node of the file is **fileContextMenu**, which is an object array and indicates the number of context menus registered by the current module. (The number must not exceed 5 per module and per application. If the number exceeds 5, only five random menus are parsed.)
1125
1126**Table 26** fileContextMenu
1127
1128| Name| Description| Data Type| Initial Value Allowed|
1129| -------- | -------- | -------- | -------- |
1130| abilityName | Name of the ability to be started for the context menu.| String| No|
1131| menuItem | Information displayed on the context menu.| Resource ID| No|
1132| menuHandler | Handler used to distinguish different context menus started by users. It is applicable when multiple context menus are created for one ability. This field is passed to the context menu as a parameter when the user clicks the menu.| String| No|
1133| menuContext | Context required for displaying the context menu. Multiple contexts are supported.| Object array| No|
1134
1135**Table 27** menuContext
1136
1137| Name| Description| Data Type| Initial Value Allowed|
1138| -------- | -------- | -------- | -------- |
1139| menuKind | Condition in which the context menu is displayed. The options are as follows:<br>-: blank area<br>- 1: file<br>- 2: folder<br>- 3: file and folder| Number| No|
1140| menuRule | Operations that can trigger context menu. The options are as follows:<br>- single: Single file or folder is selected.<br>- multi: Multiple files or folders are selected.<br>- both: Both.| String| No (This attribute is read when **menuKind** is set to **1** or **2**.)|
1141| fileSupportType | Supported types of files. The context item is displayed when the selected file list contains files of these types.<br>When the value is set to *, the **fileNotSupportType** field is read.<br>When the value is left empty, no processing is performed.| String array| No (This attribute is read when **menuKind** is set to **1**.)|
1142| fileNotSupportType | 	Types of files not supported. The context item is not displayed when the selected file list contains files of these types.<br>This attribute is read only when **menuKind** is set to **1** and **fileSupportType** is set to *.| String array| Yes (initial value: left empty)|
1143
1144Example of the **menu.json** file in the **resources/base/profile** directory:
1145```json
1146{
1147  "fileContextMenu": [
1148    {
1149      "abilityName": "EntryAbility",
1150      "menuItem": "$string:module_desc",
1151      "menuHandler": "openCompress",
1152      "menuContext": [
1153        {
1154          "menuKind": 0
1155        },
1156        {
1157          "menuKind": 1,
1158          "menuRule": "both",
1159          "fileSupportType": [
1160            ".rar",
1161            ".zip"
1162          ],
1163          "fileNotSupportType": [
1164            ""
1165          ]
1166        },
1167        {
1168          "menuKind": 2,
1169          "menuRule": "single"
1170        },
1171        {
1172          "menuKind": 3
1173        }
1174      ]
1175    }
1176  ]
1177}
1178```
1179
1180**Response Behavior**
1181
1182After a context menu is registered, the **More** option of the menu, when clicked, displays a sublist of menu items specified in **menuItem**. After you right-click the file manager, the file manager starts the third-party application using **startAbility** by default. In addition to the bundle name and ability name of the third-party application, the following fields are also passed in **parameter** of **want**:
1183
1184**Table 28** parameter field in want
1185
1186| Name| Value| Data Type|
1187| -------- | -------- | -------- |
1188| menuHandler | Value of **menuHandler** in the registration configuration file.| String|
1189| uriList | URIs for redirection when the user right-clicks files. If the context menu is displayed by right-clicking a blank area, the value is null. If the context menu is displayed by right-clicking a single file, the array length is 1. If the context menu is displayed by right-clicking multiple files, the URIs of all files should be passed in.| String array|
1190
1191## startWindow
1192
1193This tag points to a profile resource and is used to define the configuration file **start_window.json** of the UIAbility startup page in **resources/base/profile**. If this field is set, the **startWindowIcon** and **startWindowBackground** fields do not take effect.
1194
1195**Table 29** startWindow configuration
1196
1197| Name| Description| Data Type| Initial Value Allowed|
1198| -------- | -------- | -------- | -------- |
1199| startWindowAppIcon | Index to the icon file of the UIAbility startup page. The value is a string with a maximum of 255 bytes.| String| Yes (initial value: left empty)|
1200| startWindowIllustration | Index to the illustration file of the UIAbility startup page. The value is a string with a maximum of 255 bytes.| String| Yes (initial value: left empty)|
1201| startWindowBrandingImage | Index to the brand logo file of the UIAbility startup page. The value is a string with a maximum of 255 bytes.| String| Yes (initial value: left empty)|
1202| startWindowBackgroundColor | Index to the background color resource file of the UIAbility startup page. The value is a string with a maximum of 255 bytes.| String| No|
1203| startWindowBackgroundImage | Index to the background image file of the UIAbility startup page. The value is a string with a maximum of 255 bytes.| String| Yes (initial value: left empty)|
1204| startWindowBackgroundImageFit | Background image adaptation mode of the UIAbility startup page. The options are as follows:<br>- **Contain**: Proportionally scaled based on the aspect ratio, the image is fully contained within the display area.<br>- **Cover**: Proportionally scaled based on the aspect ratio, both width and height of the image are greater than or equal to that of the display area.<br>- **Auto**: adaptive display.<br>- **Fill**: The image fills the display area without any aspect ratio scaling applied.<br>- **ScaleDown**: The image is displayed in accordance with its aspect ratio, either scaled down or kept unchanged.<br>- **None**: The image is displayed in its original size.| String| Yes (initial value: **Cover**)|
1205
1206Example of the **start_window.json** file in the **resources/base/profile** directory:
1207```json
1208{
1209  "startWindowAppIcon": "$media:start_window_app_icon",
1210  "startWindowIllustration": "$media:start_window_illustration",
1211  "startWindowBrandingImage": "$media:start_window_branding_image",
1212  "startWindowBackgroundColor": "$color:start_window_back_ground_color",
1213  "startWindowBackgroundImage": "$media:start_window_back_ground_image",
1214  "startWindowBackgroundImageFit": "Cover"
1215}
1216```
1217