應(yīng)用程序信息的定義

2024-01-23 13:07 更新
說明

說明:

本模塊首批接口從API version 9 開始支持。后續(xù)版本的新增接口,采用上角標(biāo)單獨(dú)標(biāo)記接口的起始版本。

應(yīng)用程序信息的定義,應(yīng)用可以通過getBundleInfoForSelf獲取自身的Application信息,其中入?yún)?a rel="external nofollow" target="_blank" >bundleFlags需要使用 GET_BUNDLE_INFO_WITH_APPLICATION。

ApplicationInfo

系統(tǒng)能力: 以下各項(xiàng)對(duì)應(yīng)的系統(tǒng)能力均為SystemCapability.BundleManager.BundleFramework.Core

名稱

類型

可讀

可寫

說明

name

string

應(yīng)用程序的名稱。

description

string

標(biāo)識(shí)應(yīng)用的描述信息,使用示例:"description": $string: mainability_description"。

descriptionId

number

標(biāo)識(shí)應(yīng)用的描述信息的資源id。

enabled

boolean

判斷應(yīng)用程序是否可以使用,默認(rèn)為true。

label

string

標(biāo)識(shí)應(yīng)用的名稱,使用示例:"label": "$string: mainability_description"。

labelId

number

標(biāo)識(shí)應(yīng)用名稱的資源id。

icon

string

應(yīng)用程序的圖標(biāo),使用示例:"icon": "$media:icon"。

iconId

number

應(yīng)用程序圖標(biāo)的資源id。

process

string

應(yīng)用程序的進(jìn)程,如果不設(shè)置,默認(rèn)為包的名稱。

permissions

Array<string>

訪問應(yīng)用程序所需的權(quán)限,通過調(diào)用bundleManager.getApplicationInfo接口,傳入GET_APPLICATION_INFO_WITH_PERMISSION獲取。

codePath

string

應(yīng)用程序的安裝目錄。

metadata

Map<string, Array<Metadata>>

應(yīng)用程序的元信息,通過調(diào)用bundleManager.getApplicationInfo接口,傳入GET_APPLICATION_INFO_WITH_METADATA獲取。

removable

boolean

應(yīng)用程序是否可以被移除。

accessTokenId

number

應(yīng)用程序的accessTokenId。

uid

number

應(yīng)用程序的uid。

iconResource

Resource

應(yīng)用程序的圖標(biāo)資源信息,通過ApplicationInfo 獲取的resource 包含了該資源的信息的bundleName、moduleName 和 id,可以調(diào)用全球化的接口@ohos.resourceManager.d.ts中的getMediaContent來(lái)獲取詳細(xì)的資源數(shù)據(jù)信息。

labelResource

Resource

應(yīng)用程序的標(biāo)簽資源信息,通過ApplicationInfo 獲取的resource 包含了該資源的信息的bundleName、moduleName 和 id,可以調(diào)用全球化的接口@ohos.resourceManager.d.ts中的getMediaContent來(lái)獲取詳細(xì)的資源數(shù)據(jù)信息。

descriptionResource

Resource

應(yīng)用程序的描述資源信息,通過ApplicationInfo 獲取的resource 包含了該資源的信息的bundleName、moduleName 和 id,可以調(diào)用全球化的接口@ohos.resourceManager.d.ts中的getMediaContent來(lái)獲取詳細(xì)的資源數(shù)據(jù)信息。

appDistributionType

string

應(yīng)用程序簽名證書的分發(fā)類型,分為:app_gallery、enterprise、os_integration和crowdtesting。

appProvisionType

string

應(yīng)用程序簽名證書文件的類型,分為debug和release兩種類型。

systemApp

boolean

標(biāo)識(shí)應(yīng)用是否為系統(tǒng)應(yīng)用。

以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)