diff --git a/ui/Settings_FaceAuth/.gitignore b/ui/Settings_FaceAuth/.gitignore
new file mode 100644
index 0000000..fdc0c4a
--- /dev/null
+++ b/ui/Settings_FaceAuth/.gitignore
@@ -0,0 +1,16 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+/entry/.preview
+.cxx
+/node_modules
diff --git a/ui/Settings_FaceAuth/.idea/.gitignore b/ui/Settings_FaceAuth/.idea/.gitignore
new file mode 100644
index 0000000..26d3352
--- /dev/null
+++ b/ui/Settings_FaceAuth/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/ui/Settings_FaceAuth/.idea/compiler.xml b/ui/Settings_FaceAuth/.idea/compiler.xml
new file mode 100644
index 0000000..fb7f4a8
--- /dev/null
+++ b/ui/Settings_FaceAuth/.idea/compiler.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ui/Settings_FaceAuth/.idea/gradle.xml b/ui/Settings_FaceAuth/.idea/gradle.xml
new file mode 100644
index 0000000..b27c1ff
--- /dev/null
+++ b/ui/Settings_FaceAuth/.idea/gradle.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ui/Settings_FaceAuth/.idea/jarRepositories.xml b/ui/Settings_FaceAuth/.idea/jarRepositories.xml
new file mode 100644
index 0000000..19e238e
--- /dev/null
+++ b/ui/Settings_FaceAuth/.idea/jarRepositories.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ui/Settings_FaceAuth/.idea/misc.xml b/ui/Settings_FaceAuth/.idea/misc.xml
new file mode 100644
index 0000000..58918f5
--- /dev/null
+++ b/ui/Settings_FaceAuth/.idea/misc.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/ui/Settings_FaceAuth/.idea/previewer/phone/phoneSettingConfig_MateX2.json b/ui/Settings_FaceAuth/.idea/previewer/phone/phoneSettingConfig_MateX2.json
new file mode 100644
index 0000000..69beee7
--- /dev/null
+++ b/ui/Settings_FaceAuth/.idea/previewer/phone/phoneSettingConfig_MateX2.json
@@ -0,0 +1,25 @@
+{
+ "setting": {
+ "1.0.1": {
+ "Language": {
+ "args": {
+ "Language": "zh_CN"
+ }
+ }
+ }
+ },
+ "frontend": {
+ "1.0.0": {
+ "Resolution": {
+ "args": {
+ "Resolution": "360*780"
+ }
+ },
+ "DeviceType": {
+ "args": {
+ "DeviceType": "phone"
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/ui/Settings_FaceAuth/.idea/previewer/phone/phoneSettingConfig_P40.json b/ui/Settings_FaceAuth/.idea/previewer/phone/phoneSettingConfig_P40.json
new file mode 100644
index 0000000..69beee7
--- /dev/null
+++ b/ui/Settings_FaceAuth/.idea/previewer/phone/phoneSettingConfig_P40.json
@@ -0,0 +1,25 @@
+{
+ "setting": {
+ "1.0.1": {
+ "Language": {
+ "args": {
+ "Language": "zh_CN"
+ }
+ }
+ }
+ },
+ "frontend": {
+ "1.0.0": {
+ "Resolution": {
+ "args": {
+ "Resolution": "360*780"
+ }
+ },
+ "DeviceType": {
+ "args": {
+ "DeviceType": "phone"
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/ui/Settings_FaceAuth/.idea/previewer/previewConfigV2.json b/ui/Settings_FaceAuth/.idea/previewer/previewConfigV2.json
new file mode 100644
index 0000000..aef592d
--- /dev/null
+++ b/ui/Settings_FaceAuth/.idea/previewer/previewConfigV2.json
@@ -0,0 +1,37 @@
+{
+ "1.0.0": {
+ "LastPreviewDevice": {}
+ },
+ "1.0.1": {
+ "profileList": [
+ {
+ "id": "P40",
+ "deviceType": "phone",
+ "width": 1080,
+ "height": 2340,
+ "shape": "rect",
+ "dpi": 480,
+ "orientation": "portrait",
+ "language": "zh_CN",
+ "colorMode": "light"
+ },
+ {
+ "id": "MateX2",
+ "deviceType": "phone",
+ "width": 2200,
+ "height": 2480,
+ "shape": "rect",
+ "dpi": 520,
+ "orientation": "portrait",
+ "language": "zh_CN",
+ "colorMode": "light"
+ }
+ ],
+ "runningProfileList": [
+ "MateX2"
+ ],
+ "availableProfileList": [
+ "P40"
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ui/Settings_FaceAuth/.idea/vcs.xml b/ui/Settings_FaceAuth/.idea/vcs.xml
new file mode 100644
index 0000000..288b36b
--- /dev/null
+++ b/ui/Settings_FaceAuth/.idea/vcs.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ui/faceenroll/build.gradle b/ui/Settings_FaceAuth/build.gradle
similarity index 72%
rename from ui/faceenroll/build.gradle
rename to ui/Settings_FaceAuth/build.gradle
index 1e889bb..8d7822b 100644
--- a/ui/faceenroll/build.gradle
+++ b/ui/Settings_FaceAuth/build.gradle
@@ -1,3 +1,4 @@
+
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,40 +17,34 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
apply plugin: 'com.huawei.ohos.app'
+//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510
ohos {
- compileSdkVersion 7
- defaultConfig {
- compatibleSdkVersion 6
- }
+ compileSdkVersion 8
supportSystem "standard"
}
buildscript {
repositories {
maven {
- url 'https://mirrors.huaweicloud.com/repository/maven/'
+ url 'https://repo.huaweicloud.com/repository/maven/'
}
maven {
url 'https://developer.huawei.com/repo/'
}
- maven {
- url 'http://repo.ark.tools.huawei.com/artifactory/maven-public/'
- }
- jcenter()
}
dependencies {
- classpath 'com.huawei.ohos:hap:3.0.3.2'
+ classpath 'com.huawei.ohos:hap:3.0.5.2'
+ classpath 'com.huawei.ohos:decctest:1.2.7.2'
}
}
allprojects {
repositories {
maven {
- url 'https://mirrors.huaweicloud.com/repository/maven/'
+ url 'https://repo.huaweicloud.com/repository/maven/'
}
maven {
url 'https://developer.huawei.com/repo/'
}
- jcenter()
}
}
diff --git a/ui/Settings_FaceAuth/entry/.gitignore b/ui/Settings_FaceAuth/entry/.gitignore
new file mode 100644
index 0000000..7d5b7a9
--- /dev/null
+++ b/ui/Settings_FaceAuth/entry/.gitignore
@@ -0,0 +1,2 @@
+/build
+/node_modules
diff --git a/ui/faceenroll/product/pad/build.gradle b/ui/Settings_FaceAuth/entry/build.gradle
similarity index 86%
rename from ui/faceenroll/product/pad/build.gradle
rename to ui/Settings_FaceAuth/entry/build.gradle
index 264827e..53aaded 100644
--- a/ui/faceenroll/product/pad/build.gradle
+++ b/ui/Settings_FaceAuth/entry/build.gradle
@@ -16,12 +16,10 @@
apply plugin: 'com.huawei.ohos.hap'
//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510
ohos {
- compileSdkVersion 7
+ compileSdkVersion 8
defaultConfig {
- compatibleSdkVersion 7
+ compatibleSdkVersion 8
}
- arkEnabled false
-
buildTypes {
release {
proguardOpt {
@@ -30,9 +28,9 @@ ohos {
}
}
}
-
}
dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar', '*.har'])
+ testImplementation 'junit:junit:4.13.1'
}
-
diff --git a/ui/Settings_FaceAuth/entry/proguard-rules.pro b/ui/Settings_FaceAuth/entry/proguard-rules.pro
new file mode 100644
index 0000000..f7666e4
--- /dev/null
+++ b/ui/Settings_FaceAuth/entry/proguard-rules.pro
@@ -0,0 +1 @@
+# config module specific ProGuard rules here.
\ No newline at end of file
diff --git a/ui/faceenroll/product/phone/src/main/config.json b/ui/Settings_FaceAuth/entry/src/main/config.json
similarity index 57%
rename from ui/faceenroll/product/phone/src/main/config.json
rename to ui/Settings_FaceAuth/entry/src/main/config.json
index c66e027..fa182b9 100644
--- a/ui/faceenroll/product/phone/src/main/config.json
+++ b/ui/Settings_FaceAuth/entry/src/main/config.json
@@ -1,6 +1,6 @@
{
"app": {
- "bundleName": "com.ohos.faceEnroll",
+ "bundleName": "com.ohos.settings.faceauth",
"vendor": "ohos",
"version": {
"code": 1000000,
@@ -9,14 +9,14 @@
},
"deviceConfig": {},
"module": {
- "package": "com.ohos.faceEnroll",
+ "package": "com.ohos.settings.faceauth",
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
- "moduleName": "phone",
+ "moduleName": "entry",
"moduleType": "entry",
"installationFree": true
},
@@ -25,23 +25,19 @@
"skills": [
{
"entities": [
- "entity.system.home",
- "flag.home.intent.from.system"
],
"actions": [
- "action.system.home",
- "com.ohos.action.main"
]
}
],
"visible": true,
- "name": "com.ohos.faceEnroll.MainAbility",
+ "name": ".enrollmentstartview",
"icon": "$media:icon",
- "description": "$string:mainability_description",
- "label": "$string:app_name",
+ "description": "$string:description_enrollmentstartview",
+ "label": "$string:entry_enrollmentstartview",
"type": "page",
"launchType": "singleton",
- "srcPath": "default",
+ "srcPath": "enrollmentstartview",
"srcLanguage": "ets",
"metaData": {
"customizeData": [
@@ -52,6 +48,20 @@
}
}
],
+ "reqPermissions": [
+ {
+ "name": "ohos.permission.USE_USER_IDM"
+ },
+ {
+ "name": "ohos.permission.MANAGE_USER_IDM"
+ },
+ {
+ "name": "ohos.permission.ACCESS_USER_AUTH_INTERNAL"
+ },
+ {
+ "name": "ohos.permission.ACCESS_PIN_AUTH"
+ }
+ ],
"js": [
{
"mode": {
@@ -60,17 +70,12 @@
},
"pages": [
"pages/entryView",
- "pages/userAuth",
- "pages/userSettings",
- "pages/index",
- "pages/enroll_2D",
- "pages/success",
- "pages/enroll_3D",
- "pages/declare",
- "pages/startViews_2D",
- "pages/startViews_3D"
+ "pages/faceConfig",
+ "pages/enrolling",
+ "pages/enrollDeclare",
+ "pages/enrollIntro"
],
- "name": "default",
+ "name": ".enrollmentstartview",
"window": {
"designWidth": 720,
"autoDesignWidth": false
diff --git a/ui/faceenroll/product/phone/src/main/ets/default/app.ets b/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/app.ets
similarity index 52%
rename from ui/faceenroll/product/phone/src/main/ets/default/app.ets
rename to ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/app.ets
index ab5e2d8..8300b2c 100644
--- a/ui/faceenroll/product/phone/src/main/ets/default/app.ets
+++ b/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/app.ets
@@ -13,12 +13,25 @@
* limitations under the License.
*/
-export default {
- onCreate() {
- console.info('FaceEnroll entry Application onCreate')
- },
- onDestroy() {
- console.info('FaceEnroll entry Application onDestroy')
- },
+import Log from './utils/log.ets'
+import UserIDMModel from './model/userIDMModel.ets'
+import CommonController from './controller/commonController.ets'
-}
+var TAG:string = 'App:'
+
+export default {
+ onCreate() {
+ Log.info(TAG, 'Application onCreate+')
+ Log.info(TAG, 'Application onCreate-')
+ },
+ onDestroy() {
+ Log.info(TAG, 'Application onDestroy+')
+ UserIDMModel.destroy()
+ Log.info(TAG, 'Application onDestroy-')
+ },
+ onHide() {
+ Log.info(TAG, 'Application onHide+, terminate ability')
+ CommonController.terminateAbility()
+ Log.info(TAG, 'Application onHide-')
+ }
+}
\ No newline at end of file
diff --git a/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/component/backComponent.ets b/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/component/backComponent.ets
new file mode 100644
index 0000000..dc826ca
--- /dev/null
+++ b/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/component/backComponent.ets
@@ -0,0 +1,70 @@
+/*
+ * 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 '../utils/log.ets'
+import commonControler from '../controller/commonController.ets'
+import Constants from '../config/constant.ets'
+
+@Preview
+@Component
+export default struct BackComponent {
+ private prevTag: string
+ private title: string = ""
+ private TAG : string = "BackComponent"
+ @State isTouch: boolean = false
+
+ aboutToAppear() {
+ this.TAG = this.prevTag + "BackComp:"
+ }
+
+ build() {
+ Row() {
+ Image($r('app.media.back_op'))
+ .height('50')
+ .width('50')
+ .borderRadius(15)
+ .backgroundColor(this.isTouch? "#E3E3E3": "#00000000")
+ .onClick(() => {
+ Log.info(this.TAG, 'back image onClick +')
+ commonControler.routeBack()
+ Log.info(this.TAG, 'back image onClick -')
+ })
+ .margin({
+ left: 15,
+ top: 5,
+ bottom: 5
+ })
+ .onTouch((event: TouchEvent) => {
+ if (event.type === TouchType.Down) {
+ this.isTouch = true;
+ }
+ if (event.type === TouchType.Up) {
+ this.isTouch = false;
+ }
+ })
+ Text(this.title)
+ .fontSize(24)
+ .fontWeight(FontWeight.Bold)
+ .width('90%')
+ .maxLines(1)
+ .textOverflow({ overflow: TextOverflow.Ellipsis })
+ .margin({ left: 15, right: 15 });
+ }.width('100%')
+ .height(70)
+ .width("100%")
+ .alignItems(VerticalAlign.Center)
+ .align(Alignment.Start);
+ }
+}
\ No newline at end of file
diff --git a/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/component/confirmDialog.ets b/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/component/confirmDialog.ets
new file mode 100644
index 0000000..6279ab3
--- /dev/null
+++ b/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/component/confirmDialog.ets
@@ -0,0 +1,77 @@
+/*
+ * 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 '../utils/log.ets'
+import Constants from '../config/constant.ets'
+import DefaultConstants from '../config/defaultConstant.ets'
+import UserIDMModel from '../model/userIDMModel.ets'
+
+@CustomDialog
+export default struct ConfirmDialog {
+ private TAG: string = "ConfirmDialog:"
+ private controller: CustomDialogController;
+ @Prop title: string
+ @Prop content: string
+ @Prop confirmText: string
+ @Prop cancelText: string
+ private confirmOperation: ()=>{}
+
+ build() {
+ Column() {
+ Text(this.title)
+ .fontSize(DefaultConstants.OVERSIZE_FONT_SIZE)
+ .margin({ bottom: DefaultConstants.PADDING_20 })
+ Text(this.content)
+ .fontSize(DefaultConstants.LARGE_FONT_SIZE)
+ .margin({ bottom: DefaultConstants.PADDING_16 })
+ .margin({ left: -DefaultConstants.PADDING_10, bottom: DefaultConstants.PADDING_20 })
+
+ Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) {
+ Text(this.cancelText)
+ .fontColor($r('app.color.startView_color'))
+ .fontSize(DefaultConstants.LARGE_FONT_SIZE)
+ .onClick(() => {
+ Log.info(this.TAG, "click cancel+")
+ this.controller.close()
+ Log.info(this.TAG, "click cancel-")
+ })
+ Divider()
+ .vertical(true)
+ .strokeWidth(DefaultConstants.DIVIDER)
+ .color(DefaultConstants.DARK_GREY_BACKGROUND_COLOR)
+ .height(DefaultConstants.PADDING_30)
+ Text(this.confirmText)
+ .fontColor(Color.Red)
+ .fontSize(DefaultConstants.LARGE_FONT_SIZE)
+ .onClick(() => {
+ Log.info(this.TAG, "click confirm+")
+ this.confirmOperation()
+ Log.info(this.TAG, "click confirm-")
+ this.controller.close()
+ })
+ }
+ }
+ .width(DefaultConstants.TOTAL_WIDTH)
+ .borderRadius(DefaultConstants.BORDER_RADIUS)
+ .backgroundColor(DefaultConstants.WHITE_BACKGROUND_COLOR)
+ .alignItems(HorizontalAlign.Start)
+ .padding({
+ bottom: DefaultConstants.PADDING_30,
+ top: DefaultConstants.PADDING_20,
+ left: DefaultConstants.PADDING_30,
+ right: DefaultConstants.PADDING_30
+ })
+ }
+}
\ No newline at end of file
diff --git a/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/config/config.ets b/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/config/config.ets
new file mode 100644
index 0000000..3c4966a
--- /dev/null
+++ b/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/config/config.ets
@@ -0,0 +1,51 @@
+/*
+ * 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 '../utils/log.ets'
+import deviceInfo from '@ohos.deviceInfo'
+import display from '@ohos.display';
+
+class Config {
+ private TAG: string = "Config:"
+ private deviceType : string = "tablet"
+ private nonAppBarDisplayHeight: number = 0
+ private nonDisplayHeight: number = 0
+
+ constructor() {
+ Log.info(this.TAG, "constructor+")
+ display.getDefaultDisplay().then((display)=>{
+ if (typeof display.height === "string") {
+ Log.info(this.TAG, "mock mode ")
+ this.deviceType = "tablet"
+ return
+ }
+ Log.info(this.TAG, "display height: " + display.height +
+ " display width: " + display.width)
+ if (display.height > display.width) {
+ this.deviceType = "phone"
+ } else {
+ this.deviceType = "tablet"
+ }
+ })
+ Log.info(this.TAG, "constructor-")
+ }
+
+ getDeviceType() : string {
+ return this.deviceType
+ }
+}
+
+let config = new Config();
+export default config as Config
\ No newline at end of file
diff --git a/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/config/constant.ets b/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/config/constant.ets
new file mode 100644
index 0000000..daf07c8
--- /dev/null
+++ b/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/config/constant.ets
@@ -0,0 +1,192 @@
+/*
+ * 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 default class Constants {
+ //code and errorCode
+ static CODE_RESULT = 1
+ static CODE_CANCEL = 2
+ static CODE_ACQUIRE = 3
+ static ERROR_CODE_SUCCESS = 0
+ static ERROR_CODE_FAIL = 1
+ static ERROR_CODE_CANCEL = 2
+ static ERROR_CODE_TIMEOUT = 4
+ static ERROR_CODE_ALGORITHM_NOT_INIT = 5
+ static ERROR_CODE_HAL_INVALID = 6
+ static ERROR_CODE_OVER_MAX_FACES = 7
+ static ERROR_CODE_INVALID_PARAMETERS = 9
+ static ERROR_CODE_BUSY = 13
+ static ERROR_CODE_ENROLL_HAS_REGISTERED = 16
+ static ERROR_CODE_FACE_DETECTED = 38
+ static ERROR_CODE_BAD_QUALITY = 4
+ static ERROR_CODE_NOT_FOUND = 5
+ static ERROR_CODE_TOO_SMALL = 6
+ static ERROR_CODE_TOO_LARGE = 7
+ static ERROR_CODE_OFFSET_LEFT = 8
+ static ERROR_CODE_OFFSET_TOP = 9
+ static ERROR_CODE_OFFSET_RIGHT = 10
+ static ERROR_CODE_OFFSET_BOTTOM = 11
+ static ERROR_CODE_LIVENESS_WARNING = 13
+ static ERROR_CODE_LIVENESS_FAILURE = 14
+ static ERROR_CODE_ROTATED_LEFT = 15
+ static ERROR_CODE_RISE = 16
+ static ERROR_CODE_ROTATED_RIGHT = 17
+ static ERROR_CODE_DOWN = 18
+ static ERROR_CODE_EYE_OCCLUSION = 21
+ static ERROR_CODE_EYE_CLOSE = 22
+ static ERROR_CODE_MOUTH_OCCLUSION = 23
+ static ERROR_CODE_MULTI = 27
+ static ERROR_CODE_BLUR = 28
+ static ERROR_CODE_NOT_COMPLETE = 29
+ static ERROR_CODE_DARKLIGHT = 30
+ static ERROR_CODE_HIGHTLIGHT = 31
+ static ERROR_CODE_HALF_SHADOW = 32
+ static ERROR_CODE_HAS_REGISTERED = 37
+ static ERROR_CODE_DARKPIC = 39
+ static ERROR_CODE_ROTATE_TOP_RIGHT = 40
+ static ERROR_CODE_ROTATE_TOP_LEFT = 41
+ static ERROR_CODE_ROTATE_BOTTOM_RIGHT = 42
+ static ERROR_CODE_ROTATE_BOTTOM_LEFT = 43
+ static ERROR_CODE_OPEN_CAMERA_FAILED = 46
+ static ERROR_CODE_PROGRESS_FIRST = 1004
+ static ERROR_CODE_PROGRESS_SECOND = 1008
+ static ERROR_CODE_PROGRESS_THIRD = 1012
+ static PARAM_TOKEN = "check"
+ static FLAGS = 0
+ static FACEID = 0
+ static PREVIEWID = 2
+
+ //setTimeout
+ static TIMEOUT_100 = 100
+ static TIMEOUT_200 = 200
+ static TIMEOUT_300 = 300
+ static TIMEOUT_400 = 400
+ static TIMEOUT_500 = 500
+ static TIMEOUT_600 = 600
+ static TIMEOUT_700 = 700
+ static TIMEOUT_800 = 800
+ static TIMEOUT_900 = 900
+ static TIMEOUT_1000 = 1000
+ static TIMEOUT_1100 = 1100
+ static TIMEOUT_1200 = 1200
+ static TIMEOUT_1300 = 1300
+ static TIMEOUT_1400 = 1400
+ static TIMEOUT_1500 = 1500
+ static TIMEOUT_1600 = 1600
+ static TIMEOUT_1700 = 1700
+ static TIMEOUT_1800 = 1800
+ static TIMEOUT_1900 = 1900
+ static TIMEOUT_2000 = 2000
+ static TIMEOUT_3000 = 3000
+
+ //UI
+ static SHELTER_ANIMATOR = 1000
+ static PROGRESS_START = 0
+ static PROGRESS_TOTAL = 100
+ static FONT_WEIGHT = 500
+ static SHELTER_START_WIDTH = 1100
+ static SHELTER_END_WIDTH = '100%'
+ static CENTER_HEIGHT = '620px'
+ static SHELTER_START_HEIGHT = '2000px'
+ static SHELTER_END_HEIGHT = '640px'
+ static SHELTER_3D_END_HEIGHT = '640px'
+ static PROGRESS_VALUE_FIRST = 30
+ static PROGRESS_VALUE_SECOND = 60
+ static PROGRESS_VALUE_THIRD = 100
+ static SPACE = 20
+ static INITIAL_INDEX = 0
+ static HEIGHT_LIST = 60
+ static FONTSIZE_16 = 16
+ static BORDER_RADIUS = 10
+ static STROKE_WIDTH = 2
+ static START_MARGIN = 20
+ static END_MARGIN = 20
+ static SHOW_START_VIEWS_3D = '3D'
+ static SHOW_START_VIEWS_2D = '2D'
+ static LIST_PADDING = 5
+ static BLUR_START = 0
+ static BLUR_END = 40
+ static CENTER_POSITION_Y = 5
+ static BUTTON_POSITION = '92%'
+ static ENROLL_INFO_POSITION = '918px'
+ static ENROLL_INFO_WIDTH = '90%'
+ static CHECKBOX_POSITION_X = '5%'
+ static CHECKBOX_POSITION_Y = '85%'
+ static CHECKBOX_TEXT_POSITION_X = '18%'
+ static CHECKBOX_TEXT_POSITION_Y = '87%'
+
+ static PROGRESS_WIDTH = '460px'
+ static BACK_WIDTH = '136px'
+ static BACK_HEIGHT = '110px'
+ static TITLE_FONT_SIZE = '48px'
+ static TITLE_MARGIN = '24px'
+ static TITLE_ENROLLING_MARGIN = '140px'
+ static IMAGE_MARGIN = '96px'
+ static IMAGE_3D_MARGIN = '48px'
+ static FONT_SIZE = '28px'
+ static SMALL_TITLE_FONT_SIZE = '36px'
+ static CONTENT1_MARGIN = '16px'
+ static CONTENT2_MARGIN = '8px'
+ static BUTTON_FONT_SIZE = '32px'
+ static BUTTON_WIDTH = '384px'
+ static BUTTON_HEIGHT = '80px'
+ static IMAGE_2D_HEIGHT = '480px'
+ static IMAGE_3D_WIDTH = '512px'
+ static ERROR_CODE_INFO_SIZE = '32px'
+ static ENROLL_CENTER_POSITION_Y = '240px'
+ static SUCCESS_WIDTH = '204px'
+ static CHECKBOX_SIZE = '60px'
+ static APERTURE1_WIDTH = '266px'
+ static APERTURE2_WIDTH = '264px'
+ static APERTURE34_WIDTH = '284px'
+ static APERTURE5_WIDTH = '466px'
+
+ //PROGRESS
+ static PROGRESS_VALUE_5 = 5
+ static PROGRESS_VALUE_10 = 10
+ static PROGRESS_VALUE_15 = 15
+ static PROGRESS_VALUE_20 = 20
+ static PROGRESS_VALUE_25 = 25
+ static PROGRESS_VALUE_30 = 30
+ static PROGRESS_VALUE_35 = 35
+ static PROGRESS_VALUE_40 = 40
+ static PROGRESS_VALUE_45 = 45
+ static PROGRESS_VALUE_50 = 50
+ static PROGRESS_VALUE_55 = 55
+ static PROGRESS_VALUE_60 = 60
+ static PROGRESS_VALUE_65 = 65
+ static PROGRESS_VALUE_70 = 70
+ static PROGRESS_VALUE_75 = 75
+ static PROGRESS_VALUE_80 = 80
+ static PROGRESS_VALUE_85 = 85
+ static PROGRESS_VALUE_90 = 90
+ static PROGRESS_VALUE_95 = 95
+ static PROGRESS_VALUE_100 = 100
+
+ static DECLARE_WIDTH = '90%'
+ static DECLARE_MAX_WIDTH = '100%'
+ static DECLARE_TITLE_FONT_SIZE = 24
+ static DECLARE_SECONDARY_TITLE_FONT_SIZE = 23
+ static DECLARE_TEXT_FONT_SIZE = 22
+ static DECLARE_ITEM_MARGIN_BOTTOM = 10
+ static DECLARE_TITLE_MARGIN_TOP = 20
+ static DECLARE_TITLE_MARGIN_BOTTOM = 20
+ static DECLARE_TEXT_LINE_HEIGHT = 33
+ static DECLARE_SCROLL_BAR_WIDTH = 0
+ static DECLARE_BACKGROUND_COLOR = "#F2F3F5"
+ static DECLARE_TITLE_2 = "2."
+ static DECLARE_TITLE_3 = "3."
+ static DECLARE_TITLE_4 = "4."
+ static DECLARE_TITLE_5 = "5."
+}
\ No newline at end of file
diff --git a/ui/faceenroll/feature/faceSettings/src/main/ets/default/common/DefaultConstants.ets b/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/config/defaultConstant.ets
similarity index 99%
rename from ui/faceenroll/feature/faceSettings/src/main/ets/default/common/DefaultConstants.ets
rename to ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/config/defaultConstant.ets
index e24c9c7..9900707 100644
--- a/ui/faceenroll/feature/faceSettings/src/main/ets/default/common/DefaultConstants.ets
+++ b/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/config/defaultConstant.ets
@@ -12,6 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
export default class StyleConstants {
public static DEFAULT_FONT_COLOR: string = '#ffffff'
public static TOTAL_WIDTH: string = '93%';
diff --git a/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/controller/commonController.ets b/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/controller/commonController.ets
new file mode 100644
index 0000000..8eca5f1
--- /dev/null
+++ b/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/controller/commonController.ets
@@ -0,0 +1,93 @@
+/*
+ * 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 '../utils/log.ets'
+import router from '@system.router';
+import FeatureAbility from '@ohos.ability.featureAbility';
+import Config from '../config/config.ets'
+import UserIDMModel from '../model/userIDMModel.ets'
+
+class CommonController {
+ private TAG: string = "CommonController:"
+
+ async routeBack() {
+ if (router.getLength() > 1) {
+ Log.info(this.TAG, 'router back: back+')
+ router.back()
+ Log.info(this.TAG, 'router back: back-')
+ } else {
+ Log.info(this.TAG, 'router back: terminate ability+')
+ this.terminateAbility()
+ Log.info(this.TAG, 'router back: terminate ability-')
+ }
+ }
+
+ async terminateAbility() {
+ Log.info(this.TAG, 'terminate ability+')
+ UserIDMModel.destroy()
+ FeatureAbility.terminateAbility()
+ Log.info(this.TAG, 'terminate ability-')
+ }
+
+ async sleepMS(ms) {
+ return new Promise(resolve => setTimeout(resolve, ms));
+ }
+
+ getDialogAlignment():DialogAlignment {
+ if (Config.getDeviceType() === 'phone') {
+ return DialogAlignment.Bottom
+ } else {
+ return DialogAlignment.Center
+ }
+ }
+
+ getHeightPercentageBegin(width: number, height: number) :string {
+ var a = width / 2
+ var b = height / 2
+ var R = Math.sqrt(a * a + b * b)
+ var H = R / 0.3
+ var HPercentage = "" + Math.trunc(H * 166 / height) + '%'
+ return HPercentage
+ }
+
+ setNonAppBarDisplaySize(nonAppBarDisplayWidth: number, nonAppBarDisplayHeight: number) {
+ if (Config.getDeviceType() != 'phone') {
+ return;
+ }
+ AppStorage.SetOrCreate('enrollImageHeight', nonAppBarDisplayHeight / 2);
+ AppStorage.SetOrCreate('enrollImageWidth', nonAppBarDisplayWidth);
+ // when percentage is 166%, circular diameter == height
+ AppStorage.SetOrCreate('stackShelterHeightBegin',
+ this.getHeightPercentageBegin(nonAppBarDisplayWidth, nonAppBarDisplayHeight / 2));
+ AppStorage.SetOrCreate('stackShelterHeightEnd', "133%"); // 166 * 0.8
+ AppStorage.SetOrCreate('stackRingHeightPercentage', "85%");
+ }
+
+ setDisplaySize(displayWidth: number, displayHeight: number) {
+ if (Config.getDeviceType() != 'tablet') {
+ return;
+ }
+ var sideLength = Math.min(displayWidth, displayHeight / 2) * 0.8
+ AppStorage.SetOrCreate('enrollImageHeight', sideLength);
+ AppStorage.SetOrCreate('enrollImageWidth', sideLength);
+ AppStorage.SetOrCreate('stackShelterHeightBegin',
+ this.getHeightPercentageBegin(sideLength, sideLength));
+ AppStorage.SetOrCreate('stackShelterHeightEnd', "146%"); // 166 * 0.88
+ AppStorage.SetOrCreate('stackRingHeightPercentage', "94%");
+ }
+}
+
+let commonController = new CommonController();
+export default commonController as CommonController
\ No newline at end of file
diff --git a/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/controller/enrollingController.ets b/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/controller/enrollingController.ets
new file mode 100644
index 0000000..1cde268
--- /dev/null
+++ b/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/controller/enrollingController.ets
@@ -0,0 +1,136 @@
+/*
+ * 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 '../utils/log.ets'
+import router from '@system.router';
+import Config from '../config/config.ets'
+import CommonController from '../controller/commonController.ets'
+import UserIDMModel from '../model/userIDMModel.ets'
+
+class EnrollingController {
+ private TAG: string = "EnrollingController:"
+
+ constructor() {
+ Log.info(this.TAG, 'constructor+')
+ Log.info(this.TAG, 'constructor-')
+ }
+
+ init() {
+ Log.info(this.TAG, 'init+')
+ AppStorage.Set('stackVideoVisibility', Visibility.Visible);
+ AppStorage.Set('stackShelterVisibility', Visibility.Hidden);
+ AppStorage.Set('stackProgressVisibility', Visibility.Hidden);
+ AppStorage.Set('stackSuccessVisibility', Visibility.Hidden);
+ AppStorage.Set('enrollTipVisibility', Visibility.Visible);
+ AppStorage.Set('enrollButtonVisibility', Visibility.Hidden);
+
+ AppStorage.Set('stackProgressValue', 0);
+ AppStorage.Set('stackShelterHeight', AppStorage.Get('stackShelterHeightBegin'));
+ AppStorage.Set('enrollTip', '');
+ AppStorage.Set('stackVideoBlurRadius', 0);
+
+ AppStorage.Set('enrollStatus', $r('app.string.enrolling'));
+
+ UserIDMModel.setOnAcquireCallback(this.onAcquire.bind(this))
+ UserIDMModel.enrollFace().then(this.processResult.bind(this))
+ Log.info(this.TAG, 'init-')
+ }
+
+ async processResult(result : number) {
+ await this.faceDetected()
+ await this.enrollProcessing()
+ if (result == 0) {
+ await this.enrollSuccess()
+ } else {
+ await this.enrollFail()
+ }
+ }
+
+ async onAcquire(result: number) {
+ Log.info(this.TAG, 'onAcuquire+ result: ' + result)
+ if (result === 25) {
+ Log.info(this.TAG, 'onAcuquire face detected+')
+ this.faceDetected()
+ Log.info(this.TAG, 'onAcuquire face detected-')
+ }
+ Log.info(this.TAG, 'onAcuquire-')
+ }
+
+ async faceDetected() {
+ Log.info(this.TAG, 'faceDetected+')
+ AppStorage.Set('stackVideoVisibility', Visibility.Visible);
+ AppStorage.Set('stackShelterVisibility', Visibility.Visible);
+ AppStorage.Set('stackProgressVisibility', Visibility.Hidden);
+ AppStorage.Set('stackSuccessVisibility', Visibility.Hidden);
+ AppStorage.Set('enrollTipVisibility', Visibility.Visible);
+ AppStorage.Set('enrollButtonVisibility', Visibility.Hidden);
+
+ AppStorage.Set('stackShelterHeight', AppStorage.Get('stackShelterHeightEnd'));
+ await CommonController.sleepMS(2000)
+ Log.info(this.TAG, 'faceDetected-')
+ }
+
+ async enrollProcessing() {
+ Log.info(this.TAG, 'enrollProcessing+')
+ AppStorage.Set('stackVideoVisibility', Visibility.Visible);
+ AppStorage.Set('stackShelterVisibility', Visibility.Visible);
+ AppStorage.Set('stackProgressVisibility', Visibility.Visible);
+ AppStorage.Set('stackSuccessVisibility', Visibility.Hidden);
+ AppStorage.Set('enrollTipVisibility', Visibility.Hidden);
+ AppStorage.Set('enrollButtonVisibility', Visibility.Hidden);
+
+ for (let i=0; i <= 100; i+=1) {
+ await CommonController.sleepMS(30)
+ AppStorage.Set('stackProgressValue', i);
+ }
+
+ Log.info(this.TAG, 'enrollProcessing-')
+ }
+
+ async enrollSuccess() {
+ Log.info(this.TAG, 'enrollSuccess+')
+ AppStorage.Set('stackVideoVisibility', Visibility.Hidden);
+ AppStorage.Set('stackShelterVisibility', Visibility.Hidden);
+ AppStorage.Set('stackProgressVisibility', Visibility.Hidden);
+ AppStorage.Set('stackSuccessVisibility', Visibility.Visible);
+ AppStorage.Set('enrollTipVisibility', Visibility.Hidden);
+ AppStorage.Set('enrollButtonVisibility', Visibility.Hidden);
+
+ AppStorage.Set('enrollStatus', $r('app.string.enroll_success'));
+ await CommonController.sleepMS(3000)
+ router.replace({uri: 'pages/faceConfig'})
+ Log.info(this.TAG, 'enrollSuccess-')
+ }
+
+ async enrollFail() {
+ Log.info(this.TAG, 'enrollFail+')
+ AppStorage.Set('stackVideoVisibility', Visibility.Visible);
+ AppStorage.Set('stackShelterVisibility', Visibility.Visible);
+ AppStorage.Set('stackProgressVisibility', Visibility.Visible);
+ AppStorage.Set('stackSuccessVisibility', Visibility.Hidden);
+ AppStorage.Set('enrollTipVisibility', Visibility.Visible);
+ AppStorage.Set('enrollButtonVisibility', Visibility.Visible);
+
+ AppStorage.Set('enrollStatus', $r('app.string.enrolling_fail'));
+ AppStorage.Set('enrollTip', $r('app.string.enroll_info_fail'))
+ AppStorage.Set('stackVideoBlurRadius', 30);
+ AppStorage.Set('stackProgressValue', 0);
+
+ Log.info(this.TAG, 'enrollFail-')
+ }
+}
+
+let enrollingController = new EnrollingController();
+export default enrollingController as EnrollingController
\ No newline at end of file
diff --git a/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/controller/entryViewController.ets b/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/controller/entryViewController.ets
new file mode 100644
index 0000000..7303ff4
--- /dev/null
+++ b/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/controller/entryViewController.ets
@@ -0,0 +1,62 @@
+/*
+ * 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 '../utils/log.ets'
+import UserAuthModel from '../model/userAuthModel.ets'
+import UserIDMModel from '../model/userIDMModel.ets'
+import router from '@system.router';
+
+class EntryViewController {
+ private TAG: string = "EntryViewController"
+
+ constructor() {
+ Log.info(this.TAG, "constructor+")
+ UserIDMModel.updateFaceInfo()
+ Log.info(this.TAG, "constructor-")
+ }
+
+ async doPINAuth() {
+ try {
+ Log.info(this.TAG, "doPINAuth in")
+ let challenge = await UserIDMModel.getChallenge()
+ Log.info(this.TAG, "get challenge " + JSON.stringify(challenge) )
+ let token = await UserAuthModel.authPin(challenge)
+ Log.info(this.TAG, "authPin result " + JSON.stringify(token))
+ if (token == null) {
+ Log.info(this.TAG, "authPin fail ")
+ throw 1
+ }
+ UserIDMModel.setToken(token)
+ Log.info(this.TAG, "set token ok")
+ } catch(err) {
+ Log.info(this.TAG, "exception " + JSON.stringify(err))
+ Log.info(this.TAG, "doPINAuth -")
+ throw 1
+ }
+ if (UserIDMModel.getFaceNum() == 0) {
+ Log.info(this.TAG, "route to enrollIntro")
+ router.replace({uri: 'pages/enrollIntro'})
+ } else {
+ Log.info(this.TAG, "route to faceConfig")
+ router.replace({uri: 'pages/faceConfig'})
+ }
+
+ Promise.resolve(0)
+ Log.info(this.TAG, "doPINAuth -")
+ }
+}
+
+let entryViewController = new EntryViewController();
+export default entryViewController as EntryViewController
\ No newline at end of file
diff --git a/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/controller/faceConfigController.ets b/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/controller/faceConfigController.ets
new file mode 100644
index 0000000..525f8bc
--- /dev/null
+++ b/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/controller/faceConfigController.ets
@@ -0,0 +1,52 @@
+/*
+ * 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 '../utils/log.ets'
+import UserAuthModel from '../model/userAuthModel.ets'
+import UserIDMModel from '../model/userIDMModel.ets'
+import router from '@system.router';
+import CommonController from '../controller/commonController.ets'
+
+class FaceConfigController {
+ private TAG: string = "FaceConfigController:"
+
+ constructor() {
+ Log.info(this.TAG, "constructor+")
+ Log.info(this.TAG, "constructor-")
+ }
+
+ deleteFace() {
+ Log.info(this.TAG, "deleteFace+")
+ UserIDMModel.deleteFace().then((result)=>{
+ Log.info(this.TAG, "deleteFace result: " + result)
+ if (result == 0) {
+ Log.info(this.TAG, "deleteFace routeBack+")
+ CommonController.routeBack()
+ Log.info(this.TAG, "deleteFace routerBack-")
+ } else {
+ Log.info(this.TAG, "deleteFace fail")
+ }
+ }).catch(()=>{
+ Log.info(this.TAG, "deleteFace exception")
+ CommonController.routeBack()
+ })
+ setTimeout(()=>{CommonController.routeBack()}, 500)
+
+ Log.info(this.TAG, "deleteFace-")
+ }
+}
+
+let faceConfigController = new FaceConfigController();
+export default faceConfigController as FaceConfigController
\ No newline at end of file
diff --git a/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/model/userAuthModel.ets b/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/model/userAuthModel.ets
new file mode 100644
index 0000000..d49d030
--- /dev/null
+++ b/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/model/userAuthModel.ets
@@ -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 Log from '../utils/log.ets'
+import CommonController from '../controller/commonController.ets'
+import account_osAccount from '@ohos.account.osAccount';
+
+class UserAuthModel {
+ private TAG: string = "UserAuthModel"
+ private pinAuthManger : any
+ private userAuthManager : any
+
+ constructor() {
+ Log.info(this.TAG, "constructor+")
+ this.pinAuthManger = new account_osAccount.PINAuth()
+ this.userAuthManager = new account_osAccount.UserAuth()
+ Log.info(this.TAG, "constructor-")
+ }
+
+ async authPin(challenge: Uint8Array):Promise {
+ Log.info(this.TAG, "auth Pin+")
+ this.pinAuthManger.registerInputer({
+ onGetData: (AuthSubType, IInputData) => {
+ Log.info(this.TAG, 'FaceEnroll pin.registerInputer start')
+ IInputData.onSetData(10000, new Uint8Array([ 49, 50, 51, 52, 53, 54 ]))
+ }
+ });
+
+ var ret = new Promise((resolve)=> {
+ this.userAuthManager.auth(challenge, 1, 10000, {
+ onResult: (result, extraInfo) => {
+ Log.info(this.TAG, 'authPin onResult: ' + result + ' extraInfo: ' + JSON.stringify(extraInfo));
+ this.pinAuthManger.unregisterInputer();
+ if ((result == 0) && extraInfo.token && (Object.keys(extraInfo.token).length > 0) ) {
+ resolve(extraInfo.token);
+ Log.info(this.TAG, 'authPin success');
+ setTimeout(()=>{CommonController.terminateAbility()}, 2 * 60 * 1000)
+ } else {
+ Log.error(this.TAG, 'authPin fail');
+ throw 1
+ }
+ }
+ })
+ })
+ Log.info(this.TAG, "auth Pin-")
+ return ret
+ }
+}
+
+let userAuthModel = new UserAuthModel();
+export default userAuthModel as UserAuthModel
\ No newline at end of file
diff --git a/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/model/userIDMModel.ets b/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/model/userIDMModel.ets
new file mode 100644
index 0000000..a3aadbe
--- /dev/null
+++ b/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/model/userIDMModel.ets
@@ -0,0 +1,152 @@
+/*
+ * 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 '../utils/log.ets'
+import CommonController from '../controller/commonController.ets'
+import account_osAccount from '@ohos.account.osAccount';
+
+class UserIDMModel {
+ private TAG: string = "UserIDMModel"
+ private userIdentityManager: any
+ private challenge: Uint8Array
+ private token: Uint8Array
+ private credentialId: Uint8Array
+ private faceNumber: number = 0
+ private onAcquireCallback : (number)=>{}
+
+ constructor() {
+ Log.info(this.TAG, "constructor+")
+ this.userIdentityManager = new account_osAccount.UserIdentityManager()
+ Log.info(this.TAG, "constructor-")
+ }
+
+ destroy() {
+ Log.info(this.TAG, "destroy+")
+ this.userIdentityManager.closeSession()
+ Log.info(this.TAG, "destroy-")
+ }
+
+ async getChallenge() {
+ return new Promise((resolve)=> {
+ this.userIdentityManager.openSession((data) => {
+ resolve(data)
+ })
+ })
+ }
+
+ uin8Array2String(inArray: Uint8Array): string {
+ return JSON.stringify(inArray)
+ }
+
+ string2Uint8Array(inString: string): Uint8Array {
+ let buffer = []
+ let parsed:object = JSON.parse(inString)
+ for (const key in Object.keys(parsed)) {
+ buffer.push(parsed[key])
+ }
+ let token = new Uint8Array(buffer)
+ return token
+ }
+
+ setToken(token: Uint8Array) {
+ let tokenStr = this.uin8Array2String(token);
+ AppStorage.SetOrCreate("UserIDM_Token", tokenStr)
+ Log.info(this.TAG, "setToken ok " + JSON.stringify(token))
+ }
+
+ getToken() : Uint8Array {
+ var tokenStr = AppStorage.Get("UserIDM_Token")
+ let token = this.string2Uint8Array(tokenStr)
+ Log.info(this.TAG, "getToken ok " + JSON.stringify(token))
+ return token
+ }
+
+ setCredentialId(credId: Uint8Array) {
+ let credIdStr = this.uin8Array2String(credId);
+ AppStorage.SetOrCreate("UserIDM_CredId", credIdStr)
+ Log.info(this.TAG, "setCredentialId ok " + JSON.stringify(credId))
+ }
+
+ getCredentialId() : Uint8Array {
+ var credIdStr = AppStorage.Get("UserIDM_CredId")
+ let credId = this.string2Uint8Array(credIdStr)
+ Log.info(this.TAG, "getCredentialId ok " + JSON.stringify(credId))
+ return credId
+ }
+
+ updateFaceInfo() {
+ this.userIdentityManager.getAuthInfo(2).then((data) => {
+ Log.info(this.TAG, 'getAuthInfo length ' + data.length)
+ AppStorage.SetOrCreate("UserIDM_FaceNum", data.length);
+ if (data.length > 0) {
+ this.setCredentialId(data[0].credentialId);
+ }
+ });
+ }
+
+ getFaceNum(): number {
+ return AppStorage.Get("UserIDM_FaceNum");
+ }
+
+ setOnAcquireCallback(onAcquireCallback: (result: number) => any) {
+ this.onAcquireCallback = onAcquireCallback
+ }
+
+ async enrollFace() {
+ Log.info(this.TAG, "enrollFace+")
+ let localToken = this.getToken()
+ return new Promise((resolve)=> {
+ this.userIdentityManager.addCredential({
+ credType: 2,
+ credSubType: 10000,
+ token: localToken,
+ }, {
+ onResult: (result, extraInfo) => {
+ Log.info(this.TAG, "enrollFace onResult+")
+ Log.info(this.TAG, 'FaceEnroll face.addCredential onResult ' + result)
+ if (result == 0) {
+ this.setCredentialId(extraInfo.credentialId)
+ this.updateFaceInfo()
+ }
+ Log.info(this.TAG, "enrollFace onResult-")
+ resolve(result)
+ }
+ })
+ })
+ }
+
+ async deleteFace() {
+ Log.info(this.TAG, "deleteFace+")
+ if (this.credentialId === null) {
+ Log.info(this.TAG, "no credential to delete")
+ return 0
+ }
+
+ let localToken = this.getToken()
+ let credId = this.getCredentialId()
+ return new Promise((resolve)=> {
+ this.userIdentityManager.delCred(credId, localToken), {
+ onResult: (result, extraInfo) => {
+ Log.info(this.TAG, 'FaceEnroll face.delete onResult result = ' + result);
+ this.updateFaceInfo()
+ resolve(result)
+ }
+ }
+ })
+ }
+}
+
+let userIDMModel = new UserIDMModel();
+export default userIDMModel as UserIDMModel
\ No newline at end of file
diff --git a/ui/faceenroll/product/phone/src/main/ets/default/pages/declare.ets b/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/pages/enrollDeclare.ets
similarity index 88%
rename from ui/faceenroll/product/phone/src/main/ets/default/pages/declare.ets
rename to ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/pages/enrollDeclare.ets
index 8e5080f..086325a 100644
--- a/ui/faceenroll/product/phone/src/main/ets/default/pages/declare.ets
+++ b/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/pages/enrollDeclare.ets
@@ -13,34 +13,23 @@
* limitations under the License.
*/
-import Constants from '../common/constant.ets';
-import router from '@system.router';
+import Constants from '../config/constant.ets'
+import BackComponent from '../component/backComponent.ets'
+import Log from '../utils/log.ets'
+import CommonController from '../controller/commonController.ets'
@Entry
@Component
-export default struct Declare {
- Scroll: Scroller = new Scroller();
- pattern: string = "2D";
+export default struct EnrollDeclare {
+ private pattern: string = "2D";
+ private TAG: string = "EnrollDeclare:"
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
- Scroll(this.Scroll) {
- Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center }) {
- Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Start }) {
- Image($r('app.media.back'))
- .width(Constants.BACK_WIDTH)
- .height(Constants.BACK_HEIGHT)
- .onClick(() => {
- router.back();
- })
-
- Text(this.pattern == "2D" ? $r('app.string.face_guide_2d_announce_link') : $r("app.string.face_guide_3d_announce_link"))
- .fontSize(Constants.DECLARE_TITLE_FONT_SIZE)
- .fontWeight(FontWeight.Bold)
- }
- .margin({ top: $r('app.float.back_margin') })
-
- Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center }) {
+ BackComponent({ prevTag:this.TAG, title: $r('app.string.face_guide_2d_announce_link' )})
+ Scroll() {
+ Column() {
+ Column() {
Text($r("app.string.face_feature_desc"))
.fontSize(Constants.DECLARE_SECONDARY_TITLE_FONT_SIZE)
.width(Constants.DECLARE_MAX_WIDTH)
@@ -179,9 +168,6 @@ export default struct Declare {
Span($r("app.string.face_recognize_annouce_message_14_3")).fontSize(Constants.DECLARE_TEXT_FONT_SIZE)
.fontWeight(FontWeight.Bold)
Span($r("app.string.face_recognize_annouce_message_15_2")).fontSize(Constants.DECLARE_TEXT_FONT_SIZE)
- Span($r("app.string.face_recognize_annouce_message_15_3")).fontSize(Constants.DECLARE_TEXT_FONT_SIZE)
- .fontWeight(FontWeight.Bold)
- Span($r("app.string.face_recognize_annouce_message_15_4")).fontSize(Constants.DECLARE_TEXT_FONT_SIZE)
}
.width(Constants.DECLARE_MAX_WIDTH)
.textAlign(TextAlign.Start)
@@ -196,6 +182,11 @@ export default struct Declare {
.backgroundColor(Constants.DECLARE_BACKGROUND_COLOR)
.width(Constants.DECLARE_MAX_WIDTH)
}
-}
-
+ onBackPress(): boolean {
+ Log.info(this.TAG, 'onBackPress+')
+ CommonController.routeBack()
+ Log.info(this.TAG, 'onBackPress-')
+ return true
+ }
+}
\ No newline at end of file
diff --git a/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/pages/enrollIntro.ets b/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/pages/enrollIntro.ets
new file mode 100644
index 0000000..5cb9aa9
--- /dev/null
+++ b/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/pages/enrollIntro.ets
@@ -0,0 +1,124 @@
+/*
+ * 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 BackComponent from '../component/backComponent.ets'
+import Log from '../utils/log.ets'
+import CommonController from '../controller/commonController.ets'
+import Constants from '../config/constant.ets'
+import Config from '../config/config.ets'
+
+@Entry
+@Component
+struct EnrollIntro {
+ @State TAG: string = "EnrollIntro:"
+ @StorageLink('enrollImageHeight') enrollImageHeight: number = 0
+ @StorageLink('enrollImageWidth') enrollImageWidth: number = 0
+
+ build() {
+ Column() {
+ BackComponent({prevTag:this.TAG})
+
+ Column() {
+ Column() {
+ Scroll() {
+ Column() {
+ Text($r('app.string.face_checker'))
+ .fontSize(Constants.TITLE_FONT_SIZE)
+ .fontWeight(FontWeight.Bold)
+ .margin({
+ bottom: "20"
+ })
+ Image($r('app.media.startImage_2D'))
+ .objectFit(ImageFit.Contain)
+ .width("1000%")
+ .height(this.enrollImageHeight)
+ Column() {
+ Text($r('app.string.enroll_face_guide_title'))
+ .fontSize(Constants.SMALL_TITLE_FONT_SIZE)
+ .fontWeight(Constants.FONT_WEIGHT)
+ .textAlign(TextAlign.Center)
+
+ Text($r('app.string.face_guide_2d_way'))
+ .fontSize(Constants.FONT_SIZE)
+ .fontColor($r('app.color.font_color'))
+ .textAlign(TextAlign.Center)
+ .margin({ top: Constants.CONTENT1_MARGIN })
+
+ Text() {
+ Span($r('app.string.face_guide_2d_announce'))
+ .fontColor($r('app.color.font_color'))
+ .textCase(TextCase.UpperCase)
+ .fontSize(Constants.FONT_SIZE)
+ Span($r('app.string.face_guide_2d_announce_link'))
+ .textCase(TextCase.UpperCase)
+ .fontSize(Constants.FONT_SIZE)
+ .fontColor($r('app.color.startView_color'))
+ .onClick(() => {
+ router.push({ uri: 'pages/enrollDeclare' })
+ })
+ }
+ .margin({ top: Constants.CONTENT2_MARGIN })
+ .textAlign(TextAlign.Center)
+ }
+ .width(Constants.ENROLL_INFO_WIDTH)
+ .margin({
+ top: Constants.IMAGE_MARGIN,
+ })
+ }
+ }.scrollable(ScrollDirection.Vertical).scrollBarColor(Color.Gray).scrollBarWidth(30)
+ }.width('100%').flexGrow(1)
+
+ Flex({ justifyContent: FlexAlign.Center }) {
+ Button({ type: ButtonType.Capsule, stateEffect: true }) {
+ Text($r('app.string.face_recognitin_guide')).fontSize(Constants.BUTTON_FONT_SIZE).fontColor(0xffffff)
+ }
+ .backgroundColor($r('app.color.startView_color'))
+ .width(Constants.BUTTON_WIDTH)
+ .height(Constants.BUTTON_HEIGHT)
+ .onClick(() => {
+ router.replace({ uri: 'pages/enrolling' })
+ })
+ .margin({
+ top: "24",
+ bottom: "24"
+ })
+ }
+ }.width("100%").height("100%")
+ .constraintSize({
+ maxWidth: '720'
+ })
+ .onAreaChange((_, newArea) => {
+ Log.info(this.TAG, "new non app bar area :" + JSON.stringify(newArea))
+ CommonController.setNonAppBarDisplaySize(Number(newArea.width), Number(newArea.height))
+ Log.info(this.TAG, "non app ba aboutToAppear- w: " + newArea.width + " h: " + newArea.height)
+ })
+ }
+ .width('100%')
+ .height('100%')
+ .onAreaChange((_, newArea) => {
+ Log.info(this.TAG, "new display area :" + JSON.stringify(newArea))
+ CommonController.setDisplaySize(Number(newArea.width), Number(newArea.height))
+ Log.info(this.TAG, "aboutToAppear- w: " + newArea.width + " h: " + newArea.height)
+ })
+ }
+
+ onBackPress(): boolean {
+ Log.info(this.TAG, 'onBackPress+')
+ CommonController.routeBack()
+ Log.info(this.TAG, 'onBackPress-')
+ return true
+ }
+}
\ No newline at end of file
diff --git a/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/pages/enrolling.ets b/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/pages/enrolling.ets
new file mode 100644
index 0000000..b6e156b
--- /dev/null
+++ b/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/pages/enrolling.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 BackComponent from '../component/backComponent.ets'
+import Log from '../utils/log.ets'
+import CommonController from '../controller/commonController.ets'
+import Constants from '../config/constant.ets'
+import EnrollingController from '../controller/enrollingController.ets'
+
+@Entry
+@Component
+struct Enrolling {
+ private TAG: string = "Enrolling:"
+ @StorageLink('enrollStatus') enrollStatus: string = ""
+ @StorageLink('stackVideoVisibility') stackVideoVisibility: Visibility = Visibility.Visible
+ @StorageLink('stackVideoBlurRadius') stackVideoBlurRadius: number = 0
+ @StorageLink('stackShelterVisibility') stackShelterVisibility: Visibility = Visibility.Visible
+ @StorageLink('stackShelterHeight') stackShelterHeight : string = ""
+ @StorageLink('stackProgressVisibility') stackProgressVisibility: Visibility = Visibility.Hidden
+ @StorageLink('stackProgressValue') stackProgressValue: number = 0
+ @StorageLink('stackSuccessVisibility') stackSuccessVisibility: Visibility = Visibility.Hidden
+ @StorageLink('enrollTip') enrollTip: string = ""
+ @StorageLink('enrollTipVisibility') enrollTipVisibility: Visibility = Visibility.Hidden
+ @StorageLink('enrollButtonVisibility') enrollButtonVisibility: Visibility = Visibility.Hidden
+ @StorageLink('enrollImageHeight') enrollImageHeight: number = 0
+ @StorageLink('enrollImageWidth') enrollImageWidth: number = 0
+ @StorageLink('stackRingHeightPercentage') stackRingHeightPercentage: string = ""
+
+ aboutToAppear() {
+ Log.info(this.TAG, "aboutToAppear+")
+ EnrollingController.init()
+ Log.info(this.TAG, "aboutToAppear-")
+ }
+
+ build() {
+ Column() {
+ BackComponent({prevTag:this.TAG})
+ Text(this.enrollStatus)
+ .fontSize(Constants.TITLE_FONT_SIZE)
+ .fontWeight(FontWeight.Bold)
+ .margin({
+ bottom: "20"
+ })
+ Stack() {
+ // to be replace by XComp
+ Rect()
+ .visibility(this.stackVideoVisibility)
+ .blur(this.stackVideoBlurRadius)
+ .height("500%")
+ .width("500%")
+ Image($r('app.media.shelter'))
+ .objectFit(ImageFit.Contain)
+ .height(this.stackShelterHeight)
+ .width('1000%')
+ .clip(true)
+ .markAnchor({ x: '50%', y: '50%' })
+ .position({ x: '50%', y: '50%' })
+ .animation({ duration: 2000, curve: Curve.Linear })
+ .visibility(this.stackShelterVisibility)
+ Progress({ value: Constants.PROGRESS_START, total: Constants.PROGRESS_TOTAL, style: ProgressStyle.Ring })
+ .value(this.stackProgressValue)
+ .height(this.stackRingHeightPercentage)
+ .color($r('app.color.startView_color'))
+ .visibility(this.stackProgressVisibility)
+ .markAnchor({ x: '50%', y: '50%' })
+ .position({ x: '50%', y: '50%' })
+ Image($r('app.media.success'))
+ .objectFit(ImageFit.Contain)
+ .height('30%')
+ .width('100%')
+ .visibility(this.stackSuccessVisibility)
+ }
+ .height(this.enrollImageHeight)
+ .width(this.enrollImageWidth)
+ .clip(true)
+ Blank()
+ Text(this.enrollTip)
+ .fontSize(Constants.ERROR_CODE_INFO_SIZE)
+ .textAlign(TextAlign.Center)
+ .visibility(this.enrollTipVisibility)
+ .constraintSize({
+ maxWidth:720
+ })
+ Blank()
+ Button({ type: ButtonType.Capsule, stateEffect: true }) {
+ Text($r('app.string.enroll_button_content'))
+ .fontSize(Constants.BUTTON_FONT_SIZE)
+ .fontColor($r('app.color.startView_color'))
+ }
+ .backgroundColor($r('app.color.newBtn_color'))
+ .width(Constants.BUTTON_WIDTH)
+ .height(Constants.BUTTON_HEIGHT)
+ .visibility(this.enrollButtonVisibility)
+ .onClick(() => {
+ EnrollingController.init()
+ })
+ .margin({
+ top: "24",
+ bottom: "24",
+ })
+ }
+ .width('100%')
+ .height('100%')
+ }
+
+ onBackPress(): boolean {
+ Log.info(this.TAG, 'onBackPress+')
+ CommonController.routeBack()
+ Log.info(this.TAG, 'onBackPress-')
+ return true
+ }
+}
\ No newline at end of file
diff --git a/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/pages/entryView.ets b/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/pages/entryView.ets
new file mode 100644
index 0000000..a6103d6
--- /dev/null
+++ b/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/pages/entryView.ets
@@ -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.
+ */
+
+import router from '@system.router';
+import BackComponent from '../component/backComponent.ets'
+import Log from '../utils/log.ets'
+import Constants from '../config/constant.ets'
+import EntryViewController from '../controller/entryViewController.ets'
+import CommonController from '../controller/commonController.ets'
+
+@Entry
+@Component
+struct Index {
+ private TAG: string = "Index:"
+ @State resultString: string = ""
+
+ build() {
+ Column() {
+ BackComponent({ prevTag: this.TAG })
+ Text("临时认证界面")
+ .fontSize(Constants.TITLE_FONT_SIZE)
+ .fontWeight(FontWeight.Bold)
+ Text("请将PIN码设置为123456后,点击认证按钮")
+ .fontSize(Constants.FONT_SIZE)
+ Button({ type: ButtonType.Capsule, stateEffect: true }){
+ Text('认证').fontSize(Constants.BUTTON_FONT_SIZE).fontColor(0xffffff).fontSize(Constants.TITLE_FONT_SIZE)
+ }
+ .backgroundColor($r('app.color.startView_color'))
+ .onClick(()=>{
+ EntryViewController.doPINAuth()
+ .catch(()=>{this.resultString = "认证失败,请将密码设置为123456后重试"})
+ })
+ .width(Constants.BUTTON_WIDTH)
+ .height(Constants.BUTTON_HEIGHT)
+ .margin({
+ top: "24",
+ bottom: "24"
+ })
+ Text(this.resultString)
+ .fontSize(Constants.FONT_SIZE)
+ .fontWeight(FontWeight.Bold)
+ }.alignItems(HorizontalAlign.Center)
+ .width("100%")
+ .height("100%")
+ }
+
+ onBackPress(): boolean {
+ Log.info(this.TAG, 'onBackPress+')
+ CommonController.routeBack()
+ Log.info(this.TAG, 'onBackPress-')
+ return true
+ }
+}
\ No newline at end of file
diff --git a/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/pages/faceConfig.ets b/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/pages/faceConfig.ets
new file mode 100644
index 0000000..8ea47e1
--- /dev/null
+++ b/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/pages/faceConfig.ets
@@ -0,0 +1,82 @@
+/*
+ * 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 BackComponent from '../component/backComponent.ets'
+import Log from '../utils/log.ets'
+import CommonController from '../controller/commonController.ets'
+import FaceConfigController from '../controller/faceConfigController.ets'
+import ConfirmDialog from '../component/confirmDialog.ets'
+
+@Entry
+@Component
+struct FaceConfig {
+ @State TAG: string = "FaceConfig:"
+ @State touched: boolean = false
+ private deleteFaceDialogController: CustomDialogController = new CustomDialogController({
+ builder: ConfirmDialog({
+ title: $r('app.string.delete_record_title'),
+ content: $r('app.string.wether_delete_face_data'),
+ confirmText: $r('app.string.face_record_delete'),
+ cancelText: $r('app.string.face_record_cancel'),
+ confirmOperation: this.deleteFace.bind(this)
+ }),
+ alignment: CommonController.getDialogAlignment()
+ })
+
+ deleteFace() {
+ Log.info(this.TAG, 'deleteFace+')
+ FaceConfigController.deleteFace()
+ Log.info(this.TAG, 'deleteFace-')
+ }
+
+ build() {
+ Column() {
+ BackComponent({ prevTag: this.TAG, title: $r('app.string.face_checker') })
+ Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems:ItemAlign.Center }) {
+ Row() {
+ Text($r('app.string.delete_record_title'))
+ .fontSize(22)
+ .fontColor(Color.Red)
+ .margin({left:24, top:8, bottom:8, right:0})
+ .textAlign(TextAlign.Start);
+ }
+ }
+ .backgroundColor(this.touched? "#D8D8D8":"#FFFFFF")
+ .height(56)
+ .margin({left:24, right:24, top:16})
+ .borderRadius(24)
+ .onClick(()=>{
+ this.deleteFaceDialogController.open()
+ })
+ .onTouch((event: TouchEvent) => {
+ if (event.type === TouchType.Down) {
+ this.touched = true;
+ }
+ if (event.type === TouchType.Up) {
+ this.touched = false;
+ }
+ });
+ }.width("100%")
+ .height("100%")
+ .backgroundColor("#E3E3E3");
+ }
+
+ onBackPress(): boolean {
+ Log.info(this.TAG, 'onBackPress+')
+ CommonController.routeBack()
+ Log.info(this.TAG, 'onBackPress-')
+ return true
+ }
+}
\ No newline at end of file
diff --git a/ui/faceenroll/product/pad/src/main/ets/default/app.ets b/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/utils/log.ets
similarity index 66%
rename from ui/faceenroll/product/pad/src/main/ets/default/app.ets
rename to ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/utils/log.ets
index ab5e2d8..2772794 100644
--- a/ui/faceenroll/product/pad/src/main/ets/default/app.ets
+++ b/ui/Settings_FaceAuth/entry/src/main/ets/enrollmentstartview/utils/log.ets
@@ -13,12 +13,19 @@
* limitations under the License.
*/
-export default {
- onCreate() {
- console.info('FaceEnroll entry Application onCreate')
- },
- onDestroy() {
- console.info('FaceEnroll entry Application onDestroy')
- },
+const TAG = 'Settings_FaceAuth';
-}
+export default class Log {
+
+ static info(tag, log) {
+ console.info(`Info:${TAG}:${tag} ${log}`);
+ }
+
+ static debug(tag, log) {
+ console.debug(`Debug:${TAG}:${tag} ${log}`);
+ }
+
+ static error(tag, log) {
+ console.error(`Error:${TAG}:${tag} ${log}`);
+ }
+}
\ No newline at end of file
diff --git a/ui/faceenroll/product/phone/src/main/resources/base/element/color.json b/ui/Settings_FaceAuth/entry/src/main/resources/base/element/color.json
similarity index 89%
rename from ui/faceenroll/product/phone/src/main/resources/base/element/color.json
rename to ui/Settings_FaceAuth/entry/src/main/resources/base/element/color.json
index c7bec91..09f74d9 100644
--- a/ui/faceenroll/product/phone/src/main/resources/base/element/color.json
+++ b/ui/Settings_FaceAuth/entry/src/main/resources/base/element/color.json
@@ -6,7 +6,7 @@
},
{
"name": "startView_color",
- "value": "#0A59F7"
+ "value": "#00A6F9"
},
{
"name": "newBtn_color",
diff --git a/ui/faceenroll/product/phone/src/main/resources/base/element/float.json b/ui/Settings_FaceAuth/entry/src/main/resources/base/element/float.json
similarity index 91%
rename from ui/faceenroll/product/phone/src/main/resources/base/element/float.json
rename to ui/Settings_FaceAuth/entry/src/main/resources/base/element/float.json
index c992e6a..089225d 100644
--- a/ui/faceenroll/product/phone/src/main/resources/base/element/float.json
+++ b/ui/Settings_FaceAuth/entry/src/main/resources/base/element/float.json
@@ -19,7 +19,11 @@
},
{
"name": "enroll_center_position_X",
- "value": "0"
+ "value": "880"
+ },
+ {
+ "name": "enroll_center_position_Xx",
+ "value": "790"
},
{
"name": "enroll_info_X",
diff --git a/ui/Settings_FaceAuth/entry/src/main/resources/base/element/string.json b/ui/Settings_FaceAuth/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000..5f18b9f
--- /dev/null
+++ b/ui/Settings_FaceAuth/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,28 @@
+{
+ "string": [
+ {
+ "name": "entry_MainAbility",
+ "value": "entry_MainAbility"
+ },
+ {
+ "name": "description_mainability",
+ "value": "eTS_Empty Ability"
+ },
+ {
+ "name": "description_intro",
+ "value": "eTS_Empty Ability"
+ },
+ {
+ "name": "entry_intro",
+ "value": "entry_intro"
+ },
+ {
+ "name": "description_enrollmentstartview",
+ "value": "eTS_Empty Ability"
+ },
+ {
+ "name": "entry_enrollmentstartview",
+ "value": "entry_enrollmentstartview"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/ui/Settings_FaceAuth/entry/src/main/resources/base/media/back_op.png b/ui/Settings_FaceAuth/entry/src/main/resources/base/media/back_op.png
new file mode 100644
index 0000000..c7f5cf3
Binary files /dev/null and b/ui/Settings_FaceAuth/entry/src/main/resources/base/media/back_op.png differ
diff --git a/ui/faceenroll/feature/faceSettings/src/main/resources/base/media/icon.png b/ui/Settings_FaceAuth/entry/src/main/resources/base/media/icon.png
similarity index 100%
rename from ui/faceenroll/feature/faceSettings/src/main/resources/base/media/icon.png
rename to ui/Settings_FaceAuth/entry/src/main/resources/base/media/icon.png
diff --git a/ui/faceenroll/product/pad/src/main/resources/base/media/shelter.png b/ui/Settings_FaceAuth/entry/src/main/resources/base/media/shelter.png
similarity index 100%
rename from ui/faceenroll/product/pad/src/main/resources/base/media/shelter.png
rename to ui/Settings_FaceAuth/entry/src/main/resources/base/media/shelter.png
diff --git a/ui/faceenroll/product/pad/src/main/resources/base/media/startImage_2D.png b/ui/Settings_FaceAuth/entry/src/main/resources/base/media/startImage_2D.png
similarity index 100%
rename from ui/faceenroll/product/pad/src/main/resources/base/media/startImage_2D.png
rename to ui/Settings_FaceAuth/entry/src/main/resources/base/media/startImage_2D.png
diff --git a/ui/faceenroll/product/pad/src/main/resources/base/media/success.png b/ui/Settings_FaceAuth/entry/src/main/resources/base/media/success.png
similarity index 100%
rename from ui/faceenroll/product/pad/src/main/resources/base/media/success.png
rename to ui/Settings_FaceAuth/entry/src/main/resources/base/media/success.png
diff --git a/ui/faceenroll/product/phone/src/main/resources/en_AS/element/string.json b/ui/Settings_FaceAuth/entry/src/main/resources/en_AS/element/string.json
similarity index 100%
rename from ui/faceenroll/product/phone/src/main/resources/en_AS/element/string.json
rename to ui/Settings_FaceAuth/entry/src/main/resources/en_AS/element/string.json
diff --git a/ui/faceenroll/product/phone/src/main/resources/zh_CN/element/string.json b/ui/Settings_FaceAuth/entry/src/main/resources/zh_CN/element/string.json
similarity index 98%
rename from ui/faceenroll/product/phone/src/main/resources/zh_CN/element/string.json
rename to ui/Settings_FaceAuth/entry/src/main/resources/zh_CN/element/string.json
index c4b079a..7af2771 100644
--- a/ui/faceenroll/product/phone/src/main/resources/zh_CN/element/string.json
+++ b/ui/Settings_FaceAuth/entry/src/main/resources/zh_CN/element/string.json
@@ -403,15 +403,6 @@
"name": "face_recognize_annouce_message_15_2",
"value": "删除后本设备将不再保存这些数据。"
},
-
- {
- "name": "face_recognize_annouce_message_15_3",
- "value": ""
- },
- {
- "name": "face_recognize_annouce_message_15_4",
- "value": ""
- },
{
"name": "face_guide_3d_announce_link",
"value": "关于3D人脸识别的声明"
@@ -567,7 +558,7 @@
},
{
"name": "delete_all_face_data",
- "value": "删除主用及备用面容"
+ "value": "删除面容"
},
{
"name": "wether_delete_face_data",
diff --git a/ui/Settings_FaceAuth/gradle.properties b/ui/Settings_FaceAuth/gradle.properties
new file mode 100644
index 0000000..be49249
--- /dev/null
+++ b/ui/Settings_FaceAuth/gradle.properties
@@ -0,0 +1,13 @@
+# Project-wide Gradle settings.
+# IDE (e.g. DevEco Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+# If the Chinese output is garbled, please configure the following parameter.
+# This function is enabled by default when the DevEco Studio builds the hap/app,if you need disable gradle parallel,you should set org.gradle.parallel false.
+# more information see https://docs.gradle.org/current/userguide/performance.html
+# org.gradle.parallel=false
+# org.gradle.jvmargs=-Dfile.encoding=GBK
\ No newline at end of file
diff --git a/ui/Settings_FaceAuth/gradle/wrapper/gradle-wrapper.properties b/ui/Settings_FaceAuth/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..63c817f
--- /dev/null
+++ b/ui/Settings_FaceAuth/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,5 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://repo.huaweicloud.com/gradle/gradle-7.3-bin.zip
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/ui/faceenroll/gradlew b/ui/Settings_FaceAuth/gradlew
similarity index 100%
rename from ui/faceenroll/gradlew
rename to ui/Settings_FaceAuth/gradlew
diff --git a/ui/faceenroll/gradlew.bat b/ui/Settings_FaceAuth/gradlew.bat
similarity index 100%
rename from ui/faceenroll/gradlew.bat
rename to ui/Settings_FaceAuth/gradlew.bat
diff --git a/ui/Settings_FaceAuth/package.json b/ui/Settings_FaceAuth/package.json
new file mode 100644
index 0000000..0967ef4
--- /dev/null
+++ b/ui/Settings_FaceAuth/package.json
@@ -0,0 +1 @@
+{}
diff --git a/ui/Settings_FaceAuth/settings.gradle b/ui/Settings_FaceAuth/settings.gradle
new file mode 100644
index 0000000..4773db7
--- /dev/null
+++ b/ui/Settings_FaceAuth/settings.gradle
@@ -0,0 +1 @@
+include ':entry'
diff --git a/ui/faceenroll/.gitattributes b/ui/faceenroll/.gitattributes
deleted file mode 100644
index e69de29..0000000
diff --git a/ui/faceenroll/common/src/main/config.json b/ui/faceenroll/common/src/main/config.json
deleted file mode 100644
index 083b3b4..0000000
--- a/ui/faceenroll/common/src/main/config.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "app": {
- "bundleName": "com.ohos.faceEnroll",
- "vendor": "ohos",
- "version": {
- "code": 1000000,
- "name": "1.0.0"
- }
- },
- "deviceConfig": {},
- "module": {
- "package": "com.ohos.faceEnroll",
- "deviceType": [
- "phone"
- ],
- "distro": {
- "deliveryWithInstall": true,
- "moduleName": "common",
- "moduleType": "har"
- }
- }
-
-}
\ No newline at end of file
diff --git a/ui/faceenroll/common/src/main/ets/default/Log.ets b/ui/faceenroll/common/src/main/ets/default/Log.ets
deleted file mode 100644
index 556da62..0000000
--- a/ui/faceenroll/common/src/main/ets/default/Log.ets
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * 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.
- */
-
-const TAG = 'faceenroll_Default';
-
-/**
- * Basic log class
- */
-export default class Log {
-
- /**
- * print info level log
- *
- * @param {string} tag - Page or class tag
- * @param {string} log - Log needs to be printed
- */
- static showInfo(tag, log) {
- console.info(`${TAG} tag: ${tag} --> ${log}`);
- }
-
- /**
- * print debug level log
- *
- * @param {string} tag - Page or class tag
- * @param {string} log - Log needs to be printed
- */
- static showDebug(tag, log) {
- console.debug(`${TAG} tag: ${tag} --> ${log}`);
- }
-
- /**
- * print error level log
- *
- * @param {string} tag - Page or class tag
- * @param {string} log - Log needs to be printed
- */
- static showError(tag, log) {
- console.error(`${TAG} tag: ${tag} --> ${log}`);
- }
-}
\ No newline at end of file
diff --git a/ui/faceenroll/common/src/main/ets/default/common/Config/config.ets b/ui/faceenroll/common/src/main/ets/default/common/Config/config.ets
deleted file mode 100644
index 215e5d6..0000000
--- a/ui/faceenroll/common/src/main/ets/default/common/Config/config.ets
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * 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 default class Config {
- public static FACE_TOKEN: array = new Uint8Array([1,2,3,4,5,6])
- public static TRUSTED_DEVICE_CHECK = false
- public static AUTH_TYPE = 2
- public static TYPE2D = "2D"
- public static AUTH = [
- {
- credentialId:new Uint8Array([1,2,3,4,5,6]),
- authType:2,
- authSubType:20000,
- templateId:1
- },
- {
- credentialId:new Uint8Array([1,2,3,4,5,6]),
- authType:2,
- authSubType:20000,
- templateId:2
- }
- ]
- public static FACE_DATA = {
- credentialId: credentialId,
- authType: 2,
- authSubType: 1,
- templateId: 1
- }
- public static DEVICE_LIST = [
- {
- name: "HuaWei Mate40",
- isLock: true
- },
- {
- name: "HuaWei Mate30",
- isLock: true
- },
- {
- name: "HuaWei p40",
- isLock: true
- },
- {
- name: "HuaWei p30",
- isLock: true
- }
- ]
- public static ADD_LIST = [
- {
- name: "HuaWei Mate40 add",
- isLock: true
- },
- {
- name: "HuaWei Mate30 add",
- isLock: true
- },
- {
- name: "HuaWei p40 add",
- isLock: false
- },
- {
- name: "HuaWei p30 add",
- isLock: false
- }
- ]
-}
\ No newline at end of file
diff --git a/ui/faceenroll/common/src/main/ets/default/common/manager/resourceManager.ets b/ui/faceenroll/common/src/main/ets/default/common/manager/resourceManager.ets
deleted file mode 100644
index b8d9ea0..0000000
--- a/ui/faceenroll/common/src/main/ets/default/common/manager/resourceManager.ets
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * 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 Config from "../Config/Config.ets"
-
-export default class ResourceManager {
-
- private static resourceManager: ResourceManager = new ResourceManager();
-
- public static getInstance(): ResourceManager{
- return this.resourceManager;
- }
-
- /**
- * Start pinAuth abillity and get token.
- * @param callback
- * @param getTokenCallback
- */
- public jumpToUserAuth(callback,getTokenCallback) {
- callback(Config.FACE_TOKEN,getTokenCallback);
- // FeatureAbility.startAbilityForResult({
- // want: {
- // bundleName: 'com.ohos....',
- // abilityName: 'com.ohos...'
- // },
- // requestCode: 1,
- // },
- // (err, data) => {
- // console.log("FaceEnroll resourceManager startAbilityForResult asyncCallback StartAbilityResult: "
- // + err.code + " data: " + data)
- // }).then(data =>
- // console.info("FaceEnroll resourceManager startApplicationForResult promise::then : " + JSON.stringify(data));
- // ).catch(error =>
- // console.info("FaceEnroll resourceManager startApplicationForResult promise::catch : " + JSON.stringify(error));
- // );
- }
-}
\ No newline at end of file
diff --git a/ui/faceenroll/common/src/main/ets/default/common/model/DeviceModel.ets b/ui/faceenroll/common/src/main/ets/default/common/model/DeviceModel.ets
deleted file mode 100644
index f55e392..0000000
--- a/ui/faceenroll/common/src/main/ets/default/common/model/DeviceModel.ets
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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 Config from "../Config/Config.ets"
-
-export default class trustedModel {
- private static trustedModel = new trustedModel();
-
- public static getInstance(): trustedModel{
- return this.trustedModel;
- }
-
- public getDeviceList(callback){
- callback(Config.DEVICE_LIST);
- }
- public getAddDeviceList(callback){
- callback(Config.ADD_LIST);
- }
-
- public removeDevice(device){
- }
-
- public addDevice(device){
- }
-
-}
\ No newline at end of file
diff --git a/ui/faceenroll/common/src/main/ets/default/common/model/FaceSettingsModel.ets b/ui/faceenroll/common/src/main/ets/default/common/model/FaceSettingsModel.ets
deleted file mode 100644
index 68ff9dd..0000000
--- a/ui/faceenroll/common/src/main/ets/default/common/model/FaceSettingsModel.ets
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * 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 Config from "../Config/Config.ets"
-/**
- * Class FaceSettingsModel.
- */
-export default class FaceSettingsModel {
- private static mFaceSettingsModel: FaceSettingsModel = new FaceSettingsModel();
-
- /**
- * Return an instance of FaceSettingsModel.
- */
- public static getInstance(): FaceSettingsModel {
- return this.mFaceSettingsModel;
- }
-
- /**
- * New face data. (pad)
- *
- * @param {object} callback - The callback from presenter.
- */
- NewFaceData(callback) {
- console.info("FaceEnroll FaceSettingsModel NewFaceData start");
- let credentialId = Math.random()*1000;
- let faceData = Config.FACE_DATA
- callback(faceData);
- console.info("FaceEnroll FaceSettingsModel NewFaceData end");
- }
-
-
- /**
- * Choose unlock method
- *
- * @param {object} methods - The unlock method
- */
- chooseUnlockMethod(method) {
- console.info('FaceEnroll FaceSettingsModel chooseUnlockMethod start');
- console.info('FaceEnroll FaceSettingsModel chooseUnlockMethod method' + method);
- console.info('FaceEnroll FaceSettingsModel chooseUnlockMethod end ');
- }
-
- /**
- * Whether to start up app lock
- *
- * @param {object} status - The AppLock status
- */
- AppLock(status) {
- console.info('FaceEnroll FaceSettingsModel activateAppLock start');
- if (status === true) {
- AppStorage.SetOrCreate('appLock_isOn', true);
- } else {
- console.info("FaceEnroll FaceSettingsModel close AppLock ");
- AppStorage.SetOrCreate('appLock_isOn', false);
- }
- console.info('FaceEnroll FaceSettingsModel activateAppLock end ');
- }
-
- /**
- * Whether to start up safe cabinet
- *
- * @param {object} status - The SafeCabinet status
- */
- SafeCabinet(status) {
- console.info('FaceEnroll FaceSettingsModel activateSafeCabinet start');
- if (status === true) {
- AppStorage.SetOrCreate('safeCabinet_isOn', true);
- } else {
- console.info("FaceEnroll FaceSettingsModel close activateSafeCabinet ");
- AppStorage.SetOrCreate('safeCabinet_isOn', false);
- }
- console.info('FaceEnroll FaceSettingsModel activateSafeCabinet end ');
- }
-
-
- /**
- * Whether to start up Screen fill light in low light environment
- *
- * @param {object} status - The ScreenFillFightInLowLightEnvironment status
- */
- ScreenFillFightInLowLightEnvironment(status) {
- console.info("FaceEnroll FaceSettingsModel ScreenFillFightInLowLightEnvironment start");
- if (status == true) {
- AppStorage.SetOrCreate('fillLight_isOn', true);
- } else {
- console.info("FaceEnroll FaceSettingsModel close ScreenFillFightInLowLightEnvironment ");
- AppStorage.SetOrCreate('fillLight_isOn', false);
- }
- console.info("FaceEnroll FaceSettingsModel ScreenFillFightInLowLightEnvironment end");
- }
-
- /**
- * Whether to start up smart lock screen notifications
- *
- * @param {object} status - The SmartLockScreenNotifications status
- */
- SmartLockScreenNotifications(status) {
- console.info("FaceEnroll FaceSettingsModel SmartLockScreenNotifications start");
- if (status === true) {
- AppStorage.SetOrCreate('smartDisplayLockScreen_isOn', true);
- } else {
- console.info("FaceEnroll FaceSettingsModel close SmartLockScreenNotifications ");
- AppStorage.SetOrCreate('smartDisplayLockScreen_isOn', false);
- }
- console.info("FaceEnroll FaceSettingsModel SmartLockScreenNotifications end");
- }
-
- /**
- * Whether to start up automatic fill in account password
- *
- * @param {object} status - The FillInAccountPassword status
- */
- FillInAccountPassword(status) {
- console.info("faceSettingsModel FillInAccountPassword start");
- if (status === true) {
- AppStorage.SetOrCreate('fillInAccount_isOn', true);
- } else {
- console.info("FaceEnroll FaceSettingsModel close FillInAccountPassword ");
- AppStorage.SetOrCreate('fillInAccount_isOn', false);
- }
- console.info("FaceEnroll FaceSettingsModel FillInAccountPassword end");
- }
-
- /**
- * Whether to start up look at screen during face recognition
- *
- * @param {object} status - The lookAtScreenDuringFaceRecognition status
- */
- lookAtScreenDuringFaceRecognition(status) {
- console.info("FaceEnroll FaceSettingsModel lookAtScreenDuringFaceRecognition start");
- if (status === true) {
- AppStorage.SetOrCreate('lookAtScreenDuringFaceRecognition_isOn', true);
- } else {
- console.info("FaceEnroll FaceSettingsModel close lookAtScreenDuringFaceRecognition ");
- AppStorage.SetOrCreate('lookAtScreenDuringFaceRecognition_isOn', false);
- }
- console.info("FaceEnroll FaceSettingsModel lookAtScreenDuringFaceRecognition end");
- }
-
- /**
- * Whether to start up auxiliary mode
- *
- * @param {object} status - The auxiliaryMode status
- */
- auxiliaryMode(status) {
- console.info("FaceEnroll FaceSettingsModel auxiliaryMode start");
- if (status === true) {
- AppStorage.SetOrCreate('auxiliaryMode_isOn', true);
- } else {
- console.info("FaceEnroll FaceSettingsModel close auxiliaryMode ");
- AppStorage.SetOrCreate('auxiliaryMode_isOn', false);
- }
- console.info("FaceEnroll FaceSettingsModel auxiliaryMode end");
- }
-
-
- /**
- * Whether to turn off and pick up the phone to turn on the screen
- *
- * @param {object} status - The BrightScreenOfThePhone status
- */
- BrightScreenOfThePhone(status) {
- console.info("FaceEnroll FaceSettingsModel BrightScreenOfThePhone start");
- if (status === true) {
- AppStorage.SetOrCreate('BrightScreenOfThePhone_isOn', true);
- } else {
- console.info("FaceEnroll FaceSettingsModel close BrightScreenOfThePhone ");
- AppStorage.SetOrCreate('BrightScreenOfThePhone_isOn', false);
- }
- console.info("FaceEnroll FaceSettingsModel BrightScreenOfThePhone end");
- }
-}
diff --git a/ui/faceenroll/common/src/main/ets/default/common/model/userAuthModel.ets b/ui/faceenroll/common/src/main/ets/default/common/model/userAuthModel.ets
deleted file mode 100644
index 1076a24..0000000
--- a/ui/faceenroll/common/src/main/ets/default/common/model/userAuthModel.ets
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * 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 UserIDM from '@ohos.useridm';
-import Config from "../Config/Config.ets"
-
-const auth = Config.AUTH
-export default class userAuthModel {
- private static userAuthModel = new userAuthModel();
- private authCounts: number;
- private UserIDM ;
-
- constructor() {
- this.UserIDM = UserIDM.constructor();
- }
-
- /**
- * Return an instance of userAuthModel.
- */
- public static getInstance(): userAuthModel{
- return this.userAuthModel;
- }
-
- /**
- * Get userAuthInfo.
- * @param {function} callback - Callback function.
- * @param {function} getUserMode - Do after callback function.
- */
- public getUserAuthInfo(callback, getUserMode) {
- console.info("FaceEnroll userAuthModel getUserAuthInfo start");
- this.UserIDM.getAuthInfo(Config.AUTH_TYPE, (data) => {
- try {
- console.info('FaceEnroll userAuthModel getUserAuthInfo getAuthInfo success', JSON.stringify(data));
- callback(data,getUserMode);
- }
- catch (e) {
- console.info('FaceEnroll userAuthModel getUserAuthInfo getAuthInfo error' + JSON.stringify(e));
- }
- })
- console.info("FaceEnroll userAuthModel getUserAuthInfo end");
- }
-
- /**
- * Get phone mode(2D or 3D).
- * @param callback
- */
- public getUserMode(callback) {
- callback(Config.TYPE2D);
- }
-
- /**
- * Delete face.
- * @param {number} credentialId - CredentialId.
- * @param {unit8Array} token - Token.
- * @param callback
- * @param sucssCallback
- */
- public deleteFace(credentialId, token, callback, sucssCallback) {
- console.info("FaceEnroll userAuthModel deleteFace start");
- this.UserIDM.delCred(credentialId, token, {
- onResult: (result, extraInfo) => {
- try {
- console.info('FaceEnroll uaerAuthModel deleteFace delCred result', JSON.stringify(result));
- callback(result);
- }
- catch (e) {
- console.info('FaceEnroll uaerAuthModel deleteFace delCred error', JSON.stringify(e));
- }
- },
- onAcquireInfo: (moduleNum, acquireNum, extraInfo) => {
- console.info('FaceEnroll uaerAuthModel deleteFace delCred onAcquireInfo callback');
- }
- })
- console.info("FaceEnroll userAuthModel deleteFace end");
- }
-
- /**
- *
- * @param callback
- */
- public getIsCheck(callback) {
- callback(Config.TRUSTED_DEVICE_CHECK)
- }
-}
diff --git a/ui/faceenroll/common/src/main/ets/default/common/presenter/FaceSettingsPresenter.ets b/ui/faceenroll/common/src/main/ets/default/common/presenter/FaceSettingsPresenter.ets
deleted file mode 100644
index d4ab2ac..0000000
--- a/ui/faceenroll/common/src/main/ets/default/common/presenter/FaceSettingsPresenter.ets
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * 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 FaceSettingsModel from '../model/FaceSettingsModel.ets';
-
-/**
- * Class FaceSettingsPresenter.
- */
-export default class FaceSettingsPresenter {
- private static FaceSettingsPresenter: FaceSettingsPresenter = new FaceSettingsPresenter();
- private mFaceSettingsModel: FaceSettingsModel;
-
- private constructor() {
- this.mFaceSettingsModel = FaceSettingsModel.getInstance();
-
- }
-
- /**
- * Return an instance of FaceSettingsPresenter.
- */
- public static getInstance(): FaceSettingsPresenter{
- return this.FaceSettingsPresenter;
- }
-
- /**
- * New face data.(pad)
- */
- NewFaceData(callback) {
- console.info("FaceEnroll FaceSettingsPresenter NewFaceData start");
- this.mFaceSettingsModel.NewFaceData((data) => {
- callback(data)
- })
- console.info("FaceEnroll FaceSettingsPresenter NewFaceData end");
- }
-
-
- /**
- * Choose unlock method
- *
- * @param {object} methods - The unlock method
- */
- chooseUnlockMethod(method) {
- console.info("FaceEnroll FaceSettingsPresenter chooseUnlockMethod start");
- this.mFaceSettingsModel.chooseUnlockMethod(method);
- console.info("FaceEnroll FaceSettingsPresenter chooseUnlockMethod end");
- }
-
- /**
- * Whether to start up app lock
- *
- * @param {object} status - The AppLock status
- */
- AppLock(status) {
- console.info("FaceEnroll FaceSettingsPresenter AppLock start");
- this.mFaceSettingsModel.AppLock(status);
- console.info("FaceEnroll FaceSettingsPresenter AppLock end");
- }
-
- /**
- * start up safe cabinet
- *
- * @param {object} status - The SafeCabinet status
- */
- SafeCabinet(status) {
- console.info("FaceEnroll FaceSettingsPresenter SafeCabinet start");
- this.mFaceSettingsModel.SafeCabinet(status);
- console.info("FaceEnroll FaceSettingsPresenter SafeCabinet end");
- }
-
- /**
- * Whether to start up Screen fill light in low light environment
- *
- * @param {object} status - The ScreenFillFightInLowLightEnvironment status
- */
- ScreenFillFightInLowLightEnvironment(status) {
- console.info("FaceEnroll FaceSettingsPresenter ScreenFillFightInLowLightEnvironment start");
- this.mFaceSettingsModel.ScreenFillFightInLowLightEnvironment(status);
- console.info("FaceEnroll FaceSettingsPresenter ScreenFillFightInLowLightEnvironment end");
- }
-
- /**
- * smart lock screen notifications
- *
- * @param {object} status - The SmartLockScreenNotifications status
- */
- SmartLockScreenNotifications(status) {
- console.info("FaceEnroll FaceSettingsPresenter SmartLockScreenNotifications start");
- this.mFaceSettingsModel.SmartLockScreenNotifications(status);
- console.info("FaceEnroll FaceSettingsPresenter SmartLockScreenNotifications end");
- }
-
- /**
- * Whether to start up automatic fill in account password
- *
- * @param {object} status - The FillInAccountPassword status
- */
- FillInAccountPassword(status) {
- console.info("FaceEnroll FaceSettingsPresenter FillInAccountPassword start");
- this.mFaceSettingsModel.FillInAccountPassword(status);
- console.info("FaceEnroll FaceSettingsPresenter FillInAccountPassword end");
- }
-
- /**
- * Whether to start up look at screen during face recognition
- *
- * @param {object} status - The lookAtScreenDuringFaceRecognition status
- */
- lookAtScreenDuringFaceRecognition(status) {
- console.info("FaceEnroll FaceSettingsPresenter lookAtScreenDuringFaceRecognition start");
- this.mFaceSettingsModel.lookAtScreenDuringFaceRecognition(status);
- console.info("FaceEnroll FaceSettingsPresenter lookAtScreenDuringFaceRecognition end");
- }
-
- /**
- * Whether to start up auxiliary mode
- *
- * @param {object} status - The auxiliaryMode status
- */
- auxiliaryMode(status) {
- console.info("FaceEnroll FaceSettingsPresenter auxiliaryMode start");
- this.mFaceSettingsModel.auxiliaryMode(status);
- console.info("FaceEnroll FaceSettingsPresenter auxiliaryMode end");
- }
-
- /**
- * Whether to turn off and pick up the phone to turn on the screen
- *
- * @param {object} status - The BrightScreenOfThePhone status
- */
- BrightScreenOfThePhone(status) {
- console.info("FaceEnroll FaceSettingsPresenter BrightScreenOfThePhone start");
- this.mFaceSettingsModel.BrightScreenOfThePhone(status)
- console.info("FaceEnroll FaceSettingsPresenter BrightScreenOfThePhone end");
- }
-}
\ No newline at end of file
diff --git a/ui/faceenroll/common/src/main/ets/default/common/presenter/userAuthPresenter.ets b/ui/faceenroll/common/src/main/ets/default/common/presenter/userAuthPresenter.ets
deleted file mode 100644
index 2ce6df7..0000000
--- a/ui/faceenroll/common/src/main/ets/default/common/presenter/userAuthPresenter.ets
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * 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 ResourceManager from '../manager/resourceManager.ets'
-import router from '@system.router';
-
-export default class UserAuthPresenter {
- protected mResourceManager: ResourceManager;
- private static userAuthPresenter: UserAuthPresenter = new UserAuthPresenter();
- private static resourceManager: ResourceManager = new ResourceManager();
-
- protected constructor() {
- this.mResourceManager = ResourceManager.getInstance();
- }
-
- public static getInstance(): UserAuthPresenter{
- return this.userAuthPresenter;
- }
-
- /**
- * Jump to userAuth page.
- * @param callback
- */
- public jumpToUserAuth(callback) {
- this.mResourceManager.jumpToUserAuth(this.jumpToUserAuthCallBack.bind(this),callback);
- }
-
- /**
- * Jump to userAuth after got token.
- * @param {unit8Array} token - Token.
- * @param {function} getTokenCallback - Do after get token.
- */
- public jumpToUserAuthCallBack(token,getTokenCallback) {
- AppStorage.SetOrCreate('faceToken', token);
- getTokenCallback();
- setTimeout(()=>{
- router.push({
- uri:'pages/entryView'
- });
- AppStorage.Delete('faceToken');
- },600000);
- }
-}
-
diff --git a/ui/faceenroll/common/src/main/ets/default/common/presenter/userSettingsPresenter.ets b/ui/faceenroll/common/src/main/ets/default/common/presenter/userSettingsPresenter.ets
deleted file mode 100644
index 95fb680..0000000
--- a/ui/faceenroll/common/src/main/ets/default/common/presenter/userSettingsPresenter.ets
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * 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 UserAuthModel from '../model/userAuthModel.ets'
-import FeatureAbility from '@ohos.ability.featureAbility';
-import ResourceManager from '../manager/resourceManager.ets'
-import router from '@system.router';
-
-/**
- * Class UserSettingsPresenter.
- */
-export default class UserSettingsPresenter {
- private authLength: number ;
- protected mUserAuthModel: UserAuthModel;
- protected mResourceManager: ResourceManager;
- private deleteResArr = new Array();
- private faceInfo;
- private static userSettingsPresenter: UserSettingsPresenter = new UserSettingsPresenter();
- private static resourceManager: ResourceManager = new ResourceManager();
-
- protected constructor() {
- this.mUserAuthModel = UserAuthModel.getInstance();
- this.mResourceManager = ResourceManager.getInstance();
- if (this.mUserAuthModel != undefined) {
- this.faceInfo = AppStorage.Get('faceInfo');
- }
- }
-
- /**
- * Return an instance of UserSettingsPresenter.
- */
- public static getInstance(): UserSettingsPresenter{
- return this.userSettingsPresenter;
- }
-
- /**
- * Delete face.
- * @param {object} faceInfos - User faceInfos.
- * @param {Uint8Array} token - Token.
- * @param {function} sucssCallback - Do this after callback.
- */
- public deleteFace(faceInfos, token, sucssCallback) {
- for (let i = this.deleteResArr.length; i < faceInfos.length; i++) {
- this.mUserAuthModel.deleteFace(faceInfos[i].credentialId, token, this.deleteFaceCallback.bind(this), sucssCallback);
- }
- }
-
- /**
- * Delete face callback.
- * @param {boolean} deleteRes - Delete face result.
- * @param {function} sucssCallback - Do this after get delete result.
- */
- public deleteFaceCallback(deleteRes, sucssCallback) {
- let res: boolean = deleteRes;
- this.deleteResArr.push(res);
- if (this.deleteResArr.length == this.faceInfo.length) {
- AppStorage.SetOrCreate('deleteRes', this.deleteResArr);
- sucssCallback();
- }
- }
-
- /**
- * Delete face pad.
- * @param {object} faceInfos - User faceInfos.
- * @param {Uint8Array} token - Token.
- * @param {function} sucssCallback - Do this after callback.
- */
- public deleteFacePad(faceInfo, token, sucssCallback) {
- this.mUserAuthModel.deleteFace(faceInfo.credentialId, token, this.deleteFaceCallbackPad.bind(this), sucssCallback);
- }
- /**
- * Delete face Pad callback.
- * @param {boolean} deleteRes - Delete face result.
- * @param {function} sucssCallback - Do this after get delete result.
- */
- public deleteFaceCallbackPad(deleteRes, sucssCallback) {
- if (deleteRes == true) {
- sucssCallback();
- }
- }
-}
-
diff --git a/ui/faceenroll/common/src/main/resources/base/element/string.json b/ui/faceenroll/common/src/main/resources/base/element/string.json
deleted file mode 100644
index 146f146..0000000
--- a/ui/faceenroll/common/src/main/resources/base/element/string.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "string": [
- {
- "name": "commonutil_library",
- "value": "commonutil_library"
- }
- ]
-}
diff --git a/ui/faceenroll/feature/faceSettings/build.gradle b/ui/faceenroll/feature/faceSettings/build.gradle
deleted file mode 100644
index f36dadb..0000000
--- a/ui/faceenroll/feature/faceSettings/build.gradle
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * 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.
- */
-
-apply plugin: 'com.huawei.ohos.library'
-//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510
-ohos {
- compileSdkVersion 7
- defaultConfig {
- compatibleSdkVersion 7
- }
- arkEnabled false
- buildTypes {
- release {
- proguardOpt {
- proguardEnabled false
- rulesFiles 'proguard-rules.pro'
- }
- }
- }
-}
-dependencies {
-}
\ No newline at end of file
diff --git a/ui/faceenroll/feature/faceSettings/src/main/config.json b/ui/faceenroll/feature/faceSettings/src/main/config.json
deleted file mode 100644
index 5fde09b..0000000
--- a/ui/faceenroll/feature/faceSettings/src/main/config.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "app": {
- "bundleName": "com.ohos.faceEnroll",
- "vendor": "ohos",
- "version": {
- "code": 1000000,
- "name": "1.0.0"
- }
- },
- "deviceConfig": {},
- "module": {
- "package": "com.ohos.faceEnroll",
- "deviceType": [
- "phone"
- ],
- "distro": {
- "deliveryWithInstall": true,
- "moduleName": "faceSettings1",
- "moduleType": "har"
- }
- }
-}
\ No newline at end of file
diff --git a/ui/faceenroll/feature/faceSettings/src/main/ets/default/pages/faceSettings.ets b/ui/faceenroll/feature/faceSettings/src/main/ets/default/pages/faceSettings.ets
deleted file mode 100644
index 1673f1b..0000000
--- a/ui/faceenroll/feature/faceSettings/src/main/ets/default/pages/faceSettings.ets
+++ /dev/null
@@ -1,730 +0,0 @@
-/*
- * 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 DefaultConstants from '../common/DefaultConstants.ets';
-import FaceSettingsPresenter from "../../../../../../../common/src/main/ets/default/common/presenter/FaceSettingsPresenter.ets";
-import UserSettingsPresenter from '../../../../../../../common/src/main/ets/default/common/presenter/userSettingsPresenter.ets';
-import router from '@system.router';
-
-const FACELENGTH: number = 1;
-const USER_MODE: string = '3D';
-let mFaceSettingsPresenter: FaceSettingsPresenter;
-let mUserSettingsPresenter: UserSettingsPresenter;
-
-@Component
-export default struct faceSettings {
- scroller: Scroller = new Scroller();
- @Prop faceLength: number;
- @Prop userMode: string;
- @State mFaceLength: number = 1;
- @StorageLink('deleteRes') @Watch('deleteFaceSuccess') resultArr: [] = [];
- @StorageLink('smartDisplayLockScreen_isOn') smartDisplayLockScreen_isOn: boolean = true;
- @StorageLink('fillInAccount_isOn') fillInAccount_isOn: boolean = false;
- @StorageLink('lookAtScreenDuringFaceRecognition_isOn') lookAtScreenDuringFaceRecognition_isOn: boolean = false;
- @StorageLink('fillLight_isOn') fillLight_isOn: boolean = false;
- @StorageLink('auxiliaryMode_isOn') auxiliaryMode_isOn: boolean = false;
- @State unlock_num: number = 2;
- @State safeCabinet_isOn: boolean = true;
- @State appLock_isOn: boolean = true;
-
- private aboutToAppear(): void {
- console.info("FaceEnroll FaceSettings aboutToAppear start");
- console.info('FaceEnroll FaceSettings faceLength = ' + this.faceLength);
- console.info('FaceEnroll FaceSettings userMode = ' + this.userMode);
- mUserSettingsPresenter = UserSettingsPresenter.getInstance();
- mFaceSettingsPresenter = FaceSettingsPresenter.getInstance();
- this.mFaceLength = this.faceLength;
- console.info("FaceEnroll FaceSettings aboutToAppear end");
- }
-
- SafeCabinetDialogController: CustomDialogController = new CustomDialogController({
- builder: SafeCabinetDialog({ status: $safeCabinet_isOn }),
- autoCancel: false,
- // offset: {
- // dx: 0, dy: -30
- // },
- alignment: DialogAlignment.Bottom,
- // customStyle: true
- })
- AppLockDialogController: CustomDialogController = new CustomDialogController({
- builder: AppLockDialog({ status: $appLock_isOn }),
- autoCancel: false,
- alignment: DialogAlignment.Bottom,
- // customStyle: true
- })
- UnlockDialogController: CustomDialogController = new CustomDialogController({
- builder: UnlockDialog({ num: $unlock_num }),
- autoCancel: false,
- alignment: DialogAlignment.Bottom,
- // customStyle: true
- })
- deleteFaceDialogController: CustomDialogController = new CustomDialogController({
- builder: DeleteFaceDialog({ faceNum: this.mFaceLength, confirm: this.onAccept.bind(this) }),
- autoCancel: false,
- alignment: DialogAlignment.Bottom,
- // customStyle: true
- })
-
-/**
- * Delete face.
- */
- onAccept() {
- console.info("FaceSettings AppStorage.Get('faceInfo')" + JSON.stringify(AppStorage.Get('faceInfo')));
- let faceInfos = new Array();
- faceInfos = AppStorage.Get('faceInfo');
- let faceToken = AppStorage.Get('faceToken');
- let deleteResult = mUserSettingsPresenter.deleteFace(faceInfos, faceToken, this.deleteFaceSuccess.bind(this));
- }
-
-/**
- * Do after delete face successfully.
- */
- deleteFaceSuccess() {
- console.info('FaceSettings deleteFaceSuccess start');
- let deleteRes: [] = AppStorage.Get('deleteRes');
- let faceInfos = new Array();
- faceInfos = AppStorage.Get('faceInfo');
- if (deleteRes.length == faceInfos.length) {
- let resultSucFlag = 0;
- for (let i = 0; i < deleteRes.length; i++) {
- if (deleteRes[i]) {
- resultSucFlag += 1;
- }
- }
- if (resultSucFlag == deleteRes.length) {
- this.deleteFaceDialogController.close();
- router.push({
- uri: 'pages/entryView'
- })
- } else {
- this.deleteFaceDialogController.close();
- console.info('FaceEnroll faceSettings delete face fail');
- }
- } else {
- this.deleteFaceSuccess();
- }
- }
-
- build() {
- Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center }) {
- Scroll(this.scroller) {
- Column() {
- Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) {
- Image($r('app.media.back'))
- .width(DefaultConstants.BACK_ICON_WIDTH)
- .height(DefaultConstants.BACK_ICON_HEIGHT)
- Text($r('app.string.face_checker'))
- .fontSize(DefaultConstants.OVERSIZE_FONT_SIZE)
- .margin({ left: DefaultConstants.PADDING_30 })
- }
- .padding({ left: DefaultConstants.PADDING, right: DefaultConstants.PADDING })
- .height(DefaultConstants.SINGLE_HEIGHT)
- .onClick(() => {
- router.push({
- uri: 'pages/entryView'
- })
- })
-
- Text($r('app.string.face_recognition_is_used'))
- .fontSize(DefaultConstants.MEDIUM_FONT_SIZE)
- .fontColor(DefaultConstants.GREY_FONT_COLOR)
- .padding({ left: DefaultConstants.PADDING, right: DefaultConstants.PADDING })
- .margin({ bottom: DefaultConstants.PADDING_16, top: DefaultConstants.PADDING_24 })
- Column() {
- Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
- Text($r('app.string.face_unlock_method'))
- .fontSize(DefaultConstants.LARGE_FONT_SIZE)
- Row() {
- if (this.unlock_num === 2) {
- Text($r('app.string.face_unlock_method_close'))
- .fontColor(DefaultConstants.GREY_FONT_COLOR)
- .fontSize(DefaultConstants.MEDIUM_FONT_SIZE)
- } else if (this.unlock_num === 1) {
- Text($r('app.string.face_recognize_slideunlock_title'))
- .fontColor(DefaultConstants.GREY_FONT_COLOR)
- .fontSize(DefaultConstants.MEDIUM_FONT_SIZE)
- }
- else if (this.unlock_num === 0) {
- Text($r('app.string.face_recognize_unlock_title'))
- .fontColor(DefaultConstants.GREY_FONT_COLOR)
- .fontSize(DefaultConstants.MEDIUM_FONT_SIZE)
- }
- Image($r('app.media.ic_settings_arrow'))
- .width(DefaultConstants.ICON_WIDTH)
- .height(DefaultConstants.ICON_HEIGHT)
- }
- }
- .height(DefaultConstants.SINGLE_HEIGHT_)
- .onClick(() => {
- this.UnlockDialogController.open()
- })
-
- Divider()
- .strokeWidth(DefaultConstants.DIVIDER)
- .color(DefaultConstants.GREY_BACKGROUND_COLOR)
- Flex({
- direction: FlexDirection.Row,
- justifyContent: FlexAlign.SpaceBetween,
- alignItems: ItemAlign.Center
- }) {
- Text($r('app.string.secure_notification_new'))
- .fontSize(DefaultConstants.LARGE_FONT_SIZE)
- Toggle({ type: ToggleType.Switch, isOn: this.smartDisplayLockScreen_isOn })
- .onChange(() => {
- this.smartDisplayLockScreen_isOn = !this.smartDisplayLockScreen_isOn
- mFaceSettingsPresenter.SmartLockScreenNotifications(this.smartDisplayLockScreen_isOn);
- })
- }
- .height(DefaultConstants.SINGLE_HEIGHT_)
-
- Divider()
- .strokeWidth(DefaultConstants.DIVIDER)
- .color(DefaultConstants.GREY_BACKGROUND_COLOR)
- if (this.userMode === USER_MODE) {
- Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
- Text($r('app.string.title_strong_box_pref'))
- .fontSize(DefaultConstants.LARGE_FONT_SIZE)
- if (this.safeCabinet_isOn === true) {
- Toggle({ type: ToggleType.Switch, isOn: this.safeCabinet_isOn }).onChange(() => {
- this.safeCabinet_isOn = false
- })
- } else {
- Flex({ justifyContent: FlexAlign.End }) {
- Toggle({ type: ToggleType.Switch, isOn: this.safeCabinet_isOn })
- .enabled(false)
- }.width(DefaultConstants.SINGLE_HEIGHT_)
- .height(DefaultConstants.WIDTH)
- .onClick(() => {
- console.log('lzx====> SafeCabinetDialogController onchange')
- if (this.safeCabinet_isOn === false) {
- this.SafeCabinetDialogController.open();
- } else {
- this.safeCabinet_isOn = false
- }
- })
- }
- }
- .height(DefaultConstants.SINGLE_HEIGHT_)
-
- Divider()
- .strokeWidth(DefaultConstants.DIVIDER)
- .color(DefaultConstants.GREY_BACKGROUND_COLOR)
- }
- Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
- Text($r('app.string.title_apps_security_pref'))
- .fontSize(DefaultConstants.LARGE_FONT_SIZE)
- if (this.appLock_isOn === true) {
- Toggle({ type: ToggleType.Switch, isOn: this.appLock_isOn })
- .onChange(() => {
- this.appLock_isOn = false
- mFaceSettingsPresenter.AppLock(this.appLock_isOn);
- })
- } else {
- Flex({ justifyContent: FlexAlign.End }) {
- Toggle({ type: ToggleType.Switch, isOn: this.appLock_isOn })
- .enabled(false)
- }.width(DefaultConstants.SINGLE_HEIGHT_)
- .height(DefaultConstants.WIDTH)
- .onClick(() => {
- if (this.appLock_isOn === false) {
- this.AppLockDialogController.open();
- } else {
- this.appLock_isOn = false
- mFaceSettingsPresenter.AppLock(this.appLock_isOn);
- }
- })
- }
- }
- .height(DefaultConstants.SINGLE_HEIGHT_)
-
- Divider()
- .strokeWidth(DefaultConstants.DIVIDER)
- .color(DefaultConstants.GREY_BACKGROUND_COLOR)
- Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
- Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Start }) {
- Text($r('app.string.face_fingerprint_settings_switch_title'))
- .fontSize(DefaultConstants.LARGE_FONT_SIZE)
- .margin({ bottom: DefaultConstants.PADDING_4 })
- Text($r('app.string.face_fingerprint_settings_switch_summary'))
- .fontColor(DefaultConstants.GREY_FONT_COLOR)
- .fontSize(DefaultConstants.MEDIUM_FONT_SIZE)
- }
-
- Toggle({ type: ToggleType.Switch, isOn: this.fillInAccount_isOn })
- .onChange(() => {
- this.fillInAccount_isOn = !this.fillInAccount_isOn
- mFaceSettingsPresenter.FillInAccountPassword(this.fillInAccount_isOn);
- })
- }
- .height(DefaultConstants.DOUBLE_HEIGHT_)
- }
- .borderRadius(DefaultConstants.BORDER_RADIUS)
- .backgroundColor(DefaultConstants.WHITE_BACKGROUND_COLOR)
- .margin({ bottom: DefaultConstants.PADDING })
- .padding({
- top: DefaultConstants.PADDING_8,
- bottom: DefaultConstants.PADDING_8,
- left: DefaultConstants.PADDING,
- right: DefaultConstants.PADDING
- })
-
- Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) {
- Text($r('app.string.delete_record_title'))
- .fontColor(Color.Red)
- .fontSize(DefaultConstants.LARGE_FONT_SIZE)
- }
- .borderRadius(DefaultConstants.BORDER_RADIUS)
- .backgroundColor(DefaultConstants.WHITE_BACKGROUND_COLOR)
- .margin({ bottom: DefaultConstants.PADDING_16 })
- .padding({ left: DefaultConstants.PADDING, right: DefaultConstants.PADDING })
- .height(DefaultConstants.SINGLE_HEIGHT)
- .onClick(() => {
- this.deleteFaceDialogController.open();
- })
-
- if (this.faceLength === FACELENGTH) {
- Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) {
- Text($r('app.string.enroll_backup_face_title'))
- .fontColor(Color.Blue)
- .fontSize(DefaultConstants.LARGE_FONT_SIZE)
- }
- .borderRadius(DefaultConstants.BORDER_RADIUS)
- .backgroundColor(DefaultConstants.WHITE_BACKGROUND_COLOR)
- .margin({ bottom: DefaultConstants.PADDING_16 })
- .padding({ left: DefaultConstants.PADDING, right: DefaultConstants.PADDING })
- .height(DefaultConstants.SINGLE_HEIGHT)
-
- Text($r('app.string.enroll_backup_face_summary'))
- .fontSize(DefaultConstants.MEDIUM_FONT_SIZE)
- .fontColor(DefaultConstants.GREY_FONT_COLOR)
- .margin({ bottom: DefaultConstants.PADDING_32 })
- .padding({ left: DefaultConstants.PADDING, right: DefaultConstants.PADDING })
- } else {
- Text($r('app.string.main_and_backup_faces'))
- .fontSize(DefaultConstants.MEDIUM_FONT_SIZE)
- .fontColor(DefaultConstants.GREY_FONT_COLOR)
- .margin({ bottom: DefaultConstants.PADDING_32 })
- .padding({ left: DefaultConstants.PADDING, right: DefaultConstants.PADDING })
- }
- Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
- Text($r('app.string.face_introdution_title'))
- .fontSize(DefaultConstants.LARGE_FONT_SIZE)
- Row() {
- Text($r('app.string.face_enterance_off'))
- .fontColor(DefaultConstants.GREY_FONT_COLOR)
- .fontSize(DefaultConstants.MEDIUM_FONT_SIZE)
- Image($r('app.media.ic_settings_arrow'))
- .width(DefaultConstants.ICON_WIDTH)
- .height(DefaultConstants.ICON_HEIGHT)
- }
- }
- .borderRadius(DefaultConstants.BORDER_RADIUS)
- .backgroundColor(DefaultConstants.WHITE_BACKGROUND_COLOR)
- .margin({ bottom: DefaultConstants.PADDING })
- .padding({ left: DefaultConstants.PADDING, right: DefaultConstants.PADDING })
- .height(DefaultConstants.SINGLE_HEIGHT)
- .onClick(() => {
- AppStorage.SetOrCreate('facePageFlag', 1);
- })
-
- if (this.userMode === USER_MODE) {
- Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
- Text($r('app.string.title_face_stare_aux'))
- .fontSize(DefaultConstants.LARGE_FONT_SIZE)
- Toggle({ type: ToggleType.Switch, isOn: this.lookAtScreenDuringFaceRecognition_isOn })
- .onChange(() => {
- this.lookAtScreenDuringFaceRecognition_isOn = !this.lookAtScreenDuringFaceRecognition_isOn
- mFaceSettingsPresenter.lookAtScreenDuringFaceRecognition(this.lookAtScreenDuringFaceRecognition_isOn);
- })
- }
- .borderRadius(DefaultConstants.BORDER_RADIUS)
- .backgroundColor(DefaultConstants.WHITE_BACKGROUND_COLOR)
- .margin({ bottom: DefaultConstants.PADDING_16 })
- .padding({ left: DefaultConstants.PADDING, right: DefaultConstants.PADDING })
- .height(DefaultConstants.SINGLE_HEIGHT)
- } else {
- Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
- Text($r('app.string.title_fill_light'))
- .fontSize(DefaultConstants.LARGE_FONT_SIZE)
- Toggle({ type: ToggleType.Switch, isOn: this.fillLight_isOn })
- .onChange(() => {
- this.fillLight_isOn = !this.fillLight_isOn
- mFaceSettingsPresenter.ScreenFillFightInLowLightEnvironment(this.fillLight_isOn);
- })
- }
- .borderRadius(DefaultConstants.BORDER_RADIUS)
- .backgroundColor(DefaultConstants.WHITE_BACKGROUND_COLOR)
- .margin({ bottom: DefaultConstants.PADDING })
- .padding({ left: DefaultConstants.PADDING, right: DefaultConstants.PADDING })
- .height(DefaultConstants.SINGLE_HEIGHT)
-
- Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
- Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Start }) {
- Text($r('app.string.auxiliary_mode'))
- .fontSize(DefaultConstants.LARGE_FONT_SIZE)
- .margin({ bottom: DefaultConstants.PADDING_4 })
- Text($r('app.string.recognize_without_opening_eyes'))
- .fontColor(DefaultConstants.GREY_FONT_COLOR)
- .fontSize(DefaultConstants.MEDIUM_FONT_SIZE)
- }
-
- Toggle({ type: ToggleType.Switch, isOn: this.auxiliaryMode_isOn })
- .onChange(() => {
- this.auxiliaryMode_isOn = !this.auxiliaryMode_isOn
- mFaceSettingsPresenter.auxiliaryMode(this.auxiliaryMode_isOn);
- })
- }
- .borderRadius(DefaultConstants.BORDER_RADIUS)
- .backgroundColor(DefaultConstants.WHITE_BACKGROUND_COLOR)
- .margin({ bottom: DefaultConstants.PADDING })
- .padding({ left: DefaultConstants.PADDING, right: DefaultConstants.PADDING })
- .height(DefaultConstants.DOUBLE_HEIGHT)
- }
- Text() {
- Span($r('app.string.face_3dguide_info_2'))
- .fontColor(DefaultConstants.GREY_FONT_COLOR)
- if (this.userMode === USER_MODE) {
- Span($r('app.string.face_guide_3d_announce_link'))
- .fontColor(Color.Blue)
- } else {
- Span($r('app.string.face_guide_2d_announce_link'))
- .fontColor(Color.Blue)
- }
- }
- .fontSize(DefaultConstants.SMALL_FONT_SIZE)
- .padding({ left: DefaultConstants.PADDING, right: DefaultConstants.PADDING })
- .onClick(() => {
- router.push({
- uri: 'pages/declare'
- })
- })
-
- Column() {
- Text($r('app.string.recommend_preference_title'))
- .fontColor(DefaultConstants.GREY_FONT_COLOR)
- .fontSize(DefaultConstants.MEDIUM_FONT_SIZE)
- .margin({ bottom: DefaultConstants.PADDING_16 })
- Text($r('app.string.face_config_light_01_universal'))
- .fontColor(Color.Blue)
- .fontSize(DefaultConstants.MEDIUM_FONT_SIZE)
- if (this.userMode === USER_MODE) {
- Text($r('app.string.annotation_screen_keeps_on'))
- .fontColor(Color.Blue)
- .fontSize(DefaultConstants.MEDIUM_FONT_SIZE)
- .margin({ top: DefaultConstants.PADDING_16 })
- }
- }
- .borderRadius(DefaultConstants.BORDER_RADIUS)
- .backgroundColor(DefaultConstants.DARK_GREY_BACKGROUND_COLOR)
- .margin({ bottom: DefaultConstants.PADDING_32, top: DefaultConstants.PADDING_32 })
- .padding({
- bottom: DefaultConstants.PADDING_30,
- top: DefaultConstants.PADDING_30,
- left: DefaultConstants.PADDING,
- right: DefaultConstants.PADDING
- })
- .width(DefaultConstants.WIDTH)
- .alignItems(HorizontalAlign.Start)
- }
- .backgroundColor(DefaultConstants.GREY_BACKGROUND_COLOR)
- .width(DefaultConstants.TOTAL_WIDTH)
- .alignItems(HorizontalAlign.Start)
- }
- .scrollBarWidth(0)
- }
- .width(DefaultConstants.WIDTH)
- .height(DefaultConstants.WIDTH)
- .backgroundColor(DefaultConstants.GREY_BACKGROUND_COLOR)
- }
-}
-
-@CustomDialog
-struct UnlockDialog {
- @Link num: number
- controller: CustomDialogController;
- @State booleans: boolean[] = [false, false, false]
-
- aboutToAppear() {
- this.booleans[this.num] = true
- }
-
- isChecked(num) {
- for (let i = 0;i < this.booleans.length; i++) {
- if (i != num) {
- this.booleans[i] = false
- } else {
- this.booleans[i] = true
- }
- }
- }
-
- build() {
- Column() {
- Text($r('app.string.face_unlock_method'))
- .fontSize(DefaultConstants.OVERSIZE_FONT_SIZE)
- .margin({ bottom: DefaultConstants.PADDING_30 })
- Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
- Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Start }) {
- Text($r('app.string.face_recognize_unlock_title'))
- .fontSize(DefaultConstants.LARGE_FONT_SIZE)
- .margin({ bottom: DefaultConstants.PADDING_4 })
- Text($r('app.string.face_recognize_unlock_summary_3d'))
- .fontColor(DefaultConstants.GREY_FONT_COLOR)
- .fontSize(DefaultConstants.MEDIUM_FONT_SIZE)
- }
-
- Toggle({ type: ToggleType.Checkbox, isOn: this.booleans[0] })
- .width(DefaultConstants.RADIO_SIZE)
- .height(DefaultConstants.RADIO_SIZE)
- .onChange(() => {
- this.isChecked(0)
- this.num = 0
- mFaceSettingsPresenter.chooseUnlockMethod(this.num);
- this.controller.close();
- })
- }.height(DefaultConstants.DOUBLE_HEIGHT_)
-
- Divider()
- .strokeWidth(DefaultConstants.DIVIDER)
- .color(DefaultConstants.GREY_BACKGROUND_COLOR)
- Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
- Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Start }) {
- Text($r('app.string.face_recognize_slideunlock_title'))
- .fontSize(DefaultConstants.LARGE_FONT_SIZE)
- .margin({ bottom: DefaultConstants.PADDING_4 })
- Text($r('app.string.face_recognize_slideunlock_summary_3d'))
- .fontColor(DefaultConstants.GREY_FONT_COLOR)
- .fontSize(DefaultConstants.MEDIUM_FONT_SIZE)
- }
-
- Toggle({ type: ToggleType.Checkbox, isOn: this.booleans[1] })
- .width(DefaultConstants.RADIO_SIZE)
- .height(DefaultConstants.RADIO_SIZE)
- .onChange(() => {
- this.isChecked(1)
- this.num = 1
- mFaceSettingsPresenter.chooseUnlockMethod(this.num);
- this.controller.close()
- })
- }.height(DefaultConstants.DOUBLE_HEIGHT_)
-
- Divider()
- .strokeWidth(DefaultConstants.DIVIDER)
- .color(DefaultConstants.GREY_BACKGROUND_COLOR)
- Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
- Text($r('app.string.face_unlock_method_close'))
- .fontSize(DefaultConstants.LARGE_FONT_SIZE)
- Toggle({ type: ToggleType.Checkbox, isOn: this.booleans[2] })
- .width(DefaultConstants.RADIO_SIZE)
- .height(DefaultConstants.RADIO_SIZE)
- .onChange(() => {
- this.isChecked(2)
- this.num = 2;
- mFaceSettingsPresenter.chooseUnlockMethod(this.num);
- this.controller.close()
- })
- }.height(DefaultConstants.SINGLE_HEIGHT_)
-
- Column() {
- Text($r('app.string.face_record_cancel'))
- .fontColor(Color.Blue)
- .fontSize(DefaultConstants.LARGE_FONT_SIZE)
- }
- .width(DefaultConstants.WIDTH)
- .margin({ top: DefaultConstants.PADDING_20 })
- .onClick(() => {
- this.controller.close()
- })
- }
- .width(DefaultConstants.TOTAL_WIDTH)
- .borderRadius(DefaultConstants.BORDER_RADIUS)
- .backgroundColor(DefaultConstants.WHITE_BACKGROUND_COLOR)
- .alignItems(HorizontalAlign.Start)
- .padding({
- bottom: DefaultConstants.PADDING_30,
- top: DefaultConstants.PADDING_20,
- left: DefaultConstants.PADDING_30,
- right: DefaultConstants.PADDING_30
- })
- }
-}
-
-@CustomDialog
-struct SafeCabinetDialog {
- @Link status: boolean
- controller: CustomDialogController
-
- build() {
- Column() {
- Text($r('app.string.activate_safe'))
- .fontSize(DefaultConstants.OVERSIZE_FONT_SIZE)
- .margin({ bottom: DefaultConstants.PADDING_30 })
- Text($r('app.string.face_inform_open_strongbox_msg'))
- .fontSize(DefaultConstants.LARGE_FONT_SIZE)
- .margin({ bottom: DefaultConstants.PADDING_20 })
- Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) {
- Text($r('app.string.face_record_cancel'))
- .fontColor(Color.Blue)
- .fontSize(DefaultConstants.LARGE_FONT_SIZE)
- .onClick(() => {
- this.controller.close()
- })
- Divider()
- .vertical(true)
- .strokeWidth(DefaultConstants.DIVIDER)
- .color(DefaultConstants.DARK_GREY_BACKGROUND_COLOR)
- .height(DefaultConstants.PADDING_30)
- Text($r('app.string.enable'))
- .fontColor(Color.Blue)
- .fontSize(DefaultConstants.LARGE_FONT_SIZE)
- .onClick(() => {
- this.status = true;
- mFaceSettingsPresenter.SafeCabinet(this.status);
- this.controller.close()
- })
- }
- }
- .width(DefaultConstants.TOTAL_WIDTH)
- .borderRadius(DefaultConstants.BORDER_RADIUS)
- .backgroundColor(DefaultConstants.WHITE_BACKGROUND_COLOR)
- .alignItems(HorizontalAlign.Start)
- .padding({
- bottom: DefaultConstants.PADDING_30,
- top: DefaultConstants.PADDING_20,
- left: DefaultConstants.PADDING_30,
- right: DefaultConstants.PADDING_30
- })
- }
-}
-
-@CustomDialog
-struct AppLockDialog {
- @Link status: boolean
- controller: CustomDialogController
-
- build() {
- Column() {
- Text($r('app.string.activate_app_lock'))
- .fontSize(DefaultConstants.OVERSIZE_FONT_SIZE)
- .margin({ bottom: DefaultConstants.PADDING_30 })
- Text($r('app.string.face_inform_open_applock_msg'))
- .fontSize(DefaultConstants.LARGE_FONT_SIZE)
- .margin({ bottom: DefaultConstants.PADDING_20 })
- Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) {
- Text($r('app.string.face_record_cancel'))
- .fontColor(Color.Blue)
- .fontSize(DefaultConstants.LARGE_FONT_SIZE)
- .onClick(() => {
- this.controller.close()
- })
- Divider()
- .vertical(true)
- .strokeWidth(DefaultConstants.DIVIDER)
- .color(DefaultConstants.DARK_GREY_BACKGROUND_COLOR)
- .height(DefaultConstants.PADDING_30)
- Text($r('app.string.enable'))
- .fontColor(Color.Blue)
- .fontSize(DefaultConstants.LARGE_FONT_SIZE)
- .onClick(() => {
- this.status = true;
- mFaceSettingsPresenter.AppLock(this.status);
- this.controller.close()
- })
- }
- }
- .width(DefaultConstants.TOTAL_WIDTH)
- .borderRadius(DefaultConstants.BORDER_RADIUS)
- .backgroundColor(DefaultConstants.WHITE_BACKGROUND_COLOR)
- .alignItems(HorizontalAlign.Start)
- .padding({
- bottom: DefaultConstants.PADDING_30,
- top: DefaultConstants.PADDING_20,
- left: DefaultConstants.PADDING_30,
- right: DefaultConstants.PADDING_30
- })
- }
-}
-
-@CustomDialog
-struct DeleteFaceDialog {
- controller: CustomDialogController;
- @Prop faceNum: number;
- @StorageLink('BrightScreenOfThePhone_isOn') BrightScreenOfThePhone_isOn: boolean = true;
- confirm: () => void;
-
- aboutToAppear() {
- console.log('FaceSettings faceNum ' + this.faceNum)
- }
-
- build() {
- Column() {
- if (this.faceNum === FACELENGTH) {
- Text($r('app.string.delete_record_title'))
- .fontSize(DefaultConstants.OVERSIZE_FONT_SIZE)
- .margin({ bottom: DefaultConstants.PADDING_20 })
- } else {
- Text($r('app.string.delete_all_face_data'))
- .fontSize(DefaultConstants.OVERSIZE_FONT_SIZE)
- .margin({ bottom: DefaultConstants.PADDING_20 })
- }
- Text($r('app.string.wether_delete_face_data'))
- .fontSize(DefaultConstants.LARGE_FONT_SIZE)
- .margin({ bottom: DefaultConstants.PADDING_16 })
- Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) {
- Toggle({ type: ToggleType.Checkbox, isOn: this.BrightScreenOfThePhone_isOn })
- .width(DefaultConstants.RADIO_SIZE)
- .height(DefaultConstants.RADIO_SIZE)
- .onChange((isOn) => {
- this.BrightScreenOfThePhone_isOn = !this.BrightScreenOfThePhone_isOn
- })
- Text($r('app.string.face_recognize_lighton_close_universal'))
- .fontSize(DefaultConstants.MEDIUM_FONT_SIZE)
- }
- .margin({ left: -DefaultConstants.PADDING_10, bottom: DefaultConstants.PADDING_20 })
-
- Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) {
- Text($r('app.string.face_record_cancel'))
- .fontColor(Color.Blue)
- .fontSize(DefaultConstants.LARGE_FONT_SIZE)
- .onClick(() => {
- this.controller.close()
- })
- Divider()
- .vertical(true)
- .strokeWidth(DefaultConstants.DIVIDER)
- .color(DefaultConstants.DARK_GREY_BACKGROUND_COLOR)
- .height(DefaultConstants.PADDING_30)
- Text($r('app.string.face_record_delete'))
- .fontColor(Color.Red)
- .fontSize(DefaultConstants.LARGE_FONT_SIZE)
- .onClick(() => {
- mFaceSettingsPresenter.BrightScreenOfThePhone(this.BrightScreenOfThePhone_isOn);
- this.controller.close()
- this.confirm()
- })
- }
- }
- .width(DefaultConstants.TOTAL_WIDTH)
- .borderRadius(DefaultConstants.BORDER_RADIUS)
- .backgroundColor(DefaultConstants.WHITE_BACKGROUND_COLOR)
- .alignItems(HorizontalAlign.Start)
- .padding({
- bottom: DefaultConstants.PADDING_30,
- top: DefaultConstants.PADDING_20,
- left: DefaultConstants.PADDING_30,
- right: DefaultConstants.PADDING_30
- })
- }
-}
diff --git a/ui/faceenroll/feature/faceSettings/src/main/resources/base/element/string.json b/ui/faceenroll/feature/faceSettings/src/main/resources/base/element/string.json
deleted file mode 100644
index 7d9c40f..0000000
--- a/ui/faceenroll/feature/faceSettings/src/main/resources/base/element/string.json
+++ /dev/null
@@ -1,175 +0,0 @@
-{
- "string": [
- {
- "name": "entry_MainAbility",
- "value": "entry_MainAbility"
- },
- {
- "name": "mainability_description",
- "value": "ETS_Empty Ability"
- },
- {
- "name": "face_checker",
- "value": "人脸识别"
- },
-
- {
- "name": "face_unlock_method",
- "value": "解锁屏幕"
- },
- {
- "name": "face_recognize_slideunlock_title",
- "value": "滑动解锁"
- },
- {
- "name": "secure_notification_new",
- "value": "智能显示锁屏通知"
- },
-
- {
- "name": "face_fingerprint_settings_switch_title",
- "value": "自动填充账号和密码"
- },
- {
- "name": "face_fingerprint_settings_switch_summary",
- "value": "使用密码保险箱保存的帐号和密码"
- },
- {
- "name": "delete_record_title",
- "value": "删除面部数据"
- },
- {
- "name": "enroll_backup_face_title",
- "value": "设置备用面容"
- },
- {
- "name": "enroll_backup_face_summary",
- "value": "除继续学习您的长相外,还可识别另一种面容"
- },
-
- {
- "name": "face_introdution_title",
- "value": "解锁时需连接可信设备"
- },
-
- {
- "name": "title_face_stare_aux",
- "value": "人脸识别时需注视屏幕"
- },
-
- {
- "name": "face_3dguide_info_2",
- "value": "人脸识别可基于您的面部特征信息进行身份识别,了解"
- },
- {
- "name": "face_guide_2d_announce_link",
- "value": "关于人脸识别的声明。"
- },
- {
- "name": "face_guide_3d_announce_link",
- "value": "关于3D人脸识别的声明。"
- },
- {
- "name": "recommend_preference_title",
- "value": "是否在寻找其他设置项?"
- },
- {
- "name": "face_config_light_01_universal",
- "value": "拿起手机亮屏"
- },
-
- {
- "name": "face_recognize_unlock_title",
- "value": "直接解锁"
- },
- {
- "name": "face_recognize_unlock_summary_3d",
- "value": "人脸识别成功后直接解锁"
- },
- {
- "name": "face_recognize_slideunlock_summary_3d",
- "value": "人脸识别成功后滑动屏幕解锁"
- },
- {
- "name": "face_unlock_method_close",
- "value": "关闭"
- },
- {
- "name": "face_record_cancel",
- "value": "取消"
- },
- {
- "name": "face_inform_open_strongbox_msg",
- "value": "需要启用文件管理保密柜完成人脸关联。是否启用?"
- },
- {
- "name": "face_inform_open_applock_msg",
- "value": "需开启应用锁功能才能完成人脸关联。是否立即启用应用锁?"
- },
- {
- "name": "face_record_delete",
- "value": "删除"
- },
- {
- "name": "face_recognize_lighton_close_universal",
- "value": "同时关闭拿起手机亮屏"
- },
- {
- "name": "title_strong_box_pref",
- "value": "访问保密柜"
- },
- {
- "name": "title_apps_security_pref",
- "value": "访问应用锁"
- },
- {
- "name": "face_enterance_off",
- "value": "已关闭"
- },
- {
- "name": "title_fill_light",
- "value": "暗光环境下屏幕补光"
- },
- {
- "name": "face_recognition_is_used",
- "value": "人脸识别用于"
- },
- {
- "name": "main_and_backup_faces",
- "value": "已设置主用及备用面容"
- },
-
- {
- "name": "auxiliary_mode",
- "value": "辅助模式"
- },
- {
- "name": "recognize_without_opening_eyes",
- "value": "开启屏幕朗读后无需睁眼即可识别"
- },
- {
- "name": "annotation_screen_keeps_on",
- "value": "注视屏幕不熄屏"
- },
- {
- "name": "enable",
- "value": "启用"
- },
- {
- "name": "activate_safe",
- "value": "启用保密柜"
- },
- {
- "name": "activate_app_lock",
- "value": "启用应用锁"
- },
- {
- "name": "delete_all_face_data",
- "value": "删除主用及备用面容"
- },
- {
- "name": "wether_delete_face_data",
- "value": "删除后,基于面部数据的功能将不可用。是否删除?"
- }
- ]
-}
\ No newline at end of file
diff --git a/ui/faceenroll/feature/faceSettings/src/main/resources/base/media/back.png b/ui/faceenroll/feature/faceSettings/src/main/resources/base/media/back.png
deleted file mode 100644
index 85dcc6a..0000000
Binary files a/ui/faceenroll/feature/faceSettings/src/main/resources/base/media/back.png and /dev/null differ
diff --git a/ui/faceenroll/feature/faceSettings/src/main/resources/base/media/ic_settings_arrow.svg b/ui/faceenroll/feature/faceSettings/src/main/resources/base/media/ic_settings_arrow.svg
deleted file mode 100644
index d7dd265..0000000
--- a/ui/faceenroll/feature/faceSettings/src/main/resources/base/media/ic_settings_arrow.svg
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
diff --git a/ui/faceenroll/feature/faceSettings/src/main/resources/en_US/element/string.json b/ui/faceenroll/feature/faceSettings/src/main/resources/en_US/element/string.json
deleted file mode 100644
index f163048..0000000
--- a/ui/faceenroll/feature/faceSettings/src/main/resources/en_US/element/string.json
+++ /dev/null
@@ -1,176 +0,0 @@
-{
- "string": [
- {
- "name": "entry_MainAbility",
- "value": "entry_MainAbility"
- },
- {
- "name": "mainability_description",
- "value": "ETS_Empty Ability"
- },
- {
- "name": "face_checker",
- "value": "Face Recognition"
- },
-
- {
- "name": "face_unlock_method",
- "value": "Unlock device"
- },
- {
- "name": "face_recognize_slideunlock_title",
- "value": "Slide to unlock"
- },
- {
- "name": "secure_notification_new",
- "value": "Show notifications"
- },
-
- {
- "name": "face_fingerprint_settings_switch_title",
- "value": "Autofill usernames and passwords"
- },
- {
- "name": "face_fingerprint_settings_switch_summary",
- "value": "Usernames and passwords are accessed from Password Vault."
- },
- {
- "name": "delete_record_title",
- "value": "Delete facial data"
- },
- {
- "name": "enroll_backup_face_title",
- "value": "Set an alternate look"
- },
- {
- "name": "enroll_backup_face_summary",
- "value": "Add another appearance for accurate facial recognition even if you change your look."
- },
-
- {
- "name": "face_introdution_title",
- "value": "Require trusted device"
- },
-
- {
- "name": "title_face_stare_aux",
- "value": "Require eye contact"
- },
-
- {
- "name": "face_3dguide_info_2",
- "value": "Face Recognition verifies your identity based on your facial features. To learn more, see the"
- },
- {
- "name": "face_guide_2d_announce_link",
- "value": "Statement About Face Recognition"
- },
- {
- "name": "face_guide_3d_announce_link",
- "value": "Statement About 3D Face Recognition"
- },
- {
- "name": "recommend_preference_title",
- "value": "Looking for other settings?"
- },
- {
- "name": "face_config_light_01_universal",
- "value": "Raise to wake"
- },
- {
- "name": "face_recognize_unlock_title",
- "value": "Direct unlock"
- },
- {
- "name": "face_recognize_unlock_summary_3d",
- "value": "Unlock directly after successful facial recognition."
- },
- {
- "name": "face_recognize_slideunlock_summary_3d",
- "value": "Slide to unlock after successful facial recognition."
- },
- {
- "name": "face_unlock_method_close",
- "value": "Off"
- },
- {
- "name": "face_record_cancel",
- "value": "Cancel"
- },
- {
- "name": "face_inform_open_strongbox_msg",
- "value": "The Safe feature hasn\\'t been enabled yet."
- },
- {
- "name": "face_inform_open_applock_msg",
- "value": "App Lock is not enabled. Enable now?"
- },
- {
- "name": "face_record_delete",
- "value": "Delete"
- },
- {
- "name": "face_recognize_lighton_close_universal",
- "value": "Disable raise to wake"
- },
- {
- "name": "title_strong_box_pref",
- "value": "Access Safe"
- },
- {
- "name": "title_apps_security_pref",
- "value": "Access App Lock"
- },
- {
- "name": "face_enterance_off",
- "value": "Off"
- },
- {
- "name": "title_fill_light",
- "value": "Low light compensation"
- },
-
-
- {
- "name": "face_recognition_is_used",
- "value": "人脸识别用于"
- },
- {
- "name": "main_and_backup_faces",
- "value": "已设置主用及备用面容"
- },
-
- {
- "name": "auxiliary_mode",
- "value": "辅助模式"
- },
- {
- "name": "recognize_without_opening_eyes",
- "value": "开启屏幕朗读后无需睁眼即可识别"
- },
- {
- "name": "annotation_screen_keeps_on",
- "value": "注视屏幕不熄屏"
- },
- {
- "name": "enable",
- "value": "启用"
- },
- {
- "name": "activate_safe",
- "value": "启用保密柜"
- },
- {
- "name": "activate_app_lock",
- "value": "启用应用锁"
- },
- {
- "name": "delete_all_face_data",
- "value": "删除主用及备用面容"
- },
- {
- "name": "wether_delete_face_data",
- "value": "删除后,基于面部数据的功能将不可用。是否删除?"
- }
- ]
-}
\ No newline at end of file
diff --git a/ui/faceenroll/feature/faceSettings/src/main/resources/zh_CN/element/string.json b/ui/faceenroll/feature/faceSettings/src/main/resources/zh_CN/element/string.json
deleted file mode 100644
index 7d9c40f..0000000
--- a/ui/faceenroll/feature/faceSettings/src/main/resources/zh_CN/element/string.json
+++ /dev/null
@@ -1,175 +0,0 @@
-{
- "string": [
- {
- "name": "entry_MainAbility",
- "value": "entry_MainAbility"
- },
- {
- "name": "mainability_description",
- "value": "ETS_Empty Ability"
- },
- {
- "name": "face_checker",
- "value": "人脸识别"
- },
-
- {
- "name": "face_unlock_method",
- "value": "解锁屏幕"
- },
- {
- "name": "face_recognize_slideunlock_title",
- "value": "滑动解锁"
- },
- {
- "name": "secure_notification_new",
- "value": "智能显示锁屏通知"
- },
-
- {
- "name": "face_fingerprint_settings_switch_title",
- "value": "自动填充账号和密码"
- },
- {
- "name": "face_fingerprint_settings_switch_summary",
- "value": "使用密码保险箱保存的帐号和密码"
- },
- {
- "name": "delete_record_title",
- "value": "删除面部数据"
- },
- {
- "name": "enroll_backup_face_title",
- "value": "设置备用面容"
- },
- {
- "name": "enroll_backup_face_summary",
- "value": "除继续学习您的长相外,还可识别另一种面容"
- },
-
- {
- "name": "face_introdution_title",
- "value": "解锁时需连接可信设备"
- },
-
- {
- "name": "title_face_stare_aux",
- "value": "人脸识别时需注视屏幕"
- },
-
- {
- "name": "face_3dguide_info_2",
- "value": "人脸识别可基于您的面部特征信息进行身份识别,了解"
- },
- {
- "name": "face_guide_2d_announce_link",
- "value": "关于人脸识别的声明。"
- },
- {
- "name": "face_guide_3d_announce_link",
- "value": "关于3D人脸识别的声明。"
- },
- {
- "name": "recommend_preference_title",
- "value": "是否在寻找其他设置项?"
- },
- {
- "name": "face_config_light_01_universal",
- "value": "拿起手机亮屏"
- },
-
- {
- "name": "face_recognize_unlock_title",
- "value": "直接解锁"
- },
- {
- "name": "face_recognize_unlock_summary_3d",
- "value": "人脸识别成功后直接解锁"
- },
- {
- "name": "face_recognize_slideunlock_summary_3d",
- "value": "人脸识别成功后滑动屏幕解锁"
- },
- {
- "name": "face_unlock_method_close",
- "value": "关闭"
- },
- {
- "name": "face_record_cancel",
- "value": "取消"
- },
- {
- "name": "face_inform_open_strongbox_msg",
- "value": "需要启用文件管理保密柜完成人脸关联。是否启用?"
- },
- {
- "name": "face_inform_open_applock_msg",
- "value": "需开启应用锁功能才能完成人脸关联。是否立即启用应用锁?"
- },
- {
- "name": "face_record_delete",
- "value": "删除"
- },
- {
- "name": "face_recognize_lighton_close_universal",
- "value": "同时关闭拿起手机亮屏"
- },
- {
- "name": "title_strong_box_pref",
- "value": "访问保密柜"
- },
- {
- "name": "title_apps_security_pref",
- "value": "访问应用锁"
- },
- {
- "name": "face_enterance_off",
- "value": "已关闭"
- },
- {
- "name": "title_fill_light",
- "value": "暗光环境下屏幕补光"
- },
- {
- "name": "face_recognition_is_used",
- "value": "人脸识别用于"
- },
- {
- "name": "main_and_backup_faces",
- "value": "已设置主用及备用面容"
- },
-
- {
- "name": "auxiliary_mode",
- "value": "辅助模式"
- },
- {
- "name": "recognize_without_opening_eyes",
- "value": "开启屏幕朗读后无需睁眼即可识别"
- },
- {
- "name": "annotation_screen_keeps_on",
- "value": "注视屏幕不熄屏"
- },
- {
- "name": "enable",
- "value": "启用"
- },
- {
- "name": "activate_safe",
- "value": "启用保密柜"
- },
- {
- "name": "activate_app_lock",
- "value": "启用应用锁"
- },
- {
- "name": "delete_all_face_data",
- "value": "删除主用及备用面容"
- },
- {
- "name": "wether_delete_face_data",
- "value": "删除后,基于面部数据的功能将不可用。是否删除?"
- }
- ]
-}
\ No newline at end of file
diff --git a/ui/faceenroll/feature/faceSettingsPad/build.gradle b/ui/faceenroll/feature/faceSettingsPad/build.gradle
deleted file mode 100644
index f36dadb..0000000
--- a/ui/faceenroll/feature/faceSettingsPad/build.gradle
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * 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.
- */
-
-apply plugin: 'com.huawei.ohos.library'
-//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510
-ohos {
- compileSdkVersion 7
- defaultConfig {
- compatibleSdkVersion 7
- }
- arkEnabled false
- buildTypes {
- release {
- proguardOpt {
- proguardEnabled false
- rulesFiles 'proguard-rules.pro'
- }
- }
- }
-}
-dependencies {
-}
\ No newline at end of file
diff --git a/ui/faceenroll/feature/faceSettingsPad/src/main/config.json b/ui/faceenroll/feature/faceSettingsPad/src/main/config.json
deleted file mode 100644
index 5fde09b..0000000
--- a/ui/faceenroll/feature/faceSettingsPad/src/main/config.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "app": {
- "bundleName": "com.ohos.faceEnroll",
- "vendor": "ohos",
- "version": {
- "code": 1000000,
- "name": "1.0.0"
- }
- },
- "deviceConfig": {},
- "module": {
- "package": "com.ohos.faceEnroll",
- "deviceType": [
- "phone"
- ],
- "distro": {
- "deliveryWithInstall": true,
- "moduleName": "faceSettings1",
- "moduleType": "har"
- }
- }
-}
\ No newline at end of file
diff --git a/ui/faceenroll/feature/faceSettingsPad/src/main/ets/default/common/DefaultConstants.ets b/ui/faceenroll/feature/faceSettingsPad/src/main/ets/default/common/DefaultConstants.ets
deleted file mode 100644
index e7040a8..0000000
--- a/ui/faceenroll/feature/faceSettingsPad/src/main/ets/default/common/DefaultConstants.ets
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * 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 default class StyleConstants {
- public static DEFAULT_FONT_COLOR: string = '#ffffff'
- public static WIDTH: string = '100%';
- public static DIALOG_WIDTH: number = 440;
- public static DIALOG_PADDING: number = 24;
- public static DIALOG_TITLE_TOP: number = 20;
- public static DIALOG_TITLE_BOTTOM: number = 25;
- public static DIALOG_BUTTON_WIDTH: number = 196;
- public static DIALOG_BUTTON_WIDTH2: number = 392;
- public static DIALOG_BUTTON_HEIGHT: number = 45;
- public static ICON_WIDTH: number = 25;
- public static ICON_HEIGHT: number = 35;
- public static BACK_ICON_HEIGHT: number = 60;
- public static BACK_ICON_WIDTH: number = 30;
- public static RADIO_SIZE: number = 25;
- public static TOGGLE_SIZE: number = 40;
- public static TOGGLE_BOX_SIZE: number = 50;
- public static SINGLE_HEIGHT: number = 68;
- public static SINGLE_HEIGHT_: number = 55;
- public static DOUBLE_HEIGHT_: number = 68;
- public static DIVIDER: number = 1;
- public static BORDER_RADIUS: number = 20;
- public static PADDING: number = 14;
- public static PADDING_30: number = 30;
- public static PADDING_4: number = 4;
- public static TEXT_PADDING: number = 10;
- public static TEXT_PADDING2: number = 20;
- public static GERY_BORDER_PADDING: number = 16;
- public static WHITE_BACKGROUND_COLOR: string = '#FFFFFF';
- public static GREY_BACKGROUND_COLOR: string = '#F2F3F5';
- public static DARK_GREY_BACKGROUND_COLOR: string = '#E5E6E8';
- public static GREY_FONT_COLOR: string = '#5B5C5E';
- public static BLUE_FONT_COLOR: string = '#0A58F6';
- public static SMALL_FONT_SIZE: number = 17;
- public static MEDIUM_FONT_SIZE: number = 18;
- public static LARGE_FONT_SIZE: number = 19;
- public static OVERSIZE_FONT_SIZE: number = 22;
-}
\ No newline at end of file
diff --git a/ui/faceenroll/feature/faceSettingsPad/src/main/ets/default/pages/index.ets b/ui/faceenroll/feature/faceSettingsPad/src/main/ets/default/pages/index.ets
deleted file mode 100644
index 2c69009..0000000
--- a/ui/faceenroll/feature/faceSettingsPad/src/main/ets/default/pages/index.ets
+++ /dev/null
@@ -1,603 +0,0 @@
-// @ts-nocheck
-/*
- * 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 DefaultConstants from '../common/DefaultConstants.ets'
-import FaceSettingsPresenter from "../../../../../../../common/src/main/ets/default/common/presenter/FaceSettingsPresenter.ets"
-import UserSettingsPresenter from '../../../../../../../common/src/main/ets/default/common/presenter/userSettingsPresenter.ets'
-
-let mFaceSettingsPresenter: FaceSettingsPresenter;
-let mUserSettingsPresenter: UserSettingsPresenter;
-const FACENAME = '面部';
-
-@Component
-export default struct FaceSettings {
- scroller: Scroller = new Scroller();
- @Prop faceLength: number;
- @Prop userMode: string;
- @StorageLink('faceInfo') faceInfos: [] = [];
- @StorageLink('fillLight_isOn') fillLight_isOn: boolean = false;
- @StorageLink('fillInAccount_isOn') fillInAccount_isOn: boolean = false;
- @State appLock_isOn: boolean = true;
- @State unlock_num: number = 2;
- @State text: string = '面部1';
- private removeFace ;
- @State faceNames: [] = [];
- private name: [] = [{ isUsed:false }, { isUsed:false },{ isUsed:false },{ isUsed:false },{ isUsed:false }];
-
- private aboutToAppear(): void {
- console.info("FaceEnroll FaceSettings aboutToAppear start");
- console.info('FaceEnroll FaceSettings faceLength = ' + this.faceLength);
- console.info('FaceEnroll FaceSettings userMode = ' + this.userMode);
- mFaceSettingsPresenter = FaceSettingsPresenter.getInstance();
- mUserSettingsPresenter = UserSettingsPresenter.getInstance();
- for (let i = 0; i < this.faceInfos.length; i++) {
- this.faceNames.push({
- id: this.faceInfos[i].credentialId,
- name: i+1
- });
- this.name[i].isUsed = true;
- }
- console.info("FaceEnroll FaceSettings aboutToAppear end");
- }
-
- AppLockDialogController: CustomDialogController = new CustomDialogController({
- builder: AppLockDialog({ status: $appLock_isOn }),
- autoCancel: false,
- customStyle: true
- })
- UnlockDialogController: CustomDialogController = new CustomDialogController({
- builder: UnlockDialog({ num: $unlock_num }),
- autoCancel: false,
- customStyle: true
- })
- ReviseFaceController: CustomDialogController = new CustomDialogController({
- builder: ReviseFaceDialog({ text: $text, confirm: this.onAccept.bind(this) }),
- autoCancel: false,
- customStyle: true
- })
-
- onAccept() {
- let faceToken = AppStorage.Get('faceToken');
- mUserSettingsPresenter.deleteFacePad(this.removeFace, faceToken, this.deleteFaceSuccess.bind(this));
- }
-
- deleteFaceSuccess() {
- if (this.faceInfos.length != 0) {
-// let index = this.faceInfos.indexOf(this.removeFace)
-// this.faceInfos.splice(index, 1)
- for(let i =0;i {
- this.UnlockDialogController.open();
- })
-
- Divider()
- .strokeWidth(DefaultConstants.DIVIDER)
- .color(DefaultConstants.GREY_BACKGROUND_COLOR)
- Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
- Text($r('app.string.title_apps_security_pref'))
- .fontSize(DefaultConstants.LARGE_FONT_SIZE)
- if (this.appLock_isOn === true) {
- Row() {
- Toggle({ type: ToggleType.Switch, isOn: this.appLock_isOn })
- .width(DefaultConstants.TOGGLE_SIZE)
- .onChange(() => {
- this.appLock_isOn = false;
- mFaceSettingsPresenter.AppLock(this.appLock_isOn);
- })
- }.width(DefaultConstants.TOGGLE_BOX_SIZE)
- .height(DefaultConstants.SINGLE_HEIGHT_)
- } else {
- Row() {
- Toggle({ type: ToggleType.Switch, isOn: this.appLock_isOn })
- .width(DefaultConstants.TOGGLE_SIZE)
- .enabled(false)
-
- }.width(DefaultConstants.TOGGLE_BOX_SIZE)
- .height(DefaultConstants.SINGLE_HEIGHT_)
-
- .onClick(() => {
- if (this.appLock_isOn === false) {
- this.AppLockDialogController.open();
- } else {
- this.appLock_isOn = false;
- mFaceSettingsPresenter.AppLock(this.appLock_isOn);
- }
- })
- }
- }
- .height(DefaultConstants.SINGLE_HEIGHT_)
-
- Divider()
- .strokeWidth(DefaultConstants.DIVIDER)
- .color(DefaultConstants.GREY_BACKGROUND_COLOR)
-
- Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
- Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Start }) {
- Text($r('app.string.face_fingerprint_settings_switch_title'))
- .fontSize(DefaultConstants.LARGE_FONT_SIZE)
- .margin({ bottom: DefaultConstants.PADDING_4 })
- Text($r('app.string.face_fingerprint_settings_switch_summary'))
- .fontColor(DefaultConstants.GREY_FONT_COLOR)
- .fontSize(DefaultConstants.MEDIUM_FONT_SIZE)
- }
-
- Toggle({ type: ToggleType.Switch, isOn: this.fillInAccount_isOn })
- .width(DefaultConstants.TOGGLE_SIZE)
- .onChange(() => {
- this.fillInAccount_isOn = !this.fillInAccount_isOn
- mFaceSettingsPresenter.FillInAccountPassword(this.fillInAccount_isOn);
- })
- }
- .height(DefaultConstants.DOUBLE_HEIGHT_)
- }
- .borderRadius(DefaultConstants.BORDER_RADIUS)
- .backgroundColor(DefaultConstants.WHITE_BACKGROUND_COLOR)
- .margin({ bottom: DefaultConstants.PADDING })
- .padding({
- top: DefaultConstants.PADDING_4,
- bottom: DefaultConstants.PADDING_4,
- left: DefaultConstants.PADDING,
- right: DefaultConstants.PADDING
- })
-
- Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
- Text($r('app.string.face_introdution_title'))
- .fontSize(DefaultConstants.LARGE_FONT_SIZE)
- Row() {
- Text($r('app.string.face_enterance_off'))
- .fontColor(DefaultConstants.GREY_FONT_COLOR)
- .fontSize(DefaultConstants.MEDIUM_FONT_SIZE)
- Image($r('app.media.ic_settings_arrow'))
- .width(DefaultConstants.ICON_WIDTH)
- .height(DefaultConstants.ICON_HEIGHT)
- }
- }
- .borderRadius(DefaultConstants.BORDER_RADIUS)
- .backgroundColor(DefaultConstants.WHITE_BACKGROUND_COLOR)
- .margin({ bottom: DefaultConstants.PADDING })
- .padding({ left: DefaultConstants.PADDING, right: DefaultConstants.PADDING })
- .height(DefaultConstants.SINGLE_HEIGHT)
- .onClick(() => {
- AppStorage.SetOrCreate('facePageFlag', 1);
- })
-
- Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
- Text($r('app.string.title_fill_light'))
- .fontSize(DefaultConstants.LARGE_FONT_SIZE)
- Toggle({ type: ToggleType.Switch, isOn: this.fillLight_isOn })
- .width(DefaultConstants.TOGGLE_SIZE)
- .onChange(() => {
- this.fillLight_isOn = !this.fillLight_isOn
- mFaceSettingsPresenter.ScreenFillFightInLowLightEnvironment(this.fillLight_isOn);
- })
- }
- .borderRadius(DefaultConstants.BORDER_RADIUS)
- .backgroundColor(DefaultConstants.WHITE_BACKGROUND_COLOR)
- .margin({ bottom: DefaultConstants.PADDING })
- .padding({ left: DefaultConstants.PADDING, right: DefaultConstants.PADDING })
- .height(DefaultConstants.SINGLE_HEIGHT)
-
- Text() {
- Span($r('app.string.multiface_list_title'))
- .fontSize(DefaultConstants.MEDIUM_FONT_SIZE)
- .fontColor(DefaultConstants.GREY_FONT_COLOR)
- if (Number(this.faceInfos.length) != 0) {
- Span('(' + Number(this.faceInfos.length) + '/5)')
- .fontSize(DefaultConstants.MEDIUM_FONT_SIZE)
- .fontColor(DefaultConstants.GREY_FONT_COLOR)
- }
- }
- .padding({ left: DefaultConstants.PADDING, right: DefaultConstants.PADDING })
- .margin({ bottom: DefaultConstants.TEXT_PADDING, top: DefaultConstants.TEXT_PADDING })
-
- Column() {
- ForEach(this.faceNames, (item) => {
- Column() {
- Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
- Text(FACENAME + item.name)
- .fontSize(DefaultConstants.LARGE_FONT_SIZE)
- }
- .height(DefaultConstants.SINGLE_HEIGHT_)
- .onClick(() => {
- this.text = FACENAME + item.name;
- this.removeFace = item.id;
- this.ReviseFaceController.open();
- })
-
- if (this.faceInfos.length <= 4) {
- Divider()
- .strokeWidth(DefaultConstants.DIVIDER)
- .color(DefaultConstants.GREY_BACKGROUND_COLOR)
- }
- }
- })
- if (this.faceInfos.length != 5) {
- Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
- Text($r('app.string.multiface_enroll_new_face'))
- .fontSize(DefaultConstants.LARGE_FONT_SIZE)
- .fontColor(DefaultConstants.BLUE_FONT_COLOR)
- }
- .height(DefaultConstants.SINGLE_HEIGHT_)
- .onClick(() => {
- mFaceSettingsPresenter.NewFaceData(this.addFaceInfo.bind(this));
- })
- }
- }
- .borderRadius(DefaultConstants.BORDER_RADIUS)
- .backgroundColor(DefaultConstants.WHITE_BACKGROUND_COLOR)
- .padding({
- top: DefaultConstants.PADDING_4,
- bottom: DefaultConstants.PADDING_4,
- left: DefaultConstants.PADDING,
- right: DefaultConstants.PADDING
- })
-
- Text() {
- Span($r('app.string.face_3dguide_info_2'))
- .fontColor(DefaultConstants.GREY_FONT_COLOR)
- Span($r('app.string.face_guide_2d_announce_link'))
- .fontColor(DefaultConstants.BLUE_FONT_COLOR)
- }
- .fontSize(DefaultConstants.SMALL_FONT_SIZE)
- .padding({ left: DefaultConstants.PADDING, right: DefaultConstants.PADDING })
- .margin({ bottom: DefaultConstants.PADDING, top: DefaultConstants.TEXT_PADDING })
-
- Column() {
- Text($r('app.string.recommend_preference_title'))
- .fontColor(DefaultConstants.GREY_FONT_COLOR)
- .fontSize(DefaultConstants.MEDIUM_FONT_SIZE)
- .margin({ bottom: DefaultConstants.GERY_BORDER_PADDING })
- Text($r('app.string.face_config_light_01_universal'))
- .fontColor(DefaultConstants.BLUE_FONT_COLOR)
- .fontSize(DefaultConstants.MEDIUM_FONT_SIZE)
- }
- .borderRadius(DefaultConstants.BORDER_RADIUS)
- .backgroundColor(DefaultConstants.DARK_GREY_BACKGROUND_COLOR)
- .margin({ top: DefaultConstants.PADDING })
- .padding({
- bottom: DefaultConstants.GERY_BORDER_PADDING,
- top: DefaultConstants.GERY_BORDER_PADDING,
- left: DefaultConstants.PADDING,
- right: DefaultConstants.PADDING
- })
- .width(DefaultConstants.WIDTH)
- .alignItems(HorizontalAlign.Start)
- }
- // .backgroundColor(DefaultConstants.GREY_BACKGROUND_COLOR)
- .padding({
- left: DefaultConstants.PADDING,
- right: DefaultConstants.PADDING
- })
- .alignItems(HorizontalAlign.Start)
- }
- .scrollBarWidth(0)
- }
- .width(DefaultConstants.WIDTH)
- .height(DefaultConstants.WIDTH)
- .backgroundColor(DefaultConstants.GREY_BACKGROUND_COLOR)
- }
-}
-
-@CustomDialog
-struct ReviseFaceDialog {
- controller: CustomDialogController;
- @Link text: string;
- confirm: () => {}
-
- build() {
- Column() {
- Text($r('app.string.multiface_face_name_title'))
- .fontSize(DefaultConstants.OVERSIZE_FONT_SIZE)
- .margin({ bottom: DefaultConstants.DIALOG_TITLE_BOTTOM })
- TextInput({ placeholder: '面部1', text: this.text })
- .margin({ bottom: DefaultConstants.DIALOG_TITLE_TOP })
- .placeholderFont({ size: DefaultConstants.LARGE_FONT_SIZE })
- .caretColor(Color.White)
- .placeholderColor(Color.Grey)
- .width(DefaultConstants.WIDTH)
- .backgroundColor(DefaultConstants.WHITE_BACKGROUND_COLOR)
- .onChange((value: string) => {
- this.text = value;
- });
- Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) {
- Button() {
- Text($r('app.string.delete_face'))
- .fontColor(DefaultConstants.BLUE_FONT_COLOR)
- .fontSize(DefaultConstants.LARGE_FONT_SIZE)
- }
- .type(ButtonType.Capsule)
- .backgroundColor(DefaultConstants.WHITE_BACKGROUND_COLOR)
- .width(DefaultConstants.DIALOG_BUTTON_WIDTH)
- .height(DefaultConstants.DIALOG_BUTTON_HEIGHT)
- .onClick(() => {
- this.controller.close();
- this.confirm();
- })
-
- Button() {
- Text($r('app.string.multiface_save'))
- .fontColor(DefaultConstants.WHITE_BACKGROUND_COLOR)
- .fontSize(DefaultConstants.LARGE_FONT_SIZE)
- }
- .backgroundColor(DefaultConstants.BLUE_FONT_COLOR)
- .type(ButtonType.Capsule)
- .width(DefaultConstants.DIALOG_BUTTON_WIDTH)
- .height(DefaultConstants.DIALOG_BUTTON_HEIGHT)
- .onClick(() => {
- this.controller.close();
- })
- }
- }
- .width(DefaultConstants.DIALOG_WIDTH)
- .borderRadius(DefaultConstants.BORDER_RADIUS)
- .backgroundColor(DefaultConstants.WHITE_BACKGROUND_COLOR)
- .alignItems(HorizontalAlign.Start)
- .padding({
- top: DefaultConstants.DIALOG_TITLE_TOP,
- bottom: DefaultConstants.DIALOG_TITLE_TOP,
- left: DefaultConstants.DIALOG_PADDING,
- right: DefaultConstants.DIALOG_PADDING
- })
- }
-}
-
-@CustomDialog
-struct AppLockDialog {
- @Link status: boolean
- controller: CustomDialogController
-
- build() {
- Column() {
- Text($r('app.string.activate_app_lock'))
- .fontSize(DefaultConstants.OVERSIZE_FONT_SIZE)
- .margin({ bottom: DefaultConstants.DIALOG_TITLE_BOTTOM })
- Text($r('app.string.face_inform_open_applock_msg'))
- .fontSize(DefaultConstants.LARGE_FONT_SIZE)
- .margin({ bottom: DefaultConstants.DIALOG_TITLE_TOP })
- Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) {
- Button() {
- Text($r('app.string.face_record_cancel'))
- .fontColor(DefaultConstants.BLUE_FONT_COLOR)
- .fontSize(DefaultConstants.LARGE_FONT_SIZE)
- }
- .backgroundColor(DefaultConstants.WHITE_BACKGROUND_COLOR)
- .type(ButtonType.Capsule)
- .width(DefaultConstants.DIALOG_BUTTON_WIDTH)
- .height(DefaultConstants.DIALOG_BUTTON_HEIGHT)
- .onClick(() => {
- this.controller.close();
- })
-
- Divider()
- .vertical(true)
- .strokeWidth(DefaultConstants.DIVIDER)
- .color(DefaultConstants.DARK_GREY_BACKGROUND_COLOR)
- .height(DefaultConstants.PADDING_30)
- Button() {
- Text($r('app.string.enable'))
- .fontColor(DefaultConstants.BLUE_FONT_COLOR)
- .fontSize(DefaultConstants.LARGE_FONT_SIZE)
- }
- .backgroundColor(DefaultConstants.WHITE_BACKGROUND_COLOR)
- .type(ButtonType.Capsule)
- .width(DefaultConstants.DIALOG_BUTTON_WIDTH)
- .height(DefaultConstants.DIALOG_BUTTON_HEIGHT)
- .onClick(() => {
- this.status = true;
- mFaceSettingsPresenter.AppLock(this.status);
- this.controller.close();
- })
- }
- }
- .width(DefaultConstants.DIALOG_WIDTH)
- .borderRadius(DefaultConstants.BORDER_RADIUS)
- .backgroundColor(DefaultConstants.WHITE_BACKGROUND_COLOR)
- .alignItems(HorizontalAlign.Start)
- .padding({
- top: DefaultConstants.DIALOG_TITLE_TOP,
- bottom: DefaultConstants.DIALOG_TITLE_TOP,
- left: DefaultConstants.DIALOG_PADDING,
- right: DefaultConstants.DIALOG_PADDING
- })
- }
-}
-
-@CustomDialog
-struct UnlockDialog {
- @Link num: number
- controller: CustomDialogController;
- @State booleans: boolean[] = [false, false, false]
-
- aboutToAppear() {
- this.booleans[this.num] = true
- }
-
- isChecked(num) {
- for (let i = 0;i < this.booleans.length; i++) {
- if (i != num) {
- this.booleans[i] = false
- } else {
- this.booleans[i] = true
- }
- }
- }
-
- build() {
- Column() {
- Text($r('app.string.face_unlock_method'))
- .fontSize(DefaultConstants.OVERSIZE_FONT_SIZE)
- .margin({ bottom: DefaultConstants.DIALOG_TITLE_BOTTOM })
- Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
- Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Start }) {
- Text($r('app.string.face_recognize_unlock_title'))
- .fontSize(DefaultConstants.LARGE_FONT_SIZE)
- .margin({ bottom: DefaultConstants.PADDING_4 })
- Text($r('app.string.face_recognize_unlock_summary_3d'))
- .fontColor(DefaultConstants.GREY_FONT_COLOR)
- .fontSize(DefaultConstants.MEDIUM_FONT_SIZE)
- }
-
- Toggle({ type: ToggleType.Checkbox, isOn: this.booleans[0] })
- .width(DefaultConstants.RADIO_SIZE)
- .height(DefaultConstants.RADIO_SIZE)
- .onChange(() => {
- this.isChecked(0)
- this.num = 0
- mFaceSettingsPresenter.chooseUnlockMethod(this.num);
- this.controller.close();
- })
- }.height(DefaultConstants.DOUBLE_HEIGHT_)
-
- Divider()
- .strokeWidth(DefaultConstants.DIVIDER)
- .color(DefaultConstants.GREY_BACKGROUND_COLOR)
- Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
- Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Start }) {
- Text($r('app.string.face_recognize_slideunlock_title'))
- .fontSize(DefaultConstants.LARGE_FONT_SIZE)
- .margin({ bottom: DefaultConstants.PADDING_4 })
- Text($r('app.string.face_recognize_slideunlock_summary_3d'))
- .fontColor(DefaultConstants.GREY_FONT_COLOR)
- .fontSize(DefaultConstants.MEDIUM_FONT_SIZE)
- }
-
- Toggle({ type: ToggleType.Checkbox, isOn: this.booleans[1] })
- .width(DefaultConstants.RADIO_SIZE)
- .height(DefaultConstants.RADIO_SIZE)
- .onChange(() => {
- this.isChecked(1)
- this.num = 1
- mFaceSettingsPresenter.chooseUnlockMethod(this.num);
- this.controller.close()
- })
- }.height(DefaultConstants.DOUBLE_HEIGHT_)
-
- Divider()
- .strokeWidth(DefaultConstants.DIVIDER)
- .color(DefaultConstants.GREY_BACKGROUND_COLOR)
- Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
- Text($r('app.string.face_unlock_method_close'))
- .fontSize(DefaultConstants.LARGE_FONT_SIZE)
- Toggle({ type: ToggleType.Checkbox, isOn: this.booleans[2] })
- .width(DefaultConstants.RADIO_SIZE)
- .height(DefaultConstants.RADIO_SIZE)
- .onChange(() => {
- this.isChecked(2)
- this.num = 2;
- mFaceSettingsPresenter.chooseUnlockMethod(this.num);
- this.controller.close()
- })
- }.height(DefaultConstants.SINGLE_HEIGHT_)
-
- Button() {
- Text($r('app.string.face_record_cancel'))
- .fontColor(DefaultConstants.BLUE_FONT_COLOR)
- .fontSize(DefaultConstants.LARGE_FONT_SIZE)
- }
- .backgroundColor(DefaultConstants.WHITE_BACKGROUND_COLOR)
- .type(ButtonType.Capsule)
- .width(DefaultConstants.DIALOG_BUTTON_WIDTH2)
- .height(DefaultConstants.DIALOG_BUTTON_HEIGHT)
- .onClick(() => {
- this.controller.close();
- })
- }
- .width(DefaultConstants.DIALOG_WIDTH)
- .borderRadius(DefaultConstants.BORDER_RADIUS)
- .backgroundColor(DefaultConstants.WHITE_BACKGROUND_COLOR)
- .alignItems(HorizontalAlign.Start)
- .padding({
- top: DefaultConstants.DIALOG_TITLE_TOP,
- bottom: DefaultConstants.DIALOG_TITLE_TOP,
- left: DefaultConstants.DIALOG_PADDING,
- right: DefaultConstants.DIALOG_PADDING
- })
- }
-}
\ No newline at end of file
diff --git a/ui/faceenroll/feature/faceSettingsPad/src/main/resources/base/element/string.json b/ui/faceenroll/feature/faceSettingsPad/src/main/resources/base/element/string.json
deleted file mode 100644
index ed637ac..0000000
--- a/ui/faceenroll/feature/faceSettingsPad/src/main/resources/base/element/string.json
+++ /dev/null
@@ -1,129 +0,0 @@
-{
- "string": [
- {
- "name": "entry_MainAbility",
- "value": "entry_MainAbility"
- },
- {
- "name": "mainability_description",
- "value": "ETS_Empty Ability"
- },
- {
- "name": "face_checker",
- "value": "人脸识别"
- },
-
- {
- "name": "face_unlock_method",
- "value": "解锁屏幕"
- },
- {
- "name": "face_recognize_slideunlock_title",
- "value": "滑动解锁"
- },
- {
- "name": "title_apps_security_pref",
- "value": "访问应用锁"
- },
- {
- "name": "title_fill_light",
- "value": "暗光环境下屏幕补光"
- },
- {
- "name": "recommend_preference_title",
- "value": "是否在寻找其他设置项?"
- },
- {
- "name": "face_config_light_01_universal",
- "value": "拿起手机亮屏"
- },
- {
- "name": "multiface_list_title",
- "value": "面部列表"
- },
- {
- "name": "multiface_default_face_name_1",
- "value": "面部 1"
- },
- {
- "name": "multiface_default_face_name",
- "value": "面部"
- },
- {
- "name": "multiface_enroll_new_face",
- "value": "新建面部数据"
- },
- {
- "name": "multiface_face_name_title",
- "value": "面部名称"
- },
- {
- "name": "delete_face",
- "value": "删除面部"
- },
- {
- "name": "multiface_save",
- "value": "保存"
- },
- {
- "name": "face_unlock_method_close",
- "value": "关闭"
- },
- {
- "name": "face_recognize_unlock_title",
- "value": "直接解锁"
- },
- {
- "name": "face_3dguide_info_2",
- "value": "人脸识别可基于您的面部特征信息进行身份识别,了解"
- },
- {
- "name": "face_guide_2d_announce_link",
- "value": "关于人脸识别的声明。"
- },
- {
- "name": "activate_app_lock",
- "value": "启用应用锁"
- },
- {
- "name": "face_inform_open_applock_msg",
- "value": "需开启应用锁功能才能完成人脸关联。是否立即启用应用锁?"
- },
- {
- "name": "face_record_cancel",
- "value": "取消"
- },
- {
- "name": "enable",
- "value": "启用"
- },
- {
- "name": "face_recognize_unlock_summary_3d",
- "value": "人脸识别成功后直接解锁"
- },
- {
- "name": "face_recognize_slideunlock_summary_3d",
- "value": "人脸识别成功后,滑动屏幕解锁"
- },
- {
- "name": "face_recognition_is_used",
- "value": "人脸识别用于"
- },
- {
- "name": "face_introdution_title",
- "value": "解锁时需连接可信设备"
- },
- {
- "name": "face_enterance_off",
- "value": "已关闭"
- },
- {
- "name": "face_fingerprint_settings_switch_title",
- "value": "自动填充账号和密码"
- },
- {
- "name": "face_fingerprint_settings_switch_summary",
- "value": "使用密码保险箱保存的帐号和密码"
- }
- ]
-}
\ No newline at end of file
diff --git a/ui/faceenroll/feature/faceSettingsPad/src/main/resources/base/media/back.png b/ui/faceenroll/feature/faceSettingsPad/src/main/resources/base/media/back.png
deleted file mode 100644
index 85dcc6a..0000000
Binary files a/ui/faceenroll/feature/faceSettingsPad/src/main/resources/base/media/back.png and /dev/null differ
diff --git a/ui/faceenroll/feature/faceSettingsPad/src/main/resources/base/media/ic_settings_arrow.svg b/ui/faceenroll/feature/faceSettingsPad/src/main/resources/base/media/ic_settings_arrow.svg
deleted file mode 100644
index d7dd265..0000000
--- a/ui/faceenroll/feature/faceSettingsPad/src/main/resources/base/media/ic_settings_arrow.svg
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
diff --git a/ui/faceenroll/feature/faceSettingsPad/src/main/resources/base/media/icon.png b/ui/faceenroll/feature/faceSettingsPad/src/main/resources/base/media/icon.png
deleted file mode 100644
index ce307a8..0000000
Binary files a/ui/faceenroll/feature/faceSettingsPad/src/main/resources/base/media/icon.png and /dev/null differ
diff --git a/ui/faceenroll/feature/faceSettingsPad/src/main/resources/en_US/element/string.json b/ui/faceenroll/feature/faceSettingsPad/src/main/resources/en_US/element/string.json
deleted file mode 100644
index f0c1fc2..0000000
--- a/ui/faceenroll/feature/faceSettingsPad/src/main/resources/en_US/element/string.json
+++ /dev/null
@@ -1,131 +0,0 @@
-{
- "string": [
- {
- "name": "entry_MainAbility",
- "value": "entry_MainAbility"
- },
- {
- "name": "mainability_description",
- "value": "ETS_Empty Ability"
- },
- {
- "name": "face_checker",
- "value": "Face Recognition"
- },
-
- {
- "name": "face_unlock_method",
- "value": "Unlock device"
- },
- {
- "name": "face_recognize_slideunlock_title",
- "value": "Slide to unlock"
- },
- {
- "name": "title_apps_security_pref",
- "value": "Access App Lock"
- },
- {
- "name": "title_fill_light",
- "value": "Low light compensation"
- },
- {
- "name": "recommend_preference_title",
- "value": "Looking for other settings?"
- },
- {
- "name": "face_config_light_01_universal",
- "value": "Raise to wake"
- },
- {
- "name": "multiface_list_title",
- "value": "Facial profiles"
- },
- {
- "name": "multiface_default_face_name_1",
- "value": "Profile 1"
- },
- {
- "name": "multiface_default_face_name",
- "value": "Profile "
- },
- {
- "name": "multiface_enroll_new_face",
- "value": "Add facial profile"
- },
- {
- "name": "multiface_face_name_title",
- "value": "Name"
- },
- {
- "name": "multiface_save",
- "value": "Save"
- },
- {
- "name": "face_unlock_method_close",
- "value": "Off"
- },
- {
- "name": "face_recognize_unlock_title",
- "value": "Direct unlock"
- },
- {
- "name": "face_3dguide_info_2",
- "value": "Face Recognition verifies your identity based on your facial features. To learn more, see the"
- },
- {
- "name": "face_guide_2d_announce_link",
- "value": "Statement About Face Recognition"
- },
-
- {
- "name": "face_inform_open_applock_msg",
- "value": "App Lock is not enabled. Enable now?"
- },
- {
- "name": "face_record_cancel",
- "value": "Cancel"
- },
- {
- "name": "face_recognize_unlock_summary_3d",
- "value": "Unlock directly after successful facial recognition."
- },
- {
- "name": "face_recognize_slideunlock_summary_3d",
- "value": "Slide to unlock after successful facial recognition."
- },
-
- {
- "name": "face_introdution_title",
- "value": "Require trusted device"
- },
- {
- "name": "face_enterance_off",
- "value": "Off"
- },
- {
- "name": "face_fingerprint_settings_switch_title",
- "value": "Autofill usernames and passwords"
- },
- {
- "name": "face_fingerprint_settings_switch_summary",
- "value": "Usernames and passwords are accessed from Password Vault."
- },
- {
- "name": "face_recognition_is_used",
- "value": "人脸识别用于"
- },
- {
- "name": "delete_face",
- "value": "删除面容"
- },
- {
- "name": "enable",
- "value": "启用"
- },
- {
- "name": "activate_app_lock",
- "value": "启用应用锁"
- }
- ]
-}
\ No newline at end of file
diff --git a/ui/faceenroll/feature/faceSettingsPad/src/main/resources/zh_CN/element/string.json b/ui/faceenroll/feature/faceSettingsPad/src/main/resources/zh_CN/element/string.json
deleted file mode 100644
index ed637ac..0000000
--- a/ui/faceenroll/feature/faceSettingsPad/src/main/resources/zh_CN/element/string.json
+++ /dev/null
@@ -1,129 +0,0 @@
-{
- "string": [
- {
- "name": "entry_MainAbility",
- "value": "entry_MainAbility"
- },
- {
- "name": "mainability_description",
- "value": "ETS_Empty Ability"
- },
- {
- "name": "face_checker",
- "value": "人脸识别"
- },
-
- {
- "name": "face_unlock_method",
- "value": "解锁屏幕"
- },
- {
- "name": "face_recognize_slideunlock_title",
- "value": "滑动解锁"
- },
- {
- "name": "title_apps_security_pref",
- "value": "访问应用锁"
- },
- {
- "name": "title_fill_light",
- "value": "暗光环境下屏幕补光"
- },
- {
- "name": "recommend_preference_title",
- "value": "是否在寻找其他设置项?"
- },
- {
- "name": "face_config_light_01_universal",
- "value": "拿起手机亮屏"
- },
- {
- "name": "multiface_list_title",
- "value": "面部列表"
- },
- {
- "name": "multiface_default_face_name_1",
- "value": "面部 1"
- },
- {
- "name": "multiface_default_face_name",
- "value": "面部"
- },
- {
- "name": "multiface_enroll_new_face",
- "value": "新建面部数据"
- },
- {
- "name": "multiface_face_name_title",
- "value": "面部名称"
- },
- {
- "name": "delete_face",
- "value": "删除面部"
- },
- {
- "name": "multiface_save",
- "value": "保存"
- },
- {
- "name": "face_unlock_method_close",
- "value": "关闭"
- },
- {
- "name": "face_recognize_unlock_title",
- "value": "直接解锁"
- },
- {
- "name": "face_3dguide_info_2",
- "value": "人脸识别可基于您的面部特征信息进行身份识别,了解"
- },
- {
- "name": "face_guide_2d_announce_link",
- "value": "关于人脸识别的声明。"
- },
- {
- "name": "activate_app_lock",
- "value": "启用应用锁"
- },
- {
- "name": "face_inform_open_applock_msg",
- "value": "需开启应用锁功能才能完成人脸关联。是否立即启用应用锁?"
- },
- {
- "name": "face_record_cancel",
- "value": "取消"
- },
- {
- "name": "enable",
- "value": "启用"
- },
- {
- "name": "face_recognize_unlock_summary_3d",
- "value": "人脸识别成功后直接解锁"
- },
- {
- "name": "face_recognize_slideunlock_summary_3d",
- "value": "人脸识别成功后,滑动屏幕解锁"
- },
- {
- "name": "face_recognition_is_used",
- "value": "人脸识别用于"
- },
- {
- "name": "face_introdution_title",
- "value": "解锁时需连接可信设备"
- },
- {
- "name": "face_enterance_off",
- "value": "已关闭"
- },
- {
- "name": "face_fingerprint_settings_switch_title",
- "value": "自动填充账号和密码"
- },
- {
- "name": "face_fingerprint_settings_switch_summary",
- "value": "使用密码保险箱保存的帐号和密码"
- }
- ]
-}
\ No newline at end of file
diff --git a/ui/faceenroll/product/pad/src/main/config.json b/ui/faceenroll/product/pad/src/main/config.json
deleted file mode 100644
index d34306d..0000000
--- a/ui/faceenroll/product/pad/src/main/config.json
+++ /dev/null
@@ -1,81 +0,0 @@
-{
- "app": {
- "bundleName": "com.ohos.faceEnroll",
- "vendor": "ohos",
- "version": {
- "code": 1000000,
- "name": "1.0.0"
- }
- },
- "deviceConfig": {},
- "module": {
- "package": "com.ohos.faceEnroll",
- "name": ".MyApplication",
- "deviceType": [
- "phone"
- ],
- "distro": {
- "deliveryWithInstall": true,
- "moduleName": "pad",
- "moduleType": "entry",
- "installationFree": true
- },
- "abilities": [
- {
- "skills": [
- {
- "entities": [
- "entity.system.home",
- "flag.home.intent.from.system"
- ],
- "actions": [
- "action.system.home",
- "com.ohos.action.main"
- ]
- }
- ],
- "visible": true,
- "name": "com.ohos.faceEnroll.MainAbility",
- "icon": "$media:icon",
- "description": "$string:mainability_description",
- "label": "$string:app_name",
- "type": "page",
- "launchType": "singleton",
- "srcPath": "default",
- "srcLanguage": "ets",
- "metaData": {
- "customizeData": [
- {
- "name": "hwc-theme"
- }
- ]
- }
- }
- ],
- "js": [
- {
- "mode": {
- "syntax": "ets",
- "type": "pageAbility"
- },
- "pages": [
- "pages/entryView",
- "pages/userAuth",
- "pages/userSettings",
- "pages/index",
- "pages/enroll_2D",
- "pages/success",
- "pages/enroll_3D",
- "pages/declare",
- "pages/startViews_2D",
- "pages/startViews_3D"
- ],
- "name": "default",
- "window": {
- "designWidth": 1280,
- "autoDesignWidth": false
- }
- }
- ]
- }
-}
\ No newline at end of file
diff --git a/ui/faceenroll/product/pad/src/main/ets/default/common/Log.ets b/ui/faceenroll/product/pad/src/main/ets/default/common/Log.ets
deleted file mode 100644
index acc3a82..0000000
--- a/ui/faceenroll/product/pad/src/main/ets/default/common/Log.ets
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * 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.
- */
-
-const TAG = 'SystemUI_Default';
-
-/**
- * Basic log class
- */
-export default class Log {
-
- /**
- * print info level log
- *
- * @param {string} tag - Page or class tag
- * @param {string} log - Log needs to be printed
- */
- static showInfo(tag, log) {
- console.info(`${TAG} tag: ${tag} --> ${log}`);
- }
-
- /**
- * print debug level log
- *
- * @param {string} tag - Page or class tag
- * @param {string} log - Log needs to be printed
- */
- static showDebug(tag, log) {
- console.debug(`${TAG} tag: ${tag} --> ${log}`);
- }
-
- /**
- * print error level log
- *
- * @param {string} tag - Page or class tag
- * @param {string} log - Log needs to be printed
- */
- static showError(tag, log) {
- console.error(`${TAG} tag: ${tag} --> ${log}`);
- }
-}
\ No newline at end of file
diff --git a/ui/faceenroll/product/pad/src/main/ets/default/common/constant.ets b/ui/faceenroll/product/pad/src/main/ets/default/common/constant.ets
deleted file mode 100644
index bab219a..0000000
--- a/ui/faceenroll/product/pad/src/main/ets/default/common/constant.ets
+++ /dev/null
@@ -1,429 +0,0 @@
-/*
- * 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 Log from '../common/Log.ets'
-
-const TAG = 'constant'
-
-async function routeSuccess() {
- let options = {
- uri: 'pages/success'
- }
- try {
- await router.push(options)
- } catch (err) {
- console.error(`fail callback, code: ${err.code}, msg: ${err.msg}`)
- }
-}
-
-async function route_back() {
- let options = {
- uri: 'pages/index'
- }
- try {
- await router.push(options)
- } catch (err) {
- console.error(`fail callback, code: ${err.code}, msg: ${err.msg}`)
- }
-}
-
-export default class Constants {
-
- //code and errorCode
- static CODE_RESULT = 1
- static CODE_CANCEL = 2
- static CODE_ACQUIRE = 3
- static ERROR_CODE_SUCCESS = 0
- static ERROR_CODE_FAIL = 1
- static ERROR_CODE_CANCEL = 2
- static ERROR_CODE_TIMEOUT = 4
- static ERROR_CODE_ALGORITHM_NOT_INIT = 5
- static ERROR_CODE_HAL_INVALID = 6
- static ERROR_CODE_OVER_MAX_FACES = 7
- static ERROR_CODE_INVALID_PARAMETERS = 9
- static ERROR_CODE_BUSY = 13
- static ERROR_CODE_ENROLL_HAS_REGISTERED = 16
- static ERROR_CODE_FACE_DETECTED = 38
- static ERROR_CODE_BAD_QUALITY = 4
- static ERROR_CODE_NOT_FOUND = 5
- static ERROR_CODE_TOO_SMALL = 6
- static ERROR_CODE_TOO_LARGE = 7
- static ERROR_CODE_OFFSET_LEFT = 8
- static ERROR_CODE_OFFSET_TOP = 9
- static ERROR_CODE_OFFSET_RIGHT = 10
- static ERROR_CODE_OFFSET_BOTTOM = 11
- static ERROR_CODE_LIVENESS_WARNING = 13
- static ERROR_CODE_LIVENESS_FAILURE = 14
- static ERROR_CODE_ROTATED_LEFT = 15
- static ERROR_CODE_RISE = 16
- static ERROR_CODE_ROTATED_RIGHT = 17
- static ERROR_CODE_DOWN = 18
- static ERROR_CODE_EYE_OCCLUSION = 21
- static ERROR_CODE_EYE_CLOSE = 22
- static ERROR_CODE_MOUTH_OCCLUSION = 23
- static ERROR_CODE_MULTI = 27
- static ERROR_CODE_BLUR = 28
- static ERROR_CODE_NOT_COMPLETE = 29
- static ERROR_CODE_DARKLIGHT = 30
- static ERROR_CODE_HIGHTLIGHT = 31
- static ERROR_CODE_HALF_SHADOW = 32
- static ERROR_CODE_HAS_REGISTERED = 37
- static ERROR_CODE_DARKPIC = 39
- static ERROR_CODE_ROTATE_TOP_RIGHT = 40
- static ERROR_CODE_ROTATE_TOP_LEFT = 41
- static ERROR_CODE_ROTATE_BOTTOM_RIGHT = 42
- static ERROR_CODE_ROTATE_BOTTOM_LEFT = 43
- static ERROR_CODE_OPEN_CAMERA_FAILED = 46
- static ERROR_CODE_PROGRESS_FIRST = 1004
- static ERROR_CODE_PROGRESS_SECOND = 1008
- static ERROR_CODE_PROGRESS_THIRD = 1012
- static PARAM_TOKEN = "check"
- static FLAGS = 0
- static FACEID = 0
- static PREVIEWID = 2
-
-
- //setTimeout
- static TIMEOUT_100 = 100
- static TIMEOUT_200 = 200
- static TIMEOUT_300 = 300
- static TIMEOUT_400 = 400
- static TIMEOUT_500 = 500
- static TIMEOUT_600 = 600
- static TIMEOUT_700 = 700
- static TIMEOUT_800 = 800
- static TIMEOUT_900 = 900
- static TIMEOUT_1000 = 1000
- static TIMEOUT_1100 = 1100
- static TIMEOUT_1200 = 1200
- static TIMEOUT_1300 = 1300
- static TIMEOUT_1400 = 1400
- static TIMEOUT_1500 = 1500
- static TIMEOUT_1600 = 1600
- static TIMEOUT_1700 = 1700
- static TIMEOUT_1800 = 1800
- static TIMEOUT_1900 = 1900
- static TIMEOUT_2000 = 2000
- static TIMEOUT_3000 = 3000
-
- //UI
- static SHELTER_ANIMATOR = 1000
- static PROGRESS_START = 0
- static PROGRESS_TOTAL = 100
- static FONT_WEIGHT = 500
- static ENROll_TITLE = 600
- static SHELTER_START_WIDTH = 1100
- static SHELTER_END_WIDTH = '100%'
- static CENTER_HEIGHT = '620lpx'
- static SHELTER_START_HEIGHT = '2000lpx'
- static SHELTER_END_HEIGHT = '640lpx'
- static SHELTER_3D_END_HEIGHT = '640lpx'
- static PROGRESS_VALUE_FIRST = 30
- static PROGRESS_VALUE_SECOND = 60
- static PROGRESS_VALUE_THIRD = 100
- static SPACE = 20
- static INITIAL_INDEX = 0
- static HEIGHT_LIST = 60
- static FONTSIZE_16 = 16
- static BORDER_RADIUS = 10
- static STROKE_WIDTH = 2
- static START_MARGIN = 20
- static END_MARGIN = 20
- static SHOW_START_VIEWS_3D = '3D'
- static SHOW_START_VIEWS_2D = '2D'
- static LIST_PADDING = 5
- static BLUR_START = 0
- static BLUR_END = 40
- static CENTER_POSITION_Y = 5
- static BUTTON_POSITION = '92%'
- static ENROLL_INFO_POSITION = '918lpx'
- static ENROLL_INFO_WIDTH = '90%'
- static CHECKBOX_POSITION_X = '5%'
- static CHECKBOX_POSITION_Y = '85%'
- static CHECKBOX_TEXT_POSITION_X = '18%'
- static CHECKBOX_TEXT_POSITION_Y = '87%'
-
-
- static PROGRESS_WIDTH = '460lpx'
- static BACK_WIDTH = '136lpx'
- static BACK_HEIGHT = '110lpx'
- static TITLE_FONT_SIZE = '48lpx'
- static TITLE_MARGIN = '24lpx'
- static TITLE_ENROLLING_MARGIN = '140lpx'
- static IMAGE_MARGIN = '96lpx'
- static IMAGE_3D_MARGIN = '48lpx'
- static FONT_SIZE = '28lpx'
- static SMALL_TITLE_FONT_SIZE = '36lpx'
- static CONTENT1_MARGIN = '16lpx'
- static CONTENT2_MARGIN = '8lpx'
- static BUTTON_FONT_SIZE = '32lpx'
- static BUTTON_WIDTH = '384lpx'
- static BUTTON_HEIGHT = '80lpx'
- static IMAGE_2D_HEIGHT = '480lpx'
- static IMAGE_3D_WIDTH = '512lpx'
- static ERROR_CODE_INFO_SIZE = '32lpx'
- static ENROLL_CENTER_POSITION_Y = '240lpx'
- static SUCCESS_WIDTH = '204lpx'
- static CHECKBOX_SIZE = '70lpx'
- static APERTURE1_WIDTH = '266lpx'
- static APERTURE2_WIDTH = '264lpx'
- static APERTURE34_WIDTH = '284lpx'
- static APERTURE5_WIDTH = '466lpx'
-
-
-
- //PROGRESS
- static PROGRESS_VALUE_5 = 5
- static PROGRESS_VALUE_10 = 10
- static PROGRESS_VALUE_15 = 15
- static PROGRESS_VALUE_20 = 20
- static PROGRESS_VALUE_25 = 25
- static PROGRESS_VALUE_30 = 30
- static PROGRESS_VALUE_35 = 35
- static PROGRESS_VALUE_40 = 40
- static PROGRESS_VALUE_45 = 45
- static PROGRESS_VALUE_50 = 50
- static PROGRESS_VALUE_55 = 55
- static PROGRESS_VALUE_60 = 60
- static PROGRESS_VALUE_65 = 65
- static PROGRESS_VALUE_70 = 70
- static PROGRESS_VALUE_75 = 75
- static PROGRESS_VALUE_80 = 80
- static PROGRESS_VALUE_85 = 85
- static PROGRESS_VALUE_90 = 90
- static PROGRESS_VALUE_95 = 95
- static PROGRESS_VALUE_100 = 100
-
- static DECLARE_WIDTH = '90%'
- static DECLARE_MAX_WIDTH = '100%'
- static DECLARE_TITLE_FONT_SIZE = 25
- static DECLARE_SECONDARY_TITLE_FONT_SIZE = 23
- static DECLARE_TEXT_FONT_SIZE = 22
- static DECLARE_ITEM_MARGIN_BOTTOM = 10
- static DECLARE_TITLE_MARGIN_TOP = 20
- static DECLARE_TITLE_MARGIN_BOTTOM = 20
- static DECLARE_TEXT_LINE_HEIGHT = 33
- static DECLARE_SCROLL_BAR_WIDTH = 0
- static DECLARE_BACKGROUND_COLOR = "#F2F3F5"
- static DECLARE_TITLE_2 = "2."
- static DECLARE_TITLE_3 = "3."
- static DECLARE_TITLE_4 = "4."
- static DECLARE_TITLE_5 = "5."
-
-
-
-
- //errorCode value
- static value(){
- const info = new Map()
- info.set(Constants.ERROR_CODE_BAD_QUALITY,$r('app.string.enroll_info_bad_quality'))
- info.set(Constants.ERROR_CODE_NOT_FOUND,$r('app.string.enroll_info_not_found'))
- info.set(Constants.ERROR_CODE_TOO_SMALL,$r('app.string.face_record_3d_tip_close'))
- info.set(Constants.ERROR_CODE_TOO_LARGE,$r('app.string.face_record_3d_tip_far'))
- info.set(Constants.ERROR_CODE_OFFSET_LEFT,$r('app.string.face_enroll_too_left'))
- info.set(Constants.ERROR_CODE_OFFSET_TOP,$r('app.string.face_enroll_too_high'))
- info.set(Constants.ERROR_CODE_OFFSET_RIGHT,$r('app.string.face_enroll_too_right'))
- info.set(Constants.ERROR_CODE_OFFSET_BOTTOM,$r('app.string.face_enroll_too_low'))
- info.set(Constants.ERROR_CODE_LIVENESS_WARNING,$r('app.string.enroll_info_liveness_warning'))
- info.set(Constants.ERROR_CODE_LIVENESS_FAILURE,$r('app.string.enroll_info_liveness_failure'))
- info.set(Constants.ERROR_CODE_ROTATED_LEFT,$r('app.string.face_rotate_too_left'))
- info.set(Constants.ERROR_CODE_RISE,$r('app.string.face_rotate_too_high'))
- info.set(Constants.ERROR_CODE_ROTATED_RIGHT,$r('app.string.face_rotate_too_right'))
- info.set(Constants.ERROR_CODE_DOWN,$r('app.string.face_rotate_too_low'))
- info.set(Constants.ERROR_CODE_EYE_OCCLUSION,$r('app.string.enroll_info_eye_occlusion'))
- info.set(Constants.ERROR_CODE_EYE_CLOSE,$r('app.string.enroll_info_eye_close'))
- info.set(Constants.ERROR_CODE_MOUTH_OCCLUSION,$r('app.string.enroll_info_mouth_occlusion'))
- info.set(Constants.ERROR_CODE_MULTI,$r('app.string.face_record_3d_tip_multi'))
- info.set(Constants.ERROR_CODE_BLUR,$r('app.string.enroll_info_blur'))
- info.set(Constants.ERROR_CODE_NOT_COMPLETE,$r('app.string.enroll_info_not_complete'))
- info.set(Constants.ERROR_CODE_DARKLIGHT,$r('app.string.enroll_info_darklight'))
- info.set(Constants.ERROR_CODE_HIGHTLIGHT,$r('app.string.enroll_info_highlight'))
- info.set(Constants.ERROR_CODE_HALF_SHADOW,$r('app.string.enroll_info_half_shadow'))
- info.set(Constants.ERROR_CODE_HAS_REGISTERED,$r('app.string.enroll_info_face_has_registered'))
- info.set(Constants.ERROR_CODE_DARKPIC,$r('app.string.enroll_info_darkpic'))
- info.set(Constants.ERROR_CODE_ROTATE_TOP_RIGHT,$r('app.string.enroll_info_rotate_top_right'))
- info.set(Constants.ERROR_CODE_ROTATE_TOP_LEFT,$r('app.string.enroll_info_rotate_top_left'))
- info.set(Constants.ERROR_CODE_ROTATE_BOTTOM_RIGHT,$r('app.string.enroll_info_rotate_bottom_right'))
- info.set(Constants.ERROR_CODE_ROTATE_BOTTOM_LEFT,$r('app.string.enroll_info_rotate_bottom_left'))
- info.set(Constants.ERROR_CODE_OPEN_CAMERA_FAILED,$r('app.string.enroll_info_open_camera_failed'))
-
- return info
- }
-
- //face progress_3D
- static progress() {
- const pro = new Map()
- pro.set(Constants.ERROR_CODE_PROGRESS_FIRST,Constants.PROGRESS_VALUE_FIRST)
- pro.set(Constants.ERROR_CODE_PROGRESS_SECOND,Constants.PROGRESS_VALUE_SECOND)
- pro.set(Constants.ERROR_CODE_PROGRESS_THIRD,Constants.PROGRESS_VALUE_THIRD)
-
- return pro
- }
- static result() {
- const res = new Map()
- res.set(Constants.ERROR_CODE_FAIL,'')
- res.set(Constants.ERROR_CODE_CANCEL,$r('app.string.enroll_info_cancel'))
- res.set(Constants.ERROR_CODE_ALGORITHM_NOT_INIT,$r('app.string.enroll_info_algorithm_not_init'))
- res.set(Constants.ERROR_CODE_HAL_INVALID,$r('app.string.enroll_info_hal_invalid'))
- res.set(Constants.ERROR_CODE_OVER_MAX_FACES,$r('app.string.enroll_info_over_max_faces'))
- res.set(Constants.ERROR_CODE_INVALID_PARAMETERS,$r('app.string.enroll_info_invalid_parameters'))
- res.set(Constants.ERROR_CODE_BUSY,$r('app.string.enroll_info_busy'))
- res.set(Constants.ERROR_CODE_ENROLL_HAS_REGISTERED,$r('app.string.enroll_info_has_registered'))
-
- return res
- }
-
- //face progress_2D
- static progress_2D(){
- Log.showInfo(TAG,'progress_2D')
-
- setTimeout(()=>{
- AppStorage.Set('prgValue',Constants.PROGRESS_VALUE_5)
- },Constants.TIMEOUT_100);
- setTimeout(()=>{
- AppStorage.Set('prgValue',Constants.PROGRESS_VALUE_10)
- },Constants.TIMEOUT_200);
- setTimeout(()=>{
- AppStorage.Set('prgValue',Constants.PROGRESS_VALUE_15)
- },Constants.TIMEOUT_300);
- setTimeout(()=>{
- AppStorage.Set('prgValue',Constants.PROGRESS_VALUE_20)
- },Constants.TIMEOUT_400);
- setTimeout(()=>{
- AppStorage.Set('prgValue',Constants.PROGRESS_VALUE_25)
- },Constants.TIMEOUT_500);
- setTimeout(()=>{
- AppStorage.Set('prgValue',Constants.PROGRESS_VALUE_30)
- },Constants.TIMEOUT_600);
- setTimeout(()=>{
- AppStorage.Set('prgValue',Constants.PROGRESS_VALUE_35)
- },Constants.TIMEOUT_700);
- setTimeout(()=>{
- AppStorage.Set('prgValue',Constants.PROGRESS_VALUE_40)
- },Constants.TIMEOUT_800);
- setTimeout(()=>{
- AppStorage.Set('prgValue',Constants.PROGRESS_VALUE_45)
- },Constants.TIMEOUT_900);
- setTimeout(()=>{
- AppStorage.Set('prgValue',Constants.PROGRESS_VALUE_50)
- },Constants.TIMEOUT_1000);
- setTimeout(()=>{
- AppStorage.Set('prgValue',Constants.PROGRESS_VALUE_55)
- },Constants.TIMEOUT_1100);
- setTimeout(()=>{
- AppStorage.Set('prgValue',Constants.PROGRESS_VALUE_60)
- },Constants.TIMEOUT_1200);
- setTimeout(()=>{
- AppStorage.Set('prgValue',Constants.PROGRESS_VALUE_65)
- },Constants.TIMEOUT_1300);
- setTimeout(()=>{
- AppStorage.Set('prgValue',Constants.PROGRESS_VALUE_70)
- },Constants.TIMEOUT_1400);
- setTimeout(()=>{
- AppStorage.Set('prgValue',Constants.PROGRESS_VALUE_75)
- },Constants.TIMEOUT_1500);
- setTimeout(()=>{
- AppStorage.Set('prgValue',Constants.PROGRESS_VALUE_80)
- },Constants.TIMEOUT_1600);
- setTimeout(()=>{
- AppStorage.Set('prgValue',Constants.PROGRESS_VALUE_85)
- },Constants.TIMEOUT_1700);
- setTimeout(()=>{
- AppStorage.Set('prgValue',Constants.PROGRESS_VALUE_90)
- },Constants.TIMEOUT_1800);
- setTimeout(()=>{
- AppStorage.Set('prgValue',Constants.PROGRESS_VALUE_95)
- },Constants.TIMEOUT_1900);
- setTimeout(()=>{
- AppStorage.Set('prgValue',Constants.PROGRESS_VALUE_100)
- routeSuccess()
- },Constants.TIMEOUT_2000)
- }
-
- static aperture(){
- setTimeout(() => {
- AppStorage.Set('showAperture1',false)
- AppStorage.Set('showAperture2',true)
- }, Constants.TIMEOUT_1000)
- setTimeout(() => {
- AppStorage.Set('showAperture2',false)
- AppStorage.Set('showAperture3',true)
- }, Constants.TIMEOUT_1300)
- setTimeout(() => {
- AppStorage.Set('showAperture3',false)
- AppStorage.Set('showAperture4',true)
- }, Constants.TIMEOUT_1600)
- setTimeout(() => {
- AppStorage.Set('showAperture4',false)
- AppStorage.Set('showAperture5',true)
- }, Constants.TIMEOUT_1900)
- }
-
- static RESULT_CODE_SUCCESS = 0
- static RESULT_CODE_FAIL = 1
- static RESULT_CODE_GENERAL_ERROR = 2
- static RESULT_CODE_CANCELED = 3
- static RESULT_CODE_TIMEOUT = 4
- static RESULT_CODE_TYPE_NOT_SUPPORT = 5
- static RESULT_CODE_TRUST_LEVEL_NOT_SUPPORT = 6
- static RESULT_CODE_BUSY = 7
- static RESULT_CODE_INVALID_PARAMETERS = 8
- static RESULT_CODE_LOCKED = 9
- static RESULT_CODE_NOT_ENROLLED = 10
-
- static resultCode(){
- const Code = new Map()
- Code.set(Constants.RESULT_CODE_SUCCESS,$r('app.string.enroll_success'))
- Code.set(Constants.RESULT_CODE_FAIL,$r('app.string.enrolling_fail'))
- Code.set(Constants.RESULT_CODE_GENERAL_ERROR,$r('app.string.enrolling_fail'))
- Code.set(Constants.RESULT_CODE_CANCELED,$r('app.string.enroll_info_cancel'))
- Code.set(Constants.RESULT_CODE_TIMEOUT,$r('app.string.enrolling_timeout'))
- Code.set(Constants.RESULT_CODE_TYPE_NOT_SUPPORT,$r('app.string.enrolling_fail'))
- Code.set(Constants.RESULT_CODE_TRUST_LEVEL_NOT_SUPPORT,$r('app.string.enrolling_fail'))
- Code.set(Constants.RESULT_CODE_BUSY,$r('app.string.enrolling_fail'))
- Code.set(Constants.RESULT_CODE_INVALID_PARAMETERS,$r('app.string.enrolling_fail'))
- Code.set(Constants.RESULT_CODE_LOCKED,$r('app.string.enrolling_fail'))
- Code.set(Constants.RESULT_CODE_NOT_ENROLLED,$r('app.string.enrolling_fail'))
- return Code
- }
-
- static FACE_AUTH_TIP_TOO_BRIGHT = 1
- static FACE_AUTH_TIP_TOO_DARK = 2
- static FACE_AUTH_TIP_TOO_CLOSE = 3
- static FACE_AUTH_TIP_TOO_FAR = 4
- static FACE_AUTH_TIP_TOO_HIGH = 5
- static FACE_AUTH_TIP_TOO_LOW = 6
- static FACE_AUTH_TIP_TOO_RIGHT = 7
- static FACE_AUTH_TIP_TOO_LEFT = 8
- static FACE_AUTH_TIP_TOO_MUCH_MOTION = 9
- static FACE_AUTH_TIP_POOR_GAZE = 10
- static FACE_AUTH_TIP_NOT_DETECTED = 11
-
- static FaceTips(){
- const Tips = new Map()
- Tips.set(Constants.FACE_AUTH_TIP_TOO_BRIGHT,$r('app.string.enroll_info_highlight'))
- Tips.set(Constants.FACE_AUTH_TIP_TOO_DARK,$r('app.string.enroll_info_darklight'))
- Tips.set(Constants.FACE_AUTH_TIP_TOO_CLOSE,$r('app.string.enroll_info_scale_too_large'))
- Tips.set(Constants.FACE_AUTH_TIP_TOO_FAR,$r('app.string.enroll_info_scale_too_small'))
- Tips.set(Constants.FACE_AUTH_TIP_TOO_HIGH,$r('app.string.enroll_info_offset_top'))
- Tips.set(Constants.FACE_AUTH_TIP_TOO_LOW,$r('app.string.enroll_info_offset_bottom'))
- Tips.set(Constants.FACE_AUTH_TIP_TOO_RIGHT,$r('app.string.enroll_info_offset_right'))
- Tips.set(Constants.FACE_AUTH_TIP_TOO_LEFT,$r('app.string.enroll_info_offset_left'))
- Tips.set(Constants.FACE_AUTH_TIP_TOO_MUCH_MOTION,$r('app.string.enroll_info_blur'))
- Tips.set(Constants.FACE_AUTH_TIP_POOR_GAZE,$r('app.string.enroll_info_eye_occlusion'))
- Tips.set(Constants.FACE_AUTH_TIP_NOT_DETECTED,$r('app.string.enroll_info_not_found'))
- return Tips
- }
-}
\ No newline at end of file
diff --git a/ui/faceenroll/product/pad/src/main/ets/default/model_2D.ets b/ui/faceenroll/product/pad/src/main/ets/default/model_2D.ets
deleted file mode 100644
index e0aacb1..0000000
--- a/ui/faceenroll/product/pad/src/main/ets/default/model_2D.ets
+++ /dev/null
@@ -1,273 +0,0 @@
-// @ts-nocheck
-/*
- * 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 Constants from './common/constant.ets';
-import UserIDM from '@ohos.useridm';
-
-var mPrgvalue;
-var mResultCode = Constants.resultCode();
-var mFaceTips = Constants.FaceTips();
-
-export class model_2D {
- private UserIDM;
-
- constructor() {
- this.UserIDM = UserIDM.constructor();
- }
- /**
- * init FaceModel
- */
- initFaceModel(credentialInfo) {
- console.info("FaceEnroll model_2D initFaceModel start");
- AppStorage.Link('width');
- AppStorage.Link('showBack');
- AppStorage.Link('height');
- AppStorage.Link('showAperture');
- AppStorage.Link('blur');
- AppStorage.Link('showPrg');
- mPrgvalue = AppStorage.Link('prgValue');
- AppStorage.Link('enrollInfo');
- AppStorage.Link('showBtn');
- AppStorage.Link('enrollTitle');
- this.startEnroll(credentialInfo);
- console.info("FaceEnroll model_2D initFaceModel end");
- }
-
- /**
- * Open session and get challenge.
- * @param callback
- */
- openSession(callback) {
- console.info("FaceEnroll model_2D openSession start");
- this.UserIDM.openSession((data) => {
- try {
- console.info("FaceEnroll model_2D openSession data", data);
- callback(data);
- }
- catch (e) {
- console.info("FaceEnroll model_2D openSession error", e);
- }
- })
- callback();
- console.info("FaceEnroll model_2D openSession end");
- }
-
- /**
- * resume page, unInit FaceModel
- */
- uninitFaceModel() {
- console.info(" FaceEnroll model_2D uninitFaceModel start");
- if (mPrgvalue != Constants.PROGRESS_TOTAL) {
- this.cancelEnroll();
- }
- setTimeout(() => {
- AppStorage.Set('width', Constants.SHELTER_START_WIDTH)
- AppStorage.Set('height', Constants.SHELTER_START_HEIGHT)
- AppStorage.Set('showBtn', false)
- AppStorage.Set('showPrg', false)
- AppStorage.Set('showBack', true)
- AppStorage.Set('blur', Constants.BLUR_START)
- AppStorage.Set('showAperture', true)
- mPrgvalue = AppStorage.Set('prgValue', $r('app.float.progress_value_start'))
- AppStorage.Set('enrollInfo', $r('app.string.enroll_info'))
- AppStorage.Set('enrollTitle', $r('app.string.face_record'))
- }, Constants.TIMEOUT_500)
- console.info(" FaceEnroll model_2D uninitFaceModel end");
- }
-
- /**
- * start enroll, get callback value
- */
- startEnroll(credentialInfo) {
- console.info(" FaceEnroll model_2D startEnroll 2d start ");
- this.UserIDM.addCredential(credentialInfo, {
- onResult: (result, extraInfo) => {
- if (result == Constants.RESULT_CODE_SUCCESS) {
- console.info(" FaceEnroll model_2D startEnroll UserIDM.addCredential onResult result", result);
- AppStorage.Set('showPrg', true);
- Constants.progress_2D();
- this.endEnroll();
- }
- if (result == Constants.RESULT_CODE_FAIL) {
- console.info(" FaceEnroll model_2D startEnroll UserIDM.addCredential onResult result", result);
- AppStorage.Set('width', Constants.SHELTER_END_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_END_HEIGHT);
- AppStorage.Set('showAperture', false);
- AppStorage.Set('enrollTitle', $r('app.string.face_record_3d_record_fail'));
- AppStorage.Set('enrollInfo', mResultCode.get(result));
- AppStorage.Set('blur', Constants.BLUR_END);
- AppStorage.Set('showBtn', true);
- AppStorage.Set('showBack', false);
- AppStorage.Set('prgValue', $r('app.float.progress_value_start'));
- }
- if (result == Constants.RESULT_CODE_GENERAL_ERROR) {
- console.info(" FaceEnroll model_2D startEnroll UserIDM.addCredential onResult result", result);
- AppStorage.Set('width', Constants.SHELTER_END_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_END_HEIGHT);
- AppStorage.Set('showAperture', false);
- AppStorage.Set('enrollTitle', $r('app.string.face_record_3d_record_fail'));
- AppStorage.Set('enrollInfo', mResultCode.get(result));
- AppStorage.Set('blur', Constants.BLUR_END);
- AppStorage.Set('showBtn', true);
- AppStorage.Set('showBack', false);
- AppStorage.Set('prgValue', $r('app.float.progress_value_start'));
- }
- if (result == Constants.RESULT_CODE_CANCELED) {
- console.info(" FaceEnroll model_2D startEnroll UserIDM.addCredential onResult result", result);
- }
- if (result == Constants.RESULT_CODE_TIMEOUT) {
- console.info(" FaceEnroll model_2D startEnroll UserIDM.addCredential onResult result", result);
- AppStorage.Set('width', Constants.SHELTER_END_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_END_HEIGHT);
- AppStorage.Set('showAperture', false);
- AppStorage.Set('enrollTitle', $r('app.string.enrolling_timeout'));
- AppStorage.Set('enrollInfo', mResultCode.get(result));
- AppStorage.Set('blur', Constants.BLUR_END);
- AppStorage.Set('showBtn', true);
- AppStorage.Set('showBack', false);
- AppStorage.Set('prgValue', $r('app.float.progress_value_start'));
- }
- if (result == Constants.RESULT_CODE_TYPE_NOT_SUPPORT) {
- console.info(" FaceEnroll model_2D startEnroll UserIDM.addCredential onResult result", result);
- AppStorage.Set('width', Constants.SHELTER_END_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_END_HEIGHT);
- AppStorage.Set('showAperture', false);
- AppStorage.Set('enrollTitle', $r('app.string.face_record_3d_record_fail'));
- AppStorage.Set('enrollInfo', mResultCode.get(result));
- AppStorage.Set('blur', Constants.BLUR_END);
- AppStorage.Set('showBtn', true);
- AppStorage.Set('showBack', false);
- AppStorage.Set('prgValue', $r('app.float.progress_value_start'));
- }
- if (result == Constants.RESULT_CODE_TRUST_LEVEL_NOT_SUPPORT) {
- console.info(" FaceEnroll model_2D startEnroll UserIDM.addCredential onResult result", result);
- AppStorage.Set('width', Constants.SHELTER_END_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_END_HEIGHT);
- AppStorage.Set('showAperture', false);
- AppStorage.Set('enrollTitle', $r('app.string.face_record_3d_record_fail'));
- AppStorage.Set('enrollInfo', mResultCode.get(result));
- AppStorage.Set('blur', Constants.BLUR_END);
- AppStorage.Set('showBtn', true);
- AppStorage.Set('showBack', false);
- AppStorage.Set('prgValue', $r('app.float.progress_value_start'));
- }
- if (result == Constants.RESULT_CODE_BUSY) {
- console.info(" FaceEnroll model_2D startEnroll UserIDM.addCredential onResult result", result);
- AppStorage.Set('width', Constants.SHELTER_END_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_END_HEIGHT);
- AppStorage.Set('showAperture', false);
- AppStorage.Set('enrollTitle', $r('app.string.face_record_3d_record_fail'));
- AppStorage.Set('enrollInfo', mResultCode.get(result));
- AppStorage.Set('blur', Constants.BLUR_END);
- AppStorage.Set('showBtn', true);
- AppStorage.Set('showBack', false);
- AppStorage.Set('prgValue', $r('app.float.progress_value_start'));
- }
- if (result == Constants.RESULT_CODE_INVALID_PARAMETERS) {
- console.info(" FaceEnroll model_2D startEnroll UserIDM.addCredential onResult result", result);
- AppStorage.Set('width', Constants.SHELTER_END_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_END_HEIGHT);
- AppStorage.Set('showAperture', false);
- AppStorage.Set('enrollTitle', $r('app.string.face_record_3d_record_fail'));
- AppStorage.Set('enrollInfo', mResultCode.get(result));
- AppStorage.Set('blur', Constants.BLUR_END);
- AppStorage.Set('showBtn', true);
- AppStorage.Set('showBack', false);
- AppStorage.Set('prgValue', $r('app.float.progress_value_start'));
- }
- if (result == Constants.RESULT_CODE_LOCKED) {
- console.info(" FaceEnroll model_2D startEnroll UserIDM.addCredential onResult result", result);
- AppStorage.Set('width', Constants.SHELTER_END_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_END_HEIGHT);
- AppStorage.Set('showAperture', false);
- AppStorage.Set('enrollTitle', $r('app.string.face_record_3d_record_fail'));
- AppStorage.Set('enrollInfo', mResultCode.get(result));
- AppStorage.Set('blur', Constants.BLUR_END);
- AppStorage.Set('showBtn', true);
- AppStorage.Set('showBack', false);
- AppStorage.Set('prgValue', $r('app.float.progress_value_start'));
- }
- if (result == Constants.RESULT_CODE_NOT_ENROLLED) {
- console.info(" FaceEnroll model_2D startEnroll UserIDM.addCredential onResult result", result);
- AppStorage.Set('width', Constants.SHELTER_END_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_END_HEIGHT);
- AppStorage.Set('showAperture', false);
- AppStorage.Set('enrollTitle', $r('app.string.face_record_3d_record_fail'));
- AppStorage.Set('enrollInfo', mResultCode.get(result));
- AppStorage.Set('blur', Constants.BLUR_END);
- AppStorage.Set('showBtn', true);
- AppStorage.Set('showBack', false);
- AppStorage.Set('prgValue', $r('app.float.progress_value_start'));
- }
- },
- onAcquireInfo: (callbackModule, acquire, extraInfo) => {
- AppStorage.Set('width', Constants.SHELTER_END_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_END_HEIGHT);
- AppStorage.Set('showAperture', false);
- AppStorage.Set('enrollTitle', $r('app.string.enrolling'));
- AppStorage.Set('enrollInfo', mFaceTips.get(acquire));
- }
- })
- this.endEnroll();
- }
-
- /**
- * end enroll
- */
- endEnroll() {
- console.info("FaceEnroll model_2D endEnroll start");
- this.UserIDM.closeSession();
- console.info("FaceEnroll model_2D endEnroll userEnroll.closeSession()");
- AppStorage.Delete('faceSession');
- console.info("FaceEnroll model_2D endEnroll end");
- }
-
- /**
- * cancel enroll
- */
- cancelEnroll() {
- console.info("FaceEnroll model_2D cancelEnroll start");
- let can = this.UserIDM.cancel(AppStorage.Get('faceSession'));
- console.info("FaceEnroll model_2D cancelEnroll userEnroll.cancel()", can);
- this.endEnroll();
- console.info("FaceEnroll model_2D cancelEnroll end");
- }
-
- /**
- * change index 3d
- */
- change_3D() {
- AppStorage.Set('show_startViews', '3D');
- }
-
- /**
- * change index 2d
- */
- change_2D() {
- AppStorage.Set('show_startViews', '2D');
- }
-
- /**
- * init index
- */
- init() {
- AppStorage.SetAndLink('show_startViews', '2D');
- }
-}
-
-let mFaceModel = new model_2D();
-
-export default mFaceModel as model_2D;
diff --git a/ui/faceenroll/product/pad/src/main/ets/default/model_3D.ets b/ui/faceenroll/product/pad/src/main/ets/default/model_3D.ets
deleted file mode 100644
index 7d43f5d..0000000
--- a/ui/faceenroll/product/pad/src/main/ets/default/model_3D.ets
+++ /dev/null
@@ -1,255 +0,0 @@
-// @ts-nocheck
-/*
- * 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 Constants from '../default/common/constant.ets';
-import UserIDM from '@ohos.useridm';
-
-var mPrgvalue;
-var mResultCode = Constants.resultCode();
-var mFaceTips = Constants.FaceTips();
-
-
-export class model_3D {
- private UserIDM;
-
- constructor() {
- this.UserIDM = UserIDM.constructor();
- }
- /**
- * init FaceModel
- */
- initFaceModel(credentialInfo) {
- console.info("FaceEnroll model_3D initFaceModel start");
- AppStorage.Link('width');
- AppStorage.Link('height');
- AppStorage.Link('showPrg');
- mPrgvalue = AppStorage.Link('prgValue');
- AppStorage.Link('showBtn');
- AppStorage.Link('blur');
- AppStorage.Link('showBack');
- AppStorage.Set('enrollInfo', $r('app.string.enroll_info'))
- AppStorage.Set('enrollTitle', $r('app.string.face_record'))
- AppStorage.Link('showAperture1')
- this.startEnroll(credentialInfo);
- console.info("FaceEnroll model_3D initFaceModel end");
- }
-
- /**
- * resume page, unInit FaceModel
- */
- uninitFaceModel() {
- console.info(" FaceEnroll model_3D uninitFaceModel start");
- if (mPrgvalue != Constants.PROGRESS_TOTAL) {
- this.cancelEnroll();
- }
- setTimeout(() => {
- AppStorage.Set('width', Constants.SHELTER_START_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_START_HEIGHT);
- AppStorage.Set('showPrg', false)
- mPrgvalue = AppStorage.Set('prgValue', $r('app.float.progress_value_start'))
- AppStorage.Set('showBack', true)
- AppStorage.Set('blur', Constants.BLUR_START)
- AppStorage.Set('showBtn', false)
- AppStorage.Set('enrollInfo', $r('app.string.enroll_info'))
- AppStorage.Set('enrollTitle', $r('app.string.face_record'))
- AppStorage.Set('showAperture1',true)
- AppStorage.Set('showAperture2',false)
- AppStorage.Set('showAperture3',false)
- AppStorage.Set('showAperture4',false)
- AppStorage.Set('showAperture5',false)
-
- },Constants.TIMEOUT_500)
- }
-
- /**
- * Open session and get challenge.
- * @param callback
- */
- openSession(callback) {
- console.info("FaceEnroll model_3D openSession start");
- this.UserIDM.openSession((data) => {
- try {
- console.info("FaceEnroll model_3D openSession data", data);
- callback(data);
- }
- catch (e) {
- console.info("FaceEnroll model_3D openSession error", e);
- }
- })
- callback();
- console.info("FaceEnroll model_3D openSession end");
- }
-
- /**
- * start enroll, get callback value
- */
- startEnroll(credentialInfo) {
- console.info(" FaceEnroll model_3D startEnroll 3d start ");
- this.UserIDM.addCredential(credentialInfo, {
- onResult: (result, extraInfo) => {
- if (result == Constants.RESULT_CODE_SUCCESS) {
- console.info(" FaceEnroll model_3D startEnroll UserIDM.addCredential onResult result", result);
- AppStorage.Set('showPrg', true);
- Constants.progress_2D();
- this.endEnroll();
- }
- if (result == Constants.RESULT_CODE_FAIL) {
- console.info(" FaceEnroll model_3D startEnroll UserIDM.addCredential onResult result", result);
- AppStorage.Set('width', Constants.SHELTER_END_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_END_HEIGHT);
- AppStorage.Set('showAperture', false);
- AppStorage.Set('enrollTitle', $r('app.string.face_record_3d_record_fail'));
- AppStorage.Set('enrollInfo', mResultCode.get(result));
- AppStorage.Set('blur', Constants.BLUR_END);
- AppStorage.Set('showBtn', true);
- AppStorage.Set('showBack', false);
- AppStorage.Set('prgValue', $r('app.float.progress_value_start'));
- }
- if (result == Constants.RESULT_CODE_GENERAL_ERROR) {
- console.info(" FaceEnroll model_3D startEnroll UserIDM.addCredential onResult result", result);
- AppStorage.Set('width', Constants.SHELTER_END_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_END_HEIGHT);
- AppStorage.Set('showAperture', false);
- AppStorage.Set('enrollTitle', $r('app.string.face_record_3d_record_fail'));
- AppStorage.Set('enrollInfo', mResultCode.get(result));
- AppStorage.Set('blur', Constants.BLUR_END);
- AppStorage.Set('showBtn', true);
- AppStorage.Set('showBack', false);
- AppStorage.Set('prgValue', $r('app.float.progress_value_start'));
- }
- if (result == Constants.RESULT_CODE_CANCELED) {
- console.info(" FaceEnroll model_3D startEnroll UserIDM.addCredential onResult result", result);
- }
- if (result == Constants.RESULT_CODE_TIMEOUT) {
- console.info(" FaceEnroll model_3D startEnroll UserIDM.addCredential onResult result", result);
- AppStorage.Set('width', Constants.SHELTER_END_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_END_HEIGHT);
- AppStorage.Set('showAperture', false);
- AppStorage.Set('enrollTitle', $r('app.string.enrolling_timeout'));
- AppStorage.Set('enrollInfo', mResultCode.get(result));
- AppStorage.Set('blur', Constants.BLUR_END);
- AppStorage.Set('showBtn', true);
- AppStorage.Set('showBack', false);
- AppStorage.Set('prgValue', $r('app.float.progress_value_start'));
- }
- if (result == Constants.RESULT_CODE_TYPE_NOT_SUPPORT) {
- console.info(" FaceEnroll model_3D startEnroll UserIDM.addCredential onResult result", result);
- AppStorage.Set('width', Constants.SHELTER_END_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_END_HEIGHT);
- AppStorage.Set('showAperture', false);
- AppStorage.Set('enrollTitle', $r('app.string.face_record_3d_record_fail'));
- AppStorage.Set('enrollInfo', mResultCode.get(result));
- AppStorage.Set('blur', Constants.BLUR_END);
- AppStorage.Set('showBtn', true);
- AppStorage.Set('showBack', false);
- AppStorage.Set('prgValue', $r('app.float.progress_value_start'));
- }
- if (result == Constants.RESULT_CODE_TRUST_LEVEL_NOT_SUPPORT) {
- console.info(" FaceEnroll model_3D startEnroll UserIDM.addCredential onResult result", result);
- AppStorage.Set('width', Constants.SHELTER_END_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_END_HEIGHT);
- AppStorage.Set('showAperture', false);
- AppStorage.Set('enrollTitle', $r('app.string.face_record_3d_record_fail'));
- AppStorage.Set('enrollInfo', mResultCode.get(result));
- AppStorage.Set('blur', Constants.BLUR_END);
- AppStorage.Set('showBtn', true);
- AppStorage.Set('showBack', false);
- AppStorage.Set('prgValue', $r('app.float.progress_value_start'));
- }
- if (result == Constants.RESULT_CODE_BUSY) {
- console.info(" FaceEnroll model_3D startEnroll UserIDM.addCredential onResult result", result);
- AppStorage.Set('width', Constants.SHELTER_END_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_END_HEIGHT);
- AppStorage.Set('showAperture', false);
- AppStorage.Set('enrollTitle', $r('app.string.face_record_3d_record_fail'));
- AppStorage.Set('enrollInfo', mResultCode.get(result));
- AppStorage.Set('blur', Constants.BLUR_END);
- AppStorage.Set('showBtn', true);
- AppStorage.Set('showBack', false);
- AppStorage.Set('prgValue', $r('app.float.progress_value_start'));
- }
- if (result == Constants.RESULT_CODE_INVALID_PARAMETERS) {
- console.info(" FaceEnroll model_3D startEnroll UserIDM.addCredential onResult result", result);
- AppStorage.Set('width', Constants.SHELTER_END_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_END_HEIGHT);
- AppStorage.Set('showAperture', false);
- AppStorage.Set('enrollTitle', $r('app.string.face_record_3d_record_fail'));
- AppStorage.Set('enrollInfo', mResultCode.get(result));
- AppStorage.Set('blur', Constants.BLUR_END);
- AppStorage.Set('showBtn', true);
- AppStorage.Set('showBack', false);
- AppStorage.Set('prgValue', $r('app.float.progress_value_start'));
- }
- if (result == Constants.RESULT_CODE_LOCKED) {
- console.info(" FaceEnroll model_3D startEnroll UserIDM.addCredential onResult result", result);
- AppStorage.Set('width', Constants.SHELTER_END_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_END_HEIGHT);
- AppStorage.Set('showAperture', false);
- AppStorage.Set('enrollTitle', $r('app.string.face_record_3d_record_fail'));
- AppStorage.Set('enrollInfo', mResultCode.get(result));
- AppStorage.Set('blur', Constants.BLUR_END);
- AppStorage.Set('showBtn', true);
- AppStorage.Set('showBack', false);
- AppStorage.Set('prgValue', $r('app.float.progress_value_start'));
- }
- if (result == Constants.RESULT_CODE_NOT_ENROLLED) {
- console.info(" FaceEnroll model_3D startEnroll UserIDM.addCredential onResult result", result);
- AppStorage.Set('width', Constants.SHELTER_END_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_END_HEIGHT);
- AppStorage.Set('showAperture', false);
- AppStorage.Set('enrollTitle', $r('app.string.face_record_3d_record_fail'));
- AppStorage.Set('enrollInfo', mResultCode.get(result));
- AppStorage.Set('blur', Constants.BLUR_END);
- AppStorage.Set('showBtn', true);
- AppStorage.Set('showBack', false);
- AppStorage.Set('prgValue', $r('app.float.progress_value_start'));
- }
- },
- onAcquireInfo: (callbackModule, acquire, extraInfo) => {
- AppStorage.Set('width', Constants.SHELTER_END_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_END_HEIGHT);
- AppStorage.Set('showAperture', false);
- AppStorage.Set('enrollTitle', $r('app.string.enrolling'));
- AppStorage.Set('enrollInfo', mFaceTips.get(acquire));
- }
- })
- this.endEnroll();
- }
-
- /**
- * end enroll
- */
- endEnroll() {
- console.info("FaceEnroll model_3D endEnroll start");
- this.UserIDM.closeSession();
- console.info("FaceEnroll model_3D endEnroll userEnroll.closeSession()");
- AppStorage.Delete('faceSession');
- console.info("FaceEnroll model_3D endEnroll end");
- }
-
- /**
- * cancel enroll
- */
- cancelEnroll() {
- console.info("FaceEnroll model_3D cancelEnroll start");
- let can = this.UserIDM.cancel(AppStorage.Get('faceSession'));
- console.info("FaceEnroll model_2D cancelEnroll userEnroll.cancel()", can);
- this.endEnroll();
- console.info("FaceEnroll model_3D cancelEnroll end");
- }
-}
-let mFaceModel = new model_3D();
-export default mFaceModel as model_3D;
\ No newline at end of file
diff --git a/ui/faceenroll/product/pad/src/main/ets/default/pages/aperture.ets b/ui/faceenroll/product/pad/src/main/ets/default/pages/aperture.ets
deleted file mode 100644
index 683247b..0000000
--- a/ui/faceenroll/product/pad/src/main/ets/default/pages/aperture.ets
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * 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 Constants from '../common/constant.ets';
-
-@Entry
-@Component
-
-export default
-
-struct Aperture {
-
- @StorageLink('showAperture1') showAperture1:boolean = true;
- @StorageLink('showAperture2') showAperture2:boolean = false;
- @StorageLink('showAperture3') showAperture3:boolean = false;
- @StorageLink('showAperture4') showAperture4:boolean = false;
- @StorageLink('showAperture5') showAperture5:boolean = false;
-
- build() {
- Flex({ alignItems: ItemAlign.Center , justifyContent:FlexAlign.Center}) {
- if (this.showAperture1) {
- Image($r('app.media.aperture1'))
- .width(Constants.APERTURE1_WIDTH)
- .height(Constants.APERTURE1_WIDTH)
- .align(Alignment.Center)
- }
- if (this.showAperture2) {
- Image($r('app.media.aperture2'))
- .width(Constants.APERTURE2_WIDTH)
- .height(Constants.APERTURE2_WIDTH)
- .align(Alignment.Center)
- }
- if (this.showAperture3) {
- Image($r('app.media.aperture3'))
- .width(Constants.APERTURE34_WIDTH)
- .height(Constants.APERTURE34_WIDTH)
- .align(Alignment.Center)
- }
- if (this.showAperture4) {
- Image($r('app.media.aperture4'))
- .width(Constants.APERTURE34_WIDTH)
- .height(Constants.APERTURE34_WIDTH)
- .align(Alignment.Center)
- }
- if (this.showAperture5) {
- Image($r('app.media.aperture5'))
- .width(Constants.APERTURE5_WIDTH)
- .height(Constants.APERTURE5_WIDTH)
- .align(Alignment.Center)
- }
- }.position({x: $r('app.float.enroll_center_position_X'),y:Constants.ENROLL_CENTER_POSITION_Y})
- .width('100%')
- .height(Constants.CENTER_HEIGHT)
- }
-}
\ No newline at end of file
diff --git a/ui/faceenroll/product/pad/src/main/ets/default/pages/declare.ets b/ui/faceenroll/product/pad/src/main/ets/default/pages/declare.ets
deleted file mode 100644
index 683247b..0000000
--- a/ui/faceenroll/product/pad/src/main/ets/default/pages/declare.ets
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * 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 Constants from '../common/constant.ets';
-
-@Entry
-@Component
-
-export default
-
-struct Aperture {
-
- @StorageLink('showAperture1') showAperture1:boolean = true;
- @StorageLink('showAperture2') showAperture2:boolean = false;
- @StorageLink('showAperture3') showAperture3:boolean = false;
- @StorageLink('showAperture4') showAperture4:boolean = false;
- @StorageLink('showAperture5') showAperture5:boolean = false;
-
- build() {
- Flex({ alignItems: ItemAlign.Center , justifyContent:FlexAlign.Center}) {
- if (this.showAperture1) {
- Image($r('app.media.aperture1'))
- .width(Constants.APERTURE1_WIDTH)
- .height(Constants.APERTURE1_WIDTH)
- .align(Alignment.Center)
- }
- if (this.showAperture2) {
- Image($r('app.media.aperture2'))
- .width(Constants.APERTURE2_WIDTH)
- .height(Constants.APERTURE2_WIDTH)
- .align(Alignment.Center)
- }
- if (this.showAperture3) {
- Image($r('app.media.aperture3'))
- .width(Constants.APERTURE34_WIDTH)
- .height(Constants.APERTURE34_WIDTH)
- .align(Alignment.Center)
- }
- if (this.showAperture4) {
- Image($r('app.media.aperture4'))
- .width(Constants.APERTURE34_WIDTH)
- .height(Constants.APERTURE34_WIDTH)
- .align(Alignment.Center)
- }
- if (this.showAperture5) {
- Image($r('app.media.aperture5'))
- .width(Constants.APERTURE5_WIDTH)
- .height(Constants.APERTURE5_WIDTH)
- .align(Alignment.Center)
- }
- }.position({x: $r('app.float.enroll_center_position_X'),y:Constants.ENROLL_CENTER_POSITION_Y})
- .width('100%')
- .height(Constants.CENTER_HEIGHT)
- }
-}
\ No newline at end of file
diff --git a/ui/faceenroll/product/pad/src/main/ets/default/pages/enroll_2D.ets b/ui/faceenroll/product/pad/src/main/ets/default/pages/enroll_2D.ets
deleted file mode 100644
index ab6e737..0000000
--- a/ui/faceenroll/product/pad/src/main/ets/default/pages/enroll_2D.ets
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * 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 mFaceModel from "../model_2D.ets";
-import Constants from '../common/constant.ets';
-const SUBTYPE_FACE_2D = 20000;
-const AUTHTYPE_FACE = 2;
-
-async function route_back() {
- let options = {
- uri: 'pages/entryView'
- }
- try {
- await router.push(options);
- } catch (err) {
- console.error(`fail callback, code: ${err.code}, msg: ${err.msg}`);
- }
-}
-
-@Entry
-@Component
-export default struct Enroll_2D {
- @StorageLink('showAperture') showAperture: boolean = true;
- @StorageLink('blur') blur: number = Constants.BLUR_START;
- @StorageLink('width') width: any = Constants.SHELTER_START_WIDTH;
- @StorageLink('height') height: any = Constants.SHELTER_START_HEIGHT;
- @StorageLink('showPrg') showPrg: boolean = false;
- @StorageLink('prgValue') prgValue: number = Constants.PROGRESS_START;
- @StorageLink('enrollInfo') enrollInfo: any = $r('app.string.enroll_info');
- @StorageLink('enrollTitle') enrollTitle: any = $r('app.string.face_record');
- @StorageLink('showBtn') showBtn: boolean = false;
- @StorageLink('showBack') showBack: boolean = true;
- private credentialInfo;
-
- private aboutToAppear(): void {
- setTimeout(()=> {
- AppStorage.Delete('faceToken');
- router.push({
- uri: 'pages/entryView'
- });
- }, 180000)
- this.credentialInfo = {
- credType:AUTHTYPE_FACE,
- credSubType:SUBTYPE_FACE_2D,
- token:AppStorage.Get('token')
- };
- mFaceModel.initFaceModel(this.credentialInfo);
- }
-
- private onPageHide() {
- mFaceModel.uninitFaceModel();
- }
-
- private onBackPress(): void{
- AppStorage.Delete('faceToken');
- router.push({
- uri: 'pages/entryView',
- })
- }
-
- build() {
- Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center }) {
- Image($r('app.media.image'))
- .width('100%')
- .height(Constants.CENTER_HEIGHT)
- .align(Alignment.Center)
- .position({x: $r('app.float.enroll_center_position_X'),y:Constants.ENROLL_CENTER_POSITION_Y})
-
- Flex()
- .width('100%')
- .height(Constants.CENTER_HEIGHT)
- .align(Alignment.Center)
- .blur(this.blur)
- .position({x:$r('app.float.enroll_center_position_X'),y: Constants.ENROLL_CENTER_POSITION_Y})
- .animation({ duration: Constants.SHELTER_ANIMATOR, curve: Curve.Linear })
-
- if (this.showAperture) {
- Flex({ alignItems: ItemAlign.Center , justifyContent:FlexAlign.Center}) {
- Image($r('app.media.aperture1'))
- .width(Constants.APERTURE1_WIDTH)
- .height(Constants.APERTURE1_WIDTH)
- .align(Alignment.Center)
- }
- .position({x:$r('app.float.enroll_center_position_X'),y:Constants.ENROLL_CENTER_POSITION_Y})
- .height(Constants.CENTER_HEIGHT)
- .width('100%')
- }
-
- Flex()
- .width('100%')
- .height(Constants.ENROLL_CENTER_POSITION_Y)
-
- Flex({ alignItems: ItemAlign.Center , justifyContent:FlexAlign.Center}) {
- Image($r('app.media.shelter'))
- .width(this.width)
- .height(this.height)
- .animation({ duration: Constants.SHELTER_ANIMATOR, curve: Curve.Linear })
- }.width('100%')
- .height(Constants.CENTER_HEIGHT)
-
-
- if(this.showPrg) {
- Flex({ alignItems: ItemAlign.Center , justifyContent:FlexAlign.Center}) {
- Progress({ value: Constants.PROGRESS_START, total: Constants.PROGRESS_TOTAL, style: ProgressStyle.Capsule })
- .value(this.prgValue)
- .width(Constants.PROGRESS_WIDTH)
- .color(Color.Red)
- }.position({x:$r('app.float.enroll_center_position_X'),y:Constants.ENROLL_CENTER_POSITION_Y})
- .height(Constants.CENTER_HEIGHT)
- .width('100%')
- }
-
- if(this.showBack) {
- Flex() {
- Image($r('app.media.back'))
- .width(Constants.BACK_WIDTH)
- .height(Constants.BACK_HEIGHT)
- .onClick(() => {
- router.back()
- })
- }.position({ x: $r('app.float.enroll_center_position_X'), y: Constants.CENTER_POSITION_Y })
- }
-
- Flex({ alignItems: ItemAlign.Center , justifyContent:FlexAlign.Center}) {
- Text(this.enrollTitle)
- .fontSize(Constants.TITLE_FONT_SIZE)
- .fontWeight(Constants.ENROll_TITLE)
- }.position({x:$r('app.float.enroll_title_position_X'),y:Constants.TITLE_ENROLLING_MARGIN})
-
- Flex({justifyContent:FlexAlign.Center}) {
- Text(this.enrollInfo)
- .fontSize(Constants.ERROR_CODE_INFO_SIZE)
- .textAlign(TextAlign.Center)
- }
- .position({ x:$r('app.float.enroll_info_X'), y: Constants.ENROLL_INFO_POSITION})
- .width(Constants.ENROLL_INFO_WIDTH)
-
- if(this.showBtn){
- Flex({justifyContent:FlexAlign.Center}) {
- Button({ type: ButtonType.Capsule, stateEffect: true }) {
- Text($r('app.string.enroll_button_content'))
- .fontSize(Constants.BUTTON_FONT_SIZE)
- .fontColor($r('app.color.startView_color'))
- }
- .backgroundColor($r('app.color.newBtn_color'))
- .width(Constants.BUTTON_WIDTH)
- .height(Constants.BUTTON_HEIGHT)
- .onClick(() => {
- route_back()
- })
- }.position({ x:$r('app.float.enroll_center_position_X'), y: Constants.BUTTON_POSITION})
- }
- }
- .width('100%')
- .height('100%')
- }
-}
\ No newline at end of file
diff --git a/ui/faceenroll/product/pad/src/main/ets/default/pages/enroll_3D.ets b/ui/faceenroll/product/pad/src/main/ets/default/pages/enroll_3D.ets
deleted file mode 100644
index 4beb183..0000000
--- a/ui/faceenroll/product/pad/src/main/ets/default/pages/enroll_3D.ets
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * 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 mFaceModel from "../model_3D.ets";
-import Constants from '../common/constant.ets';
-const SUBTYPE_FACE_2D = 20000;
-const AUTHTYPE_FACE = 2;
-
-async function route_back() {
- let options = {
- uri: 'pages/entryView'
- }
- try {
- await router.push(options);
- } catch (err) {
- console.error(`fail callback, code: ${err.code}, msg: ${err.msg}`);
- }
-}
-
-@Entry
-@Component
-export default struct Enroll_3D {
- @StorageLink('showAperture') showAperture: boolean = true;
- @StorageLink('blur') blur: number = Constants.BLUR_START;
- @StorageLink('width') width: any = Constants.SHELTER_START_WIDTH;
- @StorageLink('height') height: any = Constants.SHELTER_START_HEIGHT;
- @StorageLink('showPrg') showPrg: boolean = false;
- @StorageLink('prgValue') prgValue: number = Constants.PROGRESS_START;
- @StorageLink('enrollInfo') enrollInfo: any = $r('app.string.enroll_info');
- @StorageLink('enrollTitle') enrollTitle: any = $r('app.string.face_record');
- @StorageLink('showBtn') showBtn: boolean = false;
- @StorageLink('showBack') showBack: boolean = true;
- private credentialInfo;
-
- private aboutToAppear(): void {
- setTimeout(()=> {
- AppStorage.Delete('faceToken');
- router.push({
- uri: 'pages/entryView'
- });
- }, 180000)
- this.credentialInfo = {
- credType:AUTHTYPE_FACE,
- credSubType:SUBTYPE_FACE_2D,
- token:AppStorage.Get('token')
- };
- mFaceModel.initFaceModel(this.credentialInfo);
- }
-
- private onPageHide() {
- mFaceModel.uninitFaceModel();
- }
-
- private onBackPress(): void{
- AppStorage.Delete('faceToken');
- router.push({
- uri: 'pages/entryView',
- })
- }
-
- build() {
- Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center }) {
- Image($r('app.media.image'))
- .width('100%')
- .height(Constants.CENTER_HEIGHT)
- .align(Alignment.Center)
- .position({x: $r('app.float.enroll_center_position_X'),y:Constants.ENROLL_CENTER_POSITION_Y})
-
- Flex()
- .width('100%')
- .height(Constants.CENTER_HEIGHT)
- .align(Alignment.Center)
- .blur(this.blur)
- .position({x:$r('app.float.enroll_center_position_X'),y: Constants.ENROLL_CENTER_POSITION_Y})
- .animation({ duration: Constants.SHELTER_ANIMATOR, curve: Curve.Linear })
-
- if (this.showAperture) {
- Flex({ alignItems: ItemAlign.Center , justifyContent:FlexAlign.Center}) {
- Image($r('app.media.aperture1'))
- .width(Constants.APERTURE1_WIDTH)
- .height(Constants.APERTURE1_WIDTH)
- .align(Alignment.Center)
- }
- .position({x:$r('app.float.enroll_center_position_X'),y:Constants.ENROLL_CENTER_POSITION_Y})
- .height(Constants.CENTER_HEIGHT)
- .width('100%')
- }
-
- Flex()
- .width('100%')
- .height(Constants.ENROLL_CENTER_POSITION_Y)
-
- Flex({ alignItems: ItemAlign.Center , justifyContent:FlexAlign.Center}) {
- Image($r('app.media.shelter'))
- .width(this.width)
- .height(this.height)
- .animation({ duration: Constants.SHELTER_ANIMATOR, curve: Curve.Linear })
- }.width('100%')
- .height(Constants.CENTER_HEIGHT)
-
-
- if(this.showPrg) {
- Flex({ alignItems: ItemAlign.Center , justifyContent:FlexAlign.Center}) {
- Progress({ value: Constants.PROGRESS_START, total: Constants.PROGRESS_TOTAL, style: ProgressStyle.Capsule })
- .value(this.prgValue)
- .width(Constants.PROGRESS_WIDTH)
- .color(Color.Red)
- }.position({x:$r('app.float.enroll_center_position_X'),y:Constants.ENROLL_CENTER_POSITION_Y})
- .height(Constants.CENTER_HEIGHT)
- .width('100%')
- }
-
- if(this.showBack) {
- Flex() {
- Image($r('app.media.back'))
- .width(Constants.BACK_WIDTH)
- .height(Constants.BACK_HEIGHT)
- .onClick(() => {
- router.back()
- })
- }.position({ x: $r('app.float.enroll_center_position_X'), y: Constants.CENTER_POSITION_Y })
- }
-
- Flex({ alignItems: ItemAlign.Center , justifyContent:FlexAlign.Center}) {
- Text(this.enrollTitle)
- .fontSize(Constants.TITLE_FONT_SIZE)
- .fontWeight(Constants.ENROll_TITLE)
- }.position({x:$r('app.float.enroll_title_position_X'),y:Constants.TITLE_ENROLLING_MARGIN})
-
- Flex({justifyContent:FlexAlign.Center}) {
- Text(this.enrollInfo)
- .fontSize(Constants.ERROR_CODE_INFO_SIZE)
- .textAlign(TextAlign.Center)
- }
- .position({ x:$r('app.float.enroll_info_X'), y: Constants.ENROLL_INFO_POSITION})
- .width(Constants.ENROLL_INFO_WIDTH)
-
- if(this.showBtn){
- Flex({justifyContent:FlexAlign.Center}) {
- Button({ type: ButtonType.Capsule, stateEffect: true }) {
- Text($r('app.string.enroll_button_content'))
- .fontSize(Constants.BUTTON_FONT_SIZE)
- .fontColor($r('app.color.startView_color'))
- }
- .backgroundColor($r('app.color.newBtn_color'))
- .width(Constants.BUTTON_WIDTH)
- .height(Constants.BUTTON_HEIGHT)
- .onClick(() => {
- route_back()
- })
- }.position({ x:$r('app.float.enroll_center_position_X'), y: Constants.BUTTON_POSITION})
- }
- }
- .width('100%')
- .height('100%')
- }
-}
\ No newline at end of file
diff --git a/ui/faceenroll/product/pad/src/main/ets/default/pages/entryView.ets b/ui/faceenroll/product/pad/src/main/ets/default/pages/entryView.ets
deleted file mode 100644
index 86035ce..0000000
--- a/ui/faceenroll/product/pad/src/main/ets/default/pages/entryView.ets
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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 UserAuthPresenter from '../../../../../../../common/src/main/ets/default/common/presenter/UserAuthPresenter.ets'
-
-let mUserAuthPresenter: UserAuthPresenter;
-
-@Entry
-@Component
-struct entryView {
-
- @State open_userAuth: boolean = false;
-
- private aboutToAppear(): void {
- AppStorage.Delete('faceInfo');
- AppStorage.Delete('authLength');
- AppStorage.Delete('userMode');
- AppStorage.Delete('faceToken');
- mUserAuthPresenter = UserAuthPresenter.getInstance();
- }
- build() {
- Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
- Button('人脸识别', { type: ButtonType.Normal, stateEffect: true})
- .onClick(() => {
- mUserAuthPresenter.jumpToUserAuth(this.getTokenCallBack.bind(this));
- })
- }
- }
-
- public getTokenCallBack() {
- let faceToken = AppStorage.Get('faceToken');
- if (faceToken != undefined) {
- this.jumpToUserAuth();
- }
- }
-
- private jumpToUserAuth() {
- router.push({
- uri: 'pages/userAuth',
- })
- }
-}
\ No newline at end of file
diff --git a/ui/faceenroll/product/pad/src/main/ets/default/pages/index.ets b/ui/faceenroll/product/pad/src/main/ets/default/pages/index.ets
deleted file mode 100644
index 65b31d4..0000000
--- a/ui/faceenroll/product/pad/src/main/ets/default/pages/index.ets
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * 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 StartViews_2D from "./startViews_2D.ets";
-import StartViews_3D from "./startViews_3D.ets";
-import Constants from "../common/constant.ets";
-import router from '@system.router';
-
-@Entry
-@Component
-struct Index {
- @StorageLink('show_startViews') show_startViews: string = Constants.SHOW_START_VIEWS_2D;
- private onBackPress(): void{
- AppStorage.Delete('faceToken');
- router.push({
- uri: 'pages/entryView',
- })
- }
- build() {
-
- Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center }) {
- if (this.show_startViews == Constants.SHOW_START_VIEWS_3D) {
- StartViews_3D();
- }
- else if(this.show_startViews == Constants.SHOW_START_VIEWS_2D)
- {
- StartViews_2D();
- }
- }
- .width('100%')
- .height('100%')
- }
-}
diff --git a/ui/faceenroll/product/pad/src/main/ets/default/pages/startViews_2D.ets b/ui/faceenroll/product/pad/src/main/ets/default/pages/startViews_2D.ets
deleted file mode 100644
index eb22c8e..0000000
--- a/ui/faceenroll/product/pad/src/main/ets/default/pages/startViews_2D.ets
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * 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 Constants from '../common/constant.ets';
-import mFaceModel from "../model_2D.ets";
-
-async function routeDeclare() {
- let options = {
- uri: 'pages/declare'
- }
- try {
- await router.push(options);
- } catch (err) {
- console.error(`fail callback, code: ${err.code}, msg: ${err.msg}`);
- }
-}
-async function routeEnroll_2D() {
- let options = {
- uri: 'pages/enroll_2D'
- }
- try {
- await router.push(options);
- } catch (err) {
- console.error(`fail callback, code: ${err.code}, msg: ${err.msg}`);
- }
-}
-
-@Entry
-@Component
-export default
-struct StartViews_2D {
- @StorageLink('checkbox_color') checkbox_color : any = $r('app.color.startView_color');
- private pageHideFlag: number = 0;
-
- public openSessionCallBack() {
- routeEnroll_2D();
- }
-
- private onPageHide(): void {
- if (this.pageHideFlag == 0) {
- router.push({
- uri: 'pages/entryView'
- })
- }
- }
- private onBackPress(): void{
- AppStorage.Delete('faceToken');
- router.push({
- uri: 'pages/entryView',
- })
- }
-
- build() {
- Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center }) {
-
- Flex() {
- Image($r('app.media.back'))
- .width(Constants.BACK_WIDTH)
- .height(Constants.BACK_HEIGHT)
- .onClick(()=>{
- })
- }.margin({ top: $r('app.float.back_margin') })
- .width('100%')
-
- Text($r('app.string.face_checker'))
- .fontSize(Constants.TITLE_FONT_SIZE)
- .fontWeight(FontWeight.Bold)
- .margin({ top: Constants.TITLE_MARGIN })
-
- Image($r('app.media.startImage_2D'))
- .width('100%')
- .height(Constants.IMAGE_2D_HEIGHT)
- .margin({ top: Constants.IMAGE_MARGIN})
-
- Column() {
- Text($r('app.string.enroll_face_guide_title'))
- .fontSize(Constants.SMALL_TITLE_FONT_SIZE)
- .fontWeight(Constants.FONT_WEIGHT)
- .textAlign(TextAlign.Center)
-
- Text($r('app.string.face_guide_2d_way'))
- .fontSize(Constants.FONT_SIZE)
- .fontColor($r('app.color.font_color'))
- .textAlign(TextAlign.Center)
- .margin({ top: Constants.CONTENT1_MARGIN })
-
- Text() {
- Span($r('app.string.face_guide_2d_announce'))
- .fontColor($r('app.color.font_color'))
- .textCase(TextCase.UpperCase)
- .fontSize(Constants.FONT_SIZE)
- Span($r('app.string.face_guide_2d_announce_link'))
- .textCase(TextCase.UpperCase)
- .fontSize(Constants.FONT_SIZE)
- .fontColor($r('app.color.startView_color'))
- }.margin({ top: Constants.CONTENT2_MARGIN })
- .textAlign(TextAlign.Center)
- .onClick(() => {
- routeDeclare()
- })
-
- }.width(Constants.ENROLL_INFO_WIDTH)
- .margin({ top: Constants.IMAGE_MARGIN })
-
- Flex() {
- Toggle({ type: ToggleType.Checkbox, isOn: true })
- .size({ width: Constants.CHECKBOX_SIZE, height: Constants.CHECKBOX_SIZE })
- .selectedColor(this.checkbox_color)
- .onChange((isOn: boolean) => {console.info('Component status:' + isOn)
- })
- }.position({x:Constants.CHECKBOX_POSITION_X,y:Constants.CHECKBOX_POSITION_Y})
-
- Text($r('app.string.face_2dguide_light_notify_universal'))
- .fontSize(Constants.FONT_SIZE)
- .fontColor(Color.Black)
- .position({x:Constants.CHECKBOX_TEXT_POSITION_X,y:Constants.CHECKBOX_TEXT_POSITION_Y})
-
- Flex({justifyContent:FlexAlign.Center}) {
- Button({ type: ButtonType.Capsule, stateEffect: true }) {
- Text($r('app.string.face_record')).fontSize(Constants.BUTTON_FONT_SIZE).fontColor(0xffffff)
- }
- .backgroundColor($r('app.color.startView_color')).width(Constants.BUTTON_WIDTH).height(Constants.BUTTON_HEIGHT)
- .onClick(() => {
- this.pageHideFlag = 1;
- mFaceModel.openSession(this.openSessionCallBack.bind(this));
- })
- }.position({ x:$r('app.float.enroll_center_position_X'), y: Constants.BUTTON_POSITION})
- }
- .width('100%')
- .height('100%')
- }
-}
\ No newline at end of file
diff --git a/ui/faceenroll/product/pad/src/main/ets/default/pages/startViews_3D.ets b/ui/faceenroll/product/pad/src/main/ets/default/pages/startViews_3D.ets
deleted file mode 100644
index 05d6cca..0000000
--- a/ui/faceenroll/product/pad/src/main/ets/default/pages/startViews_3D.ets
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * 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 Constants from '../common/constant.ets';
-import mFaceModel from "../model_3D.ets";
-
-async function routeEnroll_3D() {
- let options = {
- uri: 'pages/enroll_3D'
- }
- try {
- await router.push(options);
- } catch (err) {
- console.error(`fail callback, code: ${err.code}, msg: ${err.msg}`);
- }
-}
-async function routeDeclare() {
- let options = {
- uri: 'pages/declare'
- }
- try {
- await router.push(options);
- } catch (err) {
- console.error(`fail callback, code: ${err.code}, msg: ${err.msg}`);
- }
-}
-
-
-@Entry
-@Component
-
-export default
-
-struct StartViews_3D {
- @StorageLink('checkbox_color') checkbox_color : any = $r('app.color.startView_color');
- private pageHideFlag: number = 0;
-
- public openSessionCallBack() {
- routeEnroll_3D();
- }
-
- private onPageHide(): void {
- if (this.pageHideFlag == 0) {
- router.push({
- uri: 'pages/entryView'
- })
- }
- }
-
- private onBackPress(): void{
- console.info("FaceEnroll StartViews_3D onBackPress start");
- AppStorage.Delete('faceToken');
- router.push({
- uri: 'pages/entryView',
- })
- console.info("FaceEnroll StartViews_3D onBackPress end");
- }
- build() {
- Flex({ direction: FlexDirection.Column,alignItems: ItemAlign.Center}) {
-
- Flex() {
- Image($r('app.media.back'))
- .width(Constants.BACK_WIDTH)
- .height(Constants.BACK_HEIGHT)
- .onClick(()=>{
- })
- }.margin({ top: $r('app.float.back_margin') })
- .width('100%')
-
- Text($r('app.string.face_checker'))
- .fontSize(Constants.TITLE_FONT_SIZE)
- .fontWeight(FontWeight.Bold)
- .margin({ top: Constants.TITLE_MARGIN })
-
- Stack(){
- Image($r('app.media.startImage1_3D'))
- .width(Constants.IMAGE_3D_WIDTH)
- .height(Constants.IMAGE_3D_WIDTH)
-
- Image($r('app.media.startImage2_3D'))
- .width(Constants.IMAGE_3D_WIDTH)
- .height(Constants.IMAGE_3D_WIDTH)
-
- }.margin({top:Constants.IMAGE_3D_MARGIN})
- .width('100%')
- .height(Constants.IMAGE_3D_WIDTH)
-
- Column() {
- Text($r('app.string.enroll_face_guide_title'))
- .fontSize(Constants.SMALL_TITLE_FONT_SIZE)
- .fontWeight(Constants.FONT_WEIGHT)
- .textAlign(TextAlign.Center)
-
- Text($r('app.string.face_guide_3d_way'))
- .fontSize(Constants.FONT_SIZE)
- .fontColor($r('app.color.font_color'))
- .textAlign(TextAlign.Center)
- .margin({ top: Constants.CONTENT1_MARGIN })
-
- Text() {
- Span($r('app.string.face_guide_3d_announce'))
- .fontColor($r('app.color.font_color'))
- .textCase(TextCase.UpperCase)
- .fontSize(Constants.FONT_SIZE)
- Span($r('app.string.face_guide_3d_announce_link'))
- .textCase(TextCase.UpperCase)
- .fontSize(Constants.FONT_SIZE)
- .fontColor($r('app.color.startView_color'))
- }
- .margin({ top: Constants.CONTENT2_MARGIN })
- .textAlign(TextAlign.Center)
- .onClick(() => {
- routeDeclare()
- })
- }.width(Constants.ENROLL_INFO_WIDTH)
- .margin({ top: Constants.IMAGE_MARGIN })
-
- Flex() {
- Toggle({ type: ToggleType.Checkbox, isOn: true })
- .size({ width: Constants.CHECKBOX_SIZE, height: Constants.CHECKBOX_SIZE })
- .selectedColor(this.checkbox_color)
- .onChange((isOn: boolean) => {
- console.info('Component status:' + isOn)
- })
- }.position({x:Constants.CHECKBOX_POSITION_X,y:Constants.CHECKBOX_POSITION_Y})
-
- Text($r('app.string.face_2dguide_light_notify_universal'))
- .fontSize(Constants.FONT_SIZE)
- .fontColor(Color.Black)
- .position({x:Constants.CHECKBOX_TEXT_POSITION_X,y:Constants.CHECKBOX_TEXT_POSITION_Y})
-
- Flex({justifyContent:FlexAlign.Center}) {
- Button({ type: ButtonType.Capsule, stateEffect: true }) {
- Text($r('app.string.face_recognitin_guide')).fontSize(Constants.BUTTON_FONT_SIZE).fontColor(0xffffff)
- }
- .backgroundColor($r('app.color.startView_color')) .width(Constants.BUTTON_WIDTH).height(Constants.BUTTON_HEIGHT)
- .onClick(() => {
- this.pageHideFlag = 1;
- mFaceModel.openSession(this.openSessionCallBack.bind(this));
- })
- }.position({ x:$r('app.float.enroll_center_position_X'), y: Constants.BUTTON_POSITION})
- }
- .width('100%')
- .height('100%')
- }
-}
\ No newline at end of file
diff --git a/ui/faceenroll/product/pad/src/main/ets/default/pages/success.ets b/ui/faceenroll/product/pad/src/main/ets/default/pages/success.ets
deleted file mode 100644
index 9a061bb..0000000
--- a/ui/faceenroll/product/pad/src/main/ets/default/pages/success.ets
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * 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 Constants from '../common/constant.ets';
-
-async function routeCase() {
- let options = {
- uri: 'pages/entryView'
- }
- try {
- await router.push(options);
- } catch (err) {
- console.error(`fail callback, code: ${err.code}, msg: ${err.msg}`);
- }
-}
-
-@Entry
-@Component
-struct Success {
-
- onPageShow(){
- setTimeout(()=>{
- router.push({
- uri: 'pages/userAuth'
- })
- },Constants.TIMEOUT_2000)
- }
- private onBackPress(): void{
- console.info("FaceEnroll Success onBackPress start");
- AppStorage.Delete('faceToken');
- router.push({
- uri: 'pages/entryView',
- })
- console.info("FaceEnroll Success onBackPress end");
- }
-
-
- build() {
- Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center }) {
- Flex() {
- Image($r('app.media.back'))
- .width(Constants.BACK_WIDTH)
- .height(Constants.BACK_HEIGHT)
- }.margin({ top: $r('app.float.back_margin') })
- .onClick(()=>{
- routeCase()
- })
-
- Text($r('app.string.face_record_success'))
- .fontSize(Constants.TITLE_FONT_SIZE)
- .fontWeight(FontWeight.Bold)
- .margin({ top: Constants.TITLE_MARGIN})
-
- Flex({ alignItems: ItemAlign.Center , justifyContent:FlexAlign.Center}){
- Image($r('app.media.success'))
- .width(Constants.SUCCESS_WIDTH)
- .height(Constants.SUCCESS_WIDTH)
- }.width('100%')
- .height(Constants.SUCCESS_WIDTH)
- .margin({ top: $r('app.float.success_margin') })
- }
- .width('100%')
- .height('100%')
- }
-}
\ No newline at end of file
diff --git a/ui/faceenroll/product/pad/src/main/ets/default/pages/userAuth.ets b/ui/faceenroll/product/pad/src/main/ets/default/pages/userAuth.ets
deleted file mode 100644
index 18be409..0000000
--- a/ui/faceenroll/product/pad/src/main/ets/default/pages/userAuth.ets
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * 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 userAuthModel from '../../../../../../../common/src/main/ets/default/common/model/userAuthModel.ets';
-
-@Entry
-@Component
-struct userAuth {
- @State authLength: number = 0;
- @State userMode: string = '';
- private mUserAuthModel: userAuthModel;
- private faceInfo ;
- @State faceToken: string = '';
- @State getAllCallback: boolean = false;
-
- private aboutToAppear(): void {
- this.mUserAuthModel = userAuthModel.getInstance();
- this.faceToken = AppStorage.Get('faceToken');
- if (this.mUserAuthModel != undefined) {
- this.mUserAuthModel.getUserAuthInfo(this.getAuthInfoCallback.bind(this),this.getUserMode.bind(this));
- }
- }
-
- public getUserMode() {
- this.mUserAuthModel.getUserMode(this.getUserModeCallback.bind(this));
- }
-
- onPageShow() {
- if (this.faceToken == '' || this.faceToken == undefined) {
- router.push({
- uri: 'pages/entryView',
- })
- }
- }
-
- public getAuthInfoCallback(authInfo,getUserMode) {
- this.faceInfo = authInfo;
- this.authLength = authInfo.length;
- AppStorage.SetOrCreate('authLength',this.authLength);
- AppStorage.SetOrCreate('faceInfo',this.faceInfo);
- AppStorage.SetOrCreate('facePageFlag',0);
- getUserMode();
- }
-
- public getUserModeCallback(userMode) {
- this.userMode = userMode;
- AppStorage.SetOrCreate('userMode',this.userMode);
- this.getAllCallback = true;
-
- }
-
- build() {
- Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
- if (this.getAllCallback) {
- getRouter({
- authLength: this.authLength
- })
-
- }
- }
- }
-}
-
-@Component
-struct getRouter{
- @Prop authLength: number;
- public aboutToAppear() {
- if (this.authLength == 0) {
- router.push({
- uri: 'pages/index',
- })
- }else if(this.authLength > 0) {
- router.push({
- uri: 'pages/userSettings',
- })
- }
- }
-
- build() {
- Column() {}
- }
-}
\ No newline at end of file
diff --git a/ui/faceenroll/product/pad/src/main/ets/default/pages/userSettings.ets b/ui/faceenroll/product/pad/src/main/ets/default/pages/userSettings.ets
deleted file mode 100644
index 3bc87a7..0000000
--- a/ui/faceenroll/product/pad/src/main/ets/default/pages/userSettings.ets
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * 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 faceSettings from '../../../../../../../feature/faceSettingsPad/src/main/ets/default/pages/index.ets'
-import TrustedDevices from '../../../../../../../feature/trustedDevicePad/src/main/ets/default/pages/index.ets'
-import router from '@system.router';
-
-@Entry
-@Component
-struct userSettings {
- @State authLength: number = 1;
- @State userMode: string = '';
- @StorageLink('facePageFlag') facePageFlag: number = 0;
- private faceInfo;
- private faceToken;
-
- private aboutToAppear(): void {
- this.faceInfo = AppStorage.Get('faceInfo');
- this.authLength = AppStorage.Get('authLength');
- this.userMode = AppStorage.Get('userMode');
- }
-
- private onPageHide(): void {
- router.push({
- uri: 'pages/entryView'
- })
- }
- private onBackPress(): void{
- AppStorage.Delete('faceToken');
- router.push({
- uri: 'pages/entryView',
- })
- }
-
- build() {
- Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
- if(this.authLength != 0) {
- if (this.facePageFlag == 0) {
- faceSettings({
- faceLength: this.authLength,
- userMode: this.userMode
- });
- }else if(this.facePageFlag == 1) {
- TrustedDevices();
- }
- }
- }
- .width('100%')
- .height('100%')
- .backgroundColor('#F2F3F5')
- }
-}
\ No newline at end of file
diff --git a/ui/faceenroll/product/pad/src/main/resources/base/element/color.json b/ui/faceenroll/product/pad/src/main/resources/base/element/color.json
deleted file mode 100644
index c7bec91..0000000
--- a/ui/faceenroll/product/pad/src/main/resources/base/element/color.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "color": [
- {
- "name": "font_color",
- "value": "#99000000"
- },
- {
- "name": "startView_color",
- "value": "#0A59F7"
- },
- {
- "name": "newBtn_color",
- "value": "#efefef"
- }
-
-
- ]
-}
\ No newline at end of file
diff --git a/ui/faceenroll/product/pad/src/main/resources/base/element/float.json b/ui/faceenroll/product/pad/src/main/resources/base/element/float.json
deleted file mode 100644
index 4863bec..0000000
--- a/ui/faceenroll/product/pad/src/main/resources/base/element/float.json
+++ /dev/null
@@ -1,70 +0,0 @@
-{
- "float": [
-
- {
- "name": "back_margin",
- "value": "5"
- },
- {
- "name": "enroll_title_position_X",
- "value": "0"
- },
- {
- "name": "startImage_3D_width",
- "value": "256"
- },
-
- {
- "name": "checkbox_size",
- "value": "25"
- },
- {
- "name": "enroll_center_position_X",
- "value": "0"
- },
- {
- "name": "enroll_info_X",
- "value": "20"
- },
- {
- "name": "progress_width",
- "value": "230"
- },
- {
- "name": "progress_value_start",
- "value": "0"
- },
- {
- "name": "blur_start",
- "value": "0"
- },
- {
- "name": "blur_end",
- "value": "40"
- },
- {
- "name": "aperture1_width",
- "value": "133"
- },
- {
- "name": "aperture2_width",
- "value": "132"
- },
- {
- "name": "aperture34_width",
- "value": "142"
- },
- {
- "name": "aperture5_width",
- "value": "233"
- },
- {
- "name": "success_image",
- "value": "102"
- },
- {
- "name": "success_margin",
- "value": "100"
- }
- ]
-}
\ No newline at end of file
diff --git a/ui/faceenroll/product/pad/src/main/resources/base/element/string.json b/ui/faceenroll/product/pad/src/main/resources/base/element/string.json
deleted file mode 100644
index 3f4e5c8..0000000
--- a/ui/faceenroll/product/pad/src/main/resources/base/element/string.json
+++ /dev/null
@@ -1,792 +0,0 @@
-{
- "string": [
- {
- "name": "app_name",
- "value": "faceEnroll"
- },
- {
- "name": "mainability_description",
- "value": "JS_Phone_Empty Feature Ability"
- },
- {
- "name": "description_product",
- "value": "ETS_Empty Ability"
- },
- {
- "name": "entry_product",
- "value": "entry_product"
- },
- {
- "name": "enrolling",
- "value": "正在录入"
- },
- {
- "name": "enrolling_fail",
- "value": "录入失败"
- },
- {
- "name": "enrolling_timeout",
- "value": "录入超时"
- },
- {
- "name": "declare",
- "value": "声明"
- },
- {
- "name": "declare_content",
- "value": "如果您选择添加人脸数据,在亮屏状态,您将可以通过正面注视手机屏幕瞬间解锁。人脸数据储存在您的设备,而且不会通过云服务或者其他工具备份他处。"
- },
- {
- "name": "open_clock",
- "value": "打开”拿起手机亮屏“,提升解锁体验"
- },
- {
- "name": "face_enroll",
- "value": "人脸识别"
- },
- {
- "name": "enroll_success",
- "value": "录入成功"
- },
- {
- "name": "start_title",
- "value": "如何录入面部数据"
- },
- {
- "name": "start_2D_content1",
- "value": "首先,确保摄像头清洁、面部无遮挡,录入环境光线充足、无阳光直射。然后,正对屏幕,将面部完整移入识别区。"
- },
- {
- "name": "start_2D_content2",
- "value": "人脸识别可用于解锁屏幕及访问应用锁。点击“开始录入”即表示您同意"
- },
- {
- "name": "start_2D_content3",
- "value": "关于人脸识别的声明。"
- },
- {
- "name": "start_3D_content1",
- "value": "首先,请确保您的面部全部显示在识别区内。然后注视屏幕并缓缓转动头部以完成全方位采集。"
- },
- {
- "name": "start_3D_content2",
- "value": "人脸识别可用于解锁屏幕,访问应用锁、保密柜及支付。点击“开始录入”即表示您同意"
- },
- {
- "name": "start_3D_content3",
- "value": "关于3D人脸识别的声明。"
- },
- {
- "name": "button_content",
- "value": "开始录入"
- },
- {
- "name": "enroll_info_fail",
- "value": "请确保摄像头清洁,面部无遮挡,在光线充足、无阳光直射的环境里录入。"
- },
- {
- "name": "enroll_info",
- "value": "请保持不动"
- },
- {
- "name": "enroll_info_cancel",
- "value": "被取消"
- },
- {
- "name": "enroll_info_algorithm_not_init",
- "value": "算法未初始化"
- },
- {
- "name": "enroll_info_hal_invalid",
- "value": "人脸识别demon不可用"
- },
- {
- "name": "enroll_info_over_max_faces",
- "value": "录入超过最大上限"
- },
- {
- "name": "enroll_info_invalid_parameters",
- "value": "入参无效"
- },
- {
- "name": "enroll_info_busy",
- "value": "人脸流程正在进行中,请求busy"
- },
- {
- "name": "enroll_info_has_registered",
- "value": "当前人脸已经录入过"
- },
- {
- "name": "enroll_info_bad_quality",
- "value": "图像质量太差"
- },
- {
- "name": "enroll_info_not_found",
- "value": "没检测到人脸"
- },
- {
- "name": "enroll_info_scale_too_small",
- "value": "人脸太小"
- },
- {
- "name": "enroll_info_scale_too_large",
- "value": "人脸太大"
- },
- {
- "name": "enroll_info_offset_left",
- "value": "人脸太靠左"
- },
- {
- "name": "enroll_info_offset_top",
- "value": "人脸太靠上"
- },
- {
- "name": "enroll_info_offset_right",
- "value": "人脸太靠右"
- },
- {
- "name": "enroll_info_offset_bottom",
- "value": "人脸太靠下"
- },
- {
- "name": "enroll_info_liveness_warning",
- "value": "活体检测有风险"
- },
- {
- "name": "enroll_info_liveness_failure",
- "value": "活体检测失败"
- },
- {
- "name": "enroll_info_rotated_left",
- "value": "头向左转的角度太大"
- },
- {
- "name": "enroll_info_rise",
- "value": "头抬的角度太高"
- },
- {
- "name": "enroll_info_face_has_registered",
- "value": "转动头部"
- },
- {
- "name": "enroll_info_rotated_right",
- "value": "头向右转的角度太大"
- },
- {
- "name": "enroll_info_down",
- "value": "头抬的角度太低"
- },
- {
- "name": "enroll_info_eye_occlusion",
- "value": "眼睛不清晰"
- },
- {
- "name": "enroll_info_eye_close",
- "value": "闭眼"
- },
- {
- "name": "enroll_info_mouth_occlusion",
- "value": "嘴巴不清晰"
- },
- {
- "name": "enroll_info_mutlify",
- "value": "出现多张脸"
- },
- {
- "name": "enroll_info_blur",
- "value": "脸不清晰"
- },
- {
- "name": "enroll_info_not_complete",
- "value": "脸不完整"
- },
- {
- "name": "enroll_info_darklight",
- "value": "光线太暗"
- },
- {
- "name": "enroll_info_highlight",
- "value": "光线太强"
- },
- {
- "name": "enroll_info_half_shadow",
- "value": "阴阳脸"
- },
- {
- "name": "enroll_info_darkpic",
- "value": "图片太暗"
- },
- {
- "name": "enroll_info_rotate_top_right",
- "value": "人脸头顶朝右"
- },
- {
- "name": "enroll_info_rotate_top_left",
- "value": "人脸头顶朝左"
- },
- {
- "name": "enroll_info_rotate_bottom_right",
- "value": "人脸下巴朝右"
- },
- {
- "name": "enroll_info_rotate_bottom_left",
- "value": "人脸下巴朝左"
- },
- {
- "name": "enroll_info_open_camera_failed",
- "value": "打开Camera失败"
- },
- {
- "name": "enroll_button_content",
- "value": "重新录入"
- },
- {
- "name": "deleteTitle",
- "value": "删除数据"
- } ,{
- "name": "face_introdution_title",
- "value": "解锁时需连接可信设备"
- },
- {
- "name": "face_introdution_tip",
- "value": "进行人脸识别解锁手机时,需连接可信设备以进一步提升安全性。"
- },
- {
- "name": "trusted_devices_title",
- "value": "可信设备"
- },
- {
- "name": "face_introdution_button",
- "value": "添加可信设备"
- },
- {
- "name": "connect_tip",
- "value": "已连接"
- },
- {
- "name": "disconnect_tip",
- "value": "未连接"
- },
- {
- "name": "cancel_button",
- "value": "取消"
- },
- {
- "name": "remove_device_button",
- "value": "移除"
- },
- {
- "name": "add_device_button",
- "value": "添加"
- },
- {
- "name": "remove_device_tip",
- "value": "移除后,人脸识别解锁本机时将不再需要连接可信设备。是否移除?"
- },
- {
- "name": "remove_device_title",
- "value": "移除可信设备"
- },
- {
- "name": "add_device_or_not_tip",
- "value": "是否添加"
- },
- {
- "name": "using_tips",
- "value": "使用提示"
- },
- {
- "name": "add_device_tip",
- "value": "添加后,当可信设备与本机断开连接时,将无法使用人脸识别解锁。您可以使用其他方式解锁。"
- }
-
-
- ,
- {
- "name": "face_guide_2d_announce_link",
- "value": "关于人脸识别的声明"
- },
- {
- "name": "face_feature_desc",
- "value": "功能介绍"
- },
- {
- "name": "face_recognize_annouce_message_01",
- "value": "人脸识别是一种基于人的脸部特征信息进行身份识别的生物识别技术。它通过手机前置摄像头捕捉人脸面部数据,进而快速完成面部特征比对和身份认证。可用于解锁屏幕、访问应用锁等场景。"
- },
- {
- "name": "face_recognize_annouce_message_02",
- "value": "录入面部数据时,需注意以下事项:"
- },
- {
- "name": "face_recognize_annouce_message_03",
- "value": "1.确保摄像头清洁;"
- },
- {
- "name": "face_recognize_annouce_message_04",
- "value": "2.在光线充足的环境下录入,但需避免强光直射;"
- },
- {
- "name": "face_recognize_annouce_message_05",
- "value": "3.勿用衣帽、头发、墨镜、口罩、浓妆等遮挡面部;"
- },
- {
- "name": "face_recognize_annouce_message_06",
- "value": "4.确保面部正面完整清晰地出现在提示框内,不要闭眼、大幅度仰头或低头"
- },
- {
- "name": "face_recognize_annouce_message_07",
- "value": "5.避免其他人出现在录入画面中。"
- },
- {
- "name": "face_recognize_annouce_message_08",
- "value": "任何技术都存在一定局限和风险,使用人脸识别时,需注意以下事项:"
- },
- {
- "name": "face_recognize_annouce_message_09",
- "value": "1.在暗光、强光、逆光或角度过大等场景下,人脸识别的成功率会有所降低;"
- },
- {
- "name": "face_annouce_tip1_item2_3d",
- "value": "2.人脸识别的安全性低于图案密码、数字密码、混合密码。;"
- },
- {
- "name": "face_recognize_annouce_message_10",
- "value": "您的设备可能会被容貌、外形与您相近的人或物品解锁;"
- },
- {
- "name": "face_recognize_annouce_message_11",
- "value": "请勿将设备随意交给他人使用,避免人脸识别功能被恶意利用;"
- },
- {
- "name": "face_recognize_annouce_message_12",
- "value": "除以上事项外,您还需注意其他可能影响人脸识别功能正常使用的情况。"
- },
- {
- "name": "face_recognize_annouce_message_13",
- "value": "隐私声明"
- },
- {
- "name": "face_recognize_annouce_message_14_1",
- "value": "您的"
- },
- {
- "name": "face_recognize_annouce_message_14_2",
- "value": "将受到严格保护。该数据仅加密保存于本设备的安全隔离区域,华为不会进行备份,其他应用也无法访问或备份。例如,您使用人脸识别进行应用内认证时,应用仅能收到认证是否成功的通知,而无法访问、备份或录入"
- },
- {
- "name": "face_recognize_annouce_message_14_3",
- "value": "面部数据。"
- },
- {
- "name": "face_recognize_annouce_message_15_1",
- "value": "您拥有人脸识别的自主控制权,可灵活控制人脸识别的使用及适用范围。例如,您不想使用人脸识别访问应用锁,在“设置”中将其关闭即可,此时人脸识别仍可用于其他操作,但不可用于进入应用锁。您还可彻底删除"
- },
- {
- "name": "face_recognize_annouce_message_15_2",
- "value": "删除后本设备将不再保存这些数据。"
- },
-
- {
- "name": "face_recognize_annouce_message_15_3",
- "value": ""
- },
- {
- "name": "face_recognize_annouce_message_15_4",
- "value": ""
- },
- {
- "name": "face_guide_3d_announce_link",
- "value": "关于3D人脸识别的声明"
- },
- {
- "name": "face_3drecognize_annouce_message_01",
- "value": "3D人脸识别是新一代人脸识别技术。它通过深度感应技术,捕捉更丰富的面部数据,实现三维立体防伪识别。在暗光、逆光、无光等环境下,也可用于解锁屏幕,访问应用锁、保密柜及支付,其安全性、准确率和环境适应性较传统人脸识别技术大幅提升。"
- }
-
-
-
- ,
- {
- "name": "face_recognition",
- "value": "人脸识别"
- },
- {
- "name": "face_recognition_is_used",
- "value": "人脸识别用于"
- },
- {
- "name": "unlock_screen",
- "value": "解锁屏幕"
- },
- {
- "name": "slide_to_unlock",
- "value": "滑动解锁"
- },
- {
- "name": "smart_display_lock_screen_notification",
- "value": "智能显示锁屏通知"
- },
- {
- "name": "access_safe",
- "value": "访问保密柜"
- },
- {
- "name": "access_app_lock",
- "value": "访问应用锁"
- },
- {
- "name": "automatically_fill_in_account",
- "value": "自动填充账号和密码"
- },
- {
- "name": "use_password_safe_to_save_account",
- "value": "使用密码保险箱保存账号和密码"
- },
- {
- "name": "delete_face_data",
- "value": "删除面部数据"
- },
- {
- "name": "set_backup_face",
- "value": "设置备用面容"
- },
- {
- "name": "recognize_another_face",
- "value": "除继续学习您的长相外,还可识别另一种面容"
- },
- {
- "name": "main_and_backup_faces",
- "value": "已设置主用及备用面容"
- },
- {
- "name": "trusted_device_be_connected_when_unlocking",
- "value": "解锁时需连接可信设备"
- },
- {
- "name": "closed",
- "value": "已关闭"
- },
- {
- "name": "look_at_screen_during_face_recognition",
- "value": "人脸识别时需注视屏幕"
- },
- {
- "name": "fill_light",
- "value": "暗光环境下屏幕补光"
- },
- {
- "name": "auxiliary_mode",
- "value": "辅助模式"
- },
- {
- "name": "recognize_without_opening_eyes",
- "value": "开启屏幕朗读后无需睁眼即可识别"
- },
- {
- "name": "be_based_on_facial_feature_information",
- "value": "人脸识别可基于您的面部特征信息进行身份识别,了解"
- },
- {
- "name": "statement_on_face_recognition",
- "value": "关于人脸识别的声明。"
- },
- {
- "name": "statement3D_on_face_recognition",
- "value": "关于3D人脸识别的声明。"
- },
- {
- "name": "looking_for_other_settings",
- "value": "是否在寻找其设置项?"
- },
- {
- "name": "pick_up_phone_turn_on_screen",
- "value": "拿起手机亮屏"
- },
- {
- "name": "annotation_screen_keeps_on",
- "value": "注视屏幕不息屏"
- },
- {
- "name": "unlock_directly",
- "value": "直接解锁"
- },
- {
- "name": "unlock_directly_after_successful_face_recognition",
- "value": "人脸识别成功后直接解锁"
- },
- {
- "name": "Slide_to_unlock_after_successful_face_recognition",
- "value": "人脸识别成功后滑动屏幕解锁"
- },
- {
- "name": "close",
- "value": "关闭"
- },
- {
- "name": "enable",
- "value": "启用"
- },
- {
- "name": "activate_safe",
- "value": "启动保密柜"
- },
- {
- "name": "whether_to_enable_safe",
- "value": "需开启应用文件管理保密柜完成人脸关联。是否启用?"
- },
-
- {
- "name": "activate_app_lock",
- "value": "启动应用锁"
- },
- {
- "name": "Whether_to_activate_app_lock",
- "value": "需开启应用锁功能才能完成人脸关联。是否立即启动应用锁?"
- },
- {
- "name": "delete_all_face_data",
- "value": "删除主用及备用面容"
- },
- {
- "name": "wether_delete_face_data",
- "value": "删除后,基于面部数据的功能将不可用。是否删除?"
- },
- {
- "name": "pick_up_phone",
- "value": "同时关闭拿起手机亮屏"
- },
-
-
- {
- "name": "entry_MainAbility",
- "value": "entry_MainAbility"
- },
- {
- "name": "face_lists",
- "value": "面部列表"
- },
- {
- "name": "face_1",
- "value": "面部1"
- },
- {
- "name": "face",
- "value": "面部"
- },
- {
- "name": "new_face",
- "value": "新建面部数据"
- },
- {
- "name": "face_name",
- "value": "面部名称"
- },
- {
- "name": "delete_face",
- "value": "删除面部"
- },
- {
- "name": "save",
- "value": "保存"
- },
-
- {
- "name": "face_checker",
- "value": "人脸识别"
- },
-
- {
- "name": "face_unlock_method",
- "value": "解锁屏幕"
- },
- {
- "name": "face_recognize_slideunlock_title",
- "value": "滑动解锁"
- },
- {
- "name": "title_apps_security_pref",
- "value": "访问应用锁"
- },
- {
- "name": "title_fill_light",
- "value": "暗光环境下屏幕补光"
- },
- {
- "name": "recommend_preference_title",
- "value": "是否在寻找其他设置项?"
- },
- {
- "name": "face_config_light_01_universal",
- "value": "拿起手机亮屏"
- },
- {
- "name": "multiface_list_title",
- "value": "面部列表"
- },
- {
- "name": "multiface_default_face_name_1",
- "value": "面部 1"
- },
- {
- "name": "multiface_default_face_name",
- "value": "面部"
- },
- {
- "name": "multiface_enroll_new_face",
- "value": "新建面部数据"
- },
- {
- "name": "multiface_face_name_title",
- "value": "面部名称"
- },
-
- {
- "name": "multiface_save",
- "value": "保存"
- },
- {
- "name": "face_unlock_method_close",
- "value": "关闭"
- },
- {
- "name": "face_recognize_unlock_title",
- "value": "直接解锁"
- },
- {
- "name": "face_3dguide_info_2",
- "value": "人脸识别可基于您的面部特征信息进行身份识别,了解"
- },
-
- {
- "name": "face_inform_open_applock_msg",
- "value": "需开启应用锁功能才能完成人脸关联。是否立即启用应用锁?"
- },
- {
- "name": "face_record_cancel",
- "value": "取消"
- },
-
- {
- "name": "face_recognize_unlock_summary_3d",
- "value": "人脸识别成功后直接解锁"
- },
- {
- "name": "face_recognize_slideunlock_summary_3d",
- "value": "人脸识别成功后,滑动屏幕解锁"
- },
- {
- "name": "face_enterance_off",
- "value": "已关闭"
- },
- {
- "name": "open_bluetooth",
- "value": "使用此功能需先开启蓝牙,点击设置"
- },
- {
- "name": "no_available_devices_title",
- "value": "没有可添加的设备"
- },
- {
- "name": "no_available_devices_tip",
- "value": "没有检测到可添加的配对设备。是否前往蓝牙设置配对?"
- },
- {
- "name": "pair_button",
- "value": "去配对"
- },
- {
- "name": "face_fingerprint_settings_switch_title",
- "value": "自动填充账号和密码"
- },
- {
- "name": "face_fingerprint_settings_switch_summary",
- "value": "使用密码保险箱保存的帐号和密码"
- }
- ,
- {
- "name": "face_record",
- "value": "正在录入"
- },
- {
- "name": "face_record_3d_record_fail",
- "value": "录入失败"
- },
- {
- "name": "enroll_face_guide_title",
- "value": "如何录入面部数据"
- },
- {
- "name": "face_guide_2d_way",
- "value": "首先,确保摄像头清洁、面部无遮挡,录入环境光线充足、无阳光直射。然后,正对屏幕,将面部完整移入识别区。"
- },
- {
- "name": "face_guide_2d_announce",
- "value": "人脸识别可用于解锁屏幕及访问应用锁。点击“开始录入”即表示您同意"
- },
- {
- "name": "face_2dguide_light_notify_universal",
- "value": "打开”拿起手机亮屏“,提升解锁体验"
- },
- {
- "name": "face_guide_3d_way",
- "value": "首先,请确保您的面部全部显示在识别区内。然后注视屏幕并缓缓转动头部以完成全方位采集。"
- },
- {
- "name": "face_guide_3d_announce",
- "value": "人脸识别可用于解锁屏幕,访问应用锁、保密柜及支付。点击“开始录入”即表示您同意"
- },
- {
- "name": "face_recognitin_guide",
- "value": "开始录入"
- },
- {
- "name": "face_record_success",
- "value": "录入成功"
- },
- {
- "name": "face_record_3d_tip_close",
- "value": "人脸太小"
- },
- {
- "name": "face_record_3d_tip_far",
- "value": "人脸太大"
- },
- {
- "name": "face_enroll_too_left",
- "value": "人脸太靠左"
- },
- {
- "name": "face_enroll_too_high",
- "value": "人脸太靠上"
- },
- {
- "name": "face_enroll_too_right",
- "value": "人脸太靠右"
- },
- {
- "name": "face_enroll_too_low",
- "value": "人脸太靠下"
- },
- {
- "name": "face_record_3d_tip_multi",
- "value": "出现多张脸"
- },
- {
- "name": "face_rotate_too_left",
- "value": "头向左转的角度太大"
- },
- {
- "name": "face_rotate_too_high",
- "value": "头抬的角度太高"
- },
- {
- "name": "face_rotate_too_right",
- "value": "头向右转的角度太大"
- },
- {
- "name": "face_rotate_too_low",
- "value": "头抬的角度太低"
- }
- ]
-}
\ No newline at end of file
diff --git a/ui/faceenroll/product/pad/src/main/resources/base/media/aperture1.png b/ui/faceenroll/product/pad/src/main/resources/base/media/aperture1.png
deleted file mode 100644
index 697d7cc..0000000
Binary files a/ui/faceenroll/product/pad/src/main/resources/base/media/aperture1.png and /dev/null differ
diff --git a/ui/faceenroll/product/pad/src/main/resources/base/media/aperture2.png b/ui/faceenroll/product/pad/src/main/resources/base/media/aperture2.png
deleted file mode 100644
index 39ce11d..0000000
Binary files a/ui/faceenroll/product/pad/src/main/resources/base/media/aperture2.png and /dev/null differ
diff --git a/ui/faceenroll/product/pad/src/main/resources/base/media/aperture3.png b/ui/faceenroll/product/pad/src/main/resources/base/media/aperture3.png
deleted file mode 100644
index a827aab..0000000
Binary files a/ui/faceenroll/product/pad/src/main/resources/base/media/aperture3.png and /dev/null differ
diff --git a/ui/faceenroll/product/pad/src/main/resources/base/media/aperture4.png b/ui/faceenroll/product/pad/src/main/resources/base/media/aperture4.png
deleted file mode 100644
index 381693d..0000000
Binary files a/ui/faceenroll/product/pad/src/main/resources/base/media/aperture4.png and /dev/null differ
diff --git a/ui/faceenroll/product/pad/src/main/resources/base/media/aperture5.png b/ui/faceenroll/product/pad/src/main/resources/base/media/aperture5.png
deleted file mode 100644
index 4618da2..0000000
Binary files a/ui/faceenroll/product/pad/src/main/resources/base/media/aperture5.png and /dev/null differ
diff --git a/ui/faceenroll/product/pad/src/main/resources/base/media/back.png b/ui/faceenroll/product/pad/src/main/resources/base/media/back.png
deleted file mode 100644
index 85dcc6a..0000000
Binary files a/ui/faceenroll/product/pad/src/main/resources/base/media/back.png and /dev/null differ
diff --git a/ui/faceenroll/product/pad/src/main/resources/base/media/iPad.png b/ui/faceenroll/product/pad/src/main/resources/base/media/iPad.png
deleted file mode 100644
index d48706b..0000000
Binary files a/ui/faceenroll/product/pad/src/main/resources/base/media/iPad.png and /dev/null differ
diff --git a/ui/faceenroll/product/pad/src/main/resources/base/media/ic_settings_arrow.svg b/ui/faceenroll/product/pad/src/main/resources/base/media/ic_settings_arrow.svg
deleted file mode 100644
index d7dd265..0000000
--- a/ui/faceenroll/product/pad/src/main/resources/base/media/ic_settings_arrow.svg
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
diff --git a/ui/faceenroll/product/pad/src/main/resources/base/media/icon.png b/ui/faceenroll/product/pad/src/main/resources/base/media/icon.png
deleted file mode 100644
index ce307a8..0000000
Binary files a/ui/faceenroll/product/pad/src/main/resources/base/media/icon.png and /dev/null differ
diff --git a/ui/faceenroll/product/pad/src/main/resources/base/media/image.jpg b/ui/faceenroll/product/pad/src/main/resources/base/media/image.jpg
deleted file mode 100644
index 86fc073..0000000
Binary files a/ui/faceenroll/product/pad/src/main/resources/base/media/image.jpg and /dev/null differ
diff --git a/ui/faceenroll/product/pad/src/main/resources/base/media/into_arrow.svg b/ui/faceenroll/product/pad/src/main/resources/base/media/into_arrow.svg
deleted file mode 100644
index af9aaad..0000000
--- a/ui/faceenroll/product/pad/src/main/resources/base/media/into_arrow.svg
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/ui/faceenroll/product/pad/src/main/resources/base/media/pad.png b/ui/faceenroll/product/pad/src/main/resources/base/media/pad.png
deleted file mode 100644
index d214758..0000000
Binary files a/ui/faceenroll/product/pad/src/main/resources/base/media/pad.png and /dev/null differ
diff --git a/ui/faceenroll/product/pad/src/main/resources/base/media/phone.svg b/ui/faceenroll/product/pad/src/main/resources/base/media/phone.svg
deleted file mode 100644
index b81e4e3..0000000
--- a/ui/faceenroll/product/pad/src/main/resources/base/media/phone.svg
+++ /dev/null
@@ -1,22 +0,0 @@
-
\ No newline at end of file
diff --git a/ui/faceenroll/product/pad/src/main/resources/base/media/startImage1_3D.png b/ui/faceenroll/product/pad/src/main/resources/base/media/startImage1_3D.png
deleted file mode 100644
index aa04ba1..0000000
Binary files a/ui/faceenroll/product/pad/src/main/resources/base/media/startImage1_3D.png and /dev/null differ
diff --git a/ui/faceenroll/product/pad/src/main/resources/base/media/startImage2_3D.png b/ui/faceenroll/product/pad/src/main/resources/base/media/startImage2_3D.png
deleted file mode 100644
index cd40d2e..0000000
Binary files a/ui/faceenroll/product/pad/src/main/resources/base/media/startImage2_3D.png and /dev/null differ
diff --git a/ui/faceenroll/product/pad/src/main/resources/en_AS/element/string.json b/ui/faceenroll/product/pad/src/main/resources/en_AS/element/string.json
deleted file mode 100644
index 1111b15..0000000
--- a/ui/faceenroll/product/pad/src/main/resources/en_AS/element/string.json
+++ /dev/null
@@ -1,562 +0,0 @@
-{
- "string": [
- {
- "name": "app_name",
- "value": "faceEnroll"
- },
- {
- "name": "mainability_description",
- "value": "JS_Phone_Empty Feature Ability"
- },
- {
- "name": "deleteTitle",
- "value": "delete"
- },
- {
- "name": "face_fingerprint_settings_switch_title",
- "value": "Autofill usernames and passwords"
- },
- {
- "name": "face_fingerprint_settings_switch_summary",
- "value": "Usernames and passwords are accessed from Password Vault."
- },
- {
- "name": "face_guide_2d_announce_link",
- "value": "Statement About Face Recognition"
- },
- {
- "name": "face_feature_desc",
- "value": "Feature description"
- },
- {
- "name": "face_recognize_annouce_message_01",
- "value": "Face Recognition is a biometric identification technology that allows your phone to recognize the features of your face. It uses the front camera to capture facial data, and then compares it to pre-stored data to quickly verify your identity. You can use this feature to unlock your device, open locked apps, and more."
- },
- {
- "name": "face_recognize_annouce_message_02",
- "value": "Please note the following when setting up this feature:"
- },
- {
- "name": "face_recognize_annouce_message_03",
- "value": "1.Make sure that the camera lens is clean."
- },
- {
- "name": "face_recognize_annouce_message_04",
- "value": "2.Scan your face in a well-lit environment, avoiding direct sunlight.;"
- },
- {
- "name": "face_recognize_annouce_message_05",
- "value": "3.Avoid covering your face with items of clothing, hair, sunglasses, masks, or thick makeup."
- },
- {
- "name": "face_recognize_annouce_message_06",
- "value": "4.Make sure your face is completely displayed in the frame. Look straight at the camera, and avoid raising and lowering your head or closing your eyes."
- },
- {
- "name": "face_recognize_annouce_message_07",
- "value": "5.Make sure that no one else appears in the frame."
- },
- {
- "name": "face_recognize_annouce_message_08",
- "value": "Please note the following when using Face Recognition:"
- },
- {
- "name": "face_recognize_annouce_message_09",
- "value": "1.Face Recognition may not work as well in dim, very bright, or backlit environments, or if the angle between your face and the camera is too great."
- },
- {
- "name": "face_annouce_tip1_item2_3d",
- "value": "2.Face Recognition is less secure than other unlock methods such as Pattern, PIN, and Password."
- },
- {
- "name": "face_recognize_annouce_message_10",
- "value": "There is a small chance that your device may be unlocked by people that closely resemble you or by objects that represent close depictions of your likeness."
- },
- {
- "name": "face_recognize_annouce_message_11",
- "value": "To prevent Face Recognition from being used without your consent, please exercise caution before allowing other people to use your device."
- },
- {
- "name": "face_recognize_annouce_message_12",
- "value": "The functionality of Face Recognition may also be affected in scenarios other than those described above."
- },
- {
- "name": "face_recognize_annouce_message_13",
- "value": "Privacy Statement"
- },
- {
- "name": "face_recognize_annouce_message_14_1",
- "value": "Your"
- },
- {
- "name": "face_recognize_annouce_message_14_2",
- "value": "is rigorously protected. This data is encrypted and stored in an isolated zone on your device, where it will not be copied by Huawei, and cannot be copied or accessed by any app. When you use Face Recognition in an app, the app is only informed whether or not verification is successful, and cannot access your actual"
- },
- {
- "name": "face_recognize_annouce_message_14_3",
- "value": "facial data"
- },
- {
- "name": "face_recognize_annouce_message_15_1",
- "value": "As the owner of your"
- },
- {
- "name": "face_recognize_annouce_message_15_2",
- "value": ", you are entitled to decide how you use the Face Recognition feature. For example, if you don't want to use Face Recognition to access App Lock, you can disable this feature in Settings. You can also choose to permanently delete your。"
- },
- {
- "name": "face_recognize_annouce_message_15_3",
- "value": "facial data"
- },
- {
- "name": "face_recognize_annouce_message_15_4",
- "value": "from your device."
- },
- {
- "name": "face_guide_3d_announce_link",
- "value": "Statement About 3D Face Recognition"
- },
- {
- "name": "face_3drecognize_annouce_message_01",
- "value": "3D Face Recognition uses depth-sensing technology to create a sophisticated, three-dimensional model of your face, which can be used to verify your identity. This lets you securely unlock your device, confirm payments, and access features such as App Lock and Safe by simply looking at the screen. 3D Face Recognition is more secure and robust than 2D face recognition technologies, and can even be used in the dark."
- }
- ,
- {
- "name": "face_introdution_title",
- "value": "Require trusted device"
- },
- {
- "name": "face_introdution_tip",
- "value": "Add an extra layer of security by only allowing this device to be unlocked with facial recognition when a trusted device is connected."
- },
- {
- "name": "trusted_devices_title",
- "value": "Trusted devices"
- },
- {
- "name": "face_introdution_button",
- "value": "Add trusted device"
- },
- {
- "name": "connect_tip",
- "value": "Connected"
- },
- {
- "name": "disconnect_tip",
- "value": "Not connected"
- },
- {
- "name": "cancel_button",
- "value": "Cancel"
- },
- {
- "name": "remove_device_button",
- "value": "Remove"
- },
- {
- "name": "add_device_button",
- "value": "Add"
- },
- {
- "name": "remove_device_tip",
- "value": "Once removed, a trusted device will no longer be required to unlock this device with facial recognition."
- },
- {
- "name": "remove_device_title",
- "value": "Remove trusted device"
- },
- {
- "name": "add_device_or_not_tip",
- "value": "Add trusted device?"
- },
- {
- "name": "using_tips",
- "value": "Note"
- },
- {
- "name": "add_device_tip",
- "value": "You will only be able to unlock this device with facial recognition when a trusted device is connected over Bluetooth. Other unlock methods will not be affected."
- }
-
-
-
- ,
- {
- "name": "face_recognition",
- "value": "人脸识别"
- },
- {
- "name": "face_recognition_is_used",
- "value": "人脸识别用于"
- },
- {
- "name": "unlock_screen",
- "value": "解锁屏幕"
- },
- {
- "name": "slide_to_unlock",
- "value": "滑动解锁"
- },
- {
- "name": "smart_display_lock_screen_notification",
- "value": "智能显示锁屏通知"
- },
- {
- "name": "access_safe",
- "value": "访问保密柜"
- },
- {
- "name": "access_app_lock",
- "value": "访问应用锁"
- },
- {
- "name": "automatically_fill_in_account",
- "value": "自动填充账号和密码"
- },
- {
- "name": "use_password_safe_to_save_account",
- "value": "使用密码保险箱保存账号和密码"
- },
- {
- "name": "delete_face_data",
- "value": "删除面部数据"
- },
- {
- "name": "set_backup_face",
- "value": "设置备用面容"
- },
- {
- "name": "recognize_another_face",
- "value": "除继续学习您的长相外,还可识别另一种面容"
- },
- {
- "name": "main_and_backup_faces",
- "value": "已设置主用及备用面容"
- },
- {
- "name": "trusted_device_be_connected_when_unlocking",
- "value": "解锁时需连接可信设备"
- },
- {
- "name": "closed",
- "value": "已关闭"
- },
- {
- "name": "look_at_screen_during_face_recognition",
- "value": "人脸识别时需注视屏幕"
- },
- {
- "name": "fill_light",
- "value": "暗光环境下屏幕补光"
- },
- {
- "name": "auxiliary_mode",
- "value": "辅助模式"
- },
- {
- "name": "recognize_without_opening_eyes",
- "value": "开启屏幕朗读后无需睁眼即可识别"
- },
- {
- "name": "be_based_on_facial_feature_information",
- "value": "人脸识别可基于您的面部特征信息进行身份识别,了解"
- },
- {
- "name": "statement_on_face_recognition",
- "value": "关于人脸识别的声明。"
- },
- {
- "name": "statement3D_on_face_recognition",
- "value": "关于3D人脸识别的声明。"
- },
- {
- "name": "looking_for_other_settings",
- "value": "是否在寻找其设置项?"
- },
- {
- "name": "pick_up_phone_turn_on_screen",
- "value": "拿起手机亮屏"
- },
- {
- "name": "annotation_screen_keeps_on",
- "value": "注视屏幕不息屏"
- },
- {
- "name": "unlock_directly",
- "value": "直接解锁"
- },
- {
- "name": "unlock_directly_after_successful_face_recognition",
- "value": "人脸识别成功后直接解锁"
- },
- {
- "name": "Slide_to_unlock_after_successful_face_recognition",
- "value": "人脸识别成功后滑动屏幕解锁"
- },
- {
- "name": "close",
- "value": "关闭"
- },
- {
- "name": "cancel",
- "value": "取消"
- },
- {
- "name": "enable",
- "value": "启用"
- },
- {
- "name": "activate_safe",
- "value": "启动保密柜"
- },
- {
- "name": "whether_to_enable_safe",
- "value": "需开启应用文件管理保密柜完成人脸关联。是否启用?"
- },
-
- {
- "name": "activate_app_lock",
- "value": "启动应用锁"
- },
- {
- "name": "Whether_to_activate_app_lock",
- "value": "需开启应用锁功能才能完成人脸关联。是否立即启动应用锁?"
- },
- {
- "name": "delete_all_face_data",
- "value": "删除主用及备用面容"
- },
- {
- "name": "delete",
- "value": "删除"
- },
- {
- "name": "wether_delete_face_data",
- "value": "删除后,基于面部数据的功能将不可用。是否删除?"
- },
- {
- "name": "pick_up_phone",
- "value": "同时关闭拿起手机亮屏"
- },
-
-
- {
- "name": "entry_MainAbility",
- "value": "entry_MainAbility"
- },
- {
- "name": "face_lists",
- "value": "面部列表"
- },
- {
- "name": "face_1",
- "value": "面部1"
- },
- {
- "name": "face",
- "value": "面部"
- },
- {
- "name": "new_face",
- "value": "新建面部数据"
- },
- {
- "name": "face_name",
- "value": "面部名称"
- },
- {
- "name": "delete_face",
- "value": "删除面容"
- },
- {
- "name": "save",
- "value": "保存"
- },
- {
- "name": "face_checker",
- "value": "Face Recognition"
- },
-
- {
- "name": "face_unlock_method",
- "value": "Unlock device"
- },
- {
- "name": "face_recognize_slideunlock_title",
- "value": "Slide to unlock"
- },
- {
- "name": "title_apps_security_pref",
- "value": "Access App Lock"
- },
- {
- "name": "title_fill_light",
- "value": "Low light compensation"
- },
- {
- "name": "recommend_preference_title",
- "value": "Looking for other settings?"
- },
- {
- "name": "face_config_light_01_universal",
- "value": "Raise to wake"
- },
- {
- "name": "multiface_list_title",
- "value": "Facial profiles"
- },
- {
- "name": "multiface_default_face_name_1",
- "value": "Profile 1"
- },
- {
- "name": "multiface_default_face_name",
- "value": "Profile "
- },
- {
- "name": "multiface_enroll_new_face",
- "value": "Add facial profile"
- },
- {
- "name": "multiface_face_name_title",
- "value": "Name"
- },
- {
- "name": "multiface_save",
- "value": "Save"
- },
- {
- "name": "face_unlock_method_close",
- "value": "Off"
- },
- {
- "name": "face_recognize_unlock_title",
- "value": "Direct unlock"
- },
- {
- "name": "face_3dguide_info_2",
- "value": "Face Recognition verifies your identity based on your facial features. To learn more, see the"
- },
- {
- "name": "face_inform_open_applock_msg",
- "value": "App Lock is not enabled. Enable now?"
- },
- {
- "name": "face_record_cancel",
- "value": "Cancel"
- },
- {
- "name": "face_recognize_unlock_summary_3d",
- "value": "Unlock directly after successful facial recognition."
- },
- {
- "name": "face_recognize_slideunlock_summary_3d",
- "value": "Slide to unlock after successful facial recognition."
- },
- {
- "name": "face_enterance_off",
- "value": "Off"
- },
- {
- "name": "open_bluetooth",
- "value": "Bluetooth must be enabled. Touch to enable"
- },
- {
- "name": "no_available_devices_title",
- "value": "No available devices"
- },
- {
- "name": "no_available_devices_tip",
- "value": "No paired devices found. Pair one now?"
- },
- {
- "name": "pair_button",
- "value": "Go pair"
- }
- ,
- {
- "name": "face_record",
- "value": "Set up Face Recognition"
- },
- {
- "name": "face_record_3d_record_fail",
- "value": "Setup failed"
- },
- {
- "name": "enroll_face_guide_title",
- "value": "Set up Face Recognition"
- },
- {
- "name": "face_guide_2d_way",
- "value": "Before starting, make sure the camera is clean, your face is unobstructed, and the environment is well-lit."
- },
- {
- "name": "face_guide_2d_announce",
- "value": "You can use Face Recognition to unlock your device and open locked apps.Click \"Start typing\" to indicate your consent"
- },
- {
- "name": "face_2dguide_light_notify_universal",
- "value": "Enable raise to wake"
- },
- {
- "name": "face_guide_3d_way",
- "value": "First, position your face in the frame. Then slowly move your head in a circle while looking at the screen to show all angles of your face."
- },
- {
- "name": "face_guide_3d_announce",
- "value": "You can use Face Recognition to unlock your device, confirm payments, open locked apps, and more.Click \"Start typing\" to indicate your consent"
- },
- {
- "name": "face_recognitin_guide",
- "value": "Get started"
- },
- {
- "name": "face_record_success",
- "value": "Setup complete"
- },
- {
- "name": "face_record_3d_tip_close",
- "value": "The face is too small"
- },
- {
- "name": "face_record_3d_tip_far",
- "value": "The face is too big"
- },
- {
- "name": "face_enroll_too_left",
- "value": "Face too far to the left"
- },
- {
- "name": "face_enroll_too_high",
- "value": "Face too close up"
- },
- {
- "name": "face_enroll_too_right",
- "value": "Face too far to the right"
- },
- {
- "name": "face_enroll_too_low",
- "value": "Face too far down "
- },
- {
- "name": "face_record_3d_tip_multi",
- "value": "Multiple faces appear"
- },
- {
- "name": "face_rotate_too_left",
- "value": "Too much head to the left "
- },
- {
- "name": "face_rotate_too_high",
- "value": "Head raised at too high an Angle"
- },
- {
- "name": "face_rotate_too_right",
- "value": "Head turned too far to the right"
- },
- {
- "name": "face_rotate_too_low",
- "value": "Head raised too low"
- }
- ]
-}
\ No newline at end of file
diff --git a/ui/faceenroll/product/pad/src/main/resources/zh_CN/element/string.json b/ui/faceenroll/product/pad/src/main/resources/zh_CN/element/string.json
deleted file mode 100644
index cec1eb8..0000000
--- a/ui/faceenroll/product/pad/src/main/resources/zh_CN/element/string.json
+++ /dev/null
@@ -1,791 +0,0 @@
-{
- "string": [
- {
- "name": "app_name",
- "value": "faceEnroll"
- },
- {
- "name": "mainability_description",
- "value": "JS_Phone_Empty Feature Ability"
- },
- {
- "name": "description_product",
- "value": "ETS_Empty Ability"
- },
- {
- "name": "entry_product",
- "value": "entry_product"
- },
- {
- "name": "enrolling",
- "value": "正在录入"
- },
- {
- "name": "enrolling_fail",
- "value": "录入失败"
- },
- {
- "name": "enrolling_timeout",
- "value": "录入超时"
- },
- {
- "name": "declare",
- "value": "声明"
- },
- {
- "name": "declare_content",
- "value": "如果您选择添加人脸数据,在亮屏状态,您将可以通过正面注视手机屏幕瞬间解锁。人脸数据储存在您的设备,而且不会通过云服务或者其他工具备份他处。"
- },
- {
- "name": "open_clock",
- "value": "打开”拿起手机亮屏“,提升解锁体验"
- },
- {
- "name": "face_enroll",
- "value": "人脸识别"
- },
- {
- "name": "enroll_success",
- "value": "录入成功"
- },
- {
- "name": "start_title",
- "value": "如何录入面部数据"
- },
- {
- "name": "start_2D_content1",
- "value": "首先,确保摄像头清洁、面部无遮挡,录入环境光线充足、无阳光直射。然后,正对屏幕,将面部完整移入识别区。"
- },
- {
- "name": "start_2D_content2",
- "value": "人脸识别可用于解锁屏幕及访问应用锁。点击“开始录入”即表示您同意"
- },
- {
- "name": "start_2D_content3",
- "value": "关于人脸识别的声明。"
- },
- {
- "name": "start_3D_content1",
- "value": "首先,请确保您的面部全部显示在识别区内。然后注视屏幕并缓缓转动头部以完成全方位采集。"
- },
- {
- "name": "start_3D_content2",
- "value": "人脸识别可用于解锁屏幕,访问应用锁、保密柜及支付。点击“开始录入”即表示您同意"
- },
- {
- "name": "start_3D_content3",
- "value": "关于3D人脸识别的声明。"
- },
- {
- "name": "button_content",
- "value": "开始录入"
- },
- {
- "name": "enroll_info_fail",
- "value": "请确保摄像头清洁,面部无遮挡,在光线充足、无阳光直射的环境里录入。"
- },
- {
- "name": "enroll_info",
- "value": "请保持不动"
- },
- {
- "name": "enroll_info_cancel",
- "value": "被取消"
- },
- {
- "name": "enroll_info_algorithm_not_init",
- "value": "算法未初始化"
- },
- {
- "name": "enroll_info_hal_invalid",
- "value": "人脸识别demon不可用"
- },
- {
- "name": "enroll_info_over_max_faces",
- "value": "录入超过最大上限"
- },
- {
- "name": "enroll_info_invalid_parameters",
- "value": "入参无效"
- },
- {
- "name": "enroll_info_busy",
- "value": "人脸流程正在进行中,请求busy"
- },
- {
- "name": "enroll_info_has_registered",
- "value": "当前人脸已经录入过"
- },
- {
- "name": "enroll_info_bad_quality",
- "value": "图像质量太差"
- },
- {
- "name": "enroll_info_not_found",
- "value": "没检测到人脸"
- },
- {
- "name": "enroll_info_scale_too_small",
- "value": "人脸太小"
- },
- {
- "name": "enroll_info_scale_too_large",
- "value": "人脸太大"
- },
- {
- "name": "enroll_info_offset_left",
- "value": "人脸太靠左"
- },
- {
- "name": "enroll_info_offset_top",
- "value": "人脸太靠上"
- },
- {
- "name": "enroll_info_offset_right",
- "value": "人脸太靠右"
- },
- {
- "name": "enroll_info_offset_bottom",
- "value": "人脸太靠下"
- },
- {
- "name": "enroll_info_liveness_warning",
- "value": "活体检测有风险"
- },
- {
- "name": "enroll_info_liveness_failure",
- "value": "活体检测失败"
- },
- {
- "name": "enroll_info_rotated_left",
- "value": "头向左转的角度太大"
- },
- {
- "name": "enroll_info_rise",
- "value": "头抬的角度太高"
- },
- {
- "name": "enroll_info_face_has_registered",
- "value": "转动头部"
- },
- {
- "name": "enroll_info_rotated_right",
- "value": "头向右转的角度太大"
- },
- {
- "name": "enroll_info_down",
- "value": "头抬的角度太低"
- },
- {
- "name": "enroll_info_eye_occlusion",
- "value": "眼睛不清晰"
- },
- {
- "name": "enroll_info_eye_close",
- "value": "闭眼"
- },
- {
- "name": "enroll_info_mouth_occlusion",
- "value": "嘴巴不清晰"
- },
- {
- "name": "enroll_info_mutlify",
- "value": "出现多张脸"
- },
- {
- "name": "enroll_info_blur",
- "value": "脸不清晰"
- },
- {
- "name": "enroll_info_not_complete",
- "value": "脸不完整"
- },
- {
- "name": "enroll_info_darklight",
- "value": "光线太暗"
- },
- {
- "name": "enroll_info_highlight",
- "value": "光线太强"
- },
- {
- "name": "enroll_info_half_shadow",
- "value": "阴阳脸"
- },
- {
- "name": "enroll_info_darkpic",
- "value": "图片太暗"
- },
- {
- "name": "enroll_info_rotate_top_right",
- "value": "人脸头顶朝右"
- },
- {
- "name": "enroll_info_rotate_top_left",
- "value": "人脸头顶朝左"
- },
- {
- "name": "enroll_info_rotate_bottom_right",
- "value": "人脸下巴朝右"
- },
- {
- "name": "enroll_info_rotate_bottom_left",
- "value": "人脸下巴朝左"
- },
- {
- "name": "enroll_info_open_camera_failed",
- "value": "打开Camera失败"
- },
- {
- "name": "enroll_button_content",
- "value": "重新录入"
- },
- {
- "name": "deleteTitle",
- "value": "删除数据"
- } ,{
- "name": "face_introdution_title",
- "value": "解锁时需连接可信设备"
- },
- {
- "name": "face_introdution_tip",
- "value": "进行人脸识别解锁手机时,需连接可信设备以进一步提升安全性。"
- },
- {
- "name": "trusted_devices_title",
- "value": "可信设备"
- },
- {
- "name": "face_introdution_button",
- "value": "添加可信设备"
- },
- {
- "name": "connect_tip",
- "value": "已连接"
- },
- {
- "name": "disconnect_tip",
- "value": "未连接"
- },
- {
- "name": "cancel_button",
- "value": "取消"
- },
- {
- "name": "remove_device_button",
- "value": "移除"
- },
- {
- "name": "add_device_button",
- "value": "添加"
- },
- {
- "name": "remove_device_tip",
- "value": "移除后,人脸识别解锁本机时将不再需要连接可信设备。是否移除?"
- },
- {
- "name": "remove_device_title",
- "value": "移除可信设备"
- },
- {
- "name": "add_device_or_not_tip",
- "value": "是否添加"
- },
- {
- "name": "using_tips",
- "value": "使用提示"
- },
- {
- "name": "add_device_tip",
- "value": "添加后,当可信设备与本机断开连接时,将无法使用人脸识别解锁。您可以使用其他方式解锁。"
- }
-
-
- ,
- {
- "name": "face_guide_2d_announce_link",
- "value": "关于人脸识别的声明"
- },
- {
- "name": "face_feature_desc",
- "value": "功能介绍"
- },
- {
- "name": "face_recognize_annouce_message_01",
- "value": "人脸识别是一种基于人的脸部特征信息进行身份识别的生物识别技术。它通过手机前置摄像头捕捉人脸面部数据,进而快速完成面部特征比对和身份认证。可用于解锁屏幕、访问应用锁等场景。"
- },
- {
- "name": "face_recognize_annouce_message_02",
- "value": "录入面部数据时,需注意以下事项:"
- },
- {
- "name": "face_recognize_annouce_message_03",
- "value": "1.确保摄像头清洁;"
- },
- {
- "name": "face_recognize_annouce_message_04",
- "value": "2.在光线充足的环境下录入,但需避免强光直射;"
- },
- {
- "name": "face_recognize_annouce_message_05",
- "value": "3.勿用衣帽、头发、墨镜、口罩、浓妆等遮挡面部;"
- },
- {
- "name": "face_recognize_annouce_message_06",
- "value": "4.确保面部正面完整清晰地出现在提示框内,不要闭眼、大幅度仰头或低头"
- },
- {
- "name": "face_recognize_annouce_message_07",
- "value": "5.避免其他人出现在录入画面中。"
- },
- {
- "name": "face_recognize_annouce_message_08",
- "value": "任何技术都存在一定局限和风险,使用人脸识别时,需注意以下事项:"
- },
- {
- "name": "face_recognize_annouce_message_09",
- "value": "1.在暗光、强光、逆光或角度过大等场景下,人脸识别的成功率会有所降低;"
- },
- {
- "name": "face_annouce_tip1_item2_3d",
- "value": "2.人脸识别的安全性低于图案密码、数字密码、混合密码。;"
- },
- {
- "name": "face_recognize_annouce_message_10",
- "value": "您的设备可能会被容貌、外形与您相近的人或物品解锁;"
- },
- {
- "name": "face_recognize_annouce_message_11",
- "value": "请勿将设备随意交给他人使用,避免人脸识别功能被恶意利用;"
- },
- {
- "name": "face_recognize_annouce_message_12",
- "value": "除以上事项外,您还需注意其他可能影响人脸识别功能正常使用的情况。"
- },
- {
- "name": "face_recognize_annouce_message_13",
- "value": "隐私声明"
- },
- {
- "name": "face_recognize_annouce_message_14_1",
- "value": "您的"
- },
- {
- "name": "face_recognize_annouce_message_14_2",
- "value": "将受到严格保护。该数据仅加密保存于本设备的安全隔离区域,华为不会进行备份,其他应用也无法访问或备份。例如,您使用人脸识别进行应用内认证时,应用仅能收到认证是否成功的通知,而无法访问、备份或录入"
- },
- {
- "name": "face_recognize_annouce_message_14_3",
- "value": "面部数据。"
- },
- {
- "name": "face_recognize_annouce_message_15_1",
- "value": "您拥有人脸识别的自主控制权,可灵活控制人脸识别的使用及适用范围。例如,您不想使用人脸识别访问应用锁,在“设置”中将其关闭即可,此时人脸识别仍可用于其他操作,但不可用于进入应用锁。您还可彻底删除"
- },
- {
- "name": "face_recognize_annouce_message_15_2",
- "value": "删除后本设备将不再保存这些数据。"
- },
-
- {
- "name": "face_recognize_annouce_message_15_3",
- "value": ""
- },
- {
- "name": "face_recognize_annouce_message_15_4",
- "value": ""
- },
- {
- "name": "face_guide_3d_announce_link",
- "value": "关于3D人脸识别的声明"
- },
- {
- "name": "face_3drecognize_annouce_message_01",
- "value": "3D人脸识别是新一代人脸识别技术。它通过深度感应技术,捕捉更丰富的面部数据,实现三维立体防伪识别。在暗光、逆光、无光等环境下,也可用于解锁屏幕,访问应用锁、保密柜及支付,其安全性、准确率和环境适应性较传统人脸识别技术大幅提升。"
- }
-
-
-
- ,
- {
- "name": "face_recognition",
- "value": "人脸识别"
- },
- {
- "name": "face_recognition_is_used",
- "value": "人脸识别用于"
- },
- {
- "name": "unlock_screen",
- "value": "解锁屏幕"
- },
- {
- "name": "slide_to_unlock",
- "value": "滑动解锁"
- },
- {
- "name": "smart_display_lock_screen_notification",
- "value": "智能显示锁屏通知"
- },
- {
- "name": "access_safe",
- "value": "访问保密柜"
- },
- {
- "name": "access_app_lock",
- "value": "访问应用锁"
- },
- {
- "name": "automatically_fill_in_account",
- "value": "自动填充账号和密码"
- },
- {
- "name": "use_password_safe_to_save_account",
- "value": "使用密码保险箱保存账号和密码"
- },
- {
- "name": "delete_face_data",
- "value": "删除面部数据"
- },
- {
- "name": "set_backup_face",
- "value": "设置备用面容"
- },
- {
- "name": "recognize_another_face",
- "value": "除继续学习您的长相外,还可识别另一种面容"
- },
- {
- "name": "main_and_backup_faces",
- "value": "已设置主用及备用面容"
- },
- {
- "name": "trusted_device_be_connected_when_unlocking",
- "value": "解锁时需连接可信设备"
- },
- {
- "name": "closed",
- "value": "已关闭"
- },
- {
- "name": "look_at_screen_during_face_recognition",
- "value": "人脸识别时需注视屏幕"
- },
- {
- "name": "fill_light",
- "value": "暗光环境下屏幕补光"
- },
- {
- "name": "auxiliary_mode",
- "value": "辅助模式"
- },
- {
- "name": "recognize_without_opening_eyes",
- "value": "开启屏幕朗读后无需睁眼即可识别"
- },
- {
- "name": "be_based_on_facial_feature_information",
- "value": "人脸识别可基于您的面部特征信息进行身份识别,了解"
- },
- {
- "name": "statement_on_face_recognition",
- "value": "关于人脸识别的声明。"
- },
- {
- "name": "statement3D_on_face_recognition",
- "value": "关于3D人脸识别的声明。"
- },
- {
- "name": "looking_for_other_settings",
- "value": "是否在寻找其设置项?"
- },
- {
- "name": "pick_up_phone_turn_on_screen",
- "value": "拿起手机亮屏"
- },
- {
- "name": "annotation_screen_keeps_on",
- "value": "注视屏幕不息屏"
- },
- {
- "name": "unlock_directly",
- "value": "直接解锁"
- },
- {
- "name": "unlock_directly_after_successful_face_recognition",
- "value": "人脸识别成功后直接解锁"
- },
- {
- "name": "Slide_to_unlock_after_successful_face_recognition",
- "value": "人脸识别成功后滑动屏幕解锁"
- },
- {
- "name": "close",
- "value": "关闭"
- },
- {
- "name": "enable",
- "value": "启用"
- },
- {
- "name": "activate_safe",
- "value": "启动保密柜"
- },
- {
- "name": "whether_to_enable_safe",
- "value": "需开启应用文件管理保密柜完成人脸关联。是否启用?"
- },
-
- {
- "name": "activate_app_lock",
- "value": "启动应用锁"
- },
- {
- "name": "Whether_to_activate_app_lock",
- "value": "需开启应用锁功能才能完成人脸关联。是否立即启动应用锁?"
- },
- {
- "name": "delete_all_face_data",
- "value": "删除主用及备用面容"
- },
- {
- "name": "wether_delete_face_data",
- "value": "删除后,基于面部数据的功能将不可用。是否删除?"
- },
- {
- "name": "pick_up_phone",
- "value": "同时关闭拿起手机亮屏"
- },
-
-
- {
- "name": "entry_MainAbility",
- "value": "entry_MainAbility"
- },
- {
- "name": "face_lists",
- "value": "面部列表"
- },
- {
- "name": "face_1",
- "value": "面部1"
- },
- {
- "name": "face",
- "value": "面部"
- },
- {
- "name": "new_face",
- "value": "新建面部数据"
- },
- {
- "name": "face_name",
- "value": "面部名称"
- },
- {
- "name": "delete_face",
- "value": "删除面部"
- },
- {
- "name": "save",
- "value": "保存"
- },
-
- {
- "name": "face_checker",
- "value": "人脸识别"
- },
-
- {
- "name": "face_unlock_method",
- "value": "解锁屏幕"
- },
- {
- "name": "face_recognize_slideunlock_title",
- "value": "滑动解锁"
- },
- {
- "name": "title_apps_security_pref",
- "value": "访问应用锁"
- },
- {
- "name": "title_fill_light",
- "value": "暗光环境下屏幕补光"
- },
- {
- "name": "recommend_preference_title",
- "value": "是否在寻找其他设置项?"
- },
- {
- "name": "face_config_light_01_universal",
- "value": "拿起手机亮屏"
- },
- {
- "name": "multiface_list_title",
- "value": "面部列表"
- },
- {
- "name": "multiface_default_face_name_1",
- "value": "面部 1"
- },
- {
- "name": "multiface_default_face_name",
- "value": "面部"
- },
- {
- "name": "multiface_enroll_new_face",
- "value": "新建面部数据"
- },
- {
- "name": "multiface_face_name_title",
- "value": "面部名称"
- },
-
- {
- "name": "multiface_save",
- "value": "保存"
- },
- {
- "name": "face_unlock_method_close",
- "value": "关闭"
- },
- {
- "name": "face_recognize_unlock_title",
- "value": "直接解锁"
- },
- {
- "name": "face_3dguide_info_2",
- "value": "人脸识别可基于您的面部特征信息进行身份识别,了解"
- },
-
- {
- "name": "face_inform_open_applock_msg",
- "value": "需开启应用锁功能才能完成人脸关联。是否立即启用应用锁?"
- },
- {
- "name": "face_record_cancel",
- "value": "取消"
- },
-
- {
- "name": "face_recognize_unlock_summary_3d",
- "value": "人脸识别成功后直接解锁"
- },
- {
- "name": "face_recognize_slideunlock_summary_3d",
- "value": "人脸识别成功后,滑动屏幕解锁"
- },
- {
- "name": "face_enterance_off",
- "value": "已关闭"
- },
- {
- "name": "open_bluetooth",
- "value": "使用此功能需先开启蓝牙,点击设置"
- },
- {
- "name": "no_available_devices_title",
- "value": "没有可添加的设备"
- },
- {
- "name": "no_available_devices_tip",
- "value": "没有检测到可添加的配对设备。是否前往蓝牙设置配对?"
- },
- {
- "name": "pair_button",
- "value": "去配对"
- },
- {
- "name": "face_fingerprint_settings_switch_title",
- "value": "自动填充账号和密码"
- },
- {
- "name": "face_fingerprint_settings_switch_summary",
- "value": "使用密码保险箱保存的帐号和密码"
- },
- {
- "name": "face_record",
- "value": "正在录入"
- },
- {
- "name": "face_record_3d_record_fail",
- "value": "录入失败"
- },
- {
- "name": "enroll_face_guide_title",
- "value": "如何录入面部数据"
- },
- {
- "name": "face_guide_2d_way",
- "value": "首先,确保摄像头清洁、面部无遮挡,录入环境光线充足、无阳光直射。然后,正对屏幕,将面部完整移入识别区。"
- },
- {
- "name": "face_guide_2d_announce",
- "value": "人脸识别可用于解锁屏幕及访问应用锁。点击“开始录入”即表示您同意"
- },
- {
- "name": "face_2dguide_light_notify_universal",
- "value": "打开”拿起手机亮屏“,提升解锁体验"
- },
- {
- "name": "face_guide_3d_way",
- "value": "首先,请确保您的面部全部显示在识别区内。然后注视屏幕并缓缓转动头部以完成全方位采集。"
- },
- {
- "name": "face_guide_3d_announce",
- "value": "人脸识别可用于解锁屏幕,访问应用锁、保密柜及支付。点击“开始录入”即表示您同意"
- },
- {
- "name": "face_recognitin_guide",
- "value": "开始录入"
- },
- {
- "name": "face_record_success",
- "value": "录入成功"
- },
- {
- "name": "face_record_3d_tip_close",
- "value": "人脸太小"
- },
- {
- "name": "face_record_3d_tip_far",
- "value": "人脸太大"
- },
- {
- "name": "face_enroll_too_left",
- "value": "人脸太靠左"
- },
- {
- "name": "face_enroll_too_high",
- "value": "人脸太靠上"
- },
- {
- "name": "face_enroll_too_right",
- "value": "人脸太靠右"
- },
- {
- "name": "face_enroll_too_low",
- "value": "人脸太靠下"
- },
- {
- "name": "face_record_3d_tip_multi",
- "value": "出现多张脸"
- },
- {
- "name": "face_rotate_too_left",
- "value": "头向左转的角度太大"
- },
- {
- "name": "face_rotate_too_high",
- "value": "头抬的角度太高"
- },
- {
- "name": "face_rotate_too_right",
- "value": "头向右转的角度太大"
- },
- {
- "name": "face_rotate_too_low",
- "value": "头抬的角度太低"
- }
- ]
-}
\ No newline at end of file
diff --git a/ui/faceenroll/product/phone/build.gradle b/ui/faceenroll/product/phone/build.gradle
deleted file mode 100644
index a96c69f..0000000
--- a/ui/faceenroll/product/phone/build.gradle
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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.
- */
-
-apply plugin: 'com.huawei.ohos.hap'
-ohos {
- compileSdkVersion 7
- defaultConfig {
- compatibleSdkVersion 4
- }
- arkEnabled false
-
- buildTypes {
- release {
- proguardOpt {
- proguardEnabled false
- rulesFiles 'proguard-rules.pro'
- }
- }
- }
-}
-
-dependencies {
-}
diff --git a/ui/faceenroll/product/phone/src/main/ets/default/common/constant.ets b/ui/faceenroll/product/phone/src/main/ets/default/common/constant.ets
deleted file mode 100644
index d5eec88..0000000
--- a/ui/faceenroll/product/phone/src/main/ets/default/common/constant.ets
+++ /dev/null
@@ -1,423 +0,0 @@
-/*
- * 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';
-
-async function routeSuccess() {
- let options = {
- uri: 'pages/success'
- }
- try {
- await router.push(options)
- } catch (err) {
- console.error(`fail callback, code: ${err.code}, msg: ${err.msg}`)
- }
-}
-
-async function route_back() {
- let options = {
- uri: 'pages/userAuth'
- }
- try {
- await router.push(options)
- } catch (err) {
- console.error(`fail callback, code: ${err.code}, msg: ${err.msg}`)
- }
-}
-
-export default class Constants {
-
- //code and errorCode
- static CODE_RESULT = 1
- static CODE_CANCEL = 2
- static CODE_ACQUIRE = 3
- static ERROR_CODE_SUCCESS = 0
- static ERROR_CODE_FAIL = 1
- static ERROR_CODE_CANCEL = 2
- static ERROR_CODE_TIMEOUT = 4
- static ERROR_CODE_ALGORITHM_NOT_INIT = 5
- static ERROR_CODE_HAL_INVALID = 6
- static ERROR_CODE_OVER_MAX_FACES = 7
- static ERROR_CODE_INVALID_PARAMETERS = 9
- static ERROR_CODE_BUSY = 13
- static ERROR_CODE_ENROLL_HAS_REGISTERED = 16
- static ERROR_CODE_FACE_DETECTED = 38
- static ERROR_CODE_BAD_QUALITY = 4
- static ERROR_CODE_NOT_FOUND = 5
- static ERROR_CODE_TOO_SMALL = 6
- static ERROR_CODE_TOO_LARGE = 7
- static ERROR_CODE_OFFSET_LEFT = 8
- static ERROR_CODE_OFFSET_TOP = 9
- static ERROR_CODE_OFFSET_RIGHT = 10
- static ERROR_CODE_OFFSET_BOTTOM = 11
- static ERROR_CODE_LIVENESS_WARNING = 13
- static ERROR_CODE_LIVENESS_FAILURE = 14
- static ERROR_CODE_ROTATED_LEFT = 15
- static ERROR_CODE_RISE = 16
- static ERROR_CODE_ROTATED_RIGHT = 17
- static ERROR_CODE_DOWN = 18
- static ERROR_CODE_EYE_OCCLUSION = 21
- static ERROR_CODE_EYE_CLOSE = 22
- static ERROR_CODE_MOUTH_OCCLUSION = 23
- static ERROR_CODE_MULTI = 27
- static ERROR_CODE_BLUR = 28
- static ERROR_CODE_NOT_COMPLETE = 29
- static ERROR_CODE_DARKLIGHT = 30
- static ERROR_CODE_HIGHTLIGHT = 31
- static ERROR_CODE_HALF_SHADOW = 32
- static ERROR_CODE_HAS_REGISTERED = 37
- static ERROR_CODE_DARKPIC = 39
- static ERROR_CODE_ROTATE_TOP_RIGHT = 40
- static ERROR_CODE_ROTATE_TOP_LEFT = 41
- static ERROR_CODE_ROTATE_BOTTOM_RIGHT = 42
- static ERROR_CODE_ROTATE_BOTTOM_LEFT = 43
- static ERROR_CODE_OPEN_CAMERA_FAILED = 46
- static ERROR_CODE_PROGRESS_FIRST = 1004
- static ERROR_CODE_PROGRESS_SECOND = 1008
- static ERROR_CODE_PROGRESS_THIRD = 1012
- static PARAM_TOKEN = "check"
- static FLAGS = 0
- static FACEID = 0
- static PREVIEWID = 2
-
-
- //setTimeout
- static TIMEOUT_100 = 100
- static TIMEOUT_200 = 200
- static TIMEOUT_300 = 300
- static TIMEOUT_400 = 400
- static TIMEOUT_500 = 500
- static TIMEOUT_600 = 600
- static TIMEOUT_700 = 700
- static TIMEOUT_800 = 800
- static TIMEOUT_900 = 900
- static TIMEOUT_1000 = 1000
- static TIMEOUT_1100 = 1100
- static TIMEOUT_1200 = 1200
- static TIMEOUT_1300 = 1300
- static TIMEOUT_1400 = 1400
- static TIMEOUT_1500 = 1500
- static TIMEOUT_1600 = 1600
- static TIMEOUT_1700 = 1700
- static TIMEOUT_1800 = 1800
- static TIMEOUT_1900 = 1900
- static TIMEOUT_2000 = 2000
- static TIMEOUT_3000 = 3000
-
- //UI
- static SHELTER_ANIMATOR = 1000
- static PROGRESS_START = 0
- static PROGRESS_TOTAL = 100
- static FONT_WEIGHT = 500
- static ENROll_TITLE = 600
- static SHELTER_START_WIDTH = 1100
- static SHELTER_END_WIDTH = '100%'
- static CENTER_HEIGHT = '620lpx'
- static SHELTER_START_HEIGHT = '2000lpx'
- static SHELTER_END_HEIGHT = '640lpx'
- static SHELTER_3D_END_HEIGHT = '640lpx'
- static PROGRESS_VALUE_FIRST = 30
- static PROGRESS_VALUE_SECOND = 60
- static PROGRESS_VALUE_THIRD = 100
- static SPACE = 20
- static INITIAL_INDEX = 0
- static HEIGHT_LIST = 60
- static FONTSIZE_16 = 16
- static BORDER_RADIUS = 10
- static STROKE_WIDTH = 2
- static START_MARGIN = 20
- static END_MARGIN = 20
- static SHOW_START_VIEWS_3D = '3D'
- static SHOW_START_VIEWS_2D = '2D'
- static LIST_PADDING = 5
- static BLUR_START = 0
- static BLUR_END = 40
- static CENTER_POSITION_Y = 5
- static BUTTON_POSITION = '92%'
- static ENROLL_INFO_POSITION = '918lpx'
- static ENROLL_INFO_WIDTH = '90%'
- static CHECKBOX_POSITION_X = '5%'
- static CHECKBOX_POSITION_Y = '85%'
- static CHECKBOX_TEXT_POSITION_X = '18%'
- static CHECKBOX_TEXT_POSITION_Y = '87%'
-
-
- static PROGRESS_WIDTH = '460lpx'
- static BACK_WIDTH = '136lpx'
- static BACK_HEIGHT = '110lpx'
- static TITLE_FONT_SIZE = '48lpx'
- static TITLE_MARGIN = '24lpx'
- static TITLE_ENROLLING_MARGIN = '140lpx'
- static IMAGE_MARGIN = '96lpx'
- static IMAGE_3D_MARGIN = '48lpx'
- static FONT_SIZE = '28lpx'
- static SMALL_TITLE_FONT_SIZE = '36lpx'
- static CONTENT1_MARGIN = '16lpx'
- static CONTENT2_MARGIN = '8lpx'
- static BUTTON_FONT_SIZE = '32lpx'
- static BUTTON_WIDTH = '384lpx'
- static BUTTON_HEIGHT = '80lpx'
- static IMAGE_2D_HEIGHT = '480lpx'
- static IMAGE_3D_WIDTH = '512lpx'
- static ERROR_CODE_INFO_SIZE = '32lpx'
- static ENROLL_CENTER_POSITION_Y = '240lpx'
- static SUCCESS_WIDTH = '204lpx'
- static CHECKBOX_SIZE = '60lpx'
- static APERTURE1_WIDTH = '266lpx'
- static APERTURE2_WIDTH = '264lpx'
- static APERTURE34_WIDTH = '284lpx'
- static APERTURE5_WIDTH = '466lpx'
-
-
-
- //PROGRESS
- static PROGRESS_VALUE_5 = 5
- static PROGRESS_VALUE_10 = 10
- static PROGRESS_VALUE_15 = 15
- static PROGRESS_VALUE_20 = 20
- static PROGRESS_VALUE_25 = 25
- static PROGRESS_VALUE_30 = 30
- static PROGRESS_VALUE_35 = 35
- static PROGRESS_VALUE_40 = 40
- static PROGRESS_VALUE_45 = 45
- static PROGRESS_VALUE_50 = 50
- static PROGRESS_VALUE_55 = 55
- static PROGRESS_VALUE_60 = 60
- static PROGRESS_VALUE_65 = 65
- static PROGRESS_VALUE_70 = 70
- static PROGRESS_VALUE_75 = 75
- static PROGRESS_VALUE_80 = 80
- static PROGRESS_VALUE_85 = 85
- static PROGRESS_VALUE_90 = 90
- static PROGRESS_VALUE_95 = 95
- static PROGRESS_VALUE_100 = 100
-
- static DECLARE_WIDTH = '90%'
- static DECLARE_MAX_WIDTH = '100%'
- static DECLARE_TITLE_FONT_SIZE = 25
- static DECLARE_SECONDARY_TITLE_FONT_SIZE = 23
- static DECLARE_TEXT_FONT_SIZE = 22
- static DECLARE_ITEM_MARGIN_BOTTOM = 10
- static DECLARE_TITLE_MARGIN_TOP = 20
- static DECLARE_TITLE_MARGIN_BOTTOM = 20
- static DECLARE_TEXT_LINE_HEIGHT = 33
- static DECLARE_SCROLL_BAR_WIDTH = 0
- static DECLARE_BACKGROUND_COLOR = "#F2F3F5"
- static DECLARE_TITLE_2 = "2."
- static DECLARE_TITLE_3 = "3."
- static DECLARE_TITLE_4 = "4."
- static DECLARE_TITLE_5 = "5."
-
-
-
-
- //errorCode value
- static value(){
- const info = new Map()
- info.set(Constants.ERROR_CODE_BAD_QUALITY,$r('app.string.enroll_info_bad_quality'))
- info.set(Constants.ERROR_CODE_NOT_FOUND,$r('app.string.enroll_info_not_found'))
- info.set(Constants.ERROR_CODE_TOO_SMALL,$r('app.string.face_record_3d_tip_close'))
- info.set(Constants.ERROR_CODE_TOO_LARGE,$r('app.string.face_record_3d_tip_far'))
- info.set(Constants.ERROR_CODE_OFFSET_LEFT,$r('app.string.face_enroll_too_left'))
- info.set(Constants.ERROR_CODE_OFFSET_TOP,$r('app.string.face_enroll_too_high'))
- info.set(Constants.ERROR_CODE_OFFSET_RIGHT,$r('app.string.face_enroll_too_right'))
- info.set(Constants.ERROR_CODE_OFFSET_BOTTOM,$r('app.string.face_enroll_too_low'))
- info.set(Constants.ERROR_CODE_LIVENESS_WARNING,$r('app.string.enroll_info_liveness_warning'))
- info.set(Constants.ERROR_CODE_LIVENESS_FAILURE,$r('app.string.enroll_info_liveness_failure'))
- info.set(Constants.ERROR_CODE_ROTATED_LEFT,$r('app.string.face_rotate_too_left'))
- info.set(Constants.ERROR_CODE_RISE,$r('app.string.face_rotate_too_high'))
- info.set(Constants.ERROR_CODE_ROTATED_RIGHT,$r('app.string.face_rotate_too_right'))
- info.set(Constants.ERROR_CODE_DOWN,$r('app.string.face_rotate_too_low'))
- info.set(Constants.ERROR_CODE_EYE_OCCLUSION,$r('app.string.enroll_info_eye_occlusion'))
- info.set(Constants.ERROR_CODE_EYE_CLOSE,$r('app.string.enroll_info_eye_close'))
- info.set(Constants.ERROR_CODE_MOUTH_OCCLUSION,$r('app.string.enroll_info_mouth_occlusion'))
- info.set(Constants.ERROR_CODE_MULTI,$r('app.string.face_record_3d_tip_multi'))
- info.set(Constants.ERROR_CODE_BLUR,$r('app.string.enroll_info_blur'))
- info.set(Constants.ERROR_CODE_NOT_COMPLETE,$r('app.string.enroll_info_not_complete'))
- info.set(Constants.ERROR_CODE_DARKLIGHT,$r('app.string.enroll_info_darklight'))
- info.set(Constants.ERROR_CODE_HIGHTLIGHT,$r('app.string.enroll_info_highlight'))
- info.set(Constants.ERROR_CODE_HALF_SHADOW,$r('app.string.enroll_info_half_shadow'))
- info.set(Constants.ERROR_CODE_HAS_REGISTERED,$r('app.string.enroll_info_face_has_registered'))
- info.set(Constants.ERROR_CODE_DARKPIC,$r('app.string.enroll_info_darkpic'))
- info.set(Constants.ERROR_CODE_ROTATE_TOP_RIGHT,$r('app.string.enroll_info_rotate_top_right'))
- info.set(Constants.ERROR_CODE_ROTATE_TOP_LEFT,$r('app.string.enroll_info_rotate_top_left'))
- info.set(Constants.ERROR_CODE_ROTATE_BOTTOM_RIGHT,$r('app.string.enroll_info_rotate_bottom_right'))
- info.set(Constants.ERROR_CODE_ROTATE_BOTTOM_LEFT,$r('app.string.enroll_info_rotate_bottom_left'))
- info.set(Constants.ERROR_CODE_OPEN_CAMERA_FAILED,$r('app.string.enroll_info_open_camera_failed'))
-
- return info
- }
-
- //face progress_3D
- static progress() {
- const pro = new Map()
- pro.set(Constants.ERROR_CODE_PROGRESS_FIRST,Constants.PROGRESS_VALUE_FIRST)
- pro.set(Constants.ERROR_CODE_PROGRESS_SECOND,Constants.PROGRESS_VALUE_SECOND)
- pro.set(Constants.ERROR_CODE_PROGRESS_THIRD,Constants.PROGRESS_VALUE_THIRD)
-
- return pro
- }
- static result() {
- const res = new Map()
- res.set(Constants.ERROR_CODE_FAIL,'')
- res.set(Constants.ERROR_CODE_CANCEL,$r('app.string.enroll_info_cancel'))
- res.set(Constants.ERROR_CODE_ALGORITHM_NOT_INIT,$r('app.string.enroll_info_algorithm_not_init'))
- res.set(Constants.ERROR_CODE_HAL_INVALID,$r('app.string.enroll_info_hal_invalid'))
- res.set(Constants.ERROR_CODE_OVER_MAX_FACES,$r('app.string.enroll_info_over_max_faces'))
- res.set(Constants.ERROR_CODE_INVALID_PARAMETERS,$r('app.string.enroll_info_invalid_parameters'))
- res.set(Constants.ERROR_CODE_BUSY,$r('app.string.enroll_info_busy'))
- res.set(Constants.ERROR_CODE_ENROLL_HAS_REGISTERED,$r('app.string.enroll_info_has_registered'))
-
- return res
- }
-
- //face progress_2D
- static progress_2D(){
- setTimeout(()=>{
- AppStorage.Set('prgValue',Constants.PROGRESS_VALUE_5)
- },Constants.TIMEOUT_100);
- setTimeout(()=>{
- AppStorage.Set('prgValue',Constants.PROGRESS_VALUE_10)
- },Constants.TIMEOUT_200);
- setTimeout(()=>{
- AppStorage.Set('prgValue',Constants.PROGRESS_VALUE_15)
- },Constants.TIMEOUT_300);
- setTimeout(()=>{
- AppStorage.Set('prgValue',Constants.PROGRESS_VALUE_20)
- },Constants.TIMEOUT_400);
- setTimeout(()=>{
- AppStorage.Set('prgValue',Constants.PROGRESS_VALUE_25)
- },Constants.TIMEOUT_500);
- setTimeout(()=>{
- AppStorage.Set('prgValue',Constants.PROGRESS_VALUE_30)
- },Constants.TIMEOUT_600);
- setTimeout(()=>{
- AppStorage.Set('prgValue',Constants.PROGRESS_VALUE_35)
- },Constants.TIMEOUT_700);
- setTimeout(()=>{
- AppStorage.Set('prgValue',Constants.PROGRESS_VALUE_40)
- },Constants.TIMEOUT_800);
- setTimeout(()=>{
- AppStorage.Set('prgValue',Constants.PROGRESS_VALUE_45)
- },Constants.TIMEOUT_900);
- setTimeout(()=>{
- AppStorage.Set('prgValue',Constants.PROGRESS_VALUE_50)
- },Constants.TIMEOUT_1000);
- setTimeout(()=>{
- AppStorage.Set('prgValue',Constants.PROGRESS_VALUE_55)
- },Constants.TIMEOUT_1100);
- setTimeout(()=>{
- AppStorage.Set('prgValue',Constants.PROGRESS_VALUE_60)
- },Constants.TIMEOUT_1200);
- setTimeout(()=>{
- AppStorage.Set('prgValue',Constants.PROGRESS_VALUE_65)
- },Constants.TIMEOUT_1300);
- setTimeout(()=>{
- AppStorage.Set('prgValue',Constants.PROGRESS_VALUE_70)
- },Constants.TIMEOUT_1400);
- setTimeout(()=>{
- AppStorage.Set('prgValue',Constants.PROGRESS_VALUE_75)
- },Constants.TIMEOUT_1500);
- setTimeout(()=>{
- AppStorage.Set('prgValue',Constants.PROGRESS_VALUE_80)
- },Constants.TIMEOUT_1600);
- setTimeout(()=>{
- AppStorage.Set('prgValue',Constants.PROGRESS_VALUE_85)
- },Constants.TIMEOUT_1700);
- setTimeout(()=>{
- AppStorage.Set('prgValue',Constants.PROGRESS_VALUE_90)
- },Constants.TIMEOUT_1800);
- setTimeout(()=>{
- AppStorage.Set('prgValue',Constants.PROGRESS_VALUE_95)
- },Constants.TIMEOUT_1900);
- setTimeout(()=>{
- AppStorage.Set('prgValue',Constants.PROGRESS_VALUE_100)
- routeSuccess()
- },Constants.TIMEOUT_2000)
- }
-
- static aperture(){
- setTimeout(() => {
- AppStorage.Set('showAperture1',false)
- AppStorage.Set('showAperture2',true)
- }, Constants.TIMEOUT_1000)
- setTimeout(() => {
- AppStorage.Set('showAperture2',false)
- AppStorage.Set('showAperture3',true)
- }, Constants.TIMEOUT_1300)
- setTimeout(() => {
- AppStorage.Set('showAperture3',false)
- AppStorage.Set('showAperture4',true)
- }, Constants.TIMEOUT_1600)
- setTimeout(() => {
- AppStorage.Set('showAperture4',false)
- AppStorage.Set('showAperture5',true)
- }, Constants.TIMEOUT_1900)
- }
- static RESULT_CODE_SUCCESS = 0
- static RESULT_CODE_FAIL = 1
- static RESULT_CODE_GENERAL_ERROR = 2
- static RESULT_CODE_CANCELED = 3
- static RESULT_CODE_TIMEOUT = 4
- static RESULT_CODE_TYPE_NOT_SUPPORT = 5
- static RESULT_CODE_TRUST_LEVEL_NOT_SUPPORT = 6
- static RESULT_CODE_BUSY = 7
- static RESULT_CODE_INVALID_PARAMETERS = 8
- static RESULT_CODE_LOCKED = 9
- static RESULT_CODE_NOT_ENROLLED = 10
-
- static resultCode(){
- const Code = new Map()
- Code.set(Constants.RESULT_CODE_SUCCESS,$r('app.string.enroll_success'))
- Code.set(Constants.RESULT_CODE_FAIL,$r('app.string.enrolling_fail'))
- Code.set(Constants.RESULT_CODE_GENERAL_ERROR,$r('app.string.enrolling_fail'))
- Code.set(Constants.RESULT_CODE_CANCELED,$r('app.string.enroll_info_cancel'))
- Code.set(Constants.RESULT_CODE_TIMEOUT,$r('app.string.enrolling_timeout'))
- Code.set(Constants.RESULT_CODE_TYPE_NOT_SUPPORT,$r('app.string.enrolling_fail'))
- Code.set(Constants.RESULT_CODE_TRUST_LEVEL_NOT_SUPPORT,$r('app.string.enrolling_fail'))
- Code.set(Constants.RESULT_CODE_BUSY,$r('app.string.enrolling_fail'))
- Code.set(Constants.RESULT_CODE_INVALID_PARAMETERS,$r('app.string.enrolling_fail'))
- Code.set(Constants.RESULT_CODE_LOCKED,$r('app.string.enrolling_fail'))
- Code.set(Constants.RESULT_CODE_NOT_ENROLLED,$r('app.string.enrolling_fail'))
- return Code
- }
-
- static FACE_AUTH_TIP_TOO_BRIGHT = 1
- static FACE_AUTH_TIP_TOO_DARK = 2
- static FACE_AUTH_TIP_TOO_CLOSE = 3
- static FACE_AUTH_TIP_TOO_FAR = 4
- static FACE_AUTH_TIP_TOO_HIGH = 5
- static FACE_AUTH_TIP_TOO_LOW = 6
- static FACE_AUTH_TIP_TOO_RIGHT = 7
- static FACE_AUTH_TIP_TOO_LEFT = 8
- static FACE_AUTH_TIP_TOO_MUCH_MOTION = 9
- static FACE_AUTH_TIP_POOR_GAZE = 10
- static FACE_AUTH_TIP_NOT_DETECTED = 11
-
- static FaceTips(){
- const Tips = new Map()
- Tips.set(Constants.FACE_AUTH_TIP_TOO_BRIGHT,$r('app.string.enroll_info_highlight'))
- Tips.set(Constants.FACE_AUTH_TIP_TOO_DARK,$r('app.string.enroll_info_darklight'))
- Tips.set(Constants.FACE_AUTH_TIP_TOO_CLOSE,$r('app.string.enroll_info_scale_too_large'))
- Tips.set(Constants.FACE_AUTH_TIP_TOO_FAR,$r('app.string.enroll_info_scale_too_small'))
- Tips.set(Constants.FACE_AUTH_TIP_TOO_HIGH,$r('app.string.enroll_info_offset_top'))
- Tips.set(Constants.FACE_AUTH_TIP_TOO_LOW,$r('app.string.enroll_info_offset_bottom'))
- Tips.set(Constants.FACE_AUTH_TIP_TOO_RIGHT,$r('app.string.enroll_info_offset_right'))
- Tips.set(Constants.FACE_AUTH_TIP_TOO_LEFT,$r('app.string.enroll_info_offset_left'))
- Tips.set(Constants.FACE_AUTH_TIP_TOO_MUCH_MOTION,$r('app.string.enroll_info_blur'))
- Tips.set(Constants.FACE_AUTH_TIP_POOR_GAZE,$r('app.string.enroll_info_eye_occlusion'))
- Tips.set(Constants.FACE_AUTH_TIP_NOT_DETECTED,$r('app.string.enroll_info_not_found'))
- return Tips
- }
-}
\ No newline at end of file
diff --git a/ui/faceenroll/product/phone/src/main/ets/default/model_2D.ets b/ui/faceenroll/product/phone/src/main/ets/default/model_2D.ets
deleted file mode 100644
index 51ac382..0000000
--- a/ui/faceenroll/product/phone/src/main/ets/default/model_2D.ets
+++ /dev/null
@@ -1,273 +0,0 @@
-// @ts-nocheck
-/*
- * 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 Constants from './common/constant.ets';
-import UserIDM from '@ohos.useridm';
-
-var mPrgvalue;
-var mResultCode = Constants.resultCode();
-var mFaceTips = Constants.FaceTips();
-
-export class model_2D {
- private UserIDM;
-
- constructor() {
- this.UserIDM = UserIDM.constructor();
- }
-
- /**
- * init FaceModel
- */
- initFaceModel(credentialInfo) {
- console.info("FaceEnroll model_2D initFaceModel start");
- AppStorage.Link('width');
- AppStorage.Link('showBack');
- AppStorage.Link('height');
- AppStorage.Link('showAperture');
- AppStorage.Link('blur');
- AppStorage.Link('showPrg');
- mPrgvalue = AppStorage.Link('prgValue');
- AppStorage.Link('enrollInfo');
- AppStorage.Link('showBtn');
- AppStorage.Link('enrollTitle');
- this.startEnroll(credentialInfo);
- console.info("FaceEnroll model_2D initFaceModel end");
- }
-
- /**
- * resume page, unInit FaceModel
- */
- uninitFaceModel() {
- console.info(" FaceEnroll model_2D uninitFaceModel start");
- if (mPrgvalue != Constants.PROGRESS_TOTAL) {
- this.cancelEnroll();
- }
- setTimeout(() => {
- AppStorage.Set('width', Constants.SHELTER_START_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_START_HEIGHT);
- AppStorage.Set('showBtn', false);
- AppStorage.Set('showPrg', false);
- AppStorage.Set('showBack', true);
- AppStorage.Set('blur', Constants.BLUR_START);
- AppStorage.Set('showAperture', true);
- mPrgvalue = AppStorage.Set('prgValue', $r('app.float.progress_value_start'));
- AppStorage.Set('enrollTitle', $r('app.string.face_record'));
- AppStorage.Set('enrollInfo', $r('app.string.enroll_info'));
- }, Constants.TIMEOUT_500);
- console.info(" FaceEnroll model_2D uninitFaceModel end");
- }
-
- /**
- * Open session and get challenge.
- * @param callback
- */
- openSession(callback) {
- console.info("FaceEnroll model_2D openSession start");
- this.UserIDM.openSession((data) => {
- try {
- console.info("FaceEnroll model_2D openSession data", data);
- callback(data);
- }
- catch (e) {
- console.info("FaceEnroll model_2D openSession error", e);
- }
- })
- callback();
- console.info("FaceEnroll model_2D openSession end");
- }
-
- /**
- * start enroll, get callback value
- */
- startEnroll(credentialInfo) {
- this.UserIDM.addCredential(credentialInfo, {
- onResult: (result, extraInfo) => {
- if (result == Constants.RESULT_CODE_SUCCESS) {
- console.info(" FaceEnroll model_2D startEnroll UserIDM.addCredential onResult result", result);
- AppStorage.Set('showPrg', true);
- Constants.progress_2D();
- this.endEnroll();
- }
- if (result == Constants.RESULT_CODE_FAIL) {
- console.info(" FaceEnroll model_2D startEnroll UserIDM.addCredential onResult result", result);
- AppStorage.Set('width', Constants.SHELTER_END_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_END_HEIGHT);
- AppStorage.Set('showAperture', false);
- AppStorage.Set('enrollTitle', $r('app.string.face_record_3d_record_fail'));
- AppStorage.Set('enrollInfo', mResultCode.get(result));
- AppStorage.Set('blur', Constants.BLUR_END);
- AppStorage.Set('showBtn', true);
- AppStorage.Set('showBack', false);
- AppStorage.Set('prgValue', $r('app.float.progress_value_start'));
- }
- if (result == Constants.RESULT_CODE_GENERAL_ERROR) {
- console.info(" FaceEnroll model_2D startEnroll UserIDM.addCredential onResult result", result);
- AppStorage.Set('width', Constants.SHELTER_END_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_END_HEIGHT);
- AppStorage.Set('showAperture', false);
- AppStorage.Set('enrollTitle', $r('app.string.face_record_3d_record_fail'));
- AppStorage.Set('enrollInfo', mResultCode.get(result));
- AppStorage.Set('blur', Constants.BLUR_END);
- AppStorage.Set('showBtn', true);
- AppStorage.Set('showBack', false);
- AppStorage.Set('prgValue', $r('app.float.progress_value_start'));
- }
- if (result == Constants.RESULT_CODE_CANCELED) {
- console.info(" FaceEnroll model_2D startEnroll UserIDM.addCredential onResult result", result);
- }
- if (result == Constants.RESULT_CODE_TIMEOUT) {
- console.info(" FaceEnroll model_2D startEnroll UserIDM.addCredential onResult result", result);
- AppStorage.Set('width', Constants.SHELTER_END_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_END_HEIGHT);
- AppStorage.Set('showAperture', false);
- AppStorage.Set('enrollTitle', $r('app.string.enrolling_timeout'));
- AppStorage.Set('enrollInfo', mResultCode.get(result));
- AppStorage.Set('blur', Constants.BLUR_END);
- AppStorage.Set('showBtn', true);
- AppStorage.Set('showBack', false);
- AppStorage.Set('prgValue', $r('app.float.progress_value_start'));
- }
- if (result == Constants.RESULT_CODE_TYPE_NOT_SUPPORT) {
- console.info(" FaceEnroll model_2D startEnroll UserIDM.addCredential onResult result", result);
- AppStorage.Set('width', Constants.SHELTER_END_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_END_HEIGHT);
- AppStorage.Set('showAperture', false);
- AppStorage.Set('enrollTitle', $r('app.string.face_record_3d_record_fail'));
- AppStorage.Set('enrollInfo', mResultCode.get(result));
- AppStorage.Set('blur', Constants.BLUR_END);
- AppStorage.Set('showBtn', true);
- AppStorage.Set('showBack', false);
- AppStorage.Set('prgValue', $r('app.float.progress_value_start'));
- }
- if (result == Constants.RESULT_CODE_TRUST_LEVEL_NOT_SUPPORT) {
- console.info(" FaceEnroll model_2D startEnroll UserIDM.addCredential onResult result", result);
- AppStorage.Set('width', Constants.SHELTER_END_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_END_HEIGHT);
- AppStorage.Set('showAperture', false);
- AppStorage.Set('enrollTitle', $r('app.string.face_record_3d_record_fail'));
- AppStorage.Set('enrollInfo', mResultCode.get(result));
- AppStorage.Set('blur', Constants.BLUR_END);
- AppStorage.Set('showBtn', true);
- AppStorage.Set('showBack', false);
- AppStorage.Set('prgValue', $r('app.float.progress_value_start'));
- }
- if (result == Constants.RESULT_CODE_BUSY) {
- console.info(" FaceEnroll model_2D startEnroll UserIDM.addCredential onResult result", result);
- AppStorage.Set('width', Constants.SHELTER_END_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_END_HEIGHT);
- AppStorage.Set('showAperture', false);
- AppStorage.Set('enrollTitle', $r('app.string.face_record_3d_record_fail'));
- AppStorage.Set('enrollInfo', mResultCode.get(result));
- AppStorage.Set('blur', Constants.BLUR_END);
- AppStorage.Set('showBtn', true);
- AppStorage.Set('showBack', false);
- AppStorage.Set('prgValue', $r('app.float.progress_value_start'));
- }
- if (result == Constants.RESULT_CODE_INVALID_PARAMETERS) {
- console.info(" FaceEnroll model_2D startEnroll UserIDM.addCredential onResult result", result);
- AppStorage.Set('width', Constants.SHELTER_END_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_END_HEIGHT);
- AppStorage.Set('showAperture', false);
- AppStorage.Set('enrollTitle', $r('app.string.face_record_3d_record_fail'));
- AppStorage.Set('enrollInfo', mResultCode.get(result));
- AppStorage.Set('blur', Constants.BLUR_END);
- AppStorage.Set('showBtn', true);
- AppStorage.Set('showBack', false);
- AppStorage.Set('prgValue', $r('app.float.progress_value_start'));
- }
- if (result == Constants.RESULT_CODE_LOCKED) {
- console.info(" FaceEnroll model_2D startEnroll UserIDM.addCredential onResult result", result);
- AppStorage.Set('width', Constants.SHELTER_END_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_END_HEIGHT);
- AppStorage.Set('showAperture', false);
- AppStorage.Set('enrollTitle', $r('app.string.face_record_3d_record_fail'));
- AppStorage.Set('enrollInfo', mResultCode.get(result));
- AppStorage.Set('blur', Constants.BLUR_END);
- AppStorage.Set('showBtn', true);
- AppStorage.Set('showBack', false);
- AppStorage.Set('prgValue', $r('app.float.progress_value_start'));
- }
- if (result == Constants.RESULT_CODE_NOT_ENROLLED) {
- console.info(" FaceEnroll model_2D startEnroll UserIDM.addCredential onResult result", result);
- AppStorage.Set('width', Constants.SHELTER_END_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_END_HEIGHT);
- AppStorage.Set('showAperture', false);
- AppStorage.Set('enrollTitle', $r('app.string.face_record_3d_record_fail'));
- AppStorage.Set('enrollInfo', mResultCode.get(result));
- AppStorage.Set('blur', Constants.BLUR_END);
- AppStorage.Set('showBtn', true);
- AppStorage.Set('showBack', false);
- AppStorage.Set('prgValue', $r('app.float.progress_value_start'));
- }
- },
- onAcquireInfo: (callbackModule, acquire, extraInfo) => {
- AppStorage.Set('width', Constants.SHELTER_END_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_END_HEIGHT);
- AppStorage.Set('showAperture', false);
- AppStorage.Set('enrollTitle', $r('app.string.enrolling'));
- AppStorage.Set('enrollInfo', mFaceTips.get(acquire));
- }
- })
- this.endEnroll();
- }
-
- /**
- * end enroll
- */
- endEnroll() {
- console.info("FaceEnroll model_2D endEnroll start");
- this.UserIDM.closeSession();
- console.info("FaceEnroll model_2D endEnroll userEnroll.closeSession() close");
- AppStorage.Delete('faceSession');
- console.info("FaceEnroll model_2D endEnroll end");
- }
-
- /**
- * cancel enroll
- */
- cancelEnroll() {
- console.info("FaceEnroll model_2D cancelEnroll start");
- let can = this.UserIDM.cancel(AppStorage.Get('faceSession'));
- console.info("FaceEnroll model_2D cancelEnroll userEnroll.cancel() can" + can);
- this.endEnroll();
- console.info("FaceEnroll model_2D cancelEnroll end");
- }
-
- /**
- * change index 3d
- */
- change_3D() {
- AppStorage.Set('show_startViews', '3D');
- }
-
- /**
- * change index 2d
- */
- change_2D() {
- AppStorage.Set('show_startViews', '2D');
- }
-
- /**
- * init index
- */
- init() {
- AppStorage.SetAndLink('show_startViews', '2D');
- }
-}
-
-let mFaceModel = new model_2D();
-
-export default mFaceModel as model_2D;
diff --git a/ui/faceenroll/product/phone/src/main/ets/default/model_3D.ets b/ui/faceenroll/product/phone/src/main/ets/default/model_3D.ets
deleted file mode 100644
index 8932a09..0000000
--- a/ui/faceenroll/product/phone/src/main/ets/default/model_3D.ets
+++ /dev/null
@@ -1,257 +0,0 @@
-// @ts-nocheck
-/*
- * 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 Constants from '../default/common/constant.ets';
-import UserIDM from '@ohos.useridm';
-
-var mPrgvalue;
-var mResultCode = Constants.resultCode();
-var mFaceTips = Constants.FaceTips();
-
-
-export class model_3D {
- private UserIDM;
-
- constructor() {
- this.UserIDM = UserIDM.constructor();
- }
-
- /**
- * init FaceModel
- */
- initFaceModel(credentialInfo) {
- console.info("FaceEnroll model_3D initFaceModel start");
- AppStorage.Link('width');
- AppStorage.Link('height');
- AppStorage.Link('showPrg');
- mPrgvalue = AppStorage.Link('prgValue');
- AppStorage.Link('showBtn');
- AppStorage.Link('blur');
- AppStorage.Link('showBack');
- AppStorage.Set('enrollInfo', $r('app.string.enroll_info'))
- AppStorage.Set('enrollTitle', $r('app.string.face_record'))
- AppStorage.Link('showAperture1')
- this.startEnroll(credentialInfo);
- console.info("FaceEnroll model_3D initFaceModel end");
- }
-
- /**
- * resume page, unInit FaceModel
- */
- uninitFaceModel() {
- console.info(" FaceEnroll model_3D uninitFaceModel start");
- if (mPrgvalue != Constants.PROGRESS_TOTAL) {
- this.cancelEnroll();
- }
- setTimeout(() => {
- AppStorage.Set('width', Constants.SHELTER_START_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_START_HEIGHT);
- AppStorage.Set('showPrg', false)
- mPrgvalue = AppStorage.Set('prgValue', $r('app.float.progress_value_start'))
- AppStorage.Set('showBack', true)
- AppStorage.Set('blur', Constants.BLUR_START)
- AppStorage.Set('showBtn', false)
- AppStorage.Set('enrollInfo', $r('app.string.enroll_info'))
- AppStorage.Set('enrollTitle', $r('app.string.face_record'))
- AppStorage.Set('showAperture1',true)
- AppStorage.Set('showAperture2',false)
- AppStorage.Set('showAperture3',false)
- AppStorage.Set('showAperture4',false)
- AppStorage.Set('showAperture5',false)
-
- },Constants.TIMEOUT_500)
- }
-
- /**
- * Open session and get challenge.
- * @param callback
- */
- openSession(callback) {
- console.info("FaceEnroll model_3D openSession start");
- this.UserIDM.openSession((data) => {
- try {
- console.info("FaceEnroll model_3D openSession data", data);
- callback(data);
- }
- catch (e) {
- console.info("FaceEnroll model_3D openSession error", e);
- }
- })
- callback();
- console.info("FaceEnroll model_3D openSession end");
- }
-
- /**
- * start enroll, get callback value
- */
- startEnroll(credentialInfo) {
- console.info(" FaceEnroll model_3D startEnroll 3d start ");
- this.UserIDM.addCredential(credentialInfo, {
- onResult: (result, extraInfo) => {
- if (result == Constants.RESULT_CODE_SUCCESS) {
- console.info(" FaceEnroll model_3D startEnroll UserIDM.addCredential onResult result", result);
- AppStorage.Set('showPrg', true);
- Constants.progress_2D();
- this.endEnroll();
- }
- if (result == Constants.RESULT_CODE_FAIL) {
- console.info(" FaceEnroll model_3D startEnroll UserIDM.addCredential onResult result", result);
- AppStorage.Set('width', Constants.SHELTER_END_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_END_HEIGHT);
- AppStorage.Set('showAperture', false);
- AppStorage.Set('enrollTitle', $r('app.string.face_record_3d_record_fail'));
- AppStorage.Set('enrollInfo', mResultCode.get(result));
- AppStorage.Set('blur', Constants.BLUR_END);
- AppStorage.Set('showBtn', true);
- AppStorage.Set('showBack', false);
- AppStorage.Set('prgValue', $r('app.float.progress_value_start'));
- }
- if (result == Constants.RESULT_CODE_GENERAL_ERROR) {
- console.info(" FaceEnroll model_3D startEnroll UserIDM.addCredential onResult result", result);
- AppStorage.Set('width', Constants.SHELTER_END_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_END_HEIGHT);
- AppStorage.Set('showAperture', false);
- AppStorage.Set('enrollTitle', $r('app.string.face_record_3d_record_fail'));
- AppStorage.Set('enrollInfo', mResultCode.get(result));
- AppStorage.Set('blur', Constants.BLUR_END);
- AppStorage.Set('showBtn', true);
- AppStorage.Set('showBack', false);
- AppStorage.Set('prgValue', $r('app.float.progress_value_start'));
- }
- if (result == Constants.RESULT_CODE_CANCELED) {
- console.info(" FaceEnroll model_3D startEnroll UserIDM.addCredential onResult result", result);
- }
- if (result == Constants.RESULT_CODE_TIMEOUT) {
- console.info(" FaceEnroll model_3D startEnroll UserIDM.addCredential onResult result", result);
- AppStorage.Set('width', Constants.SHELTER_END_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_END_HEIGHT);
- AppStorage.Set('showAperture', false);
- AppStorage.Set('enrollTitle', $r('app.string.enrolling_timeout'));
- AppStorage.Set('enrollInfo', mResultCode.get(result));
- AppStorage.Set('blur', Constants.BLUR_END);
- AppStorage.Set('showBtn', true);
- AppStorage.Set('showBack', false);
- AppStorage.Set('prgValue', $r('app.float.progress_value_start'));
- }
- if (result == Constants.RESULT_CODE_TYPE_NOT_SUPPORT) {
- console.info(" FaceEnroll model_3D startEnroll UserIDM.addCredential onResult result", result);
- AppStorage.Set('width', Constants.SHELTER_END_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_END_HEIGHT);
- AppStorage.Set('showAperture', false);
- AppStorage.Set('enrollTitle', $r('app.string.face_record_3d_record_fail'));
- AppStorage.Set('enrollInfo', mResultCode.get(result));
- AppStorage.Set('blur', Constants.BLUR_END);
- AppStorage.Set('showBtn', true);
- AppStorage.Set('showBack', false);
- AppStorage.Set('prgValue', $r('app.float.progress_value_start'));
- }
- if (result == Constants.RESULT_CODE_TRUST_LEVEL_NOT_SUPPORT) {
- console.info(" FaceEnroll model_3D startEnroll UserIDM.addCredential onResult result", result);
- AppStorage.Set('width', Constants.SHELTER_END_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_END_HEIGHT);
- AppStorage.Set('showAperture', false);
- AppStorage.Set('enrollTitle', $r('app.string.face_record_3d_record_fail'));
- AppStorage.Set('enrollInfo', mResultCode.get(result));
- AppStorage.Set('blur', Constants.BLUR_END);
- AppStorage.Set('showBtn', true);
- AppStorage.Set('showBack', false);
- AppStorage.Set('prgValue', $r('app.float.progress_value_start'));
- }
- if (result == Constants.RESULT_CODE_BUSY) {
- console.info(" FaceEnroll model_3D startEnroll UserIDM.addCredential onResult result", result);
- AppStorage.Set('width', Constants.SHELTER_END_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_END_HEIGHT);
- AppStorage.Set('showAperture', false);
- AppStorage.Set('enrollTitle', $r('app.string.face_record_3d_record_fail'));
- AppStorage.Set('enrollInfo', mResultCode.get(result));
- AppStorage.Set('blur', Constants.BLUR_END);
- AppStorage.Set('showBtn', true);
- AppStorage.Set('showBack', false);
- AppStorage.Set('prgValue', $r('app.float.progress_value_start'));
- }
- if (result == Constants.RESULT_CODE_INVALID_PARAMETERS) {
- console.info(" FaceEnroll model_3D startEnroll UserIDM.addCredential onResult result", result);
- AppStorage.Set('width', Constants.SHELTER_END_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_END_HEIGHT);
- AppStorage.Set('showAperture', false);
- AppStorage.Set('enrollTitle', $r('app.string.face_record_3d_record_fail'));
- AppStorage.Set('enrollInfo', mResultCode.get(result));
- AppStorage.Set('blur', Constants.BLUR_END);
- AppStorage.Set('showBtn', true);
- AppStorage.Set('showBack', false);
- AppStorage.Set('prgValue', $r('app.float.progress_value_start'));
- }
- if (result == Constants.RESULT_CODE_LOCKED) {
- console.info(" FaceEnroll model_3D startEnroll UserIDM.addCredential onResult result", result);
- AppStorage.Set('width', Constants.SHELTER_END_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_END_HEIGHT);
- AppStorage.Set('showAperture', false);
- AppStorage.Set('enrollTitle', $r('app.string.face_record_3d_record_fail'));
- AppStorage.Set('enrollInfo', mResultCode.get(result));
- AppStorage.Set('blur', Constants.BLUR_END);
- AppStorage.Set('showBtn', true);
- AppStorage.Set('showBack', false);
- AppStorage.Set('prgValue', $r('app.float.progress_value_start'));
- }
- if (result == Constants.RESULT_CODE_NOT_ENROLLED) {
- console.info(" FaceEnroll model_3D startEnroll UserIDM.addCredential onResult result", result);
- AppStorage.Set('width', Constants.SHELTER_END_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_END_HEIGHT);
- AppStorage.Set('showAperture', false);
- AppStorage.Set('enrollTitle', $r('app.string.face_record_3d_record_fail'));
- AppStorage.Set('enrollInfo', mResultCode.get(result));
- AppStorage.Set('blur', Constants.BLUR_END);
- AppStorage.Set('showBtn', true);
- AppStorage.Set('showBack', false);
- AppStorage.Set('prgValue', $r('app.float.progress_value_start'));
- }
- },
- onAcquireInfo: (callbackModule, acquire, extraInfo) => {
- AppStorage.Set('width', Constants.SHELTER_END_WIDTH);
- AppStorage.Set('height', Constants.SHELTER_END_HEIGHT);
- AppStorage.Set('showAperture', false);
- AppStorage.Set('enrollTitle', $r('app.string.enrolling'));
- AppStorage.Set('enrollInfo', mFaceTips.get(acquire));
- }
- })
- this.endEnroll();
- }
-
- /**
- * end enroll
- */
- endEnroll() {
- console.info("FaceEnroll model_3D endEnroll start");
- this.UserIDM.closeSession();
- console.info("FaceEnroll model_3D endEnroll userEnroll.closeSession()");
- AppStorage.Delete('faceSession');
- console.info("FaceEnroll model_3D endEnroll end");
- }
-
- /**
- * cancel enroll
- */
- cancelEnroll() {
- console.info("FaceEnroll model_3D cancelEnroll start");
- let can = this.UserIDM.cancel(AppStorage.Get('faceSession'));
- console.info("FaceEnroll model_3D cancelEnroll userEnroll.cancel() can" + can);
- this.endEnroll();
- console.info("FaceEnroll model_3D cancelEnroll end");
- }
-
-}
-let mFaceModel = new model_3D();
-export default mFaceModel as model_3D;
\ No newline at end of file
diff --git a/ui/faceenroll/product/phone/src/main/ets/default/pages/aperture.ets b/ui/faceenroll/product/phone/src/main/ets/default/pages/aperture.ets
deleted file mode 100644
index 89dd881..0000000
--- a/ui/faceenroll/product/phone/src/main/ets/default/pages/aperture.ets
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * 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 Constants from '../common/constant.ets';
-
-@Entry
-@Component
-export default
-struct Aperture {
- @StorageLink('showAperture1') showAperture1:boolean = true;
- @StorageLink('showAperture2') showAperture2:boolean = false;
- @StorageLink('showAperture3') showAperture3:boolean = false;
- @StorageLink('showAperture4') showAperture4:boolean = false;
- @StorageLink('showAperture5') showAperture5:boolean = false;
-
- build() {
- Flex({ alignItems: ItemAlign.Center , justifyContent:FlexAlign.Center}) {
- if (this.showAperture1) {
- Image($r('app.media.aperture1'))
- .width(Constants.APERTURE1_WIDTH)
- .height(Constants.APERTURE1_WIDTH)
- .align(Alignment.Center)
- }
- if (this.showAperture2) {
- Image($r('app.media.aperture2'))
- .width(Constants.APERTURE2_WIDTH)
- .height(Constants.APERTURE2_WIDTH)
- .align(Alignment.Center)
- }
- if (this.showAperture3) {
- Image($r('app.media.aperture3'))
- .width(Constants.APERTURE34_WIDTH)
- .height(Constants.APERTURE34_WIDTH)
- .align(Alignment.Center)
- }
- if (this.showAperture4) {
- Image($r('app.media.aperture4'))
- .width(Constants.APERTURE34_WIDTH)
- .height(Constants.APERTURE34_WIDTH)
- .align(Alignment.Center)
- }
- if (this.showAperture5) {
- Image($r('app.media.aperture5'))
- .width(Constants.APERTURE5_WIDTH)
- .height(Constants.APERTURE5_WIDTH)
- .align(Alignment.Center)
- }
- }.position({x: $r('app.float.enroll_center_position_X'),y:Constants.ENROLL_CENTER_POSITION_Y})
- .width('100%')
- .height(Constants.CENTER_HEIGHT)
- }
-}
\ No newline at end of file
diff --git a/ui/faceenroll/product/phone/src/main/ets/default/pages/enroll_2D.ets b/ui/faceenroll/product/phone/src/main/ets/default/pages/enroll_2D.ets
deleted file mode 100644
index ab2163f..0000000
--- a/ui/faceenroll/product/phone/src/main/ets/default/pages/enroll_2D.ets
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * 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 mFaceModel from "../model_2D.ets";
-import Constants from '../common/constant.ets';
-const SUBTYPE_FACE_2D = 20000;
-const AUTHTYPE_FACE = 2;
-
-async function route_back() {
- let options = {
- uri: 'pages/entryView'
- }
- try {
- await router.push(options);
- } catch (err) {
- console.error(`fail callback, code: ${err.code}, msg: ${err.msg}`);
- }
-}
-
-@Entry
-@Component
-export default struct Enroll_2D {
- @StorageLink('showAperture') showAperture: boolean = true;
- @StorageLink('blur') blur: number = Constants.BLUR_START;
- @StorageLink('width') width: any = Constants.SHELTER_START_WIDTH;
- @StorageLink('height') height: any = Constants.SHELTER_START_HEIGHT;
- @StorageLink('showPrg') showPrg: boolean = false;
- @StorageLink('prgValue') prgValue: number = Constants.PROGRESS_START;
- @StorageLink('enrollInfo') enrollInfo: any = '';
- @StorageLink('enrollTitle') enrollTitle: any = '';
- @StorageLink('showBtn') showBtn: boolean = false;
- @StorageLink('showBack') showBack: boolean = true;
- private credentialInfo;
-
- private aboutToAppear(): void {
- setTimeout(()=> {
- AppStorage.Delete('faceToken');
- router.push({
- uri: 'pages/entryView'
- });
- }, 180000)
-
- this.credentialInfo = {
- credType:AUTHTYPE_FACE,
- credSubType:SUBTYPE_FACE_2D,
- token:AppStorage.Get('token')
- };
- mFaceModel.initFaceModel(this.credentialInfo);
- }
-
- private onPageHide() {
- mFaceModel.uninitFaceModel();
- }
- private onBackPress(): void{
- AppStorage.Delete('faceToken');
- router.push({
- uri: 'pages/entryView',
- })
- }
- build() {
- Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center }) {
- Image($r('app.media.image'))
- .width('100%')
- .height(Constants.CENTER_HEIGHT)
- .align(Alignment.Center)
- .position({x: $r('app.float.enroll_center_position_X'),y:Constants.ENROLL_CENTER_POSITION_Y})
- Flex()
- .width('100%')
- .height(Constants.CENTER_HEIGHT)
- .align(Alignment.Center)
- .blur(this.blur)
- .position({x:$r('app.float.enroll_center_position_X'),y: Constants.ENROLL_CENTER_POSITION_Y})
- .animation({ duration: Constants.SHELTER_ANIMATOR, curve: Curve.Linear })
- if (this.showAperture) {
- Flex({ alignItems: ItemAlign.Center , justifyContent:FlexAlign.Center}) {
- Image($r('app.media.aperture1'))
- .width(Constants.APERTURE1_WIDTH)
- .height(Constants.APERTURE1_WIDTH)
- .align(Alignment.Center)
- }
- .position({x:$r('app.float.enroll_center_position_X'),y:Constants.ENROLL_CENTER_POSITION_Y})
- .height(Constants.CENTER_HEIGHT)
- .width('100%')
- }
-
- Flex()
- .width('100%')
- .height(Constants.ENROLL_CENTER_POSITION_Y)
- Flex({ alignItems: ItemAlign.Center , justifyContent:FlexAlign.Center}) {
- Image($r('app.media.shelter'))
- .width(this.width)
- .height(this.height)
- .animation({ duration: Constants.SHELTER_ANIMATOR, curve: Curve.Linear })
- }.width('100%')
- .height(Constants.CENTER_HEIGHT)
-
- if(this.showPrg) {
- Flex({ alignItems: ItemAlign.Center , justifyContent:FlexAlign.Center}) {
- Progress({ value: Constants.PROGRESS_START, total: Constants.PROGRESS_TOTAL, style: ProgressStyle.Capsule })
- .value(this.prgValue)
- .width(Constants.PROGRESS_WIDTH)
- .color(Color.Red)
- }.position({x:$r('app.float.enroll_center_position_X'),y:Constants.ENROLL_CENTER_POSITION_Y})
- .height(Constants.CENTER_HEIGHT)
- .width('100%')
- }
- if(this.showBack) {
- Flex() {
- Image($r('app.media.back'))
- .width(Constants.BACK_WIDTH)
- .height(Constants.BACK_HEIGHT)
- .onClick(() => {
- mFaceModel.cancelEnroll();
- router.back();
- })
- }.position({ x: $r('app.float.enroll_center_position_X'), y: Constants.CENTER_POSITION_Y })
- }
- Flex({ alignItems: ItemAlign.Center , justifyContent:FlexAlign.Center}) {
- Text(this.enrollTitle)
- .fontSize(Constants.TITLE_FONT_SIZE)
- .fontWeight(Constants.ENROll_TITLE)
- }.position({x:$r('app.float.enroll_title_position_X'),y:Constants.TITLE_ENROLLING_MARGIN})
- Flex({justifyContent:FlexAlign.Center}) {
- Text(this.enrollInfo)
- .fontSize(Constants.ERROR_CODE_INFO_SIZE)
- .textAlign(TextAlign.Center)
- }
- .position({ x:$r('app.float.enroll_info_X'), y: Constants.ENROLL_INFO_POSITION})
- .width(Constants.ENROLL_INFO_WIDTH)
- if(this.showBtn){
- Flex({justifyContent:FlexAlign.Center}) {
- Button({ type: ButtonType.Capsule, stateEffect: true }) {
- Text($r('app.string.enroll_button_content'))
- .fontSize(Constants.BUTTON_FONT_SIZE)
- .fontColor($r('app.color.startView_color'))
- }
- .backgroundColor($r('app.color.newBtn_color'))
- .width(Constants.BUTTON_WIDTH)
- .height(Constants.BUTTON_HEIGHT)
- .onClick(() => {
- route_back();
- })
- }.position({ x:$r('app.float.enroll_center_position_X'), y: Constants.BUTTON_POSITION})
- }
- }
- .width('100%')
- .height('100%')
- }
-}
\ No newline at end of file
diff --git a/ui/faceenroll/product/phone/src/main/ets/default/pages/enroll_3D.ets b/ui/faceenroll/product/phone/src/main/ets/default/pages/enroll_3D.ets
deleted file mode 100644
index cc9723a..0000000
--- a/ui/faceenroll/product/phone/src/main/ets/default/pages/enroll_3D.ets
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * 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 Aperture from './aperture.ets';
-import mFaceModel from '../model_3D.ets';
-import Constants from '../common/constant.ets';
-const SUBTYPE_FACE_2D = 20000;
-const AUTHTYPE_FACE = 2;
-
-async function route_back() {
- let options = {
- uri: 'pages/entryView'
- }
- try {
- await router.push(options);
- } catch (err) {
- console.error(`fail callback, code: ${err.code}, msg: ${err.msg}`);
- }
-}
-
-@Entry
-@Component
-struct Enroll_3D {
- @StorageLink('blur') blur: number = Constants.BLUR_START;
- @StorageLink('width') width: any = Constants.SHELTER_START_WIDTH;
- @StorageLink('height') height: any = Constants.SHELTER_START_HEIGHT;
- @StorageLink('showPrg') showPrg: boolean = false;
- @StorageLink('prgValue') prgValue: number = Constants.PROGRESS_START;
- @StorageLink('enrollInfo') enrollInfo: any = $r('app.string.enroll_info');
- @StorageLink('enrollTitle') enrollTitle: any = $r('app.string.face_record');
- @StorageLink('showBtn') showBtn: boolean = false;
- @StorageLink('showBack') showBack: boolean = true;
- private credentialInfo;
-
- private aboutToAppear(): void {
- setTimeout(()=> {
- AppStorage.Delete('faceToken');
- router.push({
- uri: 'pages/entryView'
- });
- }, 180000)
-
- this.credentialInfo = {
- credType:AUTHTYPE_FACE,
- credSubType:SUBTYPE_FACE_2D,
- token:AppStorage.Get('token')
- };
- mFaceModel.initFaceModel(this.credentialInfo);
- }
-
- private onPageHide() {
- mFaceModel.uninitFaceModel();
- }
-
- private onBackPress(): void{
- AppStorage.Delete('faceToken');
- router.push({
- uri: 'pages/entryView',
- })
- }
-
- build() {
- Flex({direction: FlexDirection.Column, alignItems: ItemAlign.Center}) {
- Image($r('app.media.image'))
- .width('100%')
- .height(Constants.CENTER_HEIGHT)
- .align(Alignment.Center)
- .position({x: $r('app.float.enroll_center_position_X'),y:Constants.ENROLL_CENTER_POSITION_Y})
-
- Flex()
- .width('100%')
- .height(Constants.CENTER_HEIGHT)
- .align(Alignment.Center)
- .blur(this.blur)
- .position({x:$r('app.float.enroll_center_position_X'),y: Constants.ENROLL_CENTER_POSITION_Y})
- .animation({ duration: Constants.SHELTER_ANIMATOR, curve: Curve.Linear })
-
- Flex()
- .width('100%')
- .height(Constants.ENROLL_CENTER_POSITION_Y)
-
- Flex({ alignItems: ItemAlign.Center , justifyContent:FlexAlign.Center}) {
- Image($r('app.media.shelter'))
- .width(this.width)
- .height(this.height)
- .animation({ duration: Constants.SHELTER_ANIMATOR, curve: Curve.Linear })
- }.width('100%')
- .height(Constants.CENTER_HEIGHT)
-
- if(this.showPrg) {
- Flex({ alignItems: ItemAlign.Center , justifyContent:FlexAlign.Center}) {
- Progress({ value: Constants.PROGRESS_START, total: Constants.PROGRESS_TOTAL, style: ProgressStyle.Capsule })
- .value(this.prgValue)
- .width(Constants.PROGRESS_WIDTH)
- .color(0x317aff)
- }.position({x:$r('app.float.enroll_center_position_X'),y: Constants.ENROLL_CENTER_POSITION_Y})
- .height(Constants.CENTER_HEIGHT)
- .width('100%')
- }
- Aperture()
- Flex({justifyContent:FlexAlign.Center}) {
- Text(this.enrollInfo)
- .fontSize(Constants.ERROR_CODE_INFO_SIZE)
- .textAlign(TextAlign.Center)
- }
- .position({ x:$r('app.float.enroll_info_X'), y: Constants.ENROLL_INFO_POSITION})
- .width(Constants.ENROLL_INFO_WIDTH)
-
- if(this.showBack) {
- Image($r('app.media.back'))
- .width(Constants.BACK_WIDTH)
- .height(Constants.BACK_HEIGHT)
- .position({ x:$r('app.float.enroll_center_position_X'), y: Constants.CENTER_POSITION_Y })
- .onClick(() => {
- mFaceModel.cancelEnroll();
- router.back();
- })
- }
- Flex({ alignItems: ItemAlign.Center , justifyContent:FlexAlign.Center}) {
- Text(this.enrollTitle)
- .fontSize(Constants.TITLE_FONT_SIZE)
- .fontWeight(Constants.ENROll_TITLE)
- }.position({x:$r('app.float.enroll_title_position_X'),y:Constants.TITLE_ENROLLING_MARGIN})
-
- if(this.showBtn){
- Flex({justifyContent:FlexAlign.Center}) {
- Button({ type: ButtonType.Capsule, stateEffect: true }) {
- Text($r('app.string.enroll_button_content'))
- .fontSize(Constants.BUTTON_FONT_SIZE)
- .fontColor($r('app.color.startView_color'))
- }
- .backgroundColor($r('app.color.newBtn_color'))
- .width(Constants.BUTTON_WIDTH)
- .height(Constants.BUTTON_HEIGHT)
- .onClick(() => {
- route_back();
- })
- }.position({ x:$r('app.float.enroll_center_position_X'), y: Constants.BUTTON_POSITION})
- }
- }
- .width('100%')
- .height('100%')
- }
-}
diff --git a/ui/faceenroll/product/phone/src/main/ets/default/pages/entryView.ets b/ui/faceenroll/product/phone/src/main/ets/default/pages/entryView.ets
deleted file mode 100644
index eafddb7..0000000
--- a/ui/faceenroll/product/phone/src/main/ets/default/pages/entryView.ets
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * 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 UserAuthPresenter from '../../../../../../../common/src/main/ets/default/common/presenter/userAuthPresenter.ets'
-
-let mUserAuthPresenter: UserAuthPresenter;
-
-@Entry
-@Component
-struct entryView {
- @State open_userAuth: boolean = false;
-
- private aboutToAppear(): void {
- AppStorage.Delete('faceInfo');
- AppStorage.Delete('authLength');
- AppStorage.Delete('userMode');
- AppStorage.Delete('faceToken');
- mUserAuthPresenter = UserAuthPresenter.getInstance();
- }
-
- build() {
- Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
- Button('人脸识别', { type: ButtonType.Normal, stateEffect: true })
- .onClick(() => {
- mUserAuthPresenter.jumpToUserAuth(this.getTokenCallBack.bind(this));
- })
- }
- }
-
-/**
- * Get token callback.
- */
- public getTokenCallBack() {
- let faceToken = AppStorage.Get('faceToken');
- if (faceToken != undefined) {
- this.jumpToUserAuth();
- }
- }
-
-/**
- * Jump to userAuth page.
- */
- private jumpToUserAuth() {
- router.push({
- uri: 'pages/userAuth',
- })
- }
-}
\ No newline at end of file
diff --git a/ui/faceenroll/product/phone/src/main/ets/default/pages/index.ets b/ui/faceenroll/product/phone/src/main/ets/default/pages/index.ets
deleted file mode 100644
index 7883a45..0000000
--- a/ui/faceenroll/product/phone/src/main/ets/default/pages/index.ets
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * 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 StartViews_2D from "./startViews_2D.ets";
-import StartViews_3D from "./startViews_3D.ets";
-import Constants from "../common/constant.ets";
-import router from '@system.router';
-
-@Entry
-@Component
-struct Index {
- @StorageLink('show_startViews') show_startViews: string = Constants.SHOW_START_VIEWS_2D;
- private onBackPress(): void{
- AppStorage.Delete('faceToken');
- router.push({
- uri: 'pages/entryView',
- })
- }
- build() {
-
- Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center }) {
- if (this.show_startViews == Constants.SHOW_START_VIEWS_3D) {
- StartViews_3D()
- }
- else if(this.show_startViews == Constants.SHOW_START_VIEWS_2D)
- {
- StartViews_2D()
- }
- }
- .width('100%')
- .height('100%')
- }
-}
diff --git a/ui/faceenroll/product/phone/src/main/ets/default/pages/startViews_2D.ets b/ui/faceenroll/product/phone/src/main/ets/default/pages/startViews_2D.ets
deleted file mode 100644
index 559f399..0000000
--- a/ui/faceenroll/product/phone/src/main/ets/default/pages/startViews_2D.ets
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * 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 Constants from '../common/constant.ets';
-import mFaceModel from "../model_2D.ets";
-
-async function routeDeclare() {
- let options = {
- uri: 'pages/declare'
- }
- try {
- await router.push(options);
- } catch (err) {
- console.error(`fail callback, code: ${err.code}, msg: ${err.msg}`);
- }
-}
-async function routeEnroll_2D() {
- let options = {
- uri: 'pages/enroll_2D'
- }
- try {
- await router.push(options);
- } catch (err) {
- console.error(`fail callback, code: ${err.code}, msg: ${err.msg}`);
- }
-}
-
-@Entry
-@Component
-export default
-struct StartViews_2D {
- @StorageLink('checkbox_color') checkbox_color : any = $r('app.color.startView_color');
- private pageHideFlag: number = 0;
-
- public openSessionCallBack() {
- routeEnroll_2D();
- }
-
- private onPageHide(): void {
- if (this.pageHideFlag == 0) {
- router.push({
- uri: 'pages/entryView'
- })
- }
- }
- private onBackPress(): void{
- AppStorage.Delete('faceToken');
- router.push({
- uri: 'pages/entryView',
- })
- }
- build() {
- Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center }) {
-
- Flex() {
- Image($r('app.media.back'))
- .width(Constants.BACK_WIDTH)
- .height(Constants.BACK_HEIGHT)
- .onClick(()=>{
- })
- }.margin({ top: $r('app.float.back_margin') })
- .width('100%')
-
-
- Text($r('app.string.face_checker'))
- .fontSize(Constants.TITLE_FONT_SIZE)
- .fontWeight(FontWeight.Bold)
- .margin({ top: Constants.TITLE_MARGIN })
-
- Image($r('app.media.startImage_2D'))
- .width('100%')
- .height(Constants.IMAGE_2D_HEIGHT)
- .margin({ top: Constants.IMAGE_MARGIN})
-
- Column() {
- Text($r('app.string.enroll_face_guide_title'))
- .fontSize(Constants.SMALL_TITLE_FONT_SIZE)
- .fontWeight(Constants.FONT_WEIGHT)
- .textAlign(TextAlign.Center)
-
- Text($r('app.string.face_guide_2d_way'))
- .fontSize(Constants.FONT_SIZE)
- .fontColor($r('app.color.font_color'))
- .textAlign(TextAlign.Center)
- .margin({ top: Constants.CONTENT1_MARGIN })
-
- Text() {
- Span($r('app.string.face_guide_2d_announce'))
- .fontColor($r('app.color.font_color'))
- .textCase(TextCase.UpperCase)
- .fontSize(Constants.FONT_SIZE)
- Span($r('app.string.face_guide_2d_announce_link'))
- .textCase(TextCase.UpperCase)
- .fontSize(Constants.FONT_SIZE)
- .fontColor($r('app.color.startView_color'))
- }.margin({ top: Constants.CONTENT2_MARGIN })
- .textAlign(TextAlign.Center)
- .onClick(() => {
- routeDeclare();
- })
-
- }.width(Constants.ENROLL_INFO_WIDTH)
- .margin({ top: Constants.IMAGE_MARGIN })
-
- Flex() {
- Toggle({ type: ToggleType.Checkbox, isOn: true })
- .size({ width: Constants.CHECKBOX_SIZE, height: Constants.CHECKBOX_SIZE })
- .selectedColor(this.checkbox_color)
- .onChange((isOn: boolean) => {console.info('Component status:' + isOn)
- })
- }.position({x:Constants.CHECKBOX_POSITION_X,y:Constants.CHECKBOX_POSITION_Y})
-
- Text($r('app.string.face_2dguide_light_notify_universal'))
- .fontSize(Constants.FONT_SIZE)
- .fontColor(Color.Black)
- .position({x:Constants.CHECKBOX_TEXT_POSITION_X,y:Constants.CHECKBOX_TEXT_POSITION_Y})
-
- Flex({justifyContent:FlexAlign.Center}) {
- Button({ type: ButtonType.Capsule, stateEffect: true }) {
- Text($r('app.string.face_record')).fontSize(Constants.BUTTON_FONT_SIZE).fontColor(0xffffff)
- }
- .backgroundColor($r('app.color.startView_color')).width(Constants.BUTTON_WIDTH).height(Constants.BUTTON_HEIGHT)
- .onClick(() => {
- this.pageHideFlag = 1;
- mFaceModel.openSession(this.openSessionCallBack.bind(this));
- })
- }.position({ x:$r('app.float.enroll_center_position_X'), y: Constants.BUTTON_POSITION})
- }
- .width('100%')
- .height('100%')
- }
-}
\ No newline at end of file
diff --git a/ui/faceenroll/product/phone/src/main/ets/default/pages/startViews_3D.ets b/ui/faceenroll/product/phone/src/main/ets/default/pages/startViews_3D.ets
deleted file mode 100644
index 8283bf8..0000000
--- a/ui/faceenroll/product/phone/src/main/ets/default/pages/startViews_3D.ets
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * 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 Constants from '../common/constant.ets';
-import mFaceModel from "../model_3D.ets";
-
-async function routeEnroll_3D() {
- let options = {
- uri: 'pages/enroll_3D'
- }
- try {
- await router.push(options);
- } catch (err) {
- console.error(`fail callback, code: ${err.code}, msg: ${err.msg}`);
- }
-}
-async function routeDeclare() {
- let options = {
- uri: 'pages/declare'
- }
- try {
- await router.push(options);
- } catch (err) {
- console.error(`fail callback, code: ${err.code}, msg: ${err.msg}`);
- }
-}
-
-@Entry
-@Component
-export default
-struct StartViews_3D {
- private pageHideFlag: number = 0;
- @StorageLink('checkbox_color') checkbox_color : any = $r('app.color.startView_color');
-
- public openSessionCallBack() {
- routeEnroll_3D();
- }
-
- private onPageHide(): void {
- if (this.pageHideFlag == 0) {
- router.push({
- uri: 'pages/entryView'
- })
- }
- }
- private onBackPress(): void{
- AppStorage.Delete('faceToken');
- router.push({
- uri: 'pages/entryView',
- })
- }
- build() {
- Flex({ direction: FlexDirection.Column,alignItems: ItemAlign.Center}) {
-
- Flex() {
- Image($r('app.media.back'))
- .width(Constants.BACK_WIDTH)
- .height(Constants.BACK_HEIGHT)
- .onClick(()=>{
- })
- }.margin({ top: $r('app.float.back_margin') })
- .width('100%')
-
- Text($r('app.string.face_checker'))
- .fontSize(Constants.TITLE_FONT_SIZE)
- .fontWeight(FontWeight.Bold)
- .margin({ top: Constants.TITLE_MARGIN })
-
- Stack(){
- Image($r('app.media.startImage1_3D'))
- .width(Constants.IMAGE_3D_WIDTH)
- .height(Constants.IMAGE_3D_WIDTH)
-
- Image($r('app.media.startImage2_3D'))
- .width(Constants.IMAGE_3D_WIDTH)
- .height(Constants.IMAGE_3D_WIDTH)
-
- }.margin({top:Constants.IMAGE_3D_MARGIN})
- .width('100%')
- .height(Constants.IMAGE_3D_WIDTH)
-
- Column() {
- Text($r('app.string.enroll_face_guide_title'))
- .fontSize(Constants.SMALL_TITLE_FONT_SIZE)
- .fontWeight(Constants.FONT_WEIGHT)
- .textAlign(TextAlign.Center)
-
- Text($r('app.string.face_guide_3d_way'))
- .fontSize(Constants.FONT_SIZE)
- .fontColor($r('app.color.font_color'))
- .textAlign(TextAlign.Center)
- .margin({ top: Constants.CONTENT1_MARGIN })
-
- Text() {
- Span($r('app.string.face_guide_3d_announce'))
- .fontColor($r('app.color.font_color'))
- .textCase(TextCase.UpperCase)
- .fontSize(Constants.FONT_SIZE)
- Span($r('app.string.face_guide_3d_announce_link'))
- .textCase(TextCase.UpperCase)
- .fontSize(Constants.FONT_SIZE)
- .fontColor($r('app.color.startView_color'))
- }
- .margin({ top: Constants.CONTENT2_MARGIN })
- .textAlign(TextAlign.Center)
- .onClick(() => {
- routeDeclare();
- })
- }.width(Constants.ENROLL_INFO_WIDTH)
- .margin({ top: Constants.IMAGE_MARGIN })
-
- Flex() {
- Toggle({ type: ToggleType.Checkbox, isOn: true })
- .size({ width: Constants.CHECKBOX_SIZE, height: Constants.CHECKBOX_SIZE })
- .selectedColor(this.checkbox_color)
- .onChange((isOn: boolean) => {
- console.info('Component status:' + isOn)
- })
- }.position({x:Constants.CHECKBOX_POSITION_X,y:Constants.CHECKBOX_POSITION_Y})
-
- Text($r('app.string.face_2dguide_light_notify_universal'))
- .fontSize(Constants.FONT_SIZE)
- .fontColor(Color.Black)
- .position({x:Constants.CHECKBOX_TEXT_POSITION_X,y:Constants.CHECKBOX_TEXT_POSITION_Y})
-
- Flex({justifyContent:FlexAlign.Center}) {
- Button({ type: ButtonType.Capsule, stateEffect: true }) {
- Text($r('app.string.face_recognitin_guide')).fontSize(Constants.BUTTON_FONT_SIZE).fontColor(0xffffff)
- }
- .backgroundColor($r('app.color.startView_color')) .width(Constants.BUTTON_WIDTH).height(Constants.BUTTON_HEIGHT)
- .onClick(() => {
- this.pageHideFlag = 1;
- mFaceModel.openSession(this.openSessionCallBack.bind(this));
- })
- }.position({ x:$r('app.float.enroll_center_position_X'), y: Constants.BUTTON_POSITION})
- }
- .width('100%')
- .height('100%')
- }
-}
\ No newline at end of file
diff --git a/ui/faceenroll/product/phone/src/main/ets/default/pages/success.ets b/ui/faceenroll/product/phone/src/main/ets/default/pages/success.ets
deleted file mode 100644
index aa73854..0000000
--- a/ui/faceenroll/product/phone/src/main/ets/default/pages/success.ets
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * 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 Constants from '../common/constant.ets';
-
-async function routeCase() {
- let options = {
- uri: 'pages/entryView'
- }
- try {
- await router.push(options);
- } catch (err) {
- console.error(`fail callback, code: ${err.code}, msg: ${err.msg}`);
- }
-}
-
-@Entry
-@Component
-struct Success {
-
- onPageShow(){
- setTimeout(()=>{
- router.push({
- uri: 'pages/userAuth'
- })
- },Constants.TIMEOUT_2000)
- }
- private onBackPress(): void{
- AppStorage.Delete('faceToken');
- router.push({
- uri: 'pages/entryView',
- })
- }
- build() {
- Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center }) {
- Flex() {
- Image($r('app.media.back'))
- .width(Constants.BACK_WIDTH)
- .height(Constants.BACK_HEIGHT)
- }.margin({ top: $r('app.float.back_margin') })
- .onClick(()=>{
- routeCase()
- })
-
- Text($r('app.string.face_record_success'))
- .fontSize(Constants.TITLE_FONT_SIZE)
- .fontWeight(FontWeight.Bold)
- .margin({ top: Constants.TITLE_MARGIN})
-
- Flex({ alignItems: ItemAlign.Center , justifyContent:FlexAlign.Center}){
- Image($r('app.media.success'))
- .width(Constants.SUCCESS_WIDTH)
- .height(Constants.SUCCESS_WIDTH)
- }.width('100%')
- .height(Constants.SUCCESS_WIDTH)
- .margin({ top: $r('app.float.success_margin') })
- }
- .width('100%')
- .height('100%')
- }
-}
\ No newline at end of file
diff --git a/ui/faceenroll/product/phone/src/main/ets/default/pages/userAuth.ets b/ui/faceenroll/product/phone/src/main/ets/default/pages/userAuth.ets
deleted file mode 100644
index b27e276..0000000
--- a/ui/faceenroll/product/phone/src/main/ets/default/pages/userAuth.ets
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * 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 userAuthModel from '../../../../../../../common/src/main/ets/default/common/model/userAuthModel.ets';
-
-@Entry
-@Component
-struct userAuth {
- @State authLength: number = 0;
- @State userMode: string = '';
- private mUserAuthModel: userAuthModel;
- private faceInfo ;
- @State faceToken: string = '';
- @State getAllCallback: boolean = false;
-
- private aboutToAppear(): void {
- this.mUserAuthModel = userAuthModel.getInstance();
- this.faceToken = AppStorage.Get('faceToken');
- if (this.mUserAuthModel != undefined) {
- this.mUserAuthModel.getUserAuthInfo(this.getAuthInfoCallback.bind(this),this.getUserMode.bind(this));
- }
- }
-
-/**
- * Get phone mode(2D or 3D).
- */
- public getUserMode() {
- this.mUserAuthModel.getUserMode(this.getUserModeCallback.bind(this));
- }
-
- onPageShow() {
- if (this.faceToken == '' || this.faceToken == undefined) {
- router.push({
- uri: 'pages/entryView',
- })
- }
- }
-
-/**
- * Get authInfo callback.
- * @param {object} authInfo - Callback data.
- * @param {function} getUserMode - Do this function after callback.
- */
- public getAuthInfoCallback(authInfo,getUserMode) {
- this.faceInfo = authInfo;
- this.authLength = authInfo.length;
- AppStorage.SetOrCreate('authLength',this.authLength);
- AppStorage.SetOrCreate('faceInfo',this.faceInfo);
- AppStorage.SetOrCreate('facePageFlag',0);
- getUserMode();
- }
-
-/**
- * Get phone mode(2D or 3D) callback.
- * @param {string} userMode - Phone mode(2D or 3D).
- */
- public getUserModeCallback(userMode) {
- this.userMode = userMode;
- AppStorage.SetOrCreate('userMode',this.userMode);
- this.getAllCallback = true;
-
- }
-
- build() {
- Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
- if (this.getAllCallback) {
- getRouter({
- authLength: this.authLength
- })
-
- }
- }
- }
-}
-
-@Component
-struct getRouter{
- @Prop authLength: number;
- public aboutToAppear() {
- if (this.authLength == 0) {
- router.push({
- uri: 'pages/index',
- })
- }else if(this.authLength > 0) {
- router.push({
- uri: 'pages/userSettings',
- })
- }
- }
-
- build() {
- Column() {}
- }
-}
\ No newline at end of file
diff --git a/ui/faceenroll/product/phone/src/main/ets/default/pages/userSettings.ets b/ui/faceenroll/product/phone/src/main/ets/default/pages/userSettings.ets
deleted file mode 100644
index 5ec6ab3..0000000
--- a/ui/faceenroll/product/phone/src/main/ets/default/pages/userSettings.ets
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * 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 faceSettings from '../../../../../../../feature/faceSettings/src/main/ets/default/pages/faceSettings.ets';
-import TrustedDevices from '../../../../../../../feature/trustedDevice/src/main/ets/default/pages/index.ets';
-import router from '@system.router';
-
-@Entry
-@Component
-struct userSettings {
- @State authLength: number = 1;
- @State userMode: string = '';
- @StorageLink('facePageFlag') facePageFlag: number = 0;
- private faceInfo;
- private faceToken;
-
- private aboutToAppear(): void {
- this.faceInfo = AppStorage.Get('faceInfo');
- this.authLength = AppStorage.Get('authLength');
- this.userMode = AppStorage.Get('userMode');
- }
-
- private onPageHide(): void {
- router.push({
- uri: 'pages/entryView'
- })
- }
- private onBackPress(): void{
- AppStorage.Delete('faceToken');
- router.push({
- uri: 'pages/entryView',
- })
- }
- onPageShow() {
-
- }
-
- build() {
- Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
- if(this.authLength != 0) {
- if (this.facePageFlag == 0) {
- faceSettings({
- faceLength: this.authLength,
- userMode: this.userMode
- });
- }else if(this.facePageFlag == 1) {
- TrustedDevices();
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/ui/faceenroll/product/phone/src/main/resources/base/element/string.json b/ui/faceenroll/product/phone/src/main/resources/base/element/string.json
deleted file mode 100644
index 9958a87..0000000
--- a/ui/faceenroll/product/phone/src/main/resources/base/element/string.json
+++ /dev/null
@@ -1,807 +0,0 @@
-{
- "string": [
- {
- "name": "app_name",
- "value": "faceEnroll"
- },
- {
- "name": "mainability_description",
- "value": "JS_Phone_Empty Feature Ability"
- },
- {
- "name": "enrolling",
- "value": "正在录入"
- },
- {
- "name": "enrolling_fail",
- "value": "录入失败"
- },
- {
- "name": "enrolling_timeout",
- "value": "录入超时"
- },
-
- {
- "name": "declare",
- "value": "声明"
- },
- {
- "name": "declare_content",
- "value": " 如果您选择添加人脸数据,在亮屏状态,您将可以通过正面注视手机屏幕瞬间解锁。人脸数据储存在您的设备,而且不会通过云服务或者其他工具备份他处。"
- },
- {
- "name": "open_clock",
- "value": "打开”拿起手机亮屏“,提升解锁体验"
- },
- {
- "name": "face_enroll",
- "value": "人脸识别"
- },
- {
- "name": "enroll_success",
- "value": "录入成功"
- },
- {
- "name": "start_title",
- "value": "如何录入面部数据"
- },
- {
- "name": "start_2D_content1",
- "value": "首先,确保摄像头清洁、面部无遮挡,录入环境光线充足、无阳光直射。然后,正对屏幕,将面部完整移入识别区。"
- },
- {
- "name": "start_2D_content2",
- "value": "人脸识别可用于解锁屏幕及访问应用锁。点击“开始录入”即表示您同意"
- },
- {
- "name": "start_2D_content3",
- "value": "关于人脸识别的声明。"
- },
- {
- "name": "start_3D_content1",
- "value": "首先,请确保您的面部全部显示在识别区内。然后注视屏幕并缓缓转动头部以完成全方位采集。"
- },
- {
- "name": "start_3D_content2",
- "value": "人脸识别可用于解锁屏幕,访问应用锁、保密柜及支付。点击“开始录入”即表示您同意"
- },
- {
- "name": "start_3D_content3",
- "value": "关于3D人脸识别的声明。"
- },
- {
- "name": "button_content",
- "value": "开始录入"
- },
- {
- "name": "enroll_info_fail",
- "value": "请确保摄像头清洁,面部无遮挡,在光线充足、无阳光直射的环境里录入。"
- },
- {
- "name": "enroll_info",
- "value": "请保持不动"
- },
- {
- "name": "enroll_info_cancel",
- "value": "被取消"
- },
- {
- "name": "enroll_info_algorithm_not_init",
- "value": "算法未初始化"
- },
- {
- "name": "enroll_info_hal_invalid",
- "value": "人脸识别demon不可用"
- },
- {
- "name": "enroll_info_over_max_faces",
- "value": "录入超过最大上限"
- },
- {
- "name": "enroll_info_invalid_parameters",
- "value": "入参无效"
- },
- {
- "name": "enroll_info_busy",
- "value": "人脸流程正在进行中,请求busy"
- },
- {
- "name": "enroll_info_has_registered",
- "value": "当前人脸已经录入过"
- },
- {
- "name": "enroll_info_bad_quality",
- "value": "图像质量太差"
- },
- {
- "name": "enroll_info_not_found",
- "value": "没检测到人脸"
- },
- {
- "name": "enroll_info_scale_too_small",
- "value": "人脸太小"
- },
- {
- "name": "enroll_info_scale_too_large",
- "value": "人脸太大"
- },
- {
- "name": "enroll_info_offset_left",
- "value": "人脸太靠左"
- },
- {
- "name": "enroll_info_offset_top",
- "value": "人脸太靠上"
- },
- {
- "name": "enroll_info_offset_right",
- "value": "人脸太靠右"
- },
- {
- "name": "enroll_info_offset_bottom",
- "value": "人脸太靠下"
- },
- {
- "name": "enroll_info_liveness_warning",
- "value": "活体检测有风险"
- },
- {
- "name": "enroll_info_liveness_failure",
- "value": "活体检测失败"
- },
- {
- "name": "enroll_info_rotated_left",
- "value": "头向左转的角度太大"
- },
- {
- "name": "enroll_info_rise",
- "value": "头抬的角度太高"
- },
- {
- "name": "enroll_info_rotated_right",
- "value": "头向右转的角度太大"
- },
- {
- "name": "enroll_info_down",
- "value": "头抬的角度太低"
- },
- {
- "name": "enroll_info_eye_occlusion",
- "value": "眼睛不清晰"
- },
- {
- "name": "enroll_info_eye_close",
- "value": "闭眼"
- },
- {
- "name": "enroll_info_mouth_occlusion",
- "value": "嘴巴不清晰"
- },
- {
- "name": "enroll_info_mutlify",
- "value": "出现多张脸"
- },
- {
- "name": "enroll_info_blur",
- "value": "脸不清晰"
- },
- {
- "name": "enroll_info_not_complete",
- "value": "脸不完整"
- },
- {
- "name": "enroll_info_darklight",
- "value": "光线太暗"
- },
- {
- "name": "enroll_info_highlight",
- "value": "光线太强"
- },
- {
- "name": "enroll_info_half_shadow",
- "value": "阴阳脸"
- },
- {
- "name": "enroll_info_darkpic",
- "value": "图片太暗"
- },
- {
- "name": "enroll_info_rotate_top_right",
- "value": "人脸头顶朝右"
- },
- {
- "name": "enroll_info_rotate_top_left",
- "value": "人脸头顶朝左"
- },
- {
- "name": "enroll_info_rotate_bottom_right",
- "value": "人脸下巴朝右"
- },
- {
- "name": "enroll_info_rotate_bottom_left",
- "value": "人脸下巴朝左"
- },
- {
- "name": "enroll_info_open_camera_failed",
- "value": "打开Camera失败"
- },
- {
- "name": "enroll_info_face_has_registered",
- "value": "转动头部"
- },
- {
- "name": "enroll_button_content",
- "value": "重新录入"
- },
- {
- "name": "description_product",
- "value": "ETS_Empty Ability"
- },
- {
- "name": "entry_product",
- "value": "entry_product"
- },
- {
- "name": "deleteTitle",
- "value": "delete"
- }
- ,{
- "name": "face_introdution_title",
- "value": "解锁时需连接可信设备"
- },
- {
- "name": "face_introdution_tip",
- "value": "进行人脸识别解锁手机时,需连接可信设备以进一步提升安全性。"
- },
- {
- "name": "trusted_devices_title",
- "value": "可信设备"
- },
- {
- "name": "face_introdution_button",
- "value": "添加可信设备"
- },
- {
- "name": "connect_tip",
- "value": "已连接"
- },
- {
- "name": "disconnect_tip",
- "value": "未连接"
- },
- {
- "name": "cancel_button",
- "value": "取消"
- },
- {
- "name": "remove_device_button",
- "value": "移除"
- },
- {
- "name": "add_device_button",
- "value": "添加"
- },
- {
- "name": "remove_device_tip",
- "value": "移除后,人脸识别解锁本机时将不再需要连接可信设备。是否移除?"
- },
- {
- "name": "remove_device_title",
- "value": "移除可信设备"
- },
- {
- "name": "add_device_or_not_tip",
- "value": "是否添加"
- },
- {
- "name": "using_tips",
- "value": "使用提示"
- },
- {
- "name": "add_device_tip",
- "value": "添加后,当可信设备与本机断开连接时,将无法使用人脸识别解锁。您可以使用其他方式解锁。"
- }
-
-
- ,
- {
- "name": "face_guide_2d_announce_link",
- "value": "关于人脸识别的声明"
- },
- {
- "name": "face_feature_desc",
- "value": "功能介绍"
- },
- {
- "name": "face_recognize_annouce_message_01",
- "value": "人脸识别是一种基于人的脸部特征信息进行身份识别的生物识别技术。它通过手机前置摄像头捕捉人脸面部数据,进而快速完成面部特征比对和身份认证。可用于解锁屏幕、访问应用锁等场景。"
- },
- {
- "name": "face_recognize_annouce_message_02",
- "value": "录入面部数据时,需注意以下事项:"
- },
- {
- "name": "face_recognize_annouce_message_03",
- "value": "1.确保摄像头清洁;"
- },
- {
- "name": "face_recognize_annouce_message_04",
- "value": "2.在光线充足的环境下录入,但需避免强光直射;"
- },
- {
- "name": "face_recognize_annouce_message_05",
- "value": "3.勿用衣帽、头发、墨镜、口罩、浓妆等遮挡面部;"
- },
- {
- "name": "face_recognize_annouce_message_06",
- "value": "4.确保面部正面完整清晰地出现在提示框内,不要闭眼、大幅度仰头或低头"
- },
- {
- "name": "face_recognize_annouce_message_07",
- "value": "5.避免其他人出现在录入画面中。"
- },
- {
- "name": "face_recognize_annouce_message_08",
- "value": "任何技术都存在一定局限和风险,使用人脸识别时,需注意以下事项:"
- },
- {
- "name": "face_recognize_annouce_message_09",
- "value": "1.在暗光、强光、逆光或角度过大等场景下,人脸识别的成功率会有所降低;"
- },
- {
- "name": "face_annouce_tip1_item2_3d",
- "value": "2.人脸识别的安全性低于图案密码、数字密码、混合密码。;"
- },
- {
- "name": "face_recognize_annouce_message_10",
- "value": "您的设备可能会被容貌、外形与您相近的人或物品解锁;"
- },
- {
- "name": "face_recognize_annouce_message_11",
- "value": "请勿将设备随意交给他人使用,避免人脸识别功能被恶意利用;"
- },
- {
- "name": "face_recognize_annouce_message_12",
- "value": "除以上事项外,您还需注意其他可能影响人脸识别功能正常使用的情况。"
- },
- {
- "name": "face_recognize_annouce_message_13",
- "value": "隐私声明"
- },
- {
- "name": "face_recognize_annouce_message_14_1",
- "value": "您的"
- },
- {
- "name": "face_recognize_annouce_message_14_2",
- "value": "将受到严格保护。该数据仅加密保存于本设备的安全隔离区域,华为不会进行备份,其他应用也无法访问或备份。例如,您使用人脸识别进行应用内认证时,应用仅能收到认证是否成功的通知,而无法访问、备份或录入"
- },
- {
- "name": "face_recognize_annouce_message_14_3",
- "value": "面部数据。"
- },
- {
- "name": "face_recognize_annouce_message_15_1",
- "value": "您拥有人脸识别的自主控制权,可灵活控制人脸识别的使用及适用范围。例如,您不想使用人脸识别访问应用锁,在“设置”中将其关闭即可,此时人脸识别仍可用于其他操作,但不可用于进入应用锁。您还可彻底删除"
- },
- {
- "name": "face_recognize_annouce_message_15_2",
- "value": "删除后本设备将不再保存这些数据。"
- },
- {
- "name": "face_recognize_annouce_message_15_3",
- "value": ""
- },
- {
- "name": "face_recognize_annouce_message_15_4",
- "value": ""
- },
- {
- "name": "face_guide_3d_announce_link",
- "value": "关于3D人脸识别的声明"
- },
- {
- "name": "face_3drecognize_annouce_message_01",
- "value": "3D人脸识别是新一代人脸识别技术。它通过深度感应技术,捕捉更丰富的面部数据,实现三维立体防伪识别。在暗光、逆光、无光等环境下,也可用于解锁屏幕,访问应用锁、保密柜及支付,其安全性、准确率和环境适应性较传统人脸识别技术大幅提升。"
- }
-
-
-
- ,
- {
- "name": "face_recognition",
- "value": "人脸识别"
- },
- {
- "name": "face_recognition_is_used",
- "value": "人脸识别用于"
- },
- {
- "name": "unlock_screen",
- "value": "解锁屏幕"
- },
- {
- "name": "slide_to_unlock",
- "value": "滑动解锁"
- },
- {
- "name": "smart_display_lock_screen_notification",
- "value": "智能显示锁屏通知"
- },
- {
- "name": "access_safe",
- "value": "访问保密柜"
- },
- {
- "name": "access_app_lock",
- "value": "访问应用锁"
- },
- {
- "name": "automatically_fill_in_account",
- "value": "自动填充账号和密码"
- },
- {
- "name": "use_password_safe_to_save_account",
- "value": "使用密码保险箱保存账号和密码"
- },
- {
- "name": "delete_face_data",
- "value": "删除面部数据"
- },
- {
- "name": "set_backup_face",
- "value": "设置备用面容"
- },
- {
- "name": "recognize_another_face",
- "value": "除继续学习您的长相外,还可识别另一种面容"
- },
- {
- "name": "main_and_backup_faces",
- "value": "已设置主用及备用面容"
- },
- {
- "name": "trusted_device_be_connected_when_unlocking",
- "value": "解锁时需连接可信设备"
- },
- {
- "name": "closed",
- "value": "已关闭"
- },
- {
- "name": "look_at_screen_during_face_recognition",
- "value": "人脸识别时需注视屏幕"
- },
- {
- "name": "fill_light",
- "value": "暗光环境下屏幕补光"
- },
- {
- "name": "auxiliary_mode",
- "value": "辅助模式"
- },
- {
- "name": "recognize_without_opening_eyes",
- "value": "开启屏幕朗读后无需睁眼即可识别"
- },
- {
- "name": "be_based_on_facial_feature_information",
- "value": "人脸识别可基于您的面部特征信息进行身份识别,了解"
- },
- {
- "name": "statement_on_face_recognition",
- "value": "关于人脸识别的声明。"
- },
- {
- "name": "statement3D_on_face_recognition",
- "value": "关于3D人脸识别的声明。"
- },
- {
- "name": "looking_for_other_settings",
- "value": "是否在寻找其设置项?"
- },
- {
- "name": "pick_up_phone_turn_on_screen",
- "value": "拿起手机亮屏"
- },
- {
- "name": "annotation_screen_keeps_on",
- "value": "注视屏幕不息屏"
- },
- {
- "name": "unlock_directly",
- "value": "直接解锁"
- },
- {
- "name": "unlock_directly_after_successful_face_recognition",
- "value": "人脸识别成功后直接解锁"
- },
- {
- "name": "Slide_to_unlock_after_successful_face_recognition",
- "value": "人脸识别成功后滑动屏幕解锁"
- },
- {
- "name": "close",
- "value": "关闭"
- },
- {
- "name": "cancel",
- "value": "取消"
- },
- {
- "name": "enable",
- "value": "启用"
- },
- {
- "name": "activate_safe",
- "value": "启动保密柜"
- },
- {
- "name": "whether_to_enable_safe",
- "value": "需开启应用文件管理保密柜完成人脸关联。是否启用?"
- },
-
- {
- "name": "activate_app_lock",
- "value": "启动应用锁"
- },
- {
- "name": "Whether_to_activate_app_lock",
- "value": "需开启应用锁功能才能完成人脸关联。是否立即启动应用锁?"
- },
- {
- "name": "delete_all_face_data",
- "value": "删除主用及备用面容"
- },
- {
- "name": "delete",
- "value": "删除"
- },
- {
- "name": "wether_delete_face_data",
- "value": "删除后,基于面部数据的功能将不可用。是否删除?"
- },
- {
- "name": "pick_up_phone",
- "value": "同时关闭拿起手机亮屏"
- },
- {
- "name": "face_checker",
- "value": "人脸识别"
- },
-
- {
- "name": "face_unlock_method",
- "value": "解锁屏幕"
- },
- {
- "name": "face_recognize_slideunlock_title",
- "value": "滑动解锁"
- },
- {
- "name": "title_apps_security_pref",
- "value": "访问应用锁"
- },
- {
- "name": "title_fill_light",
- "value": "暗光环境下屏幕补光"
- },
- {
- "name": "recommend_preference_title",
- "value": "是否在寻找其他设置项?"
- },
- {
- "name": "face_config_light_01_universal",
- "value": "拿起手机亮屏"
- },
- {
- "name": "multiface_list_title",
- "value": "面部列表"
- },
- {
- "name": "multiface_default_face_name_1",
- "value": "面部 1"
- },
- {
- "name": "multiface_default_face_name",
- "value": "面部"
- },
- {
- "name": "multiface_enroll_new_face",
- "value": "新建面部数据"
- },
- {
- "name": "multiface_face_name_title",
- "value": "面部名称"
- },
- {
- "name": "delete_face",
- "value": "删除面容"
- },
- {
- "name": "multiface_save",
- "value": "保存"
- },
- {
- "name": "face_unlock_method_close",
- "value": "关闭"
- },
- {
- "name": "face_recognize_unlock_title",
- "value": "直接解锁"
- },
- {
- "name": "face_3dguide_info_2",
- "value": "人脸识别可基于您的面部特征信息进行身份识别,了解"
- },
-
- {
- "name": "face_inform_open_applock_msg",
- "value": "需开启应用锁功能才能完成人脸关联。是否立即启用应用锁?"
- },
- {
- "name": "face_record_cancel",
- "value": "取消"
- },
-
- {
- "name": "face_recognize_unlock_summary_3d",
- "value": "人脸识别成功后直接解锁"
- },
- {
- "name": "face_recognize_slideunlock_summary_3d",
- "value": "人脸识别成功后滑动屏幕解锁"
- },
-
-
- {
- "name": "secure_notification_new",
- "value": "智能显示锁屏通知"
- },
-
- {
- "name": "face_fingerprint_settings_switch_title",
- "value": "自动填充账号和密码"
- },
- {
- "name": "face_fingerprint_settings_switch_summary",
- "value": "使用密码保险箱保存的帐号和密码"
- },
- {
- "name": "delete_record_title",
- "value": "删除面部数据"
- },
- {
- "name": "enroll_backup_face_title",
- "value": "设置备用面容"
- },
- {
- "name": "enroll_backup_face_summary",
- "value": "除继续学习您的长相外,还可识别另一种面容"
- },
- {
- "name": "title_face_stare_aux",
- "value": "人脸识别时需注视屏幕"
- },
- {
- "name": "face_inform_open_strongbox_msg",
- "value": "需要启用文件管理保密柜完成人脸关联。是否启用?"
- },
- {
- "name": "face_record_delete",
- "value": "删除"
- },
- {
- "name": "face_recognize_lighton_close_universal",
- "value": "同时关闭拿起手机亮屏"
- },
- {
- "name": "title_strong_box_pref",
- "value": "访问保密柜"
- },
- {
- "name": "face_enterance_off",
- "value": "已关闭"
- },
- {
- "name": "open_bluetooth",
- "value": "使用此功能需先开启蓝牙,点击设置"
- },
- {
- "name": "no_available_devices_title",
- "value": "没有可添加的设备"
- },
- {
- "name": "no_available_devices_tip",
- "value": "没有检测到可添加的配对设备。是否前往蓝牙设置配对?"
- },
- {
- "name": "pair_button",
- "value": "去配对"
- },
- {
- "name": "face_record",
- "value": "正在录入"
- },
- {
- "name": "face_record_3d_record_fail",
- "value": "录入失败"
- },
- {
- "name": "enroll_face_guide_title",
- "value": "如何录入面部数据"
- },
- {
- "name": "face_guide_2d_way",
- "value": "首先,确保摄像头清洁、面部无遮挡,录入环境光线充足、无阳光直射。然后,正对屏幕,将面部完整移入识别区。"
- },
- {
- "name": "face_guide_2d_announce",
- "value": "人脸识别可用于解锁屏幕及访问应用锁。点击“开始录入”即表示您同意"
- },
- {
- "name": "face_2dguide_light_notify_universal",
- "value": "打开”拿起手机亮屏“,提升解锁体验"
- },
- {
- "name": "face_guide_3d_way",
- "value": "首先,请确保您的面部全部显示在识别区内。然后注视屏幕并缓缓转动头部以完成全方位采集。"
- },
- {
- "name": "face_guide_3d_announce",
- "value": "人脸识别可用于解锁屏幕,访问应用锁、保密柜及支付。点击“开始录入”即表示您同意"
- },
- {
- "name": "face_recognitin_guide",
- "value": "开始录入"
- },
- {
- "name": "face_record_success",
- "value": "录入成功"
- },
- {
- "name": "face_record_3d_tip_close",
- "value": "人脸太小"
- },
- {
- "name": "face_record_3d_tip_far",
- "value": "人脸太大"
- },
- {
- "name": "face_enroll_too_left",
- "value": "人脸太靠左"
- },
- {
- "name": "face_enroll_too_high",
- "value": "人脸太靠上"
- },
- {
- "name": "face_enroll_too_right",
- "value": "人脸太靠右"
- },
- {
- "name": "face_enroll_too_low",
- "value": "人脸太靠下"
- },
- {
- "name": "face_record_3d_tip_multi",
- "value": "出现多张脸"
- },
- {
- "name": "face_rotate_too_left",
- "value": "头向左转的角度太大"
- },
- {
- "name": "face_rotate_too_high",
- "value": "头抬的角度太高"
- },
- {
- "name": "face_rotate_too_right",
- "value": "头向右转的角度太大"
- },
- {
- "name": "face_rotate_too_low",
- "value": "头抬的角度太低"
- }
- ]
-}
\ No newline at end of file
diff --git a/ui/faceenroll/product/phone/src/main/resources/base/media/aperture1.png b/ui/faceenroll/product/phone/src/main/resources/base/media/aperture1.png
deleted file mode 100644
index 697d7cc..0000000
Binary files a/ui/faceenroll/product/phone/src/main/resources/base/media/aperture1.png and /dev/null differ
diff --git a/ui/faceenroll/product/phone/src/main/resources/base/media/aperture2.png b/ui/faceenroll/product/phone/src/main/resources/base/media/aperture2.png
deleted file mode 100644
index 39ce11d..0000000
Binary files a/ui/faceenroll/product/phone/src/main/resources/base/media/aperture2.png and /dev/null differ
diff --git a/ui/faceenroll/product/phone/src/main/resources/base/media/aperture3.png b/ui/faceenroll/product/phone/src/main/resources/base/media/aperture3.png
deleted file mode 100644
index a827aab..0000000
Binary files a/ui/faceenroll/product/phone/src/main/resources/base/media/aperture3.png and /dev/null differ
diff --git a/ui/faceenroll/product/phone/src/main/resources/base/media/aperture4.png b/ui/faceenroll/product/phone/src/main/resources/base/media/aperture4.png
deleted file mode 100644
index 381693d..0000000
Binary files a/ui/faceenroll/product/phone/src/main/resources/base/media/aperture4.png and /dev/null differ
diff --git a/ui/faceenroll/product/phone/src/main/resources/base/media/aperture5.png b/ui/faceenroll/product/phone/src/main/resources/base/media/aperture5.png
deleted file mode 100644
index 4618da2..0000000
Binary files a/ui/faceenroll/product/phone/src/main/resources/base/media/aperture5.png and /dev/null differ
diff --git a/ui/faceenroll/product/phone/src/main/resources/base/media/back.png b/ui/faceenroll/product/phone/src/main/resources/base/media/back.png
deleted file mode 100644
index 85dcc6a..0000000
Binary files a/ui/faceenroll/product/phone/src/main/resources/base/media/back.png and /dev/null differ
diff --git a/ui/faceenroll/product/phone/src/main/resources/base/media/ic_settings_arrow.svg b/ui/faceenroll/product/phone/src/main/resources/base/media/ic_settings_arrow.svg
deleted file mode 100644
index d7dd265..0000000
--- a/ui/faceenroll/product/phone/src/main/resources/base/media/ic_settings_arrow.svg
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
diff --git a/ui/faceenroll/product/phone/src/main/resources/base/media/icon.png b/ui/faceenroll/product/phone/src/main/resources/base/media/icon.png
deleted file mode 100644
index ce307a8..0000000
Binary files a/ui/faceenroll/product/phone/src/main/resources/base/media/icon.png and /dev/null differ
diff --git a/ui/faceenroll/product/phone/src/main/resources/base/media/image.jpg b/ui/faceenroll/product/phone/src/main/resources/base/media/image.jpg
deleted file mode 100644
index 86fc073..0000000
Binary files a/ui/faceenroll/product/phone/src/main/resources/base/media/image.jpg and /dev/null differ
diff --git a/ui/faceenroll/product/phone/src/main/resources/base/media/into_arrow.svg b/ui/faceenroll/product/phone/src/main/resources/base/media/into_arrow.svg
deleted file mode 100644
index af9aaad..0000000
--- a/ui/faceenroll/product/phone/src/main/resources/base/media/into_arrow.svg
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/ui/faceenroll/product/phone/src/main/resources/base/media/phone.svg b/ui/faceenroll/product/phone/src/main/resources/base/media/phone.svg
deleted file mode 100644
index b81e4e3..0000000
--- a/ui/faceenroll/product/phone/src/main/resources/base/media/phone.svg
+++ /dev/null
@@ -1,22 +0,0 @@
-
\ No newline at end of file
diff --git a/ui/faceenroll/product/phone/src/main/resources/base/media/shelter.png b/ui/faceenroll/product/phone/src/main/resources/base/media/shelter.png
deleted file mode 100644
index dfb40a6..0000000
Binary files a/ui/faceenroll/product/phone/src/main/resources/base/media/shelter.png and /dev/null differ
diff --git a/ui/faceenroll/product/phone/src/main/resources/base/media/startImage1_3D.png b/ui/faceenroll/product/phone/src/main/resources/base/media/startImage1_3D.png
deleted file mode 100644
index aa04ba1..0000000
Binary files a/ui/faceenroll/product/phone/src/main/resources/base/media/startImage1_3D.png and /dev/null differ
diff --git a/ui/faceenroll/product/phone/src/main/resources/base/media/startImage2_3D.png b/ui/faceenroll/product/phone/src/main/resources/base/media/startImage2_3D.png
deleted file mode 100644
index cd40d2e..0000000
Binary files a/ui/faceenroll/product/phone/src/main/resources/base/media/startImage2_3D.png and /dev/null differ
diff --git a/ui/faceenroll/product/phone/src/main/resources/base/media/startImage_2D.png b/ui/faceenroll/product/phone/src/main/resources/base/media/startImage_2D.png
deleted file mode 100644
index 891a47b..0000000
Binary files a/ui/faceenroll/product/phone/src/main/resources/base/media/startImage_2D.png and /dev/null differ
diff --git a/ui/faceenroll/product/phone/src/main/resources/base/media/success.png b/ui/faceenroll/product/phone/src/main/resources/base/media/success.png
deleted file mode 100644
index 5b5ae5f..0000000
Binary files a/ui/faceenroll/product/phone/src/main/resources/base/media/success.png and /dev/null differ
diff --git a/ui/faceenroll/settings.gradle b/ui/faceenroll/settings.gradle
deleted file mode 100644
index 742508e..0000000
--- a/ui/faceenroll/settings.gradle
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * 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.
- */
-
-include ':phone', ':common', ':feature', ':feature:facesettings', ':feature:faceSettingsPad', ':feature:trustedDevice',':pad', ':feature:trusteddevicepad'
-project(':phone').projectDir = new File('./product/phone')
-project(':pad').projectDir = new File('./product/pad')
\ No newline at end of file