harmony(鸿蒙)PackInfo

2022-10-28 浏览 (751)

PackInfo

The PackInfo module provides the bundle package information, which can be obtained using bundle.getBundlePackInfo.

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.

BundlePackFlag

System API: This is a system API and cannot be called by third-party applications.

System capability: SystemCapability.BundleManager.BundleFramework

NameValueDescription
GET_PACK_INFO_ALL0x00000000All information about the package.
GET_PACKAGES0x00000001Package information about the package.
GET_BUNDLE_SUMMARY0x00000002Bundle summary of the package.
GET_MODULE_SUMMARY0x00000004Module summary of the package.

BundlePackInfo

System API: This is a system API and cannot be called by third-party applications.

System capability: SystemCapability.BundleManager.BundleFramework

NameTypeReadableWritableDescription
packagesArray<PackageConfig>YesNoPackage configuration information.
summaryPackageSummaryYesNoPackage summary.

PackageConfig

System API: This is a system API and cannot be called by third-party applications.

System capability: SystemCapability.BundleManager.BundleFramework

NameTypeReadableWritableDescription
deviceTypeArray<string>YesNoDevice types supported.
namestringYesNoPackage name.
moduleTypestringYesNoModule type.
deliveryWithInstallbooleanYesNoWhether the HAP file will be installed when the user installs the application. The value true means that the HAP file will be automatically installed when the user installs the application, and false means the opposite.

PackageSummary

System API: This is a system API and cannot be called by third-party applications.

System capability: SystemCapability.BundleManager.BundleFramework

NameTypeReadableWritableDescription
appBundleConfigInfoYesNoBundle configuration information.
modulesArray<ModuleConfigInfo>YesNoModule configuration information.

BundleConfigInfo

System API: This is a system API and cannot be called by third-party applications.

System capability: SystemCapability.BundleManager.BundleFramework

NameTypeReadableWritableDescription
bundleNamestringYesNoBundle name of an application. It uniquely identifies the application.
versionVersionYesNoBundle version.

ModuleConfigInfo

System API: This is a system API and cannot be called by third-party applications.

System capability: SystemCapability.BundleManager.BundleFramework

NameTypeReadableWritableDescription
apiVersionApiVersionYesNoAPI version of the module.
deviceTypeArray<string>YesNoDevice type of the module.
distroModuleDistroInfoYesNoDistribution information of the module.
abilitiesArray<ModuleAbilityInfo>YesNoAbility information of the module.
extensionAbilitiesArray<ExtensionAbilities>YesNoExtension ability information of the module.

ModuleDistroInfo

System API: This is a system API and cannot be called by third-party applications.

System capability: SystemCapability.BundleManager.BundleFramework

NameTypeReadableWritableDescription
mainAbilitystringYesNoName of the main ability.
deliveryWithInstallbooleanYesNoWhether the HAP file will be installed when the user installs the application. The value true means that the HAP file will be automatically installed when the user installs the application, and false means the opposite.
installationFreebooleanYesNoWhether the HAP file supports the installation-free feature. The value true means that the HAP file supports the installation-free feature and meets installation-free constraints, and false means the opposite.
moduleNamestringYesNoModule name.
moduleTypestringYesNoModule type.

ModuleAbilityInfo

System API: This is a system API and cannot be called by third-party applications.

System capability: SystemCapability.BundleManager.BundleFramework

NameTypeReadableWritableDescription
namestringYesNoLogical name of the ability. The name must be unique in the application.
labelstringYesNoName of the ability displayed to users. The value is a resource index to names in multiple languages.
visiblebooleanYesNoWhether the ability can be called by other applications. The value true means that the ability can be called by other applications, and false means the opposite.
formsArray<AbilityFormInfo>YesNoWidget information.

ExtensionAbilities

System API: This is a system API and cannot be called by third-party applications.

System capability: SystemCapability.BundleManager.BundleFramework

NameTypeReadableWritableDescription
formsArray<AbilityFormInfo>YesNoSpecification of the widget. A widget is a brief view of an application that is embedded on the home screen to receive periodical updates.

AbilityFormInfo

System API: This is a system API and cannot be called by third-party applications.

System capability: SystemCapability.BundleManager.BundleFramework

NameTypeReadableWritableDescription
namestringYesNoWidget name.
typestringYesNoWidget type.
updateEnabledbooleanYesNoWhether the widget supports periodical update. The value true means that the widget supports periodical update, and false means the opposite.
scheduledUpdateTimestringYesNoScheduled time to update the widget. The value is in 24-hour format and accurate to the minute.
updateDurationnumberYesNoInterval to update the widget. The unit is 30 minutes. The value is a multiple of 30. A widget can be updated periodically, either at a specified interval (updateDuration) or at the scheduled time (scheduledUpdateTime). If both are configured, updateDuration takes precedence.
supportDimensionsArray<number>YesNoDimensions of the widget. The value can be 1*2, 2*2, 2*4, 4*4, or a combination of these options. At least one option must be specified when defining the widget.
defaultDimensionnumberYesNoDefault dimensions of the widget. The value must be available in the supportDimensions array of the widget.

ApiVersion

System API: This is a system API and cannot be called by third-party applications.

System capability: SystemCapability.BundleManager.BundleFramework

NameTypeReadableWritableDescription
releaseTypestringYesNoName of the API version.
compatiblenumberYesNoMinimum API version.
targetnumbeYesNoTarget API version.

Version

System API: This is a system API and cannot be called by third-party applications.

System capability: SystemCapability.BundleManager.BundleFramework

NameTypeReadableWritableDescription
minCompatibleVersionCodenumberYesNoMinimum compatible version of the application. It is used to check whether the application is compatible with a version on other devices in the cross-device scenario. The value is a 32-bit non-negative integer.
namestringYesNoApplication version number visible to users.
codenumberYesNoApplication version number used only for application management. The value is a 32-bit non-negative integer. It is used only to determine whether a version is later than another version. A larger value indicates a later version.

你可能感兴趣的鸿蒙文章

harmony(鸿蒙)APIs

harmony(鸿蒙)API Reference Document Description

harmony(鸿蒙)BundleStatusCallback

harmony(鸿蒙)innerBundleManager

harmony(鸿蒙)distributedBundle

harmony(鸿蒙)Bundle

harmony(鸿蒙)Context

harmony(鸿蒙)DataUriUtils

harmony(鸿蒙)EnterpriseAdminExtensionAbility

harmony(鸿蒙)Work Scheduler Callbacks

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