1# @ohos.bundle.bundleManager (bundleManager) 2 3The bundleManager module provides APIs for obtaining application information, including [BundleInfo](js-apis-bundleManager-bundleInfo.md), [ApplicationInfo](js-apis-bundleManager-applicationInfo.md), [AbilityInfo](js-apis-bundleManager-abilityInfo.md), and [ExtensionAbility](js-apis-bundleManager-extensionAbilityInfo.md). 4 5> **NOTE** 6> 7> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. 8 9## Modules to Import 10 11```ts 12import { bundleManager } from '@kit.AbilityKit'; 13``` 14 15## Required Permissions 16 17| Permission | APL | Description | 18| ------------------------------------------ | ------------ | ------------------| 19| ohos.permission.GET_BUNDLE_INFO_PRIVILEGED | system_basic | Permission to obtain basic information and other sensitive information about a bundle.| 20 21For details about the APL, see [Basic Concepts in the Permission Mechanism](../../security/AccessToken/app-permission-mgmt-overview.md#basic-concepts-in-the-permission-mechanism). 22 23## BundleFlag 24 25Enumerates the bundle flags, which indicate the type of bundle information to obtain. 26 27 **System capability**: SystemCapability.BundleManager.BundleFramework.Core 28 29| Name | Value | Description | 30| --------------------------------------------- | ---------- | ------------------------------------------------------------ | 31| GET_BUNDLE_INFO_DEFAULT | 0x00000000 | Used to obtain the default bundle information. The obtained information does not contain information about the signature, application, HAP module, ability, ExtensionAbility, or permission.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 32| GET_BUNDLE_INFO_WITH_APPLICATION | 0x00000001 | Used to obtain the bundle information with application information. The obtained information does not contain information about the signature, HAP module, ability, ExtensionAbility, or permission.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 33| GET_BUNDLE_INFO_WITH_HAP_MODULE | 0x00000002 | Used to obtain the bundle information with HAP module information. The obtained information does not contain information about the signature, application, ability, ExtensionAbility, or permission.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 34| GET_BUNDLE_INFO_WITH_ABILITY | 0x00000004 | Used to obtain the bundle information with ability information. The obtained information does not contain information about the signature, application, ExtensionAbility, or permission. It must be used together with **GET_BUNDLE_INFO_WITH_HAP_MODULE**.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 35| GET_BUNDLE_INFO_WITH_EXTENSION_ABILITY | 0x00000008 | Used to obtain the bundle information with ExtensionAbility information. The obtained information does not contain information about the signature, application, ability, or permission. It must be used together with **GET_BUNDLE_INFO_WITH_HAP_MODULE**.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 36| GET_BUNDLE_INFO_WITH_REQUESTED_PERMISSION | 0x00000010 | Used to obtain the bundle information with permission information. The obtained information does not contain information about the signature, application, HAP module, ability, or ExtensionAbility.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 37| GET_BUNDLE_INFO_WITH_METADATA | 0x00000020 | Used to obtain the metadata contained in the application, HAP module, ability, or ExtensionAbility information. It must be used together with **GET_BUNDLE_INFO_WITH_APPLICATION**, **GET_BUNDLE_INFO_WITH_HAP_MODULE**, **GET_BUNDLE_INFO_WITH_ABILITY**, and **GET_BUNDLE_INFO_WITH_EXTENSION_ABILITY**.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 38| GET_BUNDLE_INFO_WITH_DISABLE | 0x00000040 | Used to obtain the information about disabled bundles and abilities of a bundle. The obtained information does not contain information about the signature, application, HAP module, ability, ExtensionAbility, or permission.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 39| GET_BUNDLE_INFO_WITH_SIGNATURE_INFO | 0x00000080 | Used to obtain the bundle information with signature information. The obtained information does not contain information about the application, HAP module, ability, ExtensionAbility, or permission.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 40| GET_BUNDLE_INFO_WITH_MENU<sup>11+</sup> | 0x00000100 | Used to obtain the bundle information with the file context menu configuration. It must be used together with **GET_BUNDLE_INFO_WITH_HAP_MODULE**.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 41| GET_BUNDLE_INFO_WITH_ROUTER_MAP<sup>12+</sup> | 0x00000200 | Used to obtain the bundle information with the router map. It must be used together with **GET_BUNDLE_INFO_WITH_HAP_MODULE**.<br>**Atomic service API**: This API can be used in atomic services since API version 12.| 42| GET_BUNDLE_INFO_WITH_SKILL<sup>12+</sup> | 0x00000800 | Used to obtain the bundle information with the skills. It must be used together with **GET_BUNDLE_INFO_WITH_HAP_MODULE**, **GET_BUNDLE_INFO_WITH_ABILITY**, and **GET_BUNDLE_INFO_WITH_EXTENSION_ABILITY**.<br>**Atomic service API**: This API can be used in atomic services since API version 12.| 43 44## ExtensionAbilityType 45 46Enumerates the types of ExtensionAbilities. 47 48 **System capability**: SystemCapability.BundleManager.BundleFramework.Core 49 50| Name| Value| Description| 51|:----------------:|:---:|-----| 52| FORM | 0 | [FormExtensionAbility](../apis-form-kit/js-apis-app-form-formExtensionAbility.md): provides APIs for widget development.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 53| WORK_SCHEDULER | 1 | [WorkSchedulerExtensionAbility](../apis-backgroundtasks-kit/js-apis-WorkSchedulerExtensionAbility.md): enables applications to execute non-real-time tasks when the system is idle.| 54| INPUT_METHOD | 2 | [InputMethodExtensionAbility](../apis-ime-kit/js-apis-inputmethod-extension-ability.md): provides APIs for developing input method applications.| 55|<!--DelRow--> SERVICE | 3 | [ServiceExtensionAbility](js-apis-app-ability-serviceExtensionAbility-sys.md): enables applications to run in the background and provide services.| 56| ACCESSIBILITY | 4 | <!--RP1-->[AccessibilityExtensionAbility](../apis-accessibility-kit/js-apis-application-accessibilityExtensionAbility.md)<!--RP1End-->: provides accessibility for access to and operations on the UI.| 57|<!--DelRow--> DATA_SHARE | 5 | [DataShareExtensionAbility](../apis-arkdata/js-apis-application-dataShareExtensionAbility-sys.md): enables applications to read and write data.| 58|<!--DelRow--> FILE_SHARE | 6 | FileShareExtensionAbility: enables file sharing between applications. This ability is reserved and supported only by system applications.| 59|<!--DelRow--> STATIC_SUBSCRIBER| 7 | [StaticSubscriberExtensionAbility](../apis-basic-services-kit/js-apis-application-staticSubscriberExtensionAbility-sys.md): provides APIs for processing static events, such as the startup event.| 60|<!--DelRow--> WALLPAPER | 8 | WallpaperExtensionAbility: provides APIs to implement the home screen wallpaper. This ability is reserved and supported only by system applications.| 61| BACKUP | 9 | [BackupExtensionAbility](../apis-core-file-kit/js-apis-application-backupExtensionAbility.md): provides APIs to implement application data backup and restore.| 62|<!--DelRow--> WINDOW | 10 | [WindowExtensionAbility](../apis-arkui/js-apis-application-windowExtensionAbility-sys.md): allows system applications to display UIs of other applications.| 63| ENTERPRISE_ADMIN | 11 | [EnterpriseAdminExtensionAbility](../apis-mdm-kit/js-apis-EnterpriseAdminExtensionAbility.md): provides APIs for processing enterprise management events, such as application installation events on devices and events indicating too many incorrect screen-lock password attempts.| 64|<!--DelRow--> THUMBNAIL | 13 | ThumbnailExtensionAbility: provides thumbnails for files. This ability is reserved and supported only by system applications.| 65|<!--DelRow--> PREVIEW | 14 | PreviewExtensionAbility: provides APIs for file preview so that other applications can be embedded and displayed in the current application. This ability is reserved and supported only by system applications.| 66|<!--DelRow--> PRINT<sup>10+</sup> | 15 | PrintExtensionAbility: provides APIs for printing images. This ability is supported only by system applications.| 67| SHARE<sup>10+</sup> | 16 | [ShareExtensionAbility](js-apis-app-ability-shareExtensionAbility.md): provides sharing service templates based on UIExtensionAbilities.| 68|<!--DelRow--> PUSH<sup>10+</sup> | 17 | PushExtensionAbility: provides APIs for pushing scenario-specific messages. This ability is reserved and supported only by system applications.| 69|<!--DelRow--> DRIVER<sup>10+</sup> | 18 | [DriverExtensionAbility](../apis-driverdevelopment-kit/js-apis-app-ability-driverExtensionAbility.md): provides APIs for the peripheral driver. This ability is supported only by system applications.| 70| ACTION<sup>10+</sup> | 19 | [ActionExtensionAbility](js-apis-app-ability-actionExtensionAbility.md): provides custom action service templates based on UIExtensionAbilities.| 71|<!--DelRow--> ADS_SERVICE<sup>11+</sup> | 20 | AdsServiceExtensionAbility: provides background customized ad services for external systems. This ability is supported only by system applications.| 72| EMBEDDED_UI<sup>12+</sup> | 21 | [EmbeddedUIExtensionAbility](js-apis-app-ability-embeddedUIExtensionAbility.md): provides ExtensionAbilities for the embeddable UI across process.| 73| INSIGHT_INTENT_UI<sup>12+</sup> | 22 | **InsightIntentUIExtensionAbility**: provides APIs that enable applications to be called by Celia intents so as to be displayed in windows.| 74| ASSET_ACCELERATION<sup>18+</sup> | 26 | **AssetAccelerationExtensionAbility**: provides the capability of pre-downloading background resources when the device is idle.| 75| UNSPECIFIED | 255 | No type is specified. It is used together with **queryExtensionAbilityInfo** to query all types of ExtensionAbilities.| 76 77 78## PermissionGrantState 79 80Enumerates the permission grant states. 81 82 **Atomic service API**: This API can be used in atomic services since API version 11. 83 84 **System capability**: SystemCapability.BundleManager.BundleFramework.Core 85 86| Name| Value| Description| 87|:----------------:|:---:|:---:| 88| PERMISSION_DENIED| -1 | Permission denied.| 89| PERMISSION_GRANTED | 0 | Permission granted. | 90 91## SupportWindowMode 92 93Enumerates the window modes supported by the ability. 94 95 **Atomic service API**: This API can be used in atomic services since API version 11. 96 97 **System capability**: SystemCapability.BundleManager.BundleFramework.Core 98 99| Name| Value| Description| 100|:----------------:|:---:|:---:| 101| FULL_SCREEN | 0 | A window in full-screen mode is supported.| 102| SPLIT | 1 | A window in split-screen mode is supported.| 103| FLOATING | 2 | A floating window is supported. | 104 105## LaunchType 106 107Enumerates the launch types of the ability. 108 109 **Atomic service API**: This API can be used in atomic services since API version 11. 110 111 **System capability**: SystemCapability.BundleManager.BundleFramework.Core 112 113| Name| Value| Description| 114|:----------------:|:---:|:---:| 115| SINGLETON | 0 | The ability can have only one instance.| 116| MULTITON | 1 | The ability can have multiple instances.| 117| SPECIFIED | 2 | The ability can have one or multiple instances, depending on the internal service of the ability.| 118 119## AbilityType 120 121Enumerates the types of abilities. 122 123 **Model restriction**: This API can be used only in the FA model. 124 125 **System capability**: SystemCapability.BundleManager.BundleFramework.Core 126 127| Name | Value | Description | 128| :-----: | ---- | :--------------------------------------------------------: | 129| PAGE | 1 | Ability that has the UI. FA developed using the Page template to provide the capability of interacting with users. | 130| SERVICE | 2 | Ability of the background service type, without the UI. PA developed using the Service template to provide the capability of running tasks in the background. | 131| DATA | 3 | PA developed using the Data template to provide unified data access for external systems.| 132 133## DisplayOrientation 134 135Enumerates the display orientations of the ability. This property applies only to the ability using the Page template. 136 137 **System capability**: SystemCapability.BundleManager.BundleFramework.Core 138 139| Name |Value|Description| 140|:----------------------------------|---|---| 141| UNSPECIFIED |0 |Unspecified. The orientation is determined by the system.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 142| LANDSCAPE |1 |Landscape.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 143| PORTRAIT |2 |Portrait.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 144| FOLLOW_RECENT |3 |The last display orientation is used.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 145| LANDSCAPE_INVERTED |4 |Reverse landscape.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 146| PORTRAIT_INVERTED |5 |Reverse portrait.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 147| AUTO_ROTATION |6 |Auto rotation.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 148| AUTO_ROTATION_LANDSCAPE |7 |Auto rotation in the horizontal direction.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 149| AUTO_ROTATION_PORTRAIT |8 |Auto rotation in the vertical direction.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 150| AUTO_ROTATION_RESTRICTED |9 |Switched-determined auto rotation.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 151| AUTO_ROTATION_LANDSCAPE_RESTRICTED |10|Switched-determined auto rotation in the horizontal direction.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 152| AUTO_ROTATION_PORTRAIT_RESTRICTED |11|Switched-determined auto rotation in the vertical direction.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 153| LOCKED |12|Locked.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 154| AUTO_ROTATION_UNSPECIFIED<sup>12+</sup> |13|Auto rotation controlled by the switch and determined by the system.<br>**Atomic service API**: This API can be used in atomic services since API version 12.| 155| FOLLOW_DESKTOP<sup>12+</sup> |14|Following the orientation of the home screen.<br>**Atomic service API**: This API can be used in atomic services since API version 12.| 156 157## CompatiblePolicy<sup>10+</sup> 158 159Defines the version compatibility type of the shared library. 160 161 **Atomic service API**: This API can be used in atomic services since API version 11. 162 163 **System capability**: SystemCapability.BundleManager.BundleFramework.Core 164 165| Name | Value | Description | 166| ---------------------- | ---- | -------------------------------- | 167| BACKWARD_COMPATIBILITY | 1 | The shared library is backward compatible.| 168 169## ModuleType 170 171Enumerates the module types. 172 173 **Atomic service API**: This API can be used in atomic services since API version 11. 174 175 **System capability**: SystemCapability.BundleManager.BundleFramework.Core 176 177| Name | Value | Description | 178| ------- | ---- | -------------------- | 179| ENTRY | 1 | Main module of the application. | 180| FEATURE | 2 | Dynamic feature module of the application.| 181| SHARED | 3 | Dynamic shared library module of the application. | 182 183## BundleType 184 185Enumerates the bundle types. 186 187 **Atomic service API**: This API can be used in atomic services since API version 11. 188 189 **System capability**: SystemCapability.BundleManager.BundleFramework.Core 190 191| Name | Value | Description | 192| -------------- | ---- | --------------- | 193| APP | 0 | The bundle is an application. | 194| ATOMIC_SERVICE | 1 | The bundle is an atomic service.| 195 196## MultiAppModeType<sup>12+</sup> 197Enumerates the types of the multi-app mode. 198 199 **System capability**: SystemCapability.BundleManager.BundleFramework.Core 200 201| Name| Value| Description| 202|:----------------:|:---:|:---:| 203| UNSPECIFIED| 0 | Unspecified type.| 204| MULTI_INSTANCE | 1 | Multiton mode. A resident process does not support this value. | 205| APP_CLONE | 2 | App clone mode. | 206 207## bundleManager.getBundleInfoForSelf 208 209getBundleInfoForSelf(bundleFlags: number): Promise\<BundleInfo> 210 211Obtains the bundle information based on the given bundle flags. This API uses a promise to return the result. 212 213**Atomic service API**: This API can be used in atomic services since API version 11. 214 215**System capability**: SystemCapability.BundleManager.BundleFramework.Core 216 217**Parameters** 218 219| Name | Type | Mandatory| Description | 220| ----------- | ------ | ---- | --------------------- | 221| [bundleFlags](js-apis-bundleManager.md#bundleflag) | number | Yes | Type of the bundle information to obtain.| 222 223**Return value** 224 225| Type | Description | 226| ----------------------------------------------------------- | ------------------------------------- | 227| Promise\<[BundleInfo](js-apis-bundleManager-bundleInfo.md)> | Promise used to return the bundle information.| 228 229**Error codes** 230 231For details about the error codes, see [Universal Error Codes](../errorcode-universal.md). 232 233| ID| Error Message | 234| -------- | ------------------------------------------------------------ | 235| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.| 236 237**Example** 238 239```ts 240// Obtain application info with metadataArray. 241import { bundleManager } from '@kit.AbilityKit'; 242import { BusinessError } from '@kit.BasicServicesKit'; 243import { hilog } from '@kit.PerformanceAnalysisKit'; 244 245let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION | bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_METADATA; 246 247try { 248 bundleManager.getBundleInfoForSelf(bundleFlags).then((data) => { 249 hilog.info(0x0000, 'testTag', 'getBundleInfoForSelf successfully. Data: %{public}s', JSON.stringify(data)); 250 }).catch((err: BusinessError) => { 251 hilog.error(0x0000, 'testTag', 'getBundleInfoForSelf failed. Cause: %{public}s', err.message); 252 }); 253} catch (err) { 254 let message = (err as BusinessError).message; 255 hilog.error(0x0000, 'testTag', 'getBundleInfoForSelf failed: %{public}s', message); 256} 257``` 258 259## bundleManager.getBundleInfoForSelf 260 261getBundleInfoForSelf(bundleFlags: number, callback: AsyncCallback\<BundleInfo>): void 262 263Obtains the bundle information based on the given bundle flags. This API uses an asynchronous callback to return the result. 264 265**Atomic service API**: This API can be used in atomic services since API version 11. 266 267**System capability**: SystemCapability.BundleManager.BundleFramework.Core 268 269**Parameters** 270 271| Name | Type | Mandatory| Description | 272| ----------- | ------ | ---- | --------------------- | 273| [bundleFlags](js-apis-bundleManager.md#bundleflag) | number | Yes | Type of the bundle information to obtain.| 274| callback | AsyncCallback\<[BundleInfo](js-apis-bundleManager-bundleInfo.md)> | Yes| Callback used to return the result. If the operation is successful, **err** is **null** and **data** is the bundle information obtained. Otherwise, **err** is an error object.| 275 276**Error codes** 277 278For details about the error codes, see [Universal Error Codes](../errorcode-universal.md). 279 280| ID| Error Message | 281| -------- | ------------------------------------------------------------ | 282| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.| 283 284**Example** 285 286```ts 287// Obtain ability info with permissions. 288import { bundleManager } from '@kit.AbilityKit'; 289import { BusinessError } from '@kit.BasicServicesKit'; 290import { hilog } from '@kit.PerformanceAnalysisKit'; 291 292let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_HAP_MODULE | bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_ABILITY | bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_REQUESTED_PERMISSION; 293 294try { 295 bundleManager.getBundleInfoForSelf(bundleFlags, (err, data) => { 296 if (err) { 297 hilog.error(0x0000, 'testTag', 'getBundleInfoForSelf failed: %{public}s', err.message); 298 } else { 299 hilog.info(0x0000, 'testTag', 'getBundleInfoForSelf successfully: %{public}s', JSON.stringify(data)); 300 } 301 }); 302} catch (err) { 303 let message = (err as BusinessError).message; 304 hilog.error(0x0000, 'testTag', 'getBundleInfoForSelf failed: %{public}s', message); 305} 306``` 307 308## bundleManager.getProfileByAbility 309 310getProfileByAbility(moduleName: string, abilityName: string, metadataName: string, callback: AsyncCallback\<Array\<string\>\>): void 311 312Obtains the JSON string array of the configuration file based on the given module name, ability name, and metadata name (name configured in [metadata](../../quick-start/module-configuration-file.md#metadata)). This API uses an asynchronous callback to return the result. 313 314> **NOTE** 315> 316> If the profile uses the resource reference format, the return value retains this format (for example, **$string:res_id**). You can obtain the referenced resources through related APIs of the resource management module. 317 318**Atomic service API**: This API can be used in atomic services since API version 11. 319 320**System capability**: SystemCapability.BundleManager.BundleFramework.Core 321 322**Parameters** 323 324| Name | Type | Mandatory| Description | 325| ------------ | ----------------------------- | ---- | ------------------------------------------------------------ | 326| moduleName | string | Yes | Module name. | 327| abilityName | string | Yes | Name of the UIAbility component. | 328| metadataName | string | Yes | Metadata name of the UIAbility component, that is, **name** of the **metadata** tag under **abilities** in the **module.json5** file. | 329| callback | AsyncCallback<Array\<string>> | Yes | Callback used to return the result. If the operation is successful, **err** is **null** and **data** is the array of JSON strings obtained. Otherwise, **err** is an error object.| 330 331**Error codes** 332 333For details about the error codes, see [Universal Error Codes](../errorcode-universal.md) and [Bundle Error Codes](errorcode-bundle.md). 334 335| ID| Error Message | 336| -------- | ------------------------------------------------------------ | 337| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.| 338| 17700002 | The specified moduleName is not existed. | 339| 17700003 | The specified abilityName is not existed. | 340| 17700024 | Failed to get the profile because there is no profile in the HAP. | 341| 17700026 | The specified bundle is disabled. | 342| 17700029 | The specified ability is disabled. | 343 344**Example** 345 346```ts 347import { bundleManager } from '@kit.AbilityKit'; 348import { BusinessError } from '@kit.BasicServicesKit'; 349import { hilog } from '@kit.PerformanceAnalysisKit'; 350 351let moduleName = 'entry'; 352let abilityName = 'EntryAbility'; 353let metadataName = 'ability_metadata'; 354 355try { 356 bundleManager.getProfileByAbility(moduleName, abilityName, metadataName, (err, data) => { 357 if (err) { 358 hilog.error(0x0000, 'testTag', 'getProfileByAbility failed. Cause: %{public}s', err.message); 359 } else { 360 hilog.info(0x0000, 'testTag', 'getProfileByAbility successfully: %{public}s', JSON.stringify(data)); 361 } 362 }); 363} catch (err) { 364 let message = (err as BusinessError).message; 365 hilog.error(0x0000, 'testTag', 'getProfileByAbility failed. Cause: %{public}s', message); 366} 367``` 368 369## bundleManager.getProfileByAbility 370 371getProfileByAbility(moduleName: string, abilityName: string, metadataName?: string): Promise\<Array\<string\>\> 372 373Obtains the JSON string array of the configuration file based on the given module name, ability name, and metadata name (name configured in [metadata](../../quick-start/module-configuration-file.md#metadata)). This API uses a promise to return the result. 374 375> **NOTE** 376> 377> If the profile uses the resource reference format, the return value retains this format (for example, **$string:res_id**). You can obtain the referenced resources through related APIs of the resource management module. 378 379**Atomic service API**: This API can be used in atomic services since API version 11. 380 381**System capability**: SystemCapability.BundleManager.BundleFramework.Core 382 383**Parameters** 384 385| Name | Type | Mandatory| Description | 386| ------------ | ------ | ---- | -------------------------- | 387| moduleName | string | Yes | Module name. | 388| abilityName | string | Yes | Name of the UIAbility component. | 389| metadataName | string | No | Metadata name of the UIAbility component, that is, **name** of the **metadata** tag under **abilities** in the **module.json5** file. The default value is null.| 390 391**Return value** 392 393| Type | Description | 394| ----------------------- | ------------------------------- | 395| Promise<Array\<string>> | Promise used to return the array of JSON strings obtained.| 396 397**Error codes** 398 399For details about the error codes, see [Universal Error Codes](../errorcode-universal.md) and [Bundle Error Codes](errorcode-bundle.md). 400 401| ID| Error Message | 402| -------- | ------------------------------------------------------------ | 403| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.| 404| 17700002 | The specified moduleName is not existed. | 405| 17700003 | The specified abilityName is not existed. | 406| 17700024 | Failed to get the profile because there is no profile in the HAP. | 407| 17700026 | The specified bundle is disabled. | 408| 17700029 | The specified ability is disabled. | 409 410**Example** 411 412```ts 413import { bundleManager } from '@kit.AbilityKit'; 414import { BusinessError } from '@kit.BasicServicesKit'; 415import { hilog } from '@kit.PerformanceAnalysisKit'; 416 417let moduleName = 'entry'; 418let abilityName = 'EntryAbility'; 419 420try { 421 // Obtain the JSON string array of the configuration file based on the module name and ability name. 422 bundleManager.getProfileByAbility(moduleName, abilityName).then((data) => { 423 hilog.info(0x0000, 'testTag', 'getProfileByAbility successfully. Data: %{public}s', JSON.stringify(data)); 424 }).catch((err: BusinessError) => { 425 hilog.error(0x0000, 'testTag', 'getProfileByAbility failed. Cause: %{public}s', err.message); 426 }); 427} catch (err) { 428 let message = (err as BusinessError).message; 429 hilog.error(0x0000, 'testTag', 'getProfileByAbility failed. Cause: %{public}s', message); 430} 431``` 432 433```ts 434import { bundleManager } from '@kit.AbilityKit'; 435import { BusinessError } from '@kit.BasicServicesKit'; 436import { hilog } from '@kit.PerformanceAnalysisKit'; 437 438let moduleName = 'entry'; 439let abilityName = 'EntryAbility'; 440let metadataName = 'ability_metadata'; 441 442try { 443 // Obtain the JSON string array of the configuration file based on the module name, ability name, and metadata name. 444 bundleManager.getProfileByAbility(moduleName, abilityName, metadataName).then((data) => { 445 hilog.info(0x0000, 'testTag', 'getProfileByAbility successfully. Data: %{public}s', JSON.stringify(data)); 446 }).catch((err: BusinessError) => { 447 hilog.error(0x0000, 'testTag', 'getProfileByAbility failed. Cause: %{public}s', err.message); 448 }); 449} catch (err) { 450 let message = (err as BusinessError).message; 451 hilog.error(0x0000, 'testTag', 'getProfileByAbility failed. Cause: %{public}s', message); 452} 453``` 454 455## bundleManager.getProfileByAbilitySync<sup>10+</sup> 456 457getProfileByAbilitySync(moduleName: string, abilityName: string, metadataName?: string): Array\<string\> 458 459Obtains the JSON string array of the current application's configuration file in the [metadata](../../quick-start/module-configuration-file.md#metadata) based on a given module name, ability name, and metadata name. This API returns the result synchronously. The result value is a string array. 460 461> **NOTE** 462> 463> If the profile uses the resource reference format, the return value retains this format (for example, **$string:res_id**). You can obtain the referenced resources through related APIs of the resource management module. 464 465**Atomic service API**: This API can be used in atomic services since API version 11. 466 467**System capability**: SystemCapability.BundleManager.BundleFramework.Core 468 469**Parameters** 470 471| Name | Type | Mandatory| Description | 472| ------------ | ------ | ---- | -------------------------- | 473| moduleName | string | Yes | Module name. | 474| abilityName | string | Yes | Name of the UIAbility component. | 475| metadataName | string | No | Metadata name of the UIAbility component, that is, **name** of the **metadata** tag under **abilities** in the **module.json5** file. The default value is null.| 476 477**Return value** 478 479| Type | Description | 480| ----------------------- | ------------------------------- | 481| Array\<string> | An array of JSON strings.| 482 483**Error codes** 484 485For details about the error codes, see [Universal Error Codes](../errorcode-universal.md) and [Bundle Error Codes](errorcode-bundle.md). 486 487| ID| Error Message | 488| -------- | ------------------------------------------------------------ | 489| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.| 490| 17700002 | The specified moduleName is not existed. | 491| 17700003 | The specified abilityName is not existed. | 492| 17700024 | Failed to get the profile because there is no profile in the HAP. | 493| 17700026 | The specified bundle is disabled. | 494| 17700029 | The specified ability is disabled. | 495 496**Example** 497 498```ts 499import { bundleManager } from '@kit.AbilityKit'; 500import { BusinessError } from '@kit.BasicServicesKit'; 501import { hilog } from '@kit.PerformanceAnalysisKit'; 502 503let moduleName = 'entry'; 504let abilityName = 'EntryAbility'; 505 506try { 507 // Obtain the JSON string array of the configuration file based on the module name and ability name. 508 let data = bundleManager.getProfileByAbilitySync(moduleName, abilityName); 509 hilog.info(0x0000, 'testTag', 'getProfileByAbilitySync successfully. Data: %{public}s', JSON.stringify(data)); 510} catch (err) { 511 let message = (err as BusinessError).message; 512 hilog.error(0x0000, 'testTag', 'getProfileByAbilitySync failed. Cause: %{public}s', message); 513} 514``` 515 516```ts 517import { bundleManager } from '@kit.AbilityKit'; 518import { BusinessError } from '@kit.BasicServicesKit'; 519import { hilog } from '@kit.PerformanceAnalysisKit'; 520 521let moduleName: string = 'entry'; 522let abilityName: string = 'EntryAbility'; 523let metadataName: string = 'ability_metadata'; 524 525try { 526 // Obtain the JSON string array of the configuration file based on the module name, ability name, and metadata name. 527 let data = bundleManager.getProfileByAbilitySync(moduleName, abilityName, metadataName); 528 hilog.info(0x0000, 'testTag', 'getProfileByAbilitySync successfully. Data: %{public}s', JSON.stringify(data)); 529} catch (err) { 530 let message = (err as BusinessError).message; 531 hilog.error(0x0000, 'testTag', 'getProfileByAbilitySync failed. Cause: %{public}s', message); 532} 533``` 534 535## bundleManager.getProfileByExtensionAbility 536 537getProfileByExtensionAbility(moduleName: string, extensionAbilityName: string, metadataName: string, callback: AsyncCallback\<Array\<string\>\>): void 538 539Obtains the JSON string array of the configuration file based on the given module name, ExtensionAbility name, and metadata name (name configured in [metadata](../../quick-start/module-configuration-file.md#metadata)). This API uses an asynchronous callback to return the result. 540 541> **NOTE** 542> 543> If the profile uses the resource reference format, the return value retains this format (for example, **$string:res_id**). You can obtain the referenced resources through related APIs of the resource management module. 544 545**Atomic service API**: This API can be used in atomic services since API version 11. 546 547**System capability**: SystemCapability.BundleManager.BundleFramework.Core 548 549**Parameters** 550 551| Name | Type | Mandatory| Description | 552| -------------------- | ----------------------------- | ---- | ------------------------------------------------------------ | 553| moduleName | string | Yes | Module name. | 554| extensionAbilityName | string | Yes | Name of the ExtensionAbility component. | 555| metadataName | string | Yes | Metadata name of the ExtensionAbility component, that is, **name** of the **metadata** tag under **extensionAbilities** in the **module.json5** file. | 556| callback | AsyncCallback<Array\<string>> | Yes | Callback used to return the result. If the operation is successful, **err** is **null** and **data** is the array of JSON strings obtained. Otherwise, **err** is an error object.| 557 558**Error codes** 559 560For details about the error codes, see [Universal Error Codes](../errorcode-universal.md) and [Bundle Error Codes](errorcode-bundle.md). 561 562| ID| Error Message | 563| -------- | ------------------------------------------------------------ | 564| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.| 565| 17700002 | The specified moduleName is not existed. | 566| 17700003 | The specified extensionAbilityName not existed. | 567| 17700024 | Failed to get the profile because there is no profile in the HAP. | 568| 17700026 | The specified bundle is disabled. | 569 570**Example** 571 572```ts 573import { bundleManager } from '@kit.AbilityKit'; 574import { BusinessError } from '@kit.BasicServicesKit'; 575import { hilog } from '@kit.PerformanceAnalysisKit'; 576 577let moduleName = 'entry'; 578let extensionAbilityName = 'com.example.myapplication.extension'; 579let metadataName = 'ability_metadata'; 580 581try { 582 bundleManager.getProfileByExtensionAbility(moduleName, extensionAbilityName, metadataName, (err, data) => { 583 if (err) { 584 hilog.error(0x0000, 'testTag', 'getProfileByExtensionAbility failed: %{public}s', err.message); 585 } else { 586 hilog.info(0x0000, 'testTag', 'getProfileByExtensionAbility successfully: %{public}s', JSON.stringify(data)); 587 } 588 }); 589} catch (err) { 590 let message = (err as BusinessError).message; 591 hilog.error(0x0000, 'testTag', 'getProfileByExtensionAbility failed: %{public}s', message); 592} 593``` 594 595## bundleManager.getProfileByExtensionAbility 596 597getProfileByExtensionAbility(moduleName: string, extensionAbilityName: string, metadataName?: string): Promise\<Array\<string\>\> 598 599Obtains the JSON string array of the current application's configuration file in the [metadata](../../quick-start/module-configuration-file.md#metadata) based on a given module name, ExtensionAbility name, and metadata name. This API uses a promise to return the result. 600 601> **NOTE** 602> 603> If the profile uses the resource reference format, the return value retains this format (for example, **$string:res_id**). You can obtain the referenced resources through related APIs of the resource management module. 604 605**Atomic service API**: This API can be used in atomic services since API version 11. 606 607**System capability**: SystemCapability.BundleManager.BundleFramework.Core 608 609**Parameters** 610 611| Name | Type | Mandatory| Description | 612| -------------------- | ------ | ---- | ---------------------------------- | 613| moduleName | string | Yes | Module name. | 614| extensionAbilityName | string | Yes | Name of the ExtensionAbility component.| 615| metadataName | string | No | Metadata name of the ExtensionAbility component, that is, **name** of the **metadata** tag under **extensionAbilities** in the **module.json5** file. The default value is null. | 616 617**Return value** 618 619| Type | Description | 620| ----------------------- | ----------------------------------- | 621| Promise<Array\<string>> | Promise used to return the array of JSON strings obtained.| 622 623**Error codes** 624 625For details about the error codes, see [Universal Error Codes](../errorcode-universal.md) and [Bundle Error Codes](errorcode-bundle.md). 626 627| ID| Error Message | 628| -------- | ------------------------------------------------------------ | 629| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.| 630| 17700002 | The specified moduleName is not existed. | 631| 17700003 | The specified extensionAbilityName not existed. | 632| 17700024 | Failed to get the profile because there is no profile in the HAP. | 633| 17700026 | The specified bundle is disabled. | 634 635**Example** 636 637```ts 638import { bundleManager } from '@kit.AbilityKit'; 639import { BusinessError } from '@kit.BasicServicesKit'; 640import { hilog } from '@kit.PerformanceAnalysisKit'; 641 642let moduleName = 'entry'; 643let extensionAbilityName = 'com.example.myapplication.extension'; 644let metadataName = 'ability_metadata'; 645 646try { 647 bundleManager.getProfileByExtensionAbility(moduleName, extensionAbilityName).then((data) => { 648 hilog.info(0x0000, 'testTag', 'getProfileByExtensionAbility successfully. Data: %{public}s', JSON.stringify(data)); 649 }).catch((err: BusinessError) => { 650 hilog.error(0x0000, 'testTag', 'getProfileByExtensionAbility failed. Cause: %{public}s', err.message); 651 }); 652} catch (err) { 653 let message = (err as BusinessError).message; 654 hilog.error(0x0000, 'testTag', 'getProfileByExtensionAbility failed. Cause: %{public}s', message); 655} 656 657try { 658 bundleManager.getProfileByExtensionAbility(moduleName, extensionAbilityName, metadataName).then((data) => { 659 hilog.info(0x0000, 'testTag', 'getProfileByExtensionAbility successfully. Data: %{public}s', JSON.stringify(data)); 660 }).catch((err: BusinessError) => { 661 hilog.error(0x0000, 'testTag', 'getProfileByExtensionAbility failed. Cause: %{public}s', err.message); 662 }); 663} catch (err) { 664 let message = (err as BusinessError).message; 665 hilog.error(0x0000, 'testTag', 'getProfileByExtensionAbility failed. Cause: %{public}s', message); 666} 667``` 668 669## bundleManager.getProfileByExtensionAbilitySync<sup>10+</sup> 670 671getProfileByExtensionAbilitySync(moduleName: string, extensionAbilityName: string, metadataName?: string): Array\<string\> 672 673Obtains the JSON string array of the current application's configuration file in the [metadata](../../quick-start/module-configuration-file.md#metadata) based on a given module name, ExtensionAbility name, and metadata name. This API returns the result synchronously. The result value is a string array. 674 675> **NOTE** 676> 677> If the profile uses the resource reference format, the return value retains this format (for example, **$string:res_id**). You can obtain the referenced resources through related APIs of the resource management module. 678 679**Atomic service API**: This API can be used in atomic services since API version 11. 680 681**System capability**: SystemCapability.BundleManager.BundleFramework.Core 682 683**Parameters** 684 685| Name | Type | Mandatory| Description | 686| -------------------- | ------ | ---- | ---------------------------------- | 687| moduleName | string | Yes | Module name. | 688| extensionAbilityName | string | Yes | Name of the ExtensionAbility component.| 689| metadataName | string | No | Metadata name of the ExtensionAbility component, that is, **name** of the **metadata** tag under **extensionAbilities** in the **module.json5** file. The default value is null. | 690 691**Return value** 692 693| Type | Description | 694| ----------------------- | ----------------------------------- | 695| Array\<string> | An array of JSON strings.| 696 697**Error codes** 698 699For details about the error codes, see [Universal Error Codes](../errorcode-universal.md) and [Bundle Error Codes](errorcode-bundle.md). 700 701| ID| Error Message | 702| -------- | ------------------------------------------------------------ | 703| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.| 704| 17700002 | The specified moduleName is not existed. | 705| 17700003 | The specified extensionAbilityName not existed. | 706| 17700024 | Failed to get the profile because there is no profile in the HAP. | 707| 17700026 | The specified bundle is disabled. | 708 709**Example** 710 711```ts 712import { bundleManager } from '@kit.AbilityKit'; 713import { BusinessError } from '@kit.BasicServicesKit'; 714import { hilog } from '@kit.PerformanceAnalysisKit'; 715 716let moduleName = 'entry'; 717let extensionAbilityName = 'com.example.myapplication.extension'; 718let metadataName = 'ability_metadata'; 719 720try { 721 let data = bundleManager.getProfileByExtensionAbilitySync(moduleName, extensionAbilityName); 722 hilog.info(0x0000, 'testTag', 'getProfileByExtensionAbilitySync successfully. Data: %{public}s', JSON.stringify(data)); 723} catch (err) { 724 let message = (err as BusinessError).message; 725 hilog.error(0x0000, 'testTag', 'getProfileByExtensionAbilitySync failed. Cause: %{public}s', message); 726} 727 728try { 729 let data = bundleManager.getProfileByExtensionAbilitySync(moduleName, extensionAbilityName, metadataName); 730 hilog.info(0x0000, 'testTag', 'getProfileByExtensionAbilitySync successfully. Data: %{public}s', JSON.stringify(data)); 731} catch (err) { 732 let message = (err as BusinessError).message; 733 hilog.error(0x0000, 'testTag', 'getProfileByExtensionAbilitySync failed. Cause: %{public}s', message); 734} 735``` 736 737## bundleManager.getBundleInfoForSelfSync<sup>10+</sup> 738 739getBundleInfoForSelfSync(bundleFlags: number): BundleInfo 740 741Obtains the bundle information of this bundle based on the given bundle flags. This API returns the result synchronously. 742 743**Atomic service API**: This API can be used in atomic services since API version 11. 744 745**System capability**: SystemCapability.BundleManager.BundleFramework.Core 746 747**Parameters** 748 749| Name | Type | Mandatory| Description | 750| ----------- | ------ | ---- | --------------------- | 751| [bundleFlags](js-apis-bundleManager.md#bundleflag) | number | Yes | Type of the bundle information to obtain.| 752 753**Return value** 754 755| Type | Description | 756| ------------------------------------------------- | -------------------- | 757| [BundleInfo](js-apis-bundleManager-bundleInfo.md) | Bundle information obtained.| 758 759**Error codes** 760 761For details about the error codes, see [Universal Error Codes](../errorcode-universal.md). 762 763| ID| Error Message | 764| -------- | ------------------------------------------------------------ | 765| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.| 766 767**Example** 768 769```ts 770import { bundleManager } from '@kit.AbilityKit'; 771import { BusinessError } from '@kit.BasicServicesKit'; 772import { hilog } from '@kit.PerformanceAnalysisKit'; 773 774let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_REQUESTED_PERMISSION; 775 776try { 777 let data = bundleManager.getBundleInfoForSelfSync(bundleFlags); 778 hilog.info(0x0000, 'testTag', 'getBundleInfoForSelfSync successfully: %{public}s', JSON.stringify(data)); 779} catch (err) { 780 let message = (err as BusinessError).message; 781 hilog.error(0x0000, 'testTag', 'getBundleInfoForSelfSync failed: %{public}s', message); 782} 783``` 784 785## bundleManager.canOpenLink<sup>12+</sup> 786 787canOpenLink(link: string): boolean 788 789Checks whether a link can be opened. The scheme of the specified link must be configured in the **querySchemes** field of the **module.json** file. 790 791**Atomic service API**: This API can be used in atomic services since API version 12. 792 793**System capability**: SystemCapability.BundleManager.BundleFramework.Core 794 795**Parameters** 796 797| Name | Type | Mandatory| Description | 798| ----------- | ------ | ---- | --------------------- | 799| link | string | Yes | Link to check.| 800 801**Return value** 802 803| Type | Description | 804| ------------------------------------------------- | -------------------- | 805| boolean | **true**: The link can be opened.<br>**false**: The link cannot be opened.| 806 807**Error codes** 808 809For details about the error codes, see [Universal Error Codes](../errorcode-universal.md) and [Bundle Error Codes](errorcode-bundle.md). 810 811| ID| Error Message | 812| -------- | ------------------------------------------------------------ | 813| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.| 814| 17700055 | The specified link is invalid. | 815| 17700056 | The scheme of the specified link is not in the querySchemes. | 816 817**Example** 818 819```ts 820import { bundleManager } from '@kit.AbilityKit'; 821import { BusinessError } from '@kit.BasicServicesKit'; 822import { hilog } from '@kit.PerformanceAnalysisKit'; 823 824try { 825 let link = 'welink://'; 826 let data = bundleManager.canOpenLink(link); 827 hilog.info(0x0000, 'testTag', 'canOpenLink successfully: %{public}s', JSON.stringify(data)); 828} catch (err) { 829 let message = (err as BusinessError).message; 830 hilog.error(0x0000, 'testTag', 'canOpenLink failed: %{public}s', message); 831} 832``` 833 834## bundleManager.getLaunchWant<sup>13+</sup> 835 836getLaunchWant(): Want 837 838Obtains the **Want** parameter used to start the application. 839 840**Atomic service API**: This API can be used in atomic services since API version 13. 841 842**System capability**: SystemCapability.BundleManager.BundleFramework.Core 843 844**Return value** 845 846| Type | Description | 847| ----------------------------------- | ------------------------------------------- | 848| [Want](js-apis-app-ability-want.md) | Want object that contains the bundle name and ability name.| 849 850**Error codes** 851 852For details about the error codes, see [Bundle Error Codes](errorcode-bundle.md). 853 854| ID| Error Message | 855| -------- | ----------------------------- | 856| 17700072 | The launch want is not found. | 857 858**Example** 859 860```ts 861import { BusinessError } from '@kit.BasicServicesKit'; 862import { bundleManager } from '@kit.AbilityKit'; 863import { hilog } from '@kit.PerformanceAnalysisKit'; 864 865try { 866 let want = bundleManager.getLaunchWant(); 867 hilog.info(0x0000, 'testTag', 'getLaunchWant ability name: %{public}s', want.abilityName); 868 hilog.info(0x0000, 'testTag', 'getLaunchWant bundle name: %{public}s', want.bundleName); 869} catch (error) { 870 let message = (error as BusinessError).message; 871 hilog.error(0x0000, 'testTag', 'getLaunchWant failed: %{public}s', message); 872} 873``` 874 875## bundleManager.getBundleInfo<sup>14+</sup> 876 877getBundleInfo(bundleName: string, bundleFlags: number, userId: number, callback: AsyncCallback\<BundleInfo>): void 878 879Obtains the bundle information based on the given bundle name, bundle flags, and user ID. This API uses an asynchronous callback to return the result. 880 881No permission is required for obtaining the caller's own information. 882 883**Required permissions**: ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 884 885**System capability**: SystemCapability.BundleManager.BundleFramework.Core 886 887**Parameters** 888 889| Name | Type | Mandatory| Description | 890| ----------- | ------ | ---- | ---------------------------- | 891| bundleName | string | Yes | Bundle name.| 892| [bundleFlags](js-apis-bundleManager.md#bundleflag) | number | Yes | Type of the bundle information to obtain.| 893| userId | number | Yes | User ID. | 894| callback | AsyncCallback\<[BundleInfo](js-apis-bundleManager-bundleInfo.md)> | Yes| Callback used to return the result. If the operation is successful, **err** is **null** and **data** is the bundle information obtained. Otherwise, **err** is an error object.| 895 896**Error codes** 897 898For details about the error codes, see [Universal Error Codes](../errorcode-universal.md) and [Bundle Error Codes](errorcode-bundle.md). 899 900| ID| Error Message | 901| -------- | ------------------------------------- | 902| 201 | Permission denied. | 903| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.| 904| 17700001 | The specified bundleName is not found. | 905| 17700004 | The specified user ID is not found. | 906| 17700026 | The specified bundle is disabled. | 907 908**Example** 909 910```ts 911// Obtain the bundle information with the ability information. 912import { bundleManager } from '@kit.AbilityKit'; 913import { BusinessError } from '@kit.BasicServicesKit'; 914import { hilog } from '@kit.PerformanceAnalysisKit'; 915let bundleName = 'com.example.myapplication'; 916let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_HAP_MODULE | bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_ABILITY; 917let userId = 100; 918 919try { 920 bundleManager.getBundleInfo(bundleName, bundleFlags, userId, (err, data) => { 921 if (err) { 922 hilog.error(0x0000, 'testTag', 'getBundleInfo failed: %{public}s', err.message); 923 } else { 924 hilog.info(0x0000, 'testTag', 'getBundleInfo successfully: %{public}s', JSON.stringify(data)); 925 } 926 }); 927} catch (err) { 928 let message = (err as BusinessError).message; 929 hilog.error(0x0000, 'testTag', 'getBundleInfo failed: %{public}s', message); 930} 931``` 932 933```ts 934// Obtain the bundle information with the metadata in the application information. 935import { bundleManager } from '@kit.AbilityKit'; 936import { BusinessError } from '@kit.BasicServicesKit'; 937import { hilog } from '@kit.PerformanceAnalysisKit'; 938let bundleName = 'com.example.myapplication'; 939let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION | bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_METADATA; 940let userId = 100; 941 942try { 943 bundleManager.getBundleInfo(bundleName, bundleFlags, userId, (err, data) => { 944 if (err) { 945 hilog.error(0x0000, 'testTag', 'getBundleInfo failed: %{public}s', err.message); 946 } else { 947 hilog.info(0x0000, 'testTag', 'getBundleInfo successfully: %{public}s', JSON.stringify(data)); 948 } 949 }); 950} catch (err) { 951 let message = (err as BusinessError).message; 952 hilog.error(0x0000, 'testTag', 'getBundleInfo failed: %{public}s', message); 953} 954``` 955 956## bundleManager.getBundleInfo<sup>14+</sup> 957 958getBundleInfo(bundleName: string, bundleFlags: number, callback: AsyncCallback\<BundleInfo>): void 959 960Obtains the bundle information based on the given bundle name and bundle flags. This API uses an asynchronous callback to return the result. 961 962No permission is required for obtaining the caller's own information. 963 964**Required permissions**: ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 965 966**System capability**: SystemCapability.BundleManager.BundleFramework.Core 967 968**Parameters** 969 970| Name | Type | Mandatory| Description | 971| ----------- | ------ | ---- | ---------------------------- | 972| bundleName | string | Yes | Bundle name.| 973| [bundleFlags](js-apis-bundleManager.md#bundleflag) | number | Yes | Type of the bundle information to obtain.| 974| callback | AsyncCallback\<[BundleInfo](js-apis-bundleManager-bundleInfo.md)> | Yes| Callback used to return the result. If the operation is successful, **err** is **null** and **data** is the bundle information obtained. Otherwise, **err** is an error object.| 975 976**Error codes** 977 978For details about the error codes, see [Universal Error Codes](../errorcode-universal.md) and [Bundle Error Codes](errorcode-bundle.md). 979 980| ID| Error Message | 981| -------- | ------------------------------------- | 982| 201 | Permission denied. | 983| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.| 984| 17700001 | The specified bundleName is not found. | 985| 17700026 | The specified bundle is disabled. | 986 987**Example** 988 989```ts 990// Obtain the bundle information with the ExtensionAbility information. 991import { bundleManager } from '@kit.AbilityKit'; 992import { BusinessError } from '@kit.BasicServicesKit'; 993import { hilog } from '@kit.PerformanceAnalysisKit'; 994let bundleName = 'com.example.myapplication'; 995let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_HAP_MODULE | bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_EXTENSION_ABILITY; 996 997try { 998 bundleManager.getBundleInfo(bundleName, bundleFlags, (err, data) => { 999 if (err) { 1000 hilog.error(0x0000, 'testTag', 'getBundleInfo failed: %{public}s', err.message); 1001 } else { 1002 hilog.info(0x0000, 'testTag', 'getBundleInfo successfully: %{public}s', JSON.stringify(data)); 1003 } 1004 }); 1005} catch (err) { 1006 let message = (err as BusinessError).message; 1007 hilog.error(0x0000, 'testTag', 'getBundleInfo failed: %{public}s', message); 1008} 1009``` 1010 1011## bundleManager.getBundleInfo<sup>14+</sup> 1012 1013getBundleInfo(bundleName: string, bundleFlags: number, userId?: number): Promise\<BundleInfo> 1014 1015Obtains the bundle information based on the given bundle name, bundle flags, and user ID. This API uses a promise to return the result. 1016 1017No permission is required for obtaining the caller's own information. 1018 1019**Required permissions**: ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 1020 1021**System capability**: SystemCapability.BundleManager.BundleFramework.Core 1022 1023**Parameters** 1024 1025| Name | Type | Mandatory| Description | 1026| ----------- | ------ | ---- | ---------------------------- | 1027| bundleName | string | Yes | Bundle name.| 1028| [bundleFlags](js-apis-bundleManager.md#bundleflag) | number | Yes | Type of the bundle information to obtain. | 1029| userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. | 1030 1031**Return value** 1032 1033| Type | Description | 1034| ----------------------------------------------------------- | --------------------------- | 1035| Promise\<[BundleInfo](js-apis-bundleManager-bundleInfo.md)> | Promise used to return the bundle information obtained.| 1036 1037**Error codes** 1038 1039For details about the error codes, see [Universal Error Codes](../errorcode-universal.md) and [Bundle Error Codes](errorcode-bundle.md). 1040 1041| ID| Error Message | 1042| -------- | --------------------------------------| 1043| 201 | Permission denied. | 1044| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.| 1045| 17700001 | The specified bundleName is not found. | 1046| 17700004 | The specified user ID is not found. | 1047| 17700026 | The specified bundle is disabled. | 1048 1049**Example** 1050 1051```ts 1052// Obtain the bundle information with the application and signature information. 1053import { bundleManager } from '@kit.AbilityKit'; 1054import { BusinessError } from '@kit.BasicServicesKit'; 1055import { hilog } from '@kit.PerformanceAnalysisKit'; 1056let bundleName = 'com.example.myapplication'; 1057let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION | bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_SIGNATURE_INFO; 1058let userId = 100; 1059 1060try { 1061 bundleManager.getBundleInfo(bundleName, bundleFlags, userId).then((data) => { 1062 hilog.info(0x0000, 'testTag', 'getBundleInfo successfully. Data: %{public}s', JSON.stringify(data)); 1063 }).catch((err: BusinessError) => { 1064 hilog.error(0x0000, 'testTag', 'getBundleInfo failed. Cause: %{public}s', err.message); 1065 }); 1066} catch (err) { 1067 let message = (err as BusinessError).message; 1068 hilog.error(0x0000, 'testTag', 'getBundleInfo failed. Cause: %{public}s', message); 1069} 1070``` 1071 1072```ts 1073import { bundleManager } from '@kit.AbilityKit'; 1074import { BusinessError } from '@kit.BasicServicesKit'; 1075import { hilog } from '@kit.PerformanceAnalysisKit'; 1076let bundleName = 'com.example.myapplication'; 1077let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_DEFAULT; 1078 1079try { 1080 bundleManager.getBundleInfo(bundleName, bundleFlags).then((data) => { 1081 hilog.info(0x0000, 'testTag', 'getBundleInfo successfully. Data: %{public}s', JSON.stringify(data)); 1082 }).catch((err: BusinessError) => { 1083 hilog.error(0x0000, 'testTag', 'getBundleInfo failed. Cause: %{public}s', err.message); 1084 }); 1085} catch (err) { 1086 let message = (err as BusinessError).message; 1087 hilog.error(0x0000, 'testTag', 'getBundleInfo failed. Cause: %{public}s', message); 1088} 1089 1090``` 1091 1092## bundleManager.getBundleInfoSync<sup>14+</sup> 1093 1094getBundleInfoSync(bundleName: string, bundleFlags: number, userId: number): BundleInfo 1095 1096Obtains the bundle information based on the given bundle name, bundle flags, and user ID. This API returns the result synchronously. 1097 1098No permission is required for obtaining the caller's own information. 1099 1100**Required permissions**: ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 1101 1102**System capability**: SystemCapability.BundleManager.BundleFramework.Core 1103 1104**Parameters** 1105 1106| Name | Type | Mandatory| Description | 1107| ----------- | ------ | ---- | -------------------------------------------------------- | 1108| bundleName | string | Yes | Bundle name. | 1109| [bundleFlags](js-apis-bundleManager.md#bundleflag) | number | Yes | Type of the bundle information to obtain.| 1110| userId | number | Yes | User ID. | 1111 1112**Return value** 1113 1114| Type | Description | 1115| ---------- | -------------------- | 1116| [BundleInfo](js-apis-bundleManager-bundleInfo.md) | Bundle information obtained.| 1117 1118**Error codes** 1119 1120For details about the error codes, see [Universal Error Codes](../errorcode-universal.md) and [Bundle Error Codes](errorcode-bundle.md). 1121 1122| ID| Error Message | 1123| -------- | ------------------------------------- | 1124| 201 | Permission denied. | 1125| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.| 1126| 17700001 | The specified bundleName is not found. | 1127| 17700004 | The specified user ID is not found. | 1128| 17700026 | The specified bundle is disabled. | 1129 1130**Example** 1131 1132```ts 1133import { bundleManager } from '@kit.AbilityKit'; 1134import { BusinessError } from '@kit.BasicServicesKit'; 1135import { hilog } from '@kit.PerformanceAnalysisKit'; 1136let bundleName = 'com.example.myapplication'; 1137let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_REQUESTED_PERMISSION; 1138let userId = 100; 1139 1140try { 1141 let data = bundleManager.getBundleInfoSync(bundleName, bundleFlags, userId); 1142 hilog.info(0x0000, 'testTag', 'getBundleInfoSync successfully: %{public}s', JSON.stringify(data)); 1143} catch (err) { 1144 let message = (err as BusinessError).message; 1145 hilog.error(0x0000, 'testTag', 'getBundleInfoSync failed: %{public}s', message); 1146} 1147``` 1148 1149## bundleManager.getBundleInfoSync<sup>14+</sup> 1150 1151getBundleInfoSync(bundleName: string, bundleFlags: number): BundleInfo 1152 1153Obtains the bundle information based on the given bundle name and bundle flags. This API returns the result synchronously. 1154 1155No permission is required for obtaining the caller's own information. 1156 1157**Required permissions**: ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 1158 1159**System capability**: SystemCapability.BundleManager.BundleFramework.Core 1160 1161**Parameters** 1162 1163| Name | Type | Mandatory| Description | 1164| ----------- | --------------------- | ---- | ------------------------------------------------------ | 1165| bundleName | string | Yes | Bundle name. | 1166| [bundleFlags](js-apis-bundleManager.md#bundleflag) | number | Yes | Type of the bundle information to obtain.| 1167 1168**Return value** 1169 1170| Type | Description | 1171| ------------------------------------------------- | -------------------- | 1172| [BundleInfo](js-apis-bundleManager-bundleInfo.md) | Bundle information obtained.| 1173 1174**Error codes** 1175 1176For details about the error codes, see [Universal Error Codes](../errorcode-universal.md) and [Bundle Error Codes](errorcode-bundle.md). 1177 1178| ID| Error Message | 1179| -------- | -------------------------------------- | 1180| 201 | Permission denied. | 1181| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.| 1182| 17700001 | The specified bundleName is not found. | 1183| 17700026 | The specified bundle is disabled. | 1184 1185**Example** 1186 1187```ts 1188import { bundleManager } from '@kit.AbilityKit'; 1189import { BusinessError } from '@kit.BasicServicesKit'; 1190import { hilog } from '@kit.PerformanceAnalysisKit'; 1191let bundleName = 'com.example.myapplication'; 1192let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_REQUESTED_PERMISSION; 1193try { 1194 let data = bundleManager.getBundleInfoSync(bundleName, bundleFlags); 1195 hilog.info(0x0000, 'testTag', 'getBundleInfoSync successfully: %{public}s', JSON.stringify(data)); 1196} catch (err) { 1197 let message = (err as BusinessError).message; 1198 hilog.error(0x0000, 'testTag', 'getBundleInfoSync failed: %{public}s', message); 1199} 1200``` 1201 1202## bundleManager.getBundleNameByUid<sup>14+</sup> 1203 1204getBundleNameByUid(uid: number, callback: AsyncCallback\<string>): void 1205 1206Obtains the bundle name based on the given UID. This API uses an asynchronous callback to return the result. 1207 1208**Required permissions**: ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 1209 1210**System capability**: SystemCapability.BundleManager.BundleFramework.Core 1211 1212**Parameters** 1213 1214| Name | Type | Mandatory| Description | 1215| -------- | ---------------------- | ---- | ------------------------------------------------------------ | 1216| uid | number | Yes | UID of the application. | 1217| callback | AsyncCallback\<string> | Yes | Callback used to return the result. If the operation is successful, **err** is **null** and **data** is the bundle name obtained. Otherwise, **err** is an error object.| 1218 1219**Error codes** 1220 1221For details about the error codes, see [Universal Error Codes](../errorcode-universal.md) and [Bundle Error Codes](errorcode-bundle.md). 1222 1223| ID| Error Message | 1224| -------- | --------------------- | 1225| 201 | Permission denied. | 1226| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.| 1227| 17700021 | The uid is not found. | 1228 1229**Example** 1230 1231```ts 1232import { bundleManager } from '@kit.AbilityKit'; 1233import { BusinessError } from '@kit.BasicServicesKit'; 1234import { hilog } from '@kit.PerformanceAnalysisKit'; 1235let uid = 20010005; 1236try { 1237 bundleManager.getBundleNameByUid(uid, (err, data) => { 1238 if (err) { 1239 hilog.error(0x0000, 'testTag', 'getBundleNameByUid failed: %{public}s', err.message); 1240 } else { 1241 hilog.info(0x0000, 'testTag', 'getBundleNameByUid successfully: %{public}s', JSON.stringify(data)); 1242 } 1243 }); 1244} catch (err) { 1245 let message = (err as BusinessError).message; 1246 hilog.error(0x0000, 'testTag', 'getBundleNameByUid failed: %{public}s', message); 1247} 1248``` 1249 1250## bundleManager.getBundleNameByUid<sup>14+</sup> 1251 1252getBundleNameByUid(uid: number): Promise\<string> 1253 1254Obtains the bundle name based on the given UID. This API uses a promise to return the result. 1255 1256**Required permissions**: ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 1257 1258**System capability**: SystemCapability.BundleManager.BundleFramework.Core 1259 1260**Parameters** 1261 1262| Name| Type | Mandatory| Description | 1263| ---- | ------ | ---- | ------------------ | 1264| uid | number | Yes | UID of the application.| 1265 1266**Return value** 1267 1268| Type | Description | 1269| ---------------- | --------------------------- | 1270| Promise\<string> | Promise used to return the bundle name obtained.| 1271 1272**Error codes** 1273 1274For details about the error codes, see [Universal Error Codes](../errorcode-universal.md) and [Bundle Error Codes](errorcode-bundle.md). 1275 1276| ID| Error Message | 1277| -------- | ---------------------| 1278| 201 | Permission denied. | 1279| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.| 1280| 17700021 | The uid is not found. | 1281 1282**Example** 1283 1284```ts 1285import { bundleManager } from '@kit.AbilityKit'; 1286import { BusinessError } from '@kit.BasicServicesKit'; 1287import { hilog } from '@kit.PerformanceAnalysisKit'; 1288let uid = 20010005; 1289try { 1290 bundleManager.getBundleNameByUid(uid).then((data) => { 1291 hilog.info(0x0000, 'testTag', 'getBundleNameByUid successfully. Data: %{public}s', JSON.stringify(data)); 1292 }).catch((err: BusinessError) => { 1293 hilog.error(0x0000, 'testTag', 'getBundleNameByUid failed. Cause: %{public}s', err.message); 1294 }); 1295} catch (err) { 1296 let message = (err as BusinessError).message; 1297 hilog.error(0x0000, 'testTag', 'getBundleNameByUid failed. Cause: %{public}s', message); 1298} 1299``` 1300 1301## bundleManager.getBundleNameByUidSync<sup>14+</sup> 1302 1303getBundleNameByUidSync(uid: number): string 1304 1305Obtains the bundle name based on the given UID. This API returns the result synchronously. 1306 1307**Required permissions**: ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 1308 1309**System capability**: SystemCapability.BundleManager.BundleFramework.Core 1310 1311**Parameters** 1312 1313| Name| Type | Mandatory| Description | 1314| ---- | ------ | ---- | ------------------ | 1315| uid | number | Yes | UID of the application.| 1316 1317**Return value** 1318 1319| Type | Description | 1320| ---------------- | --------------------------- | 1321| string | Bundle name obtained.| 1322 1323**Error codes** 1324 1325For details about the error codes, see [Universal Error Codes](../errorcode-universal.md) and [Bundle Error Codes](errorcode-bundle.md). 1326 1327| ID| Error Message | 1328| -------- | ---------------------| 1329| 201 | Permission denied. | 1330| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.| 1331| 17700021 | The uid is not found. | 1332 1333**Example** 1334 1335```ts 1336import { bundleManager } from '@kit.AbilityKit'; 1337import { BusinessError } from '@kit.BasicServicesKit'; 1338import { hilog } from '@kit.PerformanceAnalysisKit'; 1339let uid = 20010005; 1340try { 1341 let data = bundleManager.getBundleNameByUidSync(uid); 1342 hilog.info(0x0000, 'testTag', 'getBundleNameByUidSync successfully. Data: %{public}s', JSON.stringify(data)); 1343} catch (err) { 1344 let message = (err as BusinessError).message; 1345 hilog.error(0x0000, 'testTag', 'getBundleNameByUidSync failed. Cause: %{public}s', message); 1346} 1347``` 1348 1349## bundleManager.getAppCloneIdentity<sup>14+</sup> 1350 1351getAppCloneIdentity(uid: number): Promise\<AppCloneIdentity>; 1352 1353Obtains the bundle name and app index of an application clone based on the given UID. This API uses a promise to return the result. 1354 1355**Required permissions**: ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 1356 1357**System capability**: SystemCapability.BundleManager.BundleFramework.Core 1358 1359**Parameters** 1360 1361| Name | Type | Mandatory| Description | 1362| ---------- | ------ | ---- | ---------------------------| 1363| uid | number | Yes | UID of the application. | 1364 1365**Return value** 1366 1367| Type | Description | 1368| ----------------------------------------------------------- | --------------------------- | 1369| Promise\<[AppCloneIdentity](js-apis-bundleManager-bundleInfo.md#appcloneidentity14)> | Promise used to return \<AppCloneIdentity>.| 1370 1371**Error codes** 1372 1373For details about the error codes, see [Universal Error Codes](../errorcode-universal.md) and [Bundle Error Codes](errorcode-bundle.md). 1374 1375| ID| Error Message | 1376| -------- | --------------------------------------| 1377| 201 | Permission denied. | 1378| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.| 1379| 17700021 | The uid is not found. | 1380 1381**Example** 1382 1383```ts 1384import { bundleManager } from '@kit.AbilityKit'; 1385import { BusinessError } from '@kit.BasicServicesKit'; 1386import { hilog } from '@kit.PerformanceAnalysisKit'; 1387let uid = 20010005; 1388 1389try { 1390 bundleManager.getAppCloneIdentity(uid).then((res) => { 1391 hilog.info(0x0000, 'testTag', 'getAppCloneIdentity res = %{public}s', JSON.stringify(res)); 1392 }).catch((err: BusinessError) => { 1393 hilog.error(0x0000, 'testTag', 'getAppCloneIdentity failed. Cause: %{public}s', err.message); 1394 }); 1395} catch (err) { 1396 let message = (err as BusinessError).message; 1397 hilog.error(0x0000, 'testTag', 'getAppCloneIdentity failed. Cause: %{public}s', message); 1398} 1399``` 1400 1401## bundleManager.getSignatureInfo<sup>18+</sup> 1402 1403getSignatureInfo(uid: number): SignatureInfo 1404 1405Obtains the [SignatureInfo](./js-apis-bundleManager-bundleInfo.md#signatureinfo) based on the given UID. 1406 1407**Required permissions**: ohos.permission.GET_SIGNATURE_INFO 1408 1409**System capability**: SystemCapability.BundleManager.BundleFramework.Core 1410 1411**Parameters** 1412 1413| Name| Type | Mandatory| Description | 1414| ---- | ------ | ---- | ------------------ | 1415| uid | number | Yes | UID of the application.| 1416 1417**Return value** 1418 1419| Type | Description | 1420| ---------------- | --------------------------- | 1421| [SignatureInfo](./js-apis-bundleManager-bundleInfo.md#signatureinfo) | **SignatureInfo** object.| 1422 1423**Error codes** 1424 1425For details about the error codes, see [Universal Error Codes](../errorcode-universal.md) and [Bundle Error Codes](errorcode-bundle.md). 1426 1427| ID| Error Message | 1428| -------- | ---------------------| 1429| 201 | Permission denied. | 1430| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.| 1431| 17700021 | The uid is not found. | 1432 1433**Example** 1434 1435```ts 1436import { bundleManager } from '@kit.AbilityKit'; 1437import { BusinessError } from '@kit.BasicServicesKit'; 1438import { hilog } from '@kit.PerformanceAnalysisKit'; 1439let uid = 20010005; // Replace uid with the UID of the corresponding application. 1440try { 1441 let data = bundleManager.getSignatureInfo(uid); 1442 hilog.info(0x0000, 'testTag', 'getSignatureInfo successfully. Data: %{public}s', JSON.stringify(data)); 1443} catch (err) { 1444 let message = (err as BusinessError).message; 1445 hilog.error(0x0000, 'testTag', 'getSignatureInfo failed. Cause: %{public}s', message); 1446} 1447``` 1448 1449## ApplicationInfo 1450 1451type ApplicationInfo = _ApplicationInfo 1452 1453Defines the application information. 1454 1455**Atomic service API**: This API can be used in atomic services since API version 11. 1456 1457**System capability**: SystemCapability.BundleManager.BundleFramework.Core 1458 1459| Type | Description | 1460| ------------------------------------------------------------ | -------------- | 1461| [_ApplicationInfo](js-apis-bundleManager-applicationInfo.md#applicationinfo-1) | Application information.| 1462 1463## ModuleMetadata<sup>10+</sup> 1464 1465type ModuleMetadata = _ModuleMetadata 1466 1467Defines the metadata of a module. 1468 1469**Atomic service API**: This API can be used in atomic services since API version 11. 1470 1471**System capability**: SystemCapability.BundleManager.BundleFramework.Core 1472 1473| Type | Description | 1474| ------------------------------------------------------------ | -------------- | 1475| [_ModuleMetadata](js-apis-bundleManager-applicationInfo.md#ModuleMetadata10) | Metadata of the module.| 1476 1477## Metadata 1478 1479type Metadata = _Metadata 1480 1481Defines the metadata. 1482 1483**Atomic service API**: This API can be used in atomic services since API version 11. 1484 1485**System capability**: SystemCapability.BundleManager.BundleFramework.Core 1486 1487| Type | Description | 1488| ------------------------------------------------------------ | -------------- | 1489| [_Metadata](js-apis-bundleManager-metadata.md#metadata) | Metadata.| 1490 1491## BundleInfo 1492 1493type BundleInfo = _BundleInfo.BundleInfo 1494 1495Defines the bundle information. 1496 1497**Atomic service API**: This API can be used in atomic services since API version 11. 1498 1499**System capability**: SystemCapability.BundleManager.BundleFramework.Core 1500 1501| Type | Description | 1502| ------------------------------------------------------------ | -------------- | 1503| [_BundleInfo.BundleInfo](js-apis-bundleManager-bundleInfo.md#bundleinfo) | Bundle information.| 1504 1505 1506## UsedScene 1507 1508type UsedScene = _BundleInfo.UsedScene 1509 1510Defines the use scenario and timing for using the permission. 1511 1512**Atomic service API**: This API can be used in atomic services since API version 11. 1513 1514**System capability**: SystemCapability.BundleManager.BundleFramework.Core 1515 1516| Type | Description | 1517| ------------------------------------------------------------ | -------------- | 1518| [_BundleInfo.UsedScene](js-apis-bundleManager-bundleInfo.md#usedscene) | Use scenario and timing for using the permission.| 1519 1520## ReqPermissionDetail 1521 1522type ReqPermissionDetail = _BundleInfo.ReqPermissionDetail 1523 1524Defines the detailed information of the permissions to request from the system. 1525 1526**Atomic service API**: This API can be used in atomic services since API version 11. 1527 1528**System capability**: SystemCapability.BundleManager.BundleFramework.Core 1529 1530| Type | Description | 1531| ------------------------------------------------------------ | -------------- | 1532| [_BundleInfo.ReqPermissionDetail](js-apis-bundleManager-bundleInfo.md#reqpermissiondetail) | Detailed information of the permissions to request from the system.| 1533 1534## SignatureInfo 1535 1536type SignatureInfo = _BundleInfo.SignatureInfo 1537 1538Defines the signature information of the bundle. 1539 1540**Atomic service API**: This API can be used in atomic services since API version 11. 1541 1542**System capability**: SystemCapability.BundleManager.BundleFramework.Core 1543 1544| Type | Description | 1545| ------------------------------------------------------------ | -------------- | 1546| [_BundleInfo.SignatureInfo](js-apis-bundleManager-bundleInfo.md#signatureinfo) | Signature information of the bundle.| 1547 1548## HapModuleInfo 1549 1550type HapModuleInfo = _HapModuleInfo.HapModuleInfo 1551 1552Defines the HAP module information. 1553 1554**Atomic service API**: This API can be used in atomic services since API version 11. 1555 1556**System capability**: SystemCapability.BundleManager.BundleFramework.Core 1557 1558| Type | Description | 1559| ------------------------------------------------------------ | -------------- | 1560| [_HapModuleInfo.HapModuleInfo](js-apis-bundleManager-hapModuleInfo.md#hapmoduleinfo-1) | HAP module information.| 1561 1562## PreloadItem 1563 1564type PreloadItem = _HapModuleInfo.PreloadItem 1565 1566Defines the preloaded module information in the atomic service. 1567 1568**Atomic service API**: This API can be used in atomic services since API version 11. 1569 1570**System capability**: SystemCapability.BundleManager.BundleFramework.Core 1571 1572| Type | Description | 1573| ------------------------------------------------------------ | -------------- | 1574| [_HapModuleInfo.PreloadItem](js-apis-bundleManager-hapModuleInfo.md#preloaditem) | Preloaded module information in the atomic service.| 1575 1576## Dependency 1577 1578type Dependency = _HapModuleInfo.Dependency 1579 1580Defines the information about the dynamic shared libraries on which the module depends. 1581 1582**Atomic service API**: This API can be used in atomic services since API version 11. 1583 1584**System capability**: SystemCapability.BundleManager.BundleFramework.Core 1585 1586| Type | Description | 1587| ------------------------------------------------------------ | -------------- | 1588| [_HapModuleInfo.Dependency](js-apis-bundleManager-hapModuleInfo.md#dependency) | Information about the dynamic shared libraries on which the module depends.| 1589 1590## RouterItem<sup>12+</sup> 1591 1592type RouterItem = _HapModuleInfo.RouterItem 1593 1594Defines the router table configuration of the module. 1595 1596**Atomic service API**: This API can be used in atomic services since API version 12. 1597 1598**System capability**: SystemCapability.BundleManager.BundleFramework.Core 1599 1600| Type | Description | 1601| ------------------------------------------------------------ | -------------- | 1602| [_HapModuleInfo.RouterItem](js-apis-bundleManager-hapModuleInfo.md#routeritem12) | Router table configuration of the module.| 1603 1604## DataItem<sup>12+</sup> 1605 1606type DataItem = _HapModuleInfo.DataItem 1607 1608Defines the user-defined data in the routing table configuration of the module. 1609 1610**Atomic service API**: This API can be used in atomic services since API version 12. 1611 1612**System capability**: SystemCapability.BundleManager.BundleFramework.Core 1613 1614| Type | Description | 1615| ------------------------------------------------------------ | -------------- | 1616| [_HapModuleInfo.DataItem](js-apis-bundleManager-hapModuleInfo.md#dataitem12) | User-defined data in the routing table configuration of the module.| 1617 1618## AbilityInfo 1619 1620type AbilityInfo = _AbilityInfo.AbilityInfo 1621 1622Defines the ability information. 1623 1624**Atomic service API**: This API can be used in atomic services since API version 11. 1625 1626**System capability**: SystemCapability.BundleManager.BundleFramework.Core 1627 1628| Type | Description | 1629| ------------------------------------------------------------ | -------------- | 1630| [_AbilityInfo.AbilityInfo](js-apis-bundleManager-abilityInfo.md#abilityinfo-1) |Ability information.| 1631 1632## WindowSize 1633 1634type WindowSize = _AbilityInfo.WindowSize 1635 1636Defines the window size. 1637 1638**Atomic service API**: This API can be used in atomic services since API version 11. 1639 1640**System capability**: SystemCapability.BundleManager.BundleFramework.Core 1641 1642| Type | Description | 1643| ------------------------------------------------------------ | -------------- | 1644| [_AbilityInfo.WindowSize](js-apis-bundleManager-abilityInfo.md#windowsize) |Window size.| 1645 1646 1647## ExtensionAbilityInfo 1648 1649type ExtensionAbilityInfo = _ExtensionAbilityInfo.ExtensionAbilityInfo 1650 1651Defines the ExtensionAbility information. 1652 1653**Atomic service API**: This API can be used in atomic services since API version 11. 1654 1655**System capability**: SystemCapability.BundleManager.BundleFramework.Core 1656 1657| Type | Description | 1658| ------------------------------------------------------------ | -------------- | 1659| [_ExtensionAbilityInfo.ExtensionAbilityInfo](js-apis-bundleManager-extensionAbilityInfo.md#extensionabilityinfo-1) |ExtensionAbility information.| 1660 1661## ElementName 1662 1663type ElementName = _ElementName 1664 1665Defines the element name. 1666 1667**Atomic service API**: This API can be used in atomic services since API version 11. 1668 1669**System capability**: SystemCapability.BundleManager.BundleFramework.Core 1670 1671| Type | Description | 1672| ------------------------------------------------------------ | -------------- | 1673| [_ElementName](js-apis-bundleManager-elementName.md#elementname-1) |Element name.| 1674 1675## Skill<sup>12+</sup> 1676 1677type Skill = _Skill.Skill 1678 1679Defines the skill information. 1680 1681**Atomic service API**: This API can be used in atomic services since API version 12. 1682 1683**System capability**: SystemCapability.BundleManager.BundleFramework.Core 1684 1685| Type | Description | 1686| ------------------------------------------------------------ | -------------- | 1687| [_Skill.Skill](js-apis-bundleManager-skill.md#skill-1) |Skill information.| 1688 1689## SkillUrl<sup>12+</sup> 1690 1691type SkillUrl = _Skill.SkillUri 1692 1693Defines the SkillUri information. 1694 1695**Atomic service API**: This API can be used in atomic services since API version 12. 1696 1697**System capability**: SystemCapability.BundleManager.BundleFramework.Core 1698 1699| Type | Description | 1700| ------------------------------------------------------------ | -------------- | 1701| [_Skill.SkillUri](js-apis-bundleManager-skill.md#skilluri) |SkillUri information.| 1702 1703## AppCloneIdentity<sup>15+</sup> 1704 1705type AppCloneIdentity = _BundleInfo.AppCloneIdentity 1706 1707Describes the identity information of an application clone. 1708 1709**System capability**: SystemCapability.BundleManager.BundleFramework.Core 1710 1711| Type | Description | 1712| ------------------------------------------------------------ | -------------- | 1713| [_BundleInfo.AppCloneIdentity](js-apis-bundleManager-bundleInfo.md#appcloneidentity14) |Identity information of an application clone.| 1714