harmony 鸿蒙BundleInfo

  • 2025-06-12
  • 浏览 (2)

BundleInfo

The BundleInfo module defines the bundle information, which can be obtained through bundle.getBundleInfo.

NOTE

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.

The APIs of this module are deprecated since API version 9. You are advised to use bundleManager-BundleInfo instead.

BundleInfo(deprecated)

This API is deprecated since API version 9. You are advised to use bundleManager-BundleInfo instead.

System capability: SystemCapability.BundleManager.BundleFramework

Name Type Read-Only Optional 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> Yes No Ability configuration information.
The value is obtained by passing in GET_BUNDLE_WITH_ABILITIES to bundle.getBundleInfo.
reqPermissions Array<string> Yes No Permissions to request from the system for running the application.
The value is obtained by passing in GET_BUNDLE_WITH_REQUESTED_PERMISSION to bundle.getBundleInfo.
reqPermissionDetails Array<ReqPermissionDetail> Yes No Detailed information of the permissions to request from the system.
The value is obtained by passing in GET_BUNDLE_WITH_REQUESTED_PERMISSION to bundle.getBundleInfo.
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 the native libraries in the bundle are compressed. The value true means that the native libraries are compressed, and false means the opposite.
hapModuleInfos Array<HapModuleInfo> Yes No Module configuration information.
entryModuleName string Yes No Name of the entry module.
cpuAbi string Yes No CPU and ABI 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. The value true means that installation-free is supported, and false means the opposite.
reqPermissionStates8+ Array<number> Yes No Permission grant state. The value 0 means that the request is successful, and -1 means the opposite.

ReqPermissionDetail(deprecated)

This API is deprecated since API version 9. You are advised to use ReqPermissionDetail instead.

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

System capability: SystemCapability.BundleManager.BundleFramework

Name Type Read-Only Optional Description
name string No No Name of the permission to request.
reason string No No Reason for requesting the permission.
usedScene UsedScene No No Application scenario and timing for using the permission.

UsedScene(deprecated)

This API is deprecated since API version 9. You are advised to use UsedScene instead.

Describes the application scenario and timing for using the permission.

System capability: SystemCapability.BundleManager.BundleFramework

Name Type Read-Only Optional Description
abilities Array<string> No No Abilities that use the permission.
when string No No Time when the permission is used.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Ability Kit

harmony 鸿蒙AbilityAccessControl

harmony 鸿蒙AbilityBase

harmony 鸿蒙AbilityBase_Element

harmony 鸿蒙AbilityRuntime

harmony 鸿蒙bundle

harmony 鸿蒙OH_NativeBundle_ApplicationInfo

harmony 鸿蒙OH_NativeBundle_ElementName

harmony 鸿蒙ability_access_control.h

harmony 鸿蒙ability_base_common.h

0  赞