• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# AppProvisionInfo (系统接口)
2<!--Kit: Ability Kit-->
3<!--Subsystem: BundleManager-->
4<!--Owner: @wanghang904-->
5<!--Designer: @hanfeng6-->
6<!--Tester: @kongjing2-->
7<!--Adviser: @Brilliantry_Rui-->
8
9应用[HarmonyAppProvision配置文件](../../security/app-provision-structure.md)中的信息,可以通过[getAppProvisionInfo](./js-apis-bundleManager-sys.md#bundlemanagergetappprovisioninfo10)获取。
10
11> **说明:**
12>
13> 本模块首批接口从API version 10 开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
14>
15> 本模块为系统接口。
16
17## 导入模块
18
19```ts
20import { bundleManager } from '@kit.AbilityKit';
21```
22
23## AppProvisionInfo
24
25**系统能力:** SystemCapability.BundleManager.BundleFramework.Core
26
27**系统接口:** 此接口为系统接口。
28
29| 名称                      | 类型   | 只读 | 可选 | 说明                 |
30| ------------------------- | ------ | ---- | ---- | -------------------- |
31| versionCode              | number | 是   | 否   | 配置文件的版本号。 |
32| versionName              | string | 是   | 否   | 配置文件的版本名称。  |
33| uuid                     | string | 是   | 否   | 配置文件中的uuid。 |
34| type                     | string | 是   | 否   | 配置文件的类型,为debug或release。 |
35| appDistributionType      | string | 是   | 否   | 配置文件中的[分发类型](../../security/app-provision-structure.md)。 |
36| validity                 | [Validity](#validity) | 是   | 否   | 配置文件中的有效期。 |
37| developerId              | string | 是   | 否   | 配置文件中的开发者ID。 |
38| certificate              | string | 是   | 否   | 配置文件中的证书信息。 |
39| apl                      | string | 是   | 否   | 配置文件中的apl字段,为normal、system_basic和system_core其中之一。 |
40| issuer                      | string | 是   | 否   | 配置文件中的发行者名称。 |
41|appIdentifier<sup>11+</sup>| string         | 是   | 否   | 应用的唯一标识,是AppGallery Connect创建应用时分配的[APP ID](https://developer.huawei.com/consumer/cn/doc/app/agc-help-createharmonyapp-0000001945392297),为云端统一分配的随机字符串。该ID在应用全生命周期中不会发生变化,包括版本升级、证书变更、开发者公私钥变更、应用转移等。当需要进行跨设备调试、跨应用交互调试等场景,必须使用手动签名,签名方式的选择具体请参考[使用场景说明](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/ide-signing#section54361623194519)。      |
42| organization<sup>12+</sup> | string | 是   | 否   | 应用的组织信息。 |
43
44## Validity
45
46**系统能力:** SystemCapability.BundleManager.BundleFramework.Core
47
48**系统接口:** 此接口为系统接口。
49
50| 名称                      | 类型   | 只读 | 可选 | 说明                 |
51| ------------------------- | ------ | ---- | ---- | -------------------- |
52| notBefore                 | number | 是   | 否   | 表示配置文件有效期的开始时间。 |
53| notAfter                  | number | 是   | 否   | 表示配置文件有效期的结束时间。 |