harmony(鸿蒙)HarmonyAppProvision Configuration File

2022-08-09 浏览 (1054)

HarmonyAppProvision Configuration File

The HarmonyAppProvision configuration file (also called profile) is the file where you declare permission and signature information for your application.

Configuration File Internal Structure

The HarmonyAppProvision file consists of several parts, which are described in the table below.

Table 1 Internal structure of the HarmonyAppProvision file

NameDescriptionData TypeMandatoryInitial Value Allowed
version-codeVersion number of the HarmonyAppProvision file format. The value is a positive integer containing 32 or less digits.NumberYesNo
version-nameDescription of the version number. It is recommended that the value consist of three segments, for example, A.B.C.StringYesNo
uuidUnique ID of the HarmonyAppProvision file.StringYesNo
typeType of the HarmonyAppProvision file. The value can be debug (for application debugging) or release (for application release). The recommended value is debug.StringYesNo
issuerIssuer of the HarmonyAppProvision file.StringYesNo
validityValidity period of the HarmonyAppProvision file. For details, see Internal Structure of the validity Object.ObjectYesNo
bundle-infoInformation about the application bundle and developer. For details, see Internal Structure of the bundle-info Object.ObjectYesNo
aclsInformation about the Access Control Lists (ACLs). For details, see Internal Structure of the acls Object.ObjectNoNo
permissionsPermissions required for your application. For details, see Internal Structure of the permissions Object.ObjectNoNo
debug-infoAdditional information for application debugging. For details, see Internal Structure of the debug-info Object.ObjectNoNo

An example of the HarmonyAppProvision file is as follows:

{
    "version-code": 1,
    "version-name": "1.0.0",
	"uuid": "string",
	"type": "debug",
	"validity": {
		"not-before": 1586422743,
		"not-after": 1617958743
	},
	"bundle-info" : {
		"developer-id": "OpenHarmony",
		"development-certificate": "Base64 string",
		"distribution-certificate": "Base64 string",
		"bundle-name": "com.OpenHarmony.app.test",
		"apl": "normal",
        "app-feature": "hos_normal_app"
	},
	"acls": {
		"allowed-acls": ["string"]
    },
	"permissions": {
		"restricted-permissions": ["string"]
    },
    "debug-info" : {
	    "device-id-type": "udid",
	    "device-ids": ["string"]
    },
    "issuer": "OpenHarmony"
}

Internal Structure of the validity Object

NameDescriptionData TypeMandatoryInitial Value Allowed
not-beforeStart time of the file validity period. The value is a Unix timestamp, which is a non-negative integer.NumberYesNo
not-afterEnd time of the file validity period. The value is a Unix timestamp, which is a non-negative integer.NumberYesNo

Internal Structure of the bundle-info Object

NameDescriptionData TypeMandatoryInitial Value Allowed
developer-idUnique ID of the developer.StringYesNo
development-certificateInformation about the debug certificate.NumberYes if type is set to debug and no otherwiseNo
distribution-certificateInformation about the release certificate.NumberYes if type is set to release and no otherwiseNo
bundle-nameBundle name of the application.StringYesNo
aplAbility privilege level (APL) of your application. The value can be normal, system_basic, or system_core.StringYesNo
app-featureType of your application. The value can be hos_system_app (system application) or hos_normal_app (non-system application).StringYesNo

Internal Structure of the acls Object

The acls object contains the ACLs configured for your application. It should be noted that you still need to fill the ACL information in the reqPermissions attribute in the config.json file.

Table 4 Internal structure of the acls object

NameDescriptionData TypeMandatoryInitial Value Allowed
allowed-aclsACLs configured for your application.String arrayNoNo

Internal Structure of the permissions Object

The permissions object contains restricted permissions required for your application. Different from the ACLs set in the acls object, these permissions need user authorization during the running of your application. It should be noted that you still need to fill the permission information in the reqPermissions attribute in the config.json file.

Table 5 Internal structure of the permissions object

NameDescriptionData TypeMandatoryInitial Value Allowed
restricted-permissionsRestricted permissions required for your application.String arrayNoNo

Internal Structure of the debug-info Object

The debug-info object contains debugging information of your application, mainly device management and control information.

Table 6 Internal structure of the debug-info object

NameDescriptionData TypeMandatoryInitial Value Allowed
device-id-typeType of the device ID. Currently, only the udid type is supported.StringNoNo
device-idsIDs of devices on which your application can be debugged.String arrayNoNo

你可能感兴趣的鸿蒙文章

harmony(鸿蒙)Quick Start

harmony(鸿蒙)Basic UI Description

harmony(鸿蒙)Dynamic UI Element Building

harmony(鸿蒙)Getting Started with ArkTS

harmony(鸿蒙)Rendering Control

harmony(鸿蒙)Restrictions and Extensions

harmony(鸿蒙)State Management with Application-level Variables

harmony(鸿蒙)Basic Concepts

harmony(鸿蒙)State Management with Page-level Variables

harmony(鸿蒙)DevEco Studio (OpenHarmony) User Guide

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