fix : fix codecheck

Signed-off-by: abonadon_hk <huangkang22@huawei.com>
Change-Id: I18f99626457e1fc737b81e00ed21e230a65a0b0b
This commit is contained in:
abonadon_hk
2024-06-04 17:05:24 +08:00
parent 0aeb64277b
commit ee27a89bfe
48 changed files with 349 additions and 343 deletions
@@ -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);
})
}
@@ -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)
@@ -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'))
@@ -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'))
@@ -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 {
+14 -14
View File
@@ -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'))
@@ -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) {
@@ -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<CmdType>;
@@ -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)
@@ -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<CmdType>;
@@ -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)
@@ -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() {
@@ -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) {
@@ -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) {
@@ -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) {
@@ -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) {
@@ -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) {
@@ -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) {
@@ -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) {
@@ -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) {
@@ -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) {
@@ -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) {
@@ -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) {
@@ -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) {
@@ -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) {
@@ -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) {
@@ -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) {
@@ -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) {
@@ -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) {
@@ -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) {
@@ -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) {
@@ -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) {
@@ -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) {
@@ -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) {
@@ -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) {
@@ -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) {
@@ -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) {
@@ -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) {
@@ -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) {
@@ -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) {
@@ -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) {
@@ -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) {
@@ -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) {
@@ -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) {
@@ -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) {
@@ -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) {
@@ -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) {
@@ -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) {
@@ -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) {
@@ -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;