js-apis-bundleManager-bundleInfo.md 6.5 KB
Newer Older
1 2
# BundleInfo

G
Gloria 已提交
3
The **BundleInfo** module defines the bundle information. A system application can obtain its own or others' bundle information through [bundleManager.getBundleInfo](js-apis-bundleManager.md#bundlemanagergetbundleinfo). A third-party application can obtain its own bundle information through [getBundleInfoForSelf](js-apis-bundleManager.md#bundlemanagergetbundleinfoforself). The input parameter [bundleFlags](js-apis-bundleManager.md#bundleflag) specifies the information to be contained in the returned [BundleInfo](js-apis-bundleManager-bundleInfo.md) object.
4 5 6 7 8 9 10

> **NOTE**
>
> 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.

## BundleInfo

G
Gloria 已提交
11
**System capability**: SystemCapability.BundleManager.BundleFramework.Core
12 13 14 15 16

| Name                             | Type                                                        | Readable| Writable| Description                                                        |
| --------------------------------- | ------------------------------------------------------------ | ---- | ---- | ------------------------------------------------------------ |
| name                              | string                                                       | Yes  | No  | Bundle name.                                              |
| vendor                            | string                                                       | Yes  | No  | Vendor of the bundle.                                              |
G
Gloria 已提交
17
| versionCode                       | number                                                       | Yes  | No  | Version number of the bundle.                                             |
18 19 20
| versionName                       | string                                                       | Yes  | No  | Version description of the bundle.                                    |
| minCompatibleVersionCode          | number                                                       | Yes  | No  | Earliest version compatible with the bundle in the distributed scenario.                          |
| targetVersion                     | number                                                       | Yes  | No  | Target API version required for running the bundle.                               |
G
Gloria 已提交
21 22 23 24 25
| appInfo                           | [ApplicationInfo](js-apis-bundleManager-applicationInfo.md)         | Yes  | No  | Application information. The information can be obtained by passing in **GET_BUNDLE_INFO_WITH_APPLICATION** to the **bundleFlags** parameter of [bundleManager.getBundleInfo](js-apis-bundleManager.md#bundlemanagergetbundleinfo).                                          |
| hapModulesInfo                    | Array\<[HapModuleInfo](js-apis-bundleManager-hapModuleInfo.md)>     | Yes  | No  | Module configuration information. The information can be obtained by passing in **GET_BUNDLE_INFO_WITH_HAP_MODULE** to the **bundleFlags** parameter of [bundleManager.getBundleInfo](js-apis-bundleManager.md#bundlemanagergetbundleinfo).                                                |
| reqPermissionDetails     | Array\<[ReqPermissionDetail](#reqpermissiondetail)>   | Yes  | No  | Detailed information of the permissions to request from the system. The information can be obtained by passing in **GET_BUNDLE_INFO_WITH_REQUESTED_PERMISSION** to the **bundleFlags** parameter of [bundleManager.getBundleInfo](js-apis-bundleManager.md#bundlemanagergetbundleinfo).|
| permissionGrantStates        | Array\<[PermissionGrantState](js-apis-bundleManager.md#permissiongrantstate)> | Yes  | No  | Permission grant state. The information can be obtained by passing in **GET_BUNDLE_INFO_WITH_REQUESTED_PERMISSION** to the **bundleFlags** parameter of [bundleManager.getBundleInfo](js-apis-bundleManager.md#bundlemanagergetbundleinfo).                    |
| signatureInfo          | [SignatureInfo](#signatureinfo)                                          | Yes  | No  | Signature information of the bundle. The information can be obtained by passing in **GET_BUNDLE_INFO_WITH_SIGNATURE_INFO** to the **bundleFlags** parameter of [bundleManager.getBundleInfo](js-apis-bundleManager.md#bundlemanagergetbundleinfo).                                          |
26 27 28 29 30 31 32 33
| installTime                       | number                                                       | Yes  | No  | Time when the bundle was installed.                                         |
| updateTime                        | number                                                       | Yes  | No  | Time when the bundle was updated.                                           |


## ReqPermissionDetail

Provides the detailed information of the permissions to request from the system.

G
Gloria 已提交
34
**System capability**: SystemCapability.BundleManager.BundleFramework.Core
35 36 37 38

| Name                 | Type                   | Readable| Writable| Description                |
| --------------------- | ----------------------- | ---- | ---- | ---------------------|
| name                  | string                  | Yes  | Yes  | Name of the permission to request.  |
39
| moduleName<sup>10+</sup>            | string                  | Yes  | Yes  | Name of the module that requests the permission.  |
G
Gloria 已提交
40
| reason                | string                  | Yes  | Yes  | Reason for requesting the permission. |
41 42 43 44 45 46 47 48 49
| reasonId              | number                  | Yes  | Yes  | ID of the reason for requesting the permission.|
| usedScene             | [UsedScene](#usedscene) | Yes  | Yes  | Application scenario and timing for using the permission.|



## UsedScene

Describes the application scenario and timing for using the permission.

G
Gloria 已提交
50
**System capability**: SystemCapability.BundleManager.BundleFramework.Core
51 52 53 54 55 56 57 58 59 60

| Name     | Type          | Readable| Writable| Description                       |
| --------- | -------------- | ---- | ---- | --------------------------- |
| abilities | Array\<string> | Yes  | Yes  | Abilities that use the permission.  |
| when      | string         | Yes  | Yes  | Time when the permission is used.         |

## SignatureInfo

Describes the signature information of the bundle.

G
Gloria 已提交
61
**System capability**: SystemCapability.BundleManager.BundleFramework.Core
62 63 64 65 66

| Name     | Type          | Readable| Writable| Description                       |
| --------- | -------------- | ---- | ---- | --------------------------- |
| appId     | string         | Yes  | No  | Application ID.                |
|fingerprint| string         | Yes  | No  | Fingerprint information of the bundle.           |