• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# BundleInfo
2<!--Kit: Ability Kit-->
3<!--Subsystem: BundleManager-->
4<!--Owner: @wanghang904-->
5<!--Designer: @hanfeng6-->
6<!--Tester: @kongjing2-->
7<!--Adviser: @Brilliantry_Rui-->
8
9The module defines the bundle information, which can be obtained through [bundle.getBundleInfo](js-apis-Bundle.md#bundlegetbundleinfodeprecated).
10
11> **NOTE**
12>
13> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
14>
15> The APIs of this module are deprecated since API version 9. You are advised to use [bundleManager-BundleInfo](js-apis-bundleManager-bundleInfo.md) instead.
16
17## BundleInfo<sup>(deprecated)<sup>
18
19This API is deprecated since API version 9. You are advised to use [bundleManager-BundleInfo](js-apis-bundleManager-bundleInfo.md#bundleinfo-1) instead.
20
21**System capability**: SystemCapability.BundleManager.BundleFramework
22
23| Name                            | Type                                                        | Read-Only| Optional| Description                                                        |
24| -------------------------------- | ------------------------------------------------------------ | ---- | ---- | ------------------------------------------------------------ |
25| name                             | string                                                       | Yes  | No  | Bundle name.                                              |
26| type                             | string                                                       | Yes  | No  | Bundle type.                                                |
27| appId                            | string                                                       | Yes  | No  | ID of the application to which the bundle belongs.                                      |
28| uid                              | number                                                       | Yes  | No  | UID of the application to which the bundle belongs.                                     |
29| installTime                      | number                                                       | Yes  | No  | Time when the HAP file was installed.                                               |
30| updateTime                       | number                                                       | Yes  | No  | Time when the HAP file was updated.                                               |
31| appInfo                          | [ApplicationInfo](js-apis-bundle-ApplicationInfo.md)         | Yes  | No  | Application configuration information.                                        |
32| abilityInfos                     | Array\<[AbilityInfo](js-apis-bundle-AbilityInfo.md)>         | Yes  | No  | Ability configuration information.<br>The value is obtained by passing in GET_BUNDLE_WITH_ABILITIES to [bundle.getBundleInfo](js-apis-Bundle.md#bundlegetbundleinfodeprecated).|
33| reqPermissions                   | Array\<string>                                               | Yes  | No  | Permissions to request from the system for running the application.<br>The value is obtained by passing in GET_BUNDLE_WITH_REQUESTED_PERMISSION to [bundle.getBundleInfo](js-apis-Bundle.md#bundlegetbundleinfodeprecated).|
34| reqPermissionDetails             | Array\<[ReqPermissionDetail](#reqpermissiondetaildeprecated)> | Yes  | No  | Detailed information of the permissions to request from the system.<br>The value is obtained by passing in GET_BUNDLE_WITH_REQUESTED_PERMISSION to [bundle.getBundleInfo](js-apis-Bundle.md#bundlegetbundleinfodeprecated).|
35| vendor                           | string                                                       | Yes  | No  | Vendor of the bundle.                                            |
36| versionCode                      | number                                                       | Yes  | No  | Version number of the bundle.                                            |
37| versionName                      | string                                                       | Yes  | No  | Version description of the bundle.                                  |
38| compatibleVersion                | number                                                       | Yes  | No  | Earliest SDK version required for running the bundle.                           |
39| targetVersion                    | number                                                       | Yes  | No  | Latest SDK version required for running the bundle.                             |
40| isCompressNativeLibs             | boolean                                                      | Yes  | No  | Whether the native libraries in the bundle are compressed. **true** if compressed, **false** otherwise.                      |
41| hapModuleInfos                   | Array\<[HapModuleInfo](js-apis-bundle-HapModuleInfo.md)>     | Yes  | No  | Module configuration information.                                            |
42| entryModuleName                  | string                                                       | Yes  | No  | Name of the entry module.                                           |
43| cpuAbi                           | string                                                       | Yes  | No  | CPU and ABI information of the bundle.                                        |
44| isSilentInstallation             | string                                                       | Yes  | No  | Whether the application can be installed in silent mode.                                          |
45| minCompatibleVersionCode         | number                                                       | Yes  | No  | Earliest version compatible with the bundle in the distributed scenario.                        |
46| entryInstallationFree            | boolean                                                      | Yes  | No  | Whether installation-free is supported for the entry module. **true** if supported, **false** otherwise.                                       |
47| reqPermissionStates<sup>8+</sup> | Array\<number>                                               | Yes  | No  | Permission grant state. The value **0** means that the request is successful, and **-1** means the opposite.         |
48
49
50
51## ReqPermissionDetail<sup>(deprecated)<sup>
52
53> This API is deprecated since API version 9. You are advised to use [ReqPermissionDetail](js-apis-bundleManager-bundleInfo.md) instead.
54
55Provides the detailed information of the permissions to request from the system.
56
57**System capability**: SystemCapability.BundleManager.BundleFramework
58
59| Name                 | Type                   | Read-Only| Optional| Description                  |
60| --------------------- | ----------------------- | ---- | ---- | ---------------------- |
61| name                  | string                  | No  | No  | Name of the permission to request.  |
62| reason                | string                  | No  | No  | Reason for requesting the permission.  |
63| usedScene             | [UsedScene](#usedscenedeprecated) | No  | No  | Application scenario and timing for using the permission.|
64
65
66
67## UsedScene<sup>(deprecated)<sup>
68
69> This API is deprecated since API version 9. You are advised to use [UsedScene](js-apis-bundleManager-bundleInfo.md#usedscene) instead.
70
71Describes the application scenario and timing for using the permission.
72
73**System capability**: SystemCapability.BundleManager.BundleFramework
74
75| Name     | Type          | Read-Only| Optional| Description                       |
76| --------- | -------------- | ---- | ---- | --------------------------- |
77| abilities | Array\<string> | No  | No  | Abilities that use the permission.|
78| when      | string         | No  | No  | Time when the permission is used.         |
79