diff --git a/AppScope/app.json5 b/AppScope/app.json5
new file mode 100644
index 0000000000000000000000000000000000000000..b9626ec0b82881515db9379a792e0a17316e2cb0
--- /dev/null
+++ b/AppScope/app.json5
@@ -0,0 +1,12 @@
+{
+ "app": {
+ "bundleName": "com.ohos.updateapp",
+ "debug": false,
+ "vendor": "example",
+ "versionCode": 2040000100,
+ "versionName": "204.0.0.100",
+ "icon": "$media:app_icon",
+ "label": "$string:app_name",
+ "distributedNotificationEnabled": true
+ }
+}
diff --git a/AppScope/resources/base/element/string.json b/AppScope/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..dc1b3ddc215b3505f2e23eceb90f52a526a558d6
--- /dev/null
+++ b/AppScope/resources/base/element/string.json
@@ -0,0 +1,8 @@
+{
+ "string":[
+ {
+ "name":"app_name",
+ "value":"Software update"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/AppScope/resources/base/media/app_icon.png b/AppScope/resources/base/media/app_icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..401811bd41703121722b0d14134458c97e1a2aab
Binary files /dev/null and b/AppScope/resources/base/media/app_icon.png differ
diff --git a/AppScope/resources/zh_CN/element/string.json b/AppScope/resources/zh_CN/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..db126294c333e97e2b512a6ee7957866328cd18b
--- /dev/null
+++ b/AppScope/resources/zh_CN/element/string.json
@@ -0,0 +1,8 @@
+{
+ "string":[
+ {
+ "name":"app_name",
+ "value":"软件更新"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/OAT.xml b/OAT.xml
index ba35a7d08c8db03aa87782d35d8a27eb5aaa61a6..3446f798bb1fcbb96e8a5e0dedd1a6bf07f4aefe 100644
--- a/OAT.xml
+++ b/OAT.xml
@@ -68,11 +68,16 @@ Note:If the text contains special characters, please escape them according to th
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/build-profile.json5 b/build-profile.json5
new file mode 100644
index 0000000000000000000000000000000000000000..d8aef2bf09cc63cd5c7523eef8d3aec39c503a44
--- /dev/null
+++ b/build-profile.json5
@@ -0,0 +1,34 @@
+{
+ "app": {
+ "compileSdkVersion": 10,
+ "compatibleSdkVersion": 10,
+ "products": [
+ {
+ "name": "default",
+ "signingConfig": "release",
+ }
+ ]
+ },
+ "modules": [
+ {
+ "name": "ouc_oh_base",
+ "srcPath": "./product/oh/base",
+ "targets": [
+ {
+ "name": "default",
+ "applyToProducts": [
+ "default"
+ ]
+ }
+ ]
+ },
+ {
+ "name": "common",
+ "srcPath": "./common"
+ },
+ {
+ "name": "ota",
+ "srcPath": "./feature/ota"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/common/build-profile.json5 b/common/build-profile.json5
new file mode 100644
index 0000000000000000000000000000000000000000..35dff6d53cb3a241f8de4fb68bd01d38ade0f108
--- /dev/null
+++ b/common/build-profile.json5
@@ -0,0 +1,5 @@
+{
+ "apiType": "stageMode",
+ "buildOption": {
+ }
+}
diff --git a/common/hvigorfile.ts b/common/hvigorfile.ts
new file mode 100644
index 0000000000000000000000000000000000000000..29ad39fd474172b967a75ac68a73cf2da049b182
--- /dev/null
+++ b/common/hvigorfile.ts
@@ -0,0 +1,3 @@
+// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
+module.exports = require('@ohos/hvigor-ohos-plugin').harTasks;
+
diff --git a/entry/src/main/js/default/app.js b/common/index.ets
similarity index 53%
rename from entry/src/main/js/default/app.js
rename to common/index.ets
index dec1123b5d1c741e3c0b247e27c415ab2452f29e..4e55e90b5672824463a63d495f3893263af7e892 100644
--- a/entry/src/main/js/default/app.js
+++ b/common/index.ets
@@ -1,22 +1,23 @@
-/*
- * Copyright (c) 2021 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-export default {
- onCreate() {
-
- },
- onDestroy() {
- }
-};
+/*
+ * Copyright (c) 2023 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export { CheckingDots } from './src/main/ets/component/CheckingDots';
+export { HomeCardView } from './src/main/ets/component/HomeCardView';
+export { TitleBar } from './src/main/ets/component/TitleBar';
+
+export { UpdateUtils } from './src/main/ets/util/UpdateUtils';
+export { DeviceUtils } from './src/main/ets/util/DeviceUtils';
+export { FormatUtils } from './src/main/ets/util/FormatUtils';
+export { LogUtils } from './src/main/ets/util/LogUtils';
diff --git a/common/package-lock.json b/common/package-lock.json
new file mode 100644
index 0000000000000000000000000000000000000000..01b613ff86d73ed4b5fa26a71928520aed915262
--- /dev/null
+++ b/common/package-lock.json
@@ -0,0 +1,5 @@
+{
+ "name": "@ohos/common",
+ "version": "1.0.0",
+ "lockfileVersion": 1
+}
diff --git a/common/package.json b/common/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..da97b7ad82cd7e24cf30c00be65f3ec91f013c85
--- /dev/null
+++ b/common/package.json
@@ -0,0 +1,14 @@
+{
+ "name": "@ohos/common",
+ "description": "a npm package which contains arkUI2.0 page",
+ "ohos": {
+ "org": ""
+ },
+ "version": "1.0.0",
+ "main": "index.ets",
+ "types": "",
+ "repository": {},
+ "license": "ISC",
+ "dependencies": {},
+ "type": "module"
+}
diff --git a/common/src/main/ets/component/CheckingDots.ets b/common/src/main/ets/component/CheckingDots.ets
new file mode 100644
index 0000000000000000000000000000000000000000..45fe1ce347d7d05c7d4f332322e1f3017d3a3ca4
--- /dev/null
+++ b/common/src/main/ets/component/CheckingDots.ets
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2023 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * ...等待轮播
+ *
+ * @since 2022-07-07
+ */
+@Component
+export struct CheckingDots {
+ @Prop @Watch('onDotTextPlayChange')
+ private dotTextPlay: boolean;
+ private newVersionDotText: string= '.';
+ private checkingTid: number = null;
+ @State private dotNumber: number = 0;
+
+ aboutToDisappear() {
+ this.clearCheckingTid();
+ }
+
+ aboutToAppear() {
+ this.onDotTextPlayChange();
+ }
+
+ /**
+ * bind dotTextPlay
+ * change running play
+ */
+ private onDotTextPlayChange() {
+ if (this.dotTextPlay) {
+ this.cycleDisplay();
+ } else {
+ this.clearCheckingTid();
+ }
+ }
+
+ private clearCheckingTid(): void {
+ if (this.checkingTid != null) {
+ clearInterval(this.checkingTid);
+ this.checkingTid = null;
+ }
+ }
+
+ /**
+ * loop newVersionDotText with CHECKING_DOTS array.
+ */
+ private cycleDisplay(): void {
+ if (this.checkingTid == null) {
+ let index = 0;
+ this.dotNumber = index;
+ this.checkingTid = setInterval(() => {
+ this.dotNumber = index++%3;
+ }, 500);
+ }
+ }
+
+ @Builder dotText(visibility: Visibility) {
+ Text(this.newVersionDotText)
+ .fontSize($r('app.float.text_size_body'))
+ .fontColor(Color.Black)
+ .opacity(0.6)
+ .fontWeight(FontWeight.Regular)
+ .align(Alignment.Start)
+ .maxLines(1)
+ .textOverflow({ overflow: TextOverflow.None })
+ .visibility(visibility)
+ }
+
+ build() {
+ Row() {
+ if (this.dotTextPlay) {
+ this.dotText(Visibility.Visible)
+ if (this.dotNumber >= 1) {
+ this.dotText(Visibility.Visible)
+ } else {
+ this.dotText(Visibility.Hidden)
+ }
+ if (this.dotNumber == 2) {
+ this.dotText(Visibility.Visible)
+ } else {
+ this.dotText(Visibility.Hidden)
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/common/src/main/ets/component/HomeCardView.ets b/common/src/main/ets/component/HomeCardView.ets
new file mode 100644
index 0000000000000000000000000000000000000000..bdede9bbac6b6b102bad7761c176b2c495ccbb24
--- /dev/null
+++ b/common/src/main/ets/component/HomeCardView.ets
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2023 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import {DeviceUtils} from '../util/DeviceUtils'
+
+/**
+ * 主界面LOGO视频/图片
+ *
+ * @since 2022-06-06
+ */
+@Component
+export struct HomeCardView {
+ @Prop @Watch("onChange")
+ private playVideo: boolean;
+ private indexImage: number = 1;
+ private indexVideo: number = 99;
+ private aspectRatioHorizontal: number = 16 / 7;
+ private aspectRatioVertical: number = 1 / 1;
+ private onVideoFinished: () => boolean;
+ private videoController: VideoController;
+ @State private handleVideoPlay: boolean = false;
+
+ onChange() {
+ if (this.playVideo) {
+ this.videoController.setCurrentTime(0);
+ this.handleVideoPlay = true;
+ setTimeout(() => {
+ this.videoController.start(); // 500ms ensure to start play, Video NOT beating
+ }, 500);
+ } else {
+ this.videoController.pause();
+ this.handleVideoPlay = false;
+ }
+ }
+
+ @Builder showLogoMedia(constraintSize) {
+ Stack({ alignContent: Alignment.Center }) {
+ Video({
+ src: $r("app.media.video"),
+ previewUri: $r('app.media.video_bg'),
+ controller: this.videoController
+ })
+ .visibility(this.handleVideoPlay ? Visibility.Visible : Visibility.Hidden)
+ .zIndex(this.indexVideo)
+ .controls(false)
+ .clip(true)
+ .objectFit(ImageFit.Cover)
+ .onFinish(() => {
+ if (this.onVideoFinished) {
+ if (!this.onVideoFinished()) {
+ this.videoController.start();
+ }
+ }
+ })
+ .onPrepared(() => {
+ this.onChange(); // when video Prepared.
+ })
+ Image($r('app.media.video_bg'))
+ .objectFit(ImageFit.Cover)
+ .zIndex(this.indexImage)
+ }
+ .aspectRatio(DeviceUtils.getDeviceType() == 'tablet' ? this.aspectRatioHorizontal : this.aspectRatioVertical)
+ .constraintSize(constraintSize)
+ .clip(true)
+ .borderRadius($r('app.float.card_border_radius'))
+ .width(constraintSize?.maxWidth ? "100%" : "67%")
+ }
+
+ build() {
+ if (DeviceUtils.getDeviceType() == 'tablet') {
+ this.showLogoMedia({ minWidth: $r('app.float.home_card_min_width')})
+ } else {
+ this.showLogoMedia({ minWidth: $r('app.float.home_card_min_width'), maxWidth: $r('app.float.home_card_max_width')})
+ }
+ }
+}
diff --git a/common/src/main/ets/component/TitleBar.ets b/common/src/main/ets/component/TitleBar.ets
new file mode 100644
index 0000000000000000000000000000000000000000..fa333955c13b336b1441115205cad92c6872e313
--- /dev/null
+++ b/common/src/main/ets/component/TitleBar.ets
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2023 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import router from '@ohos.router';
+import { LogUtils } from '../util/LogUtils';
+
+/**
+ * titleBar
+ *
+ * @since 2022-06-06
+ */
+@Component
+export struct TitleBar {
+ private static readonly TAG = "TitleBar";
+ private title: string | Resource;
+ private onBack?: () => boolean;
+
+ build() {
+ Flex({ justifyContent: FlexAlign.SpaceBetween }) {
+ Row() {
+ Row() {
+ Image($r('app.media.back'))
+ .width($r('app.float.title_bar_icon_width'))
+ .height($r('app.float.title_bar_icon_height'))
+ .objectFit(ImageFit.Contain)
+ }.height($r('app.float.title_bar_height'))
+ .margin({ left: $r('app.float.title_bar_icon_margin_left') })
+ .onClick(() => {
+ let isCanNotBack = this.onBack?.();
+ if (isCanNotBack) {
+ LogUtils.info(TitleBar.TAG, 'can not router back');
+ return;
+ }
+ LogUtils.info(TitleBar.TAG, 'terminateSelf.');
+ router.back();
+ })
+
+ Text(this.title)
+ .fontSize($r('app.float.text_size_title_bar'))
+ .fontColor(Color.Black)
+ .margin({ left: $r('app.float.title_bar_text_margin_left') })
+ .fontWeight(FontWeight.Bold)
+ }.flexGrow(1)
+ .height($r('app.float.title_bar_height'))
+ }
+ }
+}
diff --git a/common/src/main/ets/manager/UpgradeInterface.ets b/common/src/main/ets/manager/UpgradeInterface.ets
new file mode 100644
index 0000000000000000000000000000000000000000..38ec094ff50f01c40bb838f8e9a9b82867ff591b
--- /dev/null
+++ b/common/src/main/ets/manager/UpgradeInterface.ets
@@ -0,0 +1,174 @@
+/*
+ * Copyright (c) 2023 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import type common from '@ohos.app.ability.common';
+import update from '@ohos.update';
+
+/**
+ * 升级控制接口
+ *
+ * @since 2022-12-01
+ */
+export interface IUpgradeControl {
+ /**
+ * 升级UX
+ */
+ page: IPage,
+
+ /**
+ * 升级提醒
+ */
+ notify: INotify
+}
+
+/**
+ * 更新日志
+ *
+ * @since 2022-12-01
+ */
+export interface ChangelogInfo {
+ /**
+ * 版本号
+ */
+ version?: string;
+
+ /**
+ * 版本大小
+ */
+ size?: string;
+
+ /**
+ * 更新日志
+ */
+ content: string;
+}
+
+/**
+ * 倒计时弹框信息
+ *
+ * @since 2022-12-01
+ */
+export interface CountDownDialogInfo {
+ /**
+ * 弹框消息体
+ */
+ dialogText: Resource;
+}
+
+/**
+ * 界面数据
+ *
+ * @since 2022-12-01
+ */
+export interface VersionPageInfo {
+ /**
+ * 版本号
+ */
+ version: string;
+
+ /**
+ * 版本大小
+ */
+ size?: number;
+
+ /**
+ * 生效模式
+ */
+ effectiveMode?: update.EffectiveMode;
+
+ /**
+ * 更新日志
+ */
+ changelog: ChangelogInfo;
+
+ /**
+ * 倒计时弹框显示内容
+ */
+ countDownDialogInfo?: CountDownDialogInfo;
+}
+
+/**
+ * ux页面显示内容
+ *
+ * @since 2022-12-01
+ */
+export interface IPage {
+ /**
+ * 取新版本数据
+ *
+ * @param versionComponents 升级包
+ * @param componentDescriptions 更新日志
+ * @return Promise 具体的新版本数据
+ */
+ getNewVersionPageInfo(versionComponents: Array,
+ componentDescriptions?: Array): Promise;
+
+ /**
+ * 取当前版本数据
+ *
+ * @param versionComponents 升级包
+ * @param componentDescriptions 更新日志
+ * @return VersionPageInfo 具体的当前版本数据
+ */
+ getCurrentVersionPageInfo(versionComponents: Array,
+ componentDescriptions: Array): VersionPageInfo;
+}
+
+/**
+ * 提醒
+ *
+ * @since 2022-12-01
+ */
+export interface INotify {
+ /**
+ * 下载进度通知
+ *
+ * @param version 版本号
+ * @param progress 进度
+ * @param context 上下文
+ */
+ showDownloading(version: string, progress: number, context: common.Context): Promise;
+
+ /**
+ * 升级失败通知
+ *
+ * @param versionName 版本号
+ * @param context 上下文
+ */
+ showUpgradeFailed(versionName: string, context: common.Context): Promise;
+
+ /**
+ * 升级成功通知
+ *
+ * @param versionName 版本号
+ * @param context 上下文
+ */
+ showUpgradeSuccess(versionName: string, context: common.Context): Promise;
+
+ /**
+ * 安装中通知
+ *
+ * @param version 版本号
+ * @param progress 进度
+ * @param context 上下文
+ */
+ showInstalling(version: string, progress: number, context: common.Context): Promise
+
+ /**
+ * 取消所有通知
+ */
+ cancelAll(): Promise;
+}
+
diff --git a/common/src/main/ets/util/DeviceUtils.ets b/common/src/main/ets/util/DeviceUtils.ets
new file mode 100644
index 0000000000000000000000000000000000000000..7be871381e2daeaf7032984f325c69b4590ffa72
--- /dev/null
+++ b/common/src/main/ets/util/DeviceUtils.ets
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2023 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import deviceInfo from '@ohos.deviceInfo';
+import i18n from '@ohos.i18n';
+
+/**
+ * 设备信息工具
+ *
+ * @since 2022-06-06
+ */
+export namespace DeviceUtils {
+ /**
+ * 获取设备类型
+ *
+ * @return 设备类型
+ */
+ export function getDeviceType(): string {
+ return deviceInfo.deviceType;
+ }
+
+ /**
+ * 获取显示版本号
+ *
+ * @return 显示版本号
+ */
+ export function getDisplayVersion(): string {
+ return deviceInfo.displayVersion;
+ }
+
+ /**
+ * 获取系统语言
+ *
+ * @return 系统语言
+ */
+ export function getSystemLanguage(): string {
+ let language = i18n.getSystemLanguage();
+ if (language == "zh-Hans") {
+ language = "zh-cn";
+ } else {
+ language = "en-us";
+ }
+ return language;
+ }
+
+ /**
+ * 取dialog位置
+ *
+ * @return dialog位置
+ */
+ export function getDialogLocation(): DialogAlignment{
+ return DialogAlignment.Bottom;
+ }
+
+ /**
+ * 取dialog偏移
+ *
+ * @return dialog偏移
+ */
+ export function getDialogOffsetY(): string | Resource {
+ return $r('app.float.dialog_location_offset_y');
+ }
+}
\ No newline at end of file
diff --git a/common/src/main/ets/util/FormatUtils.ts b/common/src/main/ets/util/FormatUtils.ts
new file mode 100644
index 0000000000000000000000000000000000000000..cb46447d7a25004872521476c0fbeb9d68fee226
--- /dev/null
+++ b/common/src/main/ets/util/FormatUtils.ts
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2023 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import type common from '@ohos.app.ability.common';
+import { DeviceUtils } from '../util/DeviceUtils';
+
+/**
+ * 格式化工具
+ *
+ * @since 2022-06-06
+ */
+export namespace FormatUtils {
+ const DECIMAL_POINT = 2;
+
+ /**
+ * 格式化文件大小
+ *
+ * @param bytes 文件大小
+ * @param decimalPoint 精确到小数点后两位
+ * @return 格式化后的字符串
+ */
+ export function formatFileSize(bytes: number, decimalPoint = DECIMAL_POINT): string {
+ if (bytes <= 0) {
+ return '0 Bytes';
+ }
+ const MAX_BYTES: number = 1024 * 1024 * 1024;
+ const DOWN_POINT: number = 0;
+ const UP_POINT: number = 5;
+ const ONE_KB = 1024;
+ let data: number = Math.min(bytes, MAX_BYTES);
+ let point: number = Math.min(Math.max(decimalPoint, DOWN_POINT), UP_POINT);
+ let sizes = ['Bytes', 'KB', 'MB', 'GB'];
+ let index = Math.floor(Math.log(data) / Math.log(ONE_KB));
+ return parseFloat((bytes / Math.pow(ONE_KB, index)).toFixed(point)) + ' ' + sizes[index];
+ }
+
+ /**
+ * 格式化字符串
+ *
+ * @param 待格式化的字符串
+ * @param args 待匹配的内容
+ * @return 格式化后的字符串
+ */
+ export function formatStr(message: string, ...args: (string | number)[]): string {
+ if (!message) {
+ return '';
+ }
+ const PLACE_HOLDER = new RegExp('%s|%d|%[0-9]\\$s');
+ let segments = message.split(PLACE_HOLDER);
+ let formattedStr: string = '';
+ for (let i = 0; i < segments.length; i++) {
+ formattedStr += segments[i];
+ if (i !== segments.length - 1) {
+ formattedStr += args[i] ? args[i] : '';
+ }
+ }
+ return formattedStr;
+ }
+
+ /**
+ * 字符串或字符串资源转大写
+ *
+ * @param context 上下文
+ * @param text 待格式化的字符串
+ * @param args 待匹配的内容
+ * @return 转大写后的字符串
+ */
+ export function toUpperCase(context: common.Context, text: ResourceStr, ...args: (string | number)[]): string {
+ if (!text) {
+ return '';
+ }
+ if (typeof text === 'string') {
+ return text.toUpperCase();
+ } else {
+ let message: string = context?.resourceManager.getStringSync(text.id);
+ return formatStr(message, ...args).toUpperCase();
+ }
+ }
+
+ /**
+ * 数字格式化
+ *
+ * @param num 待格式化数字
+ * @return 格式化之后的数字
+ */
+ export function getNumberFormat(num: number): string {
+ let language: string = DeviceUtils.getSystemLanguage();
+ let numfmt: Intl.NumberFormat = new Intl.NumberFormat(language, {style:'percent', notation:'standard'});
+ return numfmt.format(num);
+ }
+}
\ No newline at end of file
diff --git a/common/src/main/ets/util/LogUtils.ts b/common/src/main/ets/util/LogUtils.ts
new file mode 100644
index 0000000000000000000000000000000000000000..4211bbb30b0c1678367cbdf6095987f2adfd6e8f
--- /dev/null
+++ b/common/src/main/ets/util/LogUtils.ts
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2023 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import Logger from '@ohos.hilog';
+
+/**
+ * 日志打印工具
+ *
+ * @since 2022-06-06
+ */
+export namespace LogUtils {
+ const DOMAIN = 0x0A00;
+
+ /**
+ * 输出debug日志
+ *
+ * @param tag 标题
+ * @param message 日志信息
+ * @param args 附加信息
+ */
+ export function debug(tag: string, message: string, ...args: (string | number)[]): void {
+ Logger.debug(DOMAIN, tag, filterSensitiveInfo(message), ...args);
+ }
+
+ /**
+ * 输出info日志
+ *
+ * @param tag 标题
+ * @param message 日志信息
+ * @param args 附加信息
+ */
+ export function log(tag: string, message: string, ...args: (string | number)[]): void {
+ Logger.info(DOMAIN, tag, filterSensitiveInfo(message), ...args);
+ }
+
+ /**
+ * 输出info日志
+ *
+ * @param tag 标题
+ * @param message 日志信息
+ * @param args 附加信息
+ */
+ export function info(tag: string, message: string, ...args: (string | number)[]): void {
+ Logger.info(DOMAIN, tag, filterSensitiveInfo(message), ...args);
+ }
+
+ /**
+ * 输出warn日志
+ *
+ * @param tag 标题
+ * @param message 日志信息
+ * @param args 附加信息
+ */
+ export function warn(tag: string, message: string, ...args: (string | number)[]): void {
+ Logger.warn(DOMAIN, tag, filterSensitiveInfo(message), ...args);
+ }
+
+ /**
+ * 输出error日志
+ *
+ * @param tag 标题
+ * @param message 日志信息
+ * @param args 附加信息
+ */
+ export function error(tag: string, message: string, ...args: (string | number)[]): void {
+ Logger.error(DOMAIN, tag, filterSensitiveInfo(message), ...args);
+ }
+
+ function filterSensitiveInfo(message: string): string {
+ let result: string = message;
+ if (result) {
+ result = filterUrl(result, true);
+ result = filterUrl(result, false);
+ }
+ return result;
+ }
+
+ function filterUrl(message: string, isHttps: boolean): string {
+ let replaceStr: string = isHttps ? 'https://' : 'http://';
+ let result: string = '';
+ let tempResult: string = message;
+ let startIndex: number = tempResult.indexOf(replaceStr);
+ while (startIndex >= 0) {
+ result += tempResult.substring(0, startIndex) + replaceStr + '****';
+ tempResult = tempResult.substring(startIndex + replaceStr.length);
+ let endIndex: number = tempResult.indexOf('/');
+ tempResult = endIndex >= 0 ? tempResult.substring(endIndex) : '';
+ startIndex = tempResult.indexOf(replaceStr);
+ }
+ result += tempResult;
+ return result;
+ }
+}
\ No newline at end of file
diff --git a/common/src/main/ets/util/UpdateUtils.ets b/common/src/main/ets/util/UpdateUtils.ets
new file mode 100644
index 0000000000000000000000000000000000000000..30247452275e2cd9e3ec3346d8eaab9a45c4558d
--- /dev/null
+++ b/common/src/main/ets/util/UpdateUtils.ets
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2023 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import update from '@ohos.update';
+import { LogUtils } from './LogUtils';
+
+/**
+ * 接口工具
+ *
+ * @since 2022-06-06
+ */
+export namespace UpdateUtils {
+ /**
+ * 获取changelog信息
+ *
+ * @param componentDescriptions 新版本更新日志集合
+ * @param componentId 组件id
+ * @return changelog
+ */
+ export function obtainDescription(componentDescriptions: Array, componentId: string): string {
+ if (!componentDescriptions || componentId == null) {
+ return '';
+ }
+ let descArray: Array = >componentDescriptions;
+ for (let index = 0; index < descArray.length; index++) {
+ if (componentId === descArray[index]?.componentId) {
+ let description = descArray[index]?.descriptionInfo?.content;
+ let descriptionType = descArray[index]?.descriptionInfo?.descriptionType;
+ if (descriptionType != update.DescriptionType.CONTENT || description == null) {
+ description = '';
+ }
+ return description;
+ }
+ }
+ return '';
+ }
+}
\ No newline at end of file
diff --git a/common/src/main/module.json5 b/common/src/main/module.json5
new file mode 100644
index 0000000000000000000000000000000000000000..a8e96fe669df096000c844ea2008e34866fe2bc2
--- /dev/null
+++ b/common/src/main/module.json5
@@ -0,0 +1,20 @@
+{
+ "module": {
+ "name": "common",
+ "type": "har",
+ "deviceTypes": [
+ "default",
+ "tablet"
+ ],
+ "metadata": [
+ {
+ "name": "ArkTSPartialUpdate",
+ "value": "true"
+ },
+ {
+ "name": "partialUpdateStrictCheck",
+ "value": "warn"
+ }
+ ]
+ }
+}
diff --git a/common/src/main/resources/base/element/color.json b/common/src/main/resources/base/element/color.json
new file mode 100644
index 0000000000000000000000000000000000000000..1a374f7cd1363a7ddf3b825ed4a26e7aa1360288
--- /dev/null
+++ b/common/src/main/resources/base/element/color.json
@@ -0,0 +1,12 @@
+{
+ "color": [
+ {
+ "name": "card_background",
+ "value": "#FFFFFF"
+ },
+ {
+ "name": "blue",
+ "value": "#0A59F7"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/common/src/main/resources/base/element/float.json b/common/src/main/resources/base/element/float.json
new file mode 100644
index 0000000000000000000000000000000000000000..163fc3dda9c49744926a6a399f5d0827823667c4
--- /dev/null
+++ b/common/src/main/resources/base/element/float.json
@@ -0,0 +1,153 @@
+{
+ "float": [
+ {
+ "name": "custom_button_width",
+ "value": "192vp"
+ },
+ {
+ "name": "custom_button_text_margin_left",
+ "value": "16vp"
+ },
+ {
+ "name": "custom_button_text_margin_right",
+ "value": "16vp"
+ },
+ {
+ "name": "custom_button_height",
+ "value": "40vp"
+ },
+ {
+ "name": "new_version_progress_bar_size",
+ "value": "136vp"
+ },
+ {
+ "name": "new_version_progress_bar_margin_top",
+ "value": "0"
+ },
+ {
+ "name": "new_version_progress_bar_margin_bottom",
+ "value": "16vp"
+ },
+ {
+ "name": "new_version_download_status_label_margin_bottom",
+ "value": "16vp"
+ },
+ {
+ "name": "text_size_title_bar",
+ "value": "20fp"
+ },
+ {
+ "name": "text_size_progress_bar",
+ "value": "36fp"
+ },
+ {
+ "name": "text_size_title",
+ "value": "16fp"
+ },
+ {
+ "name": "text_size_body",
+ "value": "14fp"
+ },
+ {
+ "name": "text_size_btn",
+ "value": "16fp"
+ },
+ {
+ "name": "text_size_os_version",
+ "value": "16fp"
+ },
+ {
+ "name": "title_bar_height",
+ "value": "56vp"
+ },
+ {
+ "name": "title_bar_icon_width",
+ "value": "24vp"
+ },
+ {
+ "name": "title_bar_icon_height",
+ "value": "24vp"
+ },
+ {
+ "name": "title_bar_icon_margin_left",
+ "value": "24vp"
+ },
+ {
+ "name": "title_bar_icon_margin_right",
+ "value": "24vp"
+ },
+ {
+ "name": "title_bar_text_margin_left",
+ "value": "16vp"
+ },
+ {
+ "name": "home_card_min_width",
+ "value": "300vp"
+ },
+ {
+ "name": "home_card_max_width",
+ "value": "624vp"
+ },
+ {
+ "name": "home_card_margin_horizontal",
+ "value": "20vp"
+ },
+ {
+ "name": "index_dot_width",
+ "value": "18vp"
+ },
+ {
+ "name": "progress_stroke_width",
+ "value": "18vp"
+ },
+ {
+ "name": "progress_number_margin_right",
+ "value": "2vp"
+ },
+ {
+ "name": "progress_logo_other_width",
+ "value": "221vp"
+ },
+ {
+ "name": "progress_logo_other_height",
+ "value": "40vp"
+ },
+ {
+ "name": "progress_logo_other_padding_top",
+ "value": "48vp"
+ },
+ {
+ "name": "progress_logo_other_padding_bottom",
+ "value": "40vp"
+ },
+ {
+ "name": "progress_logo_other_text_margin_top",
+ "value": "16vp"
+ },
+
+ {
+ "name": "setting_options_margin_top",
+ "value": "8vp"
+ },
+ {
+ "name": "setting_options_padding_vertical",
+ "value": "6vp"
+ },
+ {
+ "name": "setting_options_padding_horizontal",
+ "value": "12vp"
+ },
+ {
+ "name": "card_border_radius",
+ "value": "16vp"
+ },
+ {
+ "name": "dialog_location_offset_y",
+ "value": "-12vp"
+ },
+ {
+ "name": "divider_margin",
+ "value": "8vp"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/common/src/main/resources/base/element/string.json b/common/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..358eb0b0184b7f54e0d445db6b0a7e0caa1db349
--- /dev/null
+++ b/common/src/main/resources/base/element/string.json
@@ -0,0 +1,12 @@
+{
+ "string": [
+ {
+ "name": "entry_MainAbility",
+ "value": "Software update"
+ },
+ {
+ "name": "description_mainability",
+ "value": "OUC Ability"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/common/src/main/resources/base/media/back.png b/common/src/main/resources/base/media/back.png
new file mode 100644
index 0000000000000000000000000000000000000000..b59dd5a42e58a26aa0ac6b9a9bc66a816b2418d3
Binary files /dev/null and b/common/src/main/resources/base/media/back.png differ
diff --git a/common/src/main/resources/base/media/logo.png b/common/src/main/resources/base/media/logo.png
new file mode 100644
index 0000000000000000000000000000000000000000..ea4799da3547a4278e983ef1903201808a23a1bf
Binary files /dev/null and b/common/src/main/resources/base/media/logo.png differ
diff --git a/common/src/main/resources/base/media/video.mp4 b/common/src/main/resources/base/media/video.mp4
new file mode 100644
index 0000000000000000000000000000000000000000..1657cf3ceeb4787016d0d1f2b19d15cd96f16533
--- /dev/null
+++ b/common/src/main/resources/base/media/video.mp4
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5de3c0193903d70c23b76e197771ec698f4fd6ead023918ab5746dc664c051ae
+size 1884896
diff --git a/common/src/main/resources/base/media/video_bg.png b/common/src/main/resources/base/media/video_bg.png
new file mode 100644
index 0000000000000000000000000000000000000000..0de8aa10d6fb105318e80ebea9b9f015a7570ce6
Binary files /dev/null and b/common/src/main/resources/base/media/video_bg.png differ
diff --git a/common/src/main/resources/zh_CN/element/string.json b/common/src/main/resources/zh_CN/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..ded331c9febd05caf92e1c7257dc3225e097cee5
--- /dev/null
+++ b/common/src/main/resources/zh_CN/element/string.json
@@ -0,0 +1,12 @@
+{
+ "string": [
+ {
+ "name": "entry_MainAbility",
+ "value": "软件更新"
+ },
+ {
+ "name": "description_mainability",
+ "value": "OUC Ability"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/entry/src/main/config.json b/entry/src/main/config.json
deleted file mode 100644
index 8035b7263d7318c09b402f276ac9fb252ece7c75..0000000000000000000000000000000000000000
--- a/entry/src/main/config.json
+++ /dev/null
@@ -1,61 +0,0 @@
-{
- "app": {
- "bundleName": "com.ohos.ota.updateclient",
- "vendor": "ohos",
- "version": {
- "code": 1,
- "name": "1.0"
- },
- "apiVersion": {
- "compatible": 8,
- "target": 8,
- "releaseType": "Beta2"
- }
- },
- "deviceConfig": {},
- "module": {
- "package": "com.ohos.ota.updateclient",
- "name": ".MyApplication",
- "deviceType": [
- "phone"
- ],
- "distro": {
- "deliveryWithInstall": true,
- "moduleName": "entry",
- "moduleType": "entry"
- },
- "abilities": [
- {
- "skills": [
- {
- "entities": [
- "entity.system.home",
- "flag.hw.home.intent.from.system"
- ],
- "actions": [
- "action.system.home"
- ]
- }
- ],
- "name": "com.ohos.ota.updateclient.MainAbility",
- "icon": "$media:icon",
- "description": "$string:mainability_description",
- "label": "updateclient",
- "type": "page",
- "launchType": "standard"
- }
- ],
- "js": [
- {
- "pages": [
- "pages/index/index"
- ],
- "name": "default",
- "window": {
- "designWidth": 720,
- "autoDesignWidth": false
- }
- }
- ]
- }
-}
\ No newline at end of file
diff --git a/entry/src/main/js/default/common/background.png b/entry/src/main/js/default/common/background.png
deleted file mode 100644
index d5f880e4020704408af6861dc4b8e105cf0332d0..0000000000000000000000000000000000000000
Binary files a/entry/src/main/js/default/common/background.png and /dev/null differ
diff --git a/entry/src/main/js/default/common/load.png b/entry/src/main/js/default/common/load.png
deleted file mode 100644
index 5121c177a42946ddd6f6487ca758829b4dc67706..0000000000000000000000000000000000000000
Binary files a/entry/src/main/js/default/common/load.png and /dev/null differ
diff --git a/entry/src/main/js/default/pages/index/index.css b/entry/src/main/js/default/pages/index/index.css
deleted file mode 100644
index d105e651e70a8535a37472de790bbc62363c7b77..0000000000000000000000000000000000000000
--- a/entry/src/main/js/default/pages/index/index.css
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * Copyright (c) 2021 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-.container {
- background-color: white;
- flex-direction: column;
- background-image: url("/common/background.png");
- background-size: 100% 85%;
- background-repeat: no-repeat;
- background-position: 0 100%;
- font-family: HYQiHei-65S;
-}
-.percent{
- text-align: right;
- font-weight: bolder;
- position: absolute;
- padding-left: 88%;
- padding-top: 6%;
-}
-
-
-.sign{
- color: black;
- padding-left: 20px;
- font-size: 80px;
-}
-
-.left{
- color: black;
- font-size: 40px;
- position: relative;
-}
-
-.banner1{
- width: 88%;
- height:9px;
- background-color: #E6E6E6;
-
-}
-.banner2{
- width: 0%;
- height: 9px;
- background-color: #0A9AFD;
- position: relative;
-}
-
-.loadImg {
- margin-top: 330px;
- width: 100px;
- height: 100px;
- margin-left: 300px;
- object-fit:scale-down;
- align-items: center;
- justify-content: center;
- animation-name: one2;
- animation-duration: 2s;
- animation-iteration-count: infinite;
- animation-timing-function: linear;
- margin-bottom: 50px;
-}
-@keyframes one2{
- from{
- transform: rotate(0deg) ;
- }
- to{
- transform: rotate(360deg);
- }
-}
-
-.title{
- color: black;
- padding-top: 350px;
- font-size: 60px;
- text-align: center;
- width: 100%;
- padding-bottom: 30px;
-
-}
-
-.title1{
- color: black;
- padding-left: 95px;
- font-size: 45px;
-}
-
-.title1_1{
- padding-top: 200px;
-}
-
-.allbutton {
- width: 400px;
- height: 80px;
- margin-left: 160px;
- margin-top: 30px;
- border-radius: 50px;
- background-color: #0A9AFD;
-}
-
-.button3{
- width: 400px;
- height: 80px;
- text-align: center;
- font-size: 50px;
- color: white;
-}
-
-.allbutton1 {
- width: 240px;
- height: 70px;
- margin-left: 110px;
- margin-top: 30px;
- border-radius: 50px;
- background-color: #0A9AFD;
-}
-
-.button1{
- width: 240px;
- height: 70px;
- border-radius: 50px;
- text-align: center;
- font-size: 36px;
- color: white;
-}
-
-.allbutton2 {
- width: 240px;
- height: 70px;
- text-align: center;
- margin-left: 40px;
- margin-top: 30px;
- border-radius: 50px;
- background-color: #0A9AFD;
-
-}
-
-.button2{
- color: white;
- width: 240px;
- height: 70px;
- border-radius: 50px;
- text-align: center;
- font-size: 36px;
-
-}
-
-.dialog-main {
- width: 500px;
-}
-.dialog-div {
- flex-direction: column;
- align-items: center;
-}
-.inner-txt {
- width: 400px;
- height: 160px;
- flex-direction: column;
- align-items: center;
- justify-content: space-around;
-}
-.inner-btn {
- width: 400px;
- height: 120px;
- justify-content: space-around;
- align-items: center;
-}
-
-
-
-
-
-
diff --git a/entry/src/main/js/default/pages/index/index.hml b/entry/src/main/js/default/pages/index/index.hml
deleted file mode 100644
index 157a50dc5fef409018c5475480e8c95758e1950d..0000000000000000000000000000000000000000
--- a/entry/src/main/js/default/pages/index/index.hml
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
- <
-
-
- 升级客户端
-
-
-
-
- {{width}}
-
-
- 当前版本:{{versionName}}
-
-
- {{title}}
-
-
- {{title}}
-
-
- {{upgradeInfo}}
-
-
-
- 版本号:{{versionName}}
-
-
- 包大小:{{size}}
-
-
- 更新日志:{{journal}}
-
-
- 注意事项: {{matter}}
-
-
-
-
-
-
- {{button}}
-
-
-
-
-
diff --git a/entry/src/main/js/default/pages/index/index.js b/entry/src/main/js/default/pages/index/index.js
deleted file mode 100644
index 2817037ebcfb0f453ee175d8bcaad3e27ad8f4d1..0000000000000000000000000000000000000000
--- a/entry/src/main/js/default/pages/index/index.js
+++ /dev/null
@@ -1,361 +0,0 @@
-/*
- * Copyright (c) 2021 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import prompt from '@ohos.prompt'
-import app from '@ohos.ability.featureAbility';
-import client from '@ohos.update';
-
-const HAS_NEW_VERSION = 1;
-const NO_NEW_VERSION = 0;
-const STATUS_CHECK_SUCCESS = 12;
-const PACKAGE_NAME = "com.ohos.ota.updateclient";
-const VENDOR = "public";
-const TAG = "OUC_DEMO ";
-var EventId = {
- EVENT_TASK_BASE: 0x01000000,
- EVENT_TASK_RECEIVE: 0x01000001,
- EVENT_TASK_CANCEL: 0x01000002,
- EVENT_DOWNLOAD_WAIT: 0x01000003,
- EVENT_DOWNLOAD_START: 0x01000004,
- EVENT_PROGRESS_UPDATE: 0x01000005,
- EVENT_DOWNLOAD_PAUSE: 0x01000006,
- EVENT_DOWNLOAD_RESUME: 0x01000007,
- EVENT_DOWNLOAD_SUCCESS: 0x01000008,
- EVENT_DOWNLOAD_FAIL: 0x01000009,
- EVENT_UPGRADE_WAIT: 0x01000010,
- EVENT_UPGRADE_START: 0x01000011,
- EVENT_UPGRADE_UPDATE: 0x01000012,
- EVENT_APPLY_WAIT: 0x01000013,
- EVENT_APPLY_START: 0x01000014,
- EVENT_UPGRADE_SUCCESS: 0x01000015,
- EVENT_UPGRADE_FAIL: 0x01000016
-}
-let upgradeInfo = {
- upgradeApp: PACKAGE_NAME,
- businessType: {
- vendor: VENDOR,
- subType: 1
- }
-}
-let eventClassifyInfo = {
- eventClassify: EventId.EVENT_TASK_BASE,
- extraInfo: ""
-}
-var temp = 0;
-let versionDigestInfo;
-let pauseDownloadOptions = {
- isAllowAutoResume: false
-}
-const page = {
- data: {
- title: "当前版本:10.2.1",
- button: "查看更新",
- pageType: "currVersion",
- versionName: "10.2.0",
- size: "20MB",
- journal: "本次更新解决了一些BUG。",
- matter: "请保持50%以上电量",
- showLoad: "",
- width: "5%",
- showBanner: "",
- showButton: "download",
- upgradeInfo: "",
- updater: Object(),
- timer: undefined,
- dialog: "",
- showSimpledialog: ""
- },
- onInit() {
- console.info(TAG + "onInit")
- try {
- page.data.updater = client.getOnlineUpdater(upgradeInfo);
- page.getCurrVersion();
- } catch (error) {
- console.error(TAG + "onInit error: " + JSON.stringify(error));
- }
- },
- onClick: function () {
- if (page.data.pageType == "currVersion") { // 检查更新版本
- page.data.pageType = "checkVersion";
- page.data.button = "取消查看";
- page.data.showLoad = "load";
- page.checkNewVersion();
- } else if (page.data.pageType == "newVersion") { // 当前需要下载新的版本
- page.data.pageType = "downVersion";
- page.data.showLoad = "load";
- page.data.showBanner = 'banner';
- page.data.button = "暂停下载";
- if (page.data.updater == undefined) {
- page.data.pageType = "errorPage";
- page.data.showButton = 'download';
- page.data.button = '退出';
- page.data.title = "初始化出现错误,退出app";
- return;
- }
- this.download()
- } else if (this.pageType == "lastVersion") { // 已经是新的版本了,单击后退出页面
- page.data.showLoad = "";
- app.terminateSelf();
- } else if (page.data.pageType == "checkVersion") { // 检查中,取消检查
- page.data.showSimpledialog = "simpledialog";
- this.$element('simpledialog').show();
- page.data.dialog = "是否取消检查";
- } else if (page.data.pageType == "downVersion") { // 下载中,取消下载
- page.data.showSimpledialog = "simpledialog";
- page.data.dialog = "是否暂停下载!";
- this.$element('simpledialog').show();
- temp = 1;
- } else if (page.data.pageType == "errorPage") { // 出错,退出
- app.terminateSelf();
- }
- },
- download() {
- console.info(TAG + "download");
- page.data.updater.on(eventClassifyInfo, eventInfo => {
- console.info(TAG + "download eventInfo: " + JSON.stringify(eventInfo))
- if (page.data.pageType != "downVersion") {
- return;
- }
- let progress = {
- status: eventInfo.taskBody?.status,
- percent: eventInfo.taskBody?.progress,
- endReason: eventInfo.taskBody?.errorMessages?.[0]?.errorCode?.toString()
- }
- let percent = progress.percent;
- if (progress.percent > 5) {
- percent = progress.percent - 5;
- } else if (progress.percent > 90) {
- percent = 90;
- }
- page.data.width = percent + '%';
- if (progress.percent == 100) {
- page.data.showLoad = "";
- page.data.showBanner = '';
- if (temp == 1) {
- this.$element('simpledialog').close();
- }
- }
- // 下载成功 UpdateState.UPDATE_STATE_DOWNLOAD_SUCCESS
- if (eventInfo.eventId == EventId.EVENT_DOWNLOAD_SUCCESS) {
- page.data.pageType = "downSuccess";
- page.data.showButton = "upgrade";
- page.data.upgradeInfo = page.data.versionName + "安装包下载完成,是否安装?";
- } else if (eventInfo.eventId == EventId.EVENT_DOWNLOAD_FAIL) { // 失败
- page.data.pageType = "errorPage";
- page.data.showButton = 'download';
- page.data.button = '退出';
- page.data.title = "下载失败";
- if (progress.endReason) {
- page.data.title = "下载失败,失败原因:" + progress.endReason;
- }
- }
- });
- let downloadOptions = {
- allowNetwork: 1,
- order: 1
- }
- page.data.updater.download(versionDigestInfo, downloadOptions).then(result => {
- console.info(TAG + "download result: " + JSON.stringify(result));
- }).catch(err => {
- console.error(TAG + "download err: " + JSON.stringify(err));
- });
- },
- clickInstall: function () {
- if (page.data.pageType == "downSuccess") { // 下载成功,开始升级
- page.upgrade();
- }
- },
-
- clickCancel: function () {
- if (page.data.pageType == "downSuccess") { // 下载成功,取消升级
- page.data.showSimpledialog = "simpledialog";
- page.data.dialog = "是否稍后安装";
- this.$element('simpledialog').show();
- }
- },
-
- getCurrVersion() {
- console.info(TAG + "getCurrVersion");
- if (page.data.updater == undefined) {
- page.data.pageType = "errorPage";
- page.data.showButton = 'download';
- page.data.button = '退出';
- page.data.title = "初始化出现错误,退出app";
- return;
- }
-
- // 获取版本信息
- page.data.updater.getTaskInfo().then(taskInfo => {
- console.info(TAG + "getTaskInfo result: " + JSON.stringify(taskInfo));
- let taskStatus = taskInfo?.taskBody?.status;
- if (taskStatus < STATUS_CHECK_SUCCESS) {
- this.checkNewVersionLocal();
- } else {
- this.getNewVersionInfoLocal();
- }
- });
- },
-
- checkNewVersionLocal() {
- page.data.updater.checkNewVersion().then(data => {
- console.info(TAG + "checkNewVersion result: " + JSON.stringify(data));
- if (data.isExistNewVersion == NO_NEW_VERSION) { // 已经是新版本
- page.data.title = "当前已经是新版本";
- page.data.button = "确定";
- page.data.pageType = "lastVersion";
- page.data.versionName = data?.newVersionInfo?.versionComponents?.[0]?.displayVersion;
- } else if (data.isExistNewVersion == HAS_NEW_VERSION) {
- page.data.button = "查看更新";
- page.data.pageType = "currVersion";
- page.data.versionName = data?.newVersionInfo?.versionComponents?.[0]?.displayVersion;
- } else {
- page.data.title = "获取新版本失败";
- }
- }).catch(error => {
- console.info(TAG + "checkNewVersion error: " + JSON.stringify(error));
- page.data.pageType = "errorPage";
- page.data.showButton = 'download';
- page.data.button = '退出';
- page.data.title = "检查新版本失败";
- if (error.errorNum) {
- page.data.title = "检查新版本失败,失败原因:" + error.errorNum;
- }
- });
- },
-
- getNewVersionInfoLocal() {
- page.data.updater.getNewVersionInfo().then(data => {
- console.info(TAG + "getNewVersionInfo result: " + JSON.stringify(data));
- page.data.button = "查看更新";
- page.data.pageType = "currVersion";
- page.data.versionName = data?.versionComponents?.[0]?.displayVersion;
- }).catch(error => {
- console.info(TAG + "getNewVersionInfo error: " + JSON.stringify(error));
- page.data.pageType = "errorPage";
- page.data.showButton = 'download';
- page.data.button = '退出';
- page.data.title = "检查新版本失败";
- if (error.errorNum) {
- page.data.title = "检查新版本失败,失败原因:" + error.errorNum;
- }
- });
- },
-
- checkNewVersion: function () {
- if (page.data.updater == undefined) {
- page.data.pageType = "errorPage";
- page.data.showButton = 'download';
- page.data.button = '退出';
- page.data.title = "初始化出现错误,退出app";
- return;
- }
- console.info(TAG + "checkNewVersion");
- page.data.updater.getNewVersionInfo().then(info => {
- console.info(TAG + "checkNewVersion getNewVersionInfo: " + JSON.stringify(info));
- versionDigestInfo = info?.versionDigestInfo;
- page.data.showLoad = "";
- let size = info?.versionComponents?.[0]?.size / 1024 / 1024;
- page.data.versionName = info?.versionComponents?.[0]?.displayVersion;
- page.data.size = String(size.toFixed(2)) + "MB";
- if (info?.versionComponents?.[0]?.descriptionInfo?.content != undefined) {
- page.data.journal = info?.versionComponents?.[0]?.descriptionInfo?.content;
- }
- page.data.pageType = "newVersion";
- page.data.button = "下载更新包";
- }).catch(error => {
- page.data.pageType = "errorPage";
- page.data.showButton = 'download';
- page.data.button = '退出';
- page.data.title = "检查新版本失败";
- if (error.errorNum) {
- page.data.title = "检查新版本失败,失败原因:" + error.errorNum;
- }
- });
- },
-
- upgrade() {
- if (page.data.updater == undefined) {
- page.data.pageType = "errorPage";
- page.data.showButton = 'download';
- page.data.button = '退出';
- page.data.title = "初始化出现错误,退出app";
- return;
- }
- page.data.updater.on(eventClassifyInfo, eventInfo => {
- console.info(TAG + "upgrade eventInfo: " + JSON.stringify(eventInfo));
- let progress = {
- status: eventInfo.taskBody?.status,
- percent: eventInfo.taskBody?.progress,
- endReason: eventInfo.taskBody?.errorMessages?.[0]?.errorCode?.toString()
- }
- page.data.width = progress.percent + '%';
- if (progress.status == EventId.EVENT_UPGRADE_FAIL) { // 失败
- page.data.showLoad = "";
- page.data.pageType = "errorPage";
- page.data.showButton = 'download';
- page.data.button = '退出';
- page.data.title = "升级失败,失败原因:" + progress.endReason;
- }
- });
- let upgradeOptions = {
- order: 2
- }
- page.data.updater.upgrade(versionDigestInfo, upgradeOptions).then(result => {
- console.info(TAG + "upgrade result: " + JSON.stringify(result));
- }).catch(err => {
- console.error(TAG + "upgrade err: " + JSON.stringify(err));
- });
- },
-
- closeDialog() {
- this.$element('simpledialog').close();
- },
-
- cancelDialog() {
- prompt.showToast({
- message: '取消对话框'
- })
- },
- cancelSchedule(e) {
- this.$element('simpledialog').close()
- prompt.showToast({
- message: '取消成功'
- })
- },
- setSchedule(e) {
- this.$element('simpledialog').close()
- prompt.showToast({
- message: '确定成功'
- })
- if (page.data.pageType == "downVersion") {
- page.data.showLoad = "";
- page.data.showBanner = '';
- page.data.pageType = "newVersion";
- page.data.button = "下载更新包";
- page.data.updater.pauseDownload(versionDigestInfo, pauseDownloadOptions);
- } else if (page.data.pageType == "downSuccess") {
- page.data.upgradeInfo = "";
- page.data.showButton = 'download';
- page.data.button = "查看更新";
- page.data.pageType = "currVersion";
- page.getCurrVersion();
- } else if (page.data.pageType == "checkVersion") {
- page.data.button = "检查更新";
- page.getCurrVersion();
- }
- }
-}
-
-export default page;
\ No newline at end of file
diff --git a/entry/src/main/resources/base/media/icon.png b/entry/src/main/resources/base/media/icon.png
deleted file mode 100644
index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000
Binary files a/entry/src/main/resources/base/media/icon.png and /dev/null differ
diff --git a/feature/ota/build-profile.json5 b/feature/ota/build-profile.json5
new file mode 100644
index 0000000000000000000000000000000000000000..35dff6d53cb3a241f8de4fb68bd01d38ade0f108
--- /dev/null
+++ b/feature/ota/build-profile.json5
@@ -0,0 +1,5 @@
+{
+ "apiType": "stageMode",
+ "buildOption": {
+ }
+}
diff --git a/feature/ota/hvigorfile.ts b/feature/ota/hvigorfile.ts
new file mode 100644
index 0000000000000000000000000000000000000000..29ad39fd474172b967a75ac68a73cf2da049b182
--- /dev/null
+++ b/feature/ota/hvigorfile.ts
@@ -0,0 +1,3 @@
+// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
+module.exports = require('@ohos/hvigor-ohos-plugin').harTasks;
+
diff --git a/feature/ota/package-lock.json b/feature/ota/package-lock.json
new file mode 100644
index 0000000000000000000000000000000000000000..5382de11f67664d5295db75e4004a18edf896b00
--- /dev/null
+++ b/feature/ota/package-lock.json
@@ -0,0 +1,11 @@
+{
+ "name": "ota",
+ "version": "1.0.0",
+ "lockfileVersion": 1,
+ "requires": true,
+ "dependencies": {
+ "@ohos/common": {
+ "version": "file:../../common"
+ }
+ }
+}
diff --git a/feature/ota/package.json b/feature/ota/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..2abe885686d5a38c0a7c363b73c46379d149a694
--- /dev/null
+++ b/feature/ota/package.json
@@ -0,0 +1,16 @@
+{
+ "name": "ota",
+ "description": "a npm package which contains arkUI2.0 page",
+ "ohos": {
+ "org": ""
+ },
+ "version": "1.0.0",
+ "main": "index.ets",
+ "types": "",
+ "repository": {},
+ "license": "ISC",
+ "dependencies": {
+ "@ohos/common": "file:../../common"
+ },
+ "type": "module"
+}
diff --git a/feature/ota/src/main/ets/OtaPage.ets b/feature/ota/src/main/ets/OtaPage.ets
new file mode 100644
index 0000000000000000000000000000000000000000..c95427bf592a9c48ecef7185143a589e99995d6c
--- /dev/null
+++ b/feature/ota/src/main/ets/OtaPage.ets
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2023 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import update from '@ohos.update';
+import { IPage, VersionPageInfo } from '@ohos/common/src/main/ets/manager/UpgradeInterface';
+import { UpdateUtils } from '@ohos/common/src/main/ets/util/UpdateUtils';
+import { FormatUtils } from '@ohos/common/src/main/ets/util/FormatUtils';
+import VersionUtils from './util/VersionUtils';
+
+/**
+ * ota的ux显示数据
+ *
+ * @since 2022-12-01
+ */
+export class OtaPage implements IPage {
+ /**
+ * 取新版本数据
+ *
+ * @param versionComponents 升级包
+ * @param componentDescriptions 更新日志
+ * @return Promise 具体的新版本数据
+ */
+ public async getNewVersionPageInfo(versionComponents: Array,
+ componentDescriptions?: Array): Promise {
+ let component: update.VersionComponent = versionComponents.filter((component: update.VersionComponent) => {
+ return component.componentType == update.ComponentType.OTA;
+ })?.[0];
+ let componentId: string = component?.componentId;
+ let description: string = '';
+ if (componentDescriptions) {
+ description = UpdateUtils.obtainDescription(componentDescriptions, componentId);
+ }
+
+ return {
+ version: component.displayVersion,
+ size: component.size,
+ effectiveMode: component.effectiveMode,
+ changelog: {
+ version: component.displayVersion,
+ size: FormatUtils.formatFileSize(component.size),
+ content: description
+ },
+ countDownDialogInfo: {
+ dialogText: $r('app.string.count_down_install_label', component.displayVersion),
+ }
+ };
+ }
+
+ /**
+ * 取当前版本数据
+ *
+ * @param versionComponents 升级包
+ * @param componentDescriptions 更新日志
+ * @return VersionPageInfo 具体的当前版本数据
+ */
+ public getCurrentVersionPageInfo(versionComponents: Array,
+ componentDescriptions: Array): VersionPageInfo {
+ let component: update.VersionComponent = versionComponents.filter((component: update.VersionComponent) => {
+ return component.componentType == update.ComponentType.OTA;
+ })?.[0];
+ let componentId: string = component?.componentId;
+ let description: string = '';
+ if (componentDescriptions) {
+ description = UpdateUtils.obtainDescription(componentDescriptions, componentId);
+ }
+ return {
+ version: VersionUtils.getCurrentDisplayVersion(),
+ changelog: {
+ version: VersionUtils.getCurrentDisplayVersion(),
+ content: description
+ }
+ };
+ }
+}
\ No newline at end of file
diff --git a/feature/ota/src/main/ets/UpgradeAdapter.ets b/feature/ota/src/main/ets/UpgradeAdapter.ets
new file mode 100644
index 0000000000000000000000000000000000000000..3f1a78821a00bcc0f6489abaf78ac83dd7826c06
--- /dev/null
+++ b/feature/ota/src/main/ets/UpgradeAdapter.ets
@@ -0,0 +1,52 @@
+
+/*
+ * Copyright (c) 2023 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { OtaPage } from './OtaPage';
+import type { IPage } from '@ohos/common/src/main/ets/manager/UpgradeInterface';
+
+/**
+ * 升级适配器
+ *
+ * @since 2022-12-01
+ */
+export class UpgradeAdapter {
+ private _page: IPage;
+
+ private constructor() {
+ globalThis.upgradeAdapter = this;
+ }
+
+ /**
+ * 取单例对象
+ *
+ * @return 适配器对象
+ */
+ static getInstance(): UpgradeAdapter {
+ return (globalThis.upgradeAdapter as UpgradeAdapter) ?? new UpgradeAdapter();
+ }
+
+ /**
+ * 取支持的升级类型以及UX实例
+ *
+ * @return 支持的升级类型以及UX实例
+ */
+ getPageInstance(): IPage {
+ if (this._page) {
+ return this._page;
+ }
+ return new OtaPage();
+ }
+}
\ No newline at end of file
diff --git a/feature/ota/src/main/ets/util/RouterUtils.ts b/feature/ota/src/main/ets/util/RouterUtils.ts
new file mode 100644
index 0000000000000000000000000000000000000000..dfbab2f56c1393d034e1a5515d6f37b84bc6bdc4
--- /dev/null
+++ b/feature/ota/src/main/ets/util/RouterUtils.ts
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2023 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import router from '@ohos.router';
+
+/**
+ * 一秒对应的时间(1000)
+ */
+const SECOND_INTERVAL = 1000;
+
+/**
+ * 拉起主页面的等待时间(单位秒)
+ */
+const SECONDS_FOR_PAGE = 0.1;
+
+/**
+ * 路由工具
+ *
+ * @since 2022-06-06
+ */
+namespace RouterUtils {
+ function waitForSeconds(timeInSeconds: number): Promise {
+ return new Promise(resolver => {
+ setTimeout(resolver, timeInSeconds * SECOND_INTERVAL);
+ });
+ }
+
+ /**
+ * 拉起主页面,并清除其他页面
+ */
+ export async function singletonHomePage(): Promise {
+ router.clear();
+ await waitForSeconds(SECONDS_FOR_PAGE);
+ router.replace({ url: 'pages/index' });
+ }
+
+ /**
+ * 打开新版本页面
+ */
+ export function openNewVersionPage(): void {
+ router.push({ url: 'pages/newVersion' });
+ }
+
+ /**
+ * 打开当前版本页面
+ */
+ export function openCurrentVersion(): void {
+ router.push({ url: 'pages/currentVersion' });
+ }
+
+ /**
+ * 清理所有页面
+ */
+ export function clearAllPage(): void {
+ router.clear();
+ }
+
+ /**
+ * 是否能够跳转新版本页面
+ *
+ * @return 是否能够跳转
+ */
+ export async function isCanToNewVersion(): Promise {
+ return new Promise((resolve, reject) => {
+ resolve(true);
+ });
+ }
+}
+
+export default RouterUtils;
diff --git a/feature/ota/src/main/ets/util/ToastUtils.ts b/feature/ota/src/main/ets/util/ToastUtils.ts
new file mode 100644
index 0000000000000000000000000000000000000000..d2e5d40319e97900051496859a024d6477598d39
--- /dev/null
+++ b/feature/ota/src/main/ets/util/ToastUtils.ts
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2023 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import promptAction from '@ohos.promptAction';
+import { LogUtils } from '@ohos/common/src/main/ets/util/LogUtils';
+
+/**
+ * Toast工具
+ *
+ * @since 2023-01-10
+ */
+export namespace ToastUtils {
+ /**
+ * Toast调用
+ *
+ * @param message toast显示内容
+ */
+ export function showToast(message: string): void {
+ LogUtils.info('ToastUtils', 'start showToast');
+ promptAction.showToast({
+ message: message,
+ duration: 2000,
+ bottom: getToastLocation(),
+ });
+ }
+
+ /**
+ * 取toast位置
+ *
+ * @return toast位置
+ */
+ function getToastLocation(): string {
+ return '120vp';
+ }
+}
+
+export default ToastUtils;
diff --git a/feature/ota/src/main/ets/util/VersionUtils.ets b/feature/ota/src/main/ets/util/VersionUtils.ets
new file mode 100644
index 0000000000000000000000000000000000000000..9644395cde3afda907a65d3003d0e8c4e3de7215
--- /dev/null
+++ b/feature/ota/src/main/ets/util/VersionUtils.ets
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2023 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { DeviceUtils } from '@ohos/common/src/main/ets/util/DeviceUtils';
+
+/**
+ * 版本工具
+ *
+ * @since 2022-06-06
+ */
+export namespace VersionUtils {
+ /**
+ * 获取当前版本号
+ *
+ * @return 当前版本号
+ */
+ export function getCurrentDisplayVersion(): string {
+ return DeviceUtils.getDisplayVersion();
+ }
+
+ /**
+ * 获取主页的显示版本号
+ *
+ * @return 显示版本号
+ */
+ export function getDisplayVersionForIndex(): string {
+ return DeviceUtils.getDisplayVersion();
+ }
+}
+
+export default VersionUtils;
\ No newline at end of file
diff --git a/feature/ota/src/main/module.json5 b/feature/ota/src/main/module.json5
new file mode 100644
index 0000000000000000000000000000000000000000..bde744b846af4ab0150c993e7e647196492a43ba
--- /dev/null
+++ b/feature/ota/src/main/module.json5
@@ -0,0 +1,20 @@
+{
+ "module": {
+ "name": "ota",
+ "type": "har",
+ "deviceTypes": [
+ "default",
+ "tablet"
+ ],
+ "metadata": [
+ {
+ "name": "ArkTSPartialUpdate",
+ "value": "true"
+ },
+ {
+ "name": "partialUpdateStrictCheck",
+ "value": "warn"
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/feature/ota/src/main/resources/base/element/color.json b/feature/ota/src/main/resources/base/element/color.json
new file mode 100644
index 0000000000000000000000000000000000000000..419f42123f6559ec1fb333980a8fecf0793fd4eb
--- /dev/null
+++ b/feature/ota/src/main/resources/base/element/color.json
@@ -0,0 +1,20 @@
+{
+ "color": [
+ {
+ "name": "page_background",
+ "value": "#F1F3F5"
+ },
+ {
+ "name": "has_new_version_circle_fill",
+ "value": "#F7785C"
+ },
+ {
+ "name": "dialog_btn_background",
+ "value": "#FFFFFF"
+ },
+ {
+ "name": "dialog_divider_color",
+ "value": "#33000000"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/feature/ota/src/main/resources/base/element/float.json b/feature/ota/src/main/resources/base/element/float.json
new file mode 100644
index 0000000000000000000000000000000000000000..ab8ca2354b24faee923544bbc154af66a2ed50e6
--- /dev/null
+++ b/feature/ota/src/main/resources/base/element/float.json
@@ -0,0 +1,364 @@
+{
+ "float": [
+ {
+ "name": "home_logo_bottom_margin",
+ "value": "24vp"
+ },
+ {
+ "name": "home_new_version_label_top_margin",
+ "value": "12vp"
+ },
+ {
+ "name": "text_size_progress_bar_percent",
+ "value": "18fp"
+ },
+ {
+ "name": "text_size_version_name",
+ "value": "18fp"
+ },
+ {
+ "name": "home_text_size_version_name",
+ "value": "18fp"
+ },
+ {
+ "name": "text_size_version_size",
+ "value": "14fp"
+ },
+ {
+ "name": "text_size_dialog_title",
+ "value": "20fp"
+ },
+ {
+ "name": "text_size_dialog_body",
+ "value": "16fp"
+ },
+ {
+ "name": "index_version_name_margin_top",
+ "value": "24vp"
+ },
+ {
+ "name": "index_version_name_margin_bottom",
+ "value": "8vp"
+ },
+ {
+ "name": "index_has_new_version_margin_left",
+ "value": "8vp"
+ },
+ {
+ "name": "index_content_padding_horizontal",
+ "value": "20vp"
+ },
+ {
+ "name": "index_content_padding_bottom",
+ "value": "24vp"
+ },
+ {
+ "name": "progress_logo_phone_width",
+ "value": "120vp"
+ },
+ {
+ "name": "progress_logo_phone_height",
+ "value": "120vp"
+ },
+ {
+ "name": "progress_logo_phone_padding_top",
+ "value": "54vp"
+ },
+ {
+ "name": "progress_logo_phone_padding_bottom",
+ "value": "36vp"
+ },
+ {
+ "name": "new_version_size_margin_top",
+ "value": "8vp"
+ },
+ {
+ "name": "new_version_size_margin_bottom",
+ "value": "32vp"
+ },
+ {
+ "name": "new_version_button_padding_top",
+ "value": "24vp"
+ },
+ {
+ "name": "new_version_button_padding_bottom",
+ "value": "24vp"
+ },
+ {
+ "name": "changelog_phone_detail_margin_top",
+ "value": "8vp"
+ },
+ {
+ "name": "changelog_phone_content_padding",
+ "value": "12vp"
+ },
+ {
+ "name": "changelog_phone_padding",
+ "value": "12vp"
+ },
+ {
+ "name": "changelog_tablet_title_padding_top",
+ "value": "12vp"
+ },
+ {
+ "name": "changelog_tablet_start_content_padding_horizontal",
+ "value": "12vp"
+ },
+ {
+ "name": "changelog_tablet_start_content_padding_top",
+ "value": "16vp"
+ },
+ {
+ "name": "changelog_tablet_start_content_padding_bottom",
+ "value": "16vp"
+ },
+ {
+ "name": "changelog_tablet_start_content_margin_bottom",
+ "value": "24vp"
+ },
+ {
+ "name": "changelog_tablet_start_content_radius",
+ "value": "12vp"
+ },
+ {
+ "name": "changelog_end_content_margin_horizontal",
+ "value": "24vp"
+ },
+ {
+ "name": "changelog_tablet_end_content_margin_bottom",
+ "value": "36vp"
+ },
+ {
+ "name": "changelog_tablet_has_feature_padding_top",
+ "value": "8vp"
+ },
+ {
+ "name": "changelog_tablet_no_feature_padding_top",
+ "value": "4vp"
+ },
+ {
+ "name": "changelog_tablet_start_more_padding_top",
+ "value": "12vp"
+ },
+ {
+ "name": "changelog_tablet_start_detail_padding_top",
+ "value": "8vp"
+ },
+ {
+ "name": "changelog_detail_content_padding_horizontal",
+ "value": "12vp"
+ },
+ {
+ "name": "changelog_detail_content_padding_bottom",
+ "value": "24vp"
+ },
+ {
+ "name": "changelog_detail_content_margin_horizontal",
+ "value": "12vp"
+ },
+ {
+ "name": "changelog_detail_version_name_padding_left",
+ "value": "24vp"
+ },
+ {
+ "name": "changelog_detail_version_name_padding_top",
+ "value": "12vp"
+ },
+ {
+ "name": "changelog_detail_version_size_text_padding_top",
+ "value": "8vp"
+ },
+ {
+ "name": "changelog_detail_version_size_padding_left",
+ "value": "24vp"
+ },
+ {
+ "name": "changelog_detail_icon_title_icon_width",
+ "value": "40vp"
+ },
+ {
+ "name": "changelog_detail_icon_title_icon_height",
+ "value": "40vp"
+ },
+ {
+ "name": "changelog_detail_icon_title_title_padding_left",
+ "value": "16vp"
+ },
+ {
+ "name": "changelog_detail_icon_title_first_padding_top",
+ "value": "24vp"
+ },
+ {
+ "name": "changelog_detail_icon_title_other_padding_top",
+ "value": "48vp"
+ },
+ {
+ "name": "changelog_detail_sub_title_padding_top",
+ "value": "16vp"
+ },
+ {
+ "name": "changelog_detail_body_first_padding_top",
+ "value": "8vp"
+ },
+ {
+ "name": "changelog_detail_body_other_padding_top",
+ "value": "4vp"
+ },
+ {
+ "name": "current_version_name_margin_bottom",
+ "value": "8vp"
+ },
+ {
+ "name": "current_version_name_margin_bottom_single",
+ "value": "32vp"
+ },
+ {
+ "name": "setting_content_padding_top",
+ "value": "16vp"
+ },
+ {
+ "name": "setting_content_padding_horizontal",
+ "value": "24vp"
+ },
+ {
+ "name": "setting_options_margin_bottom",
+ "value": "16vp"
+ },
+ {
+ "name": "dialog_content_margin_vertical",
+ "value": "23vp"
+ },
+ {
+ "name": "dialog_divider_height",
+ "value": "24vp"
+ },
+ {
+ "name": "dialog_margin_horizontal",
+ "value": "24vp"
+ },
+ {
+ "name": "dialog_margin_bottom",
+ "value": "16vp"
+ },
+ {
+ "name": "dialog_margin_top",
+ "value": "12vp"
+ },
+ {
+ "name": "message_dialog_margin_vertical",
+ "value": "32vp"
+ },
+ {
+ "name": "message_dialog_text_padding_left",
+ "value": "12vp"
+ },
+ {
+ "name": "message_dialog_loading_progress_height",
+ "value": "40vp"
+ },
+ {
+ "name": "message_dialog_loading_progress_width",
+ "value": "40vp"
+ },
+ {
+ "name": "changelog_load_error_width",
+ "value": "120vp"
+ },
+ {
+ "name": "changelog_load_error_height",
+ "value": "120vp"
+ },
+ {
+ "name": "changelog_load_error_margin_top",
+ "value": "200vp"
+ },
+ {
+ "name": "changelog_load_error_margin",
+ "value": "120vp"
+ },
+ {
+ "name": "loading_progress_width",
+ "value": "72vp"
+ },
+ {
+ "name": "loading_progress_height",
+ "value": "72vp"
+ },
+ {
+ "name": "toast_bottom",
+ "value": "120vp"
+ },
+ {
+ "name": "changelog_detail_version_size_text_padding_bottom",
+ "value": "8vp"
+ },
+ {
+ "name": "changelog_load_err_view_margin_horizontal",
+ "value": "24vp"
+ },
+ {
+ "name": "changelog_detail_content_padding_top",
+ "value": "24vp"
+ },
+ {
+ "name": "changelog_detail_version_name_padding_right",
+ "value": "24vp"
+ },
+ {
+ "name": "changelog_content_title",
+ "value": "16fp"
+ },
+ {
+ "name": "changelog_content_word",
+ "value": "14fp"
+ },
+ {
+ "name": "changelog_content_learn_more",
+ "value": "14fp"
+ },
+ {
+ "name": "changelog_content_end_title",
+ "value": "14fp"
+ },
+ {
+ "name": "changelog_end_word",
+ "value": "12fp"
+ },
+ {
+ "name": "changelog_page_icon_title",
+ "value": "18fp"
+ },
+ {
+ "name": "text_version_size",
+ "value": "14fp"
+ },
+ {
+ "name": "changelog_content_SubTitle",
+ "value": "16fp"
+ },
+ {
+ "name": "dialog_button_height",
+ "value": "40vp"
+ },
+ {
+ "name": "ic_arrow_width",
+ "value": "14vp"
+ },
+ {
+ "name": "ic_arrow_height",
+ "value": "7vp"
+ },
+ {
+ "name": "version_padding",
+ "value": "24vp"
+ },
+ {
+ "name": "current_version_changelog_margin_bottom",
+ "value": "8vp"
+ },
+ {
+ "name": "dialog_row_margin_horizontal",
+ "value": "12vp"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/feature/ota/src/main/resources/base/element/string.json b/feature/ota/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..dc0d5f8be2b273e4969e44a89a4e7c43245b6927
--- /dev/null
+++ b/feature/ota/src/main/resources/base/element/string.json
@@ -0,0 +1,24 @@
+{
+ "string":[
+ {
+ "name":"btn_check_new_version",
+ "value":"Check for updates"
+ },
+ {
+ "name":"software_update",
+ "value":"Software update"
+ },
+ {
+ "name":"check_version_status_has_new",
+ "value":"Update available"
+ },
+ {
+ "name":"check_version_status_no_new",
+ "value":"Your software is up to date"
+ },
+ {
+ "name":"check_version_status_checking",
+ "value":"Checking for updates"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/feature/ota/src/main/resources/base/media/icon.png b/feature/ota/src/main/resources/base/media/icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..401811bd41703121722b0d14134458c97e1a2aab
Binary files /dev/null and b/feature/ota/src/main/resources/base/media/icon.png differ
diff --git a/feature/ota/src/main/resources/tablet/element/float.json b/feature/ota/src/main/resources/tablet/element/float.json
new file mode 100644
index 0000000000000000000000000000000000000000..10f68519f56680fc4b14b056bd787efb7210e87a
--- /dev/null
+++ b/feature/ota/src/main/resources/tablet/element/float.json
@@ -0,0 +1,24 @@
+{
+ "float": [
+ {
+ "name": "home_logo_bottom_margin",
+ "value": "32vp"
+ },
+ {
+ "name": "home_new_version_label_top_margin",
+ "value": "8vp"
+ },
+ {
+ "name": "text_size_progress_bar_percent",
+ "value": "18fp"
+ },
+ {
+ "name": "text_size_version_name",
+ "value": "18fp"
+ },
+ {
+ "name": "home_text_size_version_name",
+ "value": "16fp"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/feature/ota/src/main/resources/zh_CN/element/string.json b/feature/ota/src/main/resources/zh_CN/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..9b1b83da461f984d35d54d903f8788b244118a22
--- /dev/null
+++ b/feature/ota/src/main/resources/zh_CN/element/string.json
@@ -0,0 +1,24 @@
+{
+ "string":[
+ {
+ "name":"btn_check_new_version",
+ "value":"检查更新"
+ },
+ {
+ "name":"software_update",
+ "value":"软件更新"
+ },
+ {
+ "name":"check_version_status_has_new",
+ "value":"发现新版本"
+ },
+ {
+ "name":"check_version_status_no_new",
+ "value":"已是最新版本"
+ },
+ {
+ "name":"check_version_status_checking",
+ "value":"正在检查更新"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/hvigorfile.ts b/hvigorfile.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c331b1b0e52526f357e4db47f61b5580562e4eca
--- /dev/null
+++ b/hvigorfile.ts
@@ -0,0 +1,2 @@
+// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
+module.exports = require('@ohos/hvigor-ohos-plugin').appTasks;
\ No newline at end of file
diff --git a/local.properties b/local.properties
new file mode 100644
index 0000000000000000000000000000000000000000..2a17af6df472cc6c33afbffd8c62e35c0f20a4d3
--- /dev/null
+++ b/local.properties
@@ -0,0 +1,9 @@
+# This file is automatically generated by DevEco Studio.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file should *NOT* be checked into Version Control Systems,
+# as it contains information specific to your local configuration.
+#
+# For customization when using a Version Control System, please read the header note.
+sdk.dir=D:/OpenHarmony/sdk4.0/ohos-sdk/oh
+nodejs.dir=C:/Users/Administrator/nodejs
\ No newline at end of file
diff --git a/package-lock.json b/package-lock.json
new file mode 100644
index 0000000000000000000000000000000000000000..4c50f7a56215b4e0d55ee1a9c4834a63ab9b87b3
--- /dev/null
+++ b/package-lock.json
@@ -0,0 +1,1094 @@
+{
+ "name": "ouc",
+ "version": "1.0.0",
+ "lockfileVersion": 1,
+ "requires": true,
+ "dependencies": {
+ "@ohos/hos-sdkmanager-common": {
+ "version": "2.1.6",
+ "resolved": "https://repo.harmonyos.com/npm/@ohos/hos-sdkmanager-common/-/@ohos/hos-sdkmanager-common-2.1.6.tgz",
+ "integrity": "sha512-DAT3YbqBE5/6lEOPTQA4pyNt5Wv790AlXcE5iIAofb47uXKmXf3EYL7UBoBRI0U8gJ9qnD/wNuW0vwMrlK8rDw==",
+ "requires": {
+ "@ohos/sdkmanager-common": "2.3.4"
+ }
+ },
+ "@ohos/hvigor": {
+ "version": "1.4.0",
+ "resolved": "https://repo.harmonyos.com/npm/@ohos/hvigor/-/@ohos/hvigor-1.4.0.tgz",
+ "integrity": "sha512-UNWl/KYWaRLmcyXN3tJh0XpmGswjVhSZ08BCukpTrjOSgU335L3PHI6yZJ6PuXxkAxMKgt46IOi4wVdFo8NAPA==",
+ "requires": {
+ "@ohos/hvigor-base": "1.4.0",
+ "fs-extra": "10.0.1",
+ "interpret": "1.4.0",
+ "liftoff": "4.0.0",
+ "mute-stdout": "1.0.0",
+ "pretty-hrtime": "1.0.0",
+ "typescript": "4.7.4",
+ "v8flags": "3.2.0",
+ "yargs": "17.5.1"
+ }
+ },
+ "@ohos/hvigor-base": {
+ "version": "1.4.0",
+ "resolved": "https://repo.harmonyos.com/npm/@ohos/hvigor-base/-/@ohos/hvigor-base-1.4.0.tgz",
+ "integrity": "sha512-67VK4Of6HgWMDdfa4eMb0MDcDAasctDpK6Akvttwe9U+aV5HSsRJuFS1f3cNGs5+shKyApvj8+AV7VqjzqHsVA==",
+ "requires": {
+ "fs-extra": "10.0.1",
+ "iconv-lite": "0.6.3",
+ "json5": "2.2.3",
+ "lodash": "4.17.21",
+ "log4js": "6.4.1",
+ "once": "1.4.0",
+ "pretty-hrtime": "1.0.0"
+ }
+ },
+ "@ohos/hvigor-ohos-plugin": {
+ "version": "1.4.0",
+ "resolved": "https://repo.harmonyos.com/npm/@ohos/hvigor-ohos-plugin/-/@ohos/hvigor-ohos-plugin-1.4.0.tgz",
+ "integrity": "sha512-fVGPFfjzLitY8d19kPSuMiGdw2KsZPTnaquTq910g8X0WCwYCR+N25m1LmS44H/48/mV1/ciiJusivPn3EvLJw==",
+ "requires": {
+ "@ohos/hos-sdkmanager-common": "2.1.6",
+ "@ohos/sdkmanager-common": "2.3.4",
+ "adm-zip": "0.5.9",
+ "ajv": "8.10.0",
+ "deasync": "0.1.28",
+ "execa": "5.1.1",
+ "fast-xml-parser": "4.0.3",
+ "fs-extra": "10.0.1",
+ "glob": "7.2.0",
+ "iconv-lite": "0.6.3",
+ "json5": "2.2.3",
+ "lodash": "4.17.21",
+ "pretty-hrtime": "1.0.3",
+ "resolve-package-path": "4.0.3"
+ },
+ "dependencies": {
+ "pretty-hrtime": {
+ "version": "1.0.3",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz",
+ "integrity": "sha512-66hKPCr+72mlfiSjlEB1+45IjXSqvVAIy6mocupoww4tBFE9R9IhwwUGoI4G++Tc9Aq+2rxOt0RFU6gPcrte0A=="
+ }
+ }
+ },
+ "@ohos/hypium": {
+ "version": "1.0.3",
+ "resolved": "https://repo.harmonyos.com/npm/@ohos/hypium/-/@ohos/hypium-1.0.3.tgz",
+ "integrity": "sha512-QKh8ngJk1ySbAiKpSTLP5EJIbT8Oja1zV3zwgLD7U9+KX7w2gjNIk3qoP+d13CwpEfaSR3Lxt3exlQLwWSFx3g=="
+ },
+ "@ohos/sdkmanager-common": {
+ "version": "2.3.4",
+ "resolved": "https://repo.harmonyos.com/npm/@ohos/sdkmanager-common/-/@ohos/sdkmanager-common-2.3.4.tgz",
+ "integrity": "sha512-3WATGJS2lO1EV7F7KzfHCdYwJzr5n+vdrRD65ahHHXptjko1UneBwvY1WEpxSJShQQc4lwKyBK7+6UOsc+NA/w==",
+ "requires": {
+ "axios": "0.24.0",
+ "jszip": "^3.7.0"
+ }
+ },
+ "adm-zip": {
+ "version": "0.5.9",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/adm-zip/-/adm-zip-0.5.9.tgz",
+ "integrity": "sha512-s+3fXLkeeLjZ2kLjCBwQufpI5fuN+kIGBxu6530nVQZGVol0d7Y/M88/xw9HGGUcJjKf8LutN3VPRUBq6N7Ajg=="
+ },
+ "ajv": {
+ "version": "8.10.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/ajv/-/ajv-8.10.0.tgz",
+ "integrity": "sha512-bzqAEZOjkrUMl2afH8dknrq5KEk2SrwdBROR+vH1EKVQTqaUbJVPdc/gEdggTMM0Se+s+Ja4ju4TlNcStKl2Hw==",
+ "requires": {
+ "fast-deep-equal": "^3.1.1",
+ "json-schema-traverse": "^1.0.0",
+ "require-from-string": "^2.0.2",
+ "uri-js": "^4.2.2"
+ }
+ },
+ "ansi-regex": {
+ "version": "5.0.1",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/ansi-regex/-/ansi-regex-5.0.1.tgz",
+ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="
+ },
+ "ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+ "requires": {
+ "color-convert": "^2.0.1"
+ }
+ },
+ "array-each": {
+ "version": "1.0.1",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/array-each/-/array-each-1.0.1.tgz",
+ "integrity": "sha512-zHjL5SZa68hkKHBFBK6DJCTtr9sfTCPCaph/L7tMSLcTFgy+zX7E+6q5UArbtOtMBCtxdICpfTCspRse+ywyXA=="
+ },
+ "array-slice": {
+ "version": "1.1.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/array-slice/-/array-slice-1.1.0.tgz",
+ "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w=="
+ },
+ "axios": {
+ "version": "0.24.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/axios/-/axios-0.24.0.tgz",
+ "integrity": "sha512-Q6cWsys88HoPgAaFAVUb0WpPk0O8iTeisR9IMqy9G8AbO4NlpVknrnQS03zzF9PGAWgO3cgletO3VjV/P7VztA==",
+ "requires": {
+ "follow-redirects": "^1.14.4"
+ }
+ },
+ "balanced-match": {
+ "version": "1.0.2",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/balanced-match/-/balanced-match-1.0.2.tgz",
+ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
+ },
+ "bindings": {
+ "version": "1.5.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/bindings/-/bindings-1.5.0.tgz",
+ "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
+ "requires": {
+ "file-uri-to-path": "1.0.0"
+ }
+ },
+ "brace-expansion": {
+ "version": "1.1.11",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/brace-expansion/-/brace-expansion-1.1.11.tgz",
+ "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
+ "requires": {
+ "balanced-match": "^1.0.0",
+ "concat-map": "0.0.1"
+ }
+ },
+ "braces": {
+ "version": "3.0.2",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/braces/-/braces-3.0.2.tgz",
+ "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
+ "requires": {
+ "fill-range": "^7.0.1"
+ }
+ },
+ "cliui": {
+ "version": "7.0.4",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/cliui/-/cliui-7.0.4.tgz",
+ "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==",
+ "requires": {
+ "string-width": "^4.2.0",
+ "strip-ansi": "^6.0.0",
+ "wrap-ansi": "^7.0.0"
+ }
+ },
+ "color-convert": {
+ "version": "2.0.1",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+ "requires": {
+ "color-name": "~1.1.4"
+ }
+ },
+ "color-name": {
+ "version": "1.1.4",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
+ },
+ "concat-map": {
+ "version": "0.0.1",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/concat-map/-/concat-map-0.0.1.tgz",
+ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="
+ },
+ "core-util-is": {
+ "version": "1.0.3",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/core-util-is/-/core-util-is-1.0.3.tgz",
+ "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="
+ },
+ "cross-spawn": {
+ "version": "7.0.3",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/cross-spawn/-/cross-spawn-7.0.3.tgz",
+ "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
+ "requires": {
+ "path-key": "^3.1.0",
+ "shebang-command": "^2.0.0",
+ "which": "^2.0.1"
+ },
+ "dependencies": {
+ "which": {
+ "version": "2.0.2",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/which/-/which-2.0.2.tgz",
+ "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
+ "requires": {
+ "isexe": "^2.0.0"
+ }
+ }
+ }
+ },
+ "date-format": {
+ "version": "4.0.14",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/date-format/-/date-format-4.0.14.tgz",
+ "integrity": "sha512-39BOQLs9ZjKh0/patS9nrT8wc3ioX3/eA/zgbKNopnF2wCqJEoxywwwElATYvRsXdnOxA/OQeQoFZ3rFjVajhg=="
+ },
+ "deasync": {
+ "version": "0.1.28",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/deasync/-/deasync-0.1.28.tgz",
+ "integrity": "sha512-QqLF6inIDwiATrfROIyQtwOQxjZuek13WRYZ7donU5wJPLoP67MnYxA6QtqdvdBy2mMqv5m3UefBVdJjvevOYg==",
+ "requires": {
+ "bindings": "^1.5.0",
+ "node-addon-api": "^1.7.1"
+ }
+ },
+ "debug": {
+ "version": "4.3.4",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/debug/-/debug-4.3.4.tgz",
+ "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
+ "requires": {
+ "ms": "2.1.2"
+ }
+ },
+ "detect-file": {
+ "version": "1.0.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/detect-file/-/detect-file-1.0.0.tgz",
+ "integrity": "sha512-DtCOLG98P007x7wiiOmfI0fi3eIKyWiLTGJ2MDnVi/E04lWGbf+JzrRHMm0rgIIZJGtHpKpbVgLWHrv8xXpc3Q=="
+ },
+ "emoji-regex": {
+ "version": "8.0.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/emoji-regex/-/emoji-regex-8.0.0.tgz",
+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="
+ },
+ "escalade": {
+ "version": "3.1.1",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/escalade/-/escalade-3.1.1.tgz",
+ "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw=="
+ },
+ "execa": {
+ "version": "5.1.1",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/execa/-/execa-5.1.1.tgz",
+ "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==",
+ "requires": {
+ "cross-spawn": "^7.0.3",
+ "get-stream": "^6.0.0",
+ "human-signals": "^2.1.0",
+ "is-stream": "^2.0.0",
+ "merge-stream": "^2.0.0",
+ "npm-run-path": "^4.0.1",
+ "onetime": "^5.1.2",
+ "signal-exit": "^3.0.3",
+ "strip-final-newline": "^2.0.0"
+ }
+ },
+ "expand-tilde": {
+ "version": "2.0.2",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/expand-tilde/-/expand-tilde-2.0.2.tgz",
+ "integrity": "sha512-A5EmesHW6rfnZ9ysHQjPdJRni0SRar0tjtG5MNtm9n5TUvsYU8oozprtRD4AqHxcZWWlVuAmQo2nWKfN9oyjTw==",
+ "requires": {
+ "homedir-polyfill": "^1.0.1"
+ }
+ },
+ "extend": {
+ "version": "3.0.2",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/extend/-/extend-3.0.2.tgz",
+ "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g=="
+ },
+ "fast-deep-equal": {
+ "version": "3.1.3",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
+ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="
+ },
+ "fast-xml-parser": {
+ "version": "4.0.3",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/fast-xml-parser/-/fast-xml-parser-4.0.3.tgz",
+ "integrity": "sha512-xhQbg3a/EYNHwK0cxIG1nZmVkHX/0tWihamn5pU4Mhd9KEVE2ga8ZJiqEUgB2sApElvAATOdMTLjgqIpvYDUkQ==",
+ "requires": {
+ "strnum": "^1.0.5"
+ }
+ },
+ "file-uri-to-path": {
+ "version": "1.0.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
+ "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw=="
+ },
+ "fill-range": {
+ "version": "7.0.1",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/fill-range/-/fill-range-7.0.1.tgz",
+ "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
+ "requires": {
+ "to-regex-range": "^5.0.1"
+ }
+ },
+ "findup-sync": {
+ "version": "5.0.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/findup-sync/-/findup-sync-5.0.0.tgz",
+ "integrity": "sha512-MzwXju70AuyflbgeOhzvQWAvvQdo1XL0A9bVvlXsYcFEBM87WR4OakL4OfZq+QRmr+duJubio+UtNQCPsVESzQ==",
+ "requires": {
+ "detect-file": "^1.0.0",
+ "is-glob": "^4.0.3",
+ "micromatch": "^4.0.4",
+ "resolve-dir": "^1.0.1"
+ }
+ },
+ "fined": {
+ "version": "2.0.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/fined/-/fined-2.0.0.tgz",
+ "integrity": "sha512-OFRzsL6ZMHz5s0JrsEr+TpdGNCtrVtnuG3x1yzGNiQHT0yaDnXAj8V/lWcpJVrnoDpcwXcASxAZYbuXda2Y82A==",
+ "requires": {
+ "expand-tilde": "^2.0.2",
+ "is-plain-object": "^5.0.0",
+ "object.defaults": "^1.1.0",
+ "object.pick": "^1.3.0",
+ "parse-filepath": "^1.0.2"
+ }
+ },
+ "flagged-respawn": {
+ "version": "2.0.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/flagged-respawn/-/flagged-respawn-2.0.0.tgz",
+ "integrity": "sha512-Gq/a6YCi8zexmGHMuJwahTGzXlAZAOsbCVKduWXC6TlLCjjFRlExMJc4GC2NYPYZ0r/brw9P7CpRgQmlPVeOoA=="
+ },
+ "flatted": {
+ "version": "3.2.7",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/flatted/-/flatted-3.2.7.tgz",
+ "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ=="
+ },
+ "follow-redirects": {
+ "version": "1.15.2",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/follow-redirects/-/follow-redirects-1.15.2.tgz",
+ "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA=="
+ },
+ "for-in": {
+ "version": "1.0.2",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/for-in/-/for-in-1.0.2.tgz",
+ "integrity": "sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ=="
+ },
+ "for-own": {
+ "version": "1.0.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/for-own/-/for-own-1.0.0.tgz",
+ "integrity": "sha512-0OABksIGrxKK8K4kynWkQ7y1zounQxP+CWnyclVwj81KW3vlLlGUx57DKGcP/LH216GzqnstnPocF16Nxs0Ycg==",
+ "requires": {
+ "for-in": "^1.0.1"
+ }
+ },
+ "fs-extra": {
+ "version": "10.0.1",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/fs-extra/-/fs-extra-10.0.1.tgz",
+ "integrity": "sha512-NbdoVMZso2Lsrn/QwLXOy6rm0ufY2zEOKCDzJR/0kBsb0E6qed0P3iYK+Ath3BfvXEeu4JhEtXLgILx5psUfag==",
+ "requires": {
+ "graceful-fs": "^4.2.0",
+ "jsonfile": "^6.0.1",
+ "universalify": "^2.0.0"
+ }
+ },
+ "fs.realpath": {
+ "version": "1.0.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/fs.realpath/-/fs.realpath-1.0.0.tgz",
+ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw=="
+ },
+ "function-bind": {
+ "version": "1.1.1",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/function-bind/-/function-bind-1.1.1.tgz",
+ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
+ },
+ "get-caller-file": {
+ "version": "2.0.5",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/get-caller-file/-/get-caller-file-2.0.5.tgz",
+ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg=="
+ },
+ "get-stream": {
+ "version": "6.0.1",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/get-stream/-/get-stream-6.0.1.tgz",
+ "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg=="
+ },
+ "glob": {
+ "version": "7.2.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/glob/-/glob-7.2.0.tgz",
+ "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
+ "requires": {
+ "fs.realpath": "^1.0.0",
+ "inflight": "^1.0.4",
+ "inherits": "2",
+ "minimatch": "^3.0.4",
+ "once": "^1.3.0",
+ "path-is-absolute": "^1.0.0"
+ }
+ },
+ "global-modules": {
+ "version": "1.0.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/global-modules/-/global-modules-1.0.0.tgz",
+ "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==",
+ "requires": {
+ "global-prefix": "^1.0.1",
+ "is-windows": "^1.0.1",
+ "resolve-dir": "^1.0.0"
+ }
+ },
+ "global-prefix": {
+ "version": "1.0.2",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/global-prefix/-/global-prefix-1.0.2.tgz",
+ "integrity": "sha512-5lsx1NUDHtSjfg0eHlmYvZKv8/nVqX4ckFbM+FrGcQ+04KWcWFo9P5MxPZYSzUvyzmdTbI7Eix8Q4IbELDqzKg==",
+ "requires": {
+ "expand-tilde": "^2.0.2",
+ "homedir-polyfill": "^1.0.1",
+ "ini": "^1.3.4",
+ "is-windows": "^1.0.1",
+ "which": "^1.2.14"
+ }
+ },
+ "graceful-fs": {
+ "version": "4.2.11",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/graceful-fs/-/graceful-fs-4.2.11.tgz",
+ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="
+ },
+ "has": {
+ "version": "1.0.3",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/has/-/has-1.0.3.tgz",
+ "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
+ "requires": {
+ "function-bind": "^1.1.1"
+ }
+ },
+ "homedir-polyfill": {
+ "version": "1.0.3",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz",
+ "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==",
+ "requires": {
+ "parse-passwd": "^1.0.0"
+ }
+ },
+ "human-signals": {
+ "version": "2.1.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/human-signals/-/human-signals-2.1.0.tgz",
+ "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw=="
+ },
+ "hypium": {
+ "version": "1.0.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/hypium/-/hypium-1.0.0.tgz",
+ "integrity": "sha512-nl+RQVv2AU/5FvFRhsXyWO5wh+2huhdqRZ3bszBWZzW+kpNI3AT4ydvVRYIfaQbYwV4UlX/rSc7BtFjLAezhow=="
+ },
+ "iconv-lite": {
+ "version": "0.6.3",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/iconv-lite/-/iconv-lite-0.6.3.tgz",
+ "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
+ "requires": {
+ "safer-buffer": ">= 2.1.2 < 3.0.0"
+ }
+ },
+ "immediate": {
+ "version": "3.0.6",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/immediate/-/immediate-3.0.6.tgz",
+ "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ=="
+ },
+ "inflight": {
+ "version": "1.0.6",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/inflight/-/inflight-1.0.6.tgz",
+ "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
+ "requires": {
+ "once": "^1.3.0",
+ "wrappy": "1"
+ }
+ },
+ "inherits": {
+ "version": "2.0.4",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/inherits/-/inherits-2.0.4.tgz",
+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
+ },
+ "ini": {
+ "version": "1.3.8",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/ini/-/ini-1.3.8.tgz",
+ "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew=="
+ },
+ "interpret": {
+ "version": "1.4.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/interpret/-/interpret-1.4.0.tgz",
+ "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA=="
+ },
+ "is-absolute": {
+ "version": "1.0.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/is-absolute/-/is-absolute-1.0.0.tgz",
+ "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==",
+ "requires": {
+ "is-relative": "^1.0.0",
+ "is-windows": "^1.0.1"
+ }
+ },
+ "is-core-module": {
+ "version": "2.11.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/is-core-module/-/is-core-module-2.11.0.tgz",
+ "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==",
+ "requires": {
+ "has": "^1.0.3"
+ }
+ },
+ "is-extglob": {
+ "version": "2.1.1",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/is-extglob/-/is-extglob-2.1.1.tgz",
+ "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ=="
+ },
+ "is-fullwidth-code-point": {
+ "version": "3.0.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
+ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg=="
+ },
+ "is-glob": {
+ "version": "4.0.3",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/is-glob/-/is-glob-4.0.3.tgz",
+ "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
+ "requires": {
+ "is-extglob": "^2.1.1"
+ }
+ },
+ "is-number": {
+ "version": "7.0.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/is-number/-/is-number-7.0.0.tgz",
+ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng=="
+ },
+ "is-plain-object": {
+ "version": "5.0.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/is-plain-object/-/is-plain-object-5.0.0.tgz",
+ "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q=="
+ },
+ "is-relative": {
+ "version": "1.0.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/is-relative/-/is-relative-1.0.0.tgz",
+ "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==",
+ "requires": {
+ "is-unc-path": "^1.0.0"
+ }
+ },
+ "is-stream": {
+ "version": "2.0.1",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/is-stream/-/is-stream-2.0.1.tgz",
+ "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg=="
+ },
+ "is-unc-path": {
+ "version": "1.0.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/is-unc-path/-/is-unc-path-1.0.0.tgz",
+ "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==",
+ "requires": {
+ "unc-path-regex": "^0.1.2"
+ }
+ },
+ "is-windows": {
+ "version": "1.0.2",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/is-windows/-/is-windows-1.0.2.tgz",
+ "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA=="
+ },
+ "isarray": {
+ "version": "1.0.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/isarray/-/isarray-1.0.0.tgz",
+ "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ=="
+ },
+ "isexe": {
+ "version": "2.0.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/isexe/-/isexe-2.0.0.tgz",
+ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="
+ },
+ "isobject": {
+ "version": "3.0.1",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/isobject/-/isobject-3.0.1.tgz",
+ "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg=="
+ },
+ "json-schema-traverse": {
+ "version": "1.0.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
+ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug=="
+ },
+ "json5": {
+ "version": "2.2.3",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/json5/-/json5-2.2.3.tgz",
+ "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg=="
+ },
+ "jsonfile": {
+ "version": "6.1.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/jsonfile/-/jsonfile-6.1.0.tgz",
+ "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
+ "requires": {
+ "graceful-fs": "^4.1.6",
+ "universalify": "^2.0.0"
+ }
+ },
+ "jszip": {
+ "version": "3.10.1",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/jszip/-/jszip-3.10.1.tgz",
+ "integrity": "sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==",
+ "requires": {
+ "lie": "~3.3.0",
+ "pako": "~1.0.2",
+ "readable-stream": "~2.3.6",
+ "setimmediate": "^1.0.5"
+ }
+ },
+ "kind-of": {
+ "version": "6.0.3",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/kind-of/-/kind-of-6.0.3.tgz",
+ "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw=="
+ },
+ "lie": {
+ "version": "3.3.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/lie/-/lie-3.3.0.tgz",
+ "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==",
+ "requires": {
+ "immediate": "~3.0.5"
+ }
+ },
+ "liftoff": {
+ "version": "4.0.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/liftoff/-/liftoff-4.0.0.tgz",
+ "integrity": "sha512-rMGwYF8q7g2XhG2ulBmmJgWv25qBsqRbDn5gH0+wnuyeFt7QBJlHJmtg5qEdn4pN6WVAUMgXnIxytMFRX9c1aA==",
+ "requires": {
+ "extend": "^3.0.2",
+ "findup-sync": "^5.0.0",
+ "fined": "^2.0.0",
+ "flagged-respawn": "^2.0.0",
+ "is-plain-object": "^5.0.0",
+ "object.map": "^1.0.1",
+ "rechoir": "^0.8.0",
+ "resolve": "^1.20.0"
+ }
+ },
+ "lodash": {
+ "version": "4.17.21",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/lodash/-/lodash-4.17.21.tgz",
+ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
+ },
+ "log4js": {
+ "version": "6.4.1",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/log4js/-/log4js-6.4.1.tgz",
+ "integrity": "sha512-iUiYnXqAmNKiIZ1XSAitQ4TmNs8CdZYTAWINARF3LjnsLN8tY5m0vRwd6uuWj/yNY0YHxeZodnbmxKFUOM2rMg==",
+ "requires": {
+ "date-format": "^4.0.3",
+ "debug": "^4.3.3",
+ "flatted": "^3.2.4",
+ "rfdc": "^1.3.0",
+ "streamroller": "^3.0.2"
+ }
+ },
+ "make-iterator": {
+ "version": "1.0.1",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/make-iterator/-/make-iterator-1.0.1.tgz",
+ "integrity": "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==",
+ "requires": {
+ "kind-of": "^6.0.2"
+ }
+ },
+ "map-cache": {
+ "version": "0.2.2",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/map-cache/-/map-cache-0.2.2.tgz",
+ "integrity": "sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg=="
+ },
+ "merge-stream": {
+ "version": "2.0.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/merge-stream/-/merge-stream-2.0.0.tgz",
+ "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w=="
+ },
+ "micromatch": {
+ "version": "4.0.5",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/micromatch/-/micromatch-4.0.5.tgz",
+ "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==",
+ "requires": {
+ "braces": "^3.0.2",
+ "picomatch": "^2.3.1"
+ }
+ },
+ "mimic-fn": {
+ "version": "2.1.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/mimic-fn/-/mimic-fn-2.1.0.tgz",
+ "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg=="
+ },
+ "minimatch": {
+ "version": "3.1.2",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/minimatch/-/minimatch-3.1.2.tgz",
+ "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
+ "requires": {
+ "brace-expansion": "^1.1.7"
+ }
+ },
+ "ms": {
+ "version": "2.1.2",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/ms/-/ms-2.1.2.tgz",
+ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
+ },
+ "mute-stdout": {
+ "version": "1.0.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/mute-stdout/-/mute-stdout-1.0.0.tgz",
+ "integrity": "sha512-MaSQenn0f9oxIjtCufclpV00MuYTiHaXPbdcfPIM+quMqoa8cXywjHHx4LhhIAZlXqPWMdcUpYviajfmHtHRJw=="
+ },
+ "node-addon-api": {
+ "version": "1.7.2",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/node-addon-api/-/node-addon-api-1.7.2.tgz",
+ "integrity": "sha512-ibPK3iA+vaY1eEjESkQkM0BbCqFOaZMiXRTtdB0u7b4djtY6JnsjvPdUHVMg6xQt3B8fpTTWHI9A+ADjM9frzg=="
+ },
+ "npm-run-path": {
+ "version": "4.0.1",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/npm-run-path/-/npm-run-path-4.0.1.tgz",
+ "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==",
+ "requires": {
+ "path-key": "^3.0.0"
+ }
+ },
+ "object.defaults": {
+ "version": "1.1.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/object.defaults/-/object.defaults-1.1.0.tgz",
+ "integrity": "sha512-c/K0mw/F11k4dEUBMW8naXUuBuhxRCfG7W+yFy8EcijU/rSmazOUd1XAEEe6bC0OuXY4HUKjTJv7xbxIMqdxrA==",
+ "requires": {
+ "array-each": "^1.0.1",
+ "array-slice": "^1.0.0",
+ "for-own": "^1.0.0",
+ "isobject": "^3.0.0"
+ }
+ },
+ "object.map": {
+ "version": "1.0.1",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/object.map/-/object.map-1.0.1.tgz",
+ "integrity": "sha512-3+mAJu2PLfnSVGHwIWubpOFLscJANBKuB/6A4CxBstc4aqwQY0FWcsppuy4jU5GSB95yES5JHSI+33AWuS4k6w==",
+ "requires": {
+ "for-own": "^1.0.0",
+ "make-iterator": "^1.0.0"
+ }
+ },
+ "object.pick": {
+ "version": "1.3.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/object.pick/-/object.pick-1.3.0.tgz",
+ "integrity": "sha512-tqa/UMy/CCoYmj+H5qc07qvSL9dqcs/WZENZ1JbtWBlATP+iVOe778gE6MSijnyCnORzDuX6hU+LA4SZ09YjFQ==",
+ "requires": {
+ "isobject": "^3.0.1"
+ }
+ },
+ "once": {
+ "version": "1.4.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/once/-/once-1.4.0.tgz",
+ "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
+ "requires": {
+ "wrappy": "1"
+ }
+ },
+ "onetime": {
+ "version": "5.1.2",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/onetime/-/onetime-5.1.2.tgz",
+ "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==",
+ "requires": {
+ "mimic-fn": "^2.1.0"
+ }
+ },
+ "pako": {
+ "version": "1.0.11",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/pako/-/pako-1.0.11.tgz",
+ "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw=="
+ },
+ "parse-filepath": {
+ "version": "1.0.2",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/parse-filepath/-/parse-filepath-1.0.2.tgz",
+ "integrity": "sha512-FwdRXKCohSVeXqwtYonZTXtbGJKrn+HNyWDYVcp5yuJlesTwNH4rsmRZ+GrKAPJ5bLpRxESMeS+Rl0VCHRvB2Q==",
+ "requires": {
+ "is-absolute": "^1.0.0",
+ "map-cache": "^0.2.0",
+ "path-root": "^0.1.1"
+ }
+ },
+ "parse-passwd": {
+ "version": "1.0.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/parse-passwd/-/parse-passwd-1.0.0.tgz",
+ "integrity": "sha512-1Y1A//QUXEZK7YKz+rD9WydcE1+EuPr6ZBgKecAB8tmoW6UFv0NREVJe1p+jRxtThkcbbKkfwIbWJe/IeE6m2Q=="
+ },
+ "path-is-absolute": {
+ "version": "1.0.1",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
+ "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg=="
+ },
+ "path-key": {
+ "version": "3.1.1",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/path-key/-/path-key-3.1.1.tgz",
+ "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q=="
+ },
+ "path-parse": {
+ "version": "1.0.7",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/path-parse/-/path-parse-1.0.7.tgz",
+ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw=="
+ },
+ "path-root": {
+ "version": "0.1.1",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/path-root/-/path-root-0.1.1.tgz",
+ "integrity": "sha512-QLcPegTHF11axjfojBIoDygmS2E3Lf+8+jI6wOVmNVenrKSo3mFdSGiIgdSHenczw3wPtlVMQaFVwGmM7BJdtg==",
+ "requires": {
+ "path-root-regex": "^0.1.0"
+ }
+ },
+ "path-root-regex": {
+ "version": "0.1.2",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/path-root-regex/-/path-root-regex-0.1.2.tgz",
+ "integrity": "sha512-4GlJ6rZDhQZFE0DPVKh0e9jmZ5egZfxTkp7bcRDuPlJXbAwhxcl2dINPUAsjLdejqaLsCeg8axcLjIbvBjN4pQ=="
+ },
+ "picomatch": {
+ "version": "2.3.1",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/picomatch/-/picomatch-2.3.1.tgz",
+ "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="
+ },
+ "pretty-hrtime": {
+ "version": "1.0.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/pretty-hrtime/-/pretty-hrtime-1.0.0.tgz",
+ "integrity": "sha512-CU2l5CYUAptUYq/671ajexQfXuxJFwwg0n243Kdkx8bTjeenedsWgu8TGHPm03vLfNtk3aTXgySKPp3Usykudw=="
+ },
+ "process-nextick-args": {
+ "version": "2.0.1",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
+ "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
+ },
+ "punycode": {
+ "version": "2.3.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/punycode/-/punycode-2.3.0.tgz",
+ "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA=="
+ },
+ "readable-stream": {
+ "version": "2.3.8",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/readable-stream/-/readable-stream-2.3.8.tgz",
+ "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==",
+ "requires": {
+ "core-util-is": "~1.0.0",
+ "inherits": "~2.0.3",
+ "isarray": "~1.0.0",
+ "process-nextick-args": "~2.0.0",
+ "safe-buffer": "~5.1.1",
+ "string_decoder": "~1.1.1",
+ "util-deprecate": "~1.0.1"
+ }
+ },
+ "rechoir": {
+ "version": "0.8.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/rechoir/-/rechoir-0.8.0.tgz",
+ "integrity": "sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==",
+ "requires": {
+ "resolve": "^1.20.0"
+ }
+ },
+ "require-directory": {
+ "version": "2.1.1",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/require-directory/-/require-directory-2.1.1.tgz",
+ "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q=="
+ },
+ "require-from-string": {
+ "version": "2.0.2",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/require-from-string/-/require-from-string-2.0.2.tgz",
+ "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw=="
+ },
+ "resolve": {
+ "version": "1.22.1",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/resolve/-/resolve-1.22.1.tgz",
+ "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==",
+ "requires": {
+ "is-core-module": "^2.9.0",
+ "path-parse": "^1.0.7",
+ "supports-preserve-symlinks-flag": "^1.0.0"
+ }
+ },
+ "resolve-dir": {
+ "version": "1.0.1",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/resolve-dir/-/resolve-dir-1.0.1.tgz",
+ "integrity": "sha512-R7uiTjECzvOsWSfdM0QKFNBVFcK27aHOUwdvK53BcW8zqnGdYp0Fbj82cy54+2A4P2tFM22J5kRfe1R+lM/1yg==",
+ "requires": {
+ "expand-tilde": "^2.0.0",
+ "global-modules": "^1.0.0"
+ }
+ },
+ "resolve-package-path": {
+ "version": "4.0.3",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/resolve-package-path/-/resolve-package-path-4.0.3.tgz",
+ "integrity": "sha512-SRpNAPW4kewOaNUt8VPqhJ0UMxawMwzJD8V7m1cJfdSTK9ieZwS6K7Dabsm4bmLFM96Z5Y/UznrpG5kt1im8yA==",
+ "requires": {
+ "path-root": "^0.1.1"
+ }
+ },
+ "rfdc": {
+ "version": "1.3.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/rfdc/-/rfdc-1.3.0.tgz",
+ "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA=="
+ },
+ "safe-buffer": {
+ "version": "5.1.2",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/safe-buffer/-/safe-buffer-5.1.2.tgz",
+ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
+ },
+ "safer-buffer": {
+ "version": "2.1.2",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/safer-buffer/-/safer-buffer-2.1.2.tgz",
+ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
+ },
+ "setimmediate": {
+ "version": "1.0.5",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/setimmediate/-/setimmediate-1.0.5.tgz",
+ "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA=="
+ },
+ "shebang-command": {
+ "version": "2.0.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/shebang-command/-/shebang-command-2.0.0.tgz",
+ "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
+ "requires": {
+ "shebang-regex": "^3.0.0"
+ }
+ },
+ "shebang-regex": {
+ "version": "3.0.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/shebang-regex/-/shebang-regex-3.0.0.tgz",
+ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A=="
+ },
+ "signal-exit": {
+ "version": "3.0.7",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/signal-exit/-/signal-exit-3.0.7.tgz",
+ "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="
+ },
+ "streamroller": {
+ "version": "3.1.5",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/streamroller/-/streamroller-3.1.5.tgz",
+ "integrity": "sha512-KFxaM7XT+irxvdqSP1LGLgNWbYN7ay5owZ3r/8t77p+EtSUAfUgtl7be3xtqtOmGUl9K9YPO2ca8133RlTjvKw==",
+ "requires": {
+ "date-format": "^4.0.14",
+ "debug": "^4.3.4",
+ "fs-extra": "^8.1.0"
+ },
+ "dependencies": {
+ "fs-extra": {
+ "version": "8.1.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/fs-extra/-/fs-extra-8.1.0.tgz",
+ "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==",
+ "requires": {
+ "graceful-fs": "^4.2.0",
+ "jsonfile": "^4.0.0",
+ "universalify": "^0.1.0"
+ }
+ },
+ "jsonfile": {
+ "version": "4.0.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/jsonfile/-/jsonfile-4.0.0.tgz",
+ "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==",
+ "requires": {
+ "graceful-fs": "^4.1.6"
+ }
+ },
+ "universalify": {
+ "version": "0.1.2",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/universalify/-/universalify-0.1.2.tgz",
+ "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg=="
+ }
+ }
+ },
+ "string-width": {
+ "version": "4.2.3",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/string-width/-/string-width-4.2.3.tgz",
+ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
+ "requires": {
+ "emoji-regex": "^8.0.0",
+ "is-fullwidth-code-point": "^3.0.0",
+ "strip-ansi": "^6.0.1"
+ }
+ },
+ "string_decoder": {
+ "version": "1.1.1",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/string_decoder/-/string_decoder-1.1.1.tgz",
+ "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
+ "requires": {
+ "safe-buffer": "~5.1.0"
+ }
+ },
+ "strip-ansi": {
+ "version": "6.0.1",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/strip-ansi/-/strip-ansi-6.0.1.tgz",
+ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
+ "requires": {
+ "ansi-regex": "^5.0.1"
+ }
+ },
+ "strip-final-newline": {
+ "version": "2.0.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/strip-final-newline/-/strip-final-newline-2.0.0.tgz",
+ "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA=="
+ },
+ "strnum": {
+ "version": "1.0.5",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/strnum/-/strnum-1.0.5.tgz",
+ "integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA=="
+ },
+ "supports-preserve-symlinks-flag": {
+ "version": "1.0.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz",
+ "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w=="
+ },
+ "to-regex-range": {
+ "version": "5.0.1",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/to-regex-range/-/to-regex-range-5.0.1.tgz",
+ "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
+ "requires": {
+ "is-number": "^7.0.0"
+ }
+ },
+ "typescript": {
+ "version": "4.7.4",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/typescript/-/typescript-4.7.4.tgz",
+ "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ=="
+ },
+ "unc-path-regex": {
+ "version": "0.1.2",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/unc-path-regex/-/unc-path-regex-0.1.2.tgz",
+ "integrity": "sha512-eXL4nmJT7oCpkZsHZUOJo8hcX3GbsiDOa0Qu9F646fi8dT3XuSVopVqAcEiVzSKKH7UoDti23wNX3qGFxcW5Qg=="
+ },
+ "universalify": {
+ "version": "2.0.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/universalify/-/universalify-2.0.0.tgz",
+ "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ=="
+ },
+ "uri-js": {
+ "version": "4.4.1",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/uri-js/-/uri-js-4.4.1.tgz",
+ "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==",
+ "requires": {
+ "punycode": "^2.1.0"
+ }
+ },
+ "util-deprecate": {
+ "version": "1.0.2",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/util-deprecate/-/util-deprecate-1.0.2.tgz",
+ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="
+ },
+ "v8flags": {
+ "version": "3.2.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/v8flags/-/v8flags-3.2.0.tgz",
+ "integrity": "sha512-mH8etigqMfiGWdeXpaaqGfs6BndypxusHHcv2qSHyZkGEznCd/qAXCWWRzeowtL54147cktFOC4P5y+kl8d8Jg==",
+ "requires": {
+ "homedir-polyfill": "^1.0.1"
+ }
+ },
+ "which": {
+ "version": "1.3.1",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/which/-/which-1.3.1.tgz",
+ "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
+ "requires": {
+ "isexe": "^2.0.0"
+ }
+ },
+ "wrap-ansi": {
+ "version": "7.0.0",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
+ "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
+ "requires": {
+ "ansi-styles": "^4.0.0",
+ "string-width": "^4.1.0",
+ "strip-ansi": "^6.0.0"
+ }
+ },
+ "wrappy": {
+ "version": "1.0.2",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/wrappy/-/wrappy-1.0.2.tgz",
+ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
+ },
+ "y18n": {
+ "version": "5.0.8",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/y18n/-/y18n-5.0.8.tgz",
+ "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA=="
+ },
+ "yargs": {
+ "version": "17.5.1",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/yargs/-/yargs-17.5.1.tgz",
+ "integrity": "sha512-t6YAJcxDkNX7NFYiVtKvWUz8l+PaKTLiL63mJYWR2GnHq2gjEWISzsLp9wg3aY36dY1j+gfIEL3pIF+XlJJfbA==",
+ "requires": {
+ "cliui": "^7.0.2",
+ "escalade": "^3.1.1",
+ "get-caller-file": "^2.0.5",
+ "require-directory": "^2.1.1",
+ "string-width": "^4.2.3",
+ "y18n": "^5.0.5",
+ "yargs-parser": "^21.0.0"
+ }
+ },
+ "yargs-parser": {
+ "version": "21.1.1",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/yargs-parser/-/yargs-parser-21.1.1.tgz",
+ "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw=="
+ }
+ }
+}
diff --git a/package.json b/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..d61eb11db3ed5e7af306ea4bc78657f56ba6a2e9
--- /dev/null
+++ b/package.json
@@ -0,0 +1,24 @@
+{
+ "license": "ISC",
+ "devDependencies": {},
+ "author": "",
+ "name": "ouc",
+ "ohos": {
+ "org": "huawei",
+ "directoryLevel": "project",
+ "buildTool": "hvigor"
+ },
+ "description": "example description",
+ "main": "hvigorfile.js",
+ "repository": {},
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "version": "1.0.0",
+ "dependencies": {
+ "@ohos/hvigor": "1.4.0",
+ "@ohos/hvigor-ohos-plugin": "1.4.0",
+ "hypium": "^1.0.0",
+ "@ohos/hypium": "1.0.3"
+ }
+}
diff --git a/product/oh/base/build-profile.json5 b/product/oh/base/build-profile.json5
new file mode 100644
index 0000000000000000000000000000000000000000..7343e906b3201f4de05593d1f2c629da9cbe8bf4
--- /dev/null
+++ b/product/oh/base/build-profile.json5
@@ -0,0 +1,10 @@
+{
+ "apiType": 'stageMode',
+ "buildOption": {
+ },
+ "targets": [
+ {
+ "name": "release"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/product/oh/base/hvigorfile.ts b/product/oh/base/hvigorfile.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c12d7a845ac0b114517becc3430e9d0ab64c1546
--- /dev/null
+++ b/product/oh/base/hvigorfile.ts
@@ -0,0 +1,2 @@
+// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
+module.exports = require('@ohos/hvigor-ohos-plugin').hapTasks;
diff --git a/product/oh/base/package-lock.json b/product/oh/base/package-lock.json
new file mode 100644
index 0000000000000000000000000000000000000000..cbc70618c11106e1a62f2ca97760bd595b468fae
--- /dev/null
+++ b/product/oh/base/package-lock.json
@@ -0,0 +1,22 @@
+{
+ "name": "ouc",
+ "version": "1.0.0",
+ "lockfileVersion": 1,
+ "requires": true,
+ "dependencies": {
+ "@ohos/common": {
+ "version": "file:../../../common"
+ },
+ "@ohos/ota": {
+ "version": "file:../../../feature/ota",
+ "requires": {
+ "@ohos/common": "file:../../../common"
+ },
+ "dependencies": {
+ "@ohos/common": {
+ "version": "file:../../../common"
+ }
+ }
+ }
+ }
+}
diff --git a/product/oh/base/package.json b/product/oh/base/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..38c7f84c29ff17cd71b5ab1b664480ce2142d1a5
--- /dev/null
+++ b/product/oh/base/package.json
@@ -0,0 +1,16 @@
+{
+ "name": "ouc",
+ "version": "1.0.0",
+ "ohos": {
+ "org": "huawei",
+ "buildTool": "hvigor",
+ "directoryLevel": "module"
+ },
+ "description": "ouc description",
+ "repository": {},
+ "license": "ISC",
+ "dependencies": {
+ "@ohos/common": "file:../../../common",
+ "@ohos/ota": "file:../../../feature/ota"
+ }
+}
diff --git a/product/oh/base/src/main/ets/Application/AbilityStage.ts b/product/oh/base/src/main/ets/Application/AbilityStage.ts
new file mode 100644
index 0000000000000000000000000000000000000000..158a5f6fd0587b5c95a1a5d2823aca14fb018053
--- /dev/null
+++ b/product/oh/base/src/main/ets/Application/AbilityStage.ts
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2023 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import AbilityStage from '@ohos.app.ability.AbilityStage';
+import { LogUtils } from '@ohos/common/src/main/ets/util/LogUtils';
+
+/**
+ * Stage
+ *
+ * @since 2022-06-06
+ */
+export default class MyAbilityStage extends AbilityStage {
+ onCreate(): void {
+ LogUtils.log('MyAbilityStage', 'onCreate');
+ globalThis.stageContext = this.context;
+
+ // 初始化 AppStorage ,避免出现undefined
+ AppStorage.SetOrCreate('updateStatus', 0);
+ AppStorage.SetOrCreate('downloadProgress', 0);
+ AppStorage.SetOrCreate('isClickInstall', 0);
+ AppStorage.SetOrCreate('configLanguage', '');
+ AppStorage.SetOrCreate('installStatusRefresh', '');
+ }
+}
\ No newline at end of file
diff --git a/product/oh/base/src/main/ets/MainAbility/MainAbility.ts b/product/oh/base/src/main/ets/MainAbility/MainAbility.ts
new file mode 100644
index 0000000000000000000000000000000000000000..90a3c4445ef13b7096f8aba2eb0f43a68b495313
--- /dev/null
+++ b/product/oh/base/src/main/ets/MainAbility/MainAbility.ts
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2023 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import Ability from '@ohos.app.ability.UIAbility';
+import type Want from '@ohos.app.ability.Want';
+import type AbilityConstant from '@ohos.app.ability.AbilityConstant';
+import type window from '@ohos.window';
+import type { Configuration } from '@ohos.app.ability.Configuration';
+import { LogUtils } from '@ohos/common/src/main/ets/util/LogUtils';
+
+/**
+ * 主Ability
+ *
+ * @since 2022-06-06
+ */
+export default class MainAbility extends Ability {
+ private static readonly WAITING_PREPARE_TIME = 1500;
+ private language: string = '';
+
+ onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void {
+ this.log('BaseAbility onCreate:' + this.context.config.screenDensity);
+ globalThis.abilityWant = want;
+ globalThis.abilityContext = this.context;
+ globalThis.AbilityStatus = null;
+ this.language = this.context.config.language;
+
+ this.log('BaseAbility onCreate:' + this.context.config.screenDensity);
+ }
+
+ onDestroy(): void {
+ this.log('BaseAbility onDestroy');
+ globalThis.AbilityStatus = null;
+ }
+
+ onWindowStageCreate(windowStage: window.WindowStage): void {
+ globalThis.AbilityStatus = null;
+ windowStage.loadContent('pages/index', null);
+ }
+
+ onNewWant(want: Want): void {
+ this.log('BaseAbility onNewWant:' + JSON.stringify(want));
+ globalThis.newPage = want.uri;
+ }
+
+ onConfigurationUpdate(config: Configuration): void {
+ this.log(`onConfigurationUpdated: this.language=${this.language}, config.language=${config?.language}`);
+ if (config && this.language !== config.language) {
+ this.log(`onConfigurationUpdated: language changed, currentPage=${globalThis.currentPage}`);
+ this.language = config.language;
+ AppStorage.SetOrCreate('configLanguage', config.language);
+ }
+ }
+
+ onWindowStageDestroy(): void {
+ globalThis.AbilityStatus = null;
+ this.log('BaseAbility onWindowStageDestroy');
+ }
+
+ onForeground(): void {
+ this.log('BaseAbility onForeground');
+ globalThis.AbilityStatus = 'ON_FOREGROUND';
+ }
+
+ onBackground(): void {
+ globalThis.AbilityStatus = null;
+ this.log('BaseAbility onBackground');
+ }
+
+ protected log(message: string): void {
+ LogUtils.log('BaseAbility', message);
+ }
+}
\ No newline at end of file
diff --git a/product/oh/base/src/main/ets/ServiceExtAbility/service.ts b/product/oh/base/src/main/ets/ServiceExtAbility/service.ts
new file mode 100644
index 0000000000000000000000000000000000000000..41acbad1eb196c6e8f14ab8e66de8c486ef0ff32
--- /dev/null
+++ b/product/oh/base/src/main/ets/ServiceExtAbility/service.ts
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2023 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import Extension from '@ohos.app.ability.ServiceExtensionAbility';
+import type Want from '@ohos.app.ability.Want';
+import type rpc from '@ohos.rpc';
+import { LogUtils } from '@ohos/common/src/main/ets/util/LogUtils';
+
+/**
+ * service extension ability.
+ * receive want from update_engine
+ *
+ * @since 2022-05-31
+ */
+export default class ServiceExtAbility extends Extension {
+ private static readonly TAG = 'ServiceExtAbility';
+ private startIdArray: number[] = [];
+
+ onCreate(want: Want): void {
+ LogUtils.log(ServiceExtAbility.TAG, 'onCreate:' + JSON.stringify(want));
+ globalThis.extensionContext = this.context; // when start ServiceExtAbility ,set context
+ }
+
+ async onRequest(want: Want, startId: number): Promise {
+ LogUtils.log(ServiceExtAbility.TAG, `onRequest, want: ${want.abilityName}`);
+ this.startIdArray.push(startId);
+ globalThis.extensionContext = this.context;
+ this.stopSelf(startId);
+ }
+
+ onConnect(want: Want): rpc.RemoteObject {
+ LogUtils.log(ServiceExtAbility.TAG, `onConnect , want: ${want.abilityName}`);
+ return null;
+ }
+
+ private stopSelf(startId: number): void {
+ this.startIdArray.splice(this.startIdArray.indexOf(startId), 1);
+ LogUtils.info(ServiceExtAbility.TAG, 'stopSelf length ' + this.startIdArray.length);
+ if (this.startIdArray.length === 0) {
+ LogUtils.info(ServiceExtAbility.TAG, 'stopSelf');
+ this.context?.terminateSelf().catch((err) => {
+ LogUtils.error(ServiceExtAbility.TAG, 'stopSelf err is ' + JSON.stringify(err));
+ });
+ }
+ }
+}
\ No newline at end of file
diff --git a/product/oh/base/src/main/ets/pages/index.ets b/product/oh/base/src/main/ets/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..c67efdcc77c76a08f1ff2364b62c15fd122f5a2c
--- /dev/null
+++ b/product/oh/base/src/main/ets/pages/index.ets
@@ -0,0 +1,249 @@
+/*
+ * Copyright (c) 2023 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { TitleBar } from '@ohos/common/src/main/ets/component/TitleBar';
+import { HomeCardView } from '@ohos/common/src/main/ets/component/HomeCardView';
+import { CheckingDots } from '@ohos/common/src/main/ets/component/CheckingDots';
+import { LogUtils } from '@ohos/common/src/main/ets/util/LogUtils';
+import { FormatUtils } from '@ohos/common/src/main/ets/util/FormatUtils';
+import RouterUtils from '@ohos/ota/src/main/ets/util/RouterUtils';
+import { VersionUtils } from '@ohos/ota/src/main/ets/util/VersionUtils';
+
+/**
+ * 搜包的状态
+ *
+ * @since 2022-06-12
+ */
+enum NewVersionStatus {
+ CHECKING = 'CHECKING',
+ NO_NEW_VERSION = 'NO_NEW_VERSION',
+ HAS_NEW_VERSION = 'HAS_NEW_VERSION',
+}
+
+/**
+ * 主页index
+ *
+ * @since 2022-06-06
+ */
+@Entry
+@Component
+struct Index {
+ @State newVersionActionText: Resource = $r('app.string.check_version_status_no_new');
+ @State dotTextPlay: boolean = false;
+ @State newVersionStatus: string = NewVersionStatus.NO_NEW_VERSION;
+ private displayVersion: string = VersionUtils.getDisplayVersionForIndex();
+ private videoController: VideoController = new VideoController();
+ private actionCallBack: Array<() => void> = [];
+ private checkTimes: number= 0;
+ private checkIntervalId: number;
+ private checkLoopTimes: number = 0;
+ @State private buttonText: string = '';
+
+ /**
+ * 是否已经有搜包结果
+ */
+ private checkEndStatus: NewVersionStatus = null;
+
+ /**
+ * 用来控制视频显示或者隐藏,解决卡顿
+ */
+ @State private displayVideo: boolean = true;
+
+ private onCheckAction(): boolean {
+ this.log(`onCheckAction ${this.checkEndStatus}`);
+ if (!this.checkEndStatus || this.checkEndStatus === NewVersionStatus.CHECKING) {
+ return false;
+ }
+ this.uiCheckLoop(false);
+ for (let fun of this.actionCallBack) {
+ fun();
+ }
+ this.actionCallBack = [];
+ if (this.checkEndStatus == NewVersionStatus.HAS_NEW_VERSION) {
+ this.newVersionStatus = NewVersionStatus.HAS_NEW_VERSION;
+ this.newVersionActionText = $r('app.string.check_version_status_has_new');
+ this.log('afterNewVersionFound');
+ setTimeout(() => {
+ RouterUtils.openNewVersionPage();
+ }, 50);
+ } else if (this.checkEndStatus == NewVersionStatus.NO_NEW_VERSION) {
+ this.newVersionStatus = NewVersionStatus.NO_NEW_VERSION;
+ this.newVersionActionText = $r('app.string.check_version_status_no_new');
+ }
+ this.checkEndStatus = null;
+ return true;
+ }
+
+ private notifyNewVersionStatus(newVersionStatus): void {
+ this.log('perform updateNewVersionStatus:' + newVersionStatus);
+ this.checkEndStatus = newVersionStatus; // 延时更新
+ if (newVersionStatus == NewVersionStatus.CHECKING) {
+ this.newVersionStatus = newVersionStatus;
+ this.newVersionActionText = $r('app.string.check_version_status_checking');
+ }
+ }
+
+ /**
+ * 执行搜包
+ */
+ private async checkNewVersionIfNeed(): Promise {
+ this.log('checkNewVersionIfNeed.');
+ this.uiCheckLoop(true);
+ this.checkLoopTimes = 0;
+ this.notifyNewVersionStatus(NewVersionStatus.CHECKING);
+ setTimeout(() => {
+ this.notifyNewVersionStatus(NewVersionStatus.NO_NEW_VERSION);
+ }, 2000)
+ }
+
+ /**
+ * 开启text与video的轮播
+ * 包含了一个setTimeout, 视频不播放不执行 onCheckAction()
+ *
+ * @param running
+ */
+ private uiCheckLoop(running: boolean): void {
+ this.displayVideo = running;
+ this.dotTextPlay = running;
+ if (this.checkIntervalId != null) {
+ clearInterval(this.checkIntervalId);
+ this.checkIntervalId = null;
+ }
+ if (running) {
+ this.checkTimes = 0;
+ this.checkIntervalId = setInterval(() => {
+ if (this.checkTimes === 0 && this.onCheckAction()) {
+ clearInterval(this.checkIntervalId);
+ this.checkIntervalId = null;
+ }
+ }, 7000);
+ }
+ }
+
+ aboutToAppear() {
+ this.log('aboutToAppear');
+ this.checkNewVersionIfNeed();
+ }
+
+ onBackPress() {
+ this.log('index back');
+ globalThis.abilityContext.terminateSelf();
+ return true;
+ }
+
+ onPageShow() {
+ this.log('onPageShow index');
+ RouterUtils.clearAllPage();
+ globalThis.currentPage = 'pages/index';
+ this.initButtonInfo();
+ if (this.newVersionStatus === NewVersionStatus.CHECKING) {
+ this.uiCheckLoop(true);
+ }
+ }
+
+ public onLanguageChange(): void {
+ this.initButtonInfo();
+ }
+
+ private initButtonInfo(): void {
+ this.buttonText = FormatUtils.toUpperCase(globalThis.abilityContext, $r('app.string.btn_check_new_version'));
+ }
+
+ onPageHide() {
+ this.log('onPageHide index');
+ this.uiCheckLoop(false);
+ }
+
+ build() {
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Start }) {
+ TitleBar({
+ title: $r('app.string.software_update'),
+ onBack: this.onBackPress.bind(this)
+ })
+ Column() {
+ Scroll() {
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Start }) {
+ HomeCardView({ playVideo: this.displayVideo, videoController: this.videoController, onVideoFinished: () => {
+ this.checkTimes++;
+ return this.onCheckAction.call(this);
+ } })
+ Text(this.displayVersion)
+ .fontSize($r('app.float.home_text_size_version_name'))
+ .fontWeight(FontWeight.Medium)
+ .margin({
+ top: $r('app.float.index_version_name_margin_top'),
+ bottom: $r('app.float.index_version_name_margin_bottom')
+ })
+ Row() {
+ Text(this.newVersionActionText)
+ .fontSize($r('app.float.text_size_body'))
+ .fontColor(this.newVersionStatus !== NewVersionStatus.CHECKING ?
+ $r('app.color.blue') : Color.Black)
+ .opacity(this.newVersionStatus !== NewVersionStatus.CHECKING ? 1 : 0.6)
+ .fontWeight(FontWeight.Regular)
+ .align(Alignment.Start)
+ .onClick(() => this.handleStateClicked())
+ CheckingDots({ dotTextPlay: this.dotTextPlay })
+ if (this.newVersionStatus == NewVersionStatus.HAS_NEW_VERSION) {
+ Circle({ width: '8vp', height: '8vp' })
+ .margin({ left: $r('app.float.index_has_new_version_margin_left') })
+ .fill($r('app.color.has_new_version_circle_fill'))
+ }
+ }
+ }.padding({
+ left: $r('app.float.index_content_padding_horizontal'),
+ right: $r('app.float.index_content_padding_horizontal'),
+ bottom: $r('app.float.index_content_padding_bottom')
+ }).width('100%')
+ }.width('100%')
+ .scrollable(ScrollDirection.Vertical)
+ .scrollBar(BarState.On)
+ }.flexGrow(1)
+ Column() {
+ Button() {
+ Text(this.buttonText)
+ .fontSize($r('app.float.text_size_btn')).fontColor(Color.White).fontWeight(FontWeight.Medium)
+ .margin({ left: $r('app.float.custom_button_text_margin_left'),
+ right: $r('app.float.custom_button_text_margin_right') })
+ }
+ .type(ButtonType.Capsule)
+ .constraintSize({ minWidth: $r('app.float.custom_button_width') })
+ .height($r('app.float.custom_button_height'))
+ .backgroundColor($r('app.color.blue'))
+ .opacity(this.newVersionStatus != NewVersionStatus.CHECKING ? 1 : 0.4)
+ .onClick(()=>{
+ if(this.newVersionStatus != NewVersionStatus.CHECKING) {
+ this.checkNewVersionIfNeed()
+ }
+ })
+ }.padding({
+ left: $r('app.float.index_content_padding_horizontal'),
+ right: $r('app.float.index_content_padding_horizontal'),
+ bottom: $r('app.float.index_content_padding_bottom')
+ })
+ }
+ .backgroundColor($r('app.color.page_background'))
+ .width('100%')
+ .height('100%')
+ }
+
+ private log(message: string): void {
+ LogUtils.log('Index', message);
+ }
+
+ private async handleStateClicked() {
+ this.log('handleStateClicked.');
+ }
+}
\ No newline at end of file
diff --git a/product/oh/base/src/main/module.json5 b/product/oh/base/src/main/module.json5
new file mode 100644
index 0000000000000000000000000000000000000000..4a8085cdbf4351fdbf068b269781510e98a2fc0d
--- /dev/null
+++ b/product/oh/base/src/main/module.json5
@@ -0,0 +1,85 @@
+{
+ "module": {
+ "name": "ouc_oh_base",
+ "type": "entry",
+ "srcEntrance": "./ets/Application/AbilityStage.ts",
+ "description": "$string:description_mainability",
+ "mainElement": "MainAbility",
+ "deviceTypes": [
+ "default",
+ "tablet"
+ ],
+ "deliveryWithInstall": true,
+ "installationFree": false,
+ "pages": "$profile:main_pages",
+ "metadata": [
+ {
+ "name": "ArkTSPartialUpdate",
+ "value": "true"
+ },
+ {
+ "name": "partialUpdateStrictCheck",
+ "value": "warn"
+ }
+ ],
+ "abilities": [
+ {
+ "name": "com.ohos.updateapp.MainAbility",
+ "srcEntrance": "./ets/MainAbility/MainAbility.ts",
+ "description": "$string:description_mainability",
+ "icon": "$media:icon",
+ "label": "$string:entry_MainAbility",
+ "startWindowIcon": "$media:icon",
+ "startWindowBackground": "$color:white",
+ "visible": true,
+ "launchType": "singleton",
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ },
+ {
+ "actions": [
+ "action.settings.menu.v1"
+ ]
+ }
+ ],
+ "metadata": [
+ {
+ "name": "metadata.settings.menu.v1",
+ "value": '{"menu" : {"key": "com_hmos_ouc_software_update_settings", "menuType": "Entry","titleResource": "entry_MainAbility"}}'
+ },
+ {
+ "name": "com.ohos.systemui.notification_fixed",
+ "value": '1'
+ }
+ ]
+ }
+ ],
+ "extensionAbilities": [
+ {
+ "name": "ServiceExtAbility",
+ "icon": "$media:icon",
+ "description": "service",
+ "type": "service",
+ "visible": true,
+ "srcEntrance": "./ets/ServiceExtAbility/service.ts"
+ }
+ ],
+ "requestPermissions": [
+ {
+ "name": "ohos.permission.UPDATE_SYSTEM"
+ },
+ {
+ "name": "ohos.permission.GET_NETWORK_INFO"
+ },
+ {
+ "name": "ohos.permission.START_ABILITIES_FROM_BACKGROUND"
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/product/oh/base/src/main/resources/base/element/color.json b/product/oh/base/src/main/resources/base/element/color.json
new file mode 100644
index 0000000000000000000000000000000000000000..e8c7529e4789a4f3e1045f1e36cf3c13ee6809e3
--- /dev/null
+++ b/product/oh/base/src/main/resources/base/element/color.json
@@ -0,0 +1,12 @@
+{
+ "color": [
+ {
+ "name": "blue",
+ "value": "#007DFF"
+ },
+ {
+ "name": "white",
+ "value": "#FFFFFF"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/product/oh/base/src/main/resources/base/element/float.json b/product/oh/base/src/main/resources/base/element/float.json
new file mode 100644
index 0000000000000000000000000000000000000000..322e3372173f03afba01f32d69eab48792536ed9
--- /dev/null
+++ b/product/oh/base/src/main/resources/base/element/float.json
@@ -0,0 +1,8 @@
+{
+ "float": [
+ {
+ "name": "card_border_radius",
+ "value": "24vp"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/product/oh/base/src/main/resources/base/profile/main_pages.json b/product/oh/base/src/main/resources/base/profile/main_pages.json
new file mode 100644
index 0000000000000000000000000000000000000000..4f0fe138cfeefd707fa478f44c9965c2aaea85d2
--- /dev/null
+++ b/product/oh/base/src/main/resources/base/profile/main_pages.json
@@ -0,0 +1,5 @@
+{
+ "src": [
+ "pages/index"
+ ]
+}
\ No newline at end of file
diff --git a/signature/updateapp.p7b b/signature/updateapp.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..412aa6af1cee2396addebba7eaab5ca0411890e2
Binary files /dev/null and b/signature/updateapp.p7b differ