1# BundleInfo
2
3The **BundleInfo** module defines the bundle information. A third-party application can obtain its own bundle information through [bundleManager.getBundleInfoForSelf](js-apis-bundleManager.md#bundlemanagergetbundleinfoforself), with [bundleFlags](js-apis-bundleManager.md#bundleflag) set to the information to be contained in the returned [BundleInfo](js-apis-bundleManager-bundleInfo.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## BundleInfo
10
11**System capability**: SystemCapability.BundleManager.BundleFramework.Core
12
13| Name                             | Type                                                        | Read-Only| Optional| Description                                                        |
14| --------------------------------- | ------------------------------------------------------------ | ---- | ---- | ------------------------------------------------------------ |
15| name                              | string                                                       | Yes  | No  | Bundle name.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
16| vendor                            | string                                                       | Yes  | No  | Vendor of the bundle.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
17| versionCode                       | number                                                       | Yes  | No  | Version number of the bundle.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
18| versionName                       | string                                                       | Yes  | No  | Version description of the bundle.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
19| minCompatibleVersionCode          | number                                                       | Yes  | No  | Earliest version compatible with the bundle in the distributed scenario.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
20| targetVersion                     | number                                                       | Yes  | No  | Target API version required for running the bundle.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
21| 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 [getBundleInfoForSelf](js-apis-bundleManager.md#bundlemanagergetbundleinfoforself).<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
22| 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 [getBundleInfoForSelf](js-apis-bundleManager.md#bundlemanagergetbundleinfoforself).<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
23| 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 [getBundleInfoForSelf](js-apis-bundleManager.md#bundlemanagergetbundleinfoforself).<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
24| permissionGrantStates        | Array\<[bundleManager.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 [getBundleInfoForSelf](js-apis-bundleManager.md#bundlemanagergetbundleinfoforself).<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
25| 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 [getBundleInfoForSelf](js-apis-bundleManager.md#bundlemanagergetbundleinfoforself).<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
26| installTime                       | number                                                       | Yes  | No  | Time when the bundle was installed.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
27| updateTime                        | number                                                       | Yes  | No  | Time when the bundle was updated.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
28| routerMap<sup>12+</sup>           | Array\<[RouterItem](js-apis-bundleManager-hapModuleInfo.md#routeritem12)>           | Yes  | No  | Router table of the application. The table is obtained by deduplicating and combining the **routerMap** information under **hapModulesInfo** based on the **name** field in **RouterItem**. The information can be obtained by passing in **GET_BUNDLE_INFO_WITH_HAP_MODULE** and **GET_BUNDLE_INFO_WITH_ROUTER_MAP** to the **bundleFlags** parameter of [getBundleInfoForSelf](js-apis-bundleManager.md#bundlemanagergetbundleinfoforself).<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
29| appIndex<sup>12+</sup>    | number    | Yes  | No  | Index of an application clone. It takes effect only for cloned applications.|
30
31
32## ReqPermissionDetail
33
34Provides the detailed information of the permissions to request from the system.
35> **NOTE**
36>
37> If multiple packages of an application have requested the same permission but with different reasons, the system returns only one reason based on a descending priority order: entry HAP > feature HAP > in-app HSP.
38
39**Atomic service API**: This API can be used in atomic services since API version 11.
40
41**System capability**: SystemCapability.BundleManager.BundleFramework.Core
42
43| Name                 | Type                   | Read-Only| Optional| Description                |
44| --------------------- | ----------------------- | ---- | ---- | ---------------------|
45| name                  | string                  | No  | No  | Name of the permission to request.  |
46| moduleName<sup>10+</sup>            | string                  | No  | No  | Name of the module that requests the permission.  |
47| reason                | string                  | No  | No  | Reason for requesting the permission. |
48| reasonId              | number                  | No  | No | ID of the reason for requesting the permission.|
49| usedScene             | [UsedScene](#usedscene) | No  | No  | Use scenario and timing for using the permission.|
50
51
52
53## UsedScene
54
55Describes the use scenario and timing for using the permission.
56
57**Atomic service API**: This API can be used in atomic services since API version 11.
58
59**System capability**: SystemCapability.BundleManager.BundleFramework.Core
60
61| Name     | Type          | Read-Only| Optional| Description                       |
62| --------- | -------------- | ---- | ---- | --------------------------- |
63| abilities | Array\<string> | No  | No  | Abilities that use the permission.  |
64| when      | string         | No  | No  | Time when the permission is used.         |
65
66## SignatureInfo
67
68Describes the signature information of the bundle.
69
70**Atomic service API**: This API can be used in atomic services since API version 11.
71
72**System capability**: SystemCapability.BundleManager.BundleFramework.Core
73
74| Name     | Type          | Read-Only| Optional| Description                       |
75| --------- | -------------- | ---- | ---- | --------------------------- |
76| appId     | string         | Yes  | No  | Application ID.                |
77|fingerprint| string         | Yes  | No  | Fingerprint information of the bundle. This field changes when the used signing certificate changes.           |
78|appIdentifier<sup>11+</sup>| string         | Yes  | No  | Unique ID of the application, which is allocated by the cloud. This ID does not change along the application lifecycle, including version updates, certificate changes, public and private key changes, and application transfers.           |
79|certificate<sup>13+</sup>| string         | Yes  | Yes  | Public key of the application certificate.           |
80