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 "mainElement": "EntryAbility", 14 "deviceTypes": [ 15 "default", 16 "tablet" 17 ], 18 "deliveryWithInstall": true, 19 "installationFree": false, 20 "pages": "$profile:main_pages", 21 "virtualMachine": "ark", 22 "appStartup": "$profile:app_startup_config", 23 "metadata": [ 24 { 25 "name": "string", 26 "value": "string", 27 "resource": "$profile:distributionFilter_config" 28 } 29 ], 30 "abilities": [ 31 { 32 "name": "EntryAbility", 33 "srcEntry": "./ets/entryability/EntryAbility.ets", 34 "description": "$string:EntryAbility_desc", 35 "icon": "$media:layered_image", 36 "label": "$string:EntryAbility_label", 37 "startWindowIcon": "$media:icon", 38 "startWindowBackground": "$color:start_window_background", 39 "exported": true, 40 "skills": [ 41 { 42 "entities": [ 43 "entity.system.home" 44 ], 45 "actions": [ 46 "ohos.want.action.home" 47 ] 48 } 49 ], 50 "continueType": [ 51 "continueType1" 52 ], 53 "continueBundleName": [ 54 "com.example.myapplication1", 55 "com.example.myapplication2" 56 ] 57 } 58 ], 59 "definePermissions": [ 60 { 61 "name": "ohos.abilitydemo.permission.PROVIDER", 62 "grantMode": "system_grant", 63 "availableLevel": "system_core", 64 "provisionEnable": true, 65 "distributedSceneEnable": false, 66 "label": "$string:EntryAbility_label" 67 } 68 ], 69 "requestPermissions": [ 70 { 71 "name": "ohos.abilitydemo.permission.PROVIDER", 72 "reason": "$string:reason", 73 "usedScene": { 74 "abilities": [ 75 "FormAbility" 76 ], 77 "when": "inuse" 78 } 79 } 80 ], 81 "targetModuleName": "feature", 82 "targetPriority": 50, 83 "querySchemes": [ 84 "app1Scheme", 85 "app2Scheme" 86 ], 87 "routerMap": "$profile:router_map", 88 "appEnvironments": [ 89 { 90 "name": "name1", 91 "value": "value1" 92 } 93 ], 94 "hnpPackages": [ 95 { 96 "package": "hnpsample.hnp", 97 "type": "public" 98 } 99 ], 100 "fileContextMenu": "$profile:menu" 101 } 102} 103``` 104<!--RP1End--> 105 106## Tags in the Configuration File 107 108As shown above, the **module.json5** file contains several tags. 109 110 111 **Table 1** Tags in the module.json5 file 112 113| Name| Description| Data Type| Initial Value Allowed| 114| -------- | -------- | -------- | -------- | 115| 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| 116| 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| 117| srcEntry | Code path of the module. The value is a string with a maximum of 127 bytes.| String| Yes (initial value: left empty)| 118| description | Description of the module. The value is a string with a maximum of 255 bytes. It can be a resource reference.| String| Yes (initial value: left empty)| 119| <!--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)| 120| mainElement | Name of the entry UIAbility or ExtensionAbility of the module. The value is a string with a maximum of 255 bytes.| String| Yes (initial value: left empty)| 121| [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| 122| 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| 123| 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| 124| 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)| 125| [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| 126| [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)| 127| [abilities](#abilities) | UIAbility configuration of the module. The setting is effective only for the current UIAbility.| Object array| Yes (initial value: left empty)| 128| [extensionAbilities](#extensionabilities) | ExtensionAbility configuration of the module. The setting is effective only for the current ExtensionAbility.| Object array| Yes (initial value: left empty)| 129| [definePermissions](#definepermissions) | Permissions defined for the system resource HAP. Custom permissions are not supported.| Object array| Yes (initial value: left empty)| 130| [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)| 131| [testRunner](#testrunner) | Test runner of the module.| Object| Yes (initial value: left empty)| 132| [atomicService](#atomicservice)| Atomic service configuration.| Object| Yes (initial value: left empty) | 133| [dependencies](#dependencies)| List of shared libraries on which the module depends during running.| Object array| Yes (initial value: left empty) | 134| 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)| 135| 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**)| 136| [proxyData](#proxydata) | List of data proxies provided by the module.| Object array| Yes (initial value: left empty)| 137| 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**)| 138| 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**)| 139| 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 (initial value: **false**) | 140| 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**)| 141| fileContextMenu | Context menu of the current HAP. The value is a string with a maximum of 255 bytes.| String| Yes (initial value: left empty)| 142| 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)| 143| [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)| 144| [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)| 145| appStartup | Path of the startup framework of the current module. This tag takes effect only in the entry modules. | String| Yes (initial value: left empty)| 146| [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)| 147 148## deviceTypes 149 150 **Table 2** deviceTypes 151<!--RP2--> 152| Device Type| Value| Description| 153| -------- | -------- | -------- | 154| Tablet| tablet | - | 155| Smart TV| tv | - | 156| Smart watch| wearable | Watch that provides call features.| 157| Head unit| car | - | 158| 2in1 | 2in1 | Two-in-one device that allows for interactions with a touchscreen, keyboard, and mouse device.| 159| Default device| default | Device that provides full access to system capabilities.| 160<!--RP2End--> 161 162Example of the **deviceTypes** structure: 163 164 165```json 166{ 167 "module": { 168 "name": "myHapName", 169 "type": "feature", 170 "deviceTypes" : [ 171 "tablet" 172 ] 173 } 174} 175``` 176 177 178## pages 179 180The **pages** tag is a profile that represents information about specified pages. 181 182 183```json 184{ 185 "module": { 186 // ... 187 "pages": "$profile:main_pages", // Configured through the resource file in the profile 188 } 189} 190``` 191 192Define 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. 193 194 **Table 3** pages 195 196| Name| Description| Data Type| Initial Value Allowed| 197| -------- | -------- | -------- | -------- | 198| 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| 199| window | Window-related configuration. | Object| Yes (initial value: left empty)| 200 201 202 **Table 4** window 203 204| Name| Description| Data Type| Initial Value Allowed| 205| -------- | -------- | -------- | -------- | 206| designWidth | Baseline width for page design. The size of an element is scaled by the actual device width.| Number| Yes (initial value: **720px**)| 207| 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**)| 208 209```json 210{ 211 "src": [ 212 "pages/index/mainPage", 213 "pages/second/payment", 214 "pages/third/shopping_cart", 215 "pages/four/owner" 216 ], 217 "window": { 218 "designWidth": 720, 219 "autoDesignWidth": false 220 } 221} 222``` 223 224 225## metadata 226 227The **metadata** tag represents the custom metadata of the HAP. The tag value is an array and contains three subtags: **name**, **value**, and **resource**. 228 229**Table 5** metadata 230 231| Name| Description| Data Type| Initial Value Allowed| 232| -------- | -------- | -------- | -------- | 233| name | Name of the data item. The value is a string with a maximum of 255 bytes.| String| Yes (initial value: left empty)| 234| value | Value of the data item. The value is a string with a maximum of 255 bytes.| String| Yes (initial value: left empty)| 235| resource | Custom data format. The value is a resource index. It contains a maximum of 255 bytes.| String| Yes (initial value: left empty)| 236 237The **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. 238 239The **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. 240 241The 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. 242 243```json 244{ 245 "module": { 246 "metadata": [{ 247 "name": "module_metadata", 248 "value": "a test demo for module metadata", 249 "resource": "$profile:shortcuts_config" 250 }], 251 252 "abilities": [{ 253 "metadata": [{ 254 "name": "ability_metadata", 255 "value": "a test demo for ability", 256 "resource": "$profile:config_file" 257 }, 258 { 259 "name": "ability_metadata_2", 260 "value": "a string test", 261 "resource": "$profile:config_file" 262 }, 263 { 264 "name": "ohos.ability.window.height", 265 "value": "987" 266 }, 267 { 268 "name": "ohos.ability.window.width", 269 "value": "1300" 270 }, 271 { 272 "name": "ohos.ability.window.left", 273 "value": "right-50" 274 }, 275 { 276 "name": "ohos.ability.window.top", 277 "value": "center+50" 278 }, 279 { 280 "name": "enable.remove.starting.window", 281 "value": "true" 282 }], 283 }], 284 285 "extensionAbilities": [{ 286 "metadata": [{ 287 "name": "extensionAbility_metadata", 288 "value": "a test for extensionAbility", 289 "resource": "$profile:config_file" 290 }, 291 { 292 "name": "extensionAbility_metadata_2", 293 "value": "a string test", 294 "resource": "$profile:config_file" 295 }], 296 }] 297 } 298} 299``` 300 301 302## abilities 303 304The **abilities** tag represents the UIAbility configuration of the module, which is valid only for the current UIAbility component. 305 306 **Table 6** abilities 307 308| Name| Description| Data Type| Initial Value Allowed| 309| -------- | -------- | -------- | -------- | 310| 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| 311| srcEntry | Code path of the entry UIAbility. The value is a string with a maximum of 127 bytes.| String| No| 312| [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"**)| 313| description | Description of the UIAbility. 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)| 314| icon | Icon of the UIAbility. The value is the index of the icon resource file.| String| Yes (initial value: left empty)| 315| label | Name of the UIAbility displayed to users. The value must be a resource index to support multiple languages. The value is a string with a maximum of 255 bytes.| String| Yes (initial value: left empty)| 316| 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)| 317| [metadata](#metadata)| Metadata information of the UIAbility component.| Object array| Yes (initial value: left empty)| 318| 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**)| 319| 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**)| 320| [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)| 321| 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)| 322| startWindowIcon | Index to the icon file of the UIAbility startup page. The value is a string with a maximum of 255 bytes.| String| No| 323| 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| 324| 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**)| 325| 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> When configuring the resource index in the startup direction, the value is a string with a maximum of 255 bytes.<br> Example: $string:orientation.| String| Yes (initial value: **"unspecified"**)| 326| 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", "split", "floating"])| 327| <!--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**)| 328| 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)| 329| 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)| 330| 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)| 331| 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)| 332| 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)| 333| 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)| 334| <!--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**)| 335| 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**)| 336| <!--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**)| 337| 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**)| 338| 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**)| 339| 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**)| 340| continueType | Continuation type of the UIAbility.| String array| Yes (initial value: name of the UIAbility)| 341| 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)| 342| 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)| 343 344Example of the **abilities** structure: 345 346<!--RP3--> 347```json 348{ 349 "abilities": [{ 350 "name": "EntryAbility", 351 "srcEntry": "./ets/entryability/EntryAbility.ets", 352 "launchType":"singleton", 353 "description": "$string:description_main_ability", 354 "icon": "$media:layered_image", 355 "label": "Login", 356 "permissions": [], 357 "metadata": [], 358 "exported": true, 359 "continuable": true, 360 "skills": [{ 361 "actions": ["ohos.want.action.home"], 362 "entities": ["entity.system.home"], 363 "uris": [] 364 }], 365 "backgroundModes": [ 366 "dataTransfer", 367 "audioPlayback", 368 "audioRecording", 369 "location", 370 "bluetoothInteraction", 371 "multiDeviceConnection", 372 "wifiInteraction", 373 "voip", 374 "taskKeeping" 375 ], 376 "startWindowIcon": "$media:icon", 377 "startWindowBackground": "$color:red", 378 "removeMissionAfterTerminate": true, 379 "orientation": "$string:orientation", 380 "supportWindowMode": ["fullscreen", "split", "floating"], 381 "maxWindowRatio": 3.5, 382 "minWindowRatio": 0.5, 383 "maxWindowWidth": 2560, 384 "minWindowWidth": 1400, 385 "maxWindowHeight": 300, 386 "minWindowHeight": 200, 387 "excludeFromMissions": false, 388 "unclearableMission": false, 389 "excludeFromDock": false, 390 "preferMultiWindowOrientation": "default", 391 "isolationProcess": false, 392 "continueType": [ 393 "continueType1", 394 "continueType2" 395 ], 396 "continueBundleName": [ 397 "com.example.myapplication1", 398 "com.example.myapplication2" 399 ], 400 "process": ":processTag" 401 }] 402} 403``` 404<!--RP3End--> 405 406## skills 407 408The **skills** tag represents the feature set of [wants](../application-models/want-overview.md) that can be received by the UIAbility or ExtensionAbility component. 409 410 **Table 7** skills 411 412| Name| Description| Data Type| Initial Value Allowed| 413| -------- | -------- | -------- | -------- | 414| 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)| 415| 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)| 416| uris | URIs that match the wants. The maximum number of records in an array is **512**.| Object array| Yes (initial value: left empty)| 417| 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)| 418| domainVerify | Whether to enable domain name verification.| Boolean| Yes (initial value: **false**)| 419 420 421 **Table 8** uris 422 423| Name| Description| Data Type| Initial Value Allowed| 424| -------- | -------- | -------- | -------- | 425| scheme | Scheme of the URI, such as HTTP, HTTPS, file, and FTP. | String| Yes when only **type** is set in **uris** (initial value: left empty)| 426| 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**. | String| Yes (initial value: left empty)| 427| 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)| 428| path \| pathStartWith \| 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)| 429| 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)| 430| 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)| 431| 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**)| 432| 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. For details, see [Description of linkFeature](../application-models/app-uri-config.md#description-of-linkfeature)| String| Yes (initial value: left empty)| 433 434Example of the **skills** structure: 435 436 437```json 438{ 439 "abilities": [ 440 { 441 "skills": [ 442 { 443 "actions": [ 444 "ohos.want.action.home" 445 ], 446 "entities": [ 447 "entity.system.home" 448 ], 449 "uris": [ 450 { 451 "scheme":"http", 452 "host":"example.com", 453 "port":"80", 454 "path":"path", 455 "type": "text/*", 456 "linkFeature": "Login" 457 } 458 ], 459 "permissions": [], 460 "domainVerify": false 461 } 462 ] 463 } 464 ] 465} 466``` 467 468## extensionAbilities 469 470The **extensionAbilities** tag represents the configuration of ExtensionAbilities, which is valid only for the current ExtensionAbility. 471 472 **Table 9** extensionAbilities 473 474| Name| Description| Data Type| Initial Value Allowed| 475| -------- | -------- | -------- | -------- | 476| 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| 477| srcEntry | Code path of the ExtensionAbility. The value is a string with a maximum of 127 bytes.| String| No| 478| description | Description of the ExtensionAbility. 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)| 479| 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)| 480| 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)| 481| 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>**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| 482| 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)| 483| 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)| 484| 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)| 485| 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)| 486|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)| 487| [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)| 488| 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**)| 489| 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)| 490| 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)| 491| 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)| 492 493Example of the **extensionAbilities** structure: 494 495 496```json 497{ 498 "extensionAbilities": [ 499 { 500 "name": "FormName", 501 "srcEntry": "./form/MyForm.ts", 502 "icon": "$media:icon", 503 "label" : "$string:extension_name", 504 "description": "$string:form_description", 505 "type": "form", 506 "permissions": ["ohos.abilitydemo.permission.PROVIDER"], 507 "readPermission": "", 508 "writePermission": "", 509 "exported": true, 510 "uri":"scheme://authority/path/query", 511 "skills": [{ 512 "actions": [], 513 "entities": [], 514 "uris": [], 515 "permissions": [] 516 }], 517 "metadata": [ 518 { 519 "name": "ohos.extension.form", 520 "resource": "$profile:form_config", 521 } 522 ], 523 "extensionProcessMode": "instance", 524 "dataGroupIds": [ 525 "testGroupId1" 526 ] 527 } 528 ] 529} 530``` 531 532## shortcuts 533 534The **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**. 535 536The **shortcut** information is identified in **metadata**, where: 537 538- **name** indicates the name of the shortcut, identified by **ohos.ability.shortcuts**. 539 540- **resource** indicates where the resources of the shortcut are stored. 541 542**Table 11** shortcuts 543 544| Name| Description| Data Type | Initial Value Allowed| 545| -------- | -------- | -------- | -------- | 546| 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| 547| 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)| 548| icon | Icon of the shortcut. The value is the index of the icon resource file.| String| Yes (initial value: left empty)| 549| [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)| 550 551 5521. Configure the **shortcuts_config.json** file in **/resources/base/profile/**. 553 554 ```json 555 { 556 "shortcuts": [ 557 { 558 "shortcutId": "id_test1", 559 "label": "$string:shortcut", 560 "icon": "$media:aa_icon", 561 "wants": [ 562 { 563 "bundleName": "com.ohos.hello", 564 "moduleName": "entry", 565 "abilityName": "EntryAbility", 566 "parameters": { 567 "testKey": "testValue" 568 } 569 } 570 ] 571 } 572 ] 573 } 574 ``` 575 5762. 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. 577 578 ```json 579 { 580 "module": { 581 // ... 582 "abilities": [ 583 { 584 "name": "EntryAbility", 585 "srcEntry": "./ets/entryability/EntryAbility.ets", 586 // ... 587 "skills": [ 588 { 589 "entities": [ 590 "entity.system.home" 591 ], 592 "actions": [ 593 "ohos.want.action.home" 594 ] 595 } 596 ], 597 "metadata": [ 598 { 599 "name": "ohos.ability.shortcuts", 600 "resource": "$profile:shortcuts_config" 601 } 602 ] 603 } 604 ] 605 } 606 } 607 ``` 608### wants 609 610The **wants** tag provides wants information for a shortcut. 611 612**Table 11-1** wants 613 614| Name| Description| Data Type | Initial Value Allowed| 615| -------- | -------- | -------- | -------- | 616| bundleName | Target bundle name of the shortcut.| String| No| 617| moduleName | Target module name of the shortcut.| String| Yes| 618| abilityName| Target ability name of the shortcut.| String| No| 619| parameters | Custom data when the shortcut is started. The data must be strings. A key can contain a maximum of 1024 characters.| Object| Yes| 620 621Example of the **data** structure: 622 623```json 624{ 625 "wants": [ 626 { 627 "bundleName": "com.ohos.hello", 628 "moduleName": "entry", 629 "abilityName": "EntryAbility", 630 "parameters": { 631 "testKey": "testValue" 632 } 633 } 634 ] 635} 636``` 637 638## distributionFilter 639 640The **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. 641 642> **NOTE** 643> This tag is supported since API version 10. In earlier versions, the **distroFilter** tag is used. 644 645- **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. 646 ```json 647 // Device types supported by entry1 648 { 649 "module": { 650 "name": "entry1", 651 "type": "entry", 652 "deviceTypes" : [ 653 "tv", 654 "tablet" 655 ] 656 } 657 } 658 ``` 659 ```json 660 // Device types supported by entry2 661 { 662 "module": { 663 "name": "entry2", 664 "type": "entry", 665 "deviceTypes" : [ 666 "car", 667 "tablet" 668 ] 669 } 670 } 671 ``` 672 673- **Configuration rules**: This tag consists of four attributes: [screenShape](#screenshape), [screenWindow](#screenwindow), [screenDensity](#screendensity), and [countryCode](#countrycode). 674 675 During distribution, a unique HAP is determined based on the mapping between **deviceTypes** and the preceding attributes. 676 677 * When configuring this tag, include at least one of the attributes. 678 * 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. 679 * The **screenShape** and **screenWindow** attributes are available only for lite wearables. 680 681- **Configuration**: This tag must be configured in the **/resources/base/profile** directory and be referenced in the **resource** field of **metadata**. 682 683 684**Table 12** distributionFilter 685 686| Name| Description| Data Type| Initial Value Allowed| 687| -------- | -------- | -------- | -------- | 688| [screenShape](#screenshape) | Supported screen shapes.| Object array| Yes (initial value: left empty)| 689| [screenWindow](#screenwindow) | Supported application window resolutions.| Object array| Yes (initial value: left empty)| 690| [screenDensity](#screendensity)| Pixel density of the screen, in dots per inch (DPI).| Object array| Yes (initial value: left empty)| 691| [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)| 692 693### screenShape 694 695**Table 13** screenShape 696 697| Name| Description| Data Type| Initial Value Allowed| 698| -------- | -------- | -------- | -------- | 699| 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| 700| 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| 701 702### screenWindow 703 704**Table 14** screenWindow 705 706| Name| Description| Data Type| Initial Value Allowed| 707| -------- | -------- | -------- | -------- | 708| 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| 709| 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| 710 711### screenDensity 712 713**Table 15** screenDensity 714 715| Name| Description| Data Type| Initial Value Allowed| 716| -------- | -------- | -------- | -------- | 717| 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| 718| 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| 719 720### countryCode 721 722**Table 16** countryCode 723 724| Name| Description| Data Type| Initial Value Allowed| 725| -------- | -------- | -------- | -------- | 726| 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| 727| value | Code of the country or region to which the application is to be distributed.| String array| No| 728 729 730Example: 731 7321. Configure the **distributionFilter_config.json** file (this file name is customizable) in **resources/base/profile** under the development view. 733 ```json 734 { 735 "distributionFilter": { 736 "screenShape": { 737 "policy": "include", 738 "value": [ 739 "circle", 740 "rect" 741 ] 742 }, 743 "screenWindow": { 744 "policy": "include", 745 "value": [ 746 "454*454", 747 "466*466" 748 ] 749 }, 750 "screenDensity": { 751 "policy": "exclude", 752 "value": [ 753 "ldpi", 754 "xldpi" 755 ] 756 }, 757 "countryCode": {// Distribution in China is supported. 758 "policy": "include", 759 "value": [ 760 "CN" 761 ] 762 } 763 } 764 } 765 ``` 766 767 7682. Configure **metadata** in the **module** tag in the **module.json5** file. 769 770 771 ```json 772 { 773 "module": { 774 // ... 775 "metadata": [ 776 { 777 "name": "ohos.module.distribution", 778 "resource": "$profile:distributionFilter_config", 779 } 780 ] 781 } 782 } 783 ``` 784 785 786## testRunner 787 788The **testRunner** tag represents the supported test runner. 789 790**Table 17** testRunner 791 792| Name| Description| Data Type| Initial Value Allowed| 793| -------- | -------- | -------- | -------- | 794| name | Name of the test runner object. The value is a string with a maximum of 255 bytes.| String| No| 795| srcPath | Code path of the test runner. The value is a string with a maximum of 255 bytes. | String| No| 796 797Example of the **testRunner** structure: 798 799 800```json 801{ 802 "module": { 803 // ... 804 "testRunner": { 805 "name": "myTestRunnerName", 806 "srcPath": "etc/test/TestRunner.ts" 807 } 808 } 809} 810``` 811 812## atomicService 813 814The **atomicService** tag represents the atomic service configuration. It is available only when **bundleType** is set to **atomicService** in the **app.json** file. 815 816**Table 18** atomicService 817 818| Name| Description| Data Type| Initial Value Allowed| 819| -------- | -------- | -------- | -------- | 820| preloads | List of modules to preload.| Object array| Yes (initial value: left empty)| 821 822 823**Table 19** preloads 824 825| Name| Description| Data Type| Initial Value Allowed| 826| -------- | -------- | -------- | -------- | 827| 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| 828 829 830Example of the **atomicService** structure: 831 832```json 833{ 834 "module": { 835 "atomicService": { 836 "preloads":[ 837 { 838 "moduleName":"feature" 839 } 840 ] 841 } 842 } 843} 844``` 845 846## dependencies 847 848The **dependencies** tag identifies the list of shared libraries that the module depends on when it is running. 849 850**Table 20** dependencies 851 852| Name | Description | Data Type| Initial Value Allowed| 853| ----------- | ------------------------------ | -------- | ---------- | 854| 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)| 855| 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| 856| versionCode | Version number of the shared bundle. The value ranges from 0 to 2147483647.| Number | Yes (initial value: left empty)| 857 858Example of the **dependencies** structure: 859 860```json 861{ 862 "module": { 863 "dependencies": [ 864 { 865 "bundleName":"com.share.library", 866 "moduleName": "library", 867 "versionCode": 10001 868 } 869 ] 870 } 871} 872``` 873 874## proxyData 875 876The **proxyDatas** tag provides the list of data proxies provided by the module. It can be configured only for entry and feature modules. 877 878**Table 21** proxyData 879| Name | Description | Data Type| Initial Value Allowed| 880| ----------- | ------------------------------ | -------- | ---------- | 881| 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| 882| 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)| 883| 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)| 884| [metadata](#metadata)| Metadata of the data proxy. Only the **name** and **resource** fields can be configured.| Object| Yes (initial value: left empty)| 885 886Example of the **proxyData** structure: 887 888```json 889{ 890 "module": { 891 "proxyData": [ 892 { 893 "uri":"datashareproxy://com.ohos.datashare/event/Meeting", 894 "requiredReadPermission": "ohos.permission.GET_BUNDLE_INFO", 895 "requiredWritePermission": "ohos.permission.GET_BUNDLE_INFO", 896 "metadata": { 897 "name": "datashare_metadata", 898 "resource": "$profile:datashare" 899 } 900 } 901 ] 902 } 903} 904``` 905 906## routerMap 907 908The **routerMap** tag represents the path to the routing table for the module. 909 910The **routerMap** configuration file provides the routing table information of the module. The value of the **routerMap** tag is an array. 911 912**Table 22** routerMap 913 914| Name| Description| Data Type| Initial Value Allowed| 915| -------- | -------- | -------- | -------- | 916| name | Name of the page to be redirected to. The value is a string with a maximum of 1023 bytes.| String | No | 917| pageSourceFile| Path of the page in the module. The value is a string with a maximum of 255 bytes.| String| No | 918| 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 | 919| [data](#data) | Custom data of the string type. Each piece of custom data cannot exceed 128 bytes.| Object | Yes (initial value: left empty) | 920| [customData](#customdata) | Custom data of any type. The value of the total length cannot exceed 4096 bytes. | Object | Yes (initial value: left empty) | 921 922Example: 923 9241. 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**. 925 926 ```json 927 { 928 "routerMap": [ 929 { 930 "name": "DynamicPage1", 931 "pageSourceFile": "src/main/ets/pages/pageOne.ets", 932 "buildFunction": "myFunction", 933 "customData": { 934 "stringKey": "data1", 935 "numberKey": 123, 936 "booleanKey": true, 937 "objectKey": { 938 "name": "test" 939 }, 940 "arrayKey": [ 941 { 942 "id": 123 943 } 944 ] 945 } 946 }, 947 { 948 "name": "DynamicPage2", 949 "pageSourceFile": "src/main/ets/pages/pageTwo.ets", 950 "buildFunction": "myBuilder", 951 "data": { 952 "key1": "data1", 953 "key2": "data2" 954 } 955 } 956 ] 957 } 958 ``` 959 9602. 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"**. 961 962### data 963 964The **data** tag is used to configure custom string data in the routing table. 965 966Example of the **data** structure: 967 968```json 969{ 970 "routerMap": [ 971 { 972 "name": "DynamicPage", 973 "pageSourceFile": "src/main/ets/pages/pageOne.ets", 974 "buildFunction": "myBuilder", 975 "data": { 976 "key1": "data1", 977 "key2": "data2" 978 } 979 } 980 ] 981} 982``` 983 984### customData 985 986The **data** tag represents custom data in the routing table. 987The **customData** tag is used to configure custom data of any type. 988 989Example of the **customData** structure: 990 991```json 992{ 993 "routerMap": [ 994 { 995 "name": "DynamicPage", 996 "pageSourceFile": "src/main/ets/pages/pageOne.ets", 997 "buildFunction": "myBuilder", 998 "customData": { 999 "stringKey": "data1", 1000 "numberKey": 123, 1001 "booleanKey": true, 1002 "objectKey": { 1003 "name": "test" 1004 }, 1005 "arrayKey": [ 1006 { 1007 "id": 123 1008 } 1009 ] 1010 } 1011 } 1012 ] 1013} 1014``` 1015 1016## appEnvironments 1017 1018The **appEnvironments** tag represents the application environment variables configured for the module. 1019 1020**Table 23** appEnvironments 1021 1022| Name| Description| Data Type| Initial Value Allowed| 1023| -------- | -------- | -------- | -------- | 1024| name | Name of the environment variable. The value is a string with a maximum of 4096 bytes.| String | Yes (initial value: left empty)| 1025| value | Value of the environment variable. The value is a string with a maximum of 4096 bytes. | String | Yes (initial value: left empty)| 1026 1027Example of the **appEnvironments** structure: 1028 1029```json 1030{ 1031 "module": { 1032 "appEnvironments": [ 1033 { 1034 "name":"name1", 1035 "value": "value1" 1036 } 1037 ] 1038 } 1039} 1040``` 1041 1042## definePermissions 1043 1044The **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. 1045 1046**Table 24** definePermissions 1047 1048| Name| Description| Data Type| Initial Value Allowed| 1049| -------- | -------- | -------- | -------- | 1050| name | Name of a permission. The value can contain a maximum of 255 bytes.| String| No| 1051| 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"**)| 1052| 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"**)| 1053| 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**)| 1054| distributedSceneEnabled | Whether the permission can be used in distributed scenarios.| Boolean| Yes (initial value: **false**)| 1055| label | Brief description of the permission. The value is a resource index to the description.| String| Yes (initial value: left empty)| 1056| description | Detailed description of the permission. The value is a string or a resource index to the description.| String| Yes (initial value: left empty)| 1057 1058Example of the **definePermissions** structure: 1059 1060```json 1061{ 1062 "module" : { 1063 "definePermissions": [ 1064 { 1065 "name": "ohos.abilitydemo.permission.PROVIDER", 1066 "grantMode": "system_grant", 1067 "availableLevel": "system_core", 1068 "provisionEnable": true, 1069 "distributedSceneEnable": false, 1070 "label": "$string:EntryAbility_label" 1071 } 1072 ] 1073 } 1074} 1075``` 1076 1077## hnpPackages 1078 1079The **hnpPackages** tag provides information about the native software package contained in the application. 1080 1081**Table 25** hnpPackages 1082 1083| Name| Description| Data Type| Initial Value Allowed| 1084| -------- | -------- | -------- | -------- | 1085| package | Name of the native software package.| String| No| 1086| type | Type of the native software package. The options are as follows:<br>- **public**: public type.<br>- **private**: private type. | String| No| 1087 1088Example of the **hnpPackages** structure: 1089 1090 1091```json 1092{ 1093 "module" : { 1094 "hnpPackages": [ 1095 { 1096 "package": "hnpsample.hnp", 1097 "type": "public" 1098 } 1099 ] 1100 } 1101} 1102``` 1103 1104## fileContextMenu 1105 1106The **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. 1107 1108Example of the **fileContextMenu** structure: 1109 1110```json 1111{ 1112 "module": { 1113 // ... 1114 "fileContextMenu": "$profile:menu" // Configured through the resource file in the profile 1115 } 1116} 1117``` 1118 1119Define 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. 1120The 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.) 1121 1122**Table 26** fileContextMenu 1123 1124| Name| Description| Data Type| Initial Value Allowed| 1125| -------- | -------- | -------- | -------- | 1126| abilityName | Name of the ability to be started for the context menu.| String| No| 1127| menuItem | Information displayed on the context menu.| Resource ID| No| 1128| 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| 1129| menuContext | Context required for displaying the context menu. Multiple contexts are supported.| Object array| No| 1130 1131**Table 27** menuContext 1132 1133| Name| Description| Data Type| Initial Value Allowed| 1134| -------- | -------- | -------- | -------- | 1135| 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| 1136| 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**)| 1137| 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**)| 1138| 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)| 1139 1140Example of the **menu.json** file in the **resources/base/profile** directory: 1141```json 1142{ 1143 "fileContextMenu": [ 1144 { 1145 "abilityName": "EntryAbility", 1146 "menuItem": "$string:module_desc", 1147 "menuHandler": "openCompress", 1148 "menuContext": [ 1149 { 1150 "menuKind": 0 1151 }, 1152 { 1153 "menuKind": 1, 1154 "menuRule": "both", 1155 "fileSupportType": [ 1156 ".rar", 1157 ".zip" 1158 ], 1159 "fileNotSupportType": [ 1160 "" 1161 ] 1162 }, 1163 { 1164 "menuKind": 2, 1165 "menuRule": "single" 1166 }, 1167 { 1168 "menuKind": 3 1169 } 1170 ] 1171 } 1172 ] 1173} 1174``` 1175 1176**Response Behavior** 1177 1178After 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**: 1179 1180**Table 28** parameter field in want 1181 1182| Name| Value| Data Type| 1183| -------- | -------- | -------- | 1184| menuHandler | Value of **menuHandler** in the registration configuration file.| String| 1185| 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| 1186