From de3714d04c49fdffb438ec399d1d6cf4887df51b Mon Sep 17 00:00:00 2001 From: abonadon_hk Date: Tue, 4 Jun 2024 17:05:24 +0800 Subject: [PATCH] fix : fix codecheck Signed-off-by: abonadon_hk Change-Id: I18f99626457e1fc737b81e00ed21e230a65a0b0b --- .../main/ets/common/components/FullScreen.ets | 143 +++++++++--------- .../ets/common/components/NumkeyBoard.ets | 3 +- .../main/ets/common/components/PassWord.ets | 6 +- .../ets/common/components/SixPassword.ets | 6 +- .../ets/extensionability/UserAuthAbility.ts | 2 +- entry/src/main/ets/pages/Index.ets | 28 ++-- .../ets/pages/components/CustomPassword.ets | 6 +- .../main/ets/pages/components/FaceAuth.ets | 125 +++++++-------- .../ets/pages/components/FingerprintAuth.ets | 115 +++++++------- .../ets/pages/components/PasswordAuth.ets | 24 +-- .../ets/testability/CustomMixFailAbility.ets | 6 +- .../testability/CustomMixFailTimesAbility.ets | 6 +- .../ets/testability/CustomPwdAbility.ets | 6 +- .../testability/CustomPwdNumberAbility.ets | 6 +- .../ohosTest/ets/testability/FaceAbility.ets | 6 +- .../ets/testability/FaceFailTimesAbility.ets | 6 +- .../testability/FaceFingerFailNonAbility.ets | 6 +- .../ets/testability/FaceMixAbility.ets | 6 +- .../testability/FaceMixSuccess3Ability.ets | 6 +- .../ets/testability/FaceMixSuccessAbility.ets | 6 +- .../testability/FaceMixSuccessAllAbility.ets | 6 +- .../FaceMixSuccessLandscapeAbility.ets | 6 +- .../ets/testability/FaceMixTimesAbility.ets | 6 +- .../testability/FacePinFailTimesAbility.ets | 6 +- .../ets/testability/FaceSingleAbility.ets | 6 +- .../ets/testability/FingerFailAbility.ets | 6 +- .../testability/FingerFailTimesAbility.ets | 6 +- .../ets/testability/FingerOnAbility.ets | 6 +- .../ets/testability/FingerOnNullAbility.ets | 6 +- .../ets/testability/FingerOutBackAbility.ets | 6 +- .../ets/testability/FingerOutFrontAbility.ets | 6 +- .../ets/testability/FingerOutSideAbility.ets | 6 +- .../ets/testability/FingerUnderAbility.ets | 6 +- .../testability/FingerUnderNullAbility.ets | 6 +- .../ets/testability/FingerprintAbility.ets | 6 +- .../testability/FingerprintLockAbility.ets | 6 +- .../ets/testability/PasswordAbility.ets | 6 +- .../testability/PasswordFailTimesAbility.ets | 6 +- .../ets/testability/PasswordSixAbility.ets | 6 +- .../ets/testability/PinFingerOnAbility.ets | 6 +- .../testability/PinFingerOnFailAbility.ets | 6 +- .../testability/PinFingerOutBackAbility.ets | 6 +- .../testability/PinFingerOutFrontAbility.ets | 6 +- .../testability/PinFingerOutSideAbility.ets | 6 +- .../ets/testability/PinFingerUnderAbility.ets | 6 +- .../testability/PinFingerUnderFailAbility.ets | 6 +- .../ohosTest/ets/testability/TestAbility.ets | 6 +- .../ohosTest/ets/testability/pages/Index.ets | 12 +- 48 files changed, 349 insertions(+), 343 deletions(-) diff --git a/entry/src/main/ets/common/components/FullScreen.ets b/entry/src/main/ets/common/components/FullScreen.ets index 8bf07c1..0f802ec 100644 --- a/entry/src/main/ets/common/components/FullScreen.ets +++ b/entry/src/main/ets/common/components/FullScreen.ets @@ -76,9 +76,9 @@ export default struct FullScreen { @StorageLink('passwordArrayNumber') passwordArrayNumber: string[] = []; @State passwordObj: string = ''; numKeyboard: NumKeyBoardItem[] = Constants.numKeyBoard; - @State prompt: string = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + @State prompt: string = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_use_pwd').id); - @State fingerText: string = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + @State fingerText: string = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_inscreen_fp').id); @StorageLink('screenLockDirection') screenLockDirection: number = 1; @StorageLink('SYSTEM_STATUS_BAR_HEIGHT') SYSTEM_STATUS_BAR_HEIGHT: number = 0; @@ -104,18 +104,18 @@ export default struct FullScreen { if (payload.type === Constants.noticeTypePin) { this.clearPassword(); if (payload.remainAttempts) { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_pwd_error').id); - if (num === 'first' && this.prompt !== (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + if (num === 'first' && this.prompt !== (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_recognition').id)) { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_use_pwd').id); } // 3: pin Residual number if (payload.remainAttempts < 3 && num !== 'first') { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager - .getStringSync($r('app.string.unified_authwidget_pwd_error_can_try').id) - + payload.remainAttempts + (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager + .getStringSync($r('app.string.unified_authwidget_pwd_error_can_try').id) + + payload.remainAttempts + (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_frequency').id); } } @@ -130,12 +130,12 @@ export default struct FullScreen { this.pinLock = 1; } if (payload.result === 0) { - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } } else if (payload.type === Constants.noticeTypeFace) { if (payload.remainAttempts < 5 && payload.remainAttempts > 0) { if (this.pinLock !== 1) { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_face_verify_fail_click_retry_s1').id); this.faceFingerLockArr[0] = false; } @@ -145,20 +145,20 @@ export default struct FullScreen { this.controlType.isShowFace = false; } else { if (this.pinLock !== 1) { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_recognition').id); } } } if (payload.remainAttempts === 0) { if (num !== 'first') { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_title_number_failed_face_forbidden').id); } this.faceFingerLockArr[0] = true; } if (payload.result === 0) { - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } } else if (payload.type === Constants.noticeTypeFinger) { let sensor: FingerPosition = { sensorType: '' }; @@ -168,7 +168,7 @@ export default struct FullScreen { } if (payload.remainAttempts && payload.result !== 0) { if (this.controlType.jumpFinger) { - this.fingerText = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.fingerText = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_fp_retry_s2').id); } if (sensor && this.fingerPosition.udSensorCenterYInThousandth !== undefined && @@ -180,14 +180,15 @@ export default struct FullScreen { setTimeout(() => { AuthUtils.getInstance().sendNotice('EVENT_AUTH_TYPE_READY', [Constants.noticeTypeFinger]); }, NOTICE_DELAY); - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_fp_retry_s2').id); } - this.fingerButtonPositionY = px2vp(this.fingerPosition.udSensorCenterYInThousandth / THOUSANDTH * this.screen[1]); + this.fingerButtonPositionY = px2vp(this.fingerPosition.udSensorCenterYInThousandth / + THOUSANDTH * this.screen[1]); FuncUtils.judgmentOverflow(this.fingerButtonPositionY); - this.fingerPositionY = this.fingerButtonPositionY - this.SYSTEM_STATUS_BAR_HEIGHT - - this.SYSTEM_STATUS_BAR_HEIGHT - px2vp(this.fingerPosition.udSensorRadiusInPx * RADIUS) - PADDING_8; + this.fingerPositionY = this.fingerButtonPositionY - this.SYSTEM_STATUS_BAR_HEIGHT - + this.SYSTEM_STATUS_BAR_HEIGHT - px2vp(this.fingerPosition.udSensorRadiusInPx * RADIUS) - PADDING_8; this.fingerPositionLine = this.fingerPositionY / px2vp(this.screen[1]); FuncUtils.judgmentOverflow(this.fingerPositionLine); if (num === 'first' && this.fingerPositionLine > FINGER_SENSOR_POSITION_LINE && payload.result != 0) { @@ -200,9 +201,9 @@ export default struct FullScreen { if (num === 'first') { this.controlType.isShowFinger = false; } else { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_title_number_failed_fp_forbidden').id); - this.fingerText = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.fingerText = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_title_number_failed_fp_forbidden').id); } this.faceFingerLockArr[1] = true; @@ -210,11 +211,11 @@ export default struct FullScreen { this.cancelImage = false; } if (payload.result === 0) { - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } } else { LogUtils.error(TAG, 'type: ' + payload.type); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } }) } @@ -235,16 +236,16 @@ export default struct FullScreen { FuncUtils.judgmentOverflow(tempPosition); this.fingerButtonPositionY = tempPosition / THOUSANDTH; FuncUtils.judgmentOverflow(this.fingerButtonPositionY); - this.fingerPositionY = this.fingerButtonPositionY - this.SYSTEM_STATUS_BAR_HEIGHT - - this.SYSTEM_STATUS_BAR_HEIGHT - px2vp(this.fingerPosition.udSensorRadiusInPx * RADIUS) - PADDING_8; + this.fingerPositionY = this.fingerButtonPositionY - this.SYSTEM_STATUS_BAR_HEIGHT - + this.SYSTEM_STATUS_BAR_HEIGHT - px2vp(this.fingerPosition.udSensorRadiusInPx * RADIUS) - PADDING_8; FuncUtils.judgmentOverflow(this.fingerPositionY); - this.fingerTipsPositionY = this.fingerButtonPositionY - px2vp(FINGER_Y_POSITION) - FINGER_HIGH - - this.SYSTEM_STATUS_BAR_HEIGHT - px2vp(this.fingerPosition.udSensorRadiusInPx * RADIUS) - PADDING_8; + this.fingerTipsPositionY = this.fingerButtonPositionY - px2vp(FINGER_Y_POSITION) - FINGER_HIGH - + this.SYSTEM_STATUS_BAR_HEIGHT - px2vp(this.fingerPosition.udSensorRadiusInPx * RADIUS) - PADDING_8; FuncUtils.judgmentOverflow(this.fingerTipsPositionY); - this.fingerTextPositionY = this.fingerButtonPositionY - px2vp(FINGER_Y_POSITION) - FINGER_TEXT_POSITION - - this.SYSTEM_STATUS_BAR_HEIGHT - px2vp(this.fingerPosition.udSensorRadiusInPx * RADIUS) - PADDING_8; + this.fingerTextPositionY = this.fingerButtonPositionY - px2vp(FINGER_Y_POSITION) - FINGER_TEXT_POSITION - + this.SYSTEM_STATUS_BAR_HEIGHT - px2vp(this.fingerPosition.udSensorRadiusInPx * RADIUS) - PADDING_8; FuncUtils.judgmentOverflow(this.fingerTextPositionY); } @@ -254,7 +255,7 @@ export default struct FullScreen { } } catch (error) { LogUtils.error(TAG, 'aboutToAppear catch error: ' + error?.code); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } } @@ -264,7 +265,7 @@ export default struct FullScreen { this.passwordArray = ['', '', '', '', '', '']; this.passwordObj = ''; this.numKeyboard[11].value = GO_BACK; - this.numKeyboard[11].row1 = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.numKeyboard[11].row1 = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_back').id); this.updateStorage(() => { }) @@ -275,16 +276,16 @@ export default struct FullScreen { } countdown(freezingTime: number): void { - const TRY_AGAIN = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager.getStringSync($r('app.string.unified_authwidget_postretry').id); - const PLEASE_TRY = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager.getStringSync($r('app.string.unified_authwidget_pleaseretry').id); + const TRY_AGAIN = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager.getStringSync($r('app.string.unified_authwidget_postretry').id); + const PLEASE_TRY = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager.getStringSync($r('app.string.unified_authwidget_pleaseretry').id); let promptText: string = ''; let freezingMillisecond = freezingTime; if (freezingMillisecond > 0) { - promptText = TimeUtils.getFreezingTimeNm(freezingMillisecond, (AppStorage.get("context") as common.ExtensionContext)); + promptText = TimeUtils.getFreezingTimeNm(freezingMillisecond, (AppStorage.get('context') as common.ExtensionContext)); promptText =PLEASE_TRY + promptText + TRY_AGAIN; setTimeout((t: number):void => this.countdown(t), INTERVAL, freezingTime - INTERVAL); } else { - promptText = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager.getStringSync($r('app.string.unified_authwidget_use_pwd').id); + promptText = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager.getStringSync($r('app.string.unified_authwidget_use_pwd').id); this.clearPassword(); // 0: pin unlock this.pinLock = 0; @@ -349,11 +350,11 @@ export default struct FullScreen { .margin({ bottom: $r('app.float.content_padding') }) .onClick(() => { if (!this.faceFingerLockArr[0]) { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_recognition').id); AuthUtils.getInstance().sendNotice('EVENT_AUTH_TYPE_READY', [Constants.noticeTypeFace]); } else { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_title_face_forbidden').id); } }) @@ -376,9 +377,9 @@ export default struct FullScreen { .textOverflow({ overflow: TextOverflow.None }) .height($r('app.float.size_24')) .onClick(() => { - if (this.prompt === (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + if (this.prompt === (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_face_verify_fail_click_retry_s1').id)) { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_recognition').id); AuthUtils.getInstance().sendNotice('EVENT_AUTH_TYPE_READY', [Constants.noticeTypeFace]); } @@ -538,10 +539,11 @@ export default struct FullScreen { // 0: pin unlock if (!this.IS_LANDSCAPE && this.pinLock === 0 && this.pinSubType === Constants.pinSix) { - if (this.controlType.isShowFinger && this.fingerPosition.sensorType !== 'OUT_OF_SCREEN_SENSOR' - && this.fingerPosition.sensorType !== 'NON_SENSOR') { - if (this.fingerPositionLine > FINGER_SENSOR_POSITION_LINE && this.fingerPosition.udSensorRadiusInPx !== undefined - && this.fingerPosition.udSensorCenterYInThousandth !== undefined) { + if (this.controlType.isShowFinger && this.fingerPosition.sensorType !== 'OUT_OF_SCREEN_SENSOR' && + this.fingerPosition.sensorType !== 'NON_SENSOR') { + if (this.fingerPositionLine > FINGER_SENSOR_POSITION_LINE && + this.fingerPosition.udSensorRadiusInPx !== undefined && + this.fingerPosition.udSensorCenterYInThousandth !== undefined) { Column() { NumKeyBoard({ onKeyPress: (index , callback) => { @@ -570,7 +572,7 @@ export default struct FullScreen { } else if (index === 1) { this.passwordArray[index - 1] = ''; this.numKeyboard[11].value = GO_BACK; - this.numKeyboard[11].row1 = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.numKeyboard[11].row1 = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_back').id); } else { this.passwordArray[index - 1] = ''; @@ -580,9 +582,9 @@ export default struct FullScreen { // 0: pin unlock this.pinLock = 0; this.clearPassword(); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); AuthUtils.getInstance().sendNotice(Constants.noticeEventCancel, [] || - (AppStorage.get("wantParams") as WantParams)?.type as string[]); + (AppStorage.get('wantParams') as WantParams)?.type as string[]); } else if (keyValue === CALL_PHONE) { if (this.passwordArray.join('').length < PASSWORD_ARRAY_LENGTH) { return; @@ -597,10 +599,10 @@ export default struct FullScreen { } .width(Constants.fullContainerWidth) .height('37%') - .position({ y: px2vp(this.screen[1] * NUM_KEY_BOTTOM) - - CANCEL_HIGH - MARGIN - px2vp(this.fingerPosition.udSensorRadiusInPx * RADIUS) - - px2vp((THOUSANDTH - this.fingerPosition.udSensorCenterYInThousandth) / THOUSANDTH * this.screen[1]) - - this.SYSTEM_STATUS_BAR_HEIGHT }) + .position({ y: px2vp(this.screen[1] * NUM_KEY_BOTTOM) - + CANCEL_HIGH - MARGIN - px2vp(this.fingerPosition.udSensorRadiusInPx * RADIUS) - + px2vp((THOUSANDTH - this.fingerPosition.udSensorCenterYInThousandth) / + THOUSANDTH * this.screen[1]) - this.SYSTEM_STATUS_BAR_HEIGHT }) } else { Column() { NumKeyBoard({ @@ -630,7 +632,7 @@ export default struct FullScreen { } else if (index === 1) { this.passwordArray[index - 1] = ''; this.numKeyboard[11].value = GO_BACK; - this.numKeyboard[11].row1 = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.numKeyboard[11].row1 = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_back').id); } else { this.passwordArray[index - 1] = ''; @@ -640,9 +642,9 @@ export default struct FullScreen { // 0: pin unlock this.pinLock = 0; this.clearPassword(); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); AuthUtils.getInstance().sendNotice(Constants.noticeEventCancel, [] || - (AppStorage.get("wantParams") as WantParams)?.type as string[]); + (AppStorage.get('wantParams') as WantParams)?.type as string[]); } else if (keyValue === CALL_PHONE) { if (this.passwordArray.join('').length < PASSWORD_ARRAY_LENGTH) { return; @@ -656,8 +658,8 @@ export default struct FullScreen { } .width(Constants.fullContainerWidth) .height('37%') - .position({ y: px2vp(this.screen[1] * NUM_KEY_BOTTOM) - CANCEL_HIGH - BOTTOM - - this.SYSTEM_STATUS_BAR_HEIGHT - this.SYSTEM_NAVIGATION_BAR_HEIGHT }) + .position({ y: px2vp(this.screen[1] * NUM_KEY_BOTTOM) - CANCEL_HIGH - BOTTOM - + this.SYSTEM_STATUS_BAR_HEIGHT - this.SYSTEM_NAVIGATION_BAR_HEIGHT }) } } else { Column() { @@ -688,7 +690,7 @@ export default struct FullScreen { } else if (index === 1) { this.passwordArray[index - 1] = ''; this.numKeyboard[11].value = GO_BACK; - this.numKeyboard[11].row1 = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.numKeyboard[11].row1 = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_back').id); } else { this.passwordArray[index - 1] = ''; @@ -698,9 +700,9 @@ export default struct FullScreen { // 0: pin unlock this.pinLock = 0; this.clearPassword(); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); AuthUtils.getInstance().sendNotice(Constants.noticeEventCancel, [] || - (AppStorage.get("wantParams") as WantParams)?.type as string[]); + (AppStorage.get('wantParams') as WantParams)?.type as string[]); } else if (keyValue === CALL_PHONE) { if (this.passwordArray.join('').length < PASSWORD_ARRAY_LENGTH) { return; @@ -715,8 +717,8 @@ export default struct FullScreen { } .width(Constants.fullContainerWidth) .height('37%') - .position({ y: px2vp(this.screen[1] * NUM_KEY_POSITION) - CANCEL_HIGH - - this.SYSTEM_STATUS_BAR_HEIGHT }) + .position({ y: px2vp(this.screen[1] * NUM_KEY_POSITION) - CANCEL_HIGH - + this.SYSTEM_STATUS_BAR_HEIGHT }) } } @@ -727,8 +729,9 @@ export default struct FullScreen { if (this.fingerPosition.sensorType === 'UNDER_SCREEN_SENSOR' || this.fingerPosition.sensorType === 'BOTH_SENSOR' || this.fingerPosition.sensorType === 'SensorType1') { - if (this.fingerPositionLine > FINGER_SENSOR_POSITION_LINE && !this.IS_LANDSCAPE && this.fingerPosition.udSensorRadiusInPx !== undefined - && this.fingerPosition.udSensorCenterYInThousandth !== undefined) { + if (this.fingerPositionLine > FINGER_SENSOR_POSITION_LINE && !this.IS_LANDSCAPE && + this.fingerPosition.udSensorRadiusInPx !== undefined && + this.fingerPosition.udSensorCenterYInThousandth !== undefined) { Column() { Image($r('app.media.ic_unlock_fingerprint')) .draggable(false) @@ -741,9 +744,9 @@ export default struct FullScreen { } }) } - .position({ y: px2vp(this.fingerPosition.udSensorCenterYInThousandth / THOUSANDTH * this.screen[1]) - - px2vp(this.fingerPosition.udSensorRadiusInPx * RADIUS) - - CANCEL_HIGH - this.SYSTEM_STATUS_BAR_HEIGHT }) + .position({ y: px2vp(this.fingerPosition.udSensorCenterYInThousandth / THOUSANDTH * this.screen[1]) - + px2vp(this.fingerPosition.udSensorRadiusInPx * RADIUS) - + CANCEL_HIGH - this.SYSTEM_STATUS_BAR_HEIGHT }) .width(Constants.fullContainerWidth) .height(this.controlType.isShowFinger ? $r('app.float.finger_high'): '9%') .justifyContent(FlexAlign.Start) @@ -770,8 +773,8 @@ export default struct FullScreen { .height(this.controlType.isShowFinger ? $r('app.float.finger_high'): '9%') .justifyContent(FlexAlign.Start) .alignItems(HorizontalAlign.Center) - .position({ y: px2vp(this.screen[1]) - CANCEL_HIGH - BOTTOM - - this.SYSTEM_STATUS_BAR_HEIGHT - this.SYSTEM_NAVIGATION_BAR_HEIGHT }) + .position({ y: px2vp(this.screen[1]) - CANCEL_HIGH - BOTTOM - + this.SYSTEM_STATUS_BAR_HEIGHT - this.SYSTEM_NAVIGATION_BAR_HEIGHT }) } } } @@ -782,10 +785,10 @@ export default struct FullScreen { .width(Constants.fullContainerWidth) } else if (!this.controlType.isLandscape && this.fingerPosition.udSensorRadiusInPx !== undefined) { Column() { - if (AppStorage.Get('titleLength') as number < (AppStorage.get("wantParams") as WantParams)?.title.length) { + if (AppStorage.Get('titleLength') as number < (AppStorage.get('wantParams') as WantParams)?.title.length) { Scroll() { Column() { - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .fontColor($r('sys.color.ohos_id_color_text_primary_contrary')) .fontSize($r('sys.float.ohos_id_text_size_sub_title2')) @@ -809,7 +812,7 @@ export default struct FullScreen { .scrollable(ScrollDirection.Vertical) .scrollBarColor('sys.color.ohos_id_color_foreground') } else { - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .height($r('app.float.text_high')) .fontColor($r('sys.color.ohos_id_color_text_primary_contrary')) @@ -861,7 +864,7 @@ export default struct FullScreen { this.controlType.jumpFinger = false; this.cancelImage = false; AuthUtils.getInstance().sendNotice(Constants.noticeEventCancel, [Constants.noticeTypeFinger]); - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_use_pwd').id); }) } diff --git a/entry/src/main/ets/common/components/NumkeyBoard.ets b/entry/src/main/ets/common/components/NumkeyBoard.ets index 880f7f6..b1e8fd8 100644 --- a/entry/src/main/ets/common/components/NumkeyBoard.ets +++ b/entry/src/main/ets/common/components/NumkeyBoard.ets @@ -108,7 +108,8 @@ export default struct NumKeyBoard { } } .onClick(() => { - setTimeout((index: number, callback: Function):void => this.onKeyPress?.(index, callback), 0, item.index, () => { + setTimeout((index: number, callback: Function):void => + this.onKeyPress?.(index, callback), 0, item.index, () => { }); }) .id('numKeyBordCustomPwd' + item.index) diff --git a/entry/src/main/ets/common/components/PassWord.ets b/entry/src/main/ets/common/components/PassWord.ets index a2f12c5..875a6a3 100644 --- a/entry/src/main/ets/common/components/PassWord.ets +++ b/entry/src/main/ets/common/components/PassWord.ets @@ -44,10 +44,10 @@ export default struct PassWord { build() { Column() { - if (AppStorage.Get('titleLength') as number < (AppStorage.get("wantParams") as WantParams)?.title.length) { + if (AppStorage.Get('titleLength') as number < (AppStorage.get('wantParams') as WantParams)?.title.length) { Scroll() { Column() { - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .fontSize($r('sys.float.ohos_id_text_size_body1')) .fontColor($r('sys.color.ohos_id_color_text_primary')) @@ -95,7 +95,7 @@ export default struct PassWord { .scrollable(ScrollDirection.Vertical) .scrollBarColor(Color.Gray) } else { - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .margin({ top: $r('app.float.title_padding_top') }) .fontSize($r('sys.float.ohos_id_text_size_body1')) diff --git a/entry/src/main/ets/common/components/SixPassword.ets b/entry/src/main/ets/common/components/SixPassword.ets index a13829c..b717879 100644 --- a/entry/src/main/ets/common/components/SixPassword.ets +++ b/entry/src/main/ets/common/components/SixPassword.ets @@ -41,10 +41,10 @@ export default struct SixPassword { build() { Column() { - if (AppStorage.Get('titleLength') as number < (AppStorage.get("wantParams") as WantParams)?.title.length) { + if (AppStorage.Get('titleLength') as number < (AppStorage.get('wantParams') as WantParams)?.title.length) { Scroll() { Column() { - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .fontSize($r('sys.float.ohos_id_text_size_body1')) .fontColor($r('sys.color.ohos_id_color_text_primary')) @@ -115,7 +115,7 @@ export default struct SixPassword { .scrollable(ScrollDirection.Vertical) .scrollBarColor(Color.Gray) } else { - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .margin({ top: $r('app.float.title_padding_top') }) .fontSize($r('sys.float.ohos_id_text_size_body1')) diff --git a/entry/src/main/ets/extensionability/UserAuthAbility.ts b/entry/src/main/ets/extensionability/UserAuthAbility.ts index e274be4..d20ef51 100644 --- a/entry/src/main/ets/extensionability/UserAuthAbility.ts +++ b/entry/src/main/ets/extensionability/UserAuthAbility.ts @@ -27,7 +27,7 @@ const MASK_THIN_COLOR = '#33182431'; export default class UserAuthAbility extends UserAuthExtensionAbility { onCreate() { LogUtils.info(TAG, 'UserAuthExtensionAbility onCreate'); - AppStorage.setOrCreate("context", this.context); + AppStorage.setOrCreate('context', this.context); } onForeground(): void { diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index 2af64d7..f38c1bc 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -52,28 +52,28 @@ struct Index { screen.getAllScreens((err, data) => { if (err.code) { LogUtils.error(TAG, 'Failed to get all screens. err: ' + err.code); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); return; } LogUtils.debug(TAG, ' get all screens. result:-- ' + JSON.stringify(data)); - this.isLandscape = data[0]?.orientation === LANDSCAPE - || data[0]?.supportedModeInfo[0]?.width > data[0]?.supportedModeInfo[0]?.height; + this.isLandscape = data[0]?.orientation === LANDSCAPE || + data[0]?.supportedModeInfo[0]?.width > data[0]?.supportedModeInfo[0]?.height; AppStorage.SetOrCreate('titleLength', (data[0]?.supportedModeInfo[0]?.width * 0.8 / fp2px(16))) LogUtils.debug(TAG, 'titleLength: ' + (data[0]?.supportedModeInfo[0]?.width * 0.8 / fp2px(16))); - LogUtils.debug(TAG, 'title: ' + (AppStorage.get("wantParams") as WantParams)?.title.length); + LogUtils.debug(TAG, 'title: ' + (AppStorage.get('wantParams') as WantParams)?.title.length); AppStorage.SetOrCreate('IS_LANDSCAPE', this.isLandscape); - LogUtils.debug(TAG, 'WantParams: ' + JSON.stringify(AppStorage.get("wantParams") as WantParams)); - if ((AppStorage.get("wantParams") as WantParams)) { - this.getParams((AppStorage.get("wantParams") as WantParams)); + LogUtils.debug(TAG, 'WantParams: ' + JSON.stringify(AppStorage.get('wantParams') as WantParams)); + if ((AppStorage.get('wantParams') as WantParams)) { + this.getParams((AppStorage.get('wantParams') as WantParams)); this.handleAuthStart(); - this.cmdData = (AppStorage.get("wantParams") as WantParams)?.cmd as CmdType[]; + this.cmdData = (AppStorage.get('wantParams') as WantParams)?.cmd as CmdType[]; } else { LogUtils.error(TAG, 'aboutToAppear wantParams null'); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } if (this.isLandscape && this.underFingerPrint) { setTimeout(() => { - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); }, FIVE_SECOND) } else { this.loadFlag = true; @@ -81,7 +81,7 @@ struct Index { }); } catch (error) { LogUtils.error(TAG, 'getAllScreens catch error: ' + error?.code); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } } @@ -102,7 +102,7 @@ struct Index { }); } catch (error) { LogUtils.error(TAG, 'getUserAuthWidgetMgr catch error: ' + error?.code); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } } @@ -159,7 +159,7 @@ struct Index { return userAuth.UserAuthType.PIN; } }) - AppStorage.setOrCreate("widgetContextId", resultInfo?.widgetContextId); + AppStorage.setOrCreate('widgetContextId', resultInfo?.widgetContextId); this.authType = newType; this.type = resultInfo?.type; this.windowModeType = resultInfo?.windowModeType; @@ -173,7 +173,7 @@ struct Index { if (this.isLandscape && this.underFingerPrint) { Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.Center, alignItems: ItemAlign.End }) { Column() { - Text((AppStorage.get("context") as common.ExtensionContext)?.resourceManager + Text((AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_tip_verify_in_portrait_mode').id)) .draggable(false) .fontColor($r('sys.color.ohos_id_color_text_primary_contrary')) diff --git a/entry/src/main/ets/pages/components/CustomPassword.ets b/entry/src/main/ets/pages/components/CustomPassword.ets index 0e85b00..5accf6b 100644 --- a/entry/src/main/ets/pages/components/CustomPassword.ets +++ b/entry/src/main/ets/pages/components/CustomPassword.ets @@ -61,7 +61,7 @@ export default struct CustomPassword { }); } catch (error) { LogUtils.error(TAG, 'aboutToAppear PINAuth catch error: ' + error?.code); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } } @@ -93,9 +93,9 @@ export default struct CustomPassword { .backgroundColor(this.isBackTouched ? $r('sys.color.ohos_id_color_hover'): Color.Transparent) .onClick(() => { - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); AuthUtils.getInstance().sendNotice(Constants.noticeEventCancel, [] || - (AppStorage.get("wantParams") as WantParams)?.type as string[]); + (AppStorage.get('wantParams') as WantParams)?.type as string[]); }) .onTouch((event?: TouchEvent) => { if (event == undefined) { diff --git a/entry/src/main/ets/pages/components/FaceAuth.ets b/entry/src/main/ets/pages/components/FaceAuth.ets index 67fe200..5cfce39 100644 --- a/entry/src/main/ets/pages/components/FaceAuth.ets +++ b/entry/src/main/ets/pages/components/FaceAuth.ets @@ -47,7 +47,7 @@ let pinData = ''; @Component export default struct FaceAuth { - @State prompt: string = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + @State prompt: string = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_recognition').id); @State @Watch('onTextValueChange') textValue: string = ''; @Link @Watch('onCmdDataChange') cmdData: Array; @@ -73,12 +73,12 @@ export default struct FaceAuth { @StorageLink('SYSTEM_NAVIGATION_BAR_HEIGHT') SYSTEM_NAVIGATION_BAR_HEIGHT: number = 0; countTime(freezingTime: number): void { - const TRY_AGAIN = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager.getStringSync($r('app.string.unified_authwidget_postretry').id); + const TRY_AGAIN = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager.getStringSync($r('app.string.unified_authwidget_postretry').id); let promptText: string = ''; let freezingMillisecond = freezingTime; if (freezingMillisecond > 0) { - promptText = TimeUtils.getFreezingTimeNm(freezingMillisecond, (AppStorage.get("context") as common.ExtensionContext)); - promptText = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + promptText = TimeUtils.getFreezingTimeNm(freezingMillisecond, (AppStorage.get('context') as common.ExtensionContext)); + promptText = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_many_failures').id) + promptText + TRY_AGAIN; setTimeout((t: number):void => this.countTime(t), INTERVAL, freezingTime - INTERVAL); } else { @@ -102,17 +102,17 @@ export default struct FaceAuth { let tempFingerPositionY = px2vp(this.screen[1]) * this.fingerPosition.udSensorCenterYInThousandth; FuncUtils.judgmentOverflow(tempFingerPositionY); if (tempPosition < FINGER_SENSOR_POSITION_LINE) { - this.fingerPositionY = (tempFingerPositionY / THOUSANDTH) - px2vp(this.screen[1]) - + this.SYSTEM_NAVIGATION_BAR_HEIGHT - MARGIN_TOP - px2vp(this.fingerPosition.udSensorRadiusInPx); + this.fingerPositionY = (tempFingerPositionY / THOUSANDTH) - px2vp(this.screen[1]) + + this.SYSTEM_NAVIGATION_BAR_HEIGHT - MARGIN_TOP - px2vp(this.fingerPosition.udSensorRadiusInPx); } else { - this.fingerPositionY = (tempFingerPositionY / THOUSANDTH) - px2vp(this.screen[1]) - + this.SYSTEM_NAVIGATION_BAR_HEIGHT - PADDING_24 - px2vp(this.fingerPosition.udSensorRadiusInPx); + this.fingerPositionY = (tempFingerPositionY / THOUSANDTH) - px2vp(this.screen[1]) + + this.SYSTEM_NAVIGATION_BAR_HEIGHT - PADDING_24 - px2vp(this.fingerPosition.udSensorRadiusInPx); } FuncUtils.judgmentOverflow(this.fingerPositionY); } LogUtils.info(TAG, 'aboutToAppear this.fingerPositionY: ' + this.fingerPositionY); if (this.dialogType === DialogType.PIN_FACE || this.dialogType === DialogType.FACE) { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_recognition').id); AuthUtils.getInstance().sendNotice('EVENT_AUTH_TYPE_READY', [Constants.noticeTypeFace]); } else if (this.dialogType === DialogType.ALL) { @@ -120,7 +120,7 @@ export default struct FaceAuth { .sendNotice('EVENT_AUTH_TYPE_READY', [Constants.noticeTypeFinger, Constants.noticeTypeFace]); } else { LogUtils.error(TAG, 'aboutToAppear not support type'); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } pinAuthManager = new account_osAccount.PINAuth(); pinAuthManager.registerInputer({ @@ -132,7 +132,7 @@ export default struct FaceAuth { }); } catch (error) { LogUtils.error(TAG, 'aboutToAppear catch error: ' + error?.code); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } } @@ -144,7 +144,8 @@ export default struct FaceAuth { if ([DialogType.PIN_FACE, DialogType.ALL].includes(this.dialogType)) { LogUtils.debug(TAG, 'toPin this.dialogType: ' + this.dialogType); if (this.dialogType === DialogType.ALL) { - AuthUtils.getInstance().sendNotice(Constants.noticeEventCancel, [Constants.noticeTypeFace, Constants.noticeTypeFinger]); + AuthUtils.getInstance().sendNotice(Constants.noticeEventCancel, + [Constants.noticeTypeFace, Constants.noticeTypeFinger]); } else if (this.dialogType === DialogType.PIN_FACE) { AuthUtils.getInstance().sendNotice(Constants.noticeEventCancel, [Constants.noticeTypeFace]); } else { @@ -160,7 +161,7 @@ export default struct FaceAuth { sendFaceEvent(): void { if (!this.faceLock) { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_recognition').id); AuthUtils.getInstance().sendNotice('EVENT_AUTH_TYPE_READY', [Constants.noticeTypeFace]); } @@ -196,24 +197,24 @@ export default struct FaceAuth { const payload: CmdData = item.payload; if (payload.type === Constants.noticeTypePin) { if (payload.result === 0) { - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } else if (payload.result && payload.result === Constants.authResultPinExpired) { - this.inputValue = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.inputValue = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_pwd_error').id); this.textValue = ''; return; } else { if (payload.remainAttempts) { - this.inputValue = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.inputValue = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_pwd_error').id); this.textValue = ''; if (num === 'first') { this.inputValue = ''; } if (payload.remainAttempts < HINT_TIMES_BY_FAIL_LESS) { - this.inputValue = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager - .getStringSync($r('app.string.unified_authwidget_pwd_error_can_try').id) - + payload.remainAttempts + (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.inputValue = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager + .getStringSync($r('app.string.unified_authwidget_pwd_error_can_try').id) + + payload.remainAttempts + (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_frequency').id); } } @@ -229,22 +230,22 @@ export default struct FaceAuth { return; } if (payload.result && payload.result === Constants.authResultPinExpired) { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_face_verify_fail_click_retry_s1').id); this.faceLock = false; return; } if (payload.remainAttempts && payload.result !== 0) { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_face_verify_fail_click_retry_s1').id); this.faceLock = false; } if (num === 'first') { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_recognition').id); } if (payload.remainAttempts === 0) { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_title_number_failed_face_forbidden').id); this.faceLock = true; if (this.dialogType === DialogType.ALL) { @@ -256,10 +257,10 @@ export default struct FaceAuth { } } if (payload.result === 0) { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_recognize_success').id) setTimeout(() => { - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); }, SECOND); } } else if (payload.type === Constants.noticeTypeFinger) { @@ -293,7 +294,7 @@ export default struct FaceAuth { } } if ((payload.remainAttempts && payload.result !== 0) || payload.result === Constants.authResultPinExpired) { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_fp_retry_s2').id); this.fingerLock = false; if (num !== 'first' && payload.remainAttempts > 0 && payload.result !== 0) { @@ -303,11 +304,11 @@ export default struct FaceAuth { } } if (num === 'first') { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_normal_fp_only').id); } if (payload.remainAttempts === 0) { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_title_number_failed_fp_forbidden').id); this.fingerLock = true; if (this.dialogType === DialogType.ALL) { @@ -319,15 +320,15 @@ export default struct FaceAuth { } } if (payload.result === 0) { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_fp_verify_success').id) setTimeout(() => { - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); }, SECOND); } } else { LogUtils.error(TAG, 'onCmdDataChange default'); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } }) } @@ -337,9 +338,9 @@ export default struct FaceAuth { AuthUtils.getInstance().sendNotice(Constants.noticeEventCancel, [Constants.noticeTypePin]); } else { AuthUtils.getInstance().sendNotice(Constants.noticeEventCancel, [] || - (AppStorage.get("wantParams") as WantParams)?.type as string[]); + (AppStorage.get('wantParams') as WantParams)?.type as string[]); } - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } build() { @@ -481,7 +482,7 @@ export default struct FaceAuth { }) } - if (AppStorage.Get('titleLength') as number < (AppStorage.get("wantParams") as WantParams)?.title.length) { + if (AppStorage.Get('titleLength') as number < (AppStorage.get('wantParams') as WantParams)?.title.length) { Scroll() { Column() { Image($r('app.media.error_faceID')) @@ -494,7 +495,7 @@ export default struct FaceAuth { .onClick(() => { this.sendFaceEvent(); }) - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .fontSize($r('sys.float.ohos_id_text_size_body1')) .fontColor($r('sys.color.ohos_id_color_text_primary')) @@ -505,7 +506,7 @@ export default struct FaceAuth { .margin({ top: $r('app.float.element_margin') }) .height($r('app.float.size_24')) .fontSize($r('sys.float.ohos_id_text_size_body2')) - .fontColor(this.onFontColor(this.prompt, (AppStorage.get("context") as common.ExtensionContext))) + .fontColor(this.onFontColor(this.prompt, (AppStorage.get('context') as common.ExtensionContext))) }.margin({left: $r('app.float.size_24'), right: $r('app.float.size_24')}) } .width('100%') @@ -524,7 +525,7 @@ export default struct FaceAuth { .onClick(() => { this.sendFaceEvent(); }) - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .fontSize($r('sys.float.ohos_id_text_size_body1')) .fontColor($r('sys.color.ohos_id_color_text_primary')) @@ -536,7 +537,7 @@ export default struct FaceAuth { .margin({ top: $r('app.float.element_margin') }) .height($r('app.float.size_24')) .fontSize($r('sys.float.ohos_id_text_size_body2')) - .fontColor(this.onFontColor(this.prompt, (AppStorage.get("context") as common.ExtensionContext))) + .fontColor(this.onFontColor(this.prompt, (AppStorage.get('context') as common.ExtensionContext))) } Image($r('app.media.ic_blue_fingerprint')) .draggable(false) @@ -561,10 +562,10 @@ export default struct FaceAuth { right: ($r('sys.float.ohos_id_dialog_margin_end')), bottom: ($r('sys.float.ohos_id_dialog_margin_bottom')) }) - } else if (this.dialogTypeFlag === PIN_FACE_FINGER && this.screenType === SCREEN_LAND - && this.fingerPosition.udSensorRadiusInPx !== undefined) { + } else if (this.dialogTypeFlag === PIN_FACE_FINGER && this.screenType === SCREEN_LAND && + this.fingerPosition.udSensorRadiusInPx !== undefined) { Column() { - if (AppStorage.Get('titleLength') as number < (AppStorage.get("wantParams") as WantParams)?.title.length) { + if (AppStorage.Get('titleLength') as number < (AppStorage.get('wantParams') as WantParams)?.title.length) { Scroll() { Column() { // Facial fingerprint password, second form @@ -578,7 +579,7 @@ export default struct FaceAuth { .onClick(() => { this.sendFaceEvent(); }) - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .fontSize($r('sys.float.ohos_id_text_size_body1')) .fontColor($r('sys.color.ohos_id_color_text_primary')) @@ -602,7 +603,7 @@ export default struct FaceAuth { .onClick(() => { this.sendFaceEvent(); }) - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .fontSize($r('sys.float.ohos_id_text_size_body1')) .fontColor($r('sys.color.ohos_id_color_text_primary')) @@ -625,9 +626,9 @@ export default struct FaceAuth { .margin({ top: $r('app.float.content_padding') }) .fontSize($r('sys.float.ohos_id_text_size_body2')) .height($r('app.float.size_24')) - .fontColor(this.onFontColor(this.prompt, (AppStorage.get("context") as common.ExtensionContext))) + .fontColor(this.onFontColor(this.prompt, (AppStorage.get('context') as common.ExtensionContext))) .onClick(() => { - if (this.prompt === (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + if (this.prompt === (AppStorage.get('context') as common.ExtensionContext)?.resourceManager ?.getStringSync($r('app.string.unified_authwidget_hint_face_verify_fail_click_retry_s1').id)) { this.sendFaceEvent(); } @@ -689,15 +690,15 @@ export default struct FaceAuth { Column() { if (this.dialogTypeFlag === PIN_FACE) { // Pin FACE - if (AppStorage.Get('titleLength') as number < (AppStorage.get("wantParams") as WantParams)?.title.length) { + if (AppStorage.Get('titleLength') as number < (AppStorage.get('wantParams') as WantParams)?.title.length) { Scroll() { Column() { - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .fontSize($r('sys.float.ohos_id_text_size_body1')) .fontColor($r('sys.color.ohos_id_color_text_primary')) .fontWeight(FontWeight.Medium) - Image(this.prompt !== (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + Image(this.prompt !== (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_recognize_success').id) ? $r('app.media.error_faceID') : $r('app.media.right_faceID')) .draggable(false) @@ -713,7 +714,7 @@ export default struct FaceAuth { }) Text(this.prompt).fontSize($r('sys.float.ohos_id_text_size_body2')) .draggable(false) - .fontColor(this.onFontColor(this.prompt, (AppStorage.get("context") as common.ExtensionContext))) + .fontColor(this.onFontColor(this.prompt, (AppStorage.get('context') as common.ExtensionContext))) .height($r('app.float.size_24')) .onClick(() => { this.sendFaceEvent(); @@ -726,14 +727,14 @@ export default struct FaceAuth { .scrollable(ScrollDirection.Vertical) .scrollBarColor(Color.Gray) } else { - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .margin({ top: $r('app.float.title_padding_top') }) .fontSize($r('sys.float.ohos_id_text_size_body1')) .fontColor($r('sys.color.ohos_id_color_text_primary')) .height($r('app.float.size_24')) .fontWeight(FontWeight.Medium) - Image(this.prompt !== (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + Image(this.prompt !== (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_recognize_success').id) ? $r('app.media.error_faceID') : $r('app.media.right_faceID')) .draggable(false) @@ -749,7 +750,7 @@ export default struct FaceAuth { }) Text(this.prompt).fontSize($r('sys.float.ohos_id_text_size_body2')) .draggable(false) - .fontColor(this.onFontColor(this.prompt, (AppStorage.get("context") as common.ExtensionContext))) + .fontColor(this.onFontColor(this.prompt, (AppStorage.get('context') as common.ExtensionContext))) .height($r('app.float.size_24')) .onClick(() => { this.sendFaceEvent(); @@ -872,16 +873,16 @@ export default struct FaceAuth { } if (this.dialogTypeFlag === SINGLE_FACE) { // Single FACE - if (AppStorage.Get('titleLength') as number < (AppStorage.get("wantParams") as WantParams)?.title.length) { + if (AppStorage.Get('titleLength') as number < (AppStorage.get('wantParams') as WantParams)?.title.length) { Scroll() { Column() { - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .fontSize($r('sys.float.ohos_id_text_size_body1')) .fontColor($r('sys.color.ohos_id_color_text_primary')) .fontWeight(FontWeight.Medium) .id('titleFaceAuth') - Image(this.prompt !== (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + Image(this.prompt !== (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_recognize_success').id) ? $r('app.media.error_faceID') : $r('app.media.right_faceID')) .draggable(false) @@ -901,7 +902,7 @@ export default struct FaceAuth { .fontSize($r('sys.float.ohos_id_text_size_body2')) .id('textFaceAuth') .height($r('app.float.size_24')) - .fontColor(this.onFontColor(this.prompt, (AppStorage.get("context") as common.ExtensionContext))) + .fontColor(this.onFontColor(this.prompt, (AppStorage.get('context') as common.ExtensionContext))) .onClick(() => { this.sendFaceEvent(); }) @@ -913,7 +914,7 @@ export default struct FaceAuth { .scrollable(ScrollDirection.Vertical) .scrollBarColor(Color.Gray) } else { - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .margin({ top: $r('app.float.title_padding_top') }) .fontSize($r('sys.float.ohos_id_text_size_body1')) @@ -921,7 +922,7 @@ export default struct FaceAuth { .height($r('app.float.size_24')) .fontWeight(FontWeight.Medium) .id('titleFaceAuth') - Image(this.prompt !== (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + Image(this.prompt !== (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_recognize_success').id) ? $r('app.media.error_faceID') : $r('app.media.right_faceID')) .draggable(false) @@ -941,12 +942,12 @@ export default struct FaceAuth { .fontSize($r('sys.float.ohos_id_text_size_body2')) .id('textFaceAuth') .height($r('app.float.size_24')) - .fontColor(this.onFontColor(this.prompt, (AppStorage.get("context") as common.ExtensionContext))) + .fontColor(this.onFontColor(this.prompt, (AppStorage.get('context') as common.ExtensionContext))) .onClick(() => { this.sendFaceEvent(); }) } - if (!((AppStorage.get("wantParams") as WantParams)?.navigationButtonText as string)) { + if (!((AppStorage.get('wantParams') as WantParams)?.navigationButtonText as string)) { Row() { Column() { Button($r('app.string.unified_authwidget_cancel'), { stateEffect: true }) @@ -987,10 +988,10 @@ export default struct FaceAuth { .color($r('sys.color.ohos_id_color_list_separator')) .width($r('app.float.divider_width')) Column() { - Button((AppStorage.get("wantParams") as WantParams)?.navigationButtonText as string) + Button((AppStorage.get('wantParams') as WantParams)?.navigationButtonText as string) .onClick(() => { AuthUtils.getInstance().sendNotice('EVENT_AUTH_USER_NAVIGATION', [Constants.noticeTypeFace]); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); }) .margin({ right: $r('app.float.content_padding') }) .width(Constants.ninetyPercentWidth) diff --git a/entry/src/main/ets/pages/components/FingerprintAuth.ets b/entry/src/main/ets/pages/components/FingerprintAuth.ets index fa5327e..ee4fb2f 100644 --- a/entry/src/main/ets/pages/components/FingerprintAuth.ets +++ b/entry/src/main/ets/pages/components/FingerprintAuth.ets @@ -53,7 +53,7 @@ export default struct FingerprintAuth { @Link type: string; @Link pinSubType: string; @Link dialogType: DialogType; - @State prompt: string = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + @State prompt: string = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_inscreen_fp').id); @State @Watch('onTextValueChange') textValue: string = ''; @Link @Watch('onCmdDataChange') cmdData: Array; @@ -78,12 +78,13 @@ export default struct FingerprintAuth { if (this.cmdData && this.cmdData.length > 0) { this.onCmdDataChange('first'); } - if (this.fingerPosition.udSensorCenterYInThousandth !== undefined && (this.screenType === ON_SCREEN || this.screenType === UNDER_SCREEN)) { + if (this.fingerPosition.udSensorCenterYInThousandth !== undefined && (this.screenType === ON_SCREEN || + this.screenType === UNDER_SCREEN)) { let tempPositionY = px2vp(this.fingerPosition.udSensorCenterYInThousandth * this.screen[1]); FuncUtils.judgmentOverflow(tempPositionY); if (this.screenType === ON_SCREEN) { - this.fingerPositionY = px2vp(this.screen[1]) - tempPositionY / THOUSANDTH + BOTTOM_BUTTON - + PADDING_8 + BOTTOM_TEXT + PADDING_24; + this.fingerPositionY = px2vp(this.screen[1]) - tempPositionY / THOUSANDTH + BOTTOM_BUTTON + + PADDING_8 + BOTTOM_TEXT + PADDING_24; } else if (this.screenType === UNDER_SCREEN) { this.fingerPositionY = px2vp(this.screen[1]) - tempPositionY / THOUSANDTH + PADDING_24; } @@ -100,7 +101,7 @@ export default struct FingerprintAuth { }); } catch (error) { LogUtils.error(TAG, 'aboutToAppear PINAuth catch error: ' + error?.code); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } } @@ -118,24 +119,24 @@ export default struct FingerprintAuth { const payload: CmdData = item.payload; if (payload.type === Constants.noticeTypePin) { if (payload.result === 0) { - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } else if (payload.result && payload.result === Constants.authResultPinExpired) { - this.inputValue = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.inputValue = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_pwd_error').id); this.textValue = ''; return; } else { if (payload.remainAttempts) { - this.inputValue = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.inputValue = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_pwd_error').id); this.textValue = ''; if (num === 'first') { this.inputValue = ''; } if (payload.remainAttempts < PIN_FAIL_TIP) { - this.inputValue = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.inputValue = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_pwd_error_can_try').id) + - payload.remainAttempts + (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + payload.remainAttempts + (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_frequency').id); } } @@ -171,7 +172,7 @@ export default struct FingerprintAuth { } } if ((payload.remainAttempts && payload.result !== 0) || payload.result === Constants.authResultPinExpired) { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_fp_retry_s2').id); this.fingerLock = false; if (payload.remainAttempts > AUTH_LOCK && num !== 'first' && payload.result != 0) { @@ -181,13 +182,13 @@ export default struct FingerprintAuth { } } if (num === 'first') { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync(this.isOffFinger ? $r('app.string.unified_authwidget_hint_normal_fp_only').id : $r('app.string.unified_authwidget_hint_inscreen_fp').id); } if (payload.remainAttempts === AUTH_LOCK) { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_title_number_failed_fp_forbidden').id); this.fingerLock = true; if (this.dialogType === DialogType.PIN_FINGER) { @@ -200,15 +201,15 @@ export default struct FingerprintAuth { } } if (payload.result === 0) { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_fp_verify_success').id) setTimeout(() => { - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); }, SECOND); } } else { LogUtils.error(TAG, 'onCmdDataChange default'); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } }) } @@ -220,14 +221,14 @@ export default struct FingerprintAuth { } countTime(freezingTime: number): void { - const TRY_AGAIN = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + const TRY_AGAIN = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_postretry').id); let promptText: string = ''; let freezingMillisecond = freezingTime; // O: freezing FINISH if (freezingMillisecond > 0) { - promptText = TimeUtils.getFreezingTimeNm(freezingMillisecond, (AppStorage.get("context") as common.ExtensionContext)); - promptText = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + promptText = TimeUtils.getFreezingTimeNm(freezingMillisecond, (AppStorage.get('context') as common.ExtensionContext)); + promptText = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_many_failures').id) + promptText + TRY_AGAIN; setTimeout((t: number):void => this.countTime(t), INTERVAL, freezingTime - INTERVAL); } else { @@ -268,9 +269,9 @@ export default struct FingerprintAuth { AuthUtils.getInstance().sendNotice(Constants.noticeEventCancel, [Constants.noticeTypePin]); } else { AuthUtils.getInstance().sendNotice(Constants.noticeEventCancel, [] || - (AppStorage.get("wantParams") as WantParams)?.type as string[]); + (AppStorage.get('wantParams') as WantParams)?.type as string[]); } - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } toPin(): void { @@ -299,10 +300,10 @@ export default struct FingerprintAuth { if (this.isOffFinger) { Column() { if ([PIN_FINGER, SINGLE_FINGER].includes(this.state) && this.fingerPosition !== undefined) { - if (AppStorage.Get('titleLength') as number < (AppStorage.get("wantParams") as WantParams)?.title.length) { + if (AppStorage.Get('titleLength') as number < (AppStorage.get('wantParams') as WantParams)?.title.length) { Scroll() { Column() { - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .fontSize($r('sys.float.ohos_id_text_size_body1')) .fontColor($r('sys.color.ohos_id_color_text_primary')) @@ -315,7 +316,7 @@ export default struct FingerprintAuth { .id('outFingerImage') Text(this.prompt) .draggable(false) - .fontColor(this.onFingerPrintFontColor(this.prompt, (AppStorage.get("context") as common.ExtensionContext))) + .fontColor(this.onFingerPrintFontColor(this.prompt, (AppStorage.get('context') as common.ExtensionContext))) .fontSize($r('sys.float.ohos_id_text_size_body2')) }.margin({left: $r('app.float.size_24'), right: $r('app.float.size_24')}) } @@ -325,7 +326,7 @@ export default struct FingerprintAuth { .scrollable(ScrollDirection.Vertical) .scrollBarColor(Color.Gray) } else { - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .margin({ top: $r('app.float.title_padding_top') }) .fontSize($r('sys.float.ohos_id_text_size_body1')) @@ -340,7 +341,7 @@ export default struct FingerprintAuth { .id('outFingerImage') Text(this.prompt) .draggable(false) - .fontColor(this.onFingerPrintFontColor(this.prompt, (AppStorage.get("context") as common.ExtensionContext))) + .fontColor(this.onFingerPrintFontColor(this.prompt, (AppStorage.get('context') as common.ExtensionContext))) .fontSize($r('sys.float.ohos_id_text_size_body2')) } } @@ -387,7 +388,7 @@ export default struct FingerprintAuth { .height($r('app.float.btn_height')) .margin({ top: $r('app.float.element_margin'), bottom: $r('app.float.content_padding') }) } else if (this.state === SINGLE_FINGER) { - if (!((AppStorage.get("wantParams") as WantParams)?.navigationButtonText as string)) { + if (!((AppStorage.get('wantParams') as WantParams)?.navigationButtonText as string)) { Row() { Column() { Button($r('app.string.unified_authwidget_cancel'), { stateEffect: true }) @@ -429,11 +430,11 @@ export default struct FingerprintAuth { .color($r('sys.color.ohos_id_color_list_separator')) .width($r('app.float.divider_width')) Column() { - Button((AppStorage.get("wantParams") as WantParams)?.navigationButtonText as string) + Button((AppStorage.get('wantParams') as WantParams)?.navigationButtonText as string) .onClick(() => { AuthUtils.getInstance() .sendNotice('EVENT_AUTH_USER_NAVIGATION', [Constants.noticeTypeFinger]); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); }) .margin({ right: $r('app.float.content_padding') }) .width(Constants.ninetyPercentWidth) @@ -619,9 +620,9 @@ export default struct FingerprintAuth { } else if (this.state === PIN_FINGER && this.fingerPosition.udSensorRadiusInPx !== undefined ) { Column() { if (this.screenType === ON_SCREEN) { - if (AppStorage.Get('titleLength') as number < (AppStorage.get("wantParams") as WantParams)?.title.length) { + if (AppStorage.Get('titleLength') as number < (AppStorage.get('wantParams') as WantParams)?.title.length) { Scroll() { - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .fontSize($r('sys.float.ohos_id_text_size_body1')) .fontColor($r('sys.color.ohos_id_color_text_primary')) @@ -634,7 +635,7 @@ export default struct FingerprintAuth { .scrollable(ScrollDirection.Vertical) .scrollBarColor(Color.Gray) } else { - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .margin({ top: $r('app.float.title_padding_top') }) .fontSize($r('sys.float.ohos_id_text_size_body1')) @@ -642,7 +643,7 @@ export default struct FingerprintAuth { .height($r('app.float.size_24')) .fontWeight(FontWeight.Medium) } - Image(this.prompt === (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + Image(this.prompt === (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_fp_verify_success').id) ? $r('app.media.right_faceID') : $r('app.media.ic_blue_fingerprint')) .draggable(false) @@ -659,7 +660,7 @@ export default struct FingerprintAuth { }) Text(this.prompt) .draggable(false) - .fontColor(this.onFingerPrintFontColor(this.prompt, (AppStorage.get("context") as common.ExtensionContext))) + .fontColor(this.onFingerPrintFontColor(this.prompt, (AppStorage.get('context') as common.ExtensionContext))) .fontSize($r('sys.float.ohos_id_text_size_body2')) Row() { Column() { @@ -733,10 +734,10 @@ export default struct FingerprintAuth { }) } - if (AppStorage.Get('titleLength') as number < (AppStorage.get("wantParams") as WantParams)?.title.length) { + if (AppStorage.Get('titleLength') as number < (AppStorage.get('wantParams') as WantParams)?.title.length) { Scroll() { Column() { - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .fontSize($r('sys.float.ohos_id_text_size_body1')) .fontColor($r('sys.color.ohos_id_color_text_primary')) @@ -746,7 +747,7 @@ export default struct FingerprintAuth { .margin({ top: $r('app.float.element_margin') }) .height($r('app.float.size_24')) .fontSize($r('sys.float.ohos_id_text_size_body2')) - .fontColor(this.onFingerPrintFontColor(this.prompt, (AppStorage.get("context") as common.ExtensionContext))) + .fontColor(this.onFingerPrintFontColor(this.prompt, (AppStorage.get('context') as common.ExtensionContext))) }.margin({left: $r('app.float.size_24'), right: $r('app.float.size_24')}) } .width('100%') @@ -754,7 +755,7 @@ export default struct FingerprintAuth { .scrollable(ScrollDirection.Vertical) .scrollBarColor(Color.Gray) } else { - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .fontSize($r('sys.float.ohos_id_text_size_body1')) .fontColor($r('sys.color.ohos_id_color_text_primary')) @@ -765,9 +766,9 @@ export default struct FingerprintAuth { .margin({ top: $r('app.float.element_margin') }) .height($r('app.float.size_24')) .fontSize($r('sys.float.ohos_id_text_size_body2')) - .fontColor(this.onFingerPrintFontColor(this.prompt, (AppStorage.get("context") as common.ExtensionContext))) + .fontColor(this.onFingerPrintFontColor(this.prompt, (AppStorage.get('context') as common.ExtensionContext))) } - Image(this.prompt === (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + Image(this.prompt === (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_fp_verify_success').id) ? $r('app.media.right_faceID') : $r('app.media.ic_blue_fingerprint')) .draggable(false) @@ -794,9 +795,9 @@ export default struct FingerprintAuth { } else if (this.state === SINGLE_FINGER) { Column() { if (this.screenType === ON_SCREEN && this.fingerPosition.udSensorRadiusInPx !== undefined) { - if (AppStorage.Get('titleLength') as number < (AppStorage.get("wantParams") as WantParams)?.title.length) { + if (AppStorage.Get('titleLength') as number < (AppStorage.get('wantParams') as WantParams)?.title.length) { Scroll() { - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .fontSize($r('sys.float.ohos_id_text_size_body1')) .fontColor($r('sys.color.ohos_id_color_text_primary')) @@ -809,7 +810,7 @@ export default struct FingerprintAuth { .scrollable(ScrollDirection.Vertical) .scrollBarColor(Color.Gray) } else { - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .margin({ top: $r('app.float.title_padding_top') }) .fontSize($r('sys.float.ohos_id_text_size_body1')) @@ -817,7 +818,7 @@ export default struct FingerprintAuth { .height($r('app.float.size_24')) .fontWeight(FontWeight.Medium) } - Image(this.prompt === (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + Image(this.prompt === (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_fp_verify_success').id) ? $r('app.media.right_faceID') : $r('app.media.ic_blue_fingerprint')) .draggable(false) @@ -834,9 +835,9 @@ export default struct FingerprintAuth { }) Text(this.prompt) .draggable(false) - .fontColor(this.onFingerPrintFontColor(this.prompt, (AppStorage.get("context") as common.ExtensionContext))) + .fontColor(this.onFingerPrintFontColor(this.prompt, (AppStorage.get('context') as common.ExtensionContext))) .fontSize($r('sys.float.ohos_id_text_size_body2')) - if (!((AppStorage.get("wantParams") as WantParams)?.navigationButtonText as string)) { + if (!((AppStorage.get('wantParams') as WantParams)?.navigationButtonText as string)) { Row() { Column() { Button($r('app.string.unified_authwidget_cancel'), { stateEffect: true }) @@ -878,11 +879,11 @@ export default struct FingerprintAuth { .color($r('sys.color.ohos_id_color_list_separator')) .width($r('app.float.divider_width')) Column() { - Button(((AppStorage.get("wantParams") as WantParams)?.navigationButtonText as string)) + Button(((AppStorage.get('wantParams') as WantParams)?.navigationButtonText as string)) .onClick(() => { AuthUtils.getInstance() .sendNotice('EVENT_AUTH_USER_NAVIGATION', [Constants.noticeTypeFinger]); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); }) .id('navigationButtonTextFingerprintAuth') .margin({ right: $r('app.float.content_padding') }) @@ -912,8 +913,8 @@ export default struct FingerprintAuth { this.handleCancel(); this.textValue = ''; }) - if ((AppStorage.get("wantParams") as WantParams)?.navigationButtonText as string) { - Button((AppStorage.get("wantParams") as WantParams)?.navigationButtonText as string) + if ((AppStorage.get('wantParams') as WantParams)?.navigationButtonText as string) { + Button((AppStorage.get('wantParams') as WantParams)?.navigationButtonText as string) .id('fingerUnderButton') .backgroundColor(Color.White) .height($r('app.float.digital_password_mask_height')) @@ -928,15 +929,15 @@ export default struct FingerprintAuth { .onClick(() => { AuthUtils.getInstance() .sendNotice('EVENT_AUTH_USER_NAVIGATION', [Constants.noticeTypeFinger]); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); }) } } - if (AppStorage.Get('titleLength') as number < (AppStorage.get("wantParams") as WantParams)?.title.length) { + if (AppStorage.Get('titleLength') as number < (AppStorage.get('wantParams') as WantParams)?.title.length) { Scroll() { Column() { - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .fontSize($r('sys.float.ohos_id_text_size_body1')) .fontColor($r('sys.color.ohos_id_color_text_primary')) @@ -946,7 +947,7 @@ export default struct FingerprintAuth { .margin({ top: $r('app.float.element_margin') }) .height($r('app.float.size_24')) .fontSize($r('sys.float.ohos_id_text_size_body2')) - .fontColor(this.onFingerPrintFontColor(this.prompt, (AppStorage.get("context") as common.ExtensionContext))) + .fontColor(this.onFingerPrintFontColor(this.prompt, (AppStorage.get('context') as common.ExtensionContext))) }.margin({left: $r('app.float.size_24'), right: $r('app.float.size_24')}) } .width('100%') @@ -954,7 +955,7 @@ export default struct FingerprintAuth { .scrollable(ScrollDirection.Vertical) .scrollBarColor(Color.Gray) } else { - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .fontSize($r('sys.float.ohos_id_text_size_body1')) .fontColor($r('sys.color.ohos_id_color_text_primary')) @@ -965,9 +966,9 @@ export default struct FingerprintAuth { .margin({ top: $r('app.float.element_margin') }) .height($r('app.float.size_24')) .fontSize($r('sys.float.ohos_id_text_size_body2')) - .fontColor(this.onFingerPrintFontColor(this.prompt, (AppStorage.get("context") as common.ExtensionContext))) + .fontColor(this.onFingerPrintFontColor(this.prompt, (AppStorage.get('context') as common.ExtensionContext))) } - Image(this.prompt === (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + Image(this.prompt === (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_fp_verify_success').id) ? $r('app.media.right_faceID') : $r('app.media.ic_blue_fingerprint')) .draggable(false) diff --git a/entry/src/main/ets/pages/components/PasswordAuth.ets b/entry/src/main/ets/pages/components/PasswordAuth.ets index 63eb644..7caa8a1 100644 --- a/entry/src/main/ets/pages/components/PasswordAuth.ets +++ b/entry/src/main/ets/pages/components/PasswordAuth.ets @@ -54,21 +54,21 @@ export default struct PasswordAuth { const payload: CmdData = item.payload; if (payload.type === Constants.noticeTypePin) { if (payload.result && payload.result === Constants.authResultPinExpired) { - this.inputValue = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.inputValue = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_pwd_error').id); this.textValue = ''; return; } if (payload.remainAttempts && payload.remainAttempts < MAX_FAIL_TIMES) { - this.inputValue = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.inputValue = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_pwd_error').id); this.textValue = ''; // pin auth Remaining number if (payload.remainAttempts < HINT_TIMES_BY_FAIL_LESS) { - this.inputValue = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager - .getStringSync($r('app.string.unified_authwidget_pwd_error_can_try').id) - + payload.remainAttempts + (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.inputValue = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager + .getStringSync($r('app.string.unified_authwidget_pwd_error_can_try').id) + + payload.remainAttempts + (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_frequency').id); } if (num === 'first') { @@ -84,7 +84,7 @@ export default struct PasswordAuth { return; } if (payload.result === 0) { - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } this.inputValue = ' '; this.textValue = ''; @@ -109,7 +109,7 @@ export default struct PasswordAuth { }); } catch (error) { LogUtils.error(TAG, 'aboutToAppear PINAuth catch error: ' + error?.code); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } } @@ -119,12 +119,12 @@ export default struct PasswordAuth { } countTime(freezingTime: number): void { - const TRY_AGAIN = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager.getStringSync($r('app.string.unified_authwidget_postretry').id); + const TRY_AGAIN = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager.getStringSync($r('app.string.unified_authwidget_postretry').id); let promptText: string = ''; let freezingMillisecond = freezingTime; if (freezingMillisecond > 0) { - promptText = TimeUtils.getFreezingTimeNm(freezingMillisecond, (AppStorage.get("context") as common.ExtensionContext)); - promptText = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + promptText = TimeUtils.getFreezingTimeNm(freezingMillisecond, (AppStorage.get('context') as common.ExtensionContext)); + promptText = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_many_failures').id) + promptText + TRY_AGAIN; setTimeout((t: number):void => this.countTime(t), INTERVAL, freezingTime - INTERVAL); } else { @@ -136,8 +136,8 @@ export default struct PasswordAuth { handleCancel(): void { AuthUtils.getInstance().sendNotice(Constants.noticeEventCancel, [] || - (AppStorage.get("wantParams") as WantParams)?.type as string[]); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('wantParams') as WantParams)?.type as string[]); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } build() { diff --git a/entry/src/ohosTest/ets/testability/CustomMixFailAbility.ets b/entry/src/ohosTest/ets/testability/CustomMixFailAbility.ets index cbbbb66..f116ca0 100644 --- a/entry/src/ohosTest/ets/testability/CustomMixFailAbility.ets +++ b/entry/src/ohosTest/ets/testability/CustomMixFailAbility.ets @@ -22,12 +22,12 @@ import common from '@ohos.app.ability.common'; export default class CustomMixFailAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context); + AppStorage.setOrCreate('context', this.context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/CustomMixFailTimesAbility.ets b/entry/src/ohosTest/ets/testability/CustomMixFailTimesAbility.ets index 5223147..7ad8271 100644 --- a/entry/src/ohosTest/ets/testability/CustomMixFailTimesAbility.ets +++ b/entry/src/ohosTest/ets/testability/CustomMixFailTimesAbility.ets @@ -21,12 +21,12 @@ import UserAuthExtensionAbility from '@ohos.app.ability.UserAuthExtensionAbility export default class CustomMixFailTimesAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/CustomPwdAbility.ets b/entry/src/ohosTest/ets/testability/CustomPwdAbility.ets index 26da7bf..8576a51 100644 --- a/entry/src/ohosTest/ets/testability/CustomPwdAbility.ets +++ b/entry/src/ohosTest/ets/testability/CustomPwdAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class CustomPwdAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/CustomPwdNumberAbility.ets b/entry/src/ohosTest/ets/testability/CustomPwdNumberAbility.ets index c89758c..f74b9f6 100644 --- a/entry/src/ohosTest/ets/testability/CustomPwdNumberAbility.ets +++ b/entry/src/ohosTest/ets/testability/CustomPwdNumberAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class CustomPwdNumberAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FaceAbility.ets b/entry/src/ohosTest/ets/testability/FaceAbility.ets index 173deea..39cd01c 100644 --- a/entry/src/ohosTest/ets/testability/FaceAbility.ets +++ b/entry/src/ohosTest/ets/testability/FaceAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class FaceAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FaceFailTimesAbility.ets b/entry/src/ohosTest/ets/testability/FaceFailTimesAbility.ets index e908882..1e3fff4 100644 --- a/entry/src/ohosTest/ets/testability/FaceFailTimesAbility.ets +++ b/entry/src/ohosTest/ets/testability/FaceFailTimesAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class FaceFailTimesAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FaceFingerFailNonAbility.ets b/entry/src/ohosTest/ets/testability/FaceFingerFailNonAbility.ets index a0cfd53..be64bea 100644 --- a/entry/src/ohosTest/ets/testability/FaceFingerFailNonAbility.ets +++ b/entry/src/ohosTest/ets/testability/FaceFingerFailNonAbility.ets @@ -20,12 +20,12 @@ import common from '@ohos.app.ability.common'; export default class FaceFingerFailNonAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context); + AppStorage.setOrCreate('context', this.context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FaceMixAbility.ets b/entry/src/ohosTest/ets/testability/FaceMixAbility.ets index 0f4bc3a..5a2a1d2 100644 --- a/entry/src/ohosTest/ets/testability/FaceMixAbility.ets +++ b/entry/src/ohosTest/ets/testability/FaceMixAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class FaceMixAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FaceMixSuccess3Ability.ets b/entry/src/ohosTest/ets/testability/FaceMixSuccess3Ability.ets index 73691a6..72a1d3e 100644 --- a/entry/src/ohosTest/ets/testability/FaceMixSuccess3Ability.ets +++ b/entry/src/ohosTest/ets/testability/FaceMixSuccess3Ability.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class FaceMixSuccess3Ability extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("session", session); - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FaceMixSuccessAbility.ets b/entry/src/ohosTest/ets/testability/FaceMixSuccessAbility.ets index 8c7246b..fa1409a 100644 --- a/entry/src/ohosTest/ets/testability/FaceMixSuccessAbility.ets +++ b/entry/src/ohosTest/ets/testability/FaceMixSuccessAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class FaceMixSuccessAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FaceMixSuccessAllAbility.ets b/entry/src/ohosTest/ets/testability/FaceMixSuccessAllAbility.ets index 5a2a037..9a4e399 100644 --- a/entry/src/ohosTest/ets/testability/FaceMixSuccessAllAbility.ets +++ b/entry/src/ohosTest/ets/testability/FaceMixSuccessAllAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class FaceMixSuccessAllAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FaceMixSuccessLandscapeAbility.ets b/entry/src/ohosTest/ets/testability/FaceMixSuccessLandscapeAbility.ets index 2491459..8a26a7c 100644 --- a/entry/src/ohosTest/ets/testability/FaceMixSuccessLandscapeAbility.ets +++ b/entry/src/ohosTest/ets/testability/FaceMixSuccessLandscapeAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class FaceMixSuccessLandscapeAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FaceMixTimesAbility.ets b/entry/src/ohosTest/ets/testability/FaceMixTimesAbility.ets index 0476450..01d24b0 100644 --- a/entry/src/ohosTest/ets/testability/FaceMixTimesAbility.ets +++ b/entry/src/ohosTest/ets/testability/FaceMixTimesAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class FaceMixTimesAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FacePinFailTimesAbility.ets b/entry/src/ohosTest/ets/testability/FacePinFailTimesAbility.ets index 025f5b3..2be2f85 100644 --- a/entry/src/ohosTest/ets/testability/FacePinFailTimesAbility.ets +++ b/entry/src/ohosTest/ets/testability/FacePinFailTimesAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class FacePinFailTimesAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FaceSingleAbility.ets b/entry/src/ohosTest/ets/testability/FaceSingleAbility.ets index 5f61cc7..5f597c7 100644 --- a/entry/src/ohosTest/ets/testability/FaceSingleAbility.ets +++ b/entry/src/ohosTest/ets/testability/FaceSingleAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class FaceSingleAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FingerFailAbility.ets b/entry/src/ohosTest/ets/testability/FingerFailAbility.ets index 61ce5bb..8521728 100644 --- a/entry/src/ohosTest/ets/testability/FingerFailAbility.ets +++ b/entry/src/ohosTest/ets/testability/FingerFailAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class FingerFailAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FingerFailTimesAbility.ets b/entry/src/ohosTest/ets/testability/FingerFailTimesAbility.ets index 17ed831..bf6e9eb 100644 --- a/entry/src/ohosTest/ets/testability/FingerFailTimesAbility.ets +++ b/entry/src/ohosTest/ets/testability/FingerFailTimesAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class FingerFailTimesAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FingerOnAbility.ets b/entry/src/ohosTest/ets/testability/FingerOnAbility.ets index 0e6f498..26963d3 100644 --- a/entry/src/ohosTest/ets/testability/FingerOnAbility.ets +++ b/entry/src/ohosTest/ets/testability/FingerOnAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class FingerOnAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FingerOnNullAbility.ets b/entry/src/ohosTest/ets/testability/FingerOnNullAbility.ets index 0a96e31..a102a8e 100644 --- a/entry/src/ohosTest/ets/testability/FingerOnNullAbility.ets +++ b/entry/src/ohosTest/ets/testability/FingerOnNullAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class FingerOnNullAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FingerOutBackAbility.ets b/entry/src/ohosTest/ets/testability/FingerOutBackAbility.ets index e33287f..2155be1 100644 --- a/entry/src/ohosTest/ets/testability/FingerOutBackAbility.ets +++ b/entry/src/ohosTest/ets/testability/FingerOutBackAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class FingerOutBackAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FingerOutFrontAbility.ets b/entry/src/ohosTest/ets/testability/FingerOutFrontAbility.ets index 8edc35a..237a422 100644 --- a/entry/src/ohosTest/ets/testability/FingerOutFrontAbility.ets +++ b/entry/src/ohosTest/ets/testability/FingerOutFrontAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class FingerOutFrontAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FingerOutSideAbility.ets b/entry/src/ohosTest/ets/testability/FingerOutSideAbility.ets index 72a0330..e30fa74 100644 --- a/entry/src/ohosTest/ets/testability/FingerOutSideAbility.ets +++ b/entry/src/ohosTest/ets/testability/FingerOutSideAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class FingerOutSideAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FingerUnderAbility.ets b/entry/src/ohosTest/ets/testability/FingerUnderAbility.ets index 0a892c9..7a37c44 100644 --- a/entry/src/ohosTest/ets/testability/FingerUnderAbility.ets +++ b/entry/src/ohosTest/ets/testability/FingerUnderAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class FingerUnderAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FingerUnderNullAbility.ets b/entry/src/ohosTest/ets/testability/FingerUnderNullAbility.ets index 4c7f62b..5a119ed 100644 --- a/entry/src/ohosTest/ets/testability/FingerUnderNullAbility.ets +++ b/entry/src/ohosTest/ets/testability/FingerUnderNullAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class FingerUnderNullAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FingerprintAbility.ets b/entry/src/ohosTest/ets/testability/FingerprintAbility.ets index b68a134..b879783 100644 --- a/entry/src/ohosTest/ets/testability/FingerprintAbility.ets +++ b/entry/src/ohosTest/ets/testability/FingerprintAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class FingerprintAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FingerprintLockAbility.ets b/entry/src/ohosTest/ets/testability/FingerprintLockAbility.ets index c2b3610..3a736e2 100644 --- a/entry/src/ohosTest/ets/testability/FingerprintLockAbility.ets +++ b/entry/src/ohosTest/ets/testability/FingerprintLockAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class FingerprintLockAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/PasswordAbility.ets b/entry/src/ohosTest/ets/testability/PasswordAbility.ets index 77f681f..acdaf93 100644 --- a/entry/src/ohosTest/ets/testability/PasswordAbility.ets +++ b/entry/src/ohosTest/ets/testability/PasswordAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class PasswordAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/PasswordFailTimesAbility.ets b/entry/src/ohosTest/ets/testability/PasswordFailTimesAbility.ets index bc6056c..16a1256 100644 --- a/entry/src/ohosTest/ets/testability/PasswordFailTimesAbility.ets +++ b/entry/src/ohosTest/ets/testability/PasswordFailTimesAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class PasswordFailTimesAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/PasswordSixAbility.ets b/entry/src/ohosTest/ets/testability/PasswordSixAbility.ets index 8b06a58..dbb029b 100644 --- a/entry/src/ohosTest/ets/testability/PasswordSixAbility.ets +++ b/entry/src/ohosTest/ets/testability/PasswordSixAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class PasswordSixAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/PinFingerOnAbility.ets b/entry/src/ohosTest/ets/testability/PinFingerOnAbility.ets index 9ef5840..dfaf7b5 100644 --- a/entry/src/ohosTest/ets/testability/PinFingerOnAbility.ets +++ b/entry/src/ohosTest/ets/testability/PinFingerOnAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class PinFingerOnAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/PinFingerOnFailAbility.ets b/entry/src/ohosTest/ets/testability/PinFingerOnFailAbility.ets index 83b0adc..6deddc0 100644 --- a/entry/src/ohosTest/ets/testability/PinFingerOnFailAbility.ets +++ b/entry/src/ohosTest/ets/testability/PinFingerOnFailAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class PinFingerOnFailAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/PinFingerOutBackAbility.ets b/entry/src/ohosTest/ets/testability/PinFingerOutBackAbility.ets index 0b07051..917ec16 100644 --- a/entry/src/ohosTest/ets/testability/PinFingerOutBackAbility.ets +++ b/entry/src/ohosTest/ets/testability/PinFingerOutBackAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class PinFingerOutBackAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/PinFingerOutFrontAbility.ets b/entry/src/ohosTest/ets/testability/PinFingerOutFrontAbility.ets index ba26260..1f0fe2d 100644 --- a/entry/src/ohosTest/ets/testability/PinFingerOutFrontAbility.ets +++ b/entry/src/ohosTest/ets/testability/PinFingerOutFrontAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class PinFingerOutFrontAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/PinFingerOutSideAbility.ets b/entry/src/ohosTest/ets/testability/PinFingerOutSideAbility.ets index 54d7397..66509b7 100644 --- a/entry/src/ohosTest/ets/testability/PinFingerOutSideAbility.ets +++ b/entry/src/ohosTest/ets/testability/PinFingerOutSideAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class PinFingerOutSideAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/PinFingerUnderAbility.ets b/entry/src/ohosTest/ets/testability/PinFingerUnderAbility.ets index ab1dcb2..942a0ad 100644 --- a/entry/src/ohosTest/ets/testability/PinFingerUnderAbility.ets +++ b/entry/src/ohosTest/ets/testability/PinFingerUnderAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class PinFingerUnderAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/PinFingerUnderFailAbility.ets b/entry/src/ohosTest/ets/testability/PinFingerUnderFailAbility.ets index eb420cf..81ec056 100644 --- a/entry/src/ohosTest/ets/testability/PinFingerUnderFailAbility.ets +++ b/entry/src/ohosTest/ets/testability/PinFingerUnderFailAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class PinFingerUnderFailAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/TestAbility.ets b/entry/src/ohosTest/ets/testability/TestAbility.ets index f32e6df..9febd3f 100644 --- a/entry/src/ohosTest/ets/testability/TestAbility.ets +++ b/entry/src/ohosTest/ets/testability/TestAbility.ets @@ -30,12 +30,12 @@ export default class TestAbility extends UserAuthExtensionAbility { let abilityDelegatorArguments: AbilityDelegatorRegistry.AbilityDelegatorArgs; abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments(); Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite); - AppStorage.setOrCreate("context", this.context); + AppStorage.setOrCreate('context', this.context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/pages/Index.ets b/entry/src/ohosTest/ets/testability/pages/Index.ets index dfd6163..026007a 100644 --- a/entry/src/ohosTest/ets/testability/pages/Index.ets +++ b/entry/src/ohosTest/ets/testability/pages/Index.ets @@ -46,7 +46,7 @@ struct Index { onCancel(): void { LogUtils.debug(TAG, 'Callback when the first button is clicked'); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } onAccept(): void { @@ -55,7 +55,7 @@ struct Index { existApp(): void { LogUtils.debug(TAG, 'Click the callback in the blank area'); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } handleAuthStart(): void { @@ -82,9 +82,9 @@ struct Index { aboutToAppear(): void { LogUtils.debug(TAG, 'aboutToAppear test'); - if (AppStorage.get("wantParams") as WantParams) { - LogUtils.debug(TAG, 'wantParams: ' + JSON.stringify(AppStorage.get("wantParams") as WantParams)); - this.getParams(AppStorage.get("wantParams") as WantParams); + if (AppStorage.get('wantParams') as WantParams) { + LogUtils.debug(TAG, 'wantParams: ' + JSON.stringify(AppStorage.get('wantParams') as WantParams)); + this.getParams(AppStorage.get('wantParams') as WantParams); } else { LogUtils.error(TAG, 'aboutToAppear wantParams null'); } @@ -129,7 +129,7 @@ struct Index { return userAuth.UserAuthType.PIN; } }) - AppStorage.setOrCreate("widgetContextId", resultInfo.widgetContextId as number); + AppStorage.setOrCreate('widgetContextId', resultInfo.widgetContextId as number); this.authType = newType; this.type = resultInfo.type; this.windowModeType = resultInfo.windowModeType; -- Gitee