1e41f4b71Sopenharmony_ci# module对象内部结构
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ci
4e41f4b71Sopenharmony_cimodule对象包含HAP的配置信息。
5e41f4b71Sopenharmony_ci
6e41f4b71Sopenharmony_ci **表1** **module对象内部结构说明**
7e41f4b71Sopenharmony_ci
8e41f4b71Sopenharmony_ci| 属性名称 | 含义 | 数据类型 | 是否可缺省 |
9e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- |
10e41f4b71Sopenharmony_ci| mainAbility | 服务中心图标露出的Ability,常驻进程拉起时会启动mainAbility。 | 字符串 | 可缺省,缺省值为空。 |
11e41f4b71Sopenharmony_ci| package | 标识HAP的包结构名称,在应用内保证唯一性。采用反向域名格式(建议与HAP的工程目录保持一致)。字符串长度为1-127个字节。 | 字符串 | 不可缺省。 |
12e41f4b71Sopenharmony_ci| name | 标识HAP的类名。采用反向域名方式标识,前缀要与同级的package标签指定的包名一致,也可采用"."开头的命名方式。字符串长度不超过255字节。 | 字符串 | 可缺省,缺省值为空。 |
13e41f4b71Sopenharmony_ci| description | 标识HAP的描述信息。字符串长度不超过255字节。如果字符串超出长度或者需要支持多语言,可以采用资源索引的方式添加描述内容。 | 字符串 | 可缺省,缺省值为空。 |
14e41f4b71Sopenharmony_ci| supportedModes | 标识应用支持的运行模式,当前只定义了驾驶模式(drive)。该标签只适用于车机。 | 字符串数组 | 可缺省,缺省值为空。 |
15e41f4b71Sopenharmony_ci|deviceType | <!--RP1-->标识允许Ability运行的设备类型。系统预定义的设备类型包括:tablet(平板)、tv(智慧屏)、car(车机)、wearable(智能穿戴)等。<!--RP1End--> | 字符串数组 | 不可缺省。 |
16e41f4b71Sopenharmony_ci|distro | 标识HAP发布的具体描述。 | 对象 | 不可缺省。 |
17e41f4b71Sopenharmony_ci|metaData | 标识HAP的元信息。 | 对象 | 可缺省,缺省值为空。 |
18e41f4b71Sopenharmony_ci| abilities | 标识当前模块内的所有Ability。采用对象数据格式。 | 对象数组 | 可缺省,缺省值为空。 |
19e41f4b71Sopenharmony_ci| js | 标识基于ArkUI框架开发的JS模块集合,其中的每个元素代表一个JS模块的信息。 | 对象数组 | 可缺省,缺省值为空。 |
20e41f4b71Sopenharmony_ci| shortcuts | 标识应用的快捷方式信息。采用对象数组格式,其中的每个元素表示一个快捷方式对象。 | 对象数组 | 可缺省,缺省值为空。 |
21e41f4b71Sopenharmony_ci| reqPermissions | 标识应用运行时向系统申请的权限。 | 对象数组 | 可缺省,缺省值为空。 |
22e41f4b71Sopenharmony_ci| colorMode | 标识应用自身的颜色模式,目前支持如下三种模式:<br/>-&nbsp;dark:表示按照深色模式选取资源。<br/>-&nbsp;light:表示按照浅色模式选取资源。<br/>-&nbsp;auto:表示跟随系统的颜色模式值选取资源。 | 字符串 | 可缺省,缺省值为"auto"。 |
23e41f4b71Sopenharmony_ci| distroFilter | 该标签下的子标签均为可选字段,用于定义HAP对应的细分设备规格的分发策略,以便应用市场在云端分发HAP时做精准匹配。该标签需要配置在/resource/profile资源目录下;在进行分发时,通过deviceType与下表属性的匹配关系,唯一确定一个用于分发到设备的HAP。 | 对象 | 可缺省,缺省值为空。但当应用中包含多个entry模块时,必须配置该标签。 |
24e41f4b71Sopenharmony_ci|commonEvents | 定义了公共事件静态订阅者的信息,该字段中需要声明静态订阅者的名称、权限要求及订阅事件列表信息,当订阅的公共事件发送时,该公共事件静态订阅者将被拉起。这里的静态订阅者区分于常用的动态订阅者,前者无需在业务代码中主动调用订阅事件的接口,在公共事件发布时可能未被拉起,而动态订阅者则在业务代码中主动调用公共事件订阅的相关API,因此需要应用处于活动状态。 | 对象数组 | 可缺省,缺省为空。 |
25e41f4b71Sopenharmony_ci| entryTheme | 此标签标识系统内部主题的关键字。将标记值设置为名称的资源索引。 | 字符串 | 可缺省,缺省值为空。 |
26e41f4b71Sopenharmony_ci|testRunner | 此标签用于支持对测试框架的配置。 | 对象 | 可缺省,缺省值为空。 |
27e41f4b71Sopenharmony_ci|generateBuildHash |标识当前HAP/HSP是否由打包工具生成哈希值。如果存在,则在系统OTA升级但应用的[version下的code](./app-structure.md#version对象内部结构)保持不变时,可根据哈希值判断应用是否需要升级。**<br/>注:该字段仅对预置应用生效。**|布尔值|该标签可缺省, 缺省值为false。|
28e41f4b71Sopenharmony_ci|libIsolation |用于区分同应用不同hap下的so文件,以防止so冲突。<br/>-&nbsp;true:当前hap的so会储存在libs目录中以Module名命名的路径下。<br/>-&nbsp;false:当前hap的so会直接储存在libs目录中。|布尔值|该标签可缺省, 缺省值为false。|
29e41f4b71Sopenharmony_ci
30e41f4b71Sopenharmony_cimodule示例:
31e41f4b71Sopenharmony_ci
32e41f4b71Sopenharmony_ci```json
33e41f4b71Sopenharmony_ci{
34e41f4b71Sopenharmony_ci  "module": {
35e41f4b71Sopenharmony_ci    "mainAbility": ".EntryAbility",
36e41f4b71Sopenharmony_ci    "deviceType": [
37e41f4b71Sopenharmony_ci      "default",
38e41f4b71Sopenharmony_ci      "tablet"
39e41f4b71Sopenharmony_ci    ],
40e41f4b71Sopenharmony_ci    "abilities": [
41e41f4b71Sopenharmony_ci      {
42e41f4b71Sopenharmony_ci        "skills": [
43e41f4b71Sopenharmony_ci          {
44e41f4b71Sopenharmony_ci            "entities": [
45e41f4b71Sopenharmony_ci              "entity.system.home"
46e41f4b71Sopenharmony_ci            ],
47e41f4b71Sopenharmony_ci            "actions": [
48e41f4b71Sopenharmony_ci              "action.system.home"
49e41f4b71Sopenharmony_ci            ]
50e41f4b71Sopenharmony_ci          }
51e41f4b71Sopenharmony_ci        ],
52e41f4b71Sopenharmony_ci        "orientation": "unspecified",
53e41f4b71Sopenharmony_ci        "visible": true,
54e41f4b71Sopenharmony_ci        "srcPath": "EntryAbility",
55e41f4b71Sopenharmony_ci        "name": ".EntryAbility",
56e41f4b71Sopenharmony_ci        "srcLanguage": "ets",
57e41f4b71Sopenharmony_ci        "icon": "$media:icon",
58e41f4b71Sopenharmony_ci        "description": "$string:MainAbility_desc",
59e41f4b71Sopenharmony_ci        "formsEnabled": false,
60e41f4b71Sopenharmony_ci        "label": "$string:MainAbility_label",
61e41f4b71Sopenharmony_ci        "type": "page",
62e41f4b71Sopenharmony_ci        "launchType": "multiton"
63e41f4b71Sopenharmony_ci      }
64e41f4b71Sopenharmony_ci    ],
65e41f4b71Sopenharmony_ci    "distro": {
66e41f4b71Sopenharmony_ci      "moduleType": "entry",
67e41f4b71Sopenharmony_ci      "installationFree": false,
68e41f4b71Sopenharmony_ci      "deliveryWithInstall": true,
69e41f4b71Sopenharmony_ci      "moduleName": "entry"
70e41f4b71Sopenharmony_ci    },
71e41f4b71Sopenharmony_ci    "package": "com.example.entry",
72e41f4b71Sopenharmony_ci    "srcPath": "",
73e41f4b71Sopenharmony_ci    "name": ".entry",
74e41f4b71Sopenharmony_ci    "js": [
75e41f4b71Sopenharmony_ci      {
76e41f4b71Sopenharmony_ci        "mode": {
77e41f4b71Sopenharmony_ci          "syntax": "ets",
78e41f4b71Sopenharmony_ci          "type": "pageAbility"
79e41f4b71Sopenharmony_ci        },
80e41f4b71Sopenharmony_ci        "pages": [
81e41f4b71Sopenharmony_ci          "pages/Index"
82e41f4b71Sopenharmony_ci        ],
83e41f4b71Sopenharmony_ci        "name": ".EntryAbility",
84e41f4b71Sopenharmony_ci        "window": {
85e41f4b71Sopenharmony_ci          "designWidth": 720,
86e41f4b71Sopenharmony_ci          "autoDesignWidth": false
87e41f4b71Sopenharmony_ci        }
88e41f4b71Sopenharmony_ci      }
89e41f4b71Sopenharmony_ci    ]
90e41f4b71Sopenharmony_ci  }
91e41f4b71Sopenharmony_ci}
92e41f4b71Sopenharmony_ci```
93e41f4b71Sopenharmony_ci
94e41f4b71Sopenharmony_ci## distro对象内部结构
95e41f4b71Sopenharmony_ci
96e41f4b71Sopenharmony_ci**表2** **distro对象内部结构说明**
97e41f4b71Sopenharmony_ci
98e41f4b71Sopenharmony_ci| 属性名称 | 含义 | 数据类型 | 是否可缺省 |
99e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- |
100e41f4b71Sopenharmony_ci| moduleName | 标识当前HAP的名称,最大长度为31个字节。 在应用升级时,该名称允许修改,但需要应用适配Module相关数据目录的迁移,可使用[文件操作接口](../reference/apis-core-file-kit/js-apis-file-fs.md#fscopydir10)。| 字符串 | 不可缺省。 |
101e41f4b71Sopenharmony_ci| moduleType | 标识当前HAP的类型,包括三种类型:entry、feature和har。 | 字符串 | 不可缺省。 |
102e41f4b71Sopenharmony_ci| installationFree | 标识当前HAP是否支持免安装特性。true:表示支持免安装特性,且符合免安装约束。false:表示不支持免安装特性。另外还需注意:当entry.hap该字段配置为true时,与该entry.hap相关的所有feature.hap该字段也需要配置为true。当entry.hap该字段配置为false时,与该entry.hap相关的各feature.hap该字段可按业务需求配置true或false。 | 布尔值 | 不可缺省。 |
103e41f4b71Sopenharmony_ci| deliveryWithInstall | 标识当前HAP是否在用户主动安装HAP所在应用的时候一起安装。true:&nbsp;安装应用时当前HAP随应用一起下载安装。false:安装应用时当前HAP并不下载安装,后续使用是按需下载。 | 布尔值 | 不可缺省。 |
104e41f4b71Sopenharmony_ci
105e41f4b71Sopenharmony_ci
106e41f4b71Sopenharmony_cidistro示例:
107e41f4b71Sopenharmony_ci
108e41f4b71Sopenharmony_ci```json
109e41f4b71Sopenharmony_ci"distro": {
110e41f4b71Sopenharmony_ci  "moduleName": "ohos_entry",
111e41f4b71Sopenharmony_ci  "moduleType": "entry",
112e41f4b71Sopenharmony_ci  "installationFree": true,
113e41f4b71Sopenharmony_ci  "deliveryWithInstall": true
114e41f4b71Sopenharmony_ci}
115e41f4b71Sopenharmony_ci```
116e41f4b71Sopenharmony_ci
117e41f4b71Sopenharmony_ci## metadata对象内部结构
118e41f4b71Sopenharmony_ci
119e41f4b71Sopenharmony_ci**表3** **metadata对象内部结构说明**
120e41f4b71Sopenharmony_ci
121e41f4b71Sopenharmony_ci| 属性名称 | 含义 | 数据类型 | 是否可缺省 |
122e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- |
123e41f4b71Sopenharmony_ci| parameters | 标识调用Ability时所有调用参数的元信息。每个调用参数的元信息由以下三个标签组成:description、name、type。 | 对象数组 | 可缺省,缺省值为空 |
124e41f4b71Sopenharmony_ci| results | 标识Ability返回值的元信息。每个返回值的元信息由以下三个标签组成:description、name、type。 | 对象数组 | 可缺省,缺省值为空。 |
125e41f4b71Sopenharmony_ci| customizeData | 该标签标识父级组件的自定义元信息,Parameters和results在application不可配。 | 对象数组 | 可缺省,缺省值为空。 |
126e41f4b71Sopenharmony_ci
127e41f4b71Sopenharmony_ci## parameters对象内部结构
128e41f4b71Sopenharmony_ci
129e41f4b71Sopenharmony_ci**表4** **parameters对象内部结构说明**
130e41f4b71Sopenharmony_ci
131e41f4b71Sopenharmony_ci| 属性名称 | 含义 | 数据类型 | 是否可缺省 |
132e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- |
133e41f4b71Sopenharmony_ci| description | 标识对调用参数的描述,可以是表示描述内容的字符串,也可以是对描述内容的资源索引以支持多语言。该标签最大长度为255个字节。 | 字符串 | 可缺省,缺省值为空。 |
134e41f4b71Sopenharmony_ci| name | 标识调用参数的名称。该标签最大长度为255个字节。 | 字符串 | 不可缺省。 |
135e41f4b71Sopenharmony_ci| type | 标识调用参数的类型,如Integer。 | 字符串 | 不可缺省。 |
136e41f4b71Sopenharmony_ci
137e41f4b71Sopenharmony_ci## results对象内部结构
138e41f4b71Sopenharmony_ci
139e41f4b71Sopenharmony_ci**表5** **results对象内部结构说明**
140e41f4b71Sopenharmony_ci
141e41f4b71Sopenharmony_ci| 属性名称 | 含义 | 数据类型 | 是否可缺省 |
142e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- |
143e41f4b71Sopenharmony_ci| description | 标识对返回值的描述,可以是表示描述内容的字符串,也可以是对描述内容的资源索引以支持多语言。该标签最大长度为255个字节。 | 字符串 | 可缺省,缺省值为空。 |
144e41f4b71Sopenharmony_ci| name | 标识返回值的名字。该标签最大长度为255个字节。 | 字符串 | 可缺省,缺省值为空。 |
145e41f4b71Sopenharmony_ci| type | 标识返回值的类型,如Integer。 | 字符串 | 不可缺省 |
146e41f4b71Sopenharmony_ci
147e41f4b71Sopenharmony_ci## customizeData对象的内部结构
148e41f4b71Sopenharmony_ci
149e41f4b71Sopenharmony_ci**表6** **customizeData对象的内部结构说明**
150e41f4b71Sopenharmony_ci
151e41f4b71Sopenharmony_ci| 属性名称 | 含义 | 数据类型 | 是否可缺省 |
152e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- |
153e41f4b71Sopenharmony_ci| name | 标识数据项的键名称,字符串类型(最大长度255字节)。 | 字符串 | 可缺省,缺省值为空。 |
154e41f4b71Sopenharmony_ci| value | 标识数据项的值名称,字符串类型(最大长度255字节)。 | 字符串 | 可缺省,缺省值为空。 |
155e41f4b71Sopenharmony_ci| extra | 标识用户自定义数据格式,标签值为标识该数据的资源的索引值。 | 字符串 | 可缺省,缺省值为空。 |
156e41f4b71Sopenharmony_ci
157e41f4b71Sopenharmony_ci
158e41f4b71Sopenharmony_cimetadata对象示例:
159e41f4b71Sopenharmony_ci
160e41f4b71Sopenharmony_ci```json
161e41f4b71Sopenharmony_ci"metaData": {
162e41f4b71Sopenharmony_ci  "parameters" : [{
163e41f4b71Sopenharmony_ci    "name" : "a test for metadata parameter",
164e41f4b71Sopenharmony_ci    "type" : "Float",
165e41f4b71Sopenharmony_ci    // "$string:parameters_description"为文件资源索引值
166e41f4b71Sopenharmony_ci    "description" : "$string:parameters_description"
167e41f4b71Sopenharmony_ci  }],
168e41f4b71Sopenharmony_ci  "results" : [{
169e41f4b71Sopenharmony_ci    "name" : "a test for metadata result",
170e41f4b71Sopenharmony_ci    "type" : "Float",
171e41f4b71Sopenharmony_ci    "description" : "$string:results_description"
172e41f4b71Sopenharmony_ci  }],
173e41f4b71Sopenharmony_ci  "customizeData" : [{
174e41f4b71Sopenharmony_ci    "name" : "a customizeData",
175e41f4b71Sopenharmony_ci    "value" : "string",
176e41f4b71Sopenharmony_ci    "extra" : "$string:customizeData_description"
177e41f4b71Sopenharmony_ci  }]
178e41f4b71Sopenharmony_ci}
179e41f4b71Sopenharmony_ci```
180e41f4b71Sopenharmony_ci
181e41f4b71Sopenharmony_ci## deviceType标签
182e41f4b71Sopenharmony_ci
183e41f4b71Sopenharmony_ci**表7** **deviceType标签配置说明**
184e41f4b71Sopenharmony_ci
185e41f4b71Sopenharmony_ci<!--RP2-->
186e41f4b71Sopenharmony_ci| 设备类型 | 枚举值 | 说明 |
187e41f4b71Sopenharmony_ci| -------- | -------- | -------- |
188e41f4b71Sopenharmony_ci| 平板 | tablet | - |
189e41f4b71Sopenharmony_ci| 智慧屏 | tv | - |
190e41f4b71Sopenharmony_ci| 智能手表 | wearable | 系统能力较丰富的手表,具备电话功能。 |
191e41f4b71Sopenharmony_ci| 运动表 | litewearable | - |
192e41f4b71Sopenharmony_ci| 车机 | car | - |
193e41f4b71Sopenharmony_ci| 默认设备 | default | 能够使用全部系统能力的设备。 |
194e41f4b71Sopenharmony_ci<!--RP2End-->
195e41f4b71Sopenharmony_ci
196e41f4b71Sopenharmony_ci## abilities对象的内部结构
197e41f4b71Sopenharmony_ci
198e41f4b71Sopenharmony_ci**表8** **abilities对象的内部结构说明**
199e41f4b71Sopenharmony_ci
200e41f4b71Sopenharmony_ci| 属性名称 | 含义 | 数据类型 | 是否可缺省 |
201e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- |
202e41f4b71Sopenharmony_ci| process | 运行应用程序或Ability的进程名称。如果在deviceConfig标记中配置了进程,则应用程序的所有能力都在此进程中运行。您还可以为特定能力设置流程属性,以便该能力可以在此流程中运行。如果此属性设置为与其他应用程序相同的进程名称,则所有这些应用程序可以在同一进程中运行,前提是他们具有相同的联合用户ID和相同的签名。该标签最大字节数为31个字节。 | 字符串 | 可缺省,缺省值为空。 |
203e41f4b71Sopenharmony_ci| name | 标识Ability名称。取值可采用反向域名方式表示,由包名和类名组成,如"com.example.myapplication.EntryAbility";也可采用"."开头的类名方式表示,如".EntryAbility"。<br/>Ability的名称,需在一个应用的范围内保证唯一。说明:在使用DevEco&nbsp;Studio新建项目时,默认生成首个Ability的配置,即"config.json"中"EntryAbility"的配置。如使用其他IDE工具,可自定义名称。该标签最大长度为127个字节。 | 字符串 | 不可缺省 |
204e41f4b71Sopenharmony_ci| description | 标识对Ability的描述。取值可以是描述性内容,也可以是对描述性内容的资源索引,以支持多语言。该标签最大长度为255个字节。 | 字符串 | 可缺省,缺省值为空。 |
205e41f4b71Sopenharmony_ci| icon | 标识Ability图标资源文件的索引。取值示例:$media:ability_icon。如果在该Ability的skills属性中,actions的取值包含&nbsp;"action.system.home",entities取值中包含"entity.system.home",则该Ability的icon将同时作为应用的icon。如果存在多个符合条件的Ability,则取位置靠前的Ability的icon作为应用的icon。<br/>说明:应用的"icon"和"label"是用户可感知配置项,需要区别于当前所有已有的应用"icon"或"label"(至少有一个不同)。 | 字符串 | 可缺省,缺省值为空。 |
206e41f4b71Sopenharmony_ci| label | 标识Ability对用户显示的名称。取值是对该名称的资源索引,支持多语言,例:$string:ability_label。如果在该Ability的skills属性中,actions的取值包含&nbsp;"action.system.home",entities取值中包含"entity.system.home",则该Ability的label将同时作为应用的label。如果存在多个符合条件的Ability,则取位置靠前的Ability的label作为应用的label。<br/>说明:&nbsp;应用的"icon"和"label"是用户可感知配置项,需要区别于当前所有已有的应用"icon"或"label"(至少有一个不同)。该标签为资源文件中定义的字符串的引用,或以"{}"包括的字符串。该标签最大长度为255个字节。 | 字符串 | 可缺省,缺省值为空。 |
207e41f4b71Sopenharmony_ci| uri | 标识Ability的统一资源标识符。该标签最大长度为255个字节。 | 字符串 | 可缺省,对于data类型的Ability不可缺省。 |
208e41f4b71Sopenharmony_ci| launchType | 标识Ability的启动模式,支持"multiton"和"singleton"两种模式:<br/>multiton:表示该Ability可以有多实例。该模式适用于大多数应用场景。<br/>singleton:表示该Ability在所有任务栈中仅可以有一个实例。例如,具有全局唯一性的呼叫来电界面即采用"singleton"模式。该标签仅适用于默认设备、平板、智慧屏、车机、智能穿戴。 | 字符串 | 可缺省,缺省值为"singleton"。 |
209e41f4b71Sopenharmony_ci| visible | 标识Ability是否可以被其他应用调用。<br/>true:可以被其他应用调用。<br/>false:不能被其他应用调用,包括无法被aa工具命令拉起应用。 | 布尔类型 | 可缺省,缺省值为"false"。 |
210e41f4b71Sopenharmony_ci| permissions | 标识其他应用的Ability调用此Ability时需要申请的权限集合,一个数组元素为一个权限名称。通常采用反向域名格式(最大255字节),取值为系统预定义的权限。 | 字符串数组 | 可缺省,缺省值为空。 |
211e41f4b71Sopenharmony_ci|skills | 标识Ability能够接收的want的特征。 | 对象数组 | 可缺省,缺省值为空。 |
212e41f4b71Sopenharmony_ci| deviceCapability | 标识Ability运行时要求设备具有的能力,采用字符串数组的格式表示。该标签为数组,支持最多配置512个元素,单个元素最大字节长度为64。 | 字符串数组 | 可缺省,缺省值为空。 |
213e41f4b71Sopenharmony_ci| metaData | 元数据。 | 对象 | 可缺省,缺省值为空。 |
214e41f4b71Sopenharmony_ci| type | 标识Ability的类型。取值范围如下:<br/>page:表示基于Page模板开发的FA,用于提供与用户交互的能力。<br/>service:表示基于Service模板开发的PA,用于提供后台运行任务的能力。<br/>data:表示基于Data模板开发的PA,用于对外部提供统一的数据访问对象。<br/>CA:表示支持其他应用以窗口方式调起该Ability。 | 字符串 | 不可缺省。 |
215e41f4b71Sopenharmony_ci| orientation | 标识该Ability的显示模式。该标签仅适用于page类型的Ability。取值范围如下:<br/>unspecified:由系统自动判断显示方向。<br/>landscape:横屏模式。<br/>portrait:竖屏模式。<br/>followRecent:跟随栈中最近的应用。 | 字符串 | 可缺省,缺省值为"unspecified"。 |
216e41f4b71Sopenharmony_ci| backgroundModes | 标识后台服务的类型,可以为一个服务配置多个后台服务类型。该标签仅适用于service类型的Ability。取值范围如下:<br/>dataTransfer:通过网络/对端设备进行数据下载、备份、分享、传输等。<br/>audioPlayback:音频播放。<br/>audioRecording:录音。<br/>pictureInPicture:画中画、小窗口播放视频。<br/>voip:音视频电话、VOIP。<br/>location:定位、导航。<br/>bluetoothInteraction:蓝牙扫描、连接、传输。<br/>wifiInteraction:Wi-Fi扫描、连接、传输。<br/>screenFetch:录屏、截屏。<br/>multiDeviceConnection:多设备互联。 | 字符串数组 | 可缺省,缺省值为空。 |
217e41f4b71Sopenharmony_ci| grantPermission | 指定是否可以向Ability内任何数据授予权限。 | 布尔值 | 可缺省,缺省值为空。 |
218e41f4b71Sopenharmony_ci| readPermission | 标识读取Ability的数据所需的权限。该标签仅适用于data类型的Ability。取值为长度不超过255字节的字符串。该标签仅适用于默认设备、平板、智慧屏、车机、智能穿戴。 | 字符串 | 可缺省,缺省为空。 |
219e41f4b71Sopenharmony_ci| writePermission | 标识向Ability写数据所需的权限。该标签仅适用于data类型的Ability。取值为长度不超过255字节的字符串。 | 字符串 | 可缺省,缺省为空。 |
220e41f4b71Sopenharmony_ci| configChanges | 标识Ability关注的系统配置集合。当已关注的配置发生变更后,Ability会收到onConfigurationUpdated回调。取值范围:<br/>mcc:表示IMSI移动设备国家/地区代码(MCC)发生变更。典型场景:检测到SIM并更新MCC。<br/>mnc:IMSI移动设备网络代码(MNC)发生变更。典型场景:检测到SIM并更新MNC。<br/>locale:表示语言区域发生变更。典型场景:用户已为设备文本的文本显示选择新的语言类型。<br/>layout:表示屏幕布局发生变更。典型场景:当前有不同的显示形态都处于活跃状态。<br/>fontSize:表示字号发生变更。典型场景:用户已设置新的全局字号。<br/>orientation:表示屏幕方向发生变更。典型场景:用户旋转设备。<br/>density:表示显示密度发生变更。典型场景:用户可能指定不同的显示比例,或当前有不同的显示形态同时处于活跃状态。<br/>size:显示窗口大小发生变更。<br/>smallestSize:显示窗口较短边的边长发生变更。<br/>colorMode:颜色模式发生变更。 | 字符串数组 | 可缺省,缺省为空。 |
221e41f4b71Sopenharmony_ci| mission | 标识Ability指定的任务栈。该标签仅适用于page类型的Ability。默认情况下应用中所有Ability同属一个任务栈。 | 字符串 | 可缺省,缺省为应用的包名。 |
222e41f4b71Sopenharmony_ci| targetAbility | 标识当前Ability重用的目标Ability。该标签仅适用于page类型的Ability。如果配置了targetAbility属性,则当前Ability(即别名Ability)的属性中仅name、icon、label、visible、permissions、skills生效,其他属性均沿用targetAbility中的属性值。目标Ability必须与别名Ability在同一应用中,且在配置文件中目标Ability必须在别名之前进行声明。 | 字符串 | 可缺省,缺省值为空。表示当前Ability不是一个别名Ability。 |
223e41f4b71Sopenharmony_ci| formsEnabled | 标识Ability是否支持卡片(forms)功能。该标签仅适用于page类型的Ability。<br/>true:支持卡片能力。<br/>false:不支持卡片能力。 | 布尔值 | 可缺省,缺省值为false。 |
224e41f4b71Sopenharmony_ci| forms | 标识服务卡片的属性。该标签仅当formsEnabled为"true"时,才能生效。 | 对象数组 | 可缺省,缺省值为空。 |
225e41f4b71Sopenharmony_ci| srcLanguage | Ability开发语言的类型,开发者创建工程时由开发者手动选择开发语言。取值如下:"js"、"ets"、"java"。 | 字符串 | 可缺省,缺省值为"js"。 |
226e41f4b71Sopenharmony_ci| srcPath | 该标签标识Ability对应的JS组件代码路径,该标签最大长度为127字节。 | 字符串 | 不可缺省。 |
227e41f4b71Sopenharmony_ci| uriPermission | 标识该Ability有权访问的应用程序数据。此属性由模式和路径子属性组成。此属性仅对类型提供者的能力有效。 | 对象 | 可缺省,缺省值为空。 |
228e41f4b71Sopenharmony_ci| startWindowIcon | 标识该Ability启动页面图标资源文件的索引。该标签仅适用于page类型的Ability。取值示例:$media:icon。 | 字符串 | 可缺省,缺省值为空。 |
229e41f4b71Sopenharmony_ci| startWindowBackground | 标识该Ability启动页面背景颜色资源文件的索引。该标签仅适用于page类型的Ability。取值示例:$color:red。 | 字符串 | 可缺省,缺省值为空。 |
230e41f4b71Sopenharmony_ci| removeMissionAfterTerminate | 该标签标识Ability销毁后是否从任务列表中移除任务。该标签仅适用于page类型的Ability。true表示销毁后移除任务,&nbsp;false表示销毁后不移除任务。 | 布尔值 | 可缺省,缺省值为false。 |
231e41f4b71Sopenharmony_ci
232e41f4b71Sopenharmony_ci
233e41f4b71Sopenharmony_ci**不允许应用隐藏入口图标**
234e41f4b71Sopenharmony_ci
235e41f4b71Sopenharmony_ci系统对无图标应用实施严格管控,防止一些恶意应用故意配置无入口图标,导致用户找不到软件所在的位置,无法操作卸载应用,在一定程度上保证用户终端设备的安全。
236e41f4b71Sopenharmony_ci
237e41f4b71Sopenharmony_ci**入口图标的设置:** 需要在配置文件(config.json)中abilities配置下设置icon,label以及skills,而且skills的配置下必须同时包含“ohos.want.action.home” 和 “entity.system.home”。
238e41f4b71Sopenharmony_ci```
239e41f4b71Sopenharmony_ci{
240e41f4b71Sopenharmony_ci  "module":{
241e41f4b71Sopenharmony_ci
242e41f4b71Sopenharmony_ci    ...
243e41f4b71Sopenharmony_ci
244e41f4b71Sopenharmony_ci    "abilities": [{
245e41f4b71Sopenharmony_ci      "icon": "$media:icon",
246e41f4b71Sopenharmony_ci      "label": "Login",
247e41f4b71Sopenharmony_ci      "skills": [{
248e41f4b71Sopenharmony_ci        "actions": ["ohos.want.action.home"],
249e41f4b71Sopenharmony_ci        "entities": ["entity.system.home"],
250e41f4b71Sopenharmony_ci        "uris": []
251e41f4b71Sopenharmony_ci      }]
252e41f4b71Sopenharmony_ci    }],
253e41f4b71Sopenharmony_ci
254e41f4b71Sopenharmony_ci    ...
255e41f4b71Sopenharmony_ci
256e41f4b71Sopenharmony_ci  }
257e41f4b71Sopenharmony_ci}
258e41f4b71Sopenharmony_ci```
259e41f4b71Sopenharmony_ci
260e41f4b71Sopenharmony_ci如果应用确需隐藏入口图标,需要配置AllowAppDesktopIconHide应用特权<!--Del-->,具体配置方式参考[应用特权配置指南](../../device-dev/subsystems/subsys-app-privilege-config-guide.md)<!--DelEnd-->。详细的入口图标及入口标签的显示规则如下。
261e41f4b71Sopenharmony_ci* HAP中包含Page类型的PageAbility
262e41f4b71Sopenharmony_ci  * 配置文件(config.json)中abilities配置中设置了入口图标
263e41f4b71Sopenharmony_ci    * 该应用没有隐藏图标的特权
264e41f4b71Sopenharmony_ci      * 系统将使用该PageAbility配置的icon作为入口图标,并显示在桌面上。用户点击该图标,页面跳转到该PageAbility首页。
265e41f4b71Sopenharmony_ci      * 系统将使用该PageAbility配置的label作为入口标签,并显示在桌面上(如果没有配置label,返回包名)。
266e41f4b71Sopenharmony_ci    * 该应用具有隐藏图标的特权
267e41f4b71Sopenharmony_ci      * 桌面查询时不返回应用信息,不会在桌面上显示对应的入口图标和标签。
268e41f4b71Sopenharmony_ci  * 配置文件(config.json)中abilities配置中未设置入口图标
269e41f4b71Sopenharmony_ci    * 该应用没有隐藏图标的特权
270e41f4b71Sopenharmony_ci      * 系统将使用系统默认图标作为入口图标,并显示在桌面上。用户点击该图标,页面跳转到应用管理中对应的应用详情页面(参考下图)。
271e41f4b71Sopenharmony_ci      * 系统将使用应用的包名作为入口标签,并显示在桌面上。
272e41f4b71Sopenharmony_ci    * 该应用具有隐藏图标的特权
273e41f4b71Sopenharmony_ci      * 桌面查询时不返回应用信息,不会在桌面上显示对应的入口图标和标签。
274e41f4b71Sopenharmony_ci* HAP中不包含Page类型的PageAbility
275e41f4b71Sopenharmony_ci  * 该应用没有隐藏图标的特权
276e41f4b71Sopenharmony_ci    * 系统将使用系统默认图标作为入口图标,并显示在桌面上。用户点击该图标,页面跳转到应用管理中对应的应用详情页面(参考下图)。
277e41f4b71Sopenharmony_ci    * 系统将使用应用的包名作为入口标签,并显示在桌面上。
278e41f4b71Sopenharmony_ci  * 该应用具有隐藏图标的特权
279e41f4b71Sopenharmony_ci    * 桌面查询时不返回应用信息,不会在桌面上显示对应的入口图标和标签。
280e41f4b71Sopenharmony_ci
281e41f4b71Sopenharmony_ci**图1** 应用的详情页示意图
282e41f4b71Sopenharmony_ci
283e41f4b71Sopenharmony_ci![应用的详情页例图](figures/application_details.jpg)
284e41f4b71Sopenharmony_ci
285e41f4b71Sopenharmony_ci注:应用详情页面中显示的label可能与桌面上显示的不同。如果非Page类型的PageAbility配置了入口图标和label,那么详情页中显示的即为配置的。<br>
286e41f4b71Sopenharmony_ci## uriPermission对象的内部结构
287e41f4b71Sopenharmony_ci
288e41f4b71Sopenharmony_ci**表9** **uriPermission对象的内部结构说明**
289e41f4b71Sopenharmony_ci
290e41f4b71Sopenharmony_ci| 属性名称 | 含义 | 数据类型 | 是否可缺省 |
291e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- |
292e41f4b71Sopenharmony_ci| path | uriPermission标识的路径,该标签最大字节长度为255个字节。 | 字符串 | 不可缺省。 |
293e41f4b71Sopenharmony_ci| mode | uriPermission的匹配模式。 | 字符串 | 可缺省,缺省值为default。 |
294e41f4b71Sopenharmony_ci
295e41f4b71Sopenharmony_ci
296e41f4b71Sopenharmony_ciabilities示例:
297e41f4b71Sopenharmony_ci
298e41f4b71Sopenharmony_ci```json
299e41f4b71Sopenharmony_ci"abilities": [
300e41f4b71Sopenharmony_ci  {
301e41f4b71Sopenharmony_ci    "name": ".EntryAbility",
302e41f4b71Sopenharmony_ci    "description": "test main ability",
303e41f4b71Sopenharmony_ci    // $media:ic_launcher 为媒体类资源
304e41f4b71Sopenharmony_ci    "icon": "$media:ic_launcher",
305e41f4b71Sopenharmony_ci    // $string:example 为字符串类资源
306e41f4b71Sopenharmony_ci    "label": "$string:example",
307e41f4b71Sopenharmony_ci    "launchType": "multiton",
308e41f4b71Sopenharmony_ci    "orientation": "unspecified",
309e41f4b71Sopenharmony_ci    "permissions": [],
310e41f4b71Sopenharmony_ci    "visible": true,
311e41f4b71Sopenharmony_ci    "skills": [
312e41f4b71Sopenharmony_ci      {
313e41f4b71Sopenharmony_ci        "actions": [
314e41f4b71Sopenharmony_ci          "action.system.home"
315e41f4b71Sopenharmony_ci        ],
316e41f4b71Sopenharmony_ci        "entities": [
317e41f4b71Sopenharmony_ci          "entity.system.home"
318e41f4b71Sopenharmony_ci        ]
319e41f4b71Sopenharmony_ci      }
320e41f4b71Sopenharmony_ci    ],
321e41f4b71Sopenharmony_ci    "configChanges": [
322e41f4b71Sopenharmony_ci      "locale",
323e41f4b71Sopenharmony_ci      "layout",
324e41f4b71Sopenharmony_ci      "fontSize",
325e41f4b71Sopenharmony_ci      "orientation"
326e41f4b71Sopenharmony_ci    ],
327e41f4b71Sopenharmony_ci    "type": "page",
328e41f4b71Sopenharmony_ci    "startWindowIcon": "$media:icon",
329e41f4b71Sopenharmony_ci    "startWindowBackground": "$color:red",
330e41f4b71Sopenharmony_ci    "removeMissionAfterTerminate": true
331e41f4b71Sopenharmony_ci  },
332e41f4b71Sopenharmony_ci  {
333e41f4b71Sopenharmony_ci    "name": ".PlayService",
334e41f4b71Sopenharmony_ci    "description": "example play ability",
335e41f4b71Sopenharmony_ci    "icon": "$media:ic_launcher",
336e41f4b71Sopenharmony_ci    "label": "$string:example",
337e41f4b71Sopenharmony_ci    "launchType": "multiton",
338e41f4b71Sopenharmony_ci    "orientation": "unspecified",
339e41f4b71Sopenharmony_ci    "visible": false,
340e41f4b71Sopenharmony_ci    "skills": [
341e41f4b71Sopenharmony_ci      {
342e41f4b71Sopenharmony_ci        "actions": [
343e41f4b71Sopenharmony_ci          "action.play.music",
344e41f4b71Sopenharmony_ci          "action.stop.music"
345e41f4b71Sopenharmony_ci        ],
346e41f4b71Sopenharmony_ci        "entities": [
347e41f4b71Sopenharmony_ci          "entity.audio"
348e41f4b71Sopenharmony_ci        ]
349e41f4b71Sopenharmony_ci      }
350e41f4b71Sopenharmony_ci    ],
351e41f4b71Sopenharmony_ci    "type": "service",
352e41f4b71Sopenharmony_ci    "backgroundModes": [
353e41f4b71Sopenharmony_ci      "audioPlayback"
354e41f4b71Sopenharmony_ci    ]
355e41f4b71Sopenharmony_ci  },
356e41f4b71Sopenharmony_ci  {
357e41f4b71Sopenharmony_ci    "name": ".UserADataAbility",
358e41f4b71Sopenharmony_ci    "type": "data",
359e41f4b71Sopenharmony_ci    "uri": "dataability://com.example.world.test.UserADataAbility",
360e41f4b71Sopenharmony_ci    "visible": true
361e41f4b71Sopenharmony_ci  }
362e41f4b71Sopenharmony_ci]
363e41f4b71Sopenharmony_ci```
364e41f4b71Sopenharmony_ci## skills对象的内部结构
365e41f4b71Sopenharmony_ci
366e41f4b71Sopenharmony_ci**表10** **skills对象的内部结构说明**
367e41f4b71Sopenharmony_ci
368e41f4b71Sopenharmony_ci| 属性名称 | 含义 | 数据类型 | 是否可缺省 |
369e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- |
370e41f4b71Sopenharmony_ci| actions | 标识能够接收的want的action值,可以包含一个或多个action。取值通常为系统预定义的action值。 | 字符串数组 | 可缺省,缺省值为空。 |
371e41f4b71Sopenharmony_ci| entities | 标识能够接收的want的Ability的类别(如视频、桌面应用等),可以包含一个或多个entity。 | 字符串数组 | 可缺省,缺省值为空。 |
372e41f4b71Sopenharmony_ci| uris | 该标签标识向want过滤器添加数据规范集合。该规范可以是只有数据类型(mimeType属性),可以是只有URI,也可以是既有数据类型又有URI。<br/>URI由其各个部分的单独属性指定:&lt;scheme&gt;://&lt;host&gt;:&lt;port&gt;[&lt;path&gt;\|&lt;pathStartWith&gt;\|&lt;pathRegex&gt;]。该标签可缺省,缺省值为空。<br/>其中,scheme字段配置为uri时必配;当只设置数据类型(mimeType)时,则scheme字段为非必配项。 | 对象数组 | 可缺省,缺省值为空。 |
373e41f4b71Sopenharmony_ci
374e41f4b71Sopenharmony_ci## uris对象的内部结构
375e41f4b71Sopenharmony_ci
376e41f4b71Sopenharmony_ci**表11** **uris对象的内部结构说明**
377e41f4b71Sopenharmony_ci
378e41f4b71Sopenharmony_ci| 属性名称 | 含义 | 数据类型 | 是否可缺省 |
379e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- |
380e41f4b71Sopenharmony_ci| scheme | 标识uri的scheme值。 | 字符串 | 不可缺省。 |
381e41f4b71Sopenharmony_ci| host | 标识uri的host值。 | 字符串 | 可缺省,缺省值为空。 |
382e41f4b71Sopenharmony_ci| port | 标识uri的port值。 | 字符串 | 可缺省,缺省值为空。 |
383e41f4b71Sopenharmony_ci| pathStartWith | 标识uri的pathStartWith值。 | 字符串 | 可缺省,缺省值为空。 |
384e41f4b71Sopenharmony_ci| path | 标识uri的path值。 | 字符串 | 可缺省,缺省值为空。 |
385e41f4b71Sopenharmony_ci| pathRegx | 标识uri的pathRegx值。 | 字符串 | 可缺省,缺省值为空。 |
386e41f4b71Sopenharmony_ci| type | 标识uri的type值。type为MIME-TYPE属性,为资源的媒体类型,常见的类型有"audio/aac","text/css"等。<br/>注意:只支持*/*、mainType/*的通配符格式,不支持mainType/subType.*的通配符格式,mainType为标准媒体类型。| 字符串 | 可缺省,缺省值为空。 |
387e41f4b71Sopenharmony_ci
388e41f4b71Sopenharmony_ci
389e41f4b71Sopenharmony_ciskills示例:
390e41f4b71Sopenharmony_ci
391e41f4b71Sopenharmony_ci```json
392e41f4b71Sopenharmony_ci"skills": [
393e41f4b71Sopenharmony_ci  {
394e41f4b71Sopenharmony_ci    "actions": [
395e41f4b71Sopenharmony_ci      "action.system.home"
396e41f4b71Sopenharmony_ci    ],
397e41f4b71Sopenharmony_ci    "entities": [
398e41f4b71Sopenharmony_ci      "entity.system.home"
399e41f4b71Sopenharmony_ci    ],
400e41f4b71Sopenharmony_ci    "uris": [
401e41f4b71Sopenharmony_ci      {
402e41f4b71Sopenharmony_ci        "scheme": "http",
403e41f4b71Sopenharmony_ci        "host": "www.example.com",
404e41f4b71Sopenharmony_ci        "port": "8080",
405e41f4b71Sopenharmony_ci        "path": "query/student/name",
406e41f4b71Sopenharmony_ci        "type": "text/*"
407e41f4b71Sopenharmony_ci      }
408e41f4b71Sopenharmony_ci    ]
409e41f4b71Sopenharmony_ci  }
410e41f4b71Sopenharmony_ci]
411e41f4b71Sopenharmony_ci```
412e41f4b71Sopenharmony_ci
413e41f4b71Sopenharmony_ci## reqPermissions权限申请
414e41f4b71Sopenharmony_ci
415e41f4b71Sopenharmony_ci**表12** **reqPermissions权限申请字段说明**
416e41f4b71Sopenharmony_ci
417e41f4b71Sopenharmony_ci| 属性名称 | 含义 | 数据类型 | 是否可缺省 |
418e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- |
419e41f4b71Sopenharmony_ci| name | 需要使用的权限名称。 | 字符串 | 否 |
420e41f4b71Sopenharmony_ci| reason | 描述申请权限的原因。需要做多语种适配。 | 字符串 | 分情况:当申请的权限为user_grant时,必须填写此字段,否则不允许在应用市场上架;其他权限可缺省,缺省为空 |
421e41f4b71Sopenharmony_ci| usedScene | 描述权限使用的场景和时机。场景类型如下两种:<br/>-&nbsp;ability:ability的名称,可配置多个。<br/>-&nbsp;when:调用时机,可填的值有inuse(使用时)、always(始终)。 | 对象 | 可缺省,缺省值为空。<br/>when可缺省,缺省值为"inuse" |
422e41f4b71Sopenharmony_ci
423e41f4b71Sopenharmony_ci## usedScene对象内部结构
424e41f4b71Sopenharmony_ci
425e41f4b71Sopenharmony_ci**表13** **usedScene对象内部结构说明**
426e41f4b71Sopenharmony_ci
427e41f4b71Sopenharmony_ci| 属性名称 | 含义 | 数据类型 | 是否可缺省 |
428e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- |
429e41f4b71Sopenharmony_ci| ability | 标识哪些Ability需要此权限,里面配置Ability的名称。 | 字符串数组 | 可以缺省,缺省表示所有Ability都需要此权限。 |
430e41f4b71Sopenharmony_ci| when | 标识此权限的使用时间:<br/>inuse:&nbsp;使用时需要此权限。<br/>always:&nbsp;所有时间都需要此权限。 | 枚举值 | 可缺省,缺省值为空。 |
431e41f4b71Sopenharmony_ci
432e41f4b71Sopenharmony_ci## js对象的内部结构
433e41f4b71Sopenharmony_ci
434e41f4b71Sopenharmony_ci**表14** **js对象的内部结构说明**
435e41f4b71Sopenharmony_ci
436e41f4b71Sopenharmony_ci| 属性名称 | 含义 | 数据类型 | 是否可缺省 |
437e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- |
438e41f4b71Sopenharmony_ci| name | 标识JS&nbsp;Component的名字。 | 字符串 | 不可缺省。 |
439e41f4b71Sopenharmony_ci| pages | 标识JS&nbsp;Component的页面用于列举JS&nbsp;Component中每个页面的路由信息,格式为“页面路径+页面名称”。其中,页面路径是以当前Ability的srcPath字段取值为基准,例如srcPath取值为EntryAbility,则JS Component页面路径需要从EntryAbility的下一层开始描述。该标签取值为数组,数组第一个元素代表JS&nbsp;FA首页。 | 字符串数组 | 不可缺省。 |
440e41f4b71Sopenharmony_ci| window | 用于定义与显示窗口相关的配置。 | 对象 | 可缺省,缺省值见表15。 |
441e41f4b71Sopenharmony_ci| type | 标识JS应用的类型。取值范围如下:<br/>normal:标识该JS&nbsp;Component为应用实例。<br/>form:标识该JS&nbsp;Component为卡片实例。 | 字符串 | 可缺省,缺省值为"normal"。 |
442e41f4b71Sopenharmony_ci|mode | 定义JS组件的开发模式。 | 对象 | 可缺省,缺省值为空。 |
443e41f4b71Sopenharmony_ci
444e41f4b71Sopenharmony_ci## window对象的内部结构
445e41f4b71Sopenharmony_ci
446e41f4b71Sopenharmony_ci**表15** **window对象的内部结构说明**
447e41f4b71Sopenharmony_ci
448e41f4b71Sopenharmony_ci| 属性名称 | 含义 | 数据类型 | 是否可缺省 |
449e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- |
450e41f4b71Sopenharmony_ci| designWidth | 标识页面设计基准宽度。以此为基准,根据实际设备宽度来缩放元素大小。 | 数值 | 可缺省,缺省值为720px。 |
451e41f4b71Sopenharmony_ci| autoDesignWidth | 标识页面设计基准宽度是否自动计算。当配置为true时,designWidth将会被忽略,设计基准宽度由设备宽度与屏幕密度计算得出。 | 布尔值 | 可缺省,缺省值为false。 |
452e41f4b71Sopenharmony_ci
453e41f4b71Sopenharmony_ci## mode对象的内部结构
454e41f4b71Sopenharmony_ci
455e41f4b71Sopenharmony_ci**表16** **mode对象的内部结构说明**
456e41f4b71Sopenharmony_ci
457e41f4b71Sopenharmony_ci| 属性名称 | 含义 | 数据类型 | 是否可缺省 |
458e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- |
459e41f4b71Sopenharmony_ci| type | 定义JS组件的功能类型。 | 字符串,取值为"pageAbility"、"form" | 可缺省,缺省值为pageAbility。 |
460e41f4b71Sopenharmony_ci| syntax | 定义JS组件的语法类型。 | 字符串,取值为"hml","ets" | 可缺省,默认值为"hml"。 |
461e41f4b71Sopenharmony_ci
462e41f4b71Sopenharmony_ci
463e41f4b71Sopenharmony_cijs示例:
464e41f4b71Sopenharmony_ci
465e41f4b71Sopenharmony_ci```json
466e41f4b71Sopenharmony_ci"js": [
467e41f4b71Sopenharmony_ci  {
468e41f4b71Sopenharmony_ci    "name": ".EntryAbility",
469e41f4b71Sopenharmony_ci    "pages": [
470e41f4b71Sopenharmony_ci      "pages/index",
471e41f4b71Sopenharmony_ci      "pages/detail/detail"
472e41f4b71Sopenharmony_ci    ],
473e41f4b71Sopenharmony_ci    "window": {
474e41f4b71Sopenharmony_ci      "designWidth": 720,
475e41f4b71Sopenharmony_ci      "autoDesignWidth": false
476e41f4b71Sopenharmony_ci    },
477e41f4b71Sopenharmony_ci    "type": "form",
478e41f4b71Sopenharmony_ci    "mode": {
479e41f4b71Sopenharmony_ci      "syntax": "ets",
480e41f4b71Sopenharmony_ci      "type": "pageAbility"
481e41f4b71Sopenharmony_ci    }
482e41f4b71Sopenharmony_ci  }
483e41f4b71Sopenharmony_ci]
484e41f4b71Sopenharmony_ci```
485e41f4b71Sopenharmony_ci
486e41f4b71Sopenharmony_ci## shortcuts对象的内部结构
487e41f4b71Sopenharmony_ci
488e41f4b71Sopenharmony_ci**表17** **shortcuts对象的内部结构说明**
489e41f4b71Sopenharmony_ci
490e41f4b71Sopenharmony_ci| 属性名称 | 含义 | 数据类型 | 是否可缺省 |
491e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- |
492e41f4b71Sopenharmony_ci| shortcutId | 标识快捷方式的ID。字符串的最大长度为63字节。 | 字符串 | 不可缺省。 |
493e41f4b71Sopenharmony_ci| label | 标识快捷方式的标签信息,即快捷方式对外显示的文字描述信息。取值可以是描述性内容,也可以是标识label的资源索引。字符串最大长度为63字节。 | 字符串 | 可缺省,缺省为空。 |
494e41f4b71Sopenharmony_ci| icon | 标识快捷方式的图标信息。取值为表示icon的资源索引。 | 字符串 | 可缺省,缺省为空。 |
495e41f4b71Sopenharmony_ci| intents | 标识快捷方式内定义的目标intent信息集合,每个intent可配置两个子标签,targetClass,&nbsp;targetBundle。 | 对象数组 | 可缺省,缺省为空。 |
496e41f4b71Sopenharmony_ci
497e41f4b71Sopenharmony_ci## intents对象的内部结构
498e41f4b71Sopenharmony_ci
499e41f4b71Sopenharmony_ci**表18** **intents对象的内部结构说明**
500e41f4b71Sopenharmony_ci
501e41f4b71Sopenharmony_ci| 属性名称 | 含义 | 数据类型 | 是否可缺省 |
502e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- |
503e41f4b71Sopenharmony_ci| targetClass | 标识快捷方式目标类名。 | 字符串 | 可缺省,缺省值为空。 |
504e41f4b71Sopenharmony_ci| targetBundle | 标识快捷方式目标Ability所在应用的包名。 | 字符串 | 可缺省,缺省值为空。 |
505e41f4b71Sopenharmony_ci
506e41f4b71Sopenharmony_ci
507e41f4b71Sopenharmony_cishortcuts示例:
508e41f4b71Sopenharmony_ci
509e41f4b71Sopenharmony_ci```json
510e41f4b71Sopenharmony_ci"shortcuts": [
511e41f4b71Sopenharmony_ci  {
512e41f4b71Sopenharmony_ci    "shortcutId": "id",
513e41f4b71Sopenharmony_ci    // $string:shortcut 为配置的字符串资源值
514e41f4b71Sopenharmony_ci    "label": "$string:shortcut",
515e41f4b71Sopenharmony_ci    "intents": [
516e41f4b71Sopenharmony_ci      {
517e41f4b71Sopenharmony_ci        "targetBundle": "com.example.world.test",
518e41f4b71Sopenharmony_ci        "targetClass": "com.example.world.test.entry.EntryAbility"
519e41f4b71Sopenharmony_ci      }
520e41f4b71Sopenharmony_ci    ]
521e41f4b71Sopenharmony_ci  }
522e41f4b71Sopenharmony_ci]
523e41f4b71Sopenharmony_ci```
524e41f4b71Sopenharmony_ci
525e41f4b71Sopenharmony_ci## forms对象的内部结构
526e41f4b71Sopenharmony_ci
527e41f4b71Sopenharmony_ci**表19** **forms对象的内部结构说明**
528e41f4b71Sopenharmony_ci
529e41f4b71Sopenharmony_ci| 属性名称 | 含义 | 数据类型 | 是否可缺省 |
530e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- |
531e41f4b71Sopenharmony_ci| name | 标识卡片的类名。字符串最大长度为127字节。 | 字符串 | 不可缺省。 |
532e41f4b71Sopenharmony_ci| description | 标识卡片的描述。取值可以是描述性内容,也可以是对描述性内容的资源索引,以支持多语言。字符串最大长度为255字节。 | 字符串 | 可缺省,缺省为空。 |
533e41f4b71Sopenharmony_ci| isDefault | 标识该卡片是否为默认卡片,每个Ability有且只有一个默认卡片。<br/>true:默认卡片。<br/>false:非默认卡片。 | 布尔值 | 不可缺省。 |
534e41f4b71Sopenharmony_ci| type | 标识卡片的类型。取值范围如下:<br/>JS:JS卡片。<br/>Java:Java卡片。 | 字符串 | 不可缺省。 |
535e41f4b71Sopenharmony_ci| colorMode | 标识卡片的主题样式,取值范围如下:<br/>auto:自适应。<br/>dark:深色主题。<br/>light:浅色主题。 | 字符串 | 可缺省,缺省值为"auto"。 |
536e41f4b71Sopenharmony_ci| supportDimensions | 标识卡片支持的外观规格,取值范围:<br/>1&nbsp;\*&nbsp;2:表示1行2列的二宫格。<br/>2&nbsp;\*&nbsp;1:表示2行1列的二宫格。<br/>2&nbsp;\*&nbsp;2:表示2行2列的四宫格。<br/>2&nbsp;\*&nbsp;4:表示2行4列的八宫格。<br/>4&nbsp;\*&nbsp;4:表示4行4列的十六宫格。 | 字符串数组 | 不可缺省。 |
537e41f4b71Sopenharmony_ci| defaultDimension | 标识卡片的默认外观规格,取值必须在该卡片supportDimensions配置的列表中。 | 字符串 | 不可缺省。 |
538e41f4b71Sopenharmony_ci| updateEnabled | 标识卡片是否支持周期性刷新,取值范围:<br/>true:表示支持周期性刷新,可以在定时刷新(updateDuration)和定点刷新(scheduledUpdateTime)两种方式任选其一,优先选择定时刷新。<br/>false:表示不支持周期性刷新。 | 布尔类型 | 不可缺省。 |
539e41f4b71Sopenharmony_ci| scheduledUpdateTime | 标识卡片的定点刷新的时刻,采用24小时制,精确到分钟。 | 字符串 | 可缺省,缺省值为"0:0"。 |
540e41f4b71Sopenharmony_ci| updateDuration | 标识卡片定时刷新的更新周期,单位为30分钟,取值为自然数。<br/>当取值为0时,表示该参数不生效。<br/>当取值为正整数N时,表示刷新周期为30\*N分钟。 | 数值 | 可缺省,缺省值为"0"。 |
541e41f4b71Sopenharmony_ci| formConfigAbility | 标识用于调整卡片的设施或活动的名称。 | 字符串 | 可缺省,缺省值为空。 |
542e41f4b71Sopenharmony_ci| jsComponentName | 标识JS卡片的Component名称。字符串最大长度为127字节。仅当卡片类型为JS卡片时,需要配置该标签。 | 字符串 | 可缺省,缺省值为空。 |
543e41f4b71Sopenharmony_ci| metaData | 标识卡片的自定义信息,包含customizeData数组标签。 | 对象 | 可缺省,缺省值为空。 |
544e41f4b71Sopenharmony_ci| formVisibleNotify | 标识是否允许卡片使用卡片可见性通知。<br/>true:允许。<br/>false:不允许。 | 布尔值 | 可缺省,缺省值为false。 |
545e41f4b71Sopenharmony_ci
546e41f4b71Sopenharmony_ci## customizeData对象内部结构
547e41f4b71Sopenharmony_ci
548e41f4b71Sopenharmony_ci**表20** **customizeData对象内部结构说明**
549e41f4b71Sopenharmony_ci
550e41f4b71Sopenharmony_ci| 属性名称 | 含义 | 数据类型 | 是否可缺省 |
551e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- |
552e41f4b71Sopenharmony_ci| name | 标识数据项的键名称。字符串最大长度为255字节。 | 字符串 | 可缺省,缺省值为空。 |
553e41f4b71Sopenharmony_ci| value | 标识数据项的值。字符串最大长度为255字节。 | 字符串 | 可缺省,缺省值为空。 |
554e41f4b71Sopenharmony_ci| extra | 标识当前custom数据的格式,取值为表示extra的资源值。 | 字符串 | 可缺省,缺省值为空。 |
555e41f4b71Sopenharmony_ci
556e41f4b71Sopenharmony_ci
557e41f4b71Sopenharmony_ciforms示例:
558e41f4b71Sopenharmony_ci
559e41f4b71Sopenharmony_ci```json
560e41f4b71Sopenharmony_ci"forms": [
561e41f4b71Sopenharmony_ci  {
562e41f4b71Sopenharmony_ci    "name": "Form_Js",
563e41f4b71Sopenharmony_ci    "description": "It's Js Form",
564e41f4b71Sopenharmony_ci    "type": "JS",
565e41f4b71Sopenharmony_ci    "jsComponentName": "card",
566e41f4b71Sopenharmony_ci    "colorMode": "auto",
567e41f4b71Sopenharmony_ci    "isDefault": true,
568e41f4b71Sopenharmony_ci    "updateEnabled": true,
569e41f4b71Sopenharmony_ci    "scheduledUpdateTime": "11:00",
570e41f4b71Sopenharmony_ci    "updateDuration": 1,
571e41f4b71Sopenharmony_ci    "defaultDimension": "2*2",
572e41f4b71Sopenharmony_ci    "supportDimensions": [
573e41f4b71Sopenharmony_ci      "2*2",
574e41f4b71Sopenharmony_ci      "2*4",
575e41f4b71Sopenharmony_ci      "4*4"
576e41f4b71Sopenharmony_ci    ]
577e41f4b71Sopenharmony_ci  },
578e41f4b71Sopenharmony_ci  {
579e41f4b71Sopenharmony_ci    "name": "Form_Js",
580e41f4b71Sopenharmony_ci    "description": "It's JS Form",
581e41f4b71Sopenharmony_ci    "type": "Js",
582e41f4b71Sopenharmony_ci    "colorMode": "auto",
583e41f4b71Sopenharmony_ci    "isDefault": false,
584e41f4b71Sopenharmony_ci    "updateEnabled": true,
585e41f4b71Sopenharmony_ci    "scheduledUpdateTime": "21:05",
586e41f4b71Sopenharmony_ci    "updateDuration": 1,
587e41f4b71Sopenharmony_ci    "defaultDimension": "1*2",
588e41f4b71Sopenharmony_ci    "supportDimensions": [
589e41f4b71Sopenharmony_ci      "1*2"
590e41f4b71Sopenharmony_ci    ],
591e41f4b71Sopenharmony_ci    "landscapeLayouts": [
592e41f4b71Sopenharmony_ci      "$layout:ability_form"
593e41f4b71Sopenharmony_ci    ],
594e41f4b71Sopenharmony_ci    "portraitLayouts": [
595e41f4b71Sopenharmony_ci      "$layout:ability_form"
596e41f4b71Sopenharmony_ci    ],
597e41f4b71Sopenharmony_ci    "formConfigAbility": "ability://com.example.myapplication.fa/.EntryAbility",
598e41f4b71Sopenharmony_ci    "metaData": {
599e41f4b71Sopenharmony_ci      "customizeData": [
600e41f4b71Sopenharmony_ci        {
601e41f4b71Sopenharmony_ci          "name": "originWidgetName",
602e41f4b71Sopenharmony_ci          "value": "com.example.weather.testWidget"
603e41f4b71Sopenharmony_ci        }
604e41f4b71Sopenharmony_ci      ]
605e41f4b71Sopenharmony_ci    }
606e41f4b71Sopenharmony_ci  }
607e41f4b71Sopenharmony_ci]
608e41f4b71Sopenharmony_ci```
609e41f4b71Sopenharmony_ci
610e41f4b71Sopenharmony_ci## distroFilter对象的内部结构
611e41f4b71Sopenharmony_ci
612e41f4b71Sopenharmony_ci**表21** **distroFilter对象的内部结构说明**
613e41f4b71Sopenharmony_ci
614e41f4b71Sopenharmony_ci| 属性名称 | 含义 | 数据类型 | 是否可缺省 |
615e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- |
616e41f4b71Sopenharmony_ci| apiVersion | 标识支持的apiVersion范围。 | 对象数组 | 可缺省,缺省值为空。 |
617e41f4b71Sopenharmony_ci|screenShape | 标识屏幕形状的支持策略。 | 对象数组 | 可缺省,缺省值为空。 |
618e41f4b71Sopenharmony_ci| screenWindow | 标识应用运行时窗口的分辨率支持策略。该字段仅支持对轻量级智能穿戴设备进行配置。 | 对象数组 | 可缺省,缺省值为空。 |
619e41f4b71Sopenharmony_ci|screenDensity | 标识屏幕的像素密度(dpi:Dots&nbsp;Per&nbsp;Inch)。 | 对象数组 | 可缺省,缺省值为空。 |
620e41f4b71Sopenharmony_ci| countryCode | 标识分发应用时的国家码。具体值参考ISO-3166-1的标准,支持多个国家和地区的枚举定义。 | 对象数组 | 可缺省,缺省值为空。 |
621e41f4b71Sopenharmony_ci
622e41f4b71Sopenharmony_ci## apiVersion对象的内部结构
623e41f4b71Sopenharmony_ci
624e41f4b71Sopenharmony_ci**表22** **apiVersion对象的内部结构说明**
625e41f4b71Sopenharmony_ci
626e41f4b71Sopenharmony_ci| 属性名称 | 含义 | 数据类型 | 是否可缺省 |
627e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- |
628e41f4b71Sopenharmony_ci| policy | 标识该子属性取值规则。配置为“exclude”或“include”。<br/>-&nbsp;exclude:表示需要排除的value属性。<br/>-&nbsp;include:表示需要包含的value属性。 | 字符串 | 不可缺省。 |
629e41f4b71Sopenharmony_ci| value | 支持的取值为API&nbsp;Version存在的整数值,例如4、5、6。场景示例:某应用,针对相同设备型号,同时在网的为使用API&nbsp;5和API&nbsp;6开发的两个软件版本,则允许上架2个entry类型的安装包,分别支持到对应设备侧软件版本的分发。 | 数组 | 不可缺省。 |
630e41f4b71Sopenharmony_ci
631e41f4b71Sopenharmony_ci## screenShape对象的内部结构
632e41f4b71Sopenharmony_ci
633e41f4b71Sopenharmony_ci**表23** **screenShape对象的内部结构说明**
634e41f4b71Sopenharmony_ci
635e41f4b71Sopenharmony_ci| 属性名称 | 含义 | 数据类型 | 是否可缺省 |
636e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- |
637e41f4b71Sopenharmony_ci| policy | 标识该子属性取值规则。配置为“exclude”或“include”。<br/>-&nbsp;exclude:表示需要排除的value属性。<br/>-&nbsp;include:表示需要包含的value属性。 | 字符串 | 不可缺省。 |
638e41f4b71Sopenharmony_ci| value | 支持的取值为API&nbsp;Version存在的整数值,例如4、5、6。场景示例:某应用,针对相同设备型号,同时在网的为使用API&nbsp;5和API&nbsp;6开发的两个软件版本,则允许上架2个entry类型的安装包,分别支持到对应设备侧软件版本的分发。 | 数组 | 不可缺省。 |
639e41f4b71Sopenharmony_ci
640e41f4b71Sopenharmony_ci## screenWindow对象的内部结构
641e41f4b71Sopenharmony_ci
642e41f4b71Sopenharmony_ci**表24** **screenWindow对象的内部结构说明**
643e41f4b71Sopenharmony_ci
644e41f4b71Sopenharmony_ci| 属性名称 | 含义 | 数据类型 | 是否可缺省 |
645e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- |
646e41f4b71Sopenharmony_ci| policy | 标识该子属性取值规则。配置为“exclude”或“include”。<br/>-&nbsp;exclude:表示需要排除的value属性。<br/>-&nbsp;include:表示需要包含的value属性。 | 字符串 | 不可缺省。 |
647e41f4b71Sopenharmony_ci| value | 支持的取值为API&nbsp;Version存在的整数值,例如4、5、6。场景示例:某应用,针对相同设备型号,同时在网的为使用API&nbsp;5和API&nbsp;6开发的两个软件版本,则允许上架2个entry类型的安装包,分别支持到对应设备侧软件版本的分发。 | 数组 | 不可缺省。 |
648e41f4b71Sopenharmony_ci
649e41f4b71Sopenharmony_ci## screenDensity对象的内部结构
650e41f4b71Sopenharmony_ci
651e41f4b71Sopenharmony_ci**表25** **screenDensity对象的内部结构说明**
652e41f4b71Sopenharmony_ci
653e41f4b71Sopenharmony_ci| 属性名称 | 含义 | 数据类型 | 是否可缺省 |
654e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- |
655e41f4b71Sopenharmony_ci| policy | 标识该子属性取值规则。配置为“exclude”或“include”。<br/>-&nbsp;exclude:表示需要排除的value属性。<br/>-&nbsp;include:表示需要包含的value属性。 | 字符串 | 不可缺省。 |
656e41f4b71Sopenharmony_ci| value | 取值范围如下:<br/>sdpi:表示小规模的屏幕密度(Small-scale&nbsp;Dots&nbsp;Per&nbsp;Inch),适用于dpi取值为(0,120]的设备。<br/>mdpi:表示中规模的屏幕密度(Medium-scale&nbsp;Dots&nbsp;Per&nbsp;Inch),适用于dpi取值为(120,160]的设备。<br/>ldpi:表示大规模的屏幕密度(Large-scale&nbsp;Dots&nbsp;Per&nbsp;Inch),适用于dpi取值为(160,240]的设备。<br/>xldpi:表示特大规模的屏幕密度(Extra&nbsp;Large-scale&nbsp;Dots&nbsp;Per&nbsp;Inch),适用于dpi取值为(240,320]的设备。<br/>xxldpi:表示超大规模的屏幕密度(Extra&nbsp;Extra&nbsp;Large-scale&nbsp;Dots&nbsp;Per&nbsp;Inch),适用于dpi取值为(320,480]的设备。<br/>xxxldpi:表示超特大规模的屏幕密度(Extra&nbsp;Extra&nbsp;Extra&nbsp;Large-scale&nbsp;Dots&nbsp;Per&nbsp;Inch),适用于dpi取值为(480,640]的设备。 | 数组 | 不可缺省。 |
657e41f4b71Sopenharmony_ci
658e41f4b71Sopenharmony_ci## countryCode对象的内部结构
659e41f4b71Sopenharmony_ci
660e41f4b71Sopenharmony_ci**表26** **countryCode对象的内部结构说明**
661e41f4b71Sopenharmony_ci
662e41f4b71Sopenharmony_ci| 属性名称 | 含义 | 数据类型 | 是否可缺省 |
663e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- |
664e41f4b71Sopenharmony_ci| policy | 标识该子属性取值规则。配置为“exclude”或“include”。<br/>-&nbsp;exclude:表示需要排除的value属性。<br/>-&nbsp;include:表示需要包含的value属性。 | 字符串 | 不可缺省。 |
665e41f4b71Sopenharmony_ci| value | 该标签标识应用需要分发的国家码,标签为字符串数组,子串表示支持的国家或地区,由两个大写字母表示。 | 字符串数组 | 不可缺省。 |
666e41f4b71Sopenharmony_ci
667e41f4b71Sopenharmony_ci
668e41f4b71Sopenharmony_cidistroFilter示例:
669e41f4b71Sopenharmony_ci
670e41f4b71Sopenharmony_ci```json
671e41f4b71Sopenharmony_ci"distroFilter":  {
672e41f4b71Sopenharmony_ci  "apiVersion": {
673e41f4b71Sopenharmony_ci    "policy": "include",
674e41f4b71Sopenharmony_ci    "value": [4,5]
675e41f4b71Sopenharmony_ci  },
676e41f4b71Sopenharmony_ci  "screenShape": {
677e41f4b71Sopenharmony_ci    "policy": "include",
678e41f4b71Sopenharmony_ci    "value": ["circle","rect"]
679e41f4b71Sopenharmony_ci  },
680e41f4b71Sopenharmony_ci  "screenWindow": {
681e41f4b71Sopenharmony_ci    "policy": "include",
682e41f4b71Sopenharmony_ci    "value": ["454*454","466*466"]
683e41f4b71Sopenharmony_ci  },
684e41f4b71Sopenharmony_ci  "screenDensity":{
685e41f4b71Sopenharmony_ci    "policy": "exclude",
686e41f4b71Sopenharmony_ci    "value": ["ldpi","xldpi"]
687e41f4b71Sopenharmony_ci  },
688e41f4b71Sopenharmony_ci  "countryCode": {
689e41f4b71Sopenharmony_ci    "policy":"include",
690e41f4b71Sopenharmony_ci    "value":["CN","HK"]
691e41f4b71Sopenharmony_ci  }
692e41f4b71Sopenharmony_ci}
693e41f4b71Sopenharmony_ci```
694e41f4b71Sopenharmony_ci
695e41f4b71Sopenharmony_ci## commonEvents对象的内部结构
696e41f4b71Sopenharmony_ci
697e41f4b71Sopenharmony_ci**表27** **commonEvents对象的内部结构说明**
698e41f4b71Sopenharmony_ci
699e41f4b71Sopenharmony_ci| 属性名称 | 含义 | 数据类型 | 是否可缺省 |
700e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- |
701e41f4b71Sopenharmony_ci| name | 标识静态公共事件名称,该标签最大长度为127字节。 | 字符串 | 不可缺省。 |
702e41f4b71Sopenharmony_ci| permission | 此标签标识实现静态公共事件所需要申请的权限,该标签最大长度为255字节。 | 字符串 | 可缺省,缺省值为空。 |
703e41f4b71Sopenharmony_ci| data | 标识配置当前静态公共事件要携带的附加数据数组。 | 字符串数组 | 可缺省,缺省值为空。 |
704e41f4b71Sopenharmony_ci| type | 该标签用于配置当前静态公共事件的分类数组。 | 字符串数组 | 可缺省,缺省值为空。 |
705e41f4b71Sopenharmony_ci| events | 此标签标识可接收的意图的一组事件值。一般由系统预定义,也可以自定义。 | 字符串数组 | 不可缺省。 |
706e41f4b71Sopenharmony_ci
707e41f4b71Sopenharmony_ci
708e41f4b71Sopenharmony_cicommonEvents示例:
709e41f4b71Sopenharmony_ci
710e41f4b71Sopenharmony_ci```json
711e41f4b71Sopenharmony_ci"commonEvents": [
712e41f4b71Sopenharmony_ci  {
713e41f4b71Sopenharmony_ci    "name": ".EntryAbility",
714e41f4b71Sopenharmony_ci    "permission": "ohos.permission.GET_BUNDLE_INFO",
715e41f4b71Sopenharmony_ci    "data": [
716e41f4b71Sopenharmony_ci      "com.example.demo",
717e41f4b71Sopenharmony_ci      "100"
718e41f4b71Sopenharmony_ci    ],
719e41f4b71Sopenharmony_ci    "events": [
720e41f4b71Sopenharmony_ci      "install",
721e41f4b71Sopenharmony_ci      "update"
722e41f4b71Sopenharmony_ci    ]
723e41f4b71Sopenharmony_ci  }
724e41f4b71Sopenharmony_ci]
725e41f4b71Sopenharmony_ci```
726e41f4b71Sopenharmony_ci
727e41f4b71Sopenharmony_ci## testRunner对象的内部结构
728e41f4b71Sopenharmony_ci
729e41f4b71Sopenharmony_ci**表28** **testRunner对象的内部结构说明**
730e41f4b71Sopenharmony_ci
731e41f4b71Sopenharmony_ci| 属性名称 | 含义 | 数据类型 | 是否可缺省 |
732e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- |
733e41f4b71Sopenharmony_ci| name | 标识测试框架对象名称,该标签最大长度为255字节。 | 字符串 | 不可缺省。 |
734e41f4b71Sopenharmony_ci| srcPath | 标识测试框架代码路径,该标签最大长度为255字节。 | 字符串 | 不可缺省。 |
735e41f4b71Sopenharmony_ci
736e41f4b71Sopenharmony_ci```json
737e41f4b71Sopenharmony_ci"testRunner": {
738e41f4b71Sopenharmony_ci  "name": "myTestRunnerName",
739e41f4b71Sopenharmony_ci  "srcPath": "etc/test/TestRunner.ts"
740e41f4b71Sopenharmony_ci}
741e41f4b71Sopenharmony_ci```
742e41f4b71Sopenharmony_ci
743e41f4b71Sopenharmony_ci
744e41f4b71Sopenharmony_cidefinePermission仅支持系统应用配置,三方应用配置不生效。
745e41f4b71Sopenharmony_ci
746e41f4b71Sopenharmony_ci## definePermissions对象内部结构
747e41f4b71Sopenharmony_ci**表29** **definePermissions对象内部结构说明**
748e41f4b71Sopenharmony_ci
749e41f4b71Sopenharmony_ci| 属性名称 | 含义 | 数据类型 | 是否可缺省 |
750e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- |
751e41f4b71Sopenharmony_ci| name | 标识权限的名称,该标签最大长度为255字节。 | 字符串 | 不可缺省。 |
752e41f4b71Sopenharmony_ci| grantMode | 标识权限的授予方式,支持如下两种授予模式如下:<br/>-&nbsp;system_grant:安装后系统自动授予该权限。<br/>-&nbsp;user_grant:使用时动态申请,用户授权后才可使用。 | 字符串 | 可缺省,缺省值为system_grant。 |
753e41f4b71Sopenharmony_ci| availableLevel | 标识权限限制类别,可选值如下:<br/>-&nbsp;system_core:系统核心权限。<br/>-&nbsp;system_basic:系统基础权限。<br/>-&nbsp;normal:普通权限。所有应用允许申请的权限。 | 字符串 | 可缺省,缺省值为normal。 |
754e41f4b71Sopenharmony_ci| provisionEnable | 标识权限是否支持证书方式申请权限,包括高级别的权限。配置为true标识开发者可以通过provision方式申请权限。 | 布尔值 | 可缺省,缺省值为true。 |
755e41f4b71Sopenharmony_ci| distributedSceneEnabled | 标识权限是否支持分布式场景下使用该权限。 | 布尔值 | 可缺省,缺省值为false。 |
756e41f4b71Sopenharmony_ci| label | 标识权限的简短描述,配置为对描述内容的资源索引。 | 字符串 | 可缺省,缺省值为空。 |
757e41f4b71Sopenharmony_ci| description | 标识权限的详细描述,可以是字符串(最大长度为255字节),或者为对描述内容的资源索引。 | 字符串 | 可缺省,缺省值为空。 |
758