openharmony 鸿蒙 js-apis-bundleManager-bundleInfo

2025-06-12 浏览 (1)

BundleInfo

The BundleInfo module defines the bundle information. A third-party application can obtain its own bundle information through bundleManager.getBundleInfoForSelf, with bundleFlags set to the information to be contained in the returned BundleInfo.

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

System capability: SystemCapability.BundleManager.BundleFramework.Core

NameTypeRead-OnlyOptionalDescription
namestringYesNoBundle name.
Atomic service API: This API can be used in atomic services since API version 11.
vendorstringYesNoVendor of the bundle.
Atomic service API: This API can be used in atomic services since API version 11.
versionCodenumberYesNoVersion number of the bundle.
Atomic service API: This API can be used in atomic services since API version 11.
versionNamestringYesNoVersion description of the bundle.
Atomic service API: This API can be used in atomic services since API version 11.
minCompatibleVersionCodenumberYesNoEarliest version compatible with the bundle in the distributed scenario.
Atomic service API: This API can be used in atomic services since API version 11.
targetVersionnumberYesNoTarget runtime version of the bundle.
Atomic service API: This API can be used in atomic services since API version 11.
appInfoApplicationInfoYesNoApplication information. The information can be obtained by passing in GET_BUNDLE_INFO_WITH_APPLICATION to the bundleFlags parameter of getBundleInfoForSelf.
Atomic service API: This API can be used in atomic services since API version 11.
hapModulesInfoArray<HapModuleInfo>YesNoModule configuration information. The information can be obtained by passing in GET_BUNDLE_INFO_WITH_HAP_MODULE to the bundleFlags parameter of getBundleInfoForSelf.
Atomic service API: This API can be used in atomic services since API version 11.
reqPermissionDetailsArray<ReqPermissionDetail>YesNoDetailed 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.
Atomic service API: This API can be used in atomic services since API version 11.
permissionGrantStatesArray<bundleManager.PermissionGrantState>YesNoPermission grant state. The information can be obtained by passing in GET_BUNDLE_INFO_WITH_REQUESTED_PERMISSION to the bundleFlags parameter of getBundleInfoForSelf.
Atomic service API: This API can be used in atomic services since API version 11.
signatureInfoSignatureInfoYesNoSignature information of the bundle. The information can be obtained by passing in GET_BUNDLE_INFO_WITH_SIGNATURE_INFO to the bundleFlags parameter of getBundleInfoForSelf.
Atomic service API: This API can be used in atomic services since API version 11.
installTimenumberYesNoTimestamp when the bundle was installed, in milliseconds.
Atomic service API: This API can be used in atomic services since API version 11.
updateTimenumberYesNoTimestamp when the bundle was last updated, in milliseconds.
Atomic service API: This API can be used in atomic services since API version 11.
routerMap12+Array<RouterItem>YesNoRouter 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.
Atomic service API: This API can be used in atomic services since API version 12.
appIndex12+numberYesNoIndex of an application clone. It takes effect only for application clones.
firstInstallTime18+numberYesYesTimestamp when the bundle was first installed on the current device, in milliseconds.
Atomic service API: This API can be used in atomic services since API version 18.

ReqPermissionDetail

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

NOTE

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.

Atomic service API: This API can be used in atomic services since API version 11.

System capability: SystemCapability.BundleManager.BundleFramework.Core

NameTypeRead-OnlyOptionalDescription
namestringNoNoName of the permission to request.
moduleName10+stringNoNoName of the module that requests the permission.
reasonstringNoNoReason for requesting the permission.
reasonIdnumberNoNoID of the reason for requesting the permission.
usedSceneUsedSceneNoNoUse scenario and timing for using the permission.

UsedScene

Describes the use scenario and timing for using the permission.

Atomic service API: This API can be used in atomic services since API version 11.

System capability: SystemCapability.BundleManager.BundleFramework.Core

NameTypeRead-OnlyOptionalDescription
abilitiesArray<string>NoNoAbilities that use the permission.
whenstringNoNoTime when the permission is used. The value can be inuse or always.

SignatureInfo

Describes the signature information of the bundle.

System capability: SystemCapability.BundleManager.BundleFramework.Core

NameTypeRead-OnlyOptionalDescription
appIdstringYesNoApplication ID.
Atomic service API: This API can be used in atomic services since API version 11.
fingerprintstringYesNoFingerprint information of the bundle. This field changes when the used signing certificate changes.
Atomic service API: This API can be used in atomic services since API version 11.
appIdentifier11+stringYesNoUnique ID of the application. It is the app ID, which is a random string, allocated by AppGallery Connect during the creation of the application. This ID does not change along the application lifecycle, including version updates, certificate changes, public and private key changes, and application transfers. If you use multiple debugging devices, perform debugging offline, or need to interact with other applications, you are advised to use manual signature.
Atomic service API: This API can be used in atomic services since API version 11.
certificate14+stringYesYesPublic key of the application certificate.
Atomic service API: This API can be used in atomic services since API version 14.

AppCloneIdentity14+

Describes the identity information of an application clone.

System capability: SystemCapability.BundleManager.BundleFramework.Core

NameTypeRead-OnlyOptionalDescription
bundleNamestringYesNoBundle name of the application.
appIndexnumberYesNoIndex of the application clone.

你可能感兴趣的鸿蒙文章

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

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/FVWD63