openharmony 鸿蒙 js-apis-bundleManager-applicationInfo

2025-06-12 浏览 (1)

ApplicationInfo

The ApplicationInfo module defines the application information. A third-party application can obtain its own application information through bundleManager.getBundleInfoForSelf, with GET_BUNDLE_INFO_WITH_APPLICATION passed in to bundleFlags.

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.

ApplicationInfo

System capability: SystemCapability.BundleManager.BundleFramework.Core

NameTypeRead-OnlyOptionalDescription
namestringYesNoApplication name.
Atomic service API: This API can be used in atomic services since API version 11.
descriptionstringYesNoDescription of the application, for example, "description": $string: mainability_description". For details, see the description of the descriptionResource field below.
Atomic service API: This API can be used in atomic services since API version 11.
descriptionIdnumberYesNoID of the application description.
Atomic service API: This API can be used in atomic services since API version 11.
enabledbooleanYesNoWhether the application is enabled. The value true means that the application is enabled, and false means the opposite.
Atomic service API: This API can be used in atomic services since API version 11.
labelstringYesNoApplication name, for example, "label": "$string: mainability_description". For details, see the description of the labelResource field below.
Atomic service API: This API can be used in atomic services since API version 11.
labelIdnumberYesNoID of the application label.
Atomic service API: This API can be used in atomic services since API version 11.
iconstringYesNoApplication icon, for example, "icon": "$media:icon". For details, see the description of the iconResource field below.
Atomic service API: This API can be used in atomic services since API version 11.
iconIdnumberYesNoID of the application icon.
Atomic service API: This API can be used in atomic services since API version 11.
processstringYesNoProcess name.
Atomic service API: This API can be used in atomic services since API version 11.
permissionsArray<string>YesNoPermissions required for accessing the application. The permissions can be obtained by passing in GET_BUNDLE_INFO_WITH_APPLICATION and 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.
codePathstringYesNoInstallation directory of the application.
Atomic service API: This API can be used in atomic services since API version 11.
metadata(deprecated)Map<string, Array<Metadata>>YesNoMetadata of the application. The information can be obtained by passing in GET_BUNDLE_INFO_WITH_APPLICATION and GET_BUNDLE_INFO_WITH_METADATA to the bundleFlags parameter of getBundleInfoForSelf.
NOTE
The metadata field is deprecated since API version 10. You are advised to use metadataArray instead.
metadataArray10+Array<ModuleMetadata>YesNoMetadata of the application. The information can be obtained by passing in GET_BUNDLE_INFO_WITH_APPLICATION and GET_BUNDLE_INFO_WITH_METADATA to the bundleFlags parameter of getBundleInfoForSelf.
Atomic service API: This API can be used in atomic services since API version 11.
removablebooleanYesNoWhether the application is removable. The value true means that the application is removable, and false means the opposite.
Atomic service API: This API can be used in atomic services since API version 11.
accessTokenIdnumberYesNoAccess token ID of the application, which is used in the application access control verification API.
Atomic service API: This API can be used in atomic services since API version 11.
uidnumberYesNoUID of the application.
Atomic service API: This API can be used in atomic services since API version 11.
iconResourceResourceYesNoResource information of the application icon. The resource information obtained contains the bundle name, module name, and ID of the resource. You can call getMediaContent to obtain the resource details.
Atomic service API: This API can be used in atomic services since API version 11.
labelResourceResourceYesNoResource information of the application label. The resource information obtained contains the bundle name, module name, and ID of the resource. You can call getMediaContent to obtain the resource details.
Atomic service API: This API can be used in atomic services since API version 11.
descriptionResourceResourceYesNoResource information of the application description. The resource information obtained contains the bundle name, module name, and ID of the resource. You can call getMediaContent to obtain the resource details.
Atomic service API: This API can be used in atomic services since API version 11.
appDistributionTypestringYesNoDistribution type of the application signing certificate. The options are as follows:
  • app_gallery: application distributed by AppGallery.
  • enterprise: enterprise application that can be installed on personal devices.
  • enterprise_mdm: enterprise Mobile Device Management (MDM) application, which can be installed only on enterprise devices. The applications of this type must have device management privileges, such as remote locking devices and installing common enterprise applications on devices.
  • enterprise_normal: common enterprise application, which can be installed on enterprise devices only through an enterprise MDM application. The applications of this type do not require device management privileges.
  • os_integration: preset application in the system.
  • crowdtesting: crowdtesting application.
  • internaltesting: application under internal testing of AppGallery.
  • none: other applications.
    Atomic service API: This API can be used in atomic services since API version 11.
  • appProvisionTypestringYesNoType of the application signing certificate file. The options are debug and release.
    Atomic service API: This API can be used in atomic services since API version 11.
    systemAppbooleanYesNoWhether the application is a system application. The value true means that the application is a system application, and false means the opposite.
    Atomic service API: This API can be used in atomic services since API version 11.
    bundleTypebundleManager.BundleTypeYesNoBundle type, which can be APP (application) or ATOMIC_SERVICE (atomic service).
    Atomic service API: This API can be used in atomic services since API version 11.
    debug10+booleanYesNoWhether the application is running in debug mode. The value true means that the application is running in debug mode, and false means the opposite.
    Atomic service API: This API can be used in atomic services since API version 11.
    dataUnclearable11+booleanYesNoWhether the application data is unclearable. The value true means that the application data is unclearable, and false means the opposite.
    Atomic service API: This API can be used in atomic services since API version 11.
    nativeLibraryPath12+stringYesNoLocal library file path of the application.
    multiAppMode12+MultiAppModeYesNoMulti-app mode.
    appIndex12+numberYesNoIndex of an application clone. It takes effect only for cloned applications.
    installSource12+stringYesNoInstallation source of the application. The options are as follows:
    - pre-installed: The application is a preset application installed at initial device startup.
    - ota: The application is a preset application added during system upgrade.
    - recovery: The preset application is uninstalled and then restored.
    - bundleName: The application corresponding to the bundle name is installed.
    - unknown: The installation source is unknown.
    Atomic service API: This API can be used in atomic services since API version 12.
    releaseType12+stringYesNoRelease type of the SDK used for application packing. Currently, the SDK release types include Canary, Beta, and Release. Each of the Canary and Beta releases can be distinguished by a sequential number, such as Canary1, Canary2, Beta1, and Beta2. You can compare the SDK release type on which application packaging depends and the OS release type (specified by deviceInfo.distributionOSReleaseType) to determine the compatibility.
    Atomic service API: This API can be used in atomic services since API version 12.
    cloudFileSyncEnabled12+booleanYesNoWhether device-cloud file synchronization is enabled for the application. The value true means that device-cloud file synchronization is enabled, and false means the opposite.
    Atomic service API: This API can be used in atomic services since API version 12.

    MultiAppMode12+

    Defines the multi-app mode.

    System capability: SystemCapability.BundleManager.BundleFramework.Core

    Parameters

    NameTypeRead-OnlyOptionalDescription
    multiAppModeTypebundleManager.MultiAppModeTypeYesNoType of the multi-app mode.
    maxCountnumberYesNoMaximum number of accounts that can log in to the application at the same time.

    ModuleMetadata10+

    Describes the metadata of a module.

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

    System capability: SystemCapability.BundleManager.BundleFramework.Core

    NameTypeRead-OnlyOptionalDescription
    moduleNamestringYesNoModule name.
    metadataArray<Metadata>YesNoMetadata list of the module.

    你可能感兴趣的鸿蒙文章

    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/QcaQzA