提交 e391ed76 编写于 作者: S shawn_he

update docs

Signed-off-by: Nshawn_he <shawn.he@huawei.com>
上级 c7ec364f
# Update
The update module applies to updates throughout the entire system, including built-in resources and preset applications, but not third-party applications.
The Update module applies to updates throughout the entire system, including built-in resources and preset applications, but not third-party applications.
There are two types of updates: SD card update and over the air (OTA) update.
......@@ -10,109 +10,212 @@ There are two types of updates: SD card update and over the air (OTA) update.
## Modules to Import
```js
import client from '@ohos.update'
import update from '@ohos.update'
```
## Required Permissions
None
## Obtains an **Updater** object.
### update.getUpdater
getUpdater(upgradeFile: string, updateType?: UpdateTypes): Updater
Obtains the **Updater** object for local update.
**System capability**: SystemCapability.Updater.update_service
**Parameters**
| Name | Type | Mandatory| Description |
| ----------- | --------------------------- | ---- | -------- |
| upgradeFile | string | Yes | Update file.|
| updateType | [UpdateTypes](#updatetypes) | Yes | Update type.|
**Return value**
| Type | Description |
| ------------------- | -------- |
| [Updater](#updater) | **Updater** object.|
**Example**
```
try {
let updater = update.getUpdater('/data/updater/updater.zip', 'OTA');
} catch(error) {
console.error(" Fail to get updater error: " + error);
}
```
### update.getUpdaterForOther
getUpdaterForOther(upgradeFile: string, device: string, updateType?: UpdateTypes): Updater
Obtains the **Updater** object for the device to be updated.
**System capability**: SystemCapability.Updater.update_service
**Parameters**
| Name | Type | Mandatory| Description |
| ----------- | --------------------------- | ---- | ---------- |
| upgradeFile | string | Yes | Update file. |
| device | string | Yes | Device to be updated.|
| updateType | [UpdateTypes](#updatetypes) | Yes | Update type. |
**Return value**
| Type | Description |
| ------------------- | -------- |
| [Updater](#updater) | **Updater** object.|
**Example**
```
try {
let updater = update.getUpdaterForOther('/data/updater/updater.zip', '1234567890', 'OTA');
} catch(error) {
console.error(" Fail to get updater error: " + error);
}
```
### update.getUpdaterFromOther
getUpdaterFromOther(upgradeFile: string, device: string, updateType?: UpdateTypes): Updater
Obtains the **Updater** object from another device for the device to be updated.
**System capability**: SystemCapability.Updater.update_service
**Parameters**
| Name | Type | Mandatory| Description |
| ----------- | --------------------------- | ---- | ---------- |
| upgradeFile | string | Yes | Update file. |
| device | string | Yes | Device to be updated.|
| updateType | [UpdateTypes](#updatetypes) | Yes | Update type. |
**Return value**
| Type | Description |
| ------------------- | -------- |
| [Updater](#updater) | **Updater** object.|
**Example**
```
try {
let updater = update.getUpdaterFromOther('/data/updater/updater.zip', '1234567890', 'OTA');
} catch(error) {
console.error(" Fail to get updater error: " + error);
}
```
## Updater
### getNewVersionInfo
getNewVersionInfo(callback: AsyncCallback\<NewVersionInfo>): void
Obtains the new version information. This method uses an asynchronous callback to return the result.
Obtains the new version information. This function uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Updater.update_service
**Parameters**
| Name| Type| Mandatory| Description|
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------ | ---- | ------------------ |
| callback | AsyncCallback<[NewVersionInfo](#newversioninfo)> | No| Callback used to return the new version information.|
| callback | AsyncCallback<[NewVersionInfo](#newversioninfo)> | No | Callback used to return the new version information.|
**Example**
```
updater.getNewVersionInfo(info => {
update.getNewVersionInfo(info => {
console.log("getNewVersionInfo success " + info.status);
console.log(`info versionName = ` + info.result[0].versionName);
console.log(`info versionCode = ` + info.result[0].versionCode);
console.log(`info verifyInfo = ` + info.result[0].verifyInfo);
)};
});
```
### getNewVersionInfo
getNewVersionInfo(): Promise\<NewVersionInfo>
Obtains the new version information. This method uses a promise to return the result.
Obtains the new version information. This function uses a promise to return the result.
**Return values**
**System capability**: SystemCapability.Updater.update_service
| Type| Description|
**Return value**
| Type | Description |
| ------------------------------------------- | ------------------------- |
| Promise\<[NewVersionInfo](#newversioninfo)> | Promise used to return the new version information.|
**Example**
```
var p = updater.getNewVersionInfo();
p.then(function (value) {
updater.getNewVersionInfo().then(value => {
console.log(`info versionName = ` + value.result[0].versionName);
console.log(`info versionCode = ` + value.result[0].versionCode);
console.log(`info verifyInfo = ` + value.result[0].verifyInfo);
}).catch(function (err) {
}).catch(err => {
console.log("getNewVersionInfo promise error: " + err.code);
)};
});
```
### checkNewVersion
checkNewVersion(callback: AsyncCallback\<NewVersionInfo>): void
Checks whether the current version is the latest. This method uses an asynchronous callback to return the result.
Checks whether the current version is the latest. This function uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Updater.update_service
**Parameters**
| Name| Type| Mandatory| Description|
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------- | ---- | ------------------ |
| callback | AsyncCallback\<[NewVersionInfo](#newversioninfo)> | No| Callback used to return the new version information.|
| callback | AsyncCallback\<[NewVersionInfo](#newversioninfo)> | No | Callback used to return the new version information.|
**Example**
```
updater.checkNewVersion(info => {
update.checkNewVersion(info => {
console.log("checkNewVersion success " + info.status);
console.log(`info versionName = ` + info.result[0].versionName);
console.log(`info versionCode = ` + info.result[0].versionCode);
console.log(`info verifyInfo = ` + info.result[0].verifyInfo);
)};
});
```
### checkNewVersion
checkNewVersion(): Promise\<NewVersionInfo>
Checks whether the current version is the latest. This method uses a promise to return the result.
Checks whether the current version is the latest. This function uses a promise to return the result.
**System capability**: SystemCapability.Updater.update_service
**Return values**
**Return value**
| Type| Description|
| Type | Description |
| ------------------------------------------- | ------------------------- |
| Promise\<[NewVersionInfo](#newversioninfo)> | Promise used to return the new version information.|
**Example**
```
var p = updater.checkNewVersion();
p.then(function (value) {
update.checkNewVersion().then(value => {
console.log(`info versionName = ` + value.result[0].versionName);
console.log(`info versionCode = ` + value.result[0].versionCode);
console.log(`info verifyInfo = ` + value.result[0].verifyInfo);
}).catch(function (err) {
}).catch(err => {
console.log("checkNewVersion promise error: " + err.code);
)};
});
```
### verifyUpdatePackage
......@@ -121,45 +224,45 @@ verifyUpdatePackage(upgradeFile: string, certsFile: string): void
Verifies whether the update package is valid.
**System capability**: SystemCapability.Updater.update_service
**Parameters**
| Name| Type| Mandatory| Description|
| Name | Type | Mandatory| Description |
| ----------- | ------ | ---- | ------------------ |
| upgradeFile | string | Yes| Path of the update package to be verified.|
| certsFile | string | Yes| Certificate path.|
| upgradeFile | string | Yes | Path of the update package to be verified.|
| certsFile | string | Yes | Certificate path. |
**Example**
```
var getVar = update.getUpdater();
getVar.on("verifyProgress", function (callback){
console.info('on verifyProgress ' + callback.percent);
update.on("verifyProgress", callback => {
console.info('on verifyProgress ' + callback.percent);
});
getVar.verifyUpdatePackage("XXX", "XXX");
getVar.off("verifyProgress");
update.verifyUpdatePackage("XXX", "XXX");
```
### rebootAndCleanUserData
rebootAndCleanUserData(): Promise\<number>
Reboots the device and clears the user partition data. This method uses a promise to return the result.
Reboots the device and clears the user partition data. This function uses a promise to return the result.
**Return values**
**System capability**: SystemCapability.Updater.update_service
| Type| Description|
**Return value**
| Type | Description |
| ---------------- | ------------------------------- |
| Promise\<number> | Promise used to return the execution result.|
**Example**
```
var getVar = update.getUpdater();
p = getVar.rebootAndCleanUserData();
p.then(function (value) {
console.info("rebootAndCleanUserData promise success: " + value);
}).catch(function (err) {
console.info("rebootAndCleanUserData promise error: " + err.code);
update.rebootAndCleanUserData().then(result => {
console.log("rebootAndCleanUserData " + result);
}).catch(err => {
console.info("rebootAndCleanUserData promise error: " + err.code);
});
```
......@@ -167,24 +270,21 @@ p.then(function (value) {
rebootAndCleanUserData(callback: AsyncCallback\<number>): void
Reboots the device and clears the user partition data. This method uses an asynchronous callback to return the result.
Reboots the device and clears the user partition data. This function uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Updater.update_service
**Parameters**
| Name| Type| Mandatory| Description|
| Name | Type | Mandatory| Description |
| -------- | -------- | ---- | ---------------------- |
| callback | Function | Yes| AsyncCallback\<number> |
| callback | AsyncCallback\<number>| Yes | Callback used to return the execution result.|
**Example**
```
var getVar = update.getUpdater();
getVar.rebootAndCleanUserData(function (err, data) {
if (err.code == 0) {
console.info("rebootAndCleanUserData callback success:" + data)
} else {
console.info("rebootAndCleanUserData callback err:" + err.code)
}
update.rebootAndCleanUserData(result => {
console.log("rebootAndCleanUserData ", result)
});
```
......@@ -192,21 +292,22 @@ getVar.rebootAndCleanUserData(function (err, data) {
applyNewVersion(): Promise\<number>
Installs the update package. This method uses a promise to return the result.
Installs the update package. This function uses a promise to return the result.
**Return values**
**System capability**: SystemCapability.Updater.update_service
| Type| Description|
**Return value**
| Type | Description |
| ---------------- | ------------------------------- |
| Promise\<number> | Promise used to return the execution result.|
**Example**
```
var getVar = update.getUpdater();
p.then(function (value) {
console.info("applyNewVersion promise success: " + value);
}).catch(function (err) {
update.applyNewVersion().then(result => {
console.log("appVewVersion ", result)
}).catch(err => {
console.info("applyNewVersion promise error: " + err.code);
});
```
......@@ -215,24 +316,21 @@ p.then(function (value) {
applyNewVersion(callback: AsyncCallback\<number>): void
Installs the update package. This method uses an asynchronous callback to return the result.
Installs the update package. This function uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Updater.update_service
**Parameters**
| Name| Type| Mandatory| Description|
| Name | Type | Mandatory| Description |
| -------- | -------- | ---- | ---------------------- |
| callback | Function | Yes| AsyncCallback\<number> |
| callback| AsyncCallback\<number>| Yes | Callback used to return the execution result.|
**Example**
```
var getVar = update.getUpdater();
getVar.applyNewVersion(function (err, data) {
if (err.code == 0) {
console.info("applyNewVersion callback success:" + data)
} else {
console.info("applyNewVersion callback err:" + err.code)
}
update.applyNewVersion(result => {
console.log("applyNewVersion ", result)
});
```
......@@ -242,6 +340,8 @@ download(): void
Downloads the new version and displays the download process.
**System capability**: SystemCapability.Updater.update_service
**Example**
```
......@@ -249,7 +349,7 @@ updater.on("downloadProgress", progress => {
console.log("downloadProgress on" + progress);
console.log(`downloadProgress status: ` + progress.status);
console.log(`downloadProgress percent: ` + progress.percent);
)};
});
updater.download();
```
......@@ -259,6 +359,8 @@ updater.upgrade():void
Starts an update.
**System capability**: SystemCapability.Updater.update_service
**Example**
```
......@@ -266,7 +368,7 @@ updater.on("upgradeProgress", progress => {
console.log("upgradeProgress on" + progress);
console.log(`upgradeProgress status: ` + progress.status);
console.log(`upgradeProgress percent: ` + progress.percent);
)};
});
updater.upgrade();
```
......@@ -274,45 +376,50 @@ updater.upgrade();
setUpdatePolicy(policy: UpdatePolicy, callback: AsyncCallback\<number>): void
Sets the update policy. This method uses an asynchronous callback to return the result.
Sets the update policy. This function uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Updater.update_service
**Parameters**
| Name| Type| Mandatory| Description|
| Name | Type | Mandatory| Description |
| -------- | ----------------------------- | ---- | ------------ |
| policy | [UpdatePolicy](#updatepolicy) | Yes| Update policy to set.|
| callback | AsyncCallback\<number> | Yes| Callback used to return the execution result.|
| policy | [UpdatePolicy](#updatepolicy) | Yes | Update policy to set.|
| callback | AsyncCallback\<number> | Yes | Callback used to return the execution result.|
**Example**
```
// Set the update policy.
let policy = {
autoDownload: false,
autoDownloadNet: true,
mode: 2,
autoUpgradeInterval: [ 2, 3 ],
autoUpgradeCondition: 2
autoDownload: false,
autoDownloadNet: true,
mode: 2,
autoUpgradeInterval: [ 2, 3 ],
autoUpgradeCondition: 2
}
updater.setUpdatePolicy(policy, function(result) {
console.log("setUpdatePolicy ", result)});
update.setUpdatePolicy(policy, result => {
console.log("setUpdatePolicy ", result)
});
```
### setUpdatePolicy
setUpdatePolicy(policy: UpdatePolicy): Promise\<number>
Sets the update policy. This method uses a promise to return the result.
Sets the update policy. This function uses a promise to return the result.
**System capability**: SystemCapability.Updater.update_service
**Parameters**
| Name| Type| Mandatory| Description|
| Name| Type | Mandatory| Description |
| ------ | ----------------------------- | ---- | ------------ |
| policy | [UpdatePolicy](#updatepolicy) | Yes| Update policy to set.|
| policy | [UpdatePolicy](#updatepolicy) | Yes | Update policy to set.|
**Return values**
**Return value**
| Type| Description|
| Type | Description |
| ---------------- | ----------------------- |
| Promise\<number> | Promise used to return the execution result.|
......@@ -320,238 +427,153 @@ Sets the update policy. This method uses a promise to return the result.
```
let policy = {
autoDownload: false,
autoDownloadNet: true,
mode: 2,
autoUpgradeInterval: [ 2, 3 ],
autoUpgradeCondition: 2
autoDownload: false,
autoDownloadNet: true,
mode: 2,
autoUpgradeInterval: [ 2, 3 ],
autoUpgradeCondition: 2
}
updater.setUpdatePolicy(policy)
.then(data=>
console.log('Policy set successfully')
)
update.setUpdatePolicy(policy).then(result =>
console.log("setUpdatePolicy ", result)
).catch(err => {
console.log("setUpdatePolicy promise error: " + err.code);
});
```
### getUpdatePolicy
getUpdatePolicy(callback: AsyncCallback\<UpdatePolicy>): void
Obtains the update policy. This method uses an asynchronous callback to return the result.
Obtains the update policy. This function uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Updater.update_service
**Parameters**
| Name| Type| Mandatory| Description|
| Name | Type | Mandatory| Description |
| -------- | --------------------------------------------- | ---- | -------------------- |
| callback | AsyncCallback\<[UpdatePolicy](#updatepolicy)> | No| Callback used to return the update policy.|
| callback | AsyncCallback\<[UpdatePolicy](#updatepolicy)> | No | Callback used to return the update policy.|
**Example**
```
updater.getUpdatePolicy(policy => {
update.getUpdatePolicy(policy => {
console.log("getUpdatePolicy success");
console.log(`policy autoDownload = ` + policy.autoDownload);
console.log(`policy autoDownloadNet = ` + policy.autoDownloadNet);
console.log(`policy mode = ` + policy.mode);
)};
});
```
### getUpdatePolicy
getUpdatePolicy(): Promise\<UpdatePolicy>
Obtains the update policy. This method uses a promise to return the result.
Obtains the update policy. This function uses a promise to return the result.
**Return values**
**System capability**: SystemCapability.Updater.update_service
| Type| Description|
**Return value**
| Type | Description |
| --------------------------------------- | --------------------------- |
| Promise\<[UpdatePolicy](#updatepolicy)> | Promise used to return the update policy.|
**Example**
```
p = updater.getUpdatePolicy();
p.then(function (value) {
update.getUpdatePolicy().then(value => {
console.log(`info autoDownload = ` + value.autoDownload);
console.log(`info autoDownloadNet = ` + value.autoDownloadNet);
console.log(`info mode = ` + value.mode);
}).catch(function (err) {
}).catch(err => {
console.log("getUpdatePolicy promise error: " + err.code);
)};
```
## update.getUpdater
getUpdater(upgradeFile: string, updateType?: UpdateTypes): Updater
Obtains the updater for the local update.
**Parameters**
| Name| Type| Mandatory| Description|
| ----------- | --------------------------- | ---- | -------- |
| upgradeFile | string | Yes| Update file.|
| updateType | [UpdateTypes](#updatetypes) | Yes| Update type.|
**Return values**
| Type| Description|
| ------------------- | -------- |
| [Updater](#updater) | Updater object.|
**Example**
```
try {
page.data.updater = update.getUpdater('/data/updater/updater.zip', 'OTA');
} catch(error) {
console.error("Failed to get updater. Error: " + error);
}
```
## update.getUpdaterForOther
getUpdaterForOther(upgradeFile: string, device: string, updateType?: UpdateTypes): Updater
Obtains the updater for the device to be updated.
**Parameters**
| Name| Type| Mandatory| Description|
| ----------- | --------------------------- | ---- | ---------- |
| upgradeFile | string | Yes| Update file.|
| device | string | Yes| Device to be updated.|
| updateType | [UpdateTypes](#updatetypes) | Yes| Update type.|
**Return values**
| Type| Description|
| ------------------- | -------- |
| [Updater](#updater) | Updater object.|
**Example**
```
try {
page.data.updater = update.getUpdaterForOther('/data/updater/updater.zip', '1234567890', 'OTA');
} catch(error) {
console.error("Failed to get updater. Error: " + error);
}
```
## update.getUpdaterFromOther
getUpdaterFromOther(upgradeFile: string, device: string, updateType?: UpdateTypes): Updater
Obtains the updater from another device for the device to be updated.
**Parameters**
| Name| Type| Mandatory| Description|
| ----------- | --------------------------- | ---- | ---------- |
| upgradeFile | string | Yes| Update file.|
| device | string | Yes| Device to be updated.|
| updateType | [UpdateTypes](#updatetypes) | Yes| Update type.|
**Return values**
| Type| Description|
| ------------------- | -------- |
| [Updater](#updater) | Updater object.|
**Example**
```
try {
page.data.updater = update.getUpdaterFromOther('/data/updater/updater.zip', '1234567890', 'OTA');
} catch(error) {
console.error("Failed to get updater. Error: " + error);
}
});
```
## UpdateTypes
Describes the update type.
Enumerates update types.
| Name| Description|
| Name| Description |
| ------ | -------- |
| OTA | OTA update.|
| patch | Patch update.|
| OTA | OTA update.<br>**System capability**: SystemCapability.Updater.update_service|
| patch | Patch update.<br>**System capability**: SystemCapability.Updater.update_service|
## PackageTypes
Enumerates the update package types.
Enumerates update package types.
| Name| Default Value| Description|
| Name | Default Value| Description |
| -------------------- | ------ | -------------- |
| PACKAGE_TYPE_NORMAL | 1 | Common update package.|
| PACKAGE_TYPE_BASE | 2 | Basic update package.|
| PACKAGE_TYPE_CUST | 3 | Custom update package.|
| PACKAGE_TYPE_PRELOAD | 4 | Preinstalled update package.|
| PACKAGE_TYPE_COTA | 5 | Parameter configuration update package.|
| PACKAGE_TYPE_VERSION | 6 | Version update package.|
| PACKAGE_TYPE_PATCH | 7 | Patch package.|
| PACKAGE_TYPE_NORMAL | 1 | Common update package.<br>**System capability**: SystemCapability.Updater.update_service|
| PACKAGE_TYPE_BASE | 2 | Basic update package.<br>**System capability**: SystemCapability.Updater.update_service|
| PACKAGE_TYPE_CUST | 3 | Custom update package.<br>**System capability**: SystemCapability.Updater.update_service|
| PACKAGE_TYPE_PRELOAD | 4 | Preinstalled update package.<br>**System capability**: SystemCapability.Updater.update_service|
| PACKAGE_TYPE_COTA | 5 | Parameter configuration update package.<br>**System capability**: SystemCapability.Updater.update_service|
| PACKAGE_TYPE_VERSION | 6 | Version update package.<br>**System capability**: SystemCapability.Updater.update_service|
| PACKAGE_TYPE_PATCH | 7 | Patch package.<br>**System capability**: SystemCapability.Updater.update_service|
## InstallMode
Enumerates the update modes.
Enumerates update modes.
| Name| Default Value| Description|
| Name | Default Value| Description |
| ------------------- | ------ | -------- |
| INSTALL_MODE_NORMAL | 0 | Normal update.|
| INSTALL_MODE_NIGHT | 1 | Update at night.|
| INSTALL_MODE_AUTO | 2 | Automatic update.|
| INSTALL_MODE_NORMAL | 0 | Normal update.<br>**System capability**: SystemCapability.Updater.update_service|
| INSTALL_MODE_NIGHT | 1 | Update at night.<br>**System capability**: SystemCapability.Updater.update_service|
| INSTALL_MODE_AUTO | 2 | Automatic update.<br>**System capability**: SystemCapability.Updater.update_service|
## NewVersionStatus
Enumerates the new version check results.
Enumerates new version check results.
| Name| Default Value| Description|
| Name | Default Value| Description |
| ------------------- | ------ | ---------------- |
| VERSION_STATUS_ERR | -1 | System error while checking for the new version.|
| VERSION_STATUS_NEW | 0 | New version detected.|
| VERSION_STATUS_NONE | 1 | No new version detected.|
| VERSION_STATUS_BUSY | 2 | System busy while checking for the new version.|
| VERSION_STATUS_ERR | -1 | System error while checking for the new version.<br>**System capability**: SystemCapability.Updater.update_service|
| VERSION_STATUS_NEW | 0 | New version detected.<br>**System capability**: SystemCapability.Updater.update_service|
| VERSION_STATUS_NONE | 1 | No new version detected.<br>**System capability**: SystemCapability.Updater.update_service|
| VERSION_STATUS_BUSY | 2 | System busy while checking for the new version.<br>**System capability**: SystemCapability.Updater.update_service|
## UpdatePolicy
Defines the update policy.
| Name| Parameter type.| Mandatory| Description|
| Name | Type | Mandatory| Description |
| ------------------- | --------------------------- | ---- | -------------- |
| autoDownload | bool | Yes| Automatic update switch.|
| installMode | [InstallMode](#installmode) | Yes| Update mode.|
| autoUpgradeInterval | Array\<number> | Yes| Period of time for automatic update.|
| autoDownload | bool | Yes | Automatic update switch.<br>**System capability**: SystemCapability.Updater.update_service|
| installMode | [InstallMode](#installmode) | Yes | Update mode.<br>**System capability**: SystemCapability.Updater.update_service|
| autoUpgradeInterval | Array\<number> | Yes | Period of time for automatic update.<br>**System capability**: SystemCapability.Updater.update_service|
## NewVersionInfo
Defines the new version information.
| Name| Type| Mandatory| Description|
| Name | Type | Mandatory| Description |
| --------------- | ------------------------------------------- | ---- | -------- |
| status | [NewVersionStatus](#newversionstatus) | Yes| Update status.|
| errMsg | string | Yes| Error message.|
| checkResults | Array<[CheckResult](#checkresult)> | Yes| Check result.|
| descriptionInfo | Array\<[DescriptionInfo](#descriptioninfo)> | Yes| Description.|
| status | [NewVersionStatus](#newversionstatus) | Yes | Update status.<br>**System capability**: SystemCapability.Updater.update_service|
| errMsg | string | Yes | Error message.<br>**System capability**: SystemCapability.Updater.update_service|
| checkResults | Array<[CheckResult](#checkresult)> | Yes | Version check result.<br>**System capability**: SystemCapability.Updater.update_service|
| descriptionInfo | Array\<[DescriptionInfo](#descriptioninfo)> | Yes | Version description information.<br>**System capability**: SystemCapability.Updater.update_service|
## CheckResult
Defines the check result.
Defines the version check result.
| Name| Type| Mandatory| Description|
| Name | Type | Mandatory| Description |
| ------------- | ----------------------------- | ---- | ------------ |
| versionName | string | Yes| Version name.|
| versionCode | number | Yes| Version code.|
| size | number | Yes| Version size.|
| verifyInfo | string | Yes| Version verification information.|
| packageType | [PackageTypes](#packagetypes) | Yes| Version type.|
| descriptionId | string | Yes| Version description.|
| versionName | string | Yes | Version name.<br>**System capability**: SystemCapability.Updater.update_service|
| versionCode | number | Yes | Version code.<br>**System capability**: SystemCapability.Updater.update_service|
| size | number | Yes | Version size.<br>**System capability**: SystemCapability.Updater.update_service|
| verifyInfo | string | Yes | Version verification information.<br>**System capability**: SystemCapability.Updater.update_service|
| packageType | [PackageTypes](#packagetypes) | Yes | Version type.<br>**System capability**: SystemCapability.Updater.update_service|
| descriptionId | string | Yes | Version description information.<br>**System capability**: SystemCapability.Updater.update_service|
## DescriptionInfo
Defines the version description information.
| Name| Type| Mandatory| Description|
| Name | Type| Mandatory| Description |
| ------------- | -------- | ---- | ----------------- |
| descriptionId | string | Yes| Version ID information.|
| content | string | Yes| Version changelog information.|
| descriptionId | string | Yes | Version ID information.<br>**System capability**: SystemCapability.Updater.update_service|
| content | string | Yes | Version changelog information.<br>**System capability**: SystemCapability.Updater.update_service|
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册