js-apis-bundle-BundleInfo.md 6.1 KB
Newer Older
W
wusongqing 已提交
1 2
# BundleInfo

W
wusongqing 已提交
3 4
> **NOTE**
>
W
wusongqing 已提交
5 6 7 8 9 10
> 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.
>
> API version 9 is a canary version for trial use. The APIs of this version may be unstable.

Provides the application bundle information.

W
wusongqing 已提交
11
## BundleInfo
W
wusongqing 已提交
12 13 14 15 16 17 18 19 20 21 22 23 24 25

 **System capability**: SystemCapability.BundleManager.BundleFramework

| Name                             | Type                                                        | Readable| Writable| Description                                      |
| --------------------------------- | ------------------------------------------------------------ | ---- | ---- | ------------------------------------------ |
| name                              | string                                                       | Yes  | No  | Bundle name.                              |
| type                              | string                                                       | Yes  | No  | Bundle type.                                |
| appId                             | string                                                       | Yes  | No  | ID of the application to which the bundle belongs.                      |
| uid                               | number                                                       | Yes  | No  | UID of the application to which the bundle belongs.                     |
| installTime                       | number                                                       | Yes  | No  | Time when the HAP file was installed.                             |
| updateTime                        | number                                                       | Yes  | No  | Time when the HAP file was updated.                             |
| appInfo                           | ApplicationInfo         | Yes  | No  | Application configuration information.                        |
| abilityInfos                      | Array\<[AbilityInfo](js-apis-bundle-AbilityInfo.md)>         | Yes  | No  | Ability configuration information.                         |
| reqPermissions                    | Array\<string>                                               | Yes  | No  | Permissions to request from the system for running the application.          |
W
wusongqing 已提交
26
| reqPermissionDetails              | Array\<[ReqPermissionDetail](#reqpermissiondetail)>          | Yes  | No  | Detailed information of the permissions to request from the system.|
W
wusongqing 已提交
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
| vendor                            | string                                                       | Yes  | No  | Vendor of the bundle.                            |
| versionCode                       | number                                                       | Yes  | No  | Version number of the bundle.                            |
| versionName                       | string                                                       | Yes  | No  | Version description of the bundle.                  |
| compatibleVersion                 | number                                                       | Yes  | No  | Earliest SDK version required for running the bundle.           |
| targetVersion                     | number                                                       | Yes  | No  | Latest SDK version required for running the bundle.             |
| isCompressNativeLibs              | boolean                                                      | Yes  | No  | Whether to compress the native library of the bundle. The default value is **true**.        |
| hapModuleInfos                    | Array\<[HapModuleInfo](js-apis-bundle-HapModuleInfo.md)>     | Yes  | No  | Module configuration information.                            |
| entryModuleName                   | string                                                       | Yes  | No  | Name of the entry module.                           |
| cpuAbi                            | string                                                       | Yes  | No  | cpuAbi information of the bundle.                        |
| isSilentInstallation              | string                                                       | Yes  | No  | Whether the application can be installed in silent mode.                          |
| minCompatibleVersionCode          | number                                                       | Yes  | No  | Earliest version compatible with the bundle in the distributed scenario.        |
| entryInstallationFree             | boolean                                                      | Yes  | No  | Whether installation-free is supported for the entry module.                       |
| reqPermissionStates<sup>8+</sup>  | Array\<number>                                               | Yes  | No  | Permission grant state.                        |
| extensionAbilityInfo<sup>9+</sup> | Array\<[ExtensionAbilityInfo](js-apis-bundle-ExtensionAbilityInfo.md)> | Yes  | No  | Extension ability information.                       |

## ReqPermissionDetail

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

 **System capability**: SystemCapability.BundleManager.BundleFramework

| Name                 | Type                   | Readable| Writable| Description                |
| --------------------- | ----------------------- | ---- | ---- | -------------------- |
| name                  | string                  | Yes  | Yes  | Name of the permission to request.  |
| reason                | string                  | Yes  | Yes  | 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.

 **System capability**: SystemCapability.BundleManager.BundleFramework

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