diff --git a/CertificateManager/AppScope/app.json5 b/CertificateManager/AppScope/app.json5 new file mode 100644 index 0000000..837e5f7 --- /dev/null +++ b/CertificateManager/AppScope/app.json5 @@ -0,0 +1,25 @@ +/** + * Copyright (c) 2022 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. + */ +{ + "app": { + "bundleName": "com.example.applications_certmanager", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name", + "distributedNotificationEnabled": true + } +} diff --git a/CertificateManager/AppScope/resources/base/element/string.json b/CertificateManager/AppScope/resources/base/element/string.json new file mode 100644 index 0000000..6a6a052 --- /dev/null +++ b/CertificateManager/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "CertManager" + } + ] +} diff --git a/CertificateManager/AppScope/resources/base/media/app_icon.png b/CertificateManager/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000..ce307a8 Binary files /dev/null and b/CertificateManager/AppScope/resources/base/media/app_icon.png differ diff --git a/CertificateManager/README.md b/CertificateManager/README.md new file mode 100644 index 0000000..9c26b87 --- /dev/null +++ b/CertificateManager/README.md @@ -0,0 +1,67 @@ +# 证书管理应用 + +## 简介 + +### 内容介绍 + +证书管理应用是OpenHarmony中预置的系统应用,主要的功能包含系统根证书查看与启用禁用,用户根证书的安装、查看、启用禁用与卸载,公共业务证书的安装、查看、授权管理与卸载,私有业务证书的查看等功能。 + +### 架构图 + +![](doc/image/image-20220727141455437.png) + +该应用架构主要结合MVP和领域驱动设计思路。 + +### 目录 + +``` +/CertManagerFa/ +├── AppScope # 应用配置 +├── common # 公共工具类 +└── product + └── phone + └── src + └── main + ├── ets # 代码目录 + │   ├── Application # AbilityStage类实现 + │   ├── MainAbility # Ability类实现 + │   ├── model # model层功能类实现 + │   ├── pages # 页面展示实现 + │   ├── presenter # 页面presenter层功能类实现 + │   └── stub # certManager打桩代码 + └── resources # 资源文件目录 +``` + +### 使用方法 + +其他应用拉起证书管理FA并执行证书安装,使用方法如下: + +``` +globalThis.context.startAbility( +{ + bundleName: "com.example.applications_certmanager", + abilityName: "MainAbility", + uri: "certInstall", +}) +``` + +其他应用拉起证书管理FA并执行申请应用授权,使用方法如下: + +``` +//拉起应用申请应用授权 +globalThis.context.startAbilityForResult( +{ + bundleName: "com.example.applications_certmanager", + abilityName: "MainAbility", + uri: "requestAuthorize", + parameters: { + appUid: appUid, //传入申请应用的appUid + } +}) +.then((data) => { + if (!data.resultCode) { + this.authUri = data.want.parameters.authUri; //授权成功后获取返回的authUri + } +}) +``` + diff --git a/CertificateManager/build-profile.json5 b/CertificateManager/build-profile.json5 new file mode 100644 index 0000000..06a3554 --- /dev/null +++ b/CertificateManager/build-profile.json5 @@ -0,0 +1,54 @@ +/** + * Copyright (c) 2022 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. + */ +{ + "app": { + "signingConfigs": [ + { + "name": "default", + "material": { + "storePassword": "000000161B64D26AFDA336B9D4E45469670FC05C21ACB86E817B3A0EBBEF557AEC2E73906C73", + "certpath": "signature/OpenHarmonyApplication.cer", + "keyAlias": "openharmony application release", + "keyPassword": "0000001669F0585B86DCE64A21563F2E7BA5320E86297F85E75F6EA4844BFB920AD864794581", + "profile": "signature/certmanager.p7b", + "signAlg": "SHA256withECDSA", + "storeFile": "signature/OpenHarmony.p12" + } + } + ], + "compileSdkVersion": 9, + "compatibleSdkVersion": 9, + "products": [ + { + "name": "default", + "signingConfig": "default", + } + ] + }, + "modules": [ + { + "name": "phone", + "srcPath": "./product/phone", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/CertificateManager/common/component/ComponentConfig.ets b/CertificateManager/common/component/ComponentConfig.ets new file mode 100644 index 0000000..0507a27 --- /dev/null +++ b/CertificateManager/common/component/ComponentConfig.ets @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2022 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 class ComponentConfig { + WH_100_100 = '100%'; + WH_30_100 = '30%'; + WH_33_100 = '33%'; + WH_35_100 = '35%'; + WH_40_100 = '40%'; + WH_45_100 = '45%'; + WH_50_100 = '50%'; + WH_55_100 = '55%'; + WH_83_100 = '83%'; + WH_90_100 = '90%'; + value_20 = 20; + font_20 = 20; + MAX_LINES_1 = 1; + MAX_LINES_2 = 2; + MAX_LINES_3 = 3; + DURATION_TIME = 200; +} + +let componentConfig = new ComponentConfig(); + +export default componentConfig as ComponentConfig; \ No newline at end of file diff --git a/CertificateManager/common/component/entryComponent.ets b/CertificateManager/common/component/entryComponent.ets new file mode 100644 index 0000000..5140cbf --- /dev/null +++ b/CertificateManager/common/component/entryComponent.ets @@ -0,0 +1,143 @@ +/** + * Copyright (c) 2022 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 ComponentConfig from './ComponentConfig'; + +/** + * item custom component + */ +@Component +export default struct EntryComponent { + @State isShow: Boolean = true; + @Prop settingIcon: string; + @State endTextIsShow: Boolean= true; + private settingTitle: string | Resource; + @State settingSummary: string | Resource = ''; + private settingValue: string; + @State settingArrow: string | PixelMap | Resource = ''; + @Prop settingArrowStyle: string; + private settingUri: string; + @State titleFontColor: Color | number | string | Resource = $r('sys.color.ohos_id_color_text_primary'); + private enabled: boolean = true; + private onArrowClick?: () => void; + @State isTouched: boolean = false; + private height ?= $r('app.float.wh_value_70'); + private image_wh ?= $r('app.float.wh_value_50'); + private fontSize ?= $r('sys.float.ohos_id_text_size_body1'); + private valueFontSize ?= $r('sys.float.ohos_id_text_size_body2'); + + build() { + Row() { + Row() { + Image(this.settingIcon) + .width(this.image_wh) + .height(this.image_wh) + .margin({ right: $r('app.float.wh_10') }) + .visibility('' === this.settingIcon ? Visibility.None : Visibility.Visible) + .objectFit(ImageFit.Contain) + .fillColor($r("sys.color.ohos_id_color_primary")) + Column() { + Text(this.settingTitle) + .fontColor(this.enabled ? this.titleFontColor : $r("sys.color.ohos_id_color_primary")) + .fontSize(this.fontSize) + .textAlign(TextAlign.Start) + .maxLines(ComponentConfig.MAX_LINES_3) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .fontWeight(500) + Row() { + Text($r('app.string.version')) + .fontColor($r('sys.color.ohos_id_color_text_secondary')) + .fontSize($r('sys.float.ohos_id_text_size_body2')) + .textAlign(TextAlign.Start) + .maxLines(ComponentConfig.MAX_LINES_1) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .visibility('pages/applicationInfo' === this.settingUri ? Visibility.Visible : Visibility.None) + .margin({ top: $r('sys.float.ohos_id_text_margin_vertical') }); + + Text(this.settingSummary) + .fontColor($r('sys.color.ohos_id_color_text_secondary')) + .fontSize($r('sys.float.ohos_id_text_size_body2')) + .fontWeight('sans-serif') + .textAlign(TextAlign.Start) + .maxLines(ComponentConfig.MAX_LINES_1) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .visibility('' === this.settingSummary || undefined === this.settingSummary ? Visibility.None : Visibility.Visible) + .margin({ top: $r('sys.float.ohos_id_text_margin_vertical') }); + } + } + .alignItems(HorizontalAlign.Start); + } + .flexShrink(0) + .alignItems(VerticalAlign.Center) + .align(Alignment.Start) + .layoutWeight(1) + + Row() { + Text(this.settingValue) + .fontSize(this.valueFontSize) + .fontColor($r("sys.color.ohos_id_color_primary")) + .opacity($r('sys.float.ohos_id_alpha_content_secondary')) + .fontWeight('HwChinese-medium') + .height($r('app.float.wh_value_40')) + .margin({ left: $r('sys.float.ohos_id_elements_margin_horizontal_l'), right: $r('app.float.wh_value_4') }) + .align(Alignment.End); + + if (!this.settingArrowStyle && this.settingArrow) { + Image(this.settingArrow) + .visibility('' === this.settingArrow ? Visibility.None : Visibility.Visible) + .width($r("app.float.wh_value_12")) + .height($r("app.float.wh_value_24")) + .margin({ right: $r('app.float.wh_24') }) + .fillColor($r("sys.color.ohos_id_color_primary")) + .opacity($r("app.float.opacity_0_2")) + } else if (this.settingArrow) { + Image(this.settingArrow) + .visibility('' === this.settingArrow ? Visibility.None : Visibility.Visible) + .fillColor($r("sys.color.ohos_id_color_primary")) + .width($r('app.float.wh_value_24')) + .height($r('app.float.wh_value_24')) + .margin({ right: $r('app.float.wh_24') }) + .borderRadius($r("sys.float.ohos_id_corner_radius_default_l")) + .onClick(this.onArrowClick) + + } + } + .alignItems(VerticalAlign.Center) + .align(Alignment.End); + } + .opacity(this.enabled?1:$r('sys.float.ohos_id_alpha_disabled')) + .height(this.height) + .width(ComponentConfig.WH_100_100) + .padding({ left: $r('sys.float.ohos_id_default_padding_start') }) + .borderRadius($r("sys.float.ohos_id_corner_radius_default_l")) + .linearGradient((this.enabled && this.isTouched) ? { + angle: 90, + direction: GradientDirection.Right, + colors: [[$r("app.color.DCEAF9"), 0.0], [$r("app.color.FAFAFA"), 1.0]] + } : { + angle: 90, + direction: GradientDirection.Right, + colors: [[$r("sys.color.ohos_id_color_foreground_contrary"), 1], [$r("sys.color.ohos_id_color_foreground_contrary"), 1]] + }) + .alignItems(VerticalAlign.Center) + .onTouch((event: TouchEvent) => { + if (event.type === TouchType.Down) { + this.isTouched = true; + } + if (event.type === TouchType.Up) { + this.isTouched = false; + } + }) + } +} \ No newline at end of file diff --git a/CertificateManager/common/component/headComponent.ets b/CertificateManager/common/component/headComponent.ets new file mode 100644 index 0000000..455b811 --- /dev/null +++ b/CertificateManager/common/component/headComponent.ets @@ -0,0 +1,67 @@ +/** + * Copyright (c) 2022 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 ComponentConfig from './ComponentConfig'; +import Router from '@system.router'; + +/** + * head custom component + */ +@Component +export default struct HeadComponent { + private icBackIsVisibility: boolean= true; + private headName: string | Resource = ''; + @State isTouch: boolean= false; + + build() { + Row() { + Stack({ alignContent: Alignment.Center }) { + Image($r('app.media.ic_back')) + .width($r('app.float.wh_value_24')) + .height($r('app.float.wh_value_24')) + .fillColor($r("sys.color.ohos_id_color_primary")) + } + .margin({ right: $r('app.float.wh_value_16') }) + .backgroundColor(this.isTouch ? $r('app.color.color_E3E3E3_grey') : $r('app.color.color_00000000_transparent')) + .visibility(this.icBackIsVisibility ? Visibility.Visible : Visibility.None) + .onClick(() => { + Router.back(); + }) + .onTouch((event: TouchEvent) => { + if (event.type === TouchType.Down) { + this.isTouch = true; + } + if (event.type === TouchType.Up) { + this.isTouch = false; + } + }); + + Text(this.headName) + .fontSize($r('app.float.head_font_20')) + .lineHeight($r('app.float.wh_value_33')) + .fontFamily('HarmonyHeiTi-Bold') + .fontWeight(FontWeight.Regular) + .fontColor($r('app.color.font_color_182431')) + .maxLines(ComponentConfig.MAX_LINES_1) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .textAlign(TextAlign.Start) + .margin({ top: $r('app.float.wh_value_13'), bottom: $r('app.float.wh_value_15') }); + } + .width(ComponentConfig.WH_100_100) + .padding({ left: $r('app.float.wh_value_24') }) + .height($r('app.float.wh_value_56')) + .alignItems(VerticalAlign.Center) + .align(Alignment.Start) + } +} \ No newline at end of file diff --git a/CertificateManager/common/component/subEntryComponent.ets b/CertificateManager/common/component/subEntryComponent.ets new file mode 100644 index 0000000..2e6e871 --- /dev/null +++ b/CertificateManager/common/component/subEntryComponent.ets @@ -0,0 +1,140 @@ +/** + * Copyright (c) 2022 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 ComponentConfig from './ComponentConfig'; + +/** + * Sub-Page Entry Component + */ +@Component +export struct SubEntryComponent { + private targetPage: string; + private title: string | Resource; + @State isTouched: boolean = false; + + build() { + Navigator({ target: this.targetPage }) { + Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { + Row() { + Text(this.title) + .fontSize($r('app.float.font_16')) + .lineHeight($r('app.float.wh_value_22')) + .fontColor($r('app.color.font_color_182431')) + .fontWeight(FontWeight.Medium) + .margin({ left: $r('app.float.distance_8') }) + .textAlign(TextAlign.Start); + } + + Image('/res/image/ic_settings_arrow.svg') + .width($r('app.float.wh_value_12')) + .height($r('app.float.wh_value_24')) + .margin({ right: $r('app.float.distance_8') }) + .fillColor($r("sys.color.ohos_id_color_primary")) + .opacity($r("app.float.opacity_0_2")) + } + .height(ComponentConfig.WH_100_100) + .width(ComponentConfig.WH_100_100) + .borderRadius($r('app.float.radius_20')) + .linearGradient(this.isTouched ? { + angle: 90, + direction: GradientDirection.Right, + colors: [[$r("app.color.DCEAF9"), 0.0], [$r("app.color.FAFAFA"), 1.0]] + } : { + angle: 90, + direction: GradientDirection.Right, + colors: [[$r("sys.color.ohos_id_color_foreground_contrary"), 1], [$r("sys.color.ohos_id_color_foreground_contrary"), 1]] + }) + .onTouch((event: TouchEvent) => { + if (event.type === TouchType.Down) { + this.isTouched = true; + } + if (event.type === TouchType.Up) { + this.isTouched = false; + } + }) + } + .padding($r('app.float.distance_4')) + .height($r('app.float.wh_value_56')) + .borderRadius($r('app.float.radius_24')) + .backgroundColor($r("sys.color.ohos_id_color_foreground_contrary")); + } +} + + +/** + * Sub-Page Entry Component with EndText + */ +@Component +export struct SubEntryComponentWithEndText { + @State isTouched: boolean = false; + @Prop endText: string; + private targetPage: string; + private title: string | Resource; + + build() { + Navigator({ target: this.targetPage }) { + Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { + Row() { + Text(this.title) + .fontSize($r('app.float.font_16')) + .lineHeight($r('app.float.wh_value_22')) + .fontWeight(FontWeight.Medium) + .fontColor($r('app.color.font_color_182431')) + .margin({ left: $r('app.float.distance_8') }) + .textAlign(TextAlign.Start); + } + + Row() { + Text(this.endText) + .fontSize($r('app.float.font_14')) + .lineHeight($r('app.float.wh_value_19')) + .fontWeight(FontWeight.Regular) + .fontColor($r('sys.color.ohos_id_color_text_secondary')) + .margin({ right: $r('app.float.distance_4') }) + .textAlign(TextAlign.End); + Image('/res/image/ic_settings_arrow.svg') + .width($r('app.float.wh_value_12')) + .height($r('app.float.wh_value_24')) + .margin({ right: $r('app.float.distance_8') }) + .fillColor($r("sys.color.ohos_id_color_primary")) + .opacity($r("app.float.opacity_0_2")) + } + } + .height(ComponentConfig.WH_100_100) + .width(ComponentConfig.WH_100_100) + .borderRadius($r('app.float.radius_20')) + .linearGradient(this.isTouched ? { + angle: 90, + direction: GradientDirection.Right, + colors: [[$r("app.color.DCEAF9"), 0.0], [$r("app.color.FAFAFA"), 1.0]] + } : { + angle: 90, + direction: GradientDirection.Right, + colors: [[$r("sys.color.ohos_id_color_foreground_contrary"), 1], [$r("sys.color.ohos_id_color_foreground_contrary"), 1]] + }) + .onTouch((event: TouchEvent) => { + if (event.type === TouchType.Down) { + this.isTouched = true; + } + if (event.type === TouchType.Up) { + this.isTouched = false; + } + }); + } + .padding($r('app.float.distance_4')) + .height($r('app.float.wh_value_56')) + .borderRadius($r('app.float.radius_24')) + .backgroundColor($r("sys.color.ohos_id_color_foreground_contrary")); + } +} \ No newline at end of file diff --git a/CertificateManager/common/util/ConfigData.ts b/CertificateManager/common/util/ConfigData.ts new file mode 100644 index 0000000..569d9d8 --- /dev/null +++ b/CertificateManager/common/util/ConfigData.ts @@ -0,0 +1,65 @@ +/** + * Copyright (c) 2022 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 class ConfigData { + + WH_100_100 = '100%'; + WH_3_100 = '3%'; + WH_4_100 = '4%'; + WH_20_100 = '20%'; + WH_25_100 = '25%'; + WH_30_100 = '30%'; + WH_33_100 = '33%'; + WH_35_100 = '35%'; + WH_40_100 = '40%'; + WH_43_100 = '43%'; + WH_45_100 = '45%'; + WH_50_100 = '50%'; + WH_53_100 = '53%'; + WH_55_100 = '55%'; + WH_60_100 = '60%'; + WH_65_100 = '65%'; + WH_70_100 = '70%'; + WH_75_100 = '75%'; + WH_80_100 = '80%'; + WH_85_100 = '85%'; + WH_88_100 = '88%'; + WH_90_100 = '90%'; + WH_92_100 = '92%'; + WH_93_100 = '93%'; + WH_94_100 = '94%'; + + value_20 = 20; + font_20 = 20; + + TAG = 'CertManager Fa ' + SWITCH_BUTTON_X_OFFSET = '-4vp' + DIALOG_DY_OFFSET = '-16vp' + + PWD_MAX_LENGTH = 64; + ALIAS_MAX_LENGTH = 64; + MAX_LINES_1 = 1; + MAX_LINES_2 = 2; + MAX_LINES_3 = 3; + DURATION_TIME = 200; + FUNCTION_TYPE_HDC = 4; + APP_AUTH_MAX_LENGTH = 4; + REQUEST_AUTH_MAX_LENGTH = 5; + VERTICAL_DIVIDER_WIDTH = 1; + +} + +let configData = new ConfigData(); +export default configData as ConfigData; \ No newline at end of file diff --git a/CertificateManager/common/util/LogDecorator.ts b/CertificateManager/common/util/LogDecorator.ts new file mode 100644 index 0000000..c883389 --- /dev/null +++ b/CertificateManager/common/util/LogDecorator.ts @@ -0,0 +1,63 @@ +/** + * Copyright (c) 2022 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 LogUtil from './LogUtil'; +import ConfigData from './ConfigData'; + +/** + * Method log decorator + */ +const LogMethod = (target: Object, methodName: string, propertyDescriptor: PropertyDescriptor): PropertyDescriptor => { + const method = propertyDescriptor.value; + + propertyDescriptor.value = function (...args: any[]) { + const params = args.map(a => JSON.stringify(a)).join(); + LogUtil.info(ConfigData.TAG + `${target.constructor.name}#${methodName}(${params}) in `); + + const result = method.apply(this, args); + const r = JSON.stringify(result); + + LogUtil.info(ConfigData.TAG + `${target.constructor.name}#${methodName}(${params}) out => ${r}`); + return result; + } + + return propertyDescriptor; +}; + +/** + * Class decorator to log all methods + */ +export const LogAll = (target: any) => { + Reflect.ownKeys(target.prototype).forEach(propertyKey => { + let propertyDescriptor: PropertyDescriptor = Object.getOwnPropertyDescriptor(target.prototype, propertyKey); + const method = propertyDescriptor.value; + + if (method) { + propertyDescriptor.value = function (...args: any[]) { + const params = args.map(a => JSON.stringify(a)).join(); + LogUtil.info(ConfigData.TAG + `${target.name}#${propertyKey.toString()}(${params}) in `); + + const result = method.apply(this, args); + const r = JSON.stringify(result); + + LogUtil.info(ConfigData.TAG + `${target.name}#${propertyKey.toString()}(${params}) out => ${r}`); + return result; + } + + Object.defineProperty(target.prototype, propertyKey, propertyDescriptor); + } + }); +} + +export default LogMethod; diff --git a/CertificateManager/common/util/LogUtil.ts b/CertificateManager/common/util/LogUtil.ts new file mode 100644 index 0000000..dcdfe6e --- /dev/null +++ b/CertificateManager/common/util/LogUtil.ts @@ -0,0 +1,85 @@ +/** + * Copyright (c) 2022 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. + */ + +/** + * Log level + */ +let LogLevel = { + /** + * debug + */ + DEBUG: 3, + + /** + * info + */ + INFO: 4, + + /** + * warn + */ + WARN: 5, + + /** + * error + */ + ERROR: 6, + + /** + * fatal + */ + FATAL: 7, +}; + +const LOG_LEVEL = LogLevel.INFO + +/** + * log package tool class + */ +export class LogUtil { + debug(msg): void { + if (LogLevel.DEBUG >= LOG_LEVEL) { + console.info(msg); + } + } + + log(msg): void { + if (LogLevel.INFO >= LOG_LEVEL) { + console.log(msg); + } + } + + info(msg): void { + if (LogLevel.INFO >= LOG_LEVEL) { + console.info(msg); + } + } + + warn(msg): void { + if (LogLevel.WARN >= LOG_LEVEL) { + console.warn(msg); + } + } + + error(msg): void { + if (LogLevel.ERROR >= LOG_LEVEL) { + console.error(msg); + } + } +} + +let mLogUtil = new LogUtil(); +export default mLogUtil as LogUtil +; diff --git a/CertificateManager/common/util/ResourceUtil.ts b/CertificateManager/common/util/ResourceUtil.ts new file mode 100644 index 0000000..5fa4dea --- /dev/null +++ b/CertificateManager/common/util/ResourceUtil.ts @@ -0,0 +1,47 @@ +/** + * Copyright (c) 2022 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 Log from './logdecorator'; + +/** + * Resource util + */ +export class ResourceUtil { + private resMgr: any; + + /** + * Initialize ResourceManager + */ + @Log + async initResourceManager(): Promise { + if (!this.resMgr) { + this.resMgr = await globalThis.certManagerAbilityContext.resourceManager; + } + } + + /** + * Get string value from NormalResource instance + * + * @param resource - NormalResource instance + */ + @Log + async getString(resource): Promise { + await this.initResourceManager(); + return await this.resMgr.getString(resource.id); + } + +} + +let resourceUtil = new ResourceUtil(); +export default resourceUtil as ResourceUtil; diff --git a/CertificateManager/doc/image/image-20220727141455437.png b/CertificateManager/doc/image/image-20220727141455437.png new file mode 100644 index 0000000..b4102ad Binary files /dev/null and b/CertificateManager/doc/image/image-20220727141455437.png differ diff --git a/CertificateManager/gradlew b/CertificateManager/gradlew new file mode 100644 index 0000000..c40e87b --- /dev/null +++ b/CertificateManager/gradlew @@ -0,0 +1,37 @@ +# +# Copyright (c) 2022-2022 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 +# +# https://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. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +function npm_install { + cd $1 + npm install +} + +npm config set registry http://mirrors.tools.huawei.com/npm/ +npm config set @ohos:registry https://cmc.centralrepo.rnd.huawei.com/artifactory/api/npm/product_npm/ +npm config set strict-ssl false +npm config set sslVerify false + +APP_HOME="`pwd -P`" +npm_install "$APP_HOME" +npm_install "$APP_HOME/product" +cd $APP_HOME +node ./node_modules/@ohos/hvigor/bin/hvigor.js --mode module assembleHap \ No newline at end of file diff --git a/CertificateManager/hvigorfile.js b/CertificateManager/hvigorfile.js new file mode 100644 index 0000000..22fbe15 --- /dev/null +++ b/CertificateManager/hvigorfile.js @@ -0,0 +1,17 @@ +/** + * Copyright (c) 2022 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. + */ + +// 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/CertificateManager/package-lock.json b/CertificateManager/package-lock.json new file mode 100644 index 0000000..ddf3718 --- /dev/null +++ b/CertificateManager/package-lock.json @@ -0,0 +1,1652 @@ +{ + "name": "applications_certmanager", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@ohos/hvigor": { + "version": "1.0.6", + "resolved": "https://repo.harmonyos.com/npm/@ohos/hvigor/-/@ohos/hvigor-1.0.6.tgz", + "integrity": "sha512-jjp7vpvUOMW1Nf7TdyhOtonwWHoSyBJLUiZTQqIx/GJV4UJyIqsiURUOqFwncQ4L7PDdeHuWly4uEelknYeWhg==", + "requires": { + "@ohos/hvigor-base": "1.0.6", + "interpret": "1.4.0", + "liftoff": "4.0.0", + "mute-stdout": "1.0.0", + "pretty-hrtime": "1.0.0", + "v8flags": "3.2.0", + "yargs": "7.1.0" + } + }, + "@ohos/hvigor-base": { + "version": "1.0.6", + "resolved": "https://repo.harmonyos.com/npm/@ohos/hvigor-base/-/@ohos/hvigor-base-1.0.6.tgz", + "integrity": "sha512-cRDnWICTxmpNiFb9clIioqP5Oik1seLCICztXVhZqultrHuxwTheCRUZrHwlpyWdkSB2Al+FFBqmSwzIgZX4IQ==", + "requires": { + "json5": "2.2.0", + "log4js": "6.4.1", + "undertaker": "1.2.1" + } + }, + "@ohos/hvigor-ohos-plugin": { + "version": "1.0.6", + "resolved": "https://repo.harmonyos.com/npm/@ohos/hvigor-ohos-plugin/-/@ohos/hvigor-ohos-plugin-1.0.6.tgz", + "integrity": "sha512-MAAi8uJxMzODUoSSNfBr+fU4HQ20dfQtkje9I+X4asc7qY2kAplW/q9f5XS8IOvv8zhC8OcSgsAXOAJuLMstOQ==", + "requires": { + "@ohos/hvigor-base": "1.0.6", + "@ohos/sdkmanager-common": "1.1.3", + "ajv": "8.10.0", + "archiver": "5.3.0", + "execa": "5.1.1", + "fs-extra": "10.0.0", + "glob": "7.2.0", + "iconv-lite": "0.6.3", + "json5": "2.2.0", + "lodash": "4.17.21", + "pretty-hrtime": "1.0.3", + "resolve-package-path": "4.0.3" + }, + "dependencies": { + "fs-extra": { + "version": "10.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/fs-extra/-/fs-extra-10.0.0.tgz", + "integrity": "sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==", + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + } + }, + "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/sdkmanager-common": { + "version": "1.1.3", + "resolved": "https://repo.harmonyos.com/npm/@ohos/sdkmanager-common/-/@ohos/sdkmanager-common-1.1.3.tgz", + "integrity": "sha512-d2uhVauDDJZIUvyyaWWoavG4N/jLyfF5IH5kEXKV6R8HNf3606H1zDQzA+UZtOfwwJFXhD9djRjnVFNB8xc7aw==" + }, + "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": "2.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==" + }, + "archiver": { + "version": "5.3.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/archiver/-/archiver-5.3.0.tgz", + "integrity": "sha512-iUw+oDwK0fgNpvveEsdQ0Ase6IIKztBJU2U0E9MzszMfmVVUyv1QJhS2ITW9ZCqx8dktAxVAjWWkKehuZE8OPg==", + "requires": { + "archiver-utils": "^2.1.0", + "async": "^3.2.0", + "buffer-crc32": "^0.2.1", + "readable-stream": "^3.6.0", + "readdir-glob": "^1.0.0", + "tar-stream": "^2.2.0", + "zip-stream": "^4.1.0" + } + }, + "archiver-utils": { + "version": "2.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/archiver-utils/-/archiver-utils-2.1.0.tgz", + "integrity": "sha512-bEL/yUb/fNNiNTuUz979Z0Yg5L+LzLxGJz8x79lYmR54fmTIb6ob/hNQgkQnIUDWIFjZVQwl9Xs356I6BAMHfw==", + "requires": { + "glob": "^7.1.4", + "graceful-fs": "^4.2.0", + "lazystream": "^1.0.0", + "lodash.defaults": "^4.2.0", + "lodash.difference": "^4.5.0", + "lodash.flatten": "^4.4.0", + "lodash.isplainobject": "^4.0.6", + "lodash.union": "^4.6.0", + "normalize-path": "^3.0.0", + "readable-stream": "^2.0.0" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://repo.huaweicloud.com/repository/npm/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "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" + } + } + } + }, + "arr-filter": { + "version": "1.1.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/arr-filter/-/arr-filter-1.1.2.tgz", + "integrity": "sha512-A2BETWCqhsecSvCkWAeVBFLH6sXEUGASuzkpjL3GR1SlL/PWL6M3J8EAAld2Uubmh39tvkJTqC9LeLHCUKmFXA==", + "requires": { + "make-iterator": "^1.0.0" + } + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==" + }, + "arr-map": { + "version": "2.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/arr-map/-/arr-map-2.0.2.tgz", + "integrity": "sha512-tVqVTHt+Q5Xb09qRkbu+DidW1yYzz5izWS2Xm2yFm7qJnmUfz4HPzNxbHkdRJbz2lrqI7S+z17xNYdFcBBO8Hw==", + "requires": { + "make-iterator": "^1.0.0" + } + }, + "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-initial": { + "version": "1.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/array-initial/-/array-initial-1.1.0.tgz", + "integrity": "sha512-BC4Yl89vneCYfpLrs5JU2aAu9/a+xWbeKhvISg9PT7eWFB9UlRvI+rKEtk6mgxWr3dSkk9gQ8hCrdqt06NXPdw==", + "requires": { + "array-slice": "^1.0.0", + "is-number": "^4.0.0" + } + }, + "array-last": { + "version": "1.3.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/array-last/-/array-last-1.3.0.tgz", + "integrity": "sha512-eOCut5rXlI6aCOS7Z7kCplKRKyiFQ6dHFBem4PwlwKeNFk2/XxTrhRh5T9PyaEWGy/NHTZWbY+nsZlNFJu9rYg==", + "requires": { + "is-number": "^4.0.0" + } + }, + "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==" + }, + "async": { + "version": "3.2.4", + "resolved": "https://repo.huaweicloud.com/repository/npm/async/-/async-3.2.4.tgz", + "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==" + }, + "async-done": { + "version": "1.3.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/async-done/-/async-done-1.3.2.tgz", + "integrity": "sha512-uYkTP8dw2og1tu1nmza1n1CMW0qb8gWWlwqMmLb7MhBVs4BXrFziT6HXUd+/RlRA/i4H9AkofYloUbs1fwMqlw==", + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.2", + "process-nextick-args": "^2.0.0", + "stream-exhaust": "^1.0.1" + } + }, + "async-settle": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/async-settle/-/async-settle-1.0.0.tgz", + "integrity": "sha512-VPXfB4Vk49z1LHHodrEQ6Xf7W4gg1w0dAPROHngx7qgDjqmIQ+fXmwgGXTW/ITLai0YLSvWepJOP9EVpMnEAcw==", + "requires": { + "async-done": "^1.2.2" + } + }, + "bach": { + "version": "1.2.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/bach/-/bach-1.2.0.tgz", + "integrity": "sha512-bZOOfCb3gXBXbTFXq3OZtGR88LwGeJvzu6szttaIzymOTS4ZttBNOWSv7aLZja2EMycKtRYV0Oa8SNKH/zkxvg==", + "requires": { + "arr-filter": "^1.1.1", + "arr-flatten": "^1.0.1", + "arr-map": "^2.0.0", + "array-each": "^1.0.0", + "array-initial": "^1.0.0", + "array-last": "^1.1.1", + "async-done": "^1.2.2", + "async-settle": "^1.0.0", + "now-and-later": "^2.0.0" + } + }, + "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==" + }, + "base64-js": { + "version": "1.5.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" + }, + "bl": { + "version": "4.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "requires": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.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" + } + }, + "buffer": { + "version": "5.7.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "buffer-crc32": { + "version": "0.2.13", + "resolved": "https://repo.huaweicloud.com/repository/npm/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==" + }, + "call-bind": { + "version": "1.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + } + }, + "camelcase": { + "version": "3.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha512-4nhGqUkc4BqbBBB4Q6zLuD7lzzrHYrjKGeYaEji/3tFR5VdJu9v+LilhGIVe8wxEJPPOeWo7eg8dwY13TZ1BNg==" + }, + "cliui": { + "version": "3.2.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha512-0yayqDxWQbqk3ojkYqUKqaAQ6AfNKeKWRNA8kR0WXzAsdHpP4BIaOmMAG87JGuO6qcobyW4GjxHd9PmhEd+T9w==", + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" + } + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA==" + }, + "collection-map": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/collection-map/-/collection-map-1.0.0.tgz", + "integrity": "sha512-5D2XXSpkOnleOI21TG7p3T0bGAsZ/XknZpKBmGYyluO8pw4zA3K8ZlrBIbC4FXg3m6z/RNFiUFfT2sQK01+UHA==", + "requires": { + "arr-map": "^2.0.2", + "for-own": "^1.0.0", + "make-iterator": "^1.0.0" + } + }, + "compress-commons": { + "version": "4.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/compress-commons/-/compress-commons-4.1.1.tgz", + "integrity": "sha512-QLdDLCKNV2dtoTorqgxngQCMA+gWXkM/Nwu7FpeBhk/RdkzimqC3jueb/FDmaZeXh+uby1jkBqE3xArsLBE5wQ==", + "requires": { + "buffer-crc32": "^0.2.13", + "crc32-stream": "^4.0.2", + "normalize-path": "^3.0.0", + "readable-stream": "^3.6.0" + } + }, + "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==" + }, + "crc-32": { + "version": "1.2.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/crc-32/-/crc-32-1.2.2.tgz", + "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==" + }, + "crc32-stream": { + "version": "4.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/crc32-stream/-/crc32-stream-4.0.2.tgz", + "integrity": "sha512-DxFZ/Hk473b/muq1VJ///PMNLj0ZMnzye9thBpmjpJKCc5eMgB95aK8zCGrGfQ90cWo561Te6HK9D+j4KPdM6w==", + "requires": { + "crc-32": "^1.2.0", + "readable-stream": "^3.4.0" + } + }, + "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" + } + } + } + }, + "d": { + "version": "1.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/d/-/d-1.0.1.tgz", + "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", + "requires": { + "es5-ext": "^0.10.50", + "type": "^1.0.1" + } + }, + "date-format": { + "version": "4.0.11", + "resolved": "https://repo.huaweicloud.com/repository/npm/date-format/-/date-format-4.0.11.tgz", + "integrity": "sha512-VS20KRyorrbMCQmpdl2hg5KaOUsda1RbnsJg461FfrcyCUg+pkd0b40BSW4niQyTheww4DBXQnS7HwSrKkipLw==" + }, + "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" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==" + }, + "default-resolution": { + "version": "2.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/default-resolution/-/default-resolution-2.0.0.tgz", + "integrity": "sha512-2xaP6GiwVwOEbXCGoJ4ufgC76m8cj805jrghScewJC2ZDsb9U0b4BIrba+xt/Uytyd0HvQ6+WymSRTfnYj59GQ==" + }, + "define-properties": { + "version": "1.1.4", + "resolved": "https://repo.huaweicloud.com/repository/npm/define-properties/-/define-properties-1.1.4.tgz", + "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", + "requires": { + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + } + }, + "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==" + }, + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://repo.huaweicloud.com/repository/npm/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "requires": { + "once": "^1.4.0" + } + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es5-ext": { + "version": "0.10.61", + "resolved": "https://repo.huaweicloud.com/repository/npm/es5-ext/-/es5-ext-0.10.61.tgz", + "integrity": "sha512-yFhIqQAzu2Ca2I4SE2Au3rxVfmohU9Y7wqGR+s7+H7krk26NXhIRAZDgqd6xqjCEFUomDEA3/Bo/7fKmIkW1kA==", + "requires": { + "es6-iterator": "^2.0.3", + "es6-symbol": "^3.1.3", + "next-tick": "^1.1.0" + } + }, + "es6-iterator": { + "version": "2.0.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==", + "requires": { + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" + } + }, + "es6-symbol": { + "version": "3.1.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/es6-symbol/-/es6-symbol-3.1.3.tgz", + "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", + "requires": { + "d": "^1.0.1", + "ext": "^1.1.2" + } + }, + "es6-weak-map": { + "version": "2.0.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/es6-weak-map/-/es6-weak-map-2.0.3.tgz", + "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==", + "requires": { + "d": "1", + "es5-ext": "^0.10.46", + "es6-iterator": "^2.0.3", + "es6-symbol": "^3.1.1" + } + }, + "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" + } + }, + "ext": { + "version": "1.6.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/ext/-/ext-1.6.0.tgz", + "integrity": "sha512-sdBImtzkq2HpkdRLtlLWDa6w4DX22ijZLKx8BMPUuKe1c5lbN6xwQDQCxSfxBQnHZ13ls/FH0MQZx/q/gr6FQg==", + "requires": { + "type": "^2.5.0" + }, + "dependencies": { + "type": { + "version": "2.6.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/type/-/type-2.6.0.tgz", + "integrity": "sha512-eiDBDOmkih5pMbo9OqsqPRGMljLodLcwd5XD5JbtNB0o89xZAwynY9EdCDsJU7LtcVCClu9DvM7/0Ep1hYX3EQ==" + } + } + }, + "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==" + }, + "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" + } + }, + "find-up": { + "version": "1.1.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha512-jvElSjyuo4EMQGoTwo1uJU5pQMwTW5lS1x05zzfJuTIyLR3zwO27LYrxNg+dlvKpGOuGy/MzBdXh80g0ve5+HA==", + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "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.5", + "resolved": "https://repo.huaweicloud.com/repository/npm/flatted/-/flatted-3.2.5.tgz", + "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==" + }, + "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-constants": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" + }, + "fs-extra": { + "version": "10.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "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": "1.0.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==" + }, + "get-intrinsic": { + "version": "1.1.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/get-intrinsic/-/get-intrinsic-1.1.2.tgz", + "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.3" + } + }, + "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.10", + "resolved": "https://repo.huaweicloud.com/repository/npm/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" + }, + "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" + } + }, + "has-property-descriptors": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", + "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "requires": { + "get-intrinsic": "^1.1.1" + } + }, + "has-symbols": { + "version": "1.0.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" + }, + "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" + } + }, + "hosted-git-info": { + "version": "2.8.9", + "resolved": "https://repo.huaweicloud.com/repository/npm/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==" + }, + "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" + } + }, + "ieee754": { + "version": "1.2.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" + }, + "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==" + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha512-xgs2NH9AE66ucSq4cNG1nhSFghr5l6tdL15Pk+jl46bmmBapgoaY/AacXyaDznAqmGL99TiLSQgO/XazFSKYeQ==" + }, + "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-arrayish": { + "version": "0.2.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==" + }, + "is-core-module": { + "version": "2.9.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/is-core-module/-/is-core-module-2.9.0.tgz", + "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", + "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": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==", + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "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": "4.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==" + }, + "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-utf8": { + "version": "0.2.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha512-rMYPYvCzsXywIsldgLaSoPlw5PfoB/ssr7hY4pLfcodrA5M/eArza1a9VmTiNIBNMjOGr1Ow9mTyU2o69U6U9Q==" + }, + "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.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/json5/-/json5-2.2.0.tgz", + "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", + "requires": { + "minimist": "^1.2.5" + } + }, + "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" + } + }, + "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==" + }, + "last-run": { + "version": "1.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/last-run/-/last-run-1.1.1.tgz", + "integrity": "sha512-U/VxvpX4N/rFvPzr3qG5EtLKEnNI0emvIQB3/ecEwv+8GHaUKbIB8vxv1Oai5FAF0d0r7LXHhLLe5K/yChm5GQ==", + "requires": { + "default-resolution": "^2.0.0", + "es6-weak-map": "^2.0.1" + } + }, + "lazystream": { + "version": "1.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/lazystream/-/lazystream-1.0.1.tgz", + "integrity": "sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==", + "requires": { + "readable-stream": "^2.0.5" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://repo.huaweicloud.com/repository/npm/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "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" + } + } + } + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha512-YiGkH6EnGrDGqLMITnGjXtGmNtjoXw9SVUzcaos8RBi7Ps0VBylkq+vOcY9QE5poLasPCR849ucFUkl0UzUyOw==", + "requires": { + "invert-kv": "^1.0.0" + } + }, + "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" + } + }, + "load-json-file": { + "version": "1.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha512-cy7ZdNRXdablkXYNI049pthVeXFurRyb9+hA/dZzerZ0pGTx42z+y+ssxBaVV2l70t1muq5IdKhn4UtcoGUY9A==", + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" + } + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://repo.huaweicloud.com/repository/npm/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "lodash.defaults": { + "version": "4.2.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/lodash.defaults/-/lodash.defaults-4.2.0.tgz", + "integrity": "sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==" + }, + "lodash.difference": { + "version": "4.5.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/lodash.difference/-/lodash.difference-4.5.0.tgz", + "integrity": "sha512-dS2j+W26TQ7taQBGN8Lbbq04ssV3emRw4NY58WErlTO29pIqS0HmoT5aJ9+TUQ1N3G+JOZSji4eugsWwGp9yPA==" + }, + "lodash.flatten": { + "version": "4.4.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/lodash.flatten/-/lodash.flatten-4.4.0.tgz", + "integrity": "sha512-C5N2Z3DgnnKr0LOpv/hKCgKdb7ZZwafIrsesve6lmzvZIRZRGaZ/l6Q8+2W7NaT+ZwO3fFlSCzCzrDCFdJfZ4g==" + }, + "lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://repo.huaweicloud.com/repository/npm/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==" + }, + "lodash.union": { + "version": "4.6.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/lodash.union/-/lodash.union-4.6.0.tgz", + "integrity": "sha512-c4pB2CdGrGdjMKYLA+XiRDO7Y0PRQbm/Gzg8qMj+QH+pFVAoTp5sBpO0odL3FjoPCGjK96p6qsP+yQoiLoOBcw==" + }, + "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" + } + }, + "minimist": { + "version": "1.2.6", + "resolved": "https://repo.huaweicloud.com/repository/npm/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" + }, + "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==" + }, + "next-tick": { + "version": "1.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/next-tick/-/next-tick-1.1.0.tgz", + "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==" + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" + }, + "now-and-later": { + "version": "2.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/now-and-later/-/now-and-later-2.0.1.tgz", + "integrity": "sha512-KGvQ0cB70AQfg107Xvs/Fbu+dGmZoTRJp2TaPwcwQm3/7PteUyN2BCgk8KBMPGBUXZdVwyWS8fDCGFygBm19UQ==", + "requires": { + "once": "^1.3.2" + } + }, + "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" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==" + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + }, + "object.assign": { + "version": "4.1.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + } + }, + "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" + } + }, + "object.reduce": { + "version": "1.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/object.reduce/-/object.reduce-1.0.1.tgz", + "integrity": "sha512-naLhxxpUESbNkRqc35oQ2scZSJueHGQNUfMW/0U37IgN6tE2dgDWg3whf+NEliy3F/QysrO48XKUz/nGPe+AQw==", + "requires": { + "for-own": "^1.0.0", + "make-iterator": "^1.0.0" + } + }, + "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" + } + }, + "os-locale": { + "version": "1.4.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/os-locale/-/os-locale-1.4.0.tgz", + "integrity": "sha512-PRT7ZORmwu2MEFt4/fv3Q+mEfN4zetKxufQrkShY2oGvUms9r8otu5HfdyIFHkYXjO7laNsoVGmM2MANfuTA8g==", + "requires": { + "lcid": "^1.0.0" + } + }, + "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-json": { + "version": "2.2.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha512-QR/GGaKCkhwk1ePQNYDRKYZ3mwU9ypsKhB0XyFnLQdomyEqk3e8wpW3V5Jp88zbxK4n5ST1nqo+g9juTpownhQ==", + "requires": { + "error-ex": "^1.2.0" + } + }, + "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-exists": { + "version": "2.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha512-yTltuKuhtNeFJKa1PiRzfLAU5182q1y4Eb4XCJ3PBqyzEDkAZRzBrKKBct682ls9reBVHf9udYLN5Nd+K1B9BQ==", + "requires": { + "pinkie-promise": "^2.0.0" + } + }, + "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==" + }, + "path-type": { + "version": "1.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha512-S4eENJz1pkiQn9Znv33Q+deTOKmbl+jj1Fl+qiP/vYezj+S8x+J3Uo0ISrx/QoEvIlOaDWJhPaRd1flJ9HXZqg==", + "requires": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "picomatch": { + "version": "2.3.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" + }, + "pify": { + "version": "2.3.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/pify/-/pify-2.3.0.tgz", + "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==" + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://repo.huaweicloud.com/repository/npm/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==" + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw==", + "requires": { + "pinkie": "^2.0.0" + } + }, + "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.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha512-7BGwRHqt4s/uVbuyoeejRn4YmFnYZiFl4AuaeXHlgZf3sONF0SOGlxs2Pw8g6hCKupo08RafIO5YXFNOKTfwsQ==", + "requires": { + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha512-WD9MTlNtI55IwYUS27iHh9tK3YoIVhxis8yKhLpTqWtml739uXc9NWTpxoHkfZf3+DkCCsXox94/VWZniuZm6A==", + "requires": { + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" + } + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "readdir-glob": { + "version": "1.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/readdir-glob/-/readdir-glob-1.1.1.tgz", + "integrity": "sha512-91/k1EzZwDx6HbERR+zucygRFfiPl2zkIYZtv3Jjr6Mn7SkKcVct8aVO+sSRiGMc6fLf72du3d92/uY63YPdEA==", + "requires": { + "minimatch": "^3.0.4" + } + }, + "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==" + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha512-IqSUtOVP4ksd1C/ej5zeEh/BIP2ajqpn8c5x+q99gvcIG/Qf0cud5raVnE/Dwd0ua9TXYDoDc0RE5hBSdz22Ug==" + }, + "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==" + }, + "semver": { + "version": "5.7.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==" + }, + "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==" + }, + "spdx-correct": { + "version": "3.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==" + }, + "spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.11", + "resolved": "https://repo.huaweicloud.com/repository/npm/spdx-license-ids/-/spdx-license-ids-3.0.11.tgz", + "integrity": "sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g==" + }, + "stream-exhaust": { + "version": "1.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/stream-exhaust/-/stream-exhaust-1.0.2.tgz", + "integrity": "sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw==" + }, + "streamroller": { + "version": "3.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/streamroller/-/streamroller-3.1.1.tgz", + "integrity": "sha512-iPhtd9unZ6zKdWgMeYGfSBuqCngyJy1B/GPi/lTpwGpa3bajuX30GjUVd0/Tn/Xhg0mr4DOSENozz9Y06qyonQ==", + "requires": { + "date-format": "^4.0.10", + "debug": "^4.3.4", + "fs-extra": "^10.1.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==", + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "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": "3.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g==", + "requires": { + "is-utf8": "^0.2.0" + } + }, + "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==" + }, + "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==" + }, + "tar-stream": { + "version": "2.2.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "requires": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + } + }, + "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" + }, + "dependencies": { + "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==" + } + } + }, + "type": { + "version": "1.2.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/type/-/type-1.2.0.tgz", + "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==" + }, + "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==" + }, + "undertaker": { + "version": "1.2.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/undertaker/-/undertaker-1.2.1.tgz", + "integrity": "sha512-71WxIzDkgYk9ZS+spIB8iZXchFhAdEo2YU8xYqBYJ39DIUIqziK78ftm26eecoIY49X0J2MLhG4hr18Yp6/CMA==", + "requires": { + "arr-flatten": "^1.0.1", + "arr-map": "^2.0.0", + "bach": "^1.0.0", + "collection-map": "^1.0.0", + "es6-weak-map": "^2.0.1", + "last-run": "^1.1.0", + "object.defaults": "^1.0.0", + "object.reduce": "^1.0.0", + "undertaker-registry": "^1.0.0" + } + }, + "undertaker-registry": { + "version": "1.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/undertaker-registry/-/undertaker-registry-1.0.1.tgz", + "integrity": "sha512-UR1khWeAjugW3548EfQmL9Z7pGMlBgXteQpr1IZeZBtnkCJQJIJ1Scj0mb9wQaPvUZ9Q17XqW6TIaPchJkyfqw==" + }, + "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" + } + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://repo.huaweicloud.com/repository/npm/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "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" + } + }, + "which-module": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/which-module/-/which-module-1.0.0.tgz", + "integrity": "sha512-F6+WgncZi/mJDrammbTuHe1q0R5hOXv/mBaiNA2TCNT/LTHusX0V+CJnj9XT8ki5ln2UZyyddDgHfCzyrOH7MQ==" + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha512-vAaEaDM946gbNpH5pLVNR+vX2ht6n0Bt3GXwVB1AuAqZosOvHNF3P7wDnh8KLkSqgUh0uh77le7Owgoz+Z9XBw==", + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + } + }, + "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": "3.2.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/y18n/-/y18n-3.2.2.tgz", + "integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==" + }, + "yargs": { + "version": "7.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/yargs/-/yargs-7.1.0.tgz", + "integrity": "sha512-JHLTJJ5uqdt0peYp5mHzmSNV4uHXWphgSlKk5jg3sY5XYPTBw0hzw0SDNnYISn7pAXeAv5pKT4CNY+EcCTptBg==", + "requires": { + "camelcase": "^3.0.0", + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "get-caller-file": "^1.0.1", + "os-locale": "^1.4.0", + "read-pkg-up": "^1.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^1.0.2", + "which-module": "^1.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^5.0.0" + } + }, + "yargs-parser": { + "version": "5.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/yargs-parser/-/yargs-parser-5.0.1.tgz", + "integrity": "sha512-wpav5XYiddjXxirPoCTUPbqM0PXvJ9hiBMvuJgInvo4/lAOTZzUprArw17q2O1P2+GHhbBr18/iQwjL5Z9BqfA==", + "requires": { + "camelcase": "^3.0.0", + "object.assign": "^4.1.0" + } + }, + "zip-stream": { + "version": "4.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/zip-stream/-/zip-stream-4.1.0.tgz", + "integrity": "sha512-zshzwQW7gG7hjpBlgeQP9RuyPGNxvJdzR8SUM3QhxCnLjWN2E7j3dOvpeDcQoETfHx0urRS7EtmVToql7YpU4A==", + "requires": { + "archiver-utils": "^2.1.0", + "compress-commons": "^4.1.0", + "readable-stream": "^3.6.0" + } + } + } +} diff --git a/CertificateManager/package.json b/CertificateManager/package.json new file mode 100644 index 0000000..9350f16 --- /dev/null +++ b/CertificateManager/package.json @@ -0,0 +1,18 @@ +{ + "license": "ISC", + "devDependencies": {}, + "name": "applications_certmanager", + "ohos": { + "org": "huawei", + "directoryLevel": "project", + "buildTool": "hvigor" + }, + "description": "example description", + "repository": {}, + "version": "1.0.0", + "dependencies": { + "@ohos/hvigor-ohos-plugin": "1.0.6", + "hypium": "^1.0.0", + "@ohos/hvigor": "1.0.6" + } +} diff --git a/CertificateManager/product/phone/.gitignore b/CertificateManager/product/phone/.gitignore new file mode 100644 index 0000000..4f9a973 --- /dev/null +++ b/CertificateManager/product/phone/.gitignore @@ -0,0 +1,3 @@ +/node_modules +/.preview +/build \ No newline at end of file diff --git a/CertificateManager/product/phone/build-profile.json5 b/CertificateManager/product/phone/build-profile.json5 new file mode 100644 index 0000000..c2a5ba2 --- /dev/null +++ b/CertificateManager/product/phone/build-profile.json5 @@ -0,0 +1,27 @@ +/** + * Copyright (c) 2022 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. + */ +{ + "apiType": 'stageMode', + "buildOption": { + }, + "targets": [ + { + "name": "default", + }, + { + "name": "ohosTest", + } + ] +} \ No newline at end of file diff --git a/CertificateManager/product/phone/hvigorfile.js b/CertificateManager/product/phone/hvigorfile.js new file mode 100644 index 0000000..fdb4fce --- /dev/null +++ b/CertificateManager/product/phone/hvigorfile.js @@ -0,0 +1,17 @@ +/** + * Copyright (c) 2022 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. + */ + +// 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/CertificateManager/product/phone/package-lock.json b/CertificateManager/product/phone/package-lock.json new file mode 100644 index 0000000..abd853c --- /dev/null +++ b/CertificateManager/product/phone/package-lock.json @@ -0,0 +1,5 @@ +{ + "name": "phone", + "version": "1.0.0", + "lockfileVersion": 1 +} diff --git a/CertificateManager/product/phone/package.json b/CertificateManager/product/phone/package.json new file mode 100644 index 0000000..e9f46ef --- /dev/null +++ b/CertificateManager/product/phone/package.json @@ -0,0 +1,14 @@ +{ + "license": "ISC", + "devDependencies": {}, + "name": "phone", + "ohos": { + "org": "huawei", + "directoryLevel": "module", + "buildTool": "hvigor" + }, + "description": "example description", + "repository": {}, + "version": "1.0.0", + "dependencies": {} +} diff --git a/CertificateManager/product/phone/src/main/ets/Application/AbilityStage.ts b/CertificateManager/product/phone/src/main/ets/Application/AbilityStage.ts new file mode 100644 index 0000000..b3f3c30 --- /dev/null +++ b/CertificateManager/product/phone/src/main/ets/Application/AbilityStage.ts @@ -0,0 +1,22 @@ +/** + * Copyright (c) 2022 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.application.AbilityStage" + +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("[Demo] MyAbilityStage onCreate") + } +} \ No newline at end of file diff --git a/CertificateManager/product/phone/src/main/ets/MainAbility/MainAbility.ts b/CertificateManager/product/phone/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 0000000..2294a72 --- /dev/null +++ b/CertificateManager/product/phone/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,74 @@ +/** + * Copyright (c) 2022 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.application.Ability'; +import certManager from '../stub/certStubPromise' + +class PwdStore { + private certPwd: string = ''; + setCertPwd(pwd) { + this.certPwd = pwd; + } + + getCertPwd() { + return this.certPwd; + } + + clearCertPwd() { + this.certPwd = ''; + } +} + +export default class MainAbility extends Ability { + onCreate(want, launchParam) { + console.log("[Demo] MainAbility onCreate") + globalThis.certManagerAbilityContext = this.context + globalThis.PwdStore = new PwdStore(); + globalThis.abilityWant = want; + globalThis.certStub = certManager; + globalThis.certStub.restoreAllMaps(); + } + + onDestroy() { + console.log("[Demo] MainAbility onDestroy") + globalThis.certStub.saveAllMaps(); + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] MainAbility onWindowStageCreate") + windowStage.setUIContent(this.context, "pages/certManagerFa", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("[Demo] MainAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] MainAbility onForeground") + } + + onBackground() { + // Ability has back to background + console.log("[Demo] MainAbility onBackground") + } + + onNewWant(want) { + console.log("[Demo] MainAbility onNewWant") + globalThis.abilityWant = want; + } +}; diff --git a/CertificateManager/product/phone/src/main/ets/model/BundleModel.ets b/CertificateManager/product/phone/src/main/ets/model/BundleModel.ets new file mode 100644 index 0000000..1767046 --- /dev/null +++ b/CertificateManager/product/phone/src/main/ets/model/BundleModel.ets @@ -0,0 +1,48 @@ +/** + * Copyright (c) 2022 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 bundle from '@ohos.bundle' +import { CMModelErrorCode } from '../model/CertMangerModel' + +export class BundleNameModel { + async getAppInfoList(AppUid, callback) { + try { + let AppInfo = { + AppImage: "", + AppName: "", + } + let AppBundleName = await bundle.getNameForUid(AppUid) + var bundleContext = await globalThis.certManagerAbilityContext.createBundleContext(AppBundleName) + + let labelId = Number(bundleContext.applicationInfo.labelId) + let iconId = Number(bundleContext.applicationInfo.iconId) + + AppInfo.AppImage = await bundleContext.resourceManager.getMediaBase64(iconId) + + AppInfo.AppName = await bundleContext.resourceManager.getString(labelId) + + console.log("AppName1111111111", JSON.stringify(AppInfo)); + + callback(CMModelErrorCode.CM_MODEL_ERROR_SUCCESS, AppInfo) + } catch (err) { + console.log("getAppNameListErr", JSON.stringify(err.code)); + callback(CMModelErrorCode.CM_MODEL_ERROR_EXCEPTION, null); + } + } +} + +let bundleNameModel = new BundleNameModel(); + +export default bundleNameModel as BundleNameModel; diff --git a/CertificateManager/product/phone/src/main/ets/model/CertManagerVo/AppAuthorVo.ets b/CertificateManager/product/phone/src/main/ets/model/CertManagerVo/AppAuthorVo.ets new file mode 100644 index 0000000..c7b6444 --- /dev/null +++ b/CertificateManager/product/phone/src/main/ets/model/CertManagerVo/AppAuthorVo.ets @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2022 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 class AppAuthorVo { + appImage: string; + uid: string; + appName: string; + status: boolean; + + constructor( + appImage: string, + uid: string, + appName: string, + status: boolean) { + this.appImage = appImage; + this.uid = uid; + this.appName = appName; + this.status = status; + } + +} \ No newline at end of file diff --git a/CertificateManager/product/phone/src/main/ets/model/CertManagerVo/CertAbstractVo.ets b/CertificateManager/product/phone/src/main/ets/model/CertManagerVo/CertAbstractVo.ets new file mode 100644 index 0000000..0200438 --- /dev/null +++ b/CertificateManager/product/phone/src/main/ets/model/CertManagerVo/CertAbstractVo.ets @@ -0,0 +1,35 @@ +/** + * Copyright (c) 2022 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 class CertAbstractVo { + uri: string; + certAlias: string; + status: boolean; + subjectName: string; + SubjectNameCN : string; + + constructor(uri: string, + certAlias: string, + status: boolean, + subjectName: string, + SubjectNameCN : string) { + this.uri = uri; + this.certAlias = certAlias; + this.status = status; + this.subjectName = subjectName; + this.SubjectNameCN = SubjectNameCN; + } + +} \ No newline at end of file diff --git a/CertificateManager/product/phone/src/main/ets/model/CertManagerVo/CertInfoVo.ets b/CertificateManager/product/phone/src/main/ets/model/CertManagerVo/CertInfoVo.ets new file mode 100644 index 0000000..200f877 --- /dev/null +++ b/CertificateManager/product/phone/src/main/ets/model/CertManagerVo/CertInfoVo.ets @@ -0,0 +1,75 @@ +/** + * Copyright (c) 2022 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 class CertInfoVo { + uri: string; + certAlias: string; + status: boolean; + issuerName: string; + subjectName: string; + serial: string; + notBefore: string; + notAfter: string; + fingerprintSha256: string; + cert: Uint8Array; + subjectNameMap :Map; + issuerNameMap :Map; + dateMap :Map; + + constructor(uri: string, + certAlias: string, + status: boolean, + issuerName: string, + subjectName: string, + serial: string, + notBefore: string, + notAfter: string, + fingerprintSha256: string, + cert: Uint8Array, + subjectNameMap: Map, + issuerNameMap :Map, + dateMap :Map) { + this.uri = uri; + this.certAlias = certAlias; + this.status = status; + this.issuerName = issuerName; + this.subjectName = subjectName; + this.serial = serial; + this.notBefore = notBefore; + this.notAfter = notAfter; + this.fingerprintSha256 = fingerprintSha256; + this.cert = cert; + this.subjectNameMap = subjectNameMap + this.issuerNameMap = issuerNameMap + this.dateMap = dateMap + } + + clearCertInfoVo() { + this.uri = ""; + this.certAlias = ""; + this.status = false; + this.issuerName = ""; + this.subjectName = ""; + this.serial = ""; + this.notBefore = ""; + this.notAfter = ""; + this.fingerprintSha256 = ""; + this.cert = null; + this.subjectNameMap = null; + this.issuerNameMap = null; + this.dateMap = null; + } + +} \ No newline at end of file diff --git a/CertificateManager/product/phone/src/main/ets/model/CertManagerVo/CredentialAbstractVo.ets b/CertificateManager/product/phone/src/main/ets/model/CertManagerVo/CredentialAbstractVo.ets new file mode 100644 index 0000000..70a599b --- /dev/null +++ b/CertificateManager/product/phone/src/main/ets/model/CertManagerVo/CredentialAbstractVo.ets @@ -0,0 +1,29 @@ +/** + * Copyright (c) 2022 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 class CredentialAbstractVo { + credType: string; + alias: string; + keyUri: string; + + constructor(credType: string, + alias: string, + keyUri: string) { + this.credType = credType; + this.alias = alias; + this.keyUri = keyUri; + } + +} \ No newline at end of file diff --git a/CertificateManager/product/phone/src/main/ets/model/CertManagerVo/CredentialVo.ets b/CertificateManager/product/phone/src/main/ets/model/CertManagerVo/CredentialVo.ets new file mode 100644 index 0000000..8554998 --- /dev/null +++ b/CertificateManager/product/phone/src/main/ets/model/CertManagerVo/CredentialVo.ets @@ -0,0 +1,47 @@ +/** + * Copyright (c) 2022 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 class CredentialVo { + credType: string; + alias: string; + keyUri: string; + certNum: number; + keyNum: number; + credData: Uint8Array; + + constructor(credType: string, + alias: string, + keyUri: string, + certNum: number, + keyNum: number, + credData: Uint8Array) { + this.credType = credType; + this.alias = alias; + this.keyUri = keyUri; + this.certNum = certNum; + this.keyNum = keyNum; + this.credData = credData; + } + + clearCredentialVo() { + this.credType = ""; + this.alias = ""; + this.keyUri = ""; + this.certNum = 0; + this.keyNum = 0; + this.credData = null; + } + +} \ No newline at end of file diff --git a/CertificateManager/product/phone/src/main/ets/model/CertMangerModel.ets b/CertificateManager/product/phone/src/main/ets/model/CertMangerModel.ets new file mode 100644 index 0000000..5581d57 --- /dev/null +++ b/CertificateManager/product/phone/src/main/ets/model/CertMangerModel.ets @@ -0,0 +1,566 @@ +/** + * Copyright (c) 2022 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 { CertManagerStore } from '../stub/certStubStruct' +import { CertAbstractVo } from './CertManagerVo/CertAbstractVo' +import { CertInfoVo } from './CertManagerVo/CertInfoVo' +import { CredentialAbstractVo } from './CertManagerVo/CredentialAbstractVo' +import { CredentialVo } from './CertManagerVo/CredentialVo' + +const TAG = "CertManager Model: "; +var certManager = globalThis.certStub; + +export enum CMModelErrorCode { + CM_MODEL_ERROR_SUCCESS = 0, + CM_MODEL_ERROR_FAILED = -1, + CM_MODEL_ERROR_EXCEPTION = -2, + CM_MODEL_ERROR_UNKNOWN_OPT = -3, + CM_MODEL_ERROR_NOT_SUPPORT = -4, +} + +export enum CMModelOptType { + CM_MODEL_OPT_UNKNOWN = 0, + CM_MODEL_OPT_SYSTEM_CA = 1, + CM_MODEL_OPT_USER_CA = 2, + CM_MODEL_OPT_APP_CRED = 3, + CM_MODEL_OPT_PRIVATE_CRED = 4, +} + +export class CertMangerModel { + getCertOrCredList(optType, callback) { + console.log(TAG + "getCertOrCredList start"); + + switch (optType) { + case CMModelOptType.CM_MODEL_OPT_SYSTEM_CA: + this.getSystemTrustedCertificateList((errCode, certList) => { + callback(errCode, certList) + }); + break; + case CMModelOptType.CM_MODEL_OPT_USER_CA: + this.getUserTrustedCertificateList((errCode, certList) => { + callback(errCode, certList) + }); + break; + case CMModelOptType.CM_MODEL_OPT_APP_CRED: + this.getAppCredList((errCode, credList) => { + callback(errCode, credList) + }); + break; + case CMModelOptType.CM_MODEL_OPT_PRIVATE_CRED: + this.getPrivateCredList((errCode, credList) => { + callback(errCode, credList) + }); + break; + default: + callback(CMModelErrorCode.CM_MODEL_ERROR_UNKNOWN_OPT, null) + break; + } + } + + getCertOrCred(optType, uri, callback) { + console.log(TAG + "getCertOrCred start"); + + switch (optType) { + case CMModelOptType.CM_MODEL_OPT_SYSTEM_CA: + this.getSystemTrustedCertificate(uri, (errCode, certInfo) => { + console.info('getSystemTrustedCertificate certInfo is' + JSON.stringify(certInfo)) + callback(errCode, certInfo) + }); + break; + case CMModelOptType.CM_MODEL_OPT_USER_CA: + this.getUserTrustedCertificate(uri, (errCode, certInfo) => { + callback(errCode, certInfo) + }); + break; + case CMModelOptType.CM_MODEL_OPT_APP_CRED: + this.getAppCredential(uri, (errCode, credInfo) => { + callback(errCode, credInfo) + }); + break; + case CMModelOptType.CM_MODEL_OPT_PRIVATE_CRED: + this.getPrivateCred(uri, (errCode, credInfo) => { + callback(errCode, credInfo) + }); + break; + default: + callback(CMModelErrorCode.CM_MODEL_ERROR_UNKNOWN_OPT, null) + break; + } + } + + deleteCertOrCred(optType, uri, callback) { + console.log(TAG + "deleteCertOrCred start"); + + switch (optType) { + case CMModelOptType.CM_MODEL_OPT_USER_CA: + this.deleteUserTrustedCertificate(uri, (errCode) => { + callback(errCode) + }); + break; + case CMModelOptType.CM_MODEL_OPT_APP_CRED: + this.deleteAppCredential(uri, (errCode) => { + callback(errCode) + }); + break; + case CMModelOptType.CM_MODEL_OPT_SYSTEM_CA: + case CMModelOptType.CM_MODEL_OPT_PRIVATE_CRED: + callback(CMModelErrorCode.CM_MODEL_ERROR_NOT_SUPPORT) + break; + default: + callback(CMModelErrorCode.CM_MODEL_ERROR_UNKNOWN_OPT) + break; + } + } + + setCertStatus(optType, uri, status, callback) { + console.log(TAG + "setCertStatus start"); + + switch (optType) { + case CMModelOptType.CM_MODEL_OPT_USER_CA: + this.setCertificateStatus(uri, CertManagerStore.CERT_MANAGER_USER_TRUSTED_STORE, status, (errCode) => { + callback(errCode) + }); + break; + case CMModelOptType.CM_MODEL_OPT_SYSTEM_CA: + this.setCertificateStatus(uri, CertManagerStore.CERT_MANAGER_SYSTEM_TRUSTED_STORE, status, (errCode) => { + callback(errCode) + }); + break; + case CMModelOptType.CM_MODEL_OPT_APP_CRED: + case CMModelOptType.CM_MODEL_OPT_PRIVATE_CRED: + callback(CMModelErrorCode.CM_MODEL_ERROR_NOT_SUPPORT) + break; + default: + callback(CMModelErrorCode.CM_MODEL_ERROR_UNKNOWN_OPT) + break; + } + } + + delAllCertOrCred(optType, callback) { + console.log(TAG + "delAllCertOrCred start"); + + switch (optType) { + case CMModelOptType.CM_MODEL_OPT_USER_CA: + this.delAllUserCertificate((errCode) => { + callback(errCode) + }); + break; + case CMModelOptType.CM_MODEL_OPT_APP_CRED: + this.delAllAppCredential((errCode) => { + callback(errCode) + }); + break; + case CMModelOptType.CM_MODEL_OPT_SYSTEM_CA: + case CMModelOptType.CM_MODEL_OPT_PRIVATE_CRED: + callback(CMModelErrorCode.CM_MODEL_ERROR_NOT_SUPPORT) + break; + default: + callback(CMModelErrorCode.CM_MODEL_ERROR_UNKNOWN_OPT) + break; + } + } + + getAuthAppList(optType, uri, callback) { + console.log(TAG + "getAuthAppList start"); + + switch (optType) { + case CMModelOptType.CM_MODEL_OPT_APP_CRED: + this.getAuthorizedAppList(uri, (errCode, appUidList) => { + callback(errCode, appUidList) + }); + break; + case CMModelOptType.CM_MODEL_OPT_USER_CA: + case CMModelOptType.CM_MODEL_OPT_SYSTEM_CA: + case CMModelOptType.CM_MODEL_OPT_PRIVATE_CRED: + callback(CMModelErrorCode.CM_MODEL_ERROR_NOT_SUPPORT) + break; + default: + callback(CMModelErrorCode.CM_MODEL_ERROR_UNKNOWN_OPT) + break; + } + } + + setAppAuth(optType, uri, appUid, status, callback) { + console.log(TAG + "setAppAuth start"); + + switch (optType) { + case CMModelOptType.CM_MODEL_OPT_APP_CRED: + this.setAuthorizedAppStatus(uri, appUid, status, (errCode, data) => { + callback(errCode, data) + }); + break; + case CMModelOptType.CM_MODEL_OPT_USER_CA: + case CMModelOptType.CM_MODEL_OPT_SYSTEM_CA: + case CMModelOptType.CM_MODEL_OPT_PRIVATE_CRED: + callback(CMModelErrorCode.CM_MODEL_ERROR_NOT_SUPPORT) + break; + default: + callback(CMModelErrorCode.CM_MODEL_ERROR_UNKNOWN_OPT) + break; + } + } + + installCertOrCred(optType, alias, data, pwd, callback) { + console.log(TAG + "installCertOrCred start"); + console.info(TAG + 'installCert optType: ' + optType + 'alias: ' + alias + ' pwd: ' + pwd) + switch (optType) { + case CMModelOptType.CM_MODEL_OPT_USER_CA: + this.installUserCertificate(data, alias, (errCode) => { + callback(errCode) + }); + break; + case CMModelOptType.CM_MODEL_OPT_APP_CRED: + this.installAppCertificate(data, alias, pwd, (errCode) => { + callback(errCode) + }); + break; + case CMModelOptType.CM_MODEL_OPT_PRIVATE_CRED: + case CMModelOptType.CM_MODEL_OPT_SYSTEM_CA: + callback(CMModelErrorCode.CM_MODEL_ERROR_NOT_SUPPORT) + break; + default: + callback(CMModelErrorCode.CM_MODEL_ERROR_UNKNOWN_OPT) + break; + } + } + + private async getSystemTrustedCertificateList(callback) { + console.log(TAG + "getSystemTrustedCertificateList start"); + try { + let SubjectNameCN; + let result = await certManager.getSystemTrustedCertificateList(); + let certList = new Array(); + console.log(TAG + "certManager::getSystemTrustedCertificateList result: " + JSON.stringify(result)); + for (let i = 0; i < result.certList.length; i++) { + if (result.certList[i].subjectName.length != 0) { + SubjectNameCN = result.certList[i].subjectName.match(/(?<=CN=).*?(?=,)/g).toString() + console.info('SubjectNameCN is:' + SubjectNameCN) + } + certList.push(new CertAbstractVo(result.certList[i].uri, result.certList[i].certAlias, + result.certList[i].status, result.certList[i].subjectName, SubjectNameCN)) + } + console.log(TAG + "getSystemTrustedCertificateList end"); + callback(CMModelErrorCode.CM_MODEL_ERROR_SUCCESS, certList) + + } catch (err) { + console.log(TAG + "getSystemTrustedCertificateList err: " + JSON.stringify(err)); + callback(CMModelErrorCode.CM_MODEL_ERROR_EXCEPTION, null) + } + } + + private async getSystemTrustedCertificate(certUri, callback) { + console.log(TAG + "getSystemTrustedCertificate start"); + try { + let result = await certManager.getSystemTrustedCertificate(certUri); + let subjectNameMap: Map = new Map() + let issuerNameMap: Map = new Map() + let dateMap: Map = new Map() + if (result.certInfo.subjectName.length != 0) { + let SubjectNameCN = result.certInfo.subjectName.match(/(?<=CN=).*?(?=,)/g) + console.info('SubjectNameCN is:' + SubjectNameCN) + let SubjectNameOU = result.certInfo.subjectName.match(/(?<=OU=).*?(?=,)/g) + console.info('SubjectNameOU is:' + SubjectNameOU) + let SubjectNameO = result.certInfo.subjectName.match(/(?<=O=).*/g) + console.info('SubjectNameO is:' + SubjectNameO) + subjectNameMap.set('常用名称:', String(SubjectNameCN)) + subjectNameMap.set('组织:', String(SubjectNameO)) + subjectNameMap.set('组织单位:', String(SubjectNameOU)) + subjectNameMap.set('序列号:', result.certInfo.serial) + } + if (result.certInfo.issuerName.length != 0) { + let IssuerNameCN = result.certInfo.subjectName.match(/(?<=CN=).*?(?=,)/g) + console.info('SubjectNameCN is:' + IssuerNameCN) + let IssuerNameOU = result.certInfo.subjectName.match(/(?<=OU=).*?(?=,)/g) + console.info('SubjectNameOU is:' + IssuerNameOU) + let IssuerNameO = result.certInfo.subjectName.match(/(?<=O=).*/g) + console.info('SubjectNameO is:' + IssuerNameO) + issuerNameMap.set('常用名称:', String(IssuerNameCN)) + issuerNameMap.set('组织:', String(IssuerNameO)) + issuerNameMap.set('组织单位:', String(IssuerNameOU)) + } + dateMap.set('颁发时间:', result.certInfo.notBefore) + dateMap.set('有效期至:', result.certInfo.notAfter) + + let certInfo = new CertInfoVo(result.certInfo.uri, result.certInfo.certAlias, + result.certInfo.status, result.certInfo.issuerName, result.certInfo.subjectName, + result.certInfo.serial, result.certInfo.notBefore, + result.certInfo.notAfter, result.certInfo.fingerprintSha256, result.certInfo.cert, + subjectNameMap, issuerNameMap, dateMap); + + console.log(TAG + "getSystemTrustedCertificate end"); + callback(CMModelErrorCode.CM_MODEL_ERROR_SUCCESS, certInfo) + + } catch (err) { + console.log(TAG + "getSystemTrustedCertificate err: " + JSON.stringify(err)); + callback(CMModelErrorCode.CM_MODEL_ERROR_EXCEPTION, null) + } + } + + private async getUserTrustedCertificateList(callback) { + console.log(TAG + "getUserTrustedCertificateList start"); + try { + let SubjectNameCN + let result = await certManager.getUserTrustedCertificateList(); + let certList = new Array(); + console.log(TAG + "getUserTrustedCertificateList result: " + JSON.stringify(result)); + for (let i = 0; i < result.certList.length; i++) { + if (result.certList[i].subjectName.length != 0) { + SubjectNameCN = result.certList[i].subjectName.match(/(?<=CN=).*?(?=,)/g).toString() + console.info('SubjectNameCN is:' + SubjectNameCN) + } + certList.push(new CertAbstractVo(result.certList[i].uri, result.certList[i].certAlias, + result.certList[i].status, result.certList[i].subjectName, SubjectNameCN)) + } + console.log(TAG + "getUserTrustedCertificateList end"); + callback(CMModelErrorCode.CM_MODEL_ERROR_SUCCESS, certList) + } catch (err) { + console.log(TAG + "getUserTrustedCertificateList err: " + JSON.stringify(err)); + callback(CMModelErrorCode.CM_MODEL_ERROR_EXCEPTION) + } + } + + private async getUserTrustedCertificate(certUri, callback) { + console.log(TAG + "getUserTrustedCertificate start"); + try { + let result = await certManager.getUserTrustedCertificate(certUri); + let subjectNameMap: Map = new Map() + let issuerNameMap: Map = new Map() + let dateMap: Map = new Map() + + if (result.certInfo.subjectName.length != 0) { + let SubjectNameCN = result.certInfo.subjectName.match(/(?<=CN=).*?(?=,)/g) + console.info('SubjectNameCN is:' + SubjectNameCN) + let SubjectNameOU = result.certInfo.subjectName.match(/(?<=OU=).*?(?=,)/g) + console.info('SubjectNameOU is:' + SubjectNameOU) + let SubjectNameO = result.certInfo.subjectName.match(/(?<=O=).*/g) + console.info('SubjectNameO is:' + SubjectNameO) + subjectNameMap.set('常用名称:', String(SubjectNameCN)) + subjectNameMap.set('组织:', String(SubjectNameO)) + subjectNameMap.set('组织单位:', String(SubjectNameOU)) + subjectNameMap.set('序列号:', result.certInfo.serial) + } + if (result.certInfo.issuerName.length != 0) { + let IssuerNameCN = result.certInfo.subjectName.match(/(?<=CN=).*?(?=,)/g) + console.info('SubjectNameCN is:' + IssuerNameCN) + let IssuerNameOU = result.certInfo.subjectName.match(/(?<=OU=).*?(?=,)/g) + console.info('SubjectNameOU is:' + IssuerNameOU) + let IssuerNameO = result.certInfo.subjectName.match(/(?<=O=).*/g) + console.info('SubjectNameO is:' + IssuerNameO) + issuerNameMap.set('常用名称:', String(IssuerNameCN)) + issuerNameMap.set('组织:', String(IssuerNameO)) + issuerNameMap.set('组织单位:', String(IssuerNameOU)) + } + dateMap.set('颁发时间:', result.certInfo.notBefore) + dateMap.set('有效期至:', result.certInfo.notAfter) + let certInfo = new CertInfoVo(result.certInfo.uri, result.certInfo.certAlias, + result.certInfo.status, result.certInfo.issuerName, result.certInfo.subjectName, + result.certInfo.serial, result.certInfo.notBefore, + result.certInfo.notAfter, result.certInfo.fingerprintSha256, result.certInfo.cert, + subjectNameMap, issuerNameMap, dateMap); + console.log(TAG + "getUserTrustedCertificate end"); + callback(CMModelErrorCode.CM_MODEL_ERROR_SUCCESS, certInfo) + } catch (err) { + console.log(TAG + "getUserTrustedCertificate err: " + JSON.stringify(err)); + callback(CMModelErrorCode.CM_MODEL_ERROR_EXCEPTION, null) + } + } + + private async deleteUserTrustedCertificate(certUri, callback) { + console.log(TAG + "deleteUserTrustedCertificate start"); + try { + await certManager.uninstallUserTrustedCertificate(certUri); + console.log(TAG + "deleteUserTrustedCertificate end"); + callback(CMModelErrorCode.CM_MODEL_ERROR_SUCCESS) + } catch (err) { + console.log(TAG + "deleteUserTrustedCertificate err: " + JSON.stringify(err)); + callback(CMModelErrorCode.CM_MODEL_ERROR_EXCEPTION) + } + } + + private async setCertificateStatus(certUri, store, status, callback) { + console.log(TAG + "setCertificateStatus start"); + try { + await certManager.setCertificateStatus(certUri, store, status); + console.log(TAG + "setCertificateStatus end"); + callback(CMModelErrorCode.CM_MODEL_ERROR_SUCCESS) + } catch (err) { + console.info(TAG + 'setCertificateStatus fail, err is' + err) + callback(CMModelErrorCode.CM_MODEL_ERROR_EXCEPTION) + } + } + + private async getAppCredList(callback) { + console.log(TAG + "getAppCredList start"); + + try { + let result = await certManager.getAppCertificateList(); + let credList = new Array(); + for (let i = 0; i < result.credentialList.length; i++) { + credList.push(new CredentialAbstractVo(result.credentialList[i].type, result.credentialList[i].alias, + result.credentialList[i].keyUri)) + } + console.log(TAG + "getAppCredList end credList: " + JSON.stringify(credList)); + callback(CMModelErrorCode.CM_MODEL_ERROR_SUCCESS, credList) + } catch (err) { + console.info(TAG + 'getAppCredList fail, err is' + err) + callback(CMModelErrorCode.CM_MODEL_ERROR_EXCEPTION) + } + } + + private async getAppCredential(certUri, callback) { + console.log(TAG + "getAppCredential start"); + try { + let result = await certManager.getAppCertificate(certUri); + let credInfo = new CredentialVo(result.credential.type, result.credential.alias, + result.credential.keyUri, result.credential.certNum, result.credential.keyNum, result.credential.credData); + console.log(TAG + "getAppCredential end"); + callback(CMModelErrorCode.CM_MODEL_ERROR_SUCCESS, credInfo) + } catch (err) { + console.info(TAG + 'getAppCredential fail, err is' + err) + callback(CMModelErrorCode.CM_MODEL_ERROR_EXCEPTION, null) + } + } + + private async deleteAppCredential(certUri, callback) { + console.log(TAG + "deleteAppCredential start"); + try { + await certManager.uninstallAppCertificate(certUri); + console.log(TAG + "deleteAppCredential end"); + callback(CMModelErrorCode.CM_MODEL_ERROR_SUCCESS) + } catch (err) { + console.info(TAG + 'deleteAppCredential fail, err is' + err) + callback(CMModelErrorCode.CM_MODEL_ERROR_EXCEPTION) + } + } + + private async getPrivateCredList(callback) { + console.log(TAG + "getPrivateCredList start"); + + try { + let result = await certManager.getPrivateCertificateList(); + let credList = new Array(); + for (let i = 0; i < result.credentialList.length; i++) { + credList.push(new CredentialAbstractVo(result.credentialList[i].type, result.credentialList[i].alias, + result.credentialList[i].keyUri)) + } + console.log(TAG + "getPrivateCredList end"); + callback(CMModelErrorCode.CM_MODEL_ERROR_SUCCESS, credList) + } catch (err) { + console.info(TAG + 'getPrivateCredList fail, err is' + err) + callback(CMModelErrorCode.CM_MODEL_ERROR_EXCEPTION) + } + } + + private async getPrivateCred(certUri, callback) { + console.log(TAG + "getPrivateCred start"); + try { + let result = await certManager.getPrivateCertificate(certUri); + let credInfo = new CredentialVo(result.credential.type, result.credential.alias, + result.credential.keyUri, result.credential.certNum, result.credential.keyNum, result.credential.credData); + console.log(TAG + "getPrivateCred end"); + callback(CMModelErrorCode.CM_MODEL_ERROR_SUCCESS, credInfo) + } catch (err) { + console.info(TAG + 'getPrivateCred fail, err is' + err) + callback(CMModelErrorCode.CM_MODEL_ERROR_EXCEPTION, null) + } + } + + private async delAllUserCertificate(callback) { + console.log(TAG + "delAllUserCertificate start"); + try { + await certManager.uninstallAllUserTrustedCertificate(); + console.log(TAG + "delAllUserCertificate end"); + callback(CMModelErrorCode.CM_MODEL_ERROR_SUCCESS) + } catch (err) { + console.info(TAG + 'delAllUserCertificate fail, err is' + err) + callback(CMModelErrorCode.CM_MODEL_ERROR_EXCEPTION) + } + } + + private async delAllAppCredential(callback) { + console.log(TAG + "delAllAppCredential start"); + try { + await certManager.uninstallAllAppCertificate(); + console.log(TAG + "delAllAppCredential end"); + callback(CMModelErrorCode.CM_MODEL_ERROR_SUCCESS) + } catch (err) { + console.info(TAG + 'delAllAppCredential fail, err is' + err) + callback(CMModelErrorCode.CM_MODEL_ERROR_EXCEPTION) + } + } + + private async getAuthorizedAppList(uri, callback) { + console.log(TAG + "getAuthorizedAppList start"); + try { + let result = await certManager.getAuthorizedAppList(uri); + console.log(TAG + "getAuthorizedAppList end"); + callback(CMModelErrorCode.CM_MODEL_ERROR_SUCCESS, result.appUidList) + } catch (err) { + console.info(TAG + 'getAuthorizedAppList fail, err is' + err) + callback(CMModelErrorCode.CM_MODEL_ERROR_EXCEPTION, null) + } + } + + private async setAuthorizedAppStatus(uri, appUid, status, callback) { + console.log(TAG + "setAuthorizedAppStatus start"); + try { + if (status) { + let result = await certManager.grantAppCertificate(uri, appUid); + console.log(TAG + "setAuthorizedAppStatus true end"); + callback(CMModelErrorCode.CM_MODEL_ERROR_SUCCESS, result.authUri) + } else { + await certManager.removeGrantedAppCertificate(uri, appUid); + console.log(TAG + "setAuthorizedAppStatus false end"); + callback(CMModelErrorCode.CM_MODEL_ERROR_SUCCESS) + } + } catch (err) { + console.info(TAG + 'setAuthorizedAppStatus fail, err is' + err) + callback(CMModelErrorCode.CM_MODEL_ERROR_EXCEPTION) + } + } + + private async installUserCertificate(data, alias, callback) { + console.info(TAG + 'installUserCertificate start alias: ' + alias + 'data' + JSON.stringify(data)) + try { + await certManager.installUserTrustedCertificate({ + inData: data, + alias: alias + }); + + console.info(TAG + 'installUserCertificate end') + callback(CMModelErrorCode.CM_MODEL_ERROR_SUCCESS) + } catch (err) { + console.info(TAG + 'installUserCertificate fail, err is' + err) + callback(CMModelErrorCode.CM_MODEL_ERROR_EXCEPTION) + } + } + + private async installAppCertificate(data, alias, pwd, callback) { + console.info(TAG + 'installAppCertificate start') + try { + await certManager.installAppCertificate(data, pwd, alias); + console.info(TAG + 'installAppCertificate end') + callback(CMModelErrorCode.CM_MODEL_ERROR_SUCCESS) + } catch (err) { + console.info(TAG + 'installAppCertificate fail, err is' + err) + callback(CMModelErrorCode.CM_MODEL_ERROR_EXCEPTION) + } + } + +} + +let certMangerModel = new CertMangerModel(); + +export default certMangerModel as CertMangerModel; \ No newline at end of file diff --git a/CertificateManager/product/phone/src/main/ets/model/FileIoModel.ets b/CertificateManager/product/phone/src/main/ets/model/FileIoModel.ets new file mode 100644 index 0000000..7c4a287 --- /dev/null +++ b/CertificateManager/product/phone/src/main/ets/model/FileIoModel.ets @@ -0,0 +1,102 @@ +/** + * Copyright (c) 2022 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 fileio from '@ohos.fileio'; +import mediaLibrary from '@ohos.multimedia.mediaLibrary'; + +export class FileIoModel { + media; + constructor() { + this.media = mediaLibrary.getMediaLibrary(globalThis.certManagerAbilityContext); + } + + getFileIdFromMediaUri(mediaUri) { + console.log("getMediaFileSuffix getFileIdFromMediaUri uri: " + mediaUri); + + let elemList = mediaUri.split("/"); + let fileIdString = elemList[elemList.length - 1]; + let fileIdNum = fileIdString.match(/\d+/g); + + return fileIdNum; + } + + getMediaFileSuffix(mediaUri, callback) { + console.log("getMediaFileSuffix start uri: " + mediaUri); + let fileKeyObj = mediaLibrary.FileKey + let fileId = this.getFileIdFromMediaUri(mediaUri); + console.log("getMediaFileSuffix start fileId: " + fileId); + let imagesFetchOp = { + selections: fileKeyObj.ID + '= ?', + selectionArgs: [fileId.toString()], + }; + let suffix; + + this.media.getFileAssets(imagesFetchOp, (error, fetchFileResult) => { + console.log("getMediaFile getFileAssets callback in fetchFileResult: "); + if (fetchFileResult != undefined) { + fetchFileResult.getFirstObject(async (error, fileAsset) => { + console.log("getMediaFile getFileAssets callback getFirstObject: "); + if (fileAsset) { + console.log("getMediaFile getFileAssets fileAsset: " + fileAsset.displayName); + suffix = fileAsset.displayName.substring(fileAsset.displayName.lastIndexOf(".") + 1); + callback(suffix); + } else { + console.log("getMediaFile getFileAssets callback getFirstObject else"); + } + }) + } else { + console.log("getMediaFile getFileAssets callback in else: "); + callback(undefined); + } + }) + } + + getMediaFileData(mediaUri, callback) { + console.log("getMediaFile start"); + + let fileKeyObj = mediaLibrary.FileKey; + let fileId = this.getFileIdFromMediaUri(mediaUri); + let imagesFetchOp = { + selections: fileKeyObj.ID + '= ?', + selectionArgs: [fileId.toString()], + }; + let fd; + + this.media.getFileAssets(imagesFetchOp, (error, fetchFileResult) => { + if (fetchFileResult != undefined) { + fetchFileResult.getFirstObject(async (error, fileAsset) => { + console.log("getMediaFile getFileAssets fileAsset: " + fileAsset.displayName); + + if (fileAsset) { + let buf = new ArrayBuffer(fileAsset.size); + fd = await fileAsset.open("r"); + fileio.read(fd, buf, (err, data) => { + if (data) { + console.info("getMediaFile read file data exist "); + callback(new Uint8Array(data.buffer)); + } else { + console.info("getMediaFile read file data: null"); + } + }); + } + }) + } + }) + } +} + +let fileIoModel = new FileIoModel(); + +export default fileIoModel as FileIoModel; diff --git a/CertificateManager/product/phone/src/main/ets/pages/cerEvidenceFa.ets b/CertificateManager/product/phone/src/main/ets/pages/cerEvidenceFa.ets new file mode 100644 index 0000000..8168788 --- /dev/null +++ b/CertificateManager/product/phone/src/main/ets/pages/cerEvidenceFa.ets @@ -0,0 +1,747 @@ +/** + * Copyright (c) 2022 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 LogUtil from '../../../../../../common/util/LogUtil'; +import ConfigData from '../../../../../../common/util/ConfigData'; +import HeadComponent from '../../../../../../common/component/headComponent'; +import CMShowAppCredPresenter from '../presenter/CMShowAppCredPresenter'; +import CMShowPrivateCredPresenter from '../presenter/CMShowPrivateCredPresenter'; +import CMFaPresenter from '../presenter/CMFaPresenter'; + +@Component +export struct DialogComponent { + @Link uidItem: CMShowAppCredPresenter; + private AppName: string; + private AppImage: string; + private Index: number; + + build() { + Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { + Row() { + Image(this.AppImage) + .width($r("app.float.credentials_app_image_wh")) + .height($r("app.float.credentials_app_image_hg")) + + Text(this.AppName) + .fontSize($r("sys.float.ohos_id_text_size_body2")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Medium) + .margin({ left: $r("app.float.credentials_app_name_margin") }) + } + .alignItems(VerticalAlign.Center) + + Toggle({ type: ToggleType.Switch, isOn: true }) + .width($r("app.float.credentials_app_Toggle_wh")) + .height($r("app.float.credentials_app_Toggle_hg")) + .selectedColor($r("app.color.credentials_app_Toggle_selectColor")) + .onChange((isOn: boolean) => { + this.uidItem.appInfoList[this.Index].status = isOn + }) + .offset({ x: 7, y:0 }) + + }.height($r("app.float.wh_value_72")) + } +} + +@CustomDialog +@Component +struct CustomDialogExampleAuthor { + controller: CustomDialogController; + @Link isShowAuthDialog: boolean; + @Link AuthorInfo: CMShowAppCredPresenter; + @State updateStatusList: boolean[] = []; + + build() { + Column() { + Text($r("app.string.managerAuthApp")) + .height($r("app.float.wh_value_56")) + .fontSize($r("sys.float.ohos_id_text_size_dialog_tittle")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Medium) + .margin({ + left: $r('app.float.wh_value_24'), + right: $r('app.float.wh_value_24') + }) + .alignSelf(ItemAlign.Start); + if (this.AuthorInfo.appInfoList.length > ConfigData.APP_AUTH_MAX_LENGTH) { + List() { + ForEach(this.AuthorInfo.appInfoList, (item, index) => { + ListItem() { + DialogComponent({ AppImage: item.appImage, AppName: item.appName, Index: index, uidItem: $AuthorInfo }) + } + }) + } + .margin({ + left: $r('app.float.wh_value_24'), + right: $r('app.float.wh_value_24') + }) + .height(ConfigData.WH_50_100) + .divider({ + strokeWidth: $r("app.float.Evidence_strokeWidth"), + color: $r("app.color.Evidence_color")}) + .borderRadius($r("app.float.Evidence_borderRadius")) + .backgroundColor($r("app.color.credentials_app_finish_backgroundColor")) + .visibility(this.AuthorInfo.appInfoList.length > 0 ? Visibility.Visible : Visibility.None) + } else { + List() { + ForEach(this.AuthorInfo.appInfoList, (item, index) => { + ListItem() { + DialogComponent({ AppImage: item.appImage, AppName: item.appName, Index: index, uidItem: $AuthorInfo }) + } + }) + } + .margin({ + left: $r('app.float.wh_value_24'), + right: $r('app.float.wh_value_24') + }) + .divider({ + strokeWidth: $r("app.float.Evidence_strokeWidth"), + color: $r("app.color.Evidence_color")}) + .borderRadius($r("app.float.Evidence_borderRadius")) + .backgroundColor($r("app.color.credentials_app_finish_backgroundColor")) + .visibility(this.AuthorInfo.appInfoList.length > 0 ? Visibility.Visible : Visibility.None) + } + + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceAround }) { + Button($r("app.string.cancelAuthApp")) + .onClick(() => { + this.isShowAuthDialog = false; + this.controller.close() + }) + .backgroundColor($r("app.color.credentials_app_finish_backgroundColor")) + .fontSize($r("sys.float.ohos_id_text_size_button1")) + .fontColor($r("sys.color.ohos_id_color_text_hyperlink")) + .width($r('app.float.wh_value_152')) + .height($r('app.float.wh_value_40')) + Divider() + .strokeWidth(ConfigData.VERTICAL_DIVIDER_WIDTH) + .color($r("sys.color.ohos_id_color_list_separator")) + .vertical(true) + .opacity($r("app.float.opacity_0_2")) + .height($r('app.float.wh_value_40')) + Button($r("app.string.finishAuthApp")) + .onClick(() => { + this.AuthorInfo.removeGrantedAppList(this.AuthorInfo.credInfo.keyUri) + this.isShowAuthDialog = false; + this.controller.close() + }) + .backgroundColor($r("app.color.credentials_app_finish_backgroundColor")) + .fontSize($r("sys.float.ohos_id_text_size_button1")) + .fontColor($r("sys.color.ohos_id_color_text_hyperlink")) + .width($r('app.float.wh_value_152')) + .height($r('app.float.wh_value_40')) + } + .height($r('app.float.wh_value_64')) + .padding({ + bottom: $r('app.float.wh_value_16') + }) + .margin({ + top: $r('app.float.wh_value_6'), + left: $r('app.float.wh_value_24'), + right: $r('app.float.wh_value_24') + }) + } + } +} + +@CustomDialog +@Component +struct CustomDialogExamplePrivate { + controller: CustomDialogController; + @State PriCerInfoPresenter: CMShowPrivateCredPresenter = CMShowPrivateCredPresenter.getInstance(); + + build() { + Column() { + Text($r("app.string.evidenceDetails")) + .height($r("app.float.wh_value_56")) + .fontSize($r("sys.float.ohos_id_text_size_dialog_tittle")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Medium) + .margin({ + left: $r('app.float.wh_value_24'), + right: $r('app.float.wh_value_24') + }) + .alignSelf(ItemAlign.Start) + + Text(this.PriCerInfoPresenter.credInfo.alias) + .fontSize($r("sys.float.ohos_id_text_size_body1")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Medium) + .margin({ + left: $r('app.float.wh_value_24'), + right: $r('app.float.wh_value_24') + }) + .alignSelf(ItemAlign.Start) + + Text($r("app.string.entryContains")) + .fontSize($r("sys.float.ohos_id_text_size_body2")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Regular) + .margin({ + top: $r('app.float.wh_value_24'), + left: $r('app.float.wh_value_24'), + right: $r('app.float.wh_value_24') + }) + .alignSelf(ItemAlign.Start) + + Text($r("app.string.keyNum", String(this.PriCerInfoPresenter.credInfo.keyNum))) + .fontSize($r("sys.float.ohos_id_text_size_body2")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Regular) + .margin({ + left: $r('app.float.wh_value_24'), + right: $r('app.float.wh_value_24') + }) + .opacity($r('app.float.opacity_100_60')) + .alignSelf(ItemAlign.Start) + + Text($r("app.string.userCerNum", String(this.PriCerInfoPresenter.credInfo.certNum))) + .fontSize($r("sys.float.ohos_id_text_size_body2")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Regular) + .margin({ + left: $r('app.float.wh_value_24'), + right: $r('app.float.wh_value_24') + }) + .opacity($r('app.float.opacity_100_60')) + .alignSelf(ItemAlign.Start) + + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceAround }) { + Button($r("app.string.privateDetailsClose")) + .onClick(() => { + this.controller.close() + }) + .backgroundColor($r("app.color.credentials_app_finish_backgroundColor")) + .fontSize($r("sys.float.ohos_id_text_size_button1")) + .fontColor($r("sys.color.ohos_id_color_text_hyperlink")) + .width($r('app.float.wh_value_152')) + .height($r('app.float.wh_value_40')) + } + .height($r('app.float.wh_value_64')) + .padding({ + bottom: $r('app.float.wh_value_16') + }) + .margin({ + top: $r('app.float.wh_value_16'), + left: $r('app.float.wh_value_24'), + right: $r('app.float.wh_value_24') + }) + } + } +} + +@CustomDialog +@Component +struct CustomDialogDeleteWarning { + controller: CustomDialogController; + @Link deleteWarn: CMShowAppCredPresenter; + @Link isShowWarnDialog: boolean; + + build() { + Column() { + Text($r("app.string.warning_title")) + .height($r("app.float.wh_value_56")) + .fontSize($r("sys.float.ohos_id_text_size_dialog_tittle")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Medium) + .margin({ + left: $r('app.float.wh_value_24'), + right: $r('app.float.wh_value_24') + }) + .alignSelf(ItemAlign.Start) + Text($r("app.string.warning_message")) + .fontSize($r('sys.float.ohos_id_text_size_body1')) + .fontWeight(FontWeight.Regular) + .fontColor($r("sys.color.ohos_id_color_primary")) + .margin({ + top: $r("app.float.wh_value_16"), + left: $r('app.float.wh_value_24'), + right: $r('app.float.wh_value_24') + }) + .alignSelf(ItemAlign.Start) + + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceAround }) { + Button($r("app.string.deleteAllCredCancel")) + .onClick(() => { + this.isShowWarnDialog = false; + this.controller.close() + }) + .backgroundColor($r("app.color.credentials_app_finish_backgroundColor")) + .fontSize($r("sys.float.ohos_id_text_size_button1")) + .fontColor($r("sys.color.ohos_id_color_text_hyperlink")) + .width($r('app.float.wh_value_152')) + .height($r('app.float.wh_value_40')) + Divider() + .strokeWidth(ConfigData.VERTICAL_DIVIDER_WIDTH) + .color($r("sys.color.ohos_id_color_list_separator")) + .vertical(true) + .height($r('app.float.wh_value_40')) + .opacity($r("app.float.opacity_0_2")) + Button($r("app.string.deleteAllCredDelete")) + .onClick(() => { + this.deleteWarn.deleteAppCred(this.deleteWarn.credInfo.keyUri); + this.isShowWarnDialog = false; + this.controller.close() + }) + .backgroundColor($r("app.color.credentials_app_finish_backgroundColor")) + .fontSize($r("sys.float.ohos_id_text_size_button1")) + .fontColor($r("sys.color.ohos_id_color_warning")) + .width($r('app.float.wh_value_152')) + .height($r('app.float.wh_value_40')) + } + .height($r('app.float.wh_value_64')) + .padding({ + bottom: $r('app.float.wh_value_16') + }) + .margin({ + top: $r('app.float.wh_value_16'), + left: $r('app.float.wh_value_24'), + right: $r('app.float.wh_value_24') + }) + } + } +} + +@CustomDialog +@Component +struct CustomDialogExampleApp { + controller: CustomDialogController; + @Link mShowAppCaPresenter: CMShowAppCredPresenter; + @Link isShowAuthDialog: boolean; + @Link isShowWarnDialog: boolean; + + aboutToAppear() { + this.mShowAppCaPresenter.getAuthorizedAppList(this.mShowAppCaPresenter.credInfo.keyUri) + } + + build() { + Column() { + Text($r("app.string.evidenceDetails")) + .height($r("app.float.wh_value_56")) + .fontSize($r("sys.float.ohos_id_text_size_dialog_tittle")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Medium) + .margin({ + left: $r('app.float.wh_value_24'), + right: $r('app.float.wh_value_24') + }) + .alignSelf(ItemAlign.Start) + + Text(this.mShowAppCaPresenter.credInfo.alias) + .fontSize($r("sys.float.ohos_id_text_size_body1")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Medium) + .margin({ + left: $r('app.float.wh_value_24'), + right: $r('app.float.wh_value_24') + }) + .alignSelf(ItemAlign.Start) + + Text($r("app.string.entryContains")) + .fontSize($r("sys.float.ohos_id_text_size_body2")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Regular) + .margin({ + top: $r('app.float.wh_value_24'), + left: $r('app.float.wh_value_24'), + right: $r('app.float.wh_value_24') + }) + .alignSelf(ItemAlign.Start) + + Text($r("app.string.keyNum", String(this.mShowAppCaPresenter.credInfo.keyNum))) + .fontSize($r("sys.float.ohos_id_text_size_body2")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Regular) + .margin({ + left: $r('app.float.wh_value_24'), + right: $r('app.float.wh_value_24') + }) + .opacity($r('app.float.opacity_100_60')) + .alignSelf(ItemAlign.Start) + + Text($r("app.string.userCerNum", String(this.mShowAppCaPresenter.credInfo.certNum))) + .fontSize($r("sys.float.ohos_id_text_size_body2")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Regular) + .margin({ + left: $r('app.float.wh_value_24'), + right: $r('app.float.wh_value_24') + }) + .opacity($r('app.float.opacity_100_60')) + .alignSelf(ItemAlign.Start) + + Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { + Column() { + Text($r("app.string.managerAuthApp")) + .fontSize($r("sys.float.ohos_id_text_size_body1")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Medium) + } + + Row() { + Image($r('app.media.ic_settings_arrow')) + .width($r("app.float.managerAuthApp_image_wh")) + .height($r("app.float.managerAuthApp_image_hg")) + .fillColor($r("sys.color.ohos_id_color_primary")) + .opacity($r("app.float.managerAuthApp_image_opacity")) + } + } + .onClick(() => { + this.isShowAuthDialog = true; + }) + .margin({ + top: $r('app.float.wh_value_12'), + left: $r('app.float.wh_value_24'), + right: $r('app.float.wh_value_24') + }) + .height('48vp') + + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceAround }) { + Button($r("app.string.publicDetailsCancel")) + .onClick(() => { + this.isShowAuthDialog = false; + this.isShowWarnDialog = false; + this.controller.close(); + }) + .backgroundColor($r("app.color.credentials_app_finish_backgroundColor")) + .fontSize($r("sys.float.ohos_id_text_size_button1")) + .fontColor($r("sys.color.ohos_id_color_text_hyperlink")) + .width($r('app.float.wh_value_152')) + .height($r('app.float.wh_value_40')) + Divider() + .strokeWidth(ConfigData.VERTICAL_DIVIDER_WIDTH) + .color($r("sys.color.ohos_id_color_list_separator")) + .vertical(true) + .height($r('app.float.wh_value_40')) + .opacity($r("app.float.opacity_0_2")) + Button($r("app.string.publicDetailsDelete")) + .onClick(() => { + this.isShowWarnDialog = true; + this.isShowAuthDialog = false; + this.controller.close() + }) + .backgroundColor($r("app.color.credentials_app_finish_backgroundColor")) + .fontSize($r("sys.float.ohos_id_text_size_button1")) + .fontColor($r("sys.color.ohos_id_color_warning")) + .width($r('app.float.wh_value_152')) + .height($r('app.float.wh_value_40')) + } + .height($r('app.float.wh_value_64')) + .padding({ + bottom: $r('app.float.wh_value_16') + }) + .margin({ + top: $r('app.float.wh_value_16'), + left: $r('app.float.wh_value_24'), + right: $r('app.float.wh_value_24') + }) + } + } +} + +@Component +export struct componentPublic { + private Alias: string; + private KeyUri: string; + @Link mShowAppCaPresenter: CMShowAppCredPresenter; + @State @Watch("onShowAuthMngChange") isShowAuthMng: boolean = false; + @State @Watch("onShowDeleteWarnDialog") isShowWarning: boolean = false; + detailsDialogController: CustomDialogController = new CustomDialogController({ + builder: CustomDialogExampleApp({ + isShowAuthDialog: $isShowAuthMng, + isShowWarnDialog: $isShowWarning, + mShowAppCaPresenter: $mShowAppCaPresenter + }), + autoCancel: true, + alignment: DialogAlignment.Bottom, + offset: { dx: 0, dy: ConfigData.DIALOG_DY_OFFSET } + }) + appDialogController: CustomDialogController = new CustomDialogController({ + builder: CustomDialogExampleAuthor({ isShowAuthDialog: $isShowAuthMng, AuthorInfo: $mShowAppCaPresenter }), + autoCancel: false, + alignment: DialogAlignment.Bottom, + offset: { dx: 0, dy: ConfigData.DIALOG_DY_OFFSET } + }) + deleteWarnDialog: CustomDialogController = new CustomDialogController({ + builder: CustomDialogDeleteWarning({ isShowWarnDialog: $isShowWarning, deleteWarn: $mShowAppCaPresenter }), + autoCancel: false, + alignment: DialogAlignment.Bottom, + offset: { dx: 0, dy: ConfigData.DIALOG_DY_OFFSET } + }) + + onShowAuthMngChange() { + if (this.isShowAuthMng == true) { + this.appDialogController.open(); + } else { + this.detailsDialogController.close(); + this.detailsDialogController.open(); + this.appDialogController.close(); + } + } + + onShowDeleteWarnDialog() { + if (this.isShowWarning == true) { + this.deleteWarnDialog.open(); + } else { + this.detailsDialogController.close(); + this.deleteWarnDialog.close(); + } + } + + build() { + Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { + Column() { + Text(this.Alias) + .fontSize($r("sys.float.ohos_id_text_size_body1")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Medium) + } + .margin({ + left: $r("app.float.publicList_margin") + }) + + Row() { + Image($r('app.media.ic_settings_arrow')) + .width($r("app.float.publicList_image_wh")) + .height($r("app.float.publicList_image_hg")) + } + .margin({ + left: $r("app.float.publicList_margin"), + right: $r("app.float.publicList_image_margin") + }) + } + .height($r("app.float.wh_value_48")) + .borderRadius($r("app.float.publicList_borderRadius")) + .onClick(() => { + this.mShowAppCaPresenter.getAppCred(this.KeyUri) + this.detailsDialogController.open() + }) + } +} + +@Component +export struct componentPrivate { + private Alias: string; + private KeyUri: string; + @State PrivateCerPresenter: CMShowPrivateCredPresenter = CMShowPrivateCredPresenter.getInstance(); + privateDetailDialog: CustomDialogController = new CustomDialogController({ + builder: CustomDialogExamplePrivate(), + autoCancel: true, + alignment: DialogAlignment.Bottom, + offset: { dx: 0, dy: ConfigData.DIALOG_DY_OFFSET } + }) + + build() { + Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { + Column() { + Text(this.Alias) + .fontSize($r("sys.float.ohos_id_text_size_body1")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Medium) + } + .margin({ + left: $r("app.float.publicList_margin") + }) + + Row() { + Image($r('app.media.ic_settings_arrow')) + .width($r("app.float.publicList_image_wh")) + .height($r("app.float.publicList_image_hg")) + } + .margin({ + left: $r("app.float.publicList_margin"), + right: $r("app.float.publicList_image_margin") + }) + } + .height($r("app.float.wh_value_48")) + .borderRadius($r("app.float.publicList_borderRadius")) + .onClick(() => { + this.PrivateCerPresenter.getPrivateCred(this.KeyUri) + this.privateDetailDialog.open() + }) + } +} + +@Entry +@Component +struct evidenceList { + @State mShowAppCaPresenter: CMShowAppCredPresenter = CMShowAppCredPresenter.getInstance(); + @State mShowPrivateCaPresenter: CMShowPrivateCredPresenter = CMShowPrivateCredPresenter.getInstance(); + @State mFaPresenter: CMFaPresenter = CMFaPresenter.getInstance(); + @State isTouched: boolean = false; + @State currentIndex: number = 0 + @State fontColor: Resource = $r("app.color.evidenceList_TabBuilder_fontColor_182431") + private controller: TabsController = new TabsController(); + + @Builder TabBuilder(index: number) { + Column() { + Text(index == 0 ? $r('app.string.tabName_public') : $r('app.string.tabName_private')) + .fontColor(this.currentIndex === index ? $r("sys.color.ohos_id_color_bottom_tab_icon") : this.fontColor) + .fontSize($r('app.float.font_16')) + .fontWeight(this.currentIndex === index ? FontWeight.Medium : FontWeight.Regular) + .alignSelf(ItemAlign.Center) + .margin({ + top: $r('app.float.TrustedEvidence_TabBuilder_Text_padding_top_value') }) + if (this.currentIndex === index) { + Divider() + .width($r('app.float.TrustedEvidence_TabBuilder_Divider_width_value')) + .margin({ top: $r('app.float.TrustedEvidence_TabBuilder_Divider_padding_top_value') }) + .strokeWidth(2) + .color($r("sys.color.ohos_id_color_bottom_tab_icon")) + .alignSelf(ItemAlign.Center) + } + } + .width(ConfigData.WH_100_100) + } + + aboutToAppear() { + LogUtil.info('in aboutToAppear'); + this.mShowAppCaPresenter.updateAppCredList(); + this.mShowPrivateCaPresenter.updatePrivateCredList(); + } + + onPageShow() { + let uri = globalThis.abilityWant.uri; + globalThis.abilityWant.uri = ""; + + if (uri === "certInstall") { + this.mFaPresenter.startInstall(); + } else if (uri === "requestAuthorize") { + this.mFaPresenter.startRequestAuth(globalThis.abilityWant.parameters.appUid); + } + } + + build() { + Column() { + GridContainer({ + columns: 12, + sizeType: SizeType.Auto, + gutter: vp2px(1) === 2 ? '12vp' : '0vp', + margin: vp2px(1) === 2 ? '24vp' : '0vp' + }) { + Row() { + Column() { + HeadComponent({ headName: $r('app.string.userEvidence') }) + Column() { + Tabs({ barPosition: BarPosition.Start, index: 0, controller: this.controller }) { + TabContent() { + List() { + ForEach(this.mShowAppCaPresenter.credList, (item) => { + ListItem() { + componentPublic({ + Alias: item.alias, + KeyUri: item.keyUri, + mShowAppCaPresenter: $mShowAppCaPresenter + }) + } + }, item => JSON.stringify(item)) + } + .width(ConfigData.WH_92_100) + .margin({ + left: ConfigData.WH_4_100 + }) + .divider({ + strokeWidth: $r("app.float.Evidence_strokeWidth"), + color: $r("app.color.Evidence_color"), + startMargin: $r("app.float.Evidence_startMargin"), + endMargin: $r("app.float.Evidence_endMargin") + }) + .borderRadius($r("app.float.Evidence_borderRadius")) + .backgroundColor($r("app.color.credentials_app_finish_backgroundColor")) + .visibility(this.mShowAppCaPresenter.credList.length > 0 ? Visibility.Visible : Visibility.None) + } + .tabBar(this.TabBuilder(0)) + .onTouch((event: TouchEvent) => { + if (event.type === TouchType.Down) { + this.isTouched = true; + } + if (event.type === TouchType.Up) { + this.isTouched = false; + } + }) + + TabContent() { + List() { + ForEach(this.mShowPrivateCaPresenter.credList, (item) => { + ListItem() { + componentPrivate({ Alias: item.alias, KeyUri: item.keyUri }) + } + }, item => JSON.stringify(item)) + } + .width(ConfigData.WH_92_100) + .margin({ + left: ConfigData.WH_4_100 + }) + .divider({ + strokeWidth: $r("app.float.Evidence_strokeWidth"), + color: $r("app.color.Evidence_color"), + startMargin: $r("app.float.Evidence_startMargin"), + endMargin: $r("app.float.Evidence_endMargin") }) + .borderRadius($r("app.float.Evidence_borderRadius")) + .backgroundColor($r("app.color.credentials_app_finish_backgroundColor")) + .visibility(this.mShowPrivateCaPresenter.credList.length > 0 ? Visibility.Visible : Visibility.None) + } + .tabBar(this.TabBuilder(1)) + .onTouch((event: TouchEvent) => { + if (event.type === TouchType.Down) { + this.isTouched = true; + } + if (event.type === TouchType.Up) { + this.isTouched = false; + } + }); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .barWidth('192vp') + .barHeight($r("app.float.Evidence_barHeight")) + .animationDuration(400) + .width(ConfigData.WH_100_100) + .backgroundColor($r("app.color.TrustedEvidence_tabs_backgroundColor_F1F3F5")) + .onChange((index: number) => { + this.currentIndex = index + }); + } + .height(ConfigData.WH_94_100) + .width(ConfigData.WH_100_100) + } + .backgroundColor($r("sys.color.ohos_id_color_sub_background")) + .width(ConfigData.WH_100_100) + .height(ConfigData.WH_100_100) + .useSizeType({ + xs: { span: 12, offset: 0 }, sm: { span: 12, offset: 0 }, + md: { span: 12, offset: 0 }, lg: { span: 8, offset: 2 } + }); + + Column() { + } + .width(ConfigData.WH_100_100) + .height(ConfigData.WH_100_100) + .useSizeType({ + xs: { span: 0, offset: 12 }, sm: { span: 0, offset: 12 }, + md: { span: 0, offset: 12 }, lg: { span: 2, offset: 10 } + }) + } + .width(ConfigData.WH_100_100) + .height(ConfigData.WH_100_100); + } + .width(ConfigData.WH_100_100) + .height(ConfigData.WH_100_100); + } + .backgroundColor($r("sys.color.ohos_id_color_sub_background")) + .width(ConfigData.WH_100_100) + .height(ConfigData.WH_100_100); + } +} diff --git a/CertificateManager/product/phone/src/main/ets/pages/certInstallAliasInput.ets b/CertificateManager/product/phone/src/main/ets/pages/certInstallAliasInput.ets new file mode 100644 index 0000000..2144cdf --- /dev/null +++ b/CertificateManager/product/phone/src/main/ets/pages/certInstallAliasInput.ets @@ -0,0 +1,159 @@ +/** + * Copyright (c) 2022 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 HeadComponent from '../../../../../../common/component/headComponent'; +import LogUtil from '../../../../../../common/util/LogUtil'; +import ConfigData from '../../../../../../common/util/ConfigData'; +import router from '@system.router'; +import CMInstallPresenter from '../presenter/CMInstallPresenter'; +import CMFaPresenter from '../presenter/CMFaPresenter'; + +@Entry +@Component +struct CertInstallAliasInput { + @State mAppCredAuthPresenter: CMInstallPresenter = CMInstallPresenter.getInstance(); + @State mFaPresenter: CMFaPresenter = CMFaPresenter.getInstance(); + @State certAlias: string = ""; + + onPageShow() { + let uri = globalThis.abilityWant.uri; + globalThis.abilityWant.uri = ""; + + if (uri === "certInstall") { + this.mFaPresenter.startInstall(); + } else if (uri === "requestAuthorize") { + this.mFaPresenter.startRequestAuth(globalThis.abilityWant.parameters.appUid); + } + } + + build() { + Column() { + Column() { + HeadComponent({ headName: $r('app.string.certificateAliasTab') }); + Text($r('app.string.certificateAliasInfo')) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontSize($r("sys.float.ohos_id_text_size_body1")) + .fontWeight(FontWeight.Medium) + .margin({ + top: $r('app.float.distance_24'), + left: $r('app.float.distance_24') + }) + .alignSelf(ItemAlign.Start) + + TextInput() + .type(InputType.Normal) + .backgroundColor($r("sys.color.ohos_id_color_sub_background")) + .enterKeyType(EnterKeyType.Done) + .fontSize($r("sys.float.ohos_id_text_size_body1")) + .fontWeight(FontWeight.Medium) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .onChange((value: string) => { + this.certAlias = value; + }) + .maxLength(ConfigData.ALIAS_MAX_LENGTH) + .margin({ + left: $r('app.float.distance_24'), + right: $r('app.float.distance_24') + }) + .height($r('app.float.distance_48')) + + Row() { + Divider().color($r('app.color.CertManager_Divider_Color_182431')) + } + .margin({ + left: $r('app.float.distance_24'), + right: $r('app.float.distance_24'), + }) + + Text($r('app.string.installAliasInputInfo')) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Regular) + .fontSize($r("sys.float.ohos_id_text_size_body2")) + .margin({ + left: $r('app.float.distance_24'), + top: $r('app.float.distance_16') + }) + .alignSelf(ItemAlign.Start) + .opacity($r('app.float.opacity_100_60')) + } + .width(ConfigData.WH_100_100) + .height(ConfigData.WH_75_100); + + Column() { + Row() { + Button() { + Text($r('app.string.installAliasInputCancel')) + .fontSize($r('sys.float.ohos_id_text_size_body1')) + .fontWeight(FontWeight.Medium) + .fontColor($r('sys.color.ohos_id_color_text_hyperlink')) + } + .type(ButtonType.Capsule) + .backgroundColor($r('app.color.install_cancel_bt_bg_color')) + .width($r('app.float.component_button_width_phone')) + .height($r('app.float.application_button_height')) + .margin({ + left: $r('app.float.distance_24'), + }) + .onClick(() => { + router.back(); + }) + + if ((this.certAlias.length > 0) && (this.certAlias[0] != ' ')) { + Button() { + Text($r('app.string.installAliasInputConfirm')) + .fontSize($r('sys.float.ohos_id_text_size_body1')) + .fontWeight(FontWeight.Medium) + .fontColor($r('app.color.install_confirm_bt_font_color')) + } + .type(ButtonType.Capsule) + .backgroundColor($r('app.color.install_confirm_bt_bg_color')) + .width($r('app.float.component_button_width_phone')) + .height($r('app.float.application_button_height')) + .margin({ + left: $r('app.float.distance_16'), + right: $r('app.float.distance_24'), + }) + .onClick(() => { + this.mAppCredAuthPresenter.installCert(router.getParams().uri, + this.certAlias, + router.getParams().suffix); + }) + } else { + Button() { + Text($r('app.string.installAliasInputConfirm')) + .fontSize($r('sys.float.ohos_id_text_size_body1')) + .fontWeight(FontWeight.Medium) + .fontColor($r('app.color.install_confirm_bt_font_color')) + } + .type(ButtonType.Capsule) + .backgroundColor($r('app.color.install_confirm_bt_bg_disable_color')) + .width($r('app.float.component_button_width_phone')) + .height($r('app.float.application_button_height')) + .margin({ + left: $r('app.float.distance_16'), + right: $r('app.float.distance_24'), + }) + } + } + .margin({ bottom: $r('app.float.wh_value_24') }) + } + .justifyContent(FlexAlign.End) + .height(ConfigData.WH_25_100); + } + .backgroundColor($r("sys.color.ohos_id_color_sub_background")) + .width(ConfigData.WH_100_100) + .height(ConfigData.WH_100_100); + } +} diff --git a/CertificateManager/product/phone/src/main/ets/pages/certManagerFa.ets b/CertificateManager/product/phone/src/main/ets/pages/certManagerFa.ets new file mode 100644 index 0000000..493ee39 --- /dev/null +++ b/CertificateManager/product/phone/src/main/ets/pages/certManagerFa.ets @@ -0,0 +1,277 @@ +/** + * Copyright (c) 2022 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 ConfigData from '../../../../../../common/util/ConfigData'; +import HeadComponent from '../../../../../../common/component/headComponent'; +import { SubEntryComponent } from '../../../../../../common/component/subEntryComponent'; +import CMFaPresenter from '../presenter/CMFaPresenter'; + +@Entry +@Component +struct CertificateComponent { + @State touchedItem: boolean = false; + @State columnMargin: string = '12vp'; + @State mFaPresenter: CMFaPresenter = CMFaPresenter.getInstance(); + + build() { + Column() { + + GridContainer({ + columns: 12, + sizeType: SizeType.Auto, + gutter: vp2px(1) === 2 ? '12vp' : '0vp', + margin: vp2px(1) === 2 ? '24vp' : '0vp' + }) { + Row({}) { + Column() { + } + .width(ConfigData.WH_100_100) + .height(ConfigData.WH_100_100) + .useSizeType({ + xs: { span: 0, offset: 0 }, sm: { span: 0, offset: 0 }, + md: { span: 0, offset: 0 }, lg: { span: 2, offset: 0 } + }); + + Column() { + HeadComponent({ headName: $r('app.string.certificateTab') }) + Column({ space: this.columnMargin }) { + + SubEntryComponent({ targetPage: "pages/trustedCa", title: $r("app.string.trustedEvidence") }) + + SubEntryComponent({ targetPage: 'pages/cerEvidenceFa', title: $r("app.string.userEvidence") }) + + CertInstallComponent({ mFaPresenter: $mFaPresenter }) + + DeleteAll({ mFaPresenter: $mFaPresenter }) + } + .margin({ top: $r("app.float.distance_8") }) + .width(ConfigData.WH_100_100) + } + .backgroundColor($r("sys.color.ohos_id_color_sub_background")) + .padding({ left: $r('app.float.wh_24'), right: $r('app.float.wh_24') }) + .width(ConfigData.WH_100_100) + .height(ConfigData.WH_100_100) + .useSizeType({ + xs: { span: 12, offset: 0 }, sm: { span: 12, offset: 0 }, + md: { span: 12, offset: 0 }, lg: { span: 8, offset: 2 } + }); + + Column() { + } + .width(ConfigData.WH_100_100) + .height(ConfigData.WH_100_100) + .useSizeType({ + xs: { span: 0, offset: 12 }, sm: { span: 0, offset: 12 }, + md: { span: 0, offset: 12 }, lg: { span: 2, offset: 10 } + }) + } + .width(ConfigData.WH_100_100) + .height(ConfigData.WH_100_100); + } + .width(ConfigData.WH_100_100) + .height(ConfigData.WH_100_100); + } + .backgroundColor($r("sys.color.ohos_id_color_sub_background")) + .width(ConfigData.WH_100_100) + .height(ConfigData.WH_100_100); + } + + onPageShow() { + let uri = globalThis.abilityWant.uri; + globalThis.abilityWant.uri = ""; + + if (uri === "certInstall") { + this.mFaPresenter.startInstall(); + } else if (uri === "requestAuthorize") { + this.mFaPresenter.startRequestAuth(globalThis.abilityWant.parameters.appUid); + } + } +} + +@CustomDialog +@Component +struct CustomDialogExampleDeleteAll { + controller: CustomDialogController; + @Link deleteAll: CMFaPresenter; + + build() { + Column() { + Text($r("app.string.deleteAllCredDialogTitle")) + .height($r("app.float.wh_value_56")) + .fontSize($r("sys.float.ohos_id_text_size_dialog_tittle")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Medium) + .margin({ + left: $r('app.float.wh_value_24'), + right: $r('app.float.wh_value_24') + }) + .alignSelf(ItemAlign.Start) + Text($r("app.string.deleteAllCredDialogMessage")) + .fontSize($r('sys.float.ohos_id_text_size_body1')) + .fontWeight(FontWeight.Regular) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .margin({ + top: $r("app.float.wh_value_16"), + left: $r('app.float.wh_value_24'), + right: $r('app.float.wh_value_24') + }) + .alignSelf(ItemAlign.Start) + + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceAround }) { + Button($r("app.string.deleteAllCredCancel")) + .onClick(() => { + this.controller.close() + }) + .backgroundColor($r("app.color.credentials_app_finish_backgroundColor")) + .fontSize($r("sys.float.ohos_id_text_size_button1")) + .fontColor($r("sys.color.ohos_id_color_text_hyperlink")) + .width($r('app.float.wh_value_152')) + .height($r('app.float.wh_value_40')) + Divider() + .strokeWidth(ConfigData.VERTICAL_DIVIDER_WIDTH) + .color($r("sys.color.ohos_id_color_list_separator")) + .vertical(true) + .height($r('app.float.wh_value_40')) + .opacity($r("app.float.opacity_0_2")) + Button($r("app.string.deleteAllCredDelete")) + .onClick(() => { + this.deleteAll.uninstallAllCert(); + this.controller.close() + }) + .backgroundColor($r("app.color.credentials_app_finish_backgroundColor")) + .fontSize($r("sys.float.ohos_id_text_size_button1")) + .fontColor($r("sys.color.ohos_id_color_warning")) + .width($r('app.float.wh_value_152')) + .height($r('app.float.wh_value_40')) + } + .height($r('app.float.wh_value_64')) + .padding({ + bottom: $r('app.float.wh_value_16') + }) + .margin({ + top: $r('app.float.wh_value_16'), + left: $r('app.float.wh_value_24'), + right: $r('app.float.wh_value_24') + }) + } + } +} + +@Component +struct DeleteAll { + @State isTouched: boolean = false; + @Link mFaPresenter: CMFaPresenter; + + deleteWarnDialog: CustomDialogController = new CustomDialogController({ + builder: CustomDialogExampleDeleteAll({ deleteAll: $mFaPresenter }), + autoCancel: true, + alignment:DialogAlignment.Bottom, + offset :{ dx:0, dy:ConfigData.DIALOG_DY_OFFSET } + }) + + build() { + Row() { + Text($r("app.string.deleteAllCred")) + .fontSize($r('app.float.font_16')) + .lineHeight($r('app.float.wh_value_22')) + .fontWeight(FontWeight.Medium) + .fontColor($r('app.color.cm_del_all_font_color')) + .margin({ left: $r('app.float.distance_8') }) + .textAlign(TextAlign.Start); + } + .padding($r('app.float.distance_4')) + .height($r('app.float.wh_value_56')) + .width(ConfigData.WH_100_100) + .borderRadius($r('app.float.radius_24')) + .linearGradient(this.isTouched ? { + angle: 90, + direction: GradientDirection.Right, + colors: [[$r("app.color.DCEAF9"), 0.0], [$r("app.color.FAFAFA"), 1.0]] + } : { + angle: 90, + direction: GradientDirection.Right, + colors: [[$r("sys.color.ohos_id_color_foreground_contrary"), 1], + [$r("sys.color.ohos_id_color_foreground_contrary"), 1]] + }) + .onTouch((event: TouchEvent) => { + if (event.type === TouchType.Down) { + this.isTouched = true; + } + if (event.type === TouchType.Up) { + this.isTouched = false; + } + }) + .onClick(() => { + this.deleteWarnDialog.open(); + }) + } +} + +@Component +export struct CertInstallComponent { + @State isTouched: boolean = false; + @Link mFaPresenter: CMFaPresenter; + + build() { + Column() { + Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { + Row() { + Text($r('app.string.installInStorageDevice')) + .fontSize($r('app.float.font_16')) + .lineHeight($r('app.float.wh_value_22')) + .fontColor($r('app.color.font_color_182431')) + .fontWeight(FontWeight.Medium) + .margin({ left: $r('app.float.distance_8') }) + .textAlign(TextAlign.Start); + } + + Image('/res/image/ic_settings_arrow.svg') + .width($r('app.float.wh_value_12')) + .height($r('app.float.wh_value_24')) + .margin({ right: $r('app.float.distance_8') }) + .fillColor($r("sys.color.ohos_id_color_primary")) + .opacity($r("app.float.opacity_0_2")) + } + .height(ConfigData.WH_100_100) + .width(ConfigData.WH_100_100) + .borderRadius($r('app.float.radius_20')) + .linearGradient(this.isTouched ? { + angle: 90, + direction: GradientDirection.Right, + colors: [[$r("app.color.DCEAF9"), 0.0], [$r("app.color.FAFAFA"), 1.0]] + } : { + angle: 90, + direction: GradientDirection.Right, + colors: [[$r("sys.color.ohos_id_color_foreground_contrary"), 1], + [$r("sys.color.ohos_id_color_foreground_contrary"), 1]] + }) + .onTouch((event: TouchEvent) => { + if (event.type === TouchType.Down) { + this.isTouched = true; + } + if (event.type === TouchType.Up) { + this.isTouched = false; + } + }) + } + .padding($r('app.float.distance_4')) + .backgroundColor($r('app.color.white_bg_color')) + .height($r('app.float.wh_value_56')) + .borderRadius($r('app.float.radius_24')) + .onClick(() => { + this.mFaPresenter.requestPermissions() + }); + } +} diff --git a/CertificateManager/product/phone/src/main/ets/pages/certPwdInput.ets b/CertificateManager/product/phone/src/main/ets/pages/certPwdInput.ets new file mode 100644 index 0000000..b4f2c05 --- /dev/null +++ b/CertificateManager/product/phone/src/main/ets/pages/certPwdInput.ets @@ -0,0 +1,121 @@ +/** + * Copyright (c) 2022 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 HeadComponent from '../../../../../../common/component/headComponent'; +import ConfigData from '../../../../../../common/util/ConfigData'; +import router from '@system.router'; +import CMFaPresenter from '../presenter/CMFaPresenter'; + +@Entry +@Component +struct CertPwdInput { + certPwd: string = ""; + @State mFaPresenter: CMFaPresenter = CMFaPresenter.getInstance(); + + onPageShow() { + let uri = globalThis.abilityWant.uri; + globalThis.abilityWant.uri = ""; + + if (uri === "certInstall") { + this.mFaPresenter.startInstall(); + } else if (uri === "requestAuthorize") { + this.mFaPresenter.startRequestAuth(globalThis.abilityWant.parameters.appUid); + } + } + + build() { + Column() { + Column() { + HeadComponent({ headName: $r('app.string.certificatePwdTab') }); + Text($r('app.string.certificatePwdInfo')) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontSize($r("sys.float.ohos_id_text_size_body1")) + .fontWeight(FontWeight.Medium) + .margin({ + top: $r('app.float.distance_24'), + left: $r('app.float.distance_24') + }) + .alignSelf(ItemAlign.Start); + + TextInput() + .type(InputType.Password) + .onChange((value: string) => { + this.certPwd = value; + }) + .maxLength(ConfigData.PWD_MAX_LENGTH) + .margin({ + top: $r('app.float.distance_16'), + left: $r('app.float.distance_24'), + right: $r('app.float.distance_24') + }) + .height('40vp') + } + .width(ConfigData.WH_100_100) + .height(ConfigData.WH_75_100); + + Column() { + Row() { + Button() { + Text($r('app.string.installPwdInputCancel')) + .fontSize($r('sys.float.ohos_id_text_size_body1')) + .fontWeight(FontWeight.Medium) + .fontColor($r('sys.color.ohos_id_color_text_hyperlink')) + } + .type(ButtonType.Capsule) + .backgroundColor($r('app.color.install_cancel_bt_bg_color')) + .width($r('app.float.component_button_width_phone')) + .height($r('app.float.application_button_height')) + .margin({ + left: $r('app.float.distance_24'), + }) + .onClick(() => { + router.back(); + }) + + Button() { + Text($r('app.string.installPwdInputConfirm')) + .fontSize($r('sys.float.ohos_id_text_size_body1')) + .fontWeight(FontWeight.Medium) + .fontColor($r('app.color.install_confirm_bt_font_color')) + } + .type(ButtonType.Capsule) + .backgroundColor($r('app.color.install_confirm_bt_bg_color')) + .width($r('app.float.component_button_width_phone')) + .height($r('app.float.application_button_height')) + .margin({ + left: $r('app.float.distance_16'), + right: $r('app.float.distance_24'), + }) + .onClick(() => { + globalThis.PwdStore.setCertPwd(this.certPwd) + router.push({ + uri: 'pages/certInstallAliasInput', + params: { + uri: router.getParams().uri, + suffix: router.getParams().suffix + } + }) + }) + } + .margin({ bottom: $r('app.float.wh_value_24') }) + } + .justifyContent(FlexAlign.End) + .height(ConfigData.WH_25_100); + } + .backgroundColor($r("sys.color.ohos_id_color_sub_background")) + .width(ConfigData.WH_100_100) + .height(ConfigData.WH_100_100); + } +} diff --git a/CertificateManager/product/phone/src/main/ets/pages/requestAuth.ets b/CertificateManager/product/phone/src/main/ets/pages/requestAuth.ets new file mode 100644 index 0000000..b9ee4df --- /dev/null +++ b/CertificateManager/product/phone/src/main/ets/pages/requestAuth.ets @@ -0,0 +1,218 @@ +/** + * Copyright (c) 2022 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 LogUtil from '../../../../../../common/util/LogUtil'; +import CMAppCredAuthPresenter from '../presenter/CMAppCredAuthPresenter'; +import router from '@system.router'; +import ConfigData from '../../../../../../common/util/ConfigData'; + +@CustomDialog +@Component +struct CustomDialogAuthForApp { + controller: CustomDialogController + @State mAppCredAuthPresenter: CMAppCredAuthPresenter = CMAppCredAuthPresenter.getInstance(); + selectUri: string = ""; + + aboutToAppear(): void { + LogUtil.info('certPwdInput about to appear'); + this.mAppCredAuthPresenter.UpdateAppNameFromUid(router.getParams().appUid); + this.mAppCredAuthPresenter.updateAppCredList(); + } + + build() { + Column() { + Text($r('app.string.pickCredToAuth')) + .fontSize($r('sys.float.ohos_id_text_size_dialog_tittle')) + .height($r("app.float.wh_value_56")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Medium) + .margin({ + left: $r('app.float.wh_value_24'), + right: $r('app.float.wh_value_24') + }) + .alignSelf(ItemAlign.Start) + + Text($r('app.string.requestAuthMsg', this.mAppCredAuthPresenter.appName)) + .fontSize($r('sys.float.ohos_id_text_size_body1')) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Regular) + .margin({ + top: $r('app.float.wh_value_8'), + left: $r('app.float.wh_value_24'), + right: $r('app.float.wh_value_24') + }) + .alignSelf(ItemAlign.Start) + + if (this.mAppCredAuthPresenter.credList.length > ConfigData.REQUEST_AUTH_MAX_LENGTH) { + List() { + ForEach(this.mAppCredAuthPresenter.credList, (item) => { + ListItem() { + Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { + + Column() { + Text(item.alias) + .fontSize($r('app.float.font_18')) + .fontColor($r('app.color.request_auth_font_color')) + .fontWeight(FontWeight.Medium) + .textAlign(TextAlign.Start); + } + .alignItems(HorizontalAlign.Start) + + Column() { + Radio({ value: item.alias, group: 'appCredGroup' }) + .checked(false) + .onChange((value: boolean) => { + console.log(item.alias + ' status is ' + value) + if (value) { + this.selectUri = item.keyUri; + console.log('selectUri is ' + this.selectUri) + } + }) + } + .alignItems(HorizontalAlign.End) + } + .width(ConfigData.WH_100_100) + } + .height($r('app.float.wh_value_64')) + }, item => JSON.stringify(item)) + } + .height(ConfigData.WH_50_100) + .margin({ + left: $r('app.float.wh_value_24'), + right: $r('app.float.wh_value_24') + }) + .divider({ + strokeWidth: $r("app.float.request_auth_strokeWidth"), + color: $r("app.color.request_auth_color"), + endMargin: $r("app.float.request_auth_divider_endMargin")}) + .borderRadius($r("app.float.request_auth_borderRadius")) + .backgroundColor($r("app.color.request_auth_background_color")) + .visibility(this.mAppCredAuthPresenter.credList.length > 0 ? Visibility.Visible : Visibility.None) + } else { + List() { + ForEach(this.mAppCredAuthPresenter.credList, (item) => { + ListItem() { + Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { + Column() { + Text(item.alias) + .fontSize($r('app.float.font_18')) + .fontColor($r('app.color.request_auth_font_color')) + .fontWeight(FontWeight.Medium) + .textAlign(TextAlign.Start); + } + .alignItems(HorizontalAlign.Start) + + Column() { + Radio({ value: item.alias, group: 'appCredGroup' }) + .checked(false) + .onChange((value: boolean) => { + console.log(item.alias + ' status is ' + value) + if (value) { + this.selectUri = item.keyUri; + console.log('selectUri is ' + this.selectUri) + } + }) + } + .alignItems(HorizontalAlign.End) + } + .width(ConfigData.WH_100_100) + } + .height($r('app.float.wh_value_64')) + }, item => JSON.stringify(item)) + } + .margin({ + left: $r('app.float.wh_value_24'), + right: $r('app.float.wh_value_24') + }) + .divider({ + strokeWidth: $r("app.float.request_auth_strokeWidth"), + color: $r("app.color.request_auth_color"), + endMargin: $r("app.float.request_auth_divider_endMargin") }) + .borderRadius($r("app.float.request_auth_borderRadius")) + .backgroundColor($r("app.color.request_auth_background_color")) + .visibility(this.mAppCredAuthPresenter.credList.length > 0 ? Visibility.Visible : Visibility.None) + } + + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceAround }) { + Button($r('app.string.requestAuthCancel')) + .onClick(() => { + this.mAppCredAuthPresenter.cancelProcess(); + this.controller.close(); + }) + .backgroundColor($r('app.color.request_auth_background_color')) + .fontColor($r('sys.color.ohos_id_color_text_hyperlink')) + .fontSize($r('sys.float.ohos_id_text_size_button1')) + .width($r('app.float.wh_value_152')) + .height($r('app.float.wh_value_40')) + + Divider() + .strokeWidth(ConfigData.VERTICAL_DIVIDER_WIDTH) + .color($r("sys.color.ohos_id_color_list_separator")) + .vertical(true) + .height($r('app.float.wh_value_40')) + .opacity($r("app.float.opacity_0_2")) + + Button($r('app.string.requestAuthFinish')) + .onClick(() => { + LogUtil.info('requestAuthorize uri: ' + this.selectUri); + if (router.getParams() && router.getParams().appUid) { + LogUtil.info('requestAuthorize appUid: ' + router.getParams().appUid); + this.mAppCredAuthPresenter.requestAuthorize(this.selectUri, router.getParams().appUid); + this.controller.close(); + } else { + LogUtil.info('requestAuthorize fail'); + } + }) + .backgroundColor($r('app.color.request_auth_background_color')) + .fontColor($r('sys.color.ohos_id_color_text_hyperlink')) + .fontSize($r('sys.float.ohos_id_text_size_button1')) + .width($r('app.float.wh_value_152')) + .height($r('app.float.wh_value_40')) + } + .height($r('app.float.wh_value_64')) + .padding({ + bottom: $r('app.float.wh_value_16') + }) + .margin({ + left: $r('app.float.wh_value_24'), + right: $r('app.float.wh_value_24') + }) + } + } +} + +@Entry +@Component +struct RadioAuth { + dialogController: CustomDialogController = new CustomDialogController({ + builder: CustomDialogAuthForApp(), + autoCancel: false, + alignment: DialogAlignment.Bottom, + offset: { dx: 0, dy: ConfigData.DIALOG_DY_OFFSET } + }) + + aboutToAppear() { + LogUtil.info('RadioAuth aboutToAppear'); + + if (router.getParams() && router.getParams().appUid) { + this.dialogController.open(); + } else { + router.replace({ uri: "pages/certManagerFa" }); + } + } + + build() { + } +} diff --git a/CertificateManager/product/phone/src/main/ets/pages/trustedCa.ets b/CertificateManager/product/phone/src/main/ets/pages/trustedCa.ets new file mode 100644 index 0000000..4b2fe31 --- /dev/null +++ b/CertificateManager/product/phone/src/main/ets/pages/trustedCa.ets @@ -0,0 +1,930 @@ +/** + * Copyright (c) 2022 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 LogUtil from '../../../../../../common/util/LogUtil'; +import ConfigData from '../../../../../../common/util/ConfigData'; +import HeadComponent from '../../../../../../common/component/headComponent'; +import CMShowSysCaPresenter from '../presenter/CMShowSysCaPresenter'; +import CMShowUserCaPresenter from '../presenter/CMShowUserCaPresenter'; +import CMFaPresenter from '../presenter/CMFaPresenter'; + +@Component +struct DialogSubjectComponent { + private map: Map; + private subjectNameCN: string = '' + private subjectNameO: string = '' + private subjectNameOU: string = '' + private serial: string = '' + aboutToAppear() { + if (this.map != null) { + this.subjectNameCN = this.map.get('常用名称:') + this.subjectNameO = this.map.get('组织:') + this.subjectNameOU = this.map.get('组织单位:') + this.serial = this.map.get('序列号:') + } + } + build() { + Column() { + Text($r("app.string.DialogSubjectComponent_firText")) + .fontSize($r("sys.float.ohos_id_text_size_body2")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Regular) + .margin({ + top: $r("app.float.DialogSubjectComponent_Text_margin_top_value") + }) + Text(this.subjectNameCN) + .fontSize($r("sys.float.ohos_id_text_size_body2")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Regular) + Text($r("app.string.DialogSubjectComponent_secText")) + .fontSize($r("sys.float.ohos_id_text_size_body2")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Regular) + .margin({ + top: $r("app.float.CustomDialogExample_Button_margin_top_value") + }) + Text(this.subjectNameO) + .fontSize($r("sys.float.ohos_id_text_size_body2")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Regular) + Text($r("app.string.DialogSubjectComponent_thdText")) + .fontSize($r("sys.float.ohos_id_text_size_body2")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Regular) + .margin({ + top: $r("app.float.CustomDialogExample_Button_margin_top_value") + }) + Text(this.subjectNameOU) + .fontSize($r("sys.float.ohos_id_text_size_body2")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Regular) + Text($r("app.string.DialogSubjectComponent_fouText")) + .fontSize($r("sys.float.ohos_id_text_size_body2")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Regular) + .margin({ + top: $r("app.float.wh_value_12") + }) + Text(this.serial) + .fontSize($r("sys.float.ohos_id_text_size_body2")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Regular) + }.alignItems(HorizontalAlign.Start); + } +} + +@Component +struct DialogIssuerComponent { + private map: Map; + private issuerNameCN: string = '' + private issuerNameO: string = '' + private issuerNameOU: string = '' + aboutToAppear() { + if (this.map != null) { + this.issuerNameCN = this.map.get('常用名称:') + this.issuerNameO = this.map.get('组织:') + this.issuerNameOU = this.map.get('组织单位:') + } + } + + build() { + Column() { + Text($r("app.string.DialogSubjectComponent_firText")) + .fontSize($r("sys.float.ohos_id_text_size_body2")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Regular) + .margin({ + top: $r("app.float.wh_value_10") + }) + Text(this.issuerNameCN) + .fontSize($r("sys.float.ohos_id_text_size_body2")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Regular) + Text($r("app.string.DialogSubjectComponent_secText")) + .fontSize($r("sys.float.ohos_id_text_size_body2")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Regular) + .margin({ + top: $r("app.float.CustomDialogExample_Button_margin_top_value") + }) + Text(this.issuerNameO) + .fontSize($r("sys.float.ohos_id_text_size_body2")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Regular) + Text($r("app.string.DialogSubjectComponent_thdText")) + .fontSize($r("sys.float.ohos_id_text_size_body2")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Regular) + .margin({ + top: $r("app.float.CustomDialogExample_Button_margin_top_value") + }) + Text(this.issuerNameOU) + .fontSize($r("sys.float.ohos_id_text_size_body2")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Regular) + }.alignItems(HorizontalAlign.Start); + } +} + +@Component +struct DialogDateComponent { + private map: Map; + private notBefore: string = '' + private notAfter: string = '' + aboutToAppear() { + if (this.map != null) { + this.notBefore = this.map.get('颁发时间:') + this.notAfter = this.map.get('有效期至:') + } + } + + build() { + Column() { + Text($r("app.string.DialogSubjectComponent_fifText")) + .fontSize($r("sys.float.ohos_id_text_size_body2")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Regular) + .margin({ + top: $r("app.float.wh_value_10") + }) + Text(this.notBefore) + .fontSize($r("sys.float.ohos_id_text_size_body2")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Regular) + Text($r("app.string.DialogSubjectComponent_sixText")) + .fontSize($r("sys.float.ohos_id_text_size_body2")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Regular) + .margin({ + top: $r("app.float.CustomDialogExample_Button_margin_top_value") + }) + Text(this.notAfter) + .fontSize($r("sys.float.ohos_id_text_size_body2")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Regular) + }.alignItems(HorizontalAlign.Start); + } +} + +@Component +struct DialogFingerPrintComponent { + private fingerprintSha256: string; + + build() { + Column() { + Text($r("app.string.CustomDialogExample_FingerPrint_text")) + .fontSize($r("sys.float.ohos_id_text_size_body2")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Regular) + .margin({ + top: $r("app.float.wh_value_10") + }) + Text(this.fingerprintSha256) + .fontSize($r("sys.float.ohos_id_text_size_body2")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Regular) + .margin({ + right: $r("app.float.wh_value_24") + }) + }.alignItems(HorizontalAlign.Start); + } +} + +@CustomDialog +@Component +struct CustomDialogDeleteWarning { + controller: CustomDialogController; + @Link deleteWarn: CMShowUserCaPresenter; + @Link mShowUserListPresenter: CMShowUserCaPresenter; + @Link isShowWarnDialog: boolean; + + build() { + Column() { + Text($r("app.string.CustomDialogExampleUser_warning_Button_title_text")) + .height($r("app.float.wh_value_56")) + .fontSize($r("sys.float.ohos_id_text_size_dialog_tittle")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Medium) + .margin({ + left: $r('app.float.wh_value_24'), + right: $r('app.float.wh_value_24') + }) + .alignSelf(ItemAlign.Start) + Text($r("app.string.CustomDialogExampleUser_warning_Button_message_text")) + .fontSize($r('sys.float.ohos_id_text_size_body1')) + .fontWeight(FontWeight.Regular) + .fontColor($r("sys.color.ohos_id_color_primary")) + .margin({ + top: $r("app.float.wh_value_16"), + left: $r('app.float.wh_value_24'), + right: $r('app.float.wh_value_24') + }) + .alignSelf(ItemAlign.Start) + + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceAround }) { + Button($r("app.string.deleteAllCredCancel")) + .onClick(() => { + this.isShowWarnDialog = false; + this.controller.close() + }) + .backgroundColor($r("app.color.CustomDialogExample_Button_backgroundColor_FFFFFF")) + .fontSize($r("sys.float.ohos_id_text_size_button1")) + .width($r('app.float.wh_value_152')) + .height($r('app.float.wh_value_40')) + .fontColor($r("sys.color.ohos_id_color_text_hyperlink")) + Divider() + .strokeWidth(1) + .color($r("sys.color.ohos_id_color_list_separator")) + .vertical(true) + .height($r('app.float.wh_value_40')) + .opacity($r("app.float.opacity_0_2")) + Button($r("app.string.deleteAllCredDelete")) + .onClick(() => { + this.deleteWarn.deleteUserCertificate(this.deleteWarn.certInfo.uri); + this.mShowUserListPresenter.updateUserTrustedCertificateList(); + this.isShowWarnDialog = false; + this.controller.close() + }) + .backgroundColor($r("app.color.CustomDialogExample_Button_backgroundColor_FFFFFF")) + .fontSize($r("sys.float.ohos_id_text_size_button1")) + .width($r('app.float.wh_value_152')) + .height($r('app.float.wh_value_40')) + .fontColor($r("sys.color.ohos_id_color_warning")) + } + .height($r('app.float.wh_value_64')) + .padding({ + bottom: $r('app.float.wh_value_16') + }) + .margin({ + top: $r('app.float.wh_value_16'), + left: $r('app.float.wh_value_24'), + right: $r('app.float.wh_value_24') + }) + } + } +} + +@CustomDialog +@Component +struct CustomDialogExampleUser { + controller: CustomDialogController; + @Link userInfoPresenter: CMShowUserCaPresenter; + @Link userInfoPresenterForAbstractList: CMShowUserCaPresenter; + @Link isShowWarnDialog: boolean; + @State IsOn: boolean = false; + + aboutToAppear() { + this.IsOn = this.userInfoPresenter.certInfo.status; + } + + build() { + Column() { + Text($r("app.string.CustomDialogExample_firText")) + .fontSize($r("sys.float.ohos_id_text_size_dialog_tittle")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Medium) + .margin({ + left: $r("app.float.CustomDialogExample_firText_margin_left_value"), + top: $r("app.float.CustomDialogExample_firText_margin_top_value") + }) + .alignSelf(ItemAlign.Start) + Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { + Column() { + Text(this.userInfoPresenter.certInfo.certAlias) + .fontSize($r("sys.float.ohos_id_text_size_body1")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Medium) + .margin({ + left: $r("app.float.wh_value_26") + }) + if (this.IsOn) { + Text($r("app.string.CustomDialogExampleUser_Status_true")) + .fontSize($r("sys.float.ohos_id_text_size_body2")) + .fontColor($r("sys.color.ohos_id_color_text_secondary")) + .margin({ + left: $r("app.float.wh_value_26") + }) + } else { + Text($r("app.string.CustomDialogExampleUser_Status_false")) + .fontSize($r("sys.float.ohos_id_text_size_body2")) + .fontColor($r("sys.color.ohos_id_color_text_secondary")) + .margin({ + left: $r("app.float.wh_value_26") + }) + } + }.alignItems(HorizontalAlign.Start); + Toggle({ type: ToggleType.Switch, isOn: this.IsOn }) + .margin({ + right: $r("app.float.CustomDialogExampleUser_Flex_Toggle_margin_right_value") + }) + .width($r("app.float.CustomDialogExampleUser_Flex_Toggle_width_value")) + .height($r("app.float.CustomDialogExampleUser_Flex_Toggle_height_value")) + .selectedColor($r("app.color.CustomDialogExampleUser_Flex_Toggle_selectedColor_007DFF")) + .onChange((isOn: boolean) => { + if (isOn) { + this.IsOn = true; + this.userInfoPresenter.setUserCertificateStatus(this.userInfoPresenter.certInfo.uri, true); + } else { + this.IsOn = false; + this.userInfoPresenter.setUserCertificateStatus(this.userInfoPresenter.certInfo.uri, false); + } + }); + } + .height($r("app.float.CustomDialogExampleUser_Flex_height_value")) + .margin({}); + List() { + ListItem() { + Text($r("app.string.CustomDialogExample_firListItem_text")) + .fontSize($r("sys.float.ohos_id_text_size_body2")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Regular) + .margin({ + top: $r("app.float.wh_value_12") + }) + }.width('100%').align(Alignment.Start) + + ListItem() { + DialogSubjectComponent({ map: this.userInfoPresenter.certInfo.subjectNameMap }); + }.width('100%').align(Alignment.Start) + + ListItem() { + Text($r("app.string.CustomDialogExample_secListItem_text")) + .fontSize($r("sys.float.ohos_id_text_size_body2")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Regular) + .margin({ + top: $r("app.float.wh_value_12") + }) + }.width('100%').align(Alignment.Start) + + ListItem() { + DialogIssuerComponent({ map: this.userInfoPresenter.certInfo.issuerNameMap }); + }.width('100%').align(Alignment.Start) + + ListItem() { + Text($r("app.string.CustomDialogExample_thdListItem_text")) + .fontSize($r("sys.float.ohos_id_text_size_body2")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Regular) + .margin({ + top: $r("app.float.wh_value_12") + }) + }.width('100%').align(Alignment.Start) + + ListItem() { + DialogDateComponent({ map: this.userInfoPresenter.certInfo.dateMap }); + }.width('100%').align(Alignment.Start) + + ListItem() { + Text($r("app.string.CustomDialogExample_fouListItem_text")) + .fontSize($r("sys.float.ohos_id_text_size_body2")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Regular) + .margin({ + top: $r("app.float.wh_value_12") + }) + }.width('100%').align(Alignment.Start) + + ListItem() { + DialogFingerPrintComponent({ fingerprintSha256: this.userInfoPresenter.certInfo.fingerprintSha256 }); + }.width('100%').align(Alignment.Start) + } + .height($r("app.float.CustomDialogExample_list_height_value")) + .margin({ + bottom: $r("app.float.CustomDialogExample_secListItem_Text_margin_left_value"), + left: $r("app.float.wh_value_24"), + right: $r("app.float.wh_value_24") + }) + .borderRadius($r("app.float.CustomDialogExample_list_borderRadius_value")) + .scrollBar(BarState.Auto); + + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceAround }) { + Button($r("app.string.CustomDialogExampleUser_Flex_firButton_text")) + .onClick(() => { + this.userInfoPresenterForAbstractList.updateUserTrustedCertificateList(); + this.isShowWarnDialog = false; + this.controller.close(); + }) + .backgroundColor($r("app.color.CustomDialogExample_Button_backgroundColor_FFFFFF")) + .fontSize($r("sys.float.ohos_id_text_size_button1")) + .width($r('app.float.wh_value_152')) + .height($r('app.float.wh_value_40')) + .fontColor($r("sys.color.ohos_id_color_text_hyperlink")) + Divider() + .strokeWidth(ConfigData.VERTICAL_DIVIDER_WIDTH) + .color($r("sys.color.ohos_id_color_list_separator")) + .vertical(true) + .height($r('app.float.wh_value_40')) + .opacity($r("app.float.opacity_0_2")) + Button($r("app.string.CustomDialogExampleUser_Flex_secButton_text")) + .onClick(() => { + this.isShowWarnDialog = true; + this.controller.close(); + }) + .backgroundColor($r("app.color.CustomDialogExample_Button_backgroundColor_FFFFFF")) + .fontSize($r("sys.float.ohos_id_text_size_button1")) + .width($r('app.float.wh_value_152')) + .height($r('app.float.wh_value_40')) + .fontColor($r("sys.color.ohos_id_color_warning")) + } + .height($r('app.float.wh_value_64')) + .padding({ + bottom: $r('app.float.wh_value_16') + }) + .margin({ + top: $r('app.float.wh_value_16'), + left: $r('app.float.wh_value_24'), + right: $r('app.float.wh_value_24') + }) + } + } +} + +@CustomDialog +@Component +struct CustomDialogExampleSystem { + controller: CustomDialogController; + @Link sysInfoPresenter: CMShowSysCaPresenter; + private isTrueButton: string = ''; + + build() { + Column() { + Text($r("app.string.CustomDialogExample_firText")) + .fontSize($r("sys.float.ohos_id_text_size_dialog_tittle")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Medium) + .margin({ + left: $r("app.float.CustomDialogExample_firText_margin_left_value"), + top: $r("app.float.CustomDialogExample_firText_margin_top_value") + }) + .alignSelf(ItemAlign.Start) + Text(this.sysInfoPresenter.certInfo.certAlias) + .fontSize($r("sys.float.ohos_id_text_size_body1")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Medium) + .margin({ + top: $r("app.float.wh_value_16"), + left: $r("app.float.CustomDialogExample_secText_margin_left_value") + }) + .alignSelf(ItemAlign.Start) + List() { + ListItem() { + Text($r("app.string.CustomDialogExample_firListItem_text")) + .fontSize($r("sys.float.ohos_id_text_size_body2")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Regular) + }.width('100%').align(Alignment.Start) + + ListItem() { + DialogSubjectComponent({ map: this.sysInfoPresenter.certInfo.subjectNameMap }); + }.width('100%').align(Alignment.Start) + + ListItem() { + Text($r("app.string.CustomDialogExample_secListItem_text")) + .fontSize($r("sys.float.ohos_id_text_size_body2")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Regular) + .margin({ + top: $r("app.float.wh_value_12") + }) + }.width('100%').align(Alignment.Start) + + ListItem() { + DialogIssuerComponent({ map: this.sysInfoPresenter.certInfo.issuerNameMap }); + }.width('100%').align(Alignment.Start) + + ListItem() { + Text($r("app.string.CustomDialogExample_thdListItem_text")) + .fontSize($r("sys.float.ohos_id_text_size_body2")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Regular) + .margin({ + top: $r("app.float.wh_value_12") + }) + }.width('100%').align(Alignment.Start) + + ListItem() { + DialogDateComponent({ map: this.sysInfoPresenter.certInfo.dateMap }); + }.width('100%').align(Alignment.Start) + + ListItem() { + Text($r("app.string.CustomDialogExample_fouListItem_text")) + .fontSize($r("sys.float.ohos_id_text_size_body2")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Regular) + .margin({ + top: $r("app.float.wh_value_12") + }) + }.width('100%').align(Alignment.Start) + + ListItem() { + DialogFingerPrintComponent({ fingerprintSha256: this.sysInfoPresenter.certInfo.fingerprintSha256 }); + }.width('100%').align(Alignment.Start) + } + .height($r("app.float.CustomDialogExample_list_height_value")) + .margin({ + left: $r("app.float.wh_value_24"), + top: $r("app.float.CustomDialogExample_list_margin_top_value"), + bottom: $r("app.float.CustomDialogExample_secListItem_Text_margin_left_value"), + right: $r("app.float.wh_value_24") + }) + .borderRadius($r("app.float.CustomDialogExample_list_borderRadius_value")) + .backgroundColor($r("app.color.CustomDialogExample_list_backgroundColor_FFFFFF")) + .scrollBar(BarState.Auto); + + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceAround }) { + Button($r("app.string.CustomDialogExample_Button_text")) + .onClick(() => { + this.controller.close(); + }) + .backgroundColor($r("app.color.CustomDialogExample_Button_backgroundColor_FFFFFF")) + .fontSize($r("sys.float.ohos_id_text_size_button1")) + .width($r('app.float.wh_value_152')) + .height($r('app.float.wh_value_40')) + .fontColor($r("sys.color.ohos_id_color_text_hyperlink")) + Divider() + .strokeWidth(ConfigData.VERTICAL_DIVIDER_WIDTH) + .color($r("sys.color.ohos_id_color_list_separator")) + .vertical(true) + .height($r('app.float.wh_value_40')) + .opacity($r("app.float.opacity_0_2")) + if (this.sysInfoPresenter.certInfo.status) { + Button($r("app.string.CustomDialogExample_Button_off")) + .onClick(() => { + this.sysInfoPresenter.setSystemCertificateStatus(this.sysInfoPresenter.certInfo.uri, false); + this.controller.close(); + }) + .backgroundColor($r("app.color.CustomDialogExample_Button_backgroundColor_FFFFFF")) + .fontSize($r("sys.float.ohos_id_text_size_button1")) + .width($r('app.float.wh_value_152')) + .height($r('app.float.wh_value_40')) + .fontColor($r("sys.color.ohos_id_color_text_hyperlink")) + } else { + Button($r("app.string.CustomDialogExample_Button_on")) + .onClick(() => { + this.sysInfoPresenter.setSystemCertificateStatus(this.sysInfoPresenter.certInfo.uri, true); + this.controller.close(); + }) + .backgroundColor($r("app.color.CustomDialogExample_Button_backgroundColor_FFFFFF")) + .fontSize($r("sys.float.ohos_id_text_size_button1")) + .width($r('app.float.wh_value_152')) + .height($r('app.float.wh_value_40')) + .fontColor($r("sys.color.ohos_id_color_text_hyperlink")) + } + } + .height($r('app.float.wh_value_64')) + .padding({ + bottom: $r('app.float.wh_value_16') + }) + .margin({ + top: $r('app.float.wh_value_16'), + left: $r('app.float.wh_value_24'), + right: $r('app.float.wh_value_24') + }) + } + } +} + +@Component +struct ComponentSystem { + private certAlias: string; + private subjectName: string; + private Status: boolean; + private Index : number; + private Uri: string; + isSwitchTouched : boolean = false; + @State isTouched: boolean = false; + @Link setStatus: CMShowSysCaPresenter; + dialogController: CustomDialogController = new CustomDialogController({ + builder: CustomDialogExampleSystem({ sysInfoPresenter: $setStatus }), + autoCancel: true, + alignment: DialogAlignment.Bottom, + offset: { dx: 0, dy: ConfigData.DIALOG_DY_OFFSET } + }) + + build() { + Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { + Column() { + Text(this.certAlias) + .height($r("app.float.ComponentSystem_firText_height_value")) + .fontSize($r("sys.float.ohos_id_text_size_body1")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Medium) + .textAlign(TextAlign.Start) + .margin({top: $r("app.float.wh_value_10") }); + Text(this.subjectName) + .height($r("app.float.ComponentSystem_secText_height_value")) + .fontSize($r("sys.float.ohos_id_text_size_body2")) + .fontColor($r("sys.color.ohos_id_color_text_secondary")) + .fontWeight(FontWeight.Regular) + .textAlign(TextAlign.Start) + .margin({ top: $r("app.float.wh_value_2"), bottom: $r("app.float.wh_value_11") }); + }.alignItems(HorizontalAlign.Start); + Toggle({ type: ToggleType.Switch, isOn: this.setStatus.certList[this.Index].status }) + .width($r("app.float.ComponentSystem_Toggle_width_value")) + .height($r("app.float.ComponentSystem_Toggle_height_value")) + .selectedColor($r("app.color.ComponentSystem_Toggle_selectedColor_007DFF")) + .onChange((isOn: boolean) => { + if (isOn) { + console.info('Component status:' + isOn); + this.setStatus.setSystemCertificateStatus(this.Uri, true); + } else { + console.info('Component status:' + isOn); + this.setStatus.setSystemCertificateStatus(this.Uri, false); + } + }) + .offset({ x: ConfigData.SWITCH_BUTTON_X_OFFSET, y: 0 }) + } + .height($r("app.float.ComponentSystem_Flex_height_value")) + .borderRadius($r("app.float.ComponentSystem_Flex_borderRadius_value")) + .onClick(() => { + this.setStatus.getSystemTrustedCertificate(this.Uri); + console.info('this.setStatus.certInfo.status is:' + JSON.stringify(this.setStatus.certInfo)); + this.dialogController.open(); + }) + } +} + +@Component +struct ComponentUser { + private certAlias: string; + private subjectName: string; + private Index : number = -1; + private Uri: string; + @State StatusText : Resource = $r("app.string.CustomDialogExampleUser_Status_false"); + @State isTouched: boolean = false; + @Link setStatus: CMShowUserCaPresenter; + @State mUserCaPresenterDetail: CMShowUserCaPresenter = CMShowUserCaPresenter.getInstance(); + @State @Watch("onShowDeleteWarnDialog") isShowWarning: boolean = false; + + dialogController: CustomDialogController = new CustomDialogController({ + builder: CustomDialogExampleUser({ isShowWarnDialog: $isShowWarning,userInfoPresenter: $mUserCaPresenterDetail, + userInfoPresenterForAbstractList: $setStatus }), + autoCancel: true, + cancel: () => { + this.setStatus.updateUserTrustedCertificateList(); + }, + alignment: DialogAlignment.Bottom, + offset: { dx: 0, dy: ConfigData.DIALOG_DY_OFFSET } + }) + + deleteWarnDialog: CustomDialogController = new CustomDialogController({ + builder: CustomDialogDeleteWarning({ + isShowWarnDialog: $isShowWarning, + deleteWarn: $mUserCaPresenterDetail, + mShowUserListPresenter: $setStatus }), + autoCancel: false, + alignment:DialogAlignment.Bottom, + offset: { dx: 0, dy: ConfigData.DIALOG_DY_OFFSET } + }) + + onShowDeleteWarnDialog() { + if (this.isShowWarning == true) { + this.deleteWarnDialog.open(); + } else { + this.dialogController.close(); + this.deleteWarnDialog.close(); + } + } + + aboutToAppear() { + LogUtil.info('in ComponentUser aboutToAppear'); + if (this.setStatus.certList[this.Index].status == true) { + this.StatusText = $r("app.string.CustomDialogExampleUser_Status_true"); + } else { + this.StatusText = $r("app.string.CustomDialogExampleUser_Status_false"); + } + } + + build() { + Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { + Column() { + Text(this.certAlias) + .height($r("app.float.componentUser_firText_height_value")) + .fontSize($r("sys.float.ohos_id_text_size_body1")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Medium) + .textAlign(TextAlign.Start) + .margin({ top: $r("app.float.wh_value_10") }); + Text(this.subjectName) + .height($r("app.float.componentUser_secText_height_value")) + .fontSize($r("sys.float.ohos_id_text_size_body2")) + .fontColor($r("sys.color.ohos_id_color_text_primary")) + .fontWeight(FontWeight.Regular) + .textAlign(TextAlign.Start) + .margin({ top: $r("app.float.wh_value_2"), bottom: $r("app.float.wh_value_11") }); + }.alignItems(HorizontalAlign.Start); + Row() { + Text(this.StatusText) + .fontSize($r("sys.float.ohos_id_text_size_body2")) + .fontColor($r("sys.color.ohos_id_color_text_secondary")) + .textAlign(TextAlign.End) + .margin({ + right: $r("app.float.componentUser_thdText_margin_value") + }) + Image($r('app.media.ic_settings_arrow')) + .width($r("app.float.componentUser_image_width_value")) + .height($r("app.float.componentUser_image_height_value")) + .fillColor($r("sys.color.ohos_id_color_primary")) + .opacity($r("app.float.componentUser_image_opacity_value")); + } + } + .height($r("app.float.componentUser_flex_height_value")) + .borderRadius($r("app.float.componentUser_flex_borderRadius_value")) + .onClick(() => { + this.mUserCaPresenterDetail.getUserTrustedCertificate(this.Uri); + console.info('userCerInfo is:' + JSON.stringify(this.setStatus.certInfo)); + this.dialogController.open(); + }); + } +} + +@Entry +@Component +struct TrustedEvidence { + @State mShowSysCaPresenter: CMShowSysCaPresenter = CMShowSysCaPresenter.getInstance(); + @State mShowUserCaPresenter: CMShowUserCaPresenter = CMShowUserCaPresenter.getInstance(); + @State mFaPresenter: CMFaPresenter = CMFaPresenter.getInstance(); + @State isTouched: boolean = false; + @State currentIndex: number = 0 + @State fontColor: Resource = $r("app.color.TrustedEvidence_TabBuilder_fontColor_182431") + @State selectedFontColor: Resource = $r("app.color.font_color_007DFF") + private controller: TabsController = new TabsController(); + + @Builder TabBuilder(index: number) { + Column() { + Text(index == 0 ? $r('app.string.system') : $r('app.string.user')) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize($r('app.float.TrustedEvidence_TabBuilder_Text_fontSize_value')) + .fontWeight(this.currentIndex === index ? FontWeight.Medium : FontWeight.Regular) + .alignSelf(ItemAlign.Center) + .margin({ + top: $r('app.float.TrustedEvidence_TabBuilder_Text_padding_top_value') + }) + if (this.currentIndex === index) { + Divider() + .width($r('app.float.TrustedEvidence_TabBuilder_Divider_width_value')) + .margin({ top: $r('app.float.TrustedEvidence_TabBuilder_Divider_padding_top_value') }) + .strokeWidth(2) + .color(this.selectedFontColor) + .alignSelf(ItemAlign.Center) + } + } + .width(ConfigData.WH_100_100) + } + + aboutToAppear() { + LogUtil.info('in aboutToAppear'); + this.mShowSysCaPresenter.updateSystemTrustedCertificateList(); + this.mShowUserCaPresenter.updateUserTrustedCertificateList(); + } + + onPageShow() { + let uri = globalThis.abilityWant.uri; + globalThis.abilityWant.uri = ""; + + if (uri === "certInstall") { + this.mFaPresenter.startInstall(); + } else if (uri === "requestAuthorize") { + this.mFaPresenter.startRequestAuth(globalThis.abilityWant.parameters.appUid); + } + } + + build() { + Column() { + GridContainer({columns:12, sizeType: SizeType.Auto, gutter: vp2px(1) === 2 ? '12vp' : '0vp', + margin: vp2px(1) === 2 ? '24vp' : '0vp'}) { + Row() { + Column() { + HeadComponent({ headName: $r('app.string.trustedEvidence') }) + Column() { + Tabs({ barPosition: BarPosition.Start, index: 0, controller: this.controller }) { + TabContent() { + List() { + ForEach(this.mShowSysCaPresenter.certList, (item, index) => { + ListItem() { + ComponentSystem({ certAlias: item.certAlias, subjectName: item.SubjectNameCN, Status: item.status, + Uri: item.uri, setStatus: $mShowSysCaPresenter, Index: index }) + } + }, item => JSON.stringify(item)) + } + .margin({ + left: $r("app.float.wh_value_12"), + right: $r("app.float.wh_value_12") + }) + .padding({ + left: $r("app.float.wh_value_12"), + top: $r("app.float.wh_value_4"), + bottom: $r("app.float.wh_value_4") + }) + .divider({ + strokeWidth: $r("app.float.sys_list_divider_strokeWidth_value"), + color: $r("app.color.sys_list_divider_color_000000"), + endMargin: '12vp' + }) + .borderRadius($r("sys.float.ohos_id_corner_radius_default_l")) + .backgroundColor($r("app.color.sys_list_backgroundColor_FFFFFF")) + .visibility(this.mShowSysCaPresenter.certList.length > 0 ? Visibility.Visible : Visibility.None); + } + .tabBar(this.TabBuilder(0)) + .onTouch((event: TouchEvent) => { + if (event.type === TouchType.Down) { + this.isTouched = true; + } + if (event.type === TouchType.Up) { + this.isTouched = false; + } + }); + + TabContent() { + List() { + ForEach(this.mShowUserCaPresenter.certList, (item, index) => { + ListItem() { + ComponentUser({ certAlias: item.certAlias, subjectName: item.SubjectNameCN, Uri: item.uri, + setStatus: $mShowUserCaPresenter, Index: index }) + } + }, item => JSON.stringify(item)) + } + .margin({ + left: $r("app.float.wh_value_12"), + right: $r("app.float.wh_value_12") + }) + .padding({ + left: $r("app.float.wh_value_12"), + right: $r("app.float.wh_value_8"), + top: $r("app.float.wh_value_4"), + bottom: $r("app.float.wh_value_4") + }) + .divider({ + strokeWidth: $r("app.float.user_list_divider_strokeWidth_value"), + color: $r("app.color.user_list_divider_color_000000"), + endMargin: '3vp' + }) + .borderRadius($r("app.float.user_list_divider_borderRadius_value")) + .backgroundColor($r("app.color.user_list_backgroundColor_FFFFFF")) + .visibility(this.mShowUserCaPresenter.certList.length > 0 ? Visibility.Visible : Visibility.None) + } + .tabBar(this.TabBuilder(1)) + .onTouch((event: TouchEvent) => { + if (event.type === TouchType.Down) { + this.isTouched = true; + } + if (event.type === TouchType.Up) { + this.isTouched = false; + } + }); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .barWidth($r("app.float.tabs_barWidth_value")) + .barHeight($r("app.float.tabs_barHeight_value")) + .animationDuration(400) + .width(ConfigData.WH_100_100) + .backgroundColor($r("app.color.TrustedEvidence_tabs_backgroundColor_F1F3F5")) + .onChange((index: number) => { + this.currentIndex = index + }); + } + .height(ConfigData.WH_94_100) + .width(ConfigData.WH_100_100); + } + .backgroundColor($r("sys.color.ohos_id_color_sub_background")) + .width(ConfigData.WH_100_100) + .height(ConfigData.WH_100_100) + .useSizeType({ + xs: { span: 12, offset: 0 }, sm: { span: 12, offset: 0 }, + md: { span: 12, offset: 0 }, lg: { span: 8, offset: 2 } + }); + + Column() { + } + .width(ConfigData.WH_100_100) + .height(ConfigData.WH_100_100) + .useSizeType({ + xs: { span: 0, offset: 12 }, sm: { span: 0, offset: 12 }, + md: { span: 0, offset: 12 }, lg: { span: 2, offset: 10 } + }); + } + .width(ConfigData.WH_100_100) + .height(ConfigData.WH_100_100); + } + .width(ConfigData.WH_100_100) + .height(ConfigData.WH_100_100); + } + .backgroundColor($r("sys.color.ohos_id_color_sub_background")) + .width(ConfigData.WH_100_100) + .height(ConfigData.WH_100_100); + } +} diff --git a/CertificateManager/product/phone/src/main/ets/presenter/CMAppCredAuthPresenter.ets b/CertificateManager/product/phone/src/main/ets/presenter/CMAppCredAuthPresenter.ets new file mode 100644 index 0000000..e8b22b8 --- /dev/null +++ b/CertificateManager/product/phone/src/main/ets/presenter/CMAppCredAuthPresenter.ets @@ -0,0 +1,103 @@ +/** + * Copyright (c) 2022 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 certManagerModel from '../model/CertMangerModel'; +import BundleModel from '../model/BundleModel'; +import { CMModelErrorCode, CMModelOptType } from '../model/CertMangerModel'; +import { CredentialAbstractVo } from '../model/CertManagerVo/CredentialAbstractVo'; +import router from '@system.router'; + +const TAG = "CMAppCredAuthPresenter Presenter: "; +const SUCCESS = 0; +const FAIL = -1; + +export default class CMAppCredAuthPresenter { + private static sInstance: CMAppCredAuthPresenter; + optType: CMModelOptType = CMModelOptType.CM_MODEL_OPT_UNKNOWN; + credList: CredentialAbstractVo[] = []; + appName: string = ''; + + public static getInstance(): CMAppCredAuthPresenter { + if (CMAppCredAuthPresenter.sInstance == null) { + CMAppCredAuthPresenter.sInstance = new CMAppCredAuthPresenter(); + } + return CMAppCredAuthPresenter.sInstance; + } + + onAboutToAppear() { + + } + + aboutToDisappear() { + this.optType = CMModelOptType.CM_MODEL_OPT_UNKNOWN; + this.credList = []; + } + + UpdateAppNameFromUid(uid) { + console.log("getAppNameFromUid start uid = " + uid); + BundleModel.getAppInfoList(uid, (errCode, appInfo) => { + console.log("getAppNameFromUid success, appInfo = " + appInfo); + if (!errCode) { + this.appName = appInfo.AppName; + } else { + console.log("getAppNameFromUid fail, uid = " + uid); + } + }) + } + + updateAppCredList() { + certManagerModel.getCertOrCredList(CMModelOptType.CM_MODEL_OPT_APP_CRED, (errCode, credList) => { + if (errCode === CMModelErrorCode.CM_MODEL_ERROR_SUCCESS) { + this.credList = credList; + console.log("updateSystemTrustedCertificateList inin :" + JSON.stringify(credList)); + } else { + console.log("updateSystemTrustedCertificateList fail"); + } + }); + } + + requestAuthorize(uri, appUid) { + console.log(TAG + "requestAuthorize start uri :" + uri + "appUid: " + appUid); + let want = globalThis.abilityWant; + + certManagerModel.setAppAuth(CMModelOptType.CM_MODEL_OPT_APP_CRED, uri, appUid, + true, (errCode, data) => { + router.clear(); + if (errCode === CMModelErrorCode.CM_MODEL_ERROR_SUCCESS) { + console.log("requestAuthorize success data: " + data); + want.parameters.authUri = data; + globalThis.certManagerAbilityContext.terminateSelfWithResult({ + resultCode: SUCCESS, + want: want + }); + } else { + console.log("requestAuthorize fail"); + globalThis.certManagerAbilityContext.terminateSelfWithResult({ + resultCode: FAIL, + want: want + }); + } + }); + } + + cancelProcess() { + console.log("cancelProcess start"); + router.clear(); + globalThis.certManagerAbilityContext.terminateSelfWithResult({ + resultCode: FAIL, + want: globalThis.abilityWant + }); + } +} \ No newline at end of file diff --git a/CertificateManager/product/phone/src/main/ets/presenter/CMFaPresenter.ets b/CertificateManager/product/phone/src/main/ets/presenter/CMFaPresenter.ets new file mode 100644 index 0000000..f218e66 --- /dev/null +++ b/CertificateManager/product/phone/src/main/ets/presenter/CMFaPresenter.ets @@ -0,0 +1,125 @@ +/** + * Copyright (c) 2022 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 '@system.router'; +import certManagerModel from '../model/CertMangerModel' +import FileIoModel from '../model/FileIoModel' +import { CMModelErrorCode, CMModelOptType } from '../model/CertMangerModel' + +const TAG = "CMFaPresenter: "; +const PAGE_URI_PWD_INPUT = 'pages/certPwdInput'; +const PAGE_URI_ALIAS_INPUT = 'pages/certInstallAliasInput'; + +export default class CMFaPresenter { + private static sInstance: CMFaPresenter; + + public static getInstance(): CMFaPresenter { + if (CMFaPresenter.sInstance == null) { + CMFaPresenter.sInstance = new CMFaPresenter(); + } + return CMFaPresenter.sInstance; + } + + onAboutToAppear() { + + } + + aboutToDisappear() { + } + + routeToNext(fileUri: string) { + console.info(TAG + 'routeToNext fileUri: ' + fileUri); + FileIoModel.getMediaFileSuffix(fileUri, (suffix) => { + if (suffix) { + if ((suffix == "cer") || (suffix == "pem")) { + router.push({ + uri: PAGE_URI_ALIAS_INPUT, + params: { + uri: fileUri, + suffix: suffix + } + }); + } else { + router.push({ + uri: PAGE_URI_PWD_INPUT, + params: { + uri: fileUri, + suffix: suffix + } + }); + } + } + }) + } + + requestPermissions() { + let permissionList: Array = [ + "ohos.permission.READ_MEDIA" + ] + globalThis.certManagerAbilityContext.requestPermissionsFromUser(permissionList, (data) => { + console.log("requestPermissions finish"); + this.startInstall(); + }) + } + + startInstall() { + globalThis.certManagerAbilityContext.startAbilityForResult( + { + bundleName: "com.ohos.filepicker", + abilityName: "MainAbility", + parameters: { + 'startMode': 'choose', + } + }, + { + windowMode: 102 + } + ) + .then((data) => { + if (!data.resultCode) { + this.routeToNext(data.want.parameters.result) + } + }) + .catch((error) => { + console.log(TAG + 'start filePicker err: ' + error); + }) + } + + startRequestAuth(uri) { + router.replace({ + uri: "pages/requestAuth", params: { + appUid: uri, + } + }) + } + + uninstallAllCert() { + certManagerModel.delAllCertOrCred(CMModelOptType.CM_MODEL_OPT_USER_CA, (errCode) => { + if (errCode === CMModelErrorCode.CM_MODEL_ERROR_SUCCESS) { + console.log(TAG + 'uninstallAllCert CM_MODEL_OPT_USER_CA success'); + } else { + console.log(TAG + 'uninstallAllCert CM_MODEL_OPT_USER_CA failed'); + } + }); + + certManagerModel.delAllCertOrCred(CMModelOptType.CM_MODEL_OPT_APP_CRED, (errCode) => { + if (errCode === CMModelErrorCode.CM_MODEL_ERROR_SUCCESS) { + console.log(TAG + 'uninstallAllCert CM_MODEL_OPT_APP_CRED success'); + } else { + console.log(TAG + 'uninstallAllCert CM_MODEL_OPT_APP_CRED failed'); + } + }); + } +} \ No newline at end of file diff --git a/CertificateManager/product/phone/src/main/ets/presenter/CMInstallPresenter.ets b/CertificateManager/product/phone/src/main/ets/presenter/CMInstallPresenter.ets new file mode 100644 index 0000000..df71e65 --- /dev/null +++ b/CertificateManager/product/phone/src/main/ets/presenter/CMInstallPresenter.ets @@ -0,0 +1,73 @@ +/** + * Copyright (c) 2022 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 certManagerModel from '../model/CertMangerModel' +import FileIoModel from '../model/FileIoModel' +import { CMModelErrorCode, CMModelOptType } from '../model/CertMangerModel' +import router from '@system.router'; + +const TAG = "CMInstallPresenter: "; + +export default class CMInstallPresenter { + private static sInstance: CMInstallPresenter; + optType: CMModelOptType = CMModelOptType.CM_MODEL_OPT_UNKNOWN; + + public static getInstance(): CMInstallPresenter { + if (CMInstallPresenter.sInstance == null) { + CMInstallPresenter.sInstance = new CMInstallPresenter(); + } + return CMInstallPresenter.sInstance; + } + + onAboutToAppear() { + + } + + aboutToDisappear() { + this.optType = CMModelOptType.CM_MODEL_OPT_UNKNOWN; + } + + updateCertFileType(suffix) { + console.info(TAG + 'updateCertFileType suffix: ' + suffix) + if ((suffix == "cer") || (suffix == "pem")) { + this.optType = CMModelOptType.CM_MODEL_OPT_USER_CA; + } else if ((suffix == "p12") || (suffix == "jks") || (suffix == "pfx")) { + this.optType = CMModelOptType.CM_MODEL_OPT_APP_CRED; + } + } + + getFileDataFromUri(uri, callback) { + FileIoModel.getMediaFileData(uri, (data) => { + callback(data) + }) + + } + + installCert(uri, alias, suffix) { + this.updateCertFileType(suffix); + this.getFileDataFromUri(uri, (data) => { + certManagerModel.installCertOrCred(this.optType, alias, data, globalThis.PwdStore.getCertPwd(), (errCode) => { + console.info(TAG + 'installCertOrCred result: ' + JSON.stringify(errCode)) + globalThis.PwdStore.clearCertPwd(); + if (errCode === CMModelErrorCode.CM_MODEL_ERROR_SUCCESS) { + console.info(TAG + 'installCert success'); + } else { + console.info(TAG + 'installCert failed'); + } + router.replace({ uri: "pages/certManagerFa" }); + }); + }) + } +} \ No newline at end of file diff --git a/CertificateManager/product/phone/src/main/ets/presenter/CMShowAppCredPresenter.ets b/CertificateManager/product/phone/src/main/ets/presenter/CMShowAppCredPresenter.ets new file mode 100644 index 0000000..80f6266 --- /dev/null +++ b/CertificateManager/product/phone/src/main/ets/presenter/CMShowAppCredPresenter.ets @@ -0,0 +1,115 @@ +/** + * Copyright (c) 2022 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 certManagerModel from '../model/CertMangerModel' +import bundleModel from '../model/BundleModel' +import { CMModelErrorCode, CMModelOptType } from '../model/CertMangerModel' +import { CredentialAbstractVo } from '../model/CertManagerVo/CredentialAbstractVo' +import { CredentialVo } from '../model/CertManagerVo/CredentialVo' +import { AppAuthorVo } from '../model/CertManagerVo/AppAuthorVo' + +export default class CMShowAppCredPresenter { + private static sInstance: CMShowAppCredPresenter; + credList: CredentialAbstractVo[] = []; + appInfoList: AppAuthorVo[] = []; + credInfo: CredentialVo = new CredentialVo("", "", "", 0, 0, null); + + public static getInstance(): CMShowAppCredPresenter { + if (CMShowAppCredPresenter.sInstance == null) { + CMShowAppCredPresenter.sInstance = new CMShowAppCredPresenter(); + } + return CMShowAppCredPresenter.sInstance; + } + + aboutToDisappear() { + this.credList = []; + this.credInfo = new CredentialVo("", "", "", 0, 0, null); + this.appInfoList = [] + } + + updateAppCredList() { + certManagerModel.getCertOrCredList(CMModelOptType.CM_MODEL_OPT_APP_CRED, (errCode, credList) => { + if (errCode === CMModelErrorCode.CM_MODEL_ERROR_SUCCESS) { + credList.sort((certAbs, certAbsOther) => { + let certAlias = certAbs.alias + let certAliasOther = certAbsOther.alias + if (certAlias <= certAliasOther) { + return -1 + } else { + return 1 + } + }) + this.credList = credList; + } else { + console.log("updateAppCredList error :" + JSON.stringify(errCode)); + this.credList = [] + } + }); + } + + getAppCred(uri) { + certManagerModel.getCertOrCred(CMModelOptType.CM_MODEL_OPT_APP_CRED, uri, (errCode, credInfo) => { + if (errCode === CMModelErrorCode.CM_MODEL_ERROR_SUCCESS) { + this.credInfo = credInfo + } else { + console.log("getAppCred error :" + JSON.stringify(errCode)); + this.credInfo.clearCredentialVo(); + } + }); + } + + deleteAppCred(uri) { + certManagerModel.deleteCertOrCred(CMModelOptType.CM_MODEL_OPT_APP_CRED, uri, (errCode) => { + if (errCode === CMModelErrorCode.CM_MODEL_ERROR_SUCCESS) { + this.updateAppCredList(); + } else { + console.log("deleteAppCred error :" + JSON.stringify(errCode)); + } + }) + } + + getAuthorizedAppList(uri) { + this.appInfoList = [] + certManagerModel.getAuthAppList(CMModelOptType.CM_MODEL_OPT_APP_CRED, uri, (errCode, appUidList) => { + if (errCode === CMModelErrorCode.CM_MODEL_ERROR_SUCCESS) { + for (let i = 0; i < appUidList.length; i++) { + bundleModel.getAppInfoList(Number(appUidList[i]),(errCode,AppInfo) => { + if (errCode == CMModelErrorCode.CM_MODEL_ERROR_SUCCESS) { + this.appInfoList.push(new AppAuthorVo(AppInfo.AppImage,appUidList[i], String(AppInfo.AppName), true)) + console.log("appInfoList: " + JSON.stringify(this.appInfoList)); + } + }) + } + } else { + console.log("getAuthorizedAppList error :" + JSON.stringify(errCode)); + this.appInfoList = []; + } + }) + } + + removeGrantedAppList(uri) { + for (let i = 0; i < this.appInfoList.length; i++) { + if (!this.appInfoList[i].status) { + certManagerModel.setAppAuth(CMModelOptType.CM_MODEL_OPT_APP_CRED, uri, this.appInfoList[i].uid, false, (errCode) => { + if (errCode === CMModelErrorCode.CM_MODEL_ERROR_SUCCESS) { + console.log("removeGrantedAppList succeed" + JSON.stringify(errCode)); + } else { + console.log("removeGrantedAppList error :" + JSON.stringify(errCode)); + } + }) + } + } + } +} \ No newline at end of file diff --git a/CertificateManager/product/phone/src/main/ets/presenter/CMShowPrivateCredPresenter.ets b/CertificateManager/product/phone/src/main/ets/presenter/CMShowPrivateCredPresenter.ets new file mode 100644 index 0000000..fb0aae0 --- /dev/null +++ b/CertificateManager/product/phone/src/main/ets/presenter/CMShowPrivateCredPresenter.ets @@ -0,0 +1,68 @@ +/** + * Copyright (c) 2022 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 certManagerModel from '../model/CertMangerModel' +import { CMModelErrorCode, CMModelOptType } from '../model/CertMangerModel' +import { CredentialAbstractVo } from '../model/CertManagerVo/CredentialAbstractVo' +import { CredentialVo } from '../model/CertManagerVo/CredentialVo' + +export default class CMShowPrivateCredPresenter { + private static sInstance: CMShowPrivateCredPresenter; + credList: CredentialAbstractVo[] = []; + credInfo: CredentialVo = new CredentialVo("", "", "", 0, 0, null); + + public static getInstance(): CMShowPrivateCredPresenter { + if (CMShowPrivateCredPresenter.sInstance == null) { + CMShowPrivateCredPresenter.sInstance = new CMShowPrivateCredPresenter(); + } + return CMShowPrivateCredPresenter.sInstance; + } + + aboutToDisappear() { + this.credList = []; + this.credInfo = new CredentialVo("", "", "", 0, 0, null); + } + + updatePrivateCredList() { + certManagerModel.getCertOrCredList(CMModelOptType.CM_MODEL_OPT_PRIVATE_CRED, (errCode, credList) => { + if (errCode === CMModelErrorCode.CM_MODEL_ERROR_SUCCESS) { + credList.sort((certAbs, certAbsOther) => { + let certAlias = certAbs.alias + let certAliasOther = certAbsOther.alias + if (certAlias <= certAliasOther) { + return -1 + } else { + return 1 + } + }) + this.credList = credList; + } else { + console.log("updatePrivateCredList error :" + JSON.stringify(errCode)); + this.credList = []; + } + }); + } + + getPrivateCred(uri) { + certManagerModel.getCertOrCred(CMModelOptType.CM_MODEL_OPT_PRIVATE_CRED, uri, (errCode, credInfo) => { + if (errCode === CMModelErrorCode.CM_MODEL_ERROR_SUCCESS) { + this.credInfo = credInfo + } else { + console.log("getPrivateCred error :" + JSON.stringify(errCode)); + this.credInfo.clearCredentialVo(); + } + }); + } +} \ No newline at end of file diff --git a/CertificateManager/product/phone/src/main/ets/presenter/CMShowSysCaPresenter.ets b/CertificateManager/product/phone/src/main/ets/presenter/CMShowSysCaPresenter.ets new file mode 100644 index 0000000..7346572 --- /dev/null +++ b/CertificateManager/product/phone/src/main/ets/presenter/CMShowSysCaPresenter.ets @@ -0,0 +1,88 @@ +/** + * Copyright (c) 2022 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 certManagerModel from '../model/CertMangerModel' +import { CMModelErrorCode, CMModelOptType } from '../model/CertMangerModel' +import { CertAbstractVo } from '../model/CertManagerVo/CertAbstractVo' +import { CertInfoVo } from '../model/CertManagerVo/CertInfoVo' + +const TAG = "CMShowSysCa Presenter: "; + +export default class CMShowSysCaPresenter { + private static sInstance: CMShowSysCaPresenter; + certList: CertAbstractVo[] = []; + certInfo: CertInfoVo = new CertInfoVo("", "", false, "", "", "", "", "", "", null, null, null, null); + + public static getInstance(): CMShowSysCaPresenter { + if (CMShowSysCaPresenter.sInstance == null) { + CMShowSysCaPresenter.sInstance = new CMShowSysCaPresenter(); + } + return CMShowSysCaPresenter.sInstance; + } + + onAboutToAppear() { + this.updateSystemTrustedCertificateList(); + } + + aboutToDisappear() { + this.certList = []; + this.certInfo = new CertInfoVo("", "", false, "", "", "", "", "", "", null, null, null, null); + } + + updateSystemTrustedCertificateList() { + certManagerModel.getCertOrCredList(CMModelOptType.CM_MODEL_OPT_SYSTEM_CA, (errCode, certList) => { + if (errCode === CMModelErrorCode.CM_MODEL_ERROR_SUCCESS) { + certList.sort((certAbs, certAbsOther) => { + let certAlias = certAbs.certAlias + let certAliasOther = certAbsOther.certAlias + if (certAlias <= certAliasOther) { + return -1 + } else { + return 1 + } + }) + this.certList = certList; + console.log("updateSystemTrustedCertificateList inin :" + JSON.stringify(certList)); + } else { + console.info(TAG + 'updateSystemTrustedCertificateList fail,errCode is' + errCode); + this.certList = []; + } + }); + } + + getSystemTrustedCertificate(uri) { + certManagerModel.getCertOrCred(CMModelOptType.CM_MODEL_OPT_SYSTEM_CA, uri, (errCode, certInfo) => { + if (errCode === CMModelErrorCode.CM_MODEL_ERROR_SUCCESS) { + console.info(TAG + 'getSystemTrustedCertificate success,errCode is ' + errCode + ' certInfo is' + + JSON.stringify(certInfo)); + this.certInfo = certInfo; + } else { + console.info(TAG + 'getSystemTrustedCertificate fail,errCode is' + errCode); + this.certInfo.clearCertInfoVo(); + } + }); + } + + setSystemCertificateStatus(uri, status) { + certManagerModel.setCertStatus(CMModelOptType.CM_MODEL_OPT_SYSTEM_CA, uri, status, (errCode) => { + if (errCode === CMModelErrorCode.CM_MODEL_ERROR_SUCCESS) { + console.info(TAG + 'setSystemCertificateStatus success,errCode is' + errCode); + this.updateSystemTrustedCertificateList(); + } else { + console.info(TAG + 'setSystemCertificateStatus fail,errCode is' + errCode); + } + }) + } +} \ No newline at end of file diff --git a/CertificateManager/product/phone/src/main/ets/presenter/CMShowUserCaPresenter.ets b/CertificateManager/product/phone/src/main/ets/presenter/CMShowUserCaPresenter.ets new file mode 100644 index 0000000..eb34040 --- /dev/null +++ b/CertificateManager/product/phone/src/main/ets/presenter/CMShowUserCaPresenter.ets @@ -0,0 +1,97 @@ +/** + * Copyright (c) 2022 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 certManagerModel from '../model/CertMangerModel' +import { CMModelErrorCode, CMModelOptType } from '../model/CertMangerModel' +import { CertAbstractVo } from '../model/CertManagerVo/CertAbstractVo' +import { CertInfoVo } from '../model/CertManagerVo/CertInfoVo' + +const TAG = "CMFaShowUserCa Presenter: "; + +export default class CMShowUserCaPresenter { + private static sInstance: CMShowUserCaPresenter; + certList: CertAbstractVo[] = []; + certInfo: CertInfoVo = new CertInfoVo("", "", false, "", "", "", "", "", "", null, null, null, null); + + public static getInstance(): CMShowUserCaPresenter { + if (CMShowUserCaPresenter.sInstance == null) { + CMShowUserCaPresenter.sInstance = new CMShowUserCaPresenter(); + } + return CMShowUserCaPresenter.sInstance; + } + + onAboutToAppear() { + + } + + aboutToDisappear() { + this.certList = []; + this.certInfo = new CertInfoVo("", "", false, "", "", "", "", "", "", null, null, null, null); + } + + updateUserTrustedCertificateList() { + certManagerModel.getCertOrCredList(CMModelOptType.CM_MODEL_OPT_USER_CA, (errCode, certList) => { + if (errCode === CMModelErrorCode.CM_MODEL_ERROR_SUCCESS) { + certList.sort((certAbs, certAbsOther) => { + let certAlias = certAbs.certAlias + let certAliasOther = certAbsOther.certAlias + if (certAlias <= certAliasOther) { + return -1 + } else { + return 1 + } + }) + this.certList = certList; + console.log("updateUserTrustedCertificateList inin :" + JSON.stringify(certList)); + } else { + console.info(TAG + 'updateUserTrustedCertificateList fail,errCode is ' + errCode); + this.certList = []; + } + }); + } + + getUserTrustedCertificate(uri) { + certManagerModel.getCertOrCred(CMModelOptType.CM_MODEL_OPT_USER_CA, uri, (errCode, certInfo) => { + if (errCode === CMModelErrorCode.CM_MODEL_ERROR_SUCCESS) { + console.info(TAG + 'getUserTrustedCertificate success, errCode is ' + errCode + ' certInfo is' + + JSON.stringify(certInfo)); + this.certInfo = certInfo; + } else { + console.info(TAG + 'getUserTrustedCertificate fail, errCode is ' + errCode); + this.certInfo.clearCertInfoVo(); + } + }); + } + + setUserCertificateStatus(uri, status) { + certManagerModel.setCertStatus(CMModelOptType.CM_MODEL_OPT_USER_CA, uri, status, (errCode) => { + if (errCode === CMModelErrorCode.CM_MODEL_ERROR_SUCCESS) { + this.getUserTrustedCertificate(uri); + } else { + console.info(TAG + 'setUserCertificateStatus fail,errCode is ' + errCode) + } + }) + } + + deleteUserCertificate(uri) { + certManagerModel.deleteCertOrCred(CMModelOptType.CM_MODEL_OPT_USER_CA, uri, (errCode) => { + if (errCode === CMModelErrorCode.CM_MODEL_ERROR_SUCCESS) { + this.updateUserTrustedCertificateList(); + } else { + console.info(TAG + 'deleteUserCertificate fail,errCode is ' + errCode); + } + }) + } +} \ No newline at end of file diff --git a/CertificateManager/product/phone/src/main/ets/stub/certStubPromise.ts b/CertificateManager/product/phone/src/main/ets/stub/certStubPromise.ts new file mode 100644 index 0000000..3834a70 --- /dev/null +++ b/CertificateManager/product/phone/src/main/ets/stub/certStubPromise.ts @@ -0,0 +1,652 @@ +/** + * Copyright (c) 2022 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 { CMResult, BusinessError, CMErrorCode, CMBlob, CMSignatureSpec, CertManagerStore } from './certStubStruct'; +import certStubUtil from './certStubUtil'; +import fileio from '@ohos.fileio'; + +var certUtil = new certStubUtil(); +const TAG = "CertManager Stub: "; +const certNum = 10 +const keyNum = 20 +const authorListA = ["20010027", "20010026", "10003", "20010013","20010033"] +const authorListB = ["20010033", "10003", "20010027"] +const authorListC = ["20010032", "20010013", "20010026", "10003"] + +export class CertStubPromise { + exceptFlag = 0; + uriBase = "uri://stub/certFile/" + type = "CM_URI_TYPE_APP_KEY" + uriCount = 0; + systemCertMap = new Map(); + userCertMap = new Map(); + uriToAlias = new Map(); + appCredMap = new Map(); + privateCredMap = new Map(); + uriToAppList = new Map(); + + constructor() { + let newCert; + + console.log(TAG + "getSystemTrustedCertificateList stub constructor start"); + newCert = certUtil.parseCertInfo(this.uriBase + this.uriCount.toString(), + "SystemRoot_1", true, new Uint8Array([0, 1, 2, 42, 100, 101, 102, 255])); + this.systemCertMap.set(this.uriBase + this.uriCount.toString(), newCert); + this.uriCount++; + + newCert = certUtil.parseCertInfo(this.uriBase + this.uriCount.toString(), + "SystemRoot_2", false, new Uint8Array([64, 1, 2, 42, 100, 123, 321, 255])); + this.systemCertMap.set(this.uriBase + this.uriCount.toString(), newCert); + this.uriCount++; + + newCert = certUtil.parseCertInfo(this.uriBase + this.uriCount.toString(), + "SystemRoot_3", true, new Uint8Array([54, 1, 123, 42, 100, 101, 102, 23])); + this.systemCertMap.set(this.uriBase + this.uriCount.toString(), newCert); + this.uriCount++; + + newCert = certUtil.parseCertInfo(this.uriBase + this.uriCount.toString(), + "UserRoot_1", true, new Uint8Array([0, 1, 2, 42, 100, 101, 102, 255])); + this.userCertMap.set("UserRoot_1", newCert); + this.uriToAlias.set(this.uriBase + this.uriCount.toString(), "UserRoot_1") + this.uriCount++; + + newCert = certUtil.parseCertInfo(this.uriBase + this.uriCount.toString(), + "UserRoot_2", false, new Uint8Array([0, 1, 2, 42, 100, 101, 102, 255])); + this.userCertMap.set("UserRoot_2", newCert); + this.uriToAlias.set(this.uriBase + this.uriCount.toString(), "UserRoot_2") + this.uriCount++; + + newCert = certUtil.parseCertInfo(this.uriBase + this.uriCount.toString(), + "UserRoot_3", true, new Uint8Array([0, 1, 2, 42, 100, 101, 102, 255])); + this.userCertMap.set("UserRoot_3", newCert); + this.uriToAlias.set(this.uriBase + this.uriCount.toString(), "UserRoot_3") + this.uriCount++; + + newCert = certUtil.parseCredential(this.type, "TheEncryptionForCCMPV1", this.uriBase + this.uriCount.toString(), certNum, keyNum, + new Uint8Array([25, 5, 34, 45, 64, 78, 7, 8])); + this.appCredMap.set("ApptemRoot_1", newCert); + this.uriToAlias.set(this.uriBase + this.uriCount.toString(), "ApptemRoot_1") + this.uriToAppList.set(this.uriBase + this.uriCount.toString(), authorListA) + this.uriCount++; + + newCert = certUtil.parseCredential(this.type, "TheEncryptionForCCMPV2", this.uriBase + this.uriCount.toString(), certNum, keyNum, + new Uint8Array([23, 1, 43, 42, 78, 90, 56, 12])); + this.appCredMap.set("ApptemRoot_2", newCert); + this.uriToAppList.set(this.uriBase + this.uriCount.toString(), authorListB) + this.uriToAlias.set(this.uriBase + this.uriCount.toString(), "ApptemRoot_2") + this.uriCount++; + + newCert = certUtil.parseCredential(this.type, "TheEncryptionForCCMPV3", this.uriBase + this.uriCount.toString(), certNum, keyNum, + new Uint8Array([21, 1, 32, 645, 100, 101, 102, 23])); + this.appCredMap.set("ApptemRoot_3", newCert); + this.uriToAppList.set(this.uriBase + this.uriCount.toString(), authorListC) + this.uriToAlias.set(this.uriBase + this.uriCount.toString(), "ApptemRoot_3") + this.uriCount++; + + newCert = certUtil.parseCredential(this.type, "Employee_WPA_EAPIEA", this.uriBase + this.uriCount.toString(), certNum, keyNum, + new Uint8Array([32, 41, 54, 67, 77, 98, 91, 123])); + this.privateCredMap.set("PrivatetemRoot_1", newCert); + this.uriToAlias.set(this.uriBase + this.uriCount.toString(), "PrivatetemRoot_1") + this.uriCount++; + + newCert = certUtil.parseCredential(this.type, "Employee_WPA_EAPIEB", this.uriBase + this.uriCount.toString(), certNum, keyNum, + new Uint8Array([34, 65, 67, 68, 33, 77, 14, 18])); + this.privateCredMap.set("PrivatetemRoot_2", newCert); + this.uriToAlias.set(this.uriBase + this.uriCount.toString(), "PrivatetemRoot_2") + this.uriCount++; + + newCert = certUtil.parseCredential(this.type, "Employee_WPA_EAPIEC", this.uriBase + this.uriCount.toString(), certNum, keyNum, + new Uint8Array([12, 3, 54, 76, 8, 123, 43, 55])); + this.privateCredMap.set("PrivatetemRoot_3", newCert); + this.uriToAlias.set(this.uriBase + this.uriCount.toString(), "PrivatetemRoot_3") + this.uriCount++; + } + + getSystemTrustedCertificateList() { + return new Promise((resolve, reject) => { + let error: BusinessError; + let data: CMResult; + let certList = new Array(); + + if (!this.exceptFlag) { + console.log(TAG + "getSystemTrustedCertificateList stub start"); + this.systemCertMap.forEach((data, keyUri) => { + certList.push(this.systemCertMap.get(keyUri)) + }) + data = { + certList: certList + }; + resolve(data); + } else { + error = { + code: CMErrorCode.CMR_FAILURE, + }; + reject(error); + } + }) + } + + getSystemTrustedCertificate(certUri: string) { + return new Promise((resolve, reject) => { + let data: CMResult; + let error: BusinessError; + + if (this.systemCertMap.has(certUri)) { + data = { + certInfo: this.systemCertMap.get(certUri) + }; + resolve(data); + } else { + error = { + code: CMErrorCode.CMR_ERROR_NOT_EXIST, + }; + reject(error); + } + }) + } + + setCertificateStatus(certUri: string, store: number, status: boolean) { + return new Promise((resolve, reject) => { + let error: BusinessError; + let alias; + + if ((!this.systemCertMap.has(certUri)) && + (!this.uriToAlias.has(certUri))) { + error = { + code: CMErrorCode.CMR_ERROR_NOT_EXIST, + }; + reject(error); + } + + if (store == CertManagerStore.CERT_MANAGER_SYSTEM_TRUSTED_STORE) { + this.systemCertMap.get(certUri).status = status; + resolve(); + } else if (store == CertManagerStore.CERT_MANAGER_USER_TRUSTED_STORE) { + alias = this.uriToAlias.get(certUri); + this.userCertMap.get(alias).status = status; + resolve(); + } else { + error = { + code: CMErrorCode.CMR_ERROR_NOT_SUPPORTED, + }; + reject(error); + } + }) + } + + installUserTrustedCertificate(certificate: CMBlob) { + return new Promise((resolve, reject) => { + let newCert = certUtil.parseCertInfo(this.uriBase + this.uriCount.toString(), + certificate.alias, true, certificate.inData); + this.userCertMap.set(certificate.alias, newCert); + this.uriToAlias.set(this.uriBase + this.uriCount.toString(), certificate.alias) + this.uriCount++; + + resolve(); + }) + } + + uninstallAllUserTrustedCertificate() { + return new Promise((resolve, reject) => { + console.log(TAG + "uninstallAllUserTrustedCertificate stub in"); + this.userCertMap.clear(); + this.uriToAlias.clear(); + resolve(); + }) + } + + uninstallUserTrustedCertificate(certUri: string) { + return new Promise((resolve, reject) => { + let error: BusinessError; + let alias; + + if (!this.uriToAlias.has(certUri)) { + error = { + code: CMErrorCode.CMR_ERROR_NOT_EXIST, + }; + reject(error); + } + + alias = this.uriToAlias.get(certUri); + this.uriToAlias.delete(certUri); + this.userCertMap.delete(alias); + resolve(); + }) + } + + getUserTrustedCertificateList() { + return new Promise((resolve, reject) => { + let error: BusinessError; + let data: CMResult; + let certList = new Array(); + + if (!this.exceptFlag) { + this.userCertMap.forEach((data, keyAlias) => { + certList.push(this.userCertMap.get(keyAlias)) + }) + + data = { + certList: certList + }; + resolve(data); + } else { + error = { + code: CMErrorCode.CMR_FAILURE, + }; + reject(error); + } + }) + } + + getUserTrustedCertificate(certUri: string) { + return new Promise((resolve, reject) => { + let data: CMResult; + let error: BusinessError; + + if (this.uriToAlias.has(certUri)) { + let alias = this.uriToAlias.get(certUri); + data = { + certInfo: this.userCertMap.get(alias) + }; + resolve(data); + } else { + error = { + code: CMErrorCode.CMR_ERROR_NOT_EXIST, + }; + reject(error); + } + }) + } + + installAppCertificate(keystore: Uint8Array, keystorePwd: string, certAlias: string) { + return new Promise((resolve, reject) => { + let newCred = certUtil.parseCredential(this.type, certAlias, this.uriBase + this.uriCount.toString(), + certNum, keyNum, keystore); + this.appCredMap.set(certAlias, newCred); + this.uriToAlias.set(this.uriBase + this.uriCount.toString(), certAlias) + this.uriCount++; + + resolve(); + }) + } + + installPrivateCertificate(keystore: Uint8Array, keystorePwd: string, certAlias: string) { + return new Promise((resolve, reject) => { + let newCred = certUtil.parseCredential("privateCred", certAlias, this.uriBase + this.uriCount.toString(), + 1, 1, keystore); + this.privateCredMap.set(certAlias, newCred); + this.uriToAlias.set(this.uriBase + this.uriCount.toString(), certAlias); + this.uriCount++; + + resolve(); + }) + } + + uninstallAllAppCertificate() { + return new Promise((resolve, reject) => { + console.log(TAG + "uninstallAllAppCertificate stub in"); + this.appCredMap.clear(); + this.privateCredMap.clear(); + + resolve(); + }) + } + + uninstallAppCertificate(keyUri: string) { + return new Promise((resolve, reject) => { + let alias; + let error: BusinessError; + + if (!this.uriToAlias.has(keyUri)) { + error = { + code: CMErrorCode.CMR_ERROR_NOT_EXIST, + }; + reject(error); + } + + alias = this.uriToAlias.get(keyUri); + this.uriToAlias.delete(keyUri); + this.appCredMap.delete(alias); + + resolve(); + }) + } + + uninstallPrivateCertificate(keyUri) { + return new Promise((resolve, reject) => { + let alias; + let error: BusinessError; + + if (!this.uriToAlias.has(keyUri)) { + error = { + code: CMErrorCode.CMR_ERROR_NOT_EXIST, + }; + reject(error); + } + + alias = this.uriToAlias.get(keyUri); + this.uriToAlias.delete(keyUri); + this.privateCredMap.delete(alias); + + resolve(); + }) + } + + getAppCertificateList() { + return new Promise((resolve, reject) => { + let error: BusinessError; + let data: CMResult; + let credList = new Array(); + + if (!this.exceptFlag) { + this.appCredMap.forEach((data, keyAlias) => { + credList.push(this.appCredMap.get(keyAlias)) + }) + + data = { + credentialList: credList + }; + resolve(data); + } else { + error = { + code: CMErrorCode.CMR_FAILURE, + }; + reject(error); + } + }) + } + + getPrivateCertificateList() { + return new Promise((resolve, reject) => { + let error: BusinessError; + let data: CMResult; + let credList = new Array(); + + if (!this.exceptFlag) { + this.privateCredMap.forEach((data, keyAlias) => { + credList.push(this.privateCredMap.get(keyAlias)) + }) + + data = { + credentialList: credList + }; + resolve(data); + } else { + error = { + code: CMErrorCode.CMR_FAILURE, + }; + reject(error); + } + }) + } + + getAppCertificate(keyUri: string) { + return new Promise((resolve, reject) => { + let data: CMResult; + let error: BusinessError; + + if (this.uriToAlias.has(keyUri)) { + let alias = this.uriToAlias.get(keyUri); + data = { + credential: this.appCredMap.get(alias) + }; + resolve(data); + } else { + error = { + code: CMErrorCode.CMR_ERROR_NOT_EXIST, + }; + reject(error); + } + }) + } + + getPrivateCertificate(keyUri: string) { + return new Promise((resolve, reject) => { + let data: CMResult; + let error: BusinessError; + + if (this.uriToAlias.has(keyUri)) { + let alias = this.uriToAlias.get(keyUri); + data = { + credential: this.privateCredMap.get(alias) + }; + resolve(data); + } else { + error = { + code: CMErrorCode.CMR_ERROR_NOT_EXIST, + }; + reject(error); + } + }) + } + + grantAppCertificate(keyUri: string, clientAppUid: string) { + return new Promise((resolve, reject) => { + let appList: Array; + let data: CMResult; + let error: BusinessError; + + console.log(TAG + "grantAppCertificate stub uri: " + keyUri + " clientAppUid: " + clientAppUid); + if (!this.uriToAlias.has(keyUri)) { + error = { + code: CMErrorCode.CMR_ERROR_NOT_EXIST, + }; + reject(error); + } + + if (this.uriToAppList.has(keyUri)) { + appList = this.uriToAppList.get(keyUri); + } else { + appList = new Array(); + } + + appList.push(clientAppUid); + this.uriToAppList.set(keyUri, appList) + data = { + authUri: "authUri-value" + }; + console.log(TAG + "grantAppCertificate stub uriToAppList: " + JSON.stringify(appList)); + + resolve(data); + }) + } + + isAuthorizedApp(keyUri: string) { + return new Promise((resolve, reject) => { + let data: CMResult; + data = { + isAuth: false + }; + resolve(data); + }) + } + + getAuthorizedAppList(keyUri: string) { + return new Promise((resolve, reject) => { + let data: CMResult; + let appList: Array; + + if ((!this.uriToAlias.has(keyUri)) || (!this.uriToAppList.has(keyUri))) { + data = { + appUidList: appList, + }; + resolve(data); + } + + appList = this.uriToAppList.get(keyUri); + + data = { + appUidList: appList + }; + resolve(data); + }) + } + + removeGrantedAppCertificate(keyUri: string, clientAppUid: string) { + return new Promise((resolve, reject) => { + let appList: Array; + + if ((!this.uriToAlias.has(keyUri)) || (!this.uriToAppList.has(keyUri))) { + let error = { + code: CMErrorCode.CMR_ERROR_NOT_EXIST, + }; + reject(error); + } + + appList = this.uriToAppList.get(keyUri); + if (appList.indexOf(clientAppUid) != -1) { + appList = appList.filter(item => item != clientAppUid); + this.uriToAppList.set(keyUri, appList); + resolve(); + } else { + let error = { + code: CMErrorCode.CMR_ERROR_NOT_EXIST, + }; + reject(error); + } + }) + } + + init(authUri: string, spec: CMSignatureSpec) { + return new Promise((resolve, reject) => { + let errorCode = CMErrorCode.CMR_SUCCESS; + let data: CMResult; + + resolve(); + }) + } + + update(handle: number, data: Uint8Array, token?: Uint8Array) { + return new Promise((resolve, reject) => { + let errorCode = CMErrorCode.CMR_SUCCESS; + let data: CMResult; + + resolve(); + }) + } + + finish(handle: number, signature?: Uint8Array) { + return new Promise((resolve, reject) => { + let errorCode = CMErrorCode.CMR_SUCCESS; + let data: CMResult; + + resolve(); + }) + } + + abort(handle: number) { + return new Promise((resolve, reject) => { + let errorCode = CMErrorCode.CMR_SUCCESS; + let data: CMResult; + + resolve(); + }) + } + + mapToJson(map) { + let obj = Object.create(null); + for (let [k, v] of map) { + obj[k] = v; + } + + return JSON.stringify(obj) + } + + jsonToMap(jsonString) { + console.log(TAG + "jsonToMap start"); + let map = new Map(); + let obj = JSON.parse(jsonString); + + for (let k of Object.keys(obj)) { + map.set(k, obj[k]) + } + return map; + } + + saveAllMaps() { + console.log(TAG + "saveAllMaps start"); + let dataList = [ + this.mapToJson(this.systemCertMap), + this.mapToJson(this.userCertMap), + this.mapToJson(this.uriToAlias), + this.mapToJson(this.appCredMap), + this.mapToJson(this.privateCredMap), + this.mapToJson(this.uriToAppList) + ]; + + let context = globalThis.certManagerAbilityContext; + let path = context.cacheDir; + path += '/certStubData' + try { + fileio.unlinkSync(path); + } catch (err) { + console.log(TAG + "saveAllMaps unlinkSync err: " + err); + } + let fd = fileio.openSync(path, 0o102, 0o666); + fileio.writeSync(fd, JSON.stringify(dataList)); + fileio.closeSync(fd); + console.log(TAG + "saveAllMaps end"); + } + + uint8ArrayToString(fileData) { + var dataString = ""; + for (var i = 0; i < fileData.length; i++) { + dataString += String.fromCharCode(fileData[i]); + } + return dataString + } + + restoreMapsFromJson(json) { + console.log(TAG + "restoreMapsFromJson start Json: " + json); + let dataList = JSON.parse(json); + this.systemCertMap = this.jsonToMap(dataList[0]); + this.userCertMap = this.jsonToMap(dataList[1]); + this.uriToAlias = this.jsonToMap(dataList[2]); + this.appCredMap = this.jsonToMap(dataList[3]); + this.privateCredMap = this.jsonToMap(dataList[4]); + this.uriToAppList = this.jsonToMap(dataList[5]); + console.log(TAG + "restoreMapsFromJson end"); + } + + restoreAllMaps() { + console.log(TAG + "getAllMaps start"); + let context = globalThis.certManagerAbilityContext; + let path = context.cacheDir; + path += '/certStubData' + + try { + let fd = fileio.openSync(path, 0o002, 0o666); + console.log(TAG + "getAllMaps fd: " + fd); + let stat = fileio.fstatSync(fd); + let size = stat.size; + let buf = new ArrayBuffer(size); + + fileio.read(fd, buf, (err, data) => { + if (data) { + this.restoreMapsFromJson(this.uint8ArrayToString(new Uint8Array(data.buffer))); + } + fileio.closeSync(fd); + }); + } catch(err) { + console.log(TAG + "getAllMaps err: " + err); + } + + console.log(TAG + "getAllMaps end"); + } +} + +let certStub = new CertStubPromise(); + +export default certStub as CertStubPromise; \ No newline at end of file diff --git a/CertificateManager/product/phone/src/main/ets/stub/certStubStruct.ts b/CertificateManager/product/phone/src/main/ets/stub/certStubStruct.ts new file mode 100644 index 0000000..e5e059f --- /dev/null +++ b/CertificateManager/product/phone/src/main/ets/stub/certStubStruct.ts @@ -0,0 +1,161 @@ +/** + * Copyright (c) 2022 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 interface CertInfo { + uri: string, + certAlias: string, + status: boolean, + issuerName: string, + subjectName: string, + serial: string, + notBefore: string, + notAfter: string, + fingerprintSha256: string, + cert: Uint8Array +} + +export interface certAbstract { + uri: string, + certAlias: string, + status: boolean, + subjectName: string, +} + +export interface CMResult { + certList?: Array, + certInfo?: CertInfo, + credentialList?:Array, + credential?: Credential, + appUidList?: Array + authUri?: string, + outData?: Uint8Array, + isAuth?: boolean +} + +export interface CMHandle { + errorCode: number, + handle: number; + token?: Uint8Array; +} + +export interface Credential { + type: string, + alias: string, + keyUri: string, + certNum: number, + keyNum: number, + credData: Uint8Array +} + +export interface CredentialAbstract { + type: string, + alias: string, + keyUri: string +} + +export interface CMContext { + userId: string, + uid: string, + packageName: string +}; + +export interface CMBlob { + readonly inData?: Uint8Array, + readonly alias?: string +}; + +export interface CMKeyProperties { + type: string; // Type of the key, must be CM_URI_TYPE_APP_KEY or CM_URI_TYPE_WLAN_KEY + alg: string; + size: number; + padding: string; + purpose: string; + digest: string; + authType: string; + authTimeout: string; +}; + +export interface CMSignatureSpec { + alg: string; + padding: string; + digest: string; + authToken: Uint8Array; // required only for user authentication +}; + +export enum CertManagerStore { + CERT_MANAGER_CREDENTIAL_STORE = 0, /* credential certificate store for end entity certificates. */ + CERT_MANAGER_SYSTEM_TRUSTED_STORE = 1, /* read only, updated by system only. */ + CERT_MANAGER_USER_TRUSTED_STORE = 2, /* modifiable by applications and user. */ + CERT_MANAGER_APPLICATION_TRUSTED_STORE = 3, /* application specific trusted certificate store; modifiable by the application only. */ +} + +export enum CMErrorCode { + CMR_SUCCESS = 0, + CMR_FAILURE = -1, + CMR_ERROR_INSTALL_CERTIFICATE = -2, + CMR_ERROR_SET_STATUS = -3, + CMR_ERROR_INVALID_ARGUMENT = -3, + CMR_ERROR_INVALID_STORE = -4, + CMR_ERROR_NOT_SUPPORTED = -5, + CMR_ERROR_UNINSTALL = -6, + CMR_ERROR_NO_PERMISSION = -7, + CMR_ERROR_INSUFFICIENT_DATA = -8, + CMR_ERROR_GET_CERTIRICATE = -9, + CMR_ERROR_STORAGE_FAILURE = -10, + CMR_ERROR_HARDWARE_FAILURE = -11, + CMR_ERROR_ALREADY_EXISTS = -12, + CMR_ERROR_NOT_EXIST = -13, + CMR_ERROR_NULL_POINTER = -14, + CMR_ERROR_FILE_SIZE_FAIL = -15, + CMR_ERROR_READ_FILE_FAIL = -16, + CMR_ERROR_INVALID_PUBLIC_KEY = -17, + CMR_ERROR_INVALID_PRIVATE_KEY = -18, + CMR_ERROR_INVALID_KEY_INFO = -19, + CMR_ERROR_REMOVE_CERTIFICATE_FAIL = -20, + CMR_ERROR_OPEN_FILE_FAIL = -21, + CMR_ERROR_INVALID_KEY_FILE = -22, + CMR_ERROR_IPC_MSG_FAIL = -23, + CMR_ERROR_REQUEST_OVERFLOWS = -24, + CMR_ERROR_PARAM_NOT_EXIST = -25, + CMR_ERROR_CRYPTO_ENGINE_ERROR = -26, + CMR_ERROR_COMMUNICATION_TIMEOUT = -27, + CMR_ERROR_IPC_INIT_FAIL = -28, + CMR_ERROR_IPC_DLOPEN_FAIL = -29, + CMR_ERROR_EFUSE_READ_FAIL = -30, + + CMR_ERROR_CHECK_GET_ALG_FAIL = -100, + CMR_ERROR_CHECK_GET_KEY_SIZE_FAIL = -101, + CMR_ERROR_CHECK_GET_PADDING_FAIL = -102, + CMR_ERROR_INVALID_DIGEST = -117, + + CMR_ERROR_INTERNAL_ERROR = -999, + CMR_ERROR_UNKNOWN_ERROR = -1000, +} + +export interface BusinessError { + /** + * Defines the basic error code. + * @since 6 + */ + code: number; +} + +export interface AsyncCallback { + /** + * Defines the callback data. + * @since 6 + */ + (err: BusinessError, data: T): void; +} \ No newline at end of file diff --git a/CertificateManager/product/phone/src/main/ets/stub/certStubUtil.ts b/CertificateManager/product/phone/src/main/ets/stub/certStubUtil.ts new file mode 100644 index 0000000..a1a07d8 --- /dev/null +++ b/CertificateManager/product/phone/src/main/ets/stub/certStubUtil.ts @@ -0,0 +1,149 @@ +/** + * Copyright (c) 2022 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 { CertInfo, certAbstract, CMResult, CMContext, AsyncCallback, BusinessError, CMHandle, + Credential, CredentialAbstract, CMErrorCode, CMBlob, CMKeyProperties, CMSignatureSpec } from './certStubStruct' + +export default class certStubUtil { + constructor() { + } + +parseCertInfo(uri: string, certAlias: string, status: boolean, cert: Uint8Array): CertInfo { + let certInfo: CertInfo; + + certInfo = { + uri: uri, + certAlias: certAlias, + status: status, + issuerName: "CN=SwissSign Gold CA - G2,OU=,O=SwissSign CA", + subjectName: "CN=SwissSign Gold CA - G2,OU=,O=SwissSign CA", + serial: "BB401C43F55E4FB0", + notBefore: "1979/5/24", + notAfter: "2030/5/24", + fingerprintSha256: "D8:C5:38:8A:B7:30:1B:1B:6E:D4:7A:E6:45:25:3A:6F:9F:1A:27:61", + cert: cert + } + + return certInfo; +} + +parseCertAbstract(uri: string, certAlias: string, status: boolean): certAbstract { + let result: certAbstract; + + result = { + uri: uri, + certAlias: certAlias, + status: status, + subjectName: "CN=SwissSign Gold CA - G2,OU=,O=SwissSign", + } + + return result; +} + + +parseCMHandle(errorCode: number, handle: number, token: Uint8Array): CMHandle { + let result: CMHandle; + + result = { + errorCode: errorCode, + handle: handle, + token: token, + } + + return result; +} + +parseCredential(type: string, alias: string, keyUri: string, certNum: number, + keyNum: number, credData: Uint8Array): Credential { + let result: Credential; + + result = { + type: type, + alias: alias, + keyUri: keyUri, + certNum: certNum, + keyNum: keyNum, + credData: credData + } + + return result; +} + +parseCredentialAbstract(type: string, alias: string, keyUri: string): CredentialAbstract { + let result: CredentialAbstract; + + result = { + type: type, + alias: alias, + keyUri: keyUri + } + + return result; +} + +parseCMContext(userId: string, uid: string, packageName: string): CMContext { + let result: CMContext; + + result = { + userId: userId, + uid: uid, + packageName: packageName + } + + return result; +} + +parseCMBlob(inData: Uint8Array, alias: string): CMBlob { + let result: CMBlob; + + result = { + inData: inData, + alias: alias + } + + return result; +} + +parseCMKeyProperties(): CMKeyProperties { + let result: CMKeyProperties; + + result = { + type: "CM_URI_TYPE_APP_KEY", // Type of the key, must be CM_URI_TYPE_APP_KEY or CM_URI_TYPE_WLAN_KEY + alg: "alg", + size: 375, + padding: "padding purpose", + purpose: "purpose property", + digest: "digest property", + authType: "Sha-256", + authTimeout: "30" + } + + return result; +} + +parseCMSignatureSpec(alg: string, padding: string, digest: string, authToken: Uint8Array): CMSignatureSpec { + let result: CMSignatureSpec; + + result = { + alg: alg, + padding: padding, + digest: digest, + authToken: authToken // required only for user authentication + } + + return result; +} + +} \ No newline at end of file diff --git a/CertificateManager/product/phone/src/main/module.json5 b/CertificateManager/product/phone/src/main/module.json5 new file mode 100644 index 0000000..ab8d71a --- /dev/null +++ b/CertificateManager/product/phone/src/main/module.json5 @@ -0,0 +1,50 @@ +/** + * Copyright (c) 2022 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. + */ +{ + "module": { + "name": "phone", + "type": "feature", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:mainability_description", + "mainElement": "MainAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "uiSyntax": "ets", + "abilities": [ + { + "name": "MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:mainability_description", + "icon": "$media:icon", + "label": "$string:entry_MainAbility", + "visible": true, + "launchType": "singleton" + } + ], + "requestPermissions": [ + { + "name": "ohos.permission.GET_BUNDLE_INFO" + }, + { + "name": "ohos.permission.READ_MEDIA", + "reason": "$string:read_media_permission_reason" + } + ] + } +} \ No newline at end of file diff --git a/CertificateManager/product/phone/src/main/resources/base/element/color.json b/CertificateManager/product/phone/src/main/resources/base/element/color.json new file mode 100644 index 0000000..2cb0964 --- /dev/null +++ b/CertificateManager/product/phone/src/main/resources/base/element/color.json @@ -0,0 +1,272 @@ +{ + "color": [ + { + "name": "color_333333_grey", + "value": "#333333" + }, + { + "name": "color_666666_grey", + "value": "#666666" + }, + { + "name": "color_999999_grey", + "value": "#999999" + }, + { + "name": "color_E3E3E3_grey", + "value": "#E3E3E3" + }, + { + "name": "color_D8D8D8_grey", + "value": "#D8D8D8" + }, + { + "name": "color_button_grey", + "value": "#1824310D" + }, + { + "name": "color_00000000_transparent", + "value": "#00000000" + }, + { + "name": "volume_bg_color", + "value": "#CCFFFFFF" + }, + { + "name": "white_bg_color", + "value": "#FFFFFF" + }, + { + "name": "font_color_182431", + "value": "#182431" + }, + { + "name": "font_color_007DFF", + "value": "#007DFF" + }, + { + "name": "search_no_result_text_color", + "value": "$color:font_color_182431" + }, + { + "name": "search_result_text_color", + "value": "$color:font_color_182431" + }, + { + "name": "search_result_text_color_highlight", + "value": "$color:font_color_007DFF" + }, + { + "name": "bluetooth_text_color_highlight", + "value": "$color:font_color_007DFF" + }, + { + "name": "FAFAFA", + "value": "#FAFAFA" + }, + { + "name": "DCEAF9", + "value": "#DCEAF9" + }, + { + "name": "4C89F0", + "value": "#4C89F0" + }, + { + "name": "D1D0DB", + "value": "#D1D0DB" + }, + { + "name": "cm_del_all_font_color", + "value": "#007DFF" + }, + { + "name": "cm_del_all_cancel_button_color", + "value": "#007DFF" + }, + { + "name": "cm_del_all_delete_button_color", + "value": "#FA2A2D" + }, + { + "name": "request_auth_font_color", + "value": "#182431" + }, + { + "name": "request_auth_background_color", + "value": "#FFFFFF" + }, + { + "name": "request_auth_bt_font_color", + "value": "#4C89F0" + }, + { + "name": "request_auth_color", + "value": "#E5E5E5" + }, + { + "name": "install_cancel_bt_font_color", + "value": "#007DFF" + }, + { + "name": "install_cancel_bt_bg_color", + "value": "#0d182431" + }, + { + "name": "install_confirm_bt_font_color", + "value": "#ffffffff" + }, + { + "name": "install_confirm_bt_bg_color", + "value": "#007DFF" + }, + { + "name": "install_confirm_bt_bg_disable_color", + "value": "#66007DFF" + }, + { + "name": "install_info_font_color", + "value": "#E6000000" + }, + { + "name": "credentials_app_name_color", + "value": "#182431" + }, + { + "name": "credentials_app_Toggle_selectColor", + "value": "#007DFF" + }, + { + "name": "credentials_app_title_color", + "value": "#182431" + }, + { + "name": "credentials_app_list_backgroundColor", + "value": "#FFFFFF" + }, + { + "name": "credentials_app_finishColor", + "value": "#4C89F0" + }, + { + "name": "credentials_app_finish_backgroundColor", + "value": "#FFFFFF" + }, + { + "name": "credentials_detail_keyNum_fontColor", + "value": "#000000" + }, + { + "name": "credentials_detail_close_fontColor", + "value": "#4C89F0" + }, + { + "name": "warning_delete_fontColor", + "value": "#FF0000" + }, + { + "name": "public_delete_fontColor", + "value": "#CD5C5C" + }, + { + "name": "evidenceList_TabBuilder_fontColor_182431", + "value": "#182431" + }, + { + "name": "Evidence_color", + "value": "#0D000000" + }, + { + "name": "Evidence_backgroundColor", + "value": "#F1F3F5" + }, + { + "name": "sys_list_divider_color_000000", + "value": "#0D000000" + }, + { + "name": "TrustedEvidence_TabBuilder_fontColor_182431", + "value": "#182431" + }, + { + "name": "sys_list_backgroundColor_FFFFFF", + "value": "#FFFFFF" + }, + { + "name": "user_list_divider_color_000000", + "value": "#0D000000" + }, + { + "name": "user_list_backgroundColor_FFFFFF", + "value": "#FFFFFF" + }, + { + "name": "componentUser_text_fontColor_182431", + "value": "#182431" + }, + { + "name": "ComponentSystem_text_fontColor_182431", + "value": "#182431" + }, + { + "name": "ComponentSystem_Toggle_selectedColor_007DFF", + "value": "#007DFF" + }, + { + "name": "CustomDialogExample_text_fontColor_182431", + "value": "#182431" + }, + { + "name": "CustomDialogExample_list_backgroundColor_FFFFFF", + "value": "#FFFFFF" + }, + { + "name": "CustomDialogExample_Button_backgroundColor_FFFFFF", + "value": "#FFFFFF" + }, + { + "name": "CustomDialogExample_Button_fontColor_4C89F0", + "value": "#4C89F0" + }, + { + "name": "CustomDialogExampleUser_text_fontColor_182431", + "value": "#182431" + }, + { + "name": "CustomDialogExampleUser_Flex_Toggle_selectedColor_007DFF", + "value": "#007DFF" + }, + { + "name": "CustomDialogExampleUser_Flex_firButton_backgroundColor_FFFFFF", + "value": "#FFFFFF" + }, + { + "name": "CustomDialogExampleUser_Flex_firButton_fontColor_4C89F0", + "value": "#4C89F0" + }, + { + "name": "CustomDialogExampleUser_warning_secButton_fontColor_FF0000", + "value": "#FF0000" + }, + { + "name": "CustomDialogExampleUser_Flex_secButton_backgroundColor_FFFFFF", + "value": "#FFFFFF" + }, + { + "name": "CustomDialogExampleUser_Flex_secButton_fontColor_FF0000", + "value": "#FF0000" + }, + { + "name": "DialogSubjectComponent_Text_fontColor_182431", + "value": "#182431" + }, + { + "name": "CertManager_Divider_Color_182431", + "value": "#182431" + }, + { + "name": "TrustedEvidence_tabs_backgroundColor_F1F3F5", + "value": "#F1F3F5" + } + ] +} \ No newline at end of file diff --git a/CertificateManager/product/phone/src/main/resources/base/element/float.json b/CertificateManager/product/phone/src/main/resources/base/element/float.json new file mode 100644 index 0000000..70bc6a4 --- /dev/null +++ b/CertificateManager/product/phone/src/main/resources/base/element/float.json @@ -0,0 +1,1680 @@ +{ + "float": [ + { + "name": "wh_value_0", + "value": "0vp" + }, + { + "name": "wh_value_1", + "value": "1vp" + }, + { + "name": "wh_value_1_5", + "value": "1.5vp" + }, + { + "name": "wh_value_2", + "value": "2vp" + }, + { + "name": "wh_value_3", + "value": "3vp" + }, + { + "name": "wh_value_4", + "value": "4vp" + }, + { + "name": "wh_value_5", + "value": "5vp" + }, + { + "name": "wh_value_6", + "value": "6vp" + }, + { + "name": "wh_value_8", + "value": "8vp" + }, + { + "name": "wh_value_9", + "value": "9vp" + }, + { + "name": "wh_value_10", + "value": "10vp" + }, + { + "name": "wh_value_11", + "value": "11vp" + }, + { + "name": "wh_value_12", + "value": "12vp" + }, + { + "name": "wh_value_13", + "value": "13vp" + }, + { + "name": "wh_value_15", + "value": "15vp" + }, + { + "name": "wh_value_16", + "value": "16vp" + }, + { + "name": "wh_value_18", + "value": "18vp" + }, + { + "name": "wh_value_19", + "value": "19vp" + }, + { + "name": "wh_value_20", + "value": "20vp" + }, + { + "name": "wh_value_21", + "value": "21vp" + }, + { + "name": "wh_value_22", + "value": "22vp" + }, + { + "name": "wh_value_24", + "value": "24vp" + }, + { + "name": "wh_value_26", + "value": "26vp" + }, + { + "name": "wh_value_28", + "value": "28vp" + }, + { + "name": "wh_value_30", + "value": "30vp" + }, + { + "name": "wh_value_32", + "value": "32vp" + }, + { + "name": "wh_value_33", + "value": "33vp" + }, + { + "name": "wh_value_40", + "value": "40vp" + }, + { + "name": "wh_value_44", + "value": "44vp" + }, + { + "name": "wh_value_48", + "value": "48vp" + }, + { + "name": "wh_value_50", + "value": "50vp" + }, + { + "name": "wh_value_52", + "value": "52vp" + }, + { + "name": "wh_value_56", + "value": "56vp" + }, + { + "name": "wh_value_60", + "value": "60vp" + }, + { + "name": "wh_value_64", + "value": "64vp" + }, + { + "name": "wh_value_65", + "value": "65vp" + }, + { + "name": "wh_value_67", + "value": "67vp" + }, + { + "name": "wh_value_70", + "value": "70vp" + }, + { + "name": "wh_value_80", + "value": "80vp" + }, + { + "name": "wh_value_96", + "value": "96vp" + }, + { + "name": "wh_value_100", + "value": "100vp" + }, + { + "name": "wh_value_109", + "value": "109vp" + }, + { + "name": "wh_value_118", + "value": "118vp" + }, + { + "name": "wh_value_119", + "value": "119vp" + }, + { + "name": "wh_value_120", + "value": "120vp" + }, + { + "name": "wh_value_130", + "value": "1300vp" + }, + { + "name": "wh_value_152", + "value": "152vp" + }, + { + "name": "wh_value_160", + "value": "160vp" + }, + { + "name": "wh_value_200", + "value": "200vp" + }, + { + "name": "wh_value_208", + "value": "208vp" + }, + { + "name": "wh_value_210", + "value": "210vp" + }, + { + "name": "wh_value_212", + "value": "212vp" + }, + { + "name": "wh_value_216", + "value": "216vp" + }, + { + "name": "wh_value_230", + "value": "230vp" + }, + { + "name": "wh_value_248", + "value": "248vp" + }, + { + "name": "wh_value_250", + "value": "250vp" + }, + { + "name": "wh_value_263", + "value": "263vp" + }, + { + "name": "wh_value_280", + "value": "280vp" + }, + { + "name": "wh_value_298", + "value": "298vp" + }, + { + "name": "wh_value_336", + "value": "336vp" + }, + { + "name": "wh_value_362", + "value": "362vp" + }, + { + "name": "wh_value_390", + "value": "390vp" + }, + { + "name": "wh_value_400", + "value": "400vp" + }, + { + "name": "wh_value_410", + "value": "410vp" + }, + { + "name": "wh_value_620", + "value": "620vp" + }, + { + "name": "wh_value_720", + "value": "720vp" + }, + { + "name": "font_35", + "value": "35fp" + }, + { + "name": "font_10", + "value": "10fp" + }, + { + "name": "font_12", + "value": "12fp" + }, + { + "name": "font_14", + "value": "14fp" + }, + { + "name": "font_16", + "value": "16fp" + }, + { + "name": "font_17", + "value": "17fp" + }, + { + "name": "font_18", + "value": "18fp" + }, + { + "name": "font_20", + "value": "20fp" + }, + { + "name": "font_21", + "value": "21fp" + }, + { + "name": "font_22", + "value": "22fp" + }, + { + "name": "font_24", + "value": "24fp" + }, + { + "name": "font_28", + "value": "28fp" + }, + { + "name": "font_30", + "value": "30fp" + }, + { + "name": "font_50", + "value": "50fp" + }, + { + "name": "lineHeight_19", + "value": "19vp" + }, + { + "name": "lineHeight_21", + "value": "21vp" + }, + { + "name": "lineHeight_22", + "value": "22vp" + }, + { + "name": "lineHeight_33", + "value": "33vp" + }, + { + "name": "lineHeight_41", + "value": "41vp" + }, + { + "name": "distance_1", + "value": "1vp" + }, + { + "name": "distance_2", + "value": "2vp" + }, + { + "name": "distance_4", + "value": "4vp" + }, + { + "name": "distance_6", + "value": "6vp" + }, + { + "name": "distance_8", + "value": "8vp" + }, + { + "name": "distance_9", + "value": "9vp" + }, + { + "name": "distance_9_5", + "value": "9.5vp" + }, + { + "name": "distance_10", + "value": "10vp" + }, + { + "name": "distance_11", + "value": "11vp" + }, + { + "name": "distance_11_5", + "value": "11.5vp" + }, + { + "name": "distance_12", + "value": "12vp" + }, + { + "name": "distance_13", + "value": "13vp" + }, + { + "name": "distance_14", + "value": "14vp" + }, + { + "name": "distance_15", + "value": "15vp" + }, + { + "name": "distance_16", + "value": "16vp" + }, + { + "name": "distance_17", + "value": "17vp" + }, + { + "name": "distance_18", + "value": "18vp" + }, + { + "name": "distance_19", + "value": "19vp" + }, + { + "name": "distance_19_5", + "value": "19.5vp" + }, + { + "name": "distance_20", + "value": "20vp" + }, + { + "name": "distance_21", + "value": "21vp" + }, + { + "name": "distance_22_5", + "value": "22.5vp" + }, + { + "name": "distance_24", + "value": "24vp" + }, + { + "name": "distance_26", + "value": "26vp" + }, + { + "name": "distance_27_5", + "value": "27.5vp" + }, + { + "name": "distance_30", + "value": "30vp" + }, + { + "name": "distance_32", + "value": "32vp" + }, + { + "name": "distance_36", + "value": "36vp" + }, + { + "name": "distance_48", + "value": "48vp" + }, + { + "name": "distance_64", + "value": "64vp" + }, + { + "name": "distance_66", + "value": "66vp" + }, + { + "name": "distance_80", + "value": "80vp" + }, + { + "name": "distance_96", + "value": "96vp" + }, + { + "name": "sys_corner_radius_clicked", + "value": "8vp" + }, + { + "name": "sys_elements_margin_vertical_l", + "value": "16vp" + }, + { + "name": "sys_elements_margin_vertical_m", + "value": "8vp" + }, + { + "name": "sys_elements_margin_horizontal_l", + "value": "16vp" + }, + { + "name": "sys_elements_margin_horizontal_m", + "value": "16vp" + }, + { + "name": "page_margin_horizontal", + "value": "24vp" + }, + { + "name": "square_click_image_size", + "value": "48vp" + }, + { + "name": "control_common_font_size", + "value": "20fp" + }, + { + "name": "item_common_vertical_margin", + "value": "20vp" + }, + { + "name": "item_common_horizontal_margin", + "value": "24vp" + }, + { + "name": "item_icon_size", + "value": "24vp" + }, + { + "name": "item_arrow_width", + "value": "12vp" + }, + { + "name": "slider_text_padding_left", + "value": "5vp" + }, + { + "name": "page_header_height", + "value": "56vp" + }, + { + "name": "volume_border_radius", + "value": "15vp" + }, + { + "name": "radius_12", + "value": "12vp" + }, + { + "name": "radius_20", + "value": "20vp" + }, + { + "name": "radius_24", + "value": "24vp" + }, + { + "name": "radius_32", + "value": "32vp" + }, + { + "name": "radius_40", + "value": "40vp" + }, + { + "name": "search_placeholder_font", + "value": "22fp" + }, + { + "name": "search_input_height", + "value": "40vp" + }, + { + "name": "search_input_margin_start", + "value": "64vp" + }, + { + "name": "search_input_horizontal_margin", + "value": "8vp" + }, + { + "name": "search_input_border_radius", + "value": "20vp" + }, + { + "name": "search_no_result_image_size", + "value": "160vp" + }, + { + "name": "search_no_result_text_font_size", + "value": "14fp" + }, + { + "name": "search_no_result_margin_top", + "value": "174vp" + }, + { + "name": "search_item_height", + "value": "72vp" + }, + { + "name": "search_result_item_title_font_size", + "value": "16vp" + }, + { + "name": "search_result_item_summary_font_size", + "value": "14fp" + }, + { + "name": "slider_image_width", + "value": "40vp" + }, + { + "name": "slider_image_height", + "value": "40vp" + }, + { + "name": "slider_image_margin", + "value": "15vp" + }, + { + "name": "audio_subtitle_font", + "value": "18fp" + }, + { + "name": "audio_subtitle_margin_left", + "value": "10vp" + }, + { + "name": "audio_subtitle_margin_bottom", + "value": "5vp" + }, + { + "name": "audio_title_summary_margin_left", + "value": "15vp" + }, + { + "name": "audio_summary_subtitle_margin_bottom", + "value": "10vp" + }, + { + "name": "audio_subtitle_margin_top", + "value": "10vp" + }, + { + "name": "audio_sound_mode_outer_height", + "value": "280vp" + }, + { + "name": "audio_sound_mode_inner_padding_top", + "value": "15vp" + }, + { + "name": "audio_sound_mode_inner_padding_bottom", + "value": "15vp" + }, + { + "name": "audio_sound_mode_outer_padding", + "value": "16vp" + }, + { + "name": "audio_sound_mode_item_inner_padding_top", + "value": "5vp" + }, + { + "name": "audio_sound_mode_border_width", + "value": "1vp" + }, + { + "name": "audio_sound_mode_border_radius", + "value": "15vp" + }, + { + "name": "audio_sound_mode_image_size", + "value": "40vp" + }, + { + "name": "audio_sound_mode_text_margin_top", + "value": "16vp" + }, + { + "name": "audio_sound_mode_font_size", + "value": "20fp" + }, + { + "name": "audio_sound_mode_radio_size", + "value": "36vp" + }, + { + "name": "audio_image_common_size", + "value": "50vp" + }, + { + "name": "audio_image_margin_right", + "value": "10vp" + }, + { + "name": "audio_subtitle_font_size", + "value": "18fp" + }, + { + "name": "audio_margin_left", + "value": "15vp" + }, + { + "name": "audio_start_end_margin_left", + "value": "15vp" + }, + { + "name": "audio_icon_height", + "value": "60vp" + }, + { + "name": "audio_no_icon_height", + "value": "70vp" + }, + { + "name": "audio_slider_height", + "value": "250vp" + }, + { + "name": "audio_volume_height", + "value": "280vp" + }, + { + "name": "audio_border_width", + "value": "1vp" + }, + { + "name": "audio_border_radius", + "value": "15vp" + }, + { + "name": "audio_volume_component_padding", + "value": "16vp" + }, + { + "name": "restore_factory_font_size", + "value": "20fp" + }, + { + "name": "restore_factory_button_width", + "value": "186vp" + }, + { + "name": "restore_factory_button_height", + "value": "40vp" + }, + { + "name": "switch_title_subtitle_size", + "value": "20fp" + }, + { + "name": "switch_component_margin", + "value": "12vp" + }, + { + "name": "switch_toggle_width", + "value": "36vp" + }, + { + "name": "switch_toggle_height", + "value": "20vp" + }, + { + "name": "switch_component_height", + "value": "70vp" + }, + { + "name": "application_common_size", + "value": "45vp" + }, + { + "name": "application_button_subtitle_size", + "value": "16fp" + }, + { + "name": "application_button_height", + "value": "40vp" + }, + { + "name": "storage_common_margin", + "value": "15vp" + }, + { + "name": "location_font_size", + "value": "16fp" + }, + { + "name": "location_common_margin", + "value": "15vp" + }, + { + "name": "storage_data_panel_height", + "value": "230vp" + }, + { + "name": "password_list_item_height", + "value": "48vp" + }, + { + "name": "password_list_item_title_font_size", + "value": "16vp" + }, + { + "name": "password_input_message_vertical_margin", + "value": "20vp" + }, + { + "name": "password_count_down_view_vertical_margin", + "value": "20vp" + }, + { + "name": "password_input_button_space", + "value": "10vp" + }, + { + "name": "password_input_button_margin_top", + "value": "40vp" + }, + { + "name": "radio_component_height", + "value": "30vp" + }, + { + "name": "radio_component_margin_bottom_right", + "value": "15vp" + }, + { + "name": "dataPanel_distance", + "value": "320vp" + }, + { + "name": "dataPanel_proportion_font_size", + "value": "66.67fp" + }, + { + "name": "dataPanel_percent_font_size", + "value": "17.78fp" + }, + { + "name": "dataPanel_used_font_size", + "value": "17.78fp" + }, + { + "name": "location_toggle_width", + "value": "36vp" + }, + { + "name": "location_toggle_height", + "value": "20vp" + }, + { + "name": "location_toggle_margin", + "value": "12vp" + }, + { + "name": "wh_value_72", + "value": "72vp" + }, + { + "name": "switch_summary_margin", + "value": "2vp" + }, + { + "name": "single_item_height", + "value": "48vp" + }, + { + "name": "wh_value_240", + "value": "240vp" + }, + { + "name": "wh_value_245", + "value": "245vp" + }, + { + "name": "wh_value_260", + "value": "260vp" + }, + { + "name": "wh_value_288", + "value": "288vp" + }, + { + "name": "wh_value_324", + "value": "324vp" + }, + { + "name": "opacity_0_2", + "value": "0.2" + }, + { + "name": "paired_device_button_width", + "value": "186vp" + }, + { + "name": "component_button_width", + "value": "263vp" + }, + { + "name": "component_button_width_phone", + "value": "148vp" + }, + { + "name": "pinCode_font_size", + "value": "32fp" + }, + { + "name": "deviceName_button_width", + "value": "263vp" + }, + { + "name": "applicationInfo_button_width", + "value": "324vp" + }, + { + "name": "passwordSetting_button_width", + "value": "261vp" + }, + { + "name": "dialog_16", + "value": "0vp" + }, + { + "name": "dialog_118", + "value": "118vp" + }, + { + "name": "wh_4", + "value": "4vp" + }, + { + "name": "wh_10", + "value": "10vp" + }, + { + "name": "wh_20", + "value": "20vp" + }, + { + "name": "wh_23", + "value": "23vp" + }, + { + "name": "wh_24", + "value": "24vp" + }, + { + "name": "wh_35", + "value": "16vp" + }, + { + "name": "wh_37", + "value": "0vp" + }, + { + "name": "wh_42", + "value": "42vp" + }, + { + "name": "wh_48", + "value": "52vp" + }, + { + "name": "wh_192", + "value": "192vp" + }, + { + "name": "wh_205", + "value": "205vp" + }, + { + "name": "wh_263", + "value": "263vp" + }, + { + "name": "wh_600", + "value": "600vp" + }, + { + "name": "wh_hed_14", + "value": "0vp" + }, + { + "name": "padding_24", + "value": "24vp" + }, + { + "name": "padding_26", + "value": "26vp" + }, + { + "name": "wh_padding_32", + "value": "32vp" + }, + { + "name": "wh_padding_33", + "value": "33vp" + }, + { + "name": "wh_padding_35", + "value": "35vp" + }, + { + "name": "wh_padding_48", + "value": "48vp" + }, + { + "name": "wh_padding_112", + "value": "112vp" + }, + { + "name": "wh_padding_128", + "value": "128vp" + }, + { + "name": "wh_padding_212", + "value": "212vp" + }, + { + "name": "dataPanel_proportion_font_size_1", + "value": "60fp" + }, + { + "name": "dataPanel_percent_font_size_1", + "value": "16vp" + }, + { + "name": "dataPanel_used_font_size_1", + "value": "14vp" + }, + { + "name": "divider_wh", + "value": "0.5vp" + }, + { + "name": "progress_bottom", + "value": "24vp" + }, + { + "name": "head_font_20", + "value": "20vp" + }, + { + "name": "opacity_100_60", + "value": "0.6" + }, + { + "name": "request_auth_radio_width", + "value": "36vp" + }, + { + "name": "request_auth_radio_height", + "value": "20vp" + }, + { + "name": "request_auth_dialog_height", + "value": "500vp" + }, + { + "name": "request_auth_divider_endMargin", + "value": "15vp" + }, + { + "name": "request_auth_borderRadius", + "value": "24vp" + }, + { + "name": "request_auth_strokeWidth", + "value": "1" + }, + { + "name": "credentials_app_image_wh", + "value": "40vp" + }, + { + "name": "credentials_app_image_hg", + "value": "40vp" + }, + { + "name": "credentials_app_image_margin", + "value": "50vp" + }, + { + "name": "credentials_app_name_margin", + "value": "16vp" + }, + { + "name": "credentials_app_Toggle_margin", + "value": "35vp" + }, + { + "name": "credentials_app_Toggle_wh", + "value": "36vp" + }, + { + "name": "credentials_app_Toggle_hg", + "value": "20vp" + }, + { + "name": "credentials_app_title_margin_bottom", + "value": "10vp" + }, + { + "name": "credentials_app_title_margin_left", + "value": "16vp" + }, + { + "name": "credentials_app_title_margin_top", + "value": "24vp" + }, + { + "name": "credentials_app_ListItem_margin_top", + "value": "30vp" + }, + { + "name": "credentials_app_List_margin_bottom", + "value": "20vp" + }, + { + "name": "credentials_app_Flex_margin_bottom", + "value": "20vp" + }, + { + "name": "credentials_app_dialog_margin_top", + "value": "31vp" + }, + { + "name": "credentials_app_list_hg", + "value": "360vp" + }, + { + "name": "credentials_app_list_margin_top", + "value": "20vp" + }, + { + "name": "credentials_app_list_padding_top", + "value": "4vp" + }, + { + "name": "credentials_app_list_padding_bottom", + "value": "14vp" + }, + { + "name": "credentials_app_list_borderRadius", + "value": "24vp" + }, + { + "name": "credentials_app_finish_margin_top", + "value": "10vp" + }, + { + "name": "credentials_app_finish_margin_bottom", + "value": "20vp" + }, + { + "name": "private_detail_title_margin_left", + "value": "16vp" + }, + { + "name": "private_detail_title_margin_top", + "value": "24vp" + }, + { + "name": "private_detail_title_margin_bottom", + "value": "20vp" + }, + { + "name": "private_detail_Text_margin_bottom", + "value": "10vp" + }, + { + "name": "private_detail_opacity", + "value": "0.7" + }, + { + "name": "private_detail_keyNum_margin_left", + "value": "30vp" + }, + { + "name": "private_detail_close_margin", + "value": "24vp" + }, + { + "name": "private_detail_margin", + "value": "10vp" + }, + { + "name": "managerAuthApp_hg", + "value": "33vp" + }, + { + "name": "managerAuthApp_image_wh", + "value": "12vp" + }, + { + "name": "managerAuthApp_image_hg", + "value": "24vp" + }, + { + "name": "managerAuthApp_image_margin", + "value": "24vp" + }, + { + "name": "managerAuthApp_image_opacity", + "value": "0.2" + }, + { + "name": "managerAuthApp_margin", + "value": "6vp" + }, + { + "name": "publicDetailsCancel_marginTop", + "value": "20vp" + }, + { + "name": "publicDetailsCancel_marginBottom", + "value": "24vp" + }, + { + "name": "publicList_hg", + "value": "33vp" + }, + { + "name": "publicList_margin", + "value": "12vp" + }, + { + "name": "publicList_image_wh", + "value": "12vp" + }, + { + "name": "publicList_image_hg", + "value": "24vp" + }, + { + "name": "publicList_image_margin", + "value": "12vp" + }, + { + "name": "publicList_image_opacity", + "value": "0.2" + }, + { + "name": "publicList_height", + "value": "64vp" + }, + { + "name": "publicList_borderRadius", + "value": "24vp" + }, + { + "name": "publicList_item_hg", + "value": "96vp" + }, + { + "name": "Evidence_wh", + "value": "672vp" + }, + { + "name": "Evidence_margin", + "value": "24vp" + }, + { + "name": "Evidence_strokeWidth", + "value": "1" + }, + { + "name": "Evidence_startMargin", + "value": "15vp" + }, + { + "name": "Evidence_endMargin", + "value": "15vp" + }, + { + "name": "Evidence_borderRadius", + "value": "24vp" + }, + { + "name": "Evidence_barWidth", + "value": "672vp" + }, + { + "name": "Evidence_barHeight", + "value": "56vp" + }, + { + "name": "evidenceList_TabBuilder_Text_fontSize_value", + "value": "20vp" + }, + { + "name": "evidenceList_TabBuilder_Text_padding_left_value", + "value": "57vp" + }, + { + "name": "evidenceList_TabBuilder_Text_padding_top_value", + "value": "22vp" + }, + { + "name": "evidenceList_TabBuilder_Text_padding_opacity_value", + "value": "0.6" + }, + { + "name": "evidenceList_TabBuilder_Divider_width_value", + "value": "25vp" + }, + { + "name": "evidenceList_TabBuilder_Divider_padding_left_value", + "value": "57vp" + }, + { + "name": "evidenceList_TabBuilder_Divider_padding_top_value", + "value": "5vp" + }, + { + "name": "TrustedEvidence_TabBuilder_Text_fontSize_value", + "value": "16vp" + }, + { + "name": "TrustedEvidence_TabBuilder_Text_padding_left_value", + "value": "57vp" + }, + { + "name": "TrustedEvidence_TabBuilder_Text_padding_top_value", + "value": "18vp" + }, + { + "name": "TrustedEvidence_TabBuilder_Text_padding_opacity_value", + "value": "0.6" + }, + { + "name": "TrustedEvidence_TabBuilder_Divider_width_value", + "value": "48vp" + }, + { + "name": "TrustedEvidence_TabBuilder_Divider_padding_left_value", + "value": "57vp" + }, + { + "name": "TrustedEvidence_TabBuilder_Divider_padding_top_value", + "value": "7vp" + }, + { + "name": "sys_list_divider_strokeWidth_value", + "value": "1" + }, + { + "name": "sys_list_divider_startMargin_value", + "value": "24vp" + }, + { + "name": "sys_list_divider_endMargin_value", + "value": "24vp" + }, + { + "name": "sys_list_divider_borderRadius_value", + "value": "24vp" + }, + { + "name": "user_list_divider_strokeWidth_value", + "value": "1" + }, + { + "name": "user_list_divider_startMargin_value", + "value": "24vp" + }, + { + "name": "user_list_divider_endMargin_value", + "value": "24vp" + }, + { + "name": "user_list_divider_borderRadius_value", + "value": "24vp" + }, + { + "name": "tabs_barWidth_value", + "value": "192vp" + }, + { + "name": "tabs_barHeight_value", + "value": "56vp" + }, + { + "name": "componentUser_firText_height_value", + "value": "22vp" + }, + { + "name": "componentUser_firText_fontSize_value", + "value": "22vp" + }, + { + "name": "componentUser_firText_margin_left_value", + "value": "24vp" + }, + { + "name": "componentUser_secText_height_value", + "value": "19vp" + }, + { + "name": "componentUser_secText_fontSize_value", + "value": "18vp" + }, + { + "name": "componentUser_secText_margin_left_value", + "value": "24vp" + }, + { + "name": "componentUser_secText_opacity_value", + "value": "0.6" + }, + { + "name": "componentUser_thdText_fontSize_value", + "value": "18vp" + }, + { + "name": "componentUser_thdText_margin_value", + "value": "4vp" + }, + { + "name": "componentUser_thdText_opacity_value", + "value": "0.6" + }, + { + "name": "componentUser_image_width_value", + "value": "12vp" + }, + { + "name": "componentUser_image_height_value", + "value": "24vp" + }, + { + "name": "componentUser_image_margin_right_value", + "value": "24vp" + }, + { + "name": "componentUser_image_opacity_value", + "value": "0.2" + }, + { + "name": "componentUser_flex_height_value", + "value": "64vp" + }, + { + "name": "componentUser_flex_borderRadius_value", + "value": "24vp" + }, + { + "name": "ComponentSystem_firText_height_value", + "value": "22vp" + }, + { + "name": "ComponentSystem_firText_fontSize_value", + "value": "22vp" + }, + { + "name": "ComponentSystem_firText_margin_left_value", + "value": "24vp" + }, + { + "name": "ComponentSystem_secText_height_value", + "value": "19vp" + }, + { + "name": "ComponentSystem_secText_fontSize_value", + "value": "18vp" + }, + { + "name": "ComponentSystem_secText_margin_left_value", + "value": "24vp" + }, + { + "name": "ComponentSystem_secText_opacity_value", + "value": "0.6" + }, + { + "name": "ComponentSystem_Toggle_margin_right_value", + "value": "24vp" + }, + { + "name": "ComponentSystem_Toggle_width_value", + "value": "36vp" + }, + { + "name": "ComponentSystem_Toggle_height_value", + "value": "20vp" + }, + { + "name": "ComponentSystem_Flex_height_value", + "value": "64vp" + }, + { + "name": "ComponentSystem_Flex_borderRadius_value", + "value": "24vp" + }, + { + "name": "CustomDialogExample_firText_fontSize_value", + "value": "24vp" + }, + { + "name": "CustomDialogExample_firText_margin_top_value", + "value": "18vp" + }, + { + "name": "CustomDialogExample_firText_margin_left_value", + "value": "24vp" + }, + { + "name": "CustomDialogExample_secText_fontSize_value", + "value": "24vp" + }, + { + "name": "CustomDialogExample_secText_margin_top_value", + "value": "24vp" + }, + { + "name": "CustomDialogExample_secText_margin_left_value", + "value": "24vp" + }, + { + "name": "CustomDialogExample_firListItem_Text_fontSize_value", + "value": "17vp" + }, + { + "name": "CustomDialogExample_firListItem_Text_margin_left_value", + "value": "24vp" + }, + { + "name": "CustomDialogExample_firListItem_Text_margin_bottom_value", + "value": "6vp" + }, + { + "name": "CustomDialogExample_secListItem_Text_fontSize_value", + "value": "17vp" + }, + { + "name": "CustomDialogExample_secListItem_Text_margin_left_value", + "value": "20vp" + }, + { + "name": "CustomDialogExample_secListItem_Text_margin_top_value", + "value": "13vp" + }, + { + "name": "CustomDialogExample_secListItem_Text_margin_bottom_value", + "value": "8vp" + }, + { + "name": "CustomDialogExample_thdListItem_Text_fontSize_value", + "value": "17vp" + }, + { + "name": "CustomDialogExample_thdListItem_Text_margin_left_value", + "value": "20vp" + }, + { + "name": "CustomDialogExample_thdListItem_Text_margin_top_value", + "value": "13vp" + }, + { + "name": "CustomDialogExample_thdListItem_Text_margin_bottom_value", + "value": "8vp" + }, + { + "name": "CustomDialogExample_list_height_value", + "value": "342vp" + }, + { + "name": "CustomDialogExample_list_margin_top_value", + "value": "21vp" + }, + { + "name": "CustomDialogExample_list_padding_top_value", + "value": "4vp" + }, + { + "name": "CustomDialogExample_list_padding_bottom_value", + "value": "4vp" + }, + { + "name": "CustomDialogExample_list_borderRadius_value", + "value": "24vp" + }, + { + "name": "CustomDialogExample_Column_margin_top_value", + "value": "6vp" + }, + { + "name": "CustomDialogExample_Button_margin_top_value", + "value": "2vp" + }, + { + "name": "CustomDialogExample_Column_height_value", + "value": "576vp" + }, + { + "name": "CustomDialogExampleUser_Flex_firText_fontSize_value", + "value": "22vp" + }, + { + "name": "CustomDialogExampleUser_Flex_firText_margin_left_value", + "value": "16vp" + }, + { + "name": "CustomDialogExampleUser_Flex_secText_fontSize_value", + "value": "18vp" + }, + { + "name": "CustomDialogExampleUser_Flex_secText_margin_left_value", + "value": "16vp" + }, + { + "name": "CustomDialogExampleUser_Flex_secText_opacity_value", + "value": "0.6" + }, + { + "name": "CustomDialogExampleUser_Flex_Toggle_margin_right_value", + "value": "37vp" + }, + { + "name": "CustomDialogExampleUser_Flex_Toggle_width_value", + "value": "36vp" + }, + { + "name": "CustomDialogExampleUser_Flex_Toggle_height_value", + "value": "20vp" + }, + { + "name": "CustomDialogExampleUser_Flex_height_value", + "value": "64vp" + }, + { + "name": "CustomDialogExampleUser_Flex_margin_top_value", + "value": "24vp" + }, + { + "name": "CustomDialogExampleUser_list_height_value", + "value": "374vp" + }, + { + "name": "CustomDialogExampleUser_list_padding_bottom_value", + "value": "14vp" + }, + { + "name": "CustomDialogExampleUser_Column_margin_top_value", + "value": "6vp" + }, + { + "name": "CustomDialogExampleUser_Flex_Button_margin_top_value", + "value": "10vp" + }, + { + "name": "CustomDialogExampleUser_Column_felx_height_value", + "value": "80vp" + }, + { + "name": "CustomDialogExampleUser_Column_height_value", + "value": "614vp" + }, + { + "name": "DialogSubjectComponent_Text_fontSize_value", + "value": "17vp" + }, + { + "name": "DialogSubjectComponent_Text_margin_left_value", + "value": "20vp" + }, + { + "name": "DialogSubjectComponent_Text_margin_top_value", + "value": "10vp" + }, + { + "name": "authorDialog_size", + "value": "500vp" + }, + { + "name": "appDialog_size", + "value": "340vp" + }, + { + "name": "privateDialog_size", + "value": "260vp" + }, + { + "name": "deleteAllDialog_size", + "value": "160vp" + } + ] +} \ No newline at end of file diff --git a/CertificateManager/product/phone/src/main/resources/base/element/string.json b/CertificateManager/product/phone/src/main/resources/base/element/string.json new file mode 100644 index 0000000..46c879d --- /dev/null +++ b/CertificateManager/product/phone/src/main/resources/base/element/string.json @@ -0,0 +1,290 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "证书管理FA" + }, + { + "name": "mainability_description", + "value": "ETS_Empty Feature Ability" + }, + { + "name": "read_media_permission_reason", + "value": "安装证书功能需使用媒体库权限" + }, + { + "name": "version", + "value": "版本 " + }, + { + "name": "certificateTab", + "value": "证书与凭据" + }, + { + "name": "certificateManage", + "value": "证书管理" + }, + { + "name": "trustedEvidence", + "value": "受信任的证书" + }, + { + "name": "userEvidence", + "value": "凭据列表" + }, + { + "name": "installInStorageDevice", + "value": "从存储设备安装" + }, + { + "name": "installCertificateFailed", + "value": "从存储设备安装失败" + }, + { + "name": "certificatePwdTab", + "value": "提取证书" + }, + { + "name": "certificateAliasTab", + "value": "设置证书" + }, + { + "name": "certificatePwdInfo", + "value": "输入证书密码以提取" + }, + { + "name": "certificateAliasInfo", + "value": "输入证书名称" + }, + { + "name": "deleteAllCred", + "value": "删除所有证书与凭据" + }, + + + { + "name": "deleteAllCredDialogTitle", + "value": "删除所有证书与凭据" + }, + { + "name": "deleteAllCredDialogMessage", + "value": "所有用户证书与凭据将被永久删除。是否删除?" + }, + { + "name": "deleteAllCredCancel", + "value": "取消" + }, + { + "name": "deleteAllCredDelete", + "value": "删除" + }, + { + "name": "pickCredToAuth", + "value": "选择证书授权" + }, + { + "name": "requestAuthMsg", + "value": "应用\"%s\"请求使用证书。选择一个证书可让该应用对服务器使用此身份凭证。该应用已将请求服务标识为\"localhost\",您只应向信任的应用授予使用证书的权限。" + }, + { + "name": "requestAuthCancel", + "value": "拒绝" + }, + { + "name": "requestAuthFinish", + "value": "授权" + }, + { + "name": "requestFailPromptMsg", + "value": "授权失败,无效AppUid" + }, + { + "name": "installPwdInputCancel", + "value": "取消" + }, + { + "name": "installPwdInputConfirm", + "value": "提取" + }, + { + "name": "installAliasInputCancel", + "value": "取消" + }, + { + "name": "installAliasInputConfirm", + "value": "确定" + }, + { + "name": "installAliasInputInfo", + "value": "注:此证书颁发者可能会检查进出设备的所有流量\n该数据包包含:CA证书" + }, + { + "name": "managerAuthApp", + "value": "管理授权应用" + }, + { + "name": "cancelAuthApp", + "value": "取消" + }, + { + "name": "finishAuthApp", + "value": "完成" + }, + { + "name": "evidenceDetails", + "value": "凭据详情" + }, + { + "name": "entryContains", + "value": "此条目包含:" + }, + { + "name": "keyNum", + "value": " %s个用户密钥" + }, + { + "name": "userCerNum", + "value": " %s个用户证书" + }, + { + "name": "privateDetailsClose", + "value": "关闭" + }, + { + "name": "publicDetailsCancel", + "value": "取消" + }, + { + "name": "publicDetailsDelete", + "value": "删除" + }, + { + "name": "warning_title", + "value": "删除凭据" + }, + { + "name": "warning_message", + "value": "删除后,被授权此凭据的应用将无法正常使用。是否删除?" + }, + { + "name": "warning_cancel", + "value": "取消" + }, + { + "name": "warning_delete", + "value": "删除" + }, + { + "name": "tabName_public", + "value": "公共" + }, + { + "name": "tabName_private", + "value": "私有" + }, + { + "name": "system", + "value": "系统" + }, + { + "name": "user", + "value": "用户" + }, + { + "name": "CustomDialogExample_firText", + "value": "证书详情" + }, + { + "name": "CustomDialogExample_firListItem_text", + "value": "颁发给:" + }, + { + "name": "CustomDialogExample_secListItem_text", + "value": "颁发者:" + }, + { + "name": "CustomDialogExample_thdListItem_text", + "value": "有效期:" + }, + { + "name": "CustomDialogExample_Button_text", + "value": "取消" + }, + { + "name": "CustomDialogExample_Button_on", + "value": "启用" + }, + { + "name": "CustomDialogExample_Button_off", + "value": "禁用" + }, + { + "name": "CustomDialogExampleUser_Status_true", + "value": "已启用" + }, + { + "name": "CustomDialogExampleUser_Status_false", + "value": "已禁用" + }, + { + "name": "CustomDialogExampleUser_Flex_firButton_text", + "value": "取消" + }, + { + "name": "CustomDialogExampleUser_Flex_secButton_text", + "value": "删除" + }, + { + "name": "CustomDialogExampleUser_warning_Button_text", + "value": "取消" + }, + { + "name": "CustomDialogExampleUser_warning_Button_title_text", + "value": "删除证书" + }, + { + "name": "CustomDialogExampleUser_warning_Button_message_text", + "value": "删除后,被授权此证书的应用将无法正常使用。是否删除?" + }, + { + "name": "CustomDialogExampleUser_warning_firButton_text", + "value": "取消" + }, + { + "name": "CustomDialogExampleUser_warning_secButton_text", + "value": "删除" + }, + { + "name": "DialogSubjectComponent_firText", + "value": "常用名称:" + }, + { + "name": "DialogSubjectComponent_secText", + "value": "组织:" + }, + { + "name": "DialogSubjectComponent_thdText", + "value": "组织单位:" + }, + { + "name": "DialogSubjectComponent_fouText", + "value": "序列号:" + }, + { + "name": "DialogSubjectComponent_fifText", + "value": "颁发时间:" + }, + { + "name": "DialogSubjectComponent_sixText", + "value": "有效期至:" + }, + { + "name": "CustomDialogExample_fouListItem_text", + "value": "指纹:" + }, + { + "name": "CustomDialogExample_FingerPrint_text", + "value": "SHA-256 指纹:" + } + ] +} \ No newline at end of file diff --git a/CertificateManager/product/phone/src/main/resources/base/media/ic_back.svg b/CertificateManager/product/phone/src/main/resources/base/media/ic_back.svg new file mode 100644 index 0000000..50e4ecd --- /dev/null +++ b/CertificateManager/product/phone/src/main/resources/base/media/ic_back.svg @@ -0,0 +1,13 @@ + + + Public/ic_public_back + + + + + + + + + + \ No newline at end of file diff --git a/CertificateManager/product/phone/src/main/resources/base/media/ic_close.svg b/CertificateManager/product/phone/src/main/resources/base/media/ic_close.svg new file mode 100644 index 0000000..e895e81 --- /dev/null +++ b/CertificateManager/product/phone/src/main/resources/base/media/ic_close.svg @@ -0,0 +1,3 @@ + + +_ic \ No newline at end of file diff --git a/CertificateManager/product/phone/src/main/resources/base/media/ic_delete.svg b/CertificateManager/product/phone/src/main/resources/base/media/ic_delete.svg new file mode 100644 index 0000000..1717615 --- /dev/null +++ b/CertificateManager/product/phone/src/main/resources/base/media/ic_delete.svg @@ -0,0 +1,13 @@ + + + xxxhdpi/ic_delete + + + + + + + + + + \ No newline at end of file diff --git a/CertificateManager/product/phone/src/main/resources/base/media/ic_move.svg b/CertificateManager/product/phone/src/main/resources/base/media/ic_move.svg new file mode 100644 index 0000000..578b6e5 --- /dev/null +++ b/CertificateManager/product/phone/src/main/resources/base/media/ic_move.svg @@ -0,0 +1 @@ +ic \ No newline at end of file diff --git a/CertificateManager/product/phone/src/main/resources/base/media/ic_public_cancel.svg b/CertificateManager/product/phone/src/main/resources/base/media/ic_public_cancel.svg new file mode 100644 index 0000000..7885cdc --- /dev/null +++ b/CertificateManager/product/phone/src/main/resources/base/media/ic_public_cancel.svg @@ -0,0 +1,13 @@ + + + Public/ic_public_cancel + + + + + + + + + + \ No newline at end of file diff --git a/CertificateManager/product/phone/src/main/resources/base/media/ic_public_close.svg b/CertificateManager/product/phone/src/main/resources/base/media/ic_public_close.svg new file mode 100644 index 0000000..cc18043 --- /dev/null +++ b/CertificateManager/product/phone/src/main/resources/base/media/ic_public_close.svg @@ -0,0 +1,13 @@ + + + Public/ic_public_close + + + + + + + + + + \ No newline at end of file diff --git a/CertificateManager/product/phone/src/main/resources/base/media/ic_settings_arrow.svg b/CertificateManager/product/phone/src/main/resources/base/media/ic_settings_arrow.svg new file mode 100644 index 0000000..ff6293c --- /dev/null +++ b/CertificateManager/product/phone/src/main/resources/base/media/ic_settings_arrow.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + diff --git a/CertificateManager/product/phone/src/main/resources/base/media/icon.png b/CertificateManager/product/phone/src/main/resources/base/media/icon.png new file mode 100644 index 0000000..ce307a8 Binary files /dev/null and b/CertificateManager/product/phone/src/main/resources/base/media/icon.png differ diff --git a/CertificateManager/product/phone/src/main/resources/base/profile/main_pages.json b/CertificateManager/product/phone/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000..c7c5c8d --- /dev/null +++ b/CertificateManager/product/phone/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,10 @@ +{ + "src": [ + "pages/certManagerFa", + "pages/certPwdInput", + "pages/trustedCa", + "pages/cerEvidenceFa", + "pages/requestAuth", + "pages/certInstallAliasInput" + ] +} diff --git a/CertificateManager/product/phone/src/main/resources/en_US/element/string.json b/CertificateManager/product/phone/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000..0ef7fd8 --- /dev/null +++ b/CertificateManager/product/phone/src/main/resources/en_US/element/string.json @@ -0,0 +1,290 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "Certificate Manager FA" + }, + { + "name": "mainability_description", + "value": "ETS_Empty Feature Ability" + }, + { + "name": "read_media_permission_reason", + "value": "Media library permission is required when installing certificates" + }, + { + "name": "version", + "value": "Version " + }, + { + "name": "certificateTab", + "value": "Certificate and Credential" + }, + { + "name": "certificateManage", + "value": "Certificate Manager" + }, + { + "name": "trustedEvidence", + "value": "Trusted Certificate" + }, + { + "name": "userEvidence", + "value": "Credential List" + }, + { + "name": "installInStorageDevice", + "value": "Install From Storage" + }, + { + "name": "installCertificateFailed", + "value": "Install From Storage Failed" + }, + { + "name": "certificatePwdTab", + "value": "Get Certificated" + }, + { + "name": "certificateAliasTab", + "value": "Set Certificated" + }, + { + "name": "certificatePwdInfo", + "value": "Input Password" + }, + { + "name": "certificateAliasInfo", + "value": "Input Certificate Alias" + }, + { + "name": "deleteAllCred", + "value": "Delete All Credentials and Certificates" + }, + + + { + "name": "deleteAllCredDialogTitle", + "value": "Delete All Credentials and Certificates" + }, + { + "name": "deleteAllCredDialogMessage", + "value": "All credentials and certificates will be deleted. Whether or not to delete?" + }, + { + "name": "deleteAllCredCancel", + "value": "Cancel" + }, + { + "name": "deleteAllCredDelete", + "value": "Delete" + }, + { + "name": "pickCredToAuth", + "value": "Select credential" + }, + { + "name": "requestAuthMsg", + "value": "Application \"%s\" Request a certificate. Selecting a certificate allows the app to use this identity credential for the server. The app has identified the requested service as \"localhost\", You should only grant permission to use certificates to trusted apps." + }, + { + "name": "requestAuthCancel", + "value": "Reject" + }, + { + "name": "requestAuthFinish", + "value": "Authorize" + }, + { + "name": "requestFailPromptMsg", + "value": "Authorize failed , invalid AppUid" + }, + { + "name": "installPwdInputCancel", + "value": "Cancel" + }, + { + "name": "installPwdInputConfirm", + "value": "Extract" + }, + { + "name": "installAliasInputCancel", + "value": "Cancel" + }, + { + "name": "installAliasInputConfirm", + "value": "Confirm" + }, + { + "name": "installAliasInputInfo", + "value": "Attention: This certificate issuer may check all traffic entering and leaving the device\nThe packets contain:CA certificate" + }, + { + "name": "managerAuthApp", + "value": "Manage Authorized Applications" + }, + { + "name": "cancelAuthApp", + "value": "Cancel" + }, + { + "name": "finishAuthApp", + "value": "Finish" + }, + { + "name": "evidenceDetails", + "value": "Credential details" + }, + { + "name": "entryContains", + "value": "This item contains:" + }, + { + "name": "keyNum", + "value": " %s user keys" + }, + { + "name": "userCerNum", + "value": " %s user certificates" + }, + { + "name": "privateDetailsClose", + "value": "Close" + }, + { + "name": "publicDetailsCancel", + "value": "Cancel" + }, + { + "name": "publicDetailsDelete", + "value": "Delete" + }, + { + "name": "warning_title", + "value": "Delete certificate" + }, + { + "name": "warning_message", + "value": "After deletion, the application authorized with this certificate will not work normally. Whether or not to delete?" + }, + { + "name": "warning_cancel", + "value": "Cancel" + }, + { + "name": "warning_delete", + "value": "Delete" + }, + { + "name": "tabName_public", + "value": "Public" + }, + { + "name": "tabName_private", + "value": "Private" + }, + { + "name": "system", + "value": "System" + }, + { + "name": "user", + "value": "User" + }, + { + "name": "CustomDialogExample_firText", + "value": "Certificate Detail" + }, + { + "name": "CustomDialogExample_firListItem_text", + "value": "Issued to:" + }, + { + "name": "CustomDialogExample_secListItem_text", + "value": "Issued by:" + }, + { + "name": "CustomDialogExample_thdListItem_text", + "value": "Validity:" + }, + { + "name": "CustomDialogExample_Button_text", + "value": "Cancel" + }, + { + "name": "CustomDialogExample_Button_on", + "value": "Enable" + }, + { + "name": "CustomDialogExample_Button_off", + "value": "Disable" + }, + { + "name": "CustomDialogExampleUser_Status_true", + "value": "Enabled" + }, + { + "name": "CustomDialogExampleUser_Status_false", + "value": "Disabled" + }, + { + "name": "CustomDialogExampleUser_Flex_firButton_text", + "value": "Cancel" + }, + { + "name": "CustomDialogExampleUser_Flex_secButton_text", + "value": "Delete" + }, + { + "name": "CustomDialogExampleUser_warning_Button_text", + "value": "Cancel" + }, + { + "name": "CustomDialogExampleUser_warning_Button_title_text", + "value": "Delete certificate" + }, + { + "name": "CustomDialogExampleUser_warning_Button_message_text", + "value": "After deletion, the application authorized with this certificate will not work normally. Whether or not to delete?" + }, + { + "name": "CustomDialogExampleUser_warning_firButton_text", + "value": "Cancel" + }, + { + "name": "CustomDialogExampleUser_warning_secButton_text", + "value": "Delete" + }, + { + "name": "DialogSubjectComponent_firText", + "value": "Common name:" + }, + { + "name": "DialogSubjectComponent_secText", + "value": "Organization:" + }, + { + "name": "DialogSubjectComponent_thdText", + "value": "Organizational unit:" + }, + { + "name": "DialogSubjectComponent_fouText", + "value": "Serial number:" + }, + { + "name": "DialogSubjectComponent_fifText", + "value": "Issued on:" + }, + { + "name": "DialogSubjectComponent_sixText", + "value": "Expires on:" + }, + { + "name": "CustomDialogExample_fouListItem_text", + "value": "Fingerprints:" + }, + { + "name": "CustomDialogExample_FingerPrint_text", + "value": "SHA-256 fingerprints:" + } + ] +} \ No newline at end of file diff --git a/CertificateManager/product/phone/src/main/resources/phone/element/float.json b/CertificateManager/product/phone/src/main/resources/phone/element/float.json new file mode 100644 index 0000000..9bab66c --- /dev/null +++ b/CertificateManager/product/phone/src/main/resources/phone/element/float.json @@ -0,0 +1,1008 @@ +{ + "float": [ + { + "name": "wh_value_0", + "value": "0vp" + }, + { + "name": "wh_value_1", + "value": "1vp" + }, + { + "name": "wh_value_1_5", + "value": "1.5vp" + }, + { + "name": "wh_value_3", + "value": "3vp" + }, + { + "name": "wh_value_4", + "value": "4vp" + }, + { + "name": "wh_value_5", + "value": "5vp" + }, + { + "name": "wh_value_6", + "value": "6vp" + }, + { + "name": "wh_value_8", + "value": "8vp" + }, + { + "name": "wh_value_9", + "value": "9vp" + }, + { + "name": "wh_value_10", + "value": "10vp" + }, + { + "name": "wh_value_11", + "value": "11vp" + }, + { + "name": "wh_value_12", + "value": "12vp" + }, + { + "name": "wh_value_13", + "value": "13vp" + }, + { + "name": "wh_value_15", + "value": "15vp" + }, + { + "name": "wh_value_16", + "value": "16vp" + }, + { + "name": "wh_value_18", + "value": "18vp" + }, + { + "name": "wh_value_19", + "value": "19vp" + }, + { + "name": "wh_value_20", + "value": "20vp" + }, + { + "name": "wh_value_21", + "value": "21vp" + }, + { + "name": "wh_value_22", + "value": "22vp" + }, + { + "name": "wh_value_24", + "value": "24vp" + }, + { + "name": "wh_value_26", + "value": "26vp" + }, + { + "name": "wh_value_28", + "value": "28vp" + }, + { + "name": "wh_value_30", + "value": "30vp" + }, + { + "name": "wh_value_32", + "value": "32vp" + }, + { + "name": "wh_value_33", + "value": "28vp" + }, + { + "name": "wh_value_40", + "value": "40vp" + }, + { + "name": "wh_value_44", + "value": "44vp" + }, + { + "name": "wh_value_48", + "value": "48vp" + }, + { + "name": "wh_value_50", + "value": "50vp" + }, + { + "name": "wh_value_52", + "value": "52vp" + }, + { + "name": "wh_value_56", + "value": "56vp" + }, + { + "name": "wh_value_60", + "value": "60vp" + }, + { + "name": "wh_value_64", + "value": "64vp" + }, + { + "name": "wh_value_65", + "value": "65vp" + }, + { + "name": "wh_value_67", + "value": "67vp" + }, + { + "name": "wh_value_70", + "value": "70vp" + }, + { + "name": "wh_value_80", + "value": "80vp" + }, + { + "name": "wh_value_96", + "value": "96vp" + }, + { + "name": "wh_value_100", + "value": "100vp" + }, + { + "name": "wh_value_109", + "value": "109vp" + }, + { + "name": "wh_value_118", + "value": "118vp" + }, + { + "name": "wh_value_119", + "value": "119vp" + }, + { + "name": "wh_value_120", + "value": "120vp" + }, + { + "name": "wh_value_130", + "value": "1300vp" + }, + { + "name": "wh_value_152", + "value": "152vp" + }, + { + "name": "wh_value_160", + "value": "144vp" + }, + { + "name": "wh_value_200", + "value": "200vp" + }, + { + "name": "wh_value_210", + "value": "210vp" + }, + { + "name": "wh_value_212", + "value": "280vp" + }, + { + "name": "wh_value_216", + "value": "216vp" + }, + { + "name": "wh_value_230", + "value": "230vp" + }, + { + "name": "wh_value_250", + "value": "250vp" + }, + { + "name": "wh_value_263", + "value": "150vp" + }, + { + "name": "wh_value_280", + "value": "280vp" + }, + { + "name": "wh_value_336", + "value": "336vp" + }, + { + "name": "wh_value_362", + "value": "288vp" + }, + { + "name": "wh_value_390", + "value": "390vp" + }, + { + "name": "wh_value_400", + "value": "400vp" + }, + { + "name": "wh_value_410", + "value": "336vp" + }, + { + "name": "wh_value_620", + "value": "620vp" + }, + { + "name": "wh_value_720", + "value": "720vp" + }, + { + "name": "font_35", + "value": "35fp" + }, + { + "name": "font_10", + "value": "10fp" + }, + { + "name": "font_14", + "value": "14fp" + }, + { + "name": "font_16", + "value": "16fp" + }, + { + "name": "font_18", + "value": "18fp" + }, + { + "name": "font_20", + "value": "20fp" + }, + { + "name": "font_21", + "value": "21fp" + }, + { + "name": "font_22", + "value": "22fp" + }, + { + "name": "font_24", + "value": "24fp" + }, + { + "name": "font_28", + "value": "28fp" + }, + { + "name": "font_30", + "value": "30fp" + }, + { + "name": "font_50", + "value": "50fp" + }, + { + "name": "lineHeight_19", + "value": "19vp" + }, + { + "name": "lineHeight_21", + "value": "21vp" + }, + { + "name": "lineHeight_22", + "value": "22vp" + }, + { + "name": "lineHeight_33", + "value": "33vp" + }, + { + "name": "lineHeight_41", + "value": "41vp" + }, + { + "name": "distance_1", + "value": "1vp" + }, + { + "name": "distance_2", + "value": "2vp" + }, + { + "name": "distance_4", + "value": "4vp" + }, + { + "name": "distance_6", + "value": "6vp" + }, + { + "name": "distance_8", + "value": "8vp" + }, + { + "name": "distance_9", + "value": "9vp" + }, + { + "name": "distance_9_5", + "value": "9.5vp" + }, + { + "name": "distance_10", + "value": "10vp" + }, + { + "name": "distance_11", + "value": "11vp" + }, + { + "name": "distance_11_5", + "value": "11.5vp" + }, + { + "name": "distance_12", + "value": "12vp" + }, + { + "name": "distance_13", + "value": "13vp" + }, + { + "name": "distance_14", + "value": "14vp" + }, + { + "name": "distance_15", + "value": "15vp" + }, + { + "name": "distance_16", + "value": "16vp" + }, + { + "name": "distance_17", + "value": "17vp" + }, + { + "name": "distance_18", + "value": "18vp" + }, + { + "name": "distance_19", + "value": "19vp" + }, + { + "name": "distance_19_5", + "value": "19.5vp" + }, + { + "name": "distance_20", + "value": "20vp" + }, + { + "name": "distance_21", + "value": "21vp" + }, + { + "name": "distance_22_5", + "value": "22.5vp" + }, + { + "name": "distance_24", + "value": "24vp" + }, + { + "name": "distance_26", + "value": "26vp" + }, + { + "name": "distance_30", + "value": "30vp" + }, + { + "name": "distance_32", + "value": "32vp" + }, + { + "name": "distance_36", + "value": "36vp" + }, + { + "name": "distance_56", + "value": "56vp" + }, + { + "name": "distance_64", + "value": "64vp" + }, + { + "name": "distance_66", + "value": "66vp" + }, + { + "name": "distance_80", + "value": "80vp" + }, + { + "name": "distance_96", + "value": "96vp" + }, + { + "name": "sys_corner_radius_clicked", + "value": "8vp" + }, + { + "name": "sys_elements_margin_vertical_l", + "value": "16vp" + }, + { + "name": "sys_elements_margin_vertical_m", + "value": "8vp" + }, + { + "name": "sys_elements_margin_horizontal_l", + "value": "16vp" + }, + { + "name": "sys_elements_margin_horizontal_m", + "value": "16vp" + }, + { + "name": "page_margin_horizontal", + "value": "24vp" + }, + { + "name": "square_click_image_size", + "value": "48vp" + }, + { + "name": "control_common_font_size", + "value": "20fp" + }, + { + "name": "item_common_vertical_margin", + "value": "20vp" + }, + { + "name": "item_common_horizontal_margin", + "value": "24vp" + }, + { + "name": "item_icon_size", + "value": "24vp" + }, + { + "name": "item_arrow_width", + "value": "12vp" + }, + { + "name": "slider_text_padding_left", + "value": "5vp" + }, + { + "name": "page_header_height", + "value": "56vp" + }, + { + "name": "volume_border_radius", + "value": "15vp" + }, + { + "name": "radius_12", + "value": "12vp" + }, + { + "name": "radius_20", + "value": "20vp" + }, + { + "name": "radius_24", + "value": "24vp" + }, + { + "name": "radius_32", + "value": "32vp" + }, + { + "name": "radius_40", + "value": "40vp" + }, + { + "name": "search_placeholder_font", + "value": "22fp" + }, + { + "name": "search_input_height", + "value": "40vp" + }, + { + "name": "search_input_margin_start", + "value": "64vp" + }, + { + "name": "search_input_horizontal_margin", + "value": "8vp" + }, + { + "name": "search_input_border_radius", + "value": "20vp" + }, + { + "name": "search_no_result_image_size", + "value": "160vp" + }, + { + "name": "search_no_result_text_font_size", + "value": "14fp" + }, + { + "name": "search_no_result_margin_top", + "value": "174vp" + }, + { + "name": "search_item_height", + "value": "72vp" + }, + { + "name": "search_result_item_title_font_size", + "value": "16vp" + }, + { + "name": "search_result_item_summary_font_size", + "value": "14fp" + }, + { + "name": "slider_image_width", + "value": "40vp" + }, + { + "name": "slider_image_height", + "value": "40vp" + }, + { + "name": "slider_image_margin", + "value": "15vp" + }, + { + "name": "audio_subtitle_font", + "value": "18fp" + }, + { + "name": "audio_subtitle_margin_left", + "value": "10vp" + }, + { + "name": "audio_subtitle_margin_bottom", + "value": "5vp" + }, + { + "name": "audio_title_summary_margin_left", + "value": "15vp" + }, + { + "name": "audio_summary_subtitle_margin_bottom", + "value": "10vp" + }, + { + "name": "audio_subtitle_margin_top", + "value": "10vp" + }, + { + "name": "audio_sound_mode_outer_height", + "value": "280vp" + }, + { + "name": "audio_sound_mode_inner_padding_top", + "value": "15vp" + }, + { + "name": "audio_sound_mode_inner_padding_bottom", + "value": "15vp" + }, + { + "name": "audio_sound_mode_outer_padding", + "value": "16vp" + }, + { + "name": "audio_sound_mode_item_inner_padding_top", + "value": "5vp" + }, + { + "name": "audio_sound_mode_border_width", + "value": "1vp" + }, + { + "name": "audio_sound_mode_border_radius", + "value": "15vp" + }, + { + "name": "audio_sound_mode_image_size", + "value": "40vp" + }, + { + "name": "audio_sound_mode_text_margin_top", + "value": "16vp" + }, + { + "name": "audio_sound_mode_font_size", + "value": "20fp" + }, + { + "name": "audio_sound_mode_radio_size", + "value": "36vp" + }, + { + "name": "audio_image_common_size", + "value": "50vp" + }, + { + "name": "audio_image_margin_right", + "value": "10vp" + }, + { + "name": "audio_subtitle_font_size", + "value": "18fp" + }, + { + "name": "audio_margin_left", + "value": "15vp" + }, + { + "name": "audio_start_end_margin_left", + "value": "15vp" + }, + { + "name": "audio_icon_height", + "value": "60vp" + }, + { + "name": "audio_no_icon_height", + "value": "70vp" + }, + { + "name": "audio_slider_height", + "value": "250vp" + }, + { + "name": "audio_volume_height", + "value": "280vp" + }, + { + "name": "audio_border_width", + "value": "1vp" + }, + { + "name": "audio_border_radius", + "value": "15vp" + }, + { + "name": "audio_volume_component_padding", + "value": "16vp" + }, + { + "name": "restore_factory_font_size", + "value": "20fp" + }, + { + "name": "restore_factory_button_width", + "value": "186vp" + }, + { + "name": "restore_factory_button_height", + "value": "40vp" + }, + { + "name": "switch_title_subtitle_size", + "value": "20fp" + }, + { + "name": "switch_component_margin", + "value": "12vp" + }, + { + "name": "switch_toggle_width", + "value": "36vp" + }, + { + "name": "switch_toggle_height", + "value": "20vp" + }, + { + "name": "switch_component_height", + "value": "70vp" + }, + { + "name": "application_common_size", + "value": "45vp" + }, + { + "name": "application_button_subtitle_size", + "value": "16fp" + }, + { + "name": "application_button_height", + "value": "40vp" + }, + { + "name": "storage_common_margin", + "value": "15vp" + }, + { + "name": "location_font_size", + "value": "16fp" + }, + { + "name": "location_common_margin", + "value": "15vp" + }, + { + "name": "storage_data_panel_height", + "value": "230vp" + }, + { + "name": "password_list_item_height", + "value": "48vp" + }, + { + "name": "password_list_item_title_font_size", + "value": "16vp" + }, + { + "name": "password_input_message_vertical_margin", + "value": "20vp" + }, + { + "name": "password_count_down_view_vertical_margin", + "value": "20vp" + }, + { + "name": "password_input_button_space", + "value": "10vp" + }, + { + "name": "password_input_button_margin_top", + "value": "40vp" + }, + { + "name": "radio_component_height", + "value": "30vp" + }, + { + "name": "radio_component_margin_bottom_right", + "value": "15vp" + }, + { + "name": "dataPanel_distance", + "value": "320vp" + }, + { + "name": "dataPanel_proportion_font_size", + "value": "66.67fp" + }, + { + "name": "dataPanel_percent_font_size", + "value": "17.78fp" + }, + { + "name": "dataPanel_used_font_size", + "value": "17.78fp" + }, + { + "name": "location_toggle_width", + "value": "36vp" + }, + { + "name": "location_toggle_height", + "value": "20vp" + }, + { + "name": "location_toggle_margin", + "value": "12vp" + }, + { + "name": "wh_value_72", + "value": "72vp" + }, + { + "name": "switch_summary_margin", + "value": "2vp" + }, + { + "name": "single_item_height", + "value": "48vp" + }, + { + "name": "wh_value_240", + "value": "240vp" + }, + { + "name": "wh_value_245", + "value": "245vp" + }, + { + "name": "wh_value_260", + "value": "260vp" + }, + { + "name": "wh_value_288", + "value": "288vp" + }, + { + "name": "wh_value_324", + "value": "324vp" + }, + { + "name": "divider_opacity", + "value": "0.2" + }, + { + "name": "paired_device_button_width", + "value": "186vp" + }, + { + "name": "component_button_width", + "value": "263vp" + }, + { + "name": "component_button_width_phone", + "value": "148vp" + }, + { + "name": "pinCode_font_size", + "value": "32fp" + }, + { + "name": "deviceName_button_width", + "value": "150vp" + }, + { + "name": "applicationInfo_button_width", + "value": "324vp" + }, + { + "name": "passwordSetting_button_width", + "value": "261vp" + }, + { + "name": "dialog_16", + "value": "16vp" + }, + { + "name": "dialog_118", + "value": "92vp" + }, + { + "name": "wh_4", + "value": "8vp" + }, + { + "name": "wh_10", + "value": "16vp" + }, + { + "name": "wh_20", + "value": "8vp" + }, + { + "name": "wh_23", + "value": "16vp" + }, + { + "name": "wh_24", + "value": "12vp" + }, + { + "name": "wh_35", + "value": "16vp" + }, + { + "name": "wh_37", + "value": "37vp" + }, + { + "name": "wh_42", + "value": "22vp" + }, + { + "name": "wh_48", + "value": "48vp" + }, + { + "name": "wh_192", + "value": "192vp" + }, + { + "name": "wh_205", + "value": "292vp" + }, + { + "name": "wh_263", + "value": "186vp" + }, + { + "name": "wh_hed_14", + "value": "14vp" + }, + { + "name": "wh_600", + "value": "600vp" + }, + { + "name": "padding_24", + "value": "24vp" + }, + { + "name": "padding_26", + "value": "14vp" + }, + { + "name": "wh_padding_32", + "value": "25vp" + }, + { + "name": "wh_padding_33", + "value": "20vp" + }, + { + "name": "wh_padding_35", + "value": "35vp" + }, + { + "name": "wh_padding_48", + "value": "24vp" + }, + { + "name": "wh_padding_112", + "value": "112vp" + }, + { + "name": "wh_padding_128", + "value": "128vp" + }, + { + "name": "wh_padding_212", + "value": "272vp" + }, + { + "name": "dataPanel_proportion_font_size_1", + "value": "60fp" + }, + { + "name": "dataPanel_percent_font_size_1", + "value": "16fp" + }, + { + "name": "dataPanel_used_font_size_1", + "value": "14fp" + }, + { + "name": "divider_wh", + "value": "0.5vp" + }, + { + "name": "progress_bottom", + "value": "127vp" + }, + { + "name": "head_font_24", + "value": "20vp" + } + ] +} \ No newline at end of file diff --git a/CertificateManager/product/phone/src/main/resources/phone/element/string.json b/CertificateManager/product/phone/src/main/resources/phone/element/string.json new file mode 100644 index 0000000..21e8873 --- /dev/null +++ b/CertificateManager/product/phone/src/main/resources/phone/element/string.json @@ -0,0 +1,48 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "证书管理FA" + }, + { + "name": "mainability_description", + "value": "ETS_Empty Feature Ability" + }, + { + "name": "certificateTab", + "value": "证书与凭据" + }, + { + "name": "certificateManage", + "value": "证书管理" + }, + { + "name": "trustedEvidence", + "value": "受信任的证书" + }, + { + "name": "userEvidence", + "value": "凭据列表" + }, + { + "name": "installInStorageDevice", + "value": "从存储设备安装" + }, + { + "name": "installCertificateFailed", + "value": "从存储设备安装失败" + }, + { + "name": "certificatePwdTab", + "value": "提取证书" + }, + { + "name": "certificatePwdInfo", + "value": "输入证书密码以提取" + }, + { + "name": "deleteAllCred", + "value": "删除所有凭据" + } + ] +} \ No newline at end of file diff --git a/CertificateManager/signature/OpenHarmony.p12 b/CertificateManager/signature/OpenHarmony.p12 new file mode 100644 index 0000000..60f9bb4 Binary files /dev/null and b/CertificateManager/signature/OpenHarmony.p12 differ diff --git a/CertificateManager/signature/OpenHarmonyApplication.cer b/CertificateManager/signature/OpenHarmonyApplication.cer new file mode 100644 index 0000000..825abdc --- /dev/null +++ b/CertificateManager/signature/OpenHarmonyApplication.cer @@ -0,0 +1,44 @@ +-----BEGIN CERTIFICATE----- +MIICRDCCAcmgAwIBAgIED+E4izAMBggqhkjOPQQDAwUAMGgxCzAJBgNVBAYTAkNO +MRQwEgYDVQQKEwtPcGVuSGFybW9ueTEZMBcGA1UECxMQT3Blbkhhcm1vbnkgVGVh +bTEoMCYGA1UEAxMfT3Blbkhhcm1vbnkgQXBwbGljYXRpb24gUm9vdCBDQTAeFw0y +MTAyMDIxMjE0MThaFw00OTEyMzExMjE0MThaMGgxCzAJBgNVBAYTAkNOMRQwEgYD +VQQKEwtPcGVuSGFybW9ueTEZMBcGA1UECxMQT3Blbkhhcm1vbnkgVGVhbTEoMCYG +A1UEAxMfT3Blbkhhcm1vbnkgQXBwbGljYXRpb24gUm9vdCBDQTB2MBAGByqGSM49 +AgEGBSuBBAAiA2IABE023XmRaw2DnO8NSsb+KG/uY0FtS3u5LQucdr3qWVnRW5ui +QIL6ttNZBEeLTUeYcJZCpayg9Llf+1SmDA7dY4iP2EcRo4UN3rilovtfFfsmH4ty +3SApHVFzWUl+NwdH8KNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC +AQYwHQYDVR0OBBYEFBc6EKGrGXzlAE+s0Zgnsphadw7NMAwGCCqGSM49BAMDBQAD +ZwAwZAIwd1p3JzHN93eoPped1li0j64npgqNzwy4OrkehYAqNXpcpaEcLZ7UxW8E +I2lZJ3SbAjAkqySHb12sIwdSFKSN9KCMMEo/eUT5dUXlcKR2nZz0MJdxT5F51qcX +1CumzkcYhgU= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIICYTCCAeWgAwIBAgIEHmXAPTAMBggqhkjOPQQDAwUAMGgxCzAJBgNVBAYTAkNO +MRQwEgYDVQQKEwtPcGVuSGFybW9ueTEZMBcGA1UECxMQT3Blbkhhcm1vbnkgVGVh +bTEoMCYGA1UEAxMfT3Blbkhhcm1vbnkgQXBwbGljYXRpb24gUm9vdCBDQTAeFw0y +MTAyMDIxMjE1MzJaFw00OTEyMzExMjE1MzJaMGMxCzAJBgNVBAYTAkNOMRQwEgYD +VQQKEwtPcGVuSGFybW9ueTEZMBcGA1UECxMQT3Blbkhhcm1vbnkgVGVhbTEjMCEG +A1UEAxMaT3Blbkhhcm1vbnkgQXBwbGljYXRpb24gQ0EwdjAQBgcqhkjOPQIBBgUr +gQQAIgNiAAQhnu7Hna8XNa2KyqRf5+lBJScE4xqf89N0g0OuqAb2re8nGsvWkw26 +uDekfnBYicd+G3Cydqa2zFIwV7Talyg2ULW3r8KbGpyl84mJEPPRmCGJ+H9gtCsf ++OrJ4Y76LVWjYzBhMB8GA1UdIwQYMBaAFBc6EKGrGXzlAE+s0Zgnsphadw7NMA8G +A1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTbhrciFtUL +oUu33SV7ufEFfaItRzAMBggqhkjOPQQDAwUAA2gAMGUCMG3cXjiDmXTvf7D4Omhf +qcc2nuO+EMfWE+N9ZhBP5UhV34mAGWi3SfLU6rcV0urWEQIxAMYIb3epOnKhUrcm +Lfu1WKzFlpYQwmw73RaCHP2I3k6NcuWOYeNwWXSNZ8o0nzvaLg== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIICMzCCAbegAwIBAgIEaOC/zDAMBggqhkjOPQQDAwUAMGMxCzAJBgNVBAYTAkNO +MRQwEgYDVQQKEwtPcGVuSGFybW9ueTEZMBcGA1UECxMQT3Blbkhhcm1vbnkgVGVh +bTEjMCEGA1UEAxMaT3Blbkhhcm1vbnkgQXBwbGljYXRpb24gQ0EwHhcNMjEwMjAy +MTIxOTMxWhcNNDkxMjMxMTIxOTMxWjBoMQswCQYDVQQGEwJDTjEUMBIGA1UEChML +T3Blbkhhcm1vbnkxGTAXBgNVBAsTEE9wZW5IYXJtb255IFRlYW0xKDAmBgNVBAMT +H09wZW5IYXJtb255IEFwcGxpY2F0aW9uIFJlbGVhc2UwWTATBgcqhkjOPQIBBggq +hkjOPQMBBwNCAATbYOCQQpW5fdkYHN45v0X3AHax12jPBdEDosFRIZ1eXmxOYzSG +JwMfsHhUU90E8lI0TXYZnNmgM1sovubeQqATo1IwUDAfBgNVHSMEGDAWgBTbhrci +FtULoUu33SV7ufEFfaItRzAOBgNVHQ8BAf8EBAMCB4AwHQYDVR0OBBYEFPtxruhl +cRBQsJdwcZqLu9oNUVgaMAwGCCqGSM49BAMDBQADaAAwZQIxAJta0PQ2p4DIu/ps +LMdLCDgQ5UH1l0B4PGhBlMgdi2zf8nk9spazEQI/0XNwpft8QAIwHSuA2WelVi/o +zAlF08DnbJrOOtOnQq5wHOPlDYB4OtUzOYJk9scotrEnJxJzGsh/ +-----END CERTIFICATE----- diff --git a/CertificateManager/signature/certmanager.p7b b/CertificateManager/signature/certmanager.p7b new file mode 100644 index 0000000..231eb12 Binary files /dev/null and b/CertificateManager/signature/certmanager.p7b differ diff --git a/CertificateManager/signature/material/ac/f9d9d313be7042d4933e55eb1e8402f6 b/CertificateManager/signature/material/ac/f9d9d313be7042d4933e55eb1e8402f6 new file mode 100644 index 0000000..99561a2 --- /dev/null +++ b/CertificateManager/signature/material/ac/f9d9d313be7042d4933e55eb1e8402f6 @@ -0,0 +1 @@ +@? E \ No newline at end of file diff --git a/CertificateManager/signature/material/ce/f7cfa6201a1644c5a0ba82969741aea2 b/CertificateManager/signature/material/ce/f7cfa6201a1644c5a0ba82969741aea2 new file mode 100644 index 0000000..110ccd7 Binary files /dev/null and b/CertificateManager/signature/material/ce/f7cfa6201a1644c5a0ba82969741aea2 differ diff --git a/CertificateManager/signature/material/fd/0/4667d093e8bc476ca6f801834e185457 b/CertificateManager/signature/material/fd/0/4667d093e8bc476ca6f801834e185457 new file mode 100644 index 0000000..117e970 --- /dev/null +++ b/CertificateManager/signature/material/fd/0/4667d093e8bc476ca6f801834e185457 @@ -0,0 +1 @@ +7h&|)? \ No newline at end of file diff --git a/CertificateManager/signature/material/fd/1/f5ed619c706f4a4db277ca6beb69de56 b/CertificateManager/signature/material/fd/1/f5ed619c706f4a4db277ca6beb69de56 new file mode 100644 index 0000000..0069d24 --- /dev/null +++ b/CertificateManager/signature/material/fd/1/f5ed619c706f4a4db277ca6beb69de56 @@ -0,0 +1 @@ +kR[|8O[ \ No newline at end of file diff --git a/CertificateManager/signature/material/fd/2/3aa4a14d432a48efb922fca804629ff8 b/CertificateManager/signature/material/fd/2/3aa4a14d432a48efb922fca804629ff8 new file mode 100644 index 0000000..5efccd1 --- /dev/null +++ b/CertificateManager/signature/material/fd/2/3aa4a14d432a48efb922fca804629ff8 @@ -0,0 +1 @@ +o 5ehì.ЁO \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d0381d6 --- /dev/null +++ b/LICENSE @@ -0,0 +1,176 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/OAT.xml b/OAT.xml new file mode 100644 index 0000000..3c88b5e --- /dev/null +++ b/OAT.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/README.md b/README.md index fe358dd..8594948 100644 --- a/README.md +++ b/README.md @@ -1,39 +1,12 @@ -# security_privacy_center +# 安全隐私中心 -#### 介绍 -{**以下是 Gitee 平台说明,您可以替换此简介** -Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台 -无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)} +## 简介 -#### 软件架构 -软件架构说明 +### 内容介绍 + +安全隐私中心模块包含提供安全和隐私保护能力的系统应用。 -#### 安装教程 +### 目录 -1. xxxx -2. xxxx -3. xxxx - -#### 使用说明 - -1. xxxx -2. xxxx -3. xxxx - -#### 参与贡献 - -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request - - -#### 特技 - -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 -5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) +[证书管理](CertificateManager/readme.md)