diff --git a/entry/src/main/ets/common/components/FullScreen.ets b/entry/src/main/ets/common/components/FullScreen.ets index 61fc2e002b221fcecd20e91c1dacd679eb90384e..9515f84339ddbda60008bf9c58486b4a59dec361 100644 --- a/entry/src/main/ets/common/components/FullScreen.ets +++ b/entry/src/main/ets/common/components/FullScreen.ets @@ -15,13 +15,14 @@ import display from '@ohos.display'; import userAuth from '@ohos.userIAM.userAuth'; -import Constants, { CmdData, CmdType, FingerPosition, NumKeyBoardItem } from '../../common/vm/Constants'; -import { globalContext, globalSession, globalWantParams } from '../../extensionability/UserAuthAbility'; +import Constants, { CmdData, CmdType, FingerPosition, NumKeyBoardItem, WantParams } from '../../common/vm/Constants'; import AuthUtils from '../utils/AuthUtils'; import FuncUtils from '../utils/FuncUtils'; import LogUtils from '../utils/LogUtils'; import TimeUtils from '../utils/TimeUtils'; import NumKeyBoard from './NumkeyBoard'; +import common from '@ohos.app.ability.common'; +import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSession'; const TAG = 'FullScreen'; const INTERVAL = 1000; @@ -42,7 +43,6 @@ const NOTICE_DELAY = 50; const FINGER_SENSOR_POSITION_LINE = 0.75; const RADIUS = 2; const PADDING_8 = 8; -const ONE_SECOND = 1000; const CANCEL_HIGH = 40; const BOTTOM = 72; const MARGIN = 4; @@ -76,9 +76,9 @@ export default struct FullScreen { @StorageLink('passwordArrayNumber') passwordArrayNumber: string[] = []; @State passwordObj: string = ''; numKeyboard: NumKeyBoardItem[] = Constants.numKeyBoard; - @State prompt: string = globalContext.resourceManager + @State prompt: string = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_use_pwd').id); - @State fingerText: string = globalContext.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 = globalContext.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 !== globalContext.resourceManager + if (num === 'first' && this.prompt !== (AppStorage.get("context") as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_recognition').id)) { - this.prompt = globalContext.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 = globalContext.resourceManager + this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_pwd_error_can_try').id) - + payload.remainAttempts + globalContext.resourceManager + + 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) { - globalSession?.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 = globalContext.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 = globalContext.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 = globalContext.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) { - globalSession?.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 = globalContext.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,7 +180,7 @@ export default struct FullScreen { setTimeout(() => { AuthUtils.getInstance().sendNotice('EVENT_AUTH_TYPE_READY', [Constants.noticeTypeFinger]); }, NOTICE_DELAY); - this.prompt = globalContext.resourceManager + this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_fp_retry_s2').id); } @@ -200,9 +200,9 @@ export default struct FullScreen { if (num === 'first') { this.controlType.isShowFinger = false; } else { - this.prompt = globalContext.resourceManager + this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_title_number_failed_fp_forbidden').id); - this.fingerText = globalContext.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 +210,11 @@ export default struct FullScreen { this.cancelImage = false; } if (payload.result === 0) { - globalSession?.terminateSelf?.(); + (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); } } else { LogUtils.error(TAG, 'type: ' + payload.type); - globalSession?.terminateSelf?.(); + (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); } }) } @@ -254,7 +254,7 @@ export default struct FullScreen { } } catch (error) { LogUtils.error(TAG, 'aboutToAppear catch error: ' + error?.code); - globalSession?.terminateSelf?.(); + (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); } } @@ -264,7 +264,7 @@ export default struct FullScreen { this.passwordArray = ['', '', '', '', '', '']; this.passwordObj = ''; this.numKeyboard[11].value = GO_BACK; - this.numKeyboard[11].row1 = globalContext.resourceManager + this.numKeyboard[11].row1 = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_back').id); this.updateStorage(() => { }) @@ -275,16 +275,16 @@ export default struct FullScreen { } countdown(freezingTime: number): void { - const TRY_AGAIN = globalContext.resourceManager.getStringSync($r('app.string.unified_authwidget_postretry').id); - const PLEASE_TRY = globalContext.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, globalContext); + promptText = TimeUtils.getFreezingTimeNm(freezingMillisecond, (AppStorage.get("context") as common.ExtensionContext)); promptText =PLEASE_TRY + promptText + TRY_AGAIN; setTimeout((t: number):void => this.countdown(freezingTime), INTERVAL, freezingTime - INTERVAL); } else { - promptText = globalContext.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 +349,11 @@ export default struct FullScreen { .margin({ bottom: $r('app.float.content_padding') }) .onClick(() => { if (!this.faceFingerLockArr[0]) { - this.prompt = globalContext.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 = globalContext.resourceManager + this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_title_face_forbidden').id); } }) @@ -376,9 +376,9 @@ export default struct FullScreen { .textOverflow({ overflow: TextOverflow.None }) .height($r('app.float.size_24')) .onClick(() => { - if (this.prompt === globalContext.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 = globalContext.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]); } @@ -434,7 +434,7 @@ export default struct FullScreen { TextInput({ placeholder: '', text: this.passwordArray?.join('') }) .draggable(false) .onChange(async (value: string) => { - const arr = value?.replace(/[^\d]/g, '')?.split(''); + const arr = value.replace(new RegExp('[^\\d]', 'g'), '').split(''); arr?.map((item, index) => { this.passwordArray[index] = item; }); @@ -456,7 +456,7 @@ export default struct FullScreen { .draggable(false) .onChange(async (value: string) => { // Removes non-numeric characters from a string - this.passwordArrayNumber = value.replace(/[^\d]/g, '').split(''); + this.passwordArrayNumber = value.replace(new RegExp('[^\\d]', 'g'), '').split(''); }) .id('pinInputNumber') .onSubmit(async (enterKey: EnterKeyType) => { @@ -570,7 +570,7 @@ export default struct FullScreen { } else if (index === 1) { this.passwordArray[index - 1] = ''; this.numKeyboard[11].value = GO_BACK; - this.numKeyboard[11].row1 = globalContext.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 +580,9 @@ export default struct FullScreen { // 0: pin unlock this.pinLock = 0; this.clearPassword(); - globalSession?.terminateSelf?.(); + (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); AuthUtils.getInstance().sendNotice(Constants.noticeEventCancel, [] || - globalWantParams?.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; @@ -630,7 +630,7 @@ export default struct FullScreen { } else if (index === 1) { this.passwordArray[index - 1] = ''; this.numKeyboard[11].value = GO_BACK; - this.numKeyboard[11].row1 = globalContext.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 +640,9 @@ export default struct FullScreen { // 0: pin unlock this.pinLock = 0; this.clearPassword(); - globalSession?.terminateSelf?.(); + (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); AuthUtils.getInstance().sendNotice(Constants.noticeEventCancel, [] || - globalWantParams?.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; @@ -688,7 +688,7 @@ export default struct FullScreen { } else if (index === 1) { this.passwordArray[index - 1] = ''; this.numKeyboard[11].value = GO_BACK; - this.numKeyboard[11].row1 = globalContext.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 +698,9 @@ export default struct FullScreen { // 0: pin unlock this.pinLock = 0; this.clearPassword(); - globalSession?.terminateSelf?.(); + (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); AuthUtils.getInstance().sendNotice(Constants.noticeEventCancel, [] || - globalWantParams?.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; @@ -782,10 +782,10 @@ export default struct FullScreen { .width(Constants.fullContainerWidth) } else if (!this.controlType.isLandscape && this.fingerPosition.udSensorRadiusInPx !== undefined) { Column() { - if (AppStorage.Get('titleLength') as number < globalWantParams?.title.length) { + if (AppStorage.Get('titleLength') as number < (AppStorage.get("wantParams") as WantParams)?.title.length) { Scroll() { Column() { - Text(globalWantParams?.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 +809,7 @@ export default struct FullScreen { .scrollable(ScrollDirection.Vertical) .scrollBarColor('sys.color.ohos_id_color_foreground') } else { - Text(globalWantParams?.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 +861,7 @@ export default struct FullScreen { this.controlType.jumpFinger = false; this.cancelImage = false; AuthUtils.getInstance().sendNotice(Constants.noticeEventCancel, [Constants.noticeTypeFinger]); - this.prompt = globalContext.resourceManager + this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_use_pwd').id); }) } diff --git a/entry/src/main/ets/common/components/PassWord.ets b/entry/src/main/ets/common/components/PassWord.ets index 0077884c78cbb5520df4d362ec99469ae464ba9d..a2f12c504b9c5926a47a51adea0a76b8fa55580c 100644 --- a/entry/src/main/ets/common/components/PassWord.ets +++ b/entry/src/main/ets/common/components/PassWord.ets @@ -13,9 +13,7 @@ * limitations under the License. */ -import Constants from '../../common/vm/Constants'; -import { globalWantParams } from '../../extensionability/UserAuthAbility'; -import LogUtils from '../utils/LogUtils'; +import Constants, { WantParams } from '../../common/vm/Constants'; const MAX_LENGTH = 32; @@ -31,7 +29,7 @@ export default struct PassWord { confirm?: () => void; onTextValueChange(): void { - this.passwordArrNumber = this.textValue.replace(/[^\d]/g, '').split(''); + this.passwordArrNumber = this.textValue.replace(new RegExp('[^\\d]', 'g'), '').split(''); } clearPassword(): void { @@ -46,10 +44,10 @@ export default struct PassWord { build() { Column() { - if (AppStorage.Get('titleLength') as number < globalWantParams?.title.length) { + if (AppStorage.Get('titleLength') as number < (AppStorage.get("wantParams") as WantParams)?.title.length) { Scroll() { Column() { - Text(globalWantParams?.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')) @@ -78,7 +76,7 @@ export default struct PassWord { }) .onChange((value: string) => { if (this.pinSubType === Constants.pinNumber) { - this.passwordArrNumber = value.replace(/[^\d]/g, '').split(''); + this.passwordArrNumber = value.replace(new RegExp('[^\\d]', 'g'), '').split(''); } this.textValue = value; }) @@ -97,7 +95,7 @@ export default struct PassWord { .scrollable(ScrollDirection.Vertical) .scrollBarColor(Color.Gray) } else { - Text(globalWantParams?.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')) @@ -127,7 +125,7 @@ export default struct PassWord { }) .onChange((value: string) => { if (this.pinSubType === Constants.pinNumber) { - this.passwordArrNumber = value.replace(/[^\d]/g, '').split(''); + this.passwordArrNumber = value.replace(new RegExp('[^\\d]', 'g'), '').split(''); } this.textValue = value; }) diff --git a/entry/src/main/ets/common/components/SixPassword.ets b/entry/src/main/ets/common/components/SixPassword.ets index 5aae84027550b271b9c7a6cb07c1f62bdfa1e95e..a13829c40700884de95f5ee3a82164ec0374ddad 100644 --- a/entry/src/main/ets/common/components/SixPassword.ets +++ b/entry/src/main/ets/common/components/SixPassword.ets @@ -13,10 +13,8 @@ * limitations under the License. */ -import Constants from '../../common/vm/Constants'; -import { globalWantParams } from '../../extensionability/UserAuthAbility'; import AuthUtils from '../utils/AuthUtils'; -import LogUtils from '../utils/LogUtils'; +import Constants, { WantParams } from '../vm/Constants'; const MAX_LENGTH = 6; @@ -28,7 +26,7 @@ export default struct SixPassword { @StorageLink('passwordArrayNumber') passwordArrayNumber: string[] = []; onTextValueChange(): void { - this.passwordArrayNumber = this.textValue.replace(/[^\d]/g, '').split(''); + this.passwordArrayNumber = this.textValue.replace(new RegExp('[^\\d]', 'g'), '').split(''); } clearPassword(): void { @@ -43,10 +41,10 @@ export default struct SixPassword { build() { Column() { - if (AppStorage.Get('titleLength') as number < globalWantParams?.title.length) { + if (AppStorage.Get('titleLength') as number < (AppStorage.get("wantParams") as WantParams)?.title.length) { Scroll() { Column() { - Text(globalWantParams?.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')) @@ -86,7 +84,7 @@ export default struct SixPassword { TextInput({ placeholder: '', text: this.passwordArrayNumber?.join('') }) .draggable(false) .onChange(async (value: string) => { - this.passwordArrayNumber = value?.replace(/[^\d]/g, '')?.split(''); + this.passwordArrayNumber = value.replace(new RegExp('[^\\d]', 'g'), '').split(''); this.textValue = this.passwordArrayNumber?.join(''); if (this.textValue?.length === MAX_LENGTH) { AuthUtils.getInstance().sendNotice('EVENT_AUTH_TYPE_READY', [Constants.noticeTypePin]); @@ -117,7 +115,7 @@ export default struct SixPassword { .scrollable(ScrollDirection.Vertical) .scrollBarColor(Color.Gray) } else { - Text(globalWantParams?.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')) @@ -158,7 +156,7 @@ export default struct SixPassword { TextInput({ placeholder: '', text: this.passwordArrayNumber?.join('') }) .draggable(false) .onChange(async (value: string) => { - this.passwordArrayNumber = value?.replace(/[^\d]/g, '')?.split(''); + this.passwordArrayNumber = value.replace(new RegExp('[^\\d]', 'g'), '').split(''); this.textValue = this.passwordArrayNumber?.join(''); if (this.textValue?.length === MAX_LENGTH) { AuthUtils.getInstance().sendNotice('EVENT_AUTH_TYPE_READY', [Constants.noticeTypePin]); diff --git a/entry/src/main/ets/common/utils/AuthUtils.ts b/entry/src/main/ets/common/utils/AuthUtils.ts index 6fc8b91d42e08fc16de32082de777f068c88d2f6..0b1b492e510876ad3abaf2a8406767342c57f2de 100644 --- a/entry/src/main/ets/common/utils/AuthUtils.ts +++ b/entry/src/main/ets/common/utils/AuthUtils.ts @@ -14,7 +14,7 @@ */ import userAuth from '@ohos.userIAM.userAuth'; -import { globalSession } from '../../extensionability/UserAuthAbility'; +import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSession'; import Constants from '../vm/Constants'; import LogUtils from './LogUtils'; @@ -22,7 +22,6 @@ const TAG = 'AuthUtils'; export default class AuthUtils { private static authUtilsInstance: AuthUtils; - private widgetContextId: number = -1; public static getInstance(): AuthUtils { if (!AuthUtils.authUtilsInstance) { @@ -31,14 +30,10 @@ export default class AuthUtils { return AuthUtils.authUtilsInstance; } - setWidgetContextId(widgetContextId): void { - this.widgetContextId = widgetContextId; - } - sendNotice(cmd: string, type: Array): void { try { const eventData = { - widgetContextId: this.widgetContextId, + widgetContextId: AppStorage.get("widgetContextId"), event: cmd, version: Constants.noticeVersion, payload: { @@ -51,7 +46,7 @@ export default class AuthUtils { LogUtils.info(TAG, 'sendNotice success'); } catch (error) { LogUtils.error(TAG, 'sendNotice catch error: ' + error?.code); - globalSession?.terminateSelf?.(); + (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); } } } \ No newline at end of file diff --git a/entry/src/main/ets/common/utils/FuncUtils.ts b/entry/src/main/ets/common/utils/FuncUtils.ts index 777ab0986828ecf4eedde15e42fc98f9d41ffadd..f1655ccd03c17276fe26eff41e3ddefb363f3b36 100644 --- a/entry/src/main/ets/common/utils/FuncUtils.ts +++ b/entry/src/main/ets/common/utils/FuncUtils.ts @@ -18,7 +18,7 @@ import userAuth from '@ohos.userIAM.userAuth'; import { DialogType } from '../module/DialogType'; import LogUtils from './LogUtils'; import window from '@ohos.window'; -import { globalSession } from '../../extensionability/UserAuthAbility'; +import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSession'; const TAG = 'FuncUtils'; @@ -79,7 +79,7 @@ export class FuncUtils { judgmentOverflow(value: number): void { if (value === Number.POSITIVE_INFINITY || value === Number.NEGATIVE_INFINITY) { LogUtils.error(TAG, 'judgmentOverflow spill code value: ' + value); - globalSession?.terminateSelf?.(); + (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); } } } diff --git a/entry/src/main/ets/common/utils/WindowPrivacyUtils.ts b/entry/src/main/ets/common/utils/WindowPrivacyUtils.ts index 1ae7c846a52b81d56decb6e9df5b4e3c09486efc..67074c6b1cdde6b12e240cf6bb30ebc01a3f62fd 100644 --- a/entry/src/main/ets/common/utils/WindowPrivacyUtils.ts +++ b/entry/src/main/ets/common/utils/WindowPrivacyUtils.ts @@ -13,7 +13,6 @@ * limitations under the License. */ import type UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSession'; -import { globalSession } from '../../extensionability/UserAuthAbility'; import LogUtils from './LogUtils'; const TAG = 'WindowPrivacyUtils'; @@ -31,7 +30,7 @@ export class WindowPrivacyUtils { }); } catch (error) { LogUtils.error(TAG, 'setWindowPrivacyMode catch error: ' + error?.code); - globalSession?.terminateSelf?.(); + (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); } } } diff --git a/entry/src/main/ets/common/vm/Constants.ts b/entry/src/main/ets/common/vm/Constants.ts index 3bff79a089f52b927cb910fd992fe29823e6f27d..fc5cfd54df6a11633e1174d7a04812e93e7f6dbf 100644 --- a/entry/src/main/ets/common/vm/Constants.ts +++ b/entry/src/main/ets/common/vm/Constants.ts @@ -167,4 +167,12 @@ export interface WantParams { navigationButtonText: string, windowModeType: string, cmd: CmdType[], +} + +export interface CommandResultInfo { + cmdData:string +} +export interface WidgetCommand { + cmd:Array, + pinSubType:string } \ No newline at end of file diff --git a/entry/src/main/ets/extensionability/UserAuthAbility.ts b/entry/src/main/ets/extensionability/UserAuthAbility.ts index 6f46a56da2774c26bc34b05f5bdd745a2bf716e3..e274be4f90eaa9101f6d5cfd0daa2a6edda84a9a 100644 --- a/entry/src/main/ets/extensionability/UserAuthAbility.ts +++ b/entry/src/main/ets/extensionability/UserAuthAbility.ts @@ -18,11 +18,6 @@ import UserAuthExtensionAbility from '@ohos.app.ability.UserAuthExtensionAbility import WindowPrivacyUtils from '../common/utils/WindowPrivacyUtils'; import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSession'; import { WantParams } from '../common/vm/Constants'; -import common from '@ohos.app.ability.common'; - -let globalSession: UIExtensionContentSession; -let globalWantParams: WantParams; -let globalContext: common.UIExtensionContext; const TAG = 'UserAuthAbility'; // The current interface only support string type @@ -32,7 +27,7 @@ const MASK_THIN_COLOR = '#33182431'; export default class UserAuthAbility extends UserAuthExtensionAbility { onCreate() { LogUtils.info(TAG, 'UserAuthExtensionAbility onCreate'); - globalContext = this.context; + AppStorage.setOrCreate("context", this.context); } onForeground(): void { @@ -41,7 +36,7 @@ export default class UserAuthAbility extends UserAuthExtensionAbility { onBackground(): void { LogUtils.info(TAG, 'UserAuthExtensionAbility onBackground'); - globalSession?.terminateSelf(); + (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); } onDestroy(): void | Promise { @@ -50,11 +45,11 @@ export default class UserAuthAbility extends UserAuthExtensionAbility { onSessionCreate(want, session): void { LogUtils.info(TAG, 'UserAuthExtensionAbility onSessionCreate'); - globalWantParams = want?.parameters?.useriamCmdData; - globalSession = session; + AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); + AppStorage.setOrCreate("session", session); (session as UIExtensionContentSession)?.loadContent('pages/Index'); try { - if (globalWantParams?.windowModeType as string === 'DIALOG_BOX') { + if ((AppStorage.get("wantParams") as WantParams)?.windowModeType === 'DIALOG_BOX') { (session as UIExtensionContentSession)?.setWindowBackgroundColor(MASK_THIN_COLOR); } else { (session as UIExtensionContentSession)?.setWindowBackgroundColor(TRANSPARENT_COLOR); @@ -71,5 +66,3 @@ export default class UserAuthAbility extends UserAuthExtensionAbility { WindowPrivacyUtils.setWindowPrivacyMode(session, false); } } - -export {globalSession, globalWantParams, globalContext} \ No newline at end of file diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index 3ae047b4de98424ecad09a83c60068432ac62391..d5af86c11a61e187a5af624b83844a7ad49f672d 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -15,16 +15,16 @@ import screen from '@ohos.screen'; import userAuth from '@ohos.userIAM.userAuth'; +import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSession'; import { DialogType } from '../common/module/DialogType'; -import AuthUtils from '../common/utils/AuthUtils'; import FuncUtils from '../common/utils/FuncUtils'; import LogUtils from '../common/utils/LogUtils'; import Constants, { CmdData, CmdType, FingerPosition, WantParams } from '../common/vm/Constants'; -import { globalContext, globalSession, globalWantParams } from '../extensionability/UserAuthAbility'; import CustomPassword from './components/CustomPassword'; import FaceAuth from './components/FaceAuth'; import FingerprintAuth from './components/FingerprintAuth'; import PasswordAuth from './components/PasswordAuth'; +import common from '@ohos.app.ability.common'; const DEFAULT_SIZE = 72; const FIVE_SECOND = 5000; @@ -52,28 +52,28 @@ struct Index { screen.getAllScreens((err, data) => { if (err.code) { LogUtils.error(TAG, 'Failed to get all screens. err: ' + err.code); - globalSession?.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; + || 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: ' + globalWantParams?.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(globalWantParams)); - if (globalWantParams) { - this.getParams(globalWantParams); + 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 = globalWantParams?.cmd as CmdType[]; + this.cmdData = (AppStorage.get("wantParams") as WantParams)?.cmd as CmdType[]; } else { LogUtils.error(TAG, 'aboutToAppear wantParams null'); - globalSession?.terminateSelf(); + (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); } if (this.isLandscape && this.underFingerPrint) { setTimeout(() => { - globalSession?.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); - globalSession?.terminateSelf(); + (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); } } @@ -102,7 +102,7 @@ struct Index { }); } catch (error) { LogUtils.error(TAG, 'getUserAuthWidgetMgr catch error: ' + error?.code); - globalSession?.terminateSelf?.(); + (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); } } @@ -115,8 +115,8 @@ struct Index { if (payload.sensorInfo && JSON.stringify(payload.sensorInfo) !== '{}') { const fingerPosition: FingerPosition = JSON.parse(payload.sensorInfo); if (fingerPosition?.sensorType === 'UNDER_SCREEN_SENSOR' || - fingerPosition?.sensorType === 'BOTH_SENSOR' || - fingerPosition?.sensorType === 'SensorType1') { + fingerPosition?.sensorType === 'BOTH_SENSOR' || + fingerPosition?.sensorType === 'SensorType1') { this.underFingerPrint = true; } } @@ -147,8 +147,8 @@ struct Index { getParams(result: WantParams): void { LogUtils.info(TAG, 'getParams'); const resultInfo: WantParams = result; - this.pinSubType = resultInfo.pinSubType; - const newType = resultInfo.type && resultInfo.type.map(item => { + this.pinSubType = resultInfo?.pinSubType; + const newType = resultInfo?.type && resultInfo?.type.map(item => { if (item === Constants.noticeTypePin) { return userAuth.UserAuthType.PIN; } else if (item === Constants.noticeTypeFinger) { @@ -159,13 +159,13 @@ struct Index { return userAuth.UserAuthType.PIN; } }) - AuthUtils.getInstance().setWidgetContextId(resultInfo.widgetContextId); + AppStorage.setOrCreate("widgetContextId", resultInfo?.widgetContextId); this.authType = newType; - this.type = resultInfo.type; - this.windowModeType = resultInfo.windowModeType; + this.type = resultInfo?.type; + this.windowModeType = resultInfo?.windowModeType; this.dialogType = FuncUtils.getDialogType(newType); - this.cmdData = resultInfo.cmd || []; - this.handleIsUnder(resultInfo.cmd || []); + this.cmdData = resultInfo?.cmd || []; + this.handleIsUnder(resultInfo?.cmd || []); } build() { @@ -173,7 +173,7 @@ struct Index { if (this.isLandscape && this.underFingerPrint) { Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.Center, alignItems: ItemAlign.End }) { Column() { - Text(globalContext.resourceManager + Text((AppStorage.get("context") as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_tip_verify_in_portrait_mode').id)) .draggable(false) .fontColor($r('sys.color.ohos_id_color_text_primary_contrary')) diff --git a/entry/src/main/ets/pages/components/CustomPassword.ets b/entry/src/main/ets/pages/components/CustomPassword.ets index 634943c02747dbae20c64d2d55992831b94d26bd..0e85b00703cc862c56e3e8004c2eb9b41122e680 100644 --- a/entry/src/main/ets/pages/components/CustomPassword.ets +++ b/entry/src/main/ets/pages/components/CustomPassword.ets @@ -18,9 +18,9 @@ import userAuth from '@ohos.userIAM.userAuth'; import FullScreen from '../../common/components/FullScreen'; import FuncUtils from '../../common/utils/FuncUtils'; import LogUtils from '../../common/utils/LogUtils'; -import Constants, { CmdType } from '../../common/vm/Constants'; +import Constants, { CmdType, WantParams } from '../../common/vm/Constants'; import AuthUtils from '../../common/utils/AuthUtils'; -import { globalSession, globalWantParams } from '../../extensionability/UserAuthAbility'; +import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSession'; const TAG = 'CustomPassword'; const BLUR_OPACITY = 0.5; @@ -61,7 +61,7 @@ export default struct CustomPassword { }); } catch (error) { LogUtils.error(TAG, 'aboutToAppear PINAuth catch error: ' + error?.code); - globalSession?.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(() => { - globalSession?.terminateSelf?.(); + (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); AuthUtils.getInstance().sendNotice(Constants.noticeEventCancel, [] || - globalWantParams?.type as string[]); + (AppStorage.get("wantParams") as WantParams)?.type as string[]); }) .onTouch((event?: TouchEvent) => { if (event == undefined) { diff --git a/entry/src/main/ets/pages/components/FaceAuth.ets b/entry/src/main/ets/pages/components/FaceAuth.ets index 141954361aa4ac689a44e5b8e12191126c5e372a..dfaf23f1ac6ae62935d9522567e6a43a70dc94d0 100644 --- a/entry/src/main/ets/pages/components/FaceAuth.ets +++ b/entry/src/main/ets/pages/components/FaceAuth.ets @@ -14,7 +14,7 @@ */ import account_osAccount from '@ohos.account.osAccount'; import display from '@ohos.display'; -import util from '@ohos.util'; +import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSession'; import PassWord from '../../common/components/PassWord'; import SixPassword from '../../common/components/SixPassword'; import { DialogType } from '../../common/module/DialogType'; @@ -22,8 +22,8 @@ import AuthUtils from '../../common/utils/AuthUtils'; import FuncUtils from '../../common/utils/FuncUtils'; import LogUtils from '../../common/utils/LogUtils'; import TimeUtils from '../../common/utils/TimeUtils'; -import Constants, { CmdData, CmdType, FingerPosition } from '../../common/vm/Constants'; -import { globalContext, globalSession, globalWantParams } from '../../extensionability/UserAuthAbility'; +import Constants, { CmdData, CmdType, FingerPosition, WantParams } from '../../common/vm/Constants'; +import common from '@ohos.app.ability.common'; const TAG = 'FaceAuth'; @@ -47,7 +47,7 @@ let pinData = ''; @Component export default struct FaceAuth { - @State prompt: string = globalContext.resourceManager + @State prompt: string = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_recognition').id); @State @Watch('onTextValueChange') textValue: string = ''; @Link @Watch('onCmdDataChange') cmdData: Array; @@ -73,12 +73,12 @@ export default struct FaceAuth { @StorageLink('SYSTEM_NAVIGATION_BAR_HEIGHT') SYSTEM_NAVIGATION_BAR_HEIGHT: number = 0; countTime(freezingTime: number): void { - const TRY_AGAIN = globalContext.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, globalContext); - promptText = globalContext.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(freezingTime), INTERVAL, freezingTime - INTERVAL); } else { @@ -112,7 +112,7 @@ export default struct FaceAuth { } LogUtils.info(TAG, 'aboutToAppear this.fingerPositionY: ' + this.fingerPositionY); if (this.dialogType === DialogType.PIN_FACE || this.dialogType === DialogType.FACE) { - this.prompt = globalContext.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'); - globalSession?.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); - globalSession?.terminateSelf?.(); + (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); } } @@ -160,7 +160,7 @@ export default struct FaceAuth { sendFaceEvent(): void { if (!this.faceLock) { - this.prompt = globalContext.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,19 +196,19 @@ export default struct FaceAuth { const payload: CmdData = item.payload; if (payload.type === Constants.noticeTypePin) { if (payload.result === 0) { - globalSession?.terminateSelf(); + (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); } else { if (payload.remainAttempts) { - this.inputValue = globalContext.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 = globalContext.resourceManager + this.inputValue = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_pwd_error_can_try').id) - + payload.remainAttempts + globalContext.resourceManager + + payload.remainAttempts + (AppStorage.get("context") as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_frequency').id); } } @@ -224,16 +224,16 @@ export default struct FaceAuth { return; } if (payload.remainAttempts && payload.result !== 0) { - this.prompt = globalContext.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 = globalContext.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 = globalContext.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) { @@ -245,10 +245,10 @@ export default struct FaceAuth { } } if (payload.result === 0) { - this.prompt = globalContext.resourceManager + this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_recognize_success').id) setTimeout(() => { - globalSession?.terminateSelf?.(); + (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); }, SECOND); } } else if (payload.type === Constants.noticeTypeFinger) { @@ -282,7 +282,7 @@ export default struct FaceAuth { } } if (payload.remainAttempts && payload.result !== 0) { - this.prompt = globalContext.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) { @@ -292,11 +292,11 @@ export default struct FaceAuth { } } if (num === 'first') { - this.prompt = globalContext.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 = globalContext.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) { @@ -308,15 +308,15 @@ export default struct FaceAuth { } } if (payload.result === 0) { - this.prompt = globalContext.resourceManager + this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_fp_verify_success').id) setTimeout(() => { - globalSession?.terminateSelf?.(); + (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); }, SECOND); } } else { LogUtils.error(TAG, 'onCmdDataChange default'); - globalSession?.terminateSelf?.(); + (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); } }) } @@ -326,9 +326,9 @@ export default struct FaceAuth { AuthUtils.getInstance().sendNotice(Constants.noticeEventCancel, [Constants.noticeTypePin]); } else { AuthUtils.getInstance().sendNotice(Constants.noticeEventCancel, [] || - globalWantParams?.type as string[]); + (AppStorage.get("wantParams") as WantParams)?.type as string[]); } - globalSession?.terminateSelf?.(); + (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); } build() { @@ -470,7 +470,7 @@ export default struct FaceAuth { }) } - if (AppStorage.Get('titleLength') as number < globalWantParams?.title.length) { + if (AppStorage.Get('titleLength') as number < (AppStorage.get("wantParams") as WantParams)?.title.length) { Scroll() { Column() { Image($r('app.media.error_faceID')) @@ -483,7 +483,7 @@ export default struct FaceAuth { .onClick(() => { this.sendFaceEvent(); }) - Text(globalWantParams?.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')) @@ -494,7 +494,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, globalContext)) + .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%') @@ -513,7 +513,7 @@ export default struct FaceAuth { .onClick(() => { this.sendFaceEvent(); }) - Text(globalWantParams?.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')) @@ -525,7 +525,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, globalContext)) + .fontColor(this.onFontColor(this.prompt, (AppStorage.get("context") as common.ExtensionContext))) } Image($r('app.media.ic_blue_fingerprint')) .draggable(false) @@ -553,7 +553,7 @@ export default struct FaceAuth { } else if (this.dialogTypeFlag === PIN_FACE_FINGER && this.screenType === SCREEN_LAND && this.fingerPosition.udSensorRadiusInPx !== undefined) { Column() { - if (AppStorage.Get('titleLength') as number < globalWantParams?.title.length) { + if (AppStorage.Get('titleLength') as number < (AppStorage.get("wantParams") as WantParams)?.title.length) { Scroll() { Column() { // Facial fingerprint password, second form @@ -567,7 +567,7 @@ export default struct FaceAuth { .onClick(() => { this.sendFaceEvent(); }) - Text(globalWantParams?.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')) @@ -591,7 +591,7 @@ export default struct FaceAuth { .onClick(() => { this.sendFaceEvent(); }) - Text(globalWantParams?.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')) @@ -614,9 +614,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, globalContext)) + .fontColor(this.onFontColor(this.prompt, (AppStorage.get("context") as common.ExtensionContext))) .onClick(() => { - if (this.prompt === globalContext?.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(); } @@ -678,15 +678,15 @@ export default struct FaceAuth { Column() { if (this.dialogTypeFlag === PIN_FACE) { // Pin FACE - if (AppStorage.Get('titleLength') as number < globalWantParams?.title.length) { + if (AppStorage.Get('titleLength') as number < (AppStorage.get("wantParams") as WantParams)?.title.length) { Scroll() { Column() { - Text(globalWantParams?.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 !== globalContext.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) @@ -702,7 +702,7 @@ export default struct FaceAuth { }) Text(this.prompt).fontSize($r('sys.float.ohos_id_text_size_body2')) .draggable(false) - .fontColor(this.onFontColor(this.prompt, globalContext)) + .fontColor(this.onFontColor(this.prompt, (AppStorage.get("context") as common.ExtensionContext))) .height($r('app.float.size_24')) .onClick(() => { this.sendFaceEvent(); @@ -715,14 +715,14 @@ export default struct FaceAuth { .scrollable(ScrollDirection.Vertical) .scrollBarColor(Color.Gray) } else { - Text(globalWantParams?.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 !== globalContext.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) @@ -738,7 +738,7 @@ export default struct FaceAuth { }) Text(this.prompt).fontSize($r('sys.float.ohos_id_text_size_body2')) .draggable(false) - .fontColor(this.onFontColor(this.prompt, globalContext)) + .fontColor(this.onFontColor(this.prompt, (AppStorage.get("context") as common.ExtensionContext))) .height($r('app.float.size_24')) .onClick(() => { this.sendFaceEvent(); @@ -861,16 +861,16 @@ export default struct FaceAuth { } if (this.dialogTypeFlag === SINGLE_FACE) { // Single FACE - if (AppStorage.Get('titleLength') as number < globalWantParams?.title.length) { + if (AppStorage.Get('titleLength') as number < (AppStorage.get("wantParams") as WantParams)?.title.length) { Scroll() { Column() { - Text(globalWantParams?.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 !== globalContext.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) @@ -890,7 +890,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, globalContext)) + .fontColor(this.onFontColor(this.prompt, (AppStorage.get("context") as common.ExtensionContext))) .onClick(() => { this.sendFaceEvent(); }) @@ -902,7 +902,7 @@ export default struct FaceAuth { .scrollable(ScrollDirection.Vertical) .scrollBarColor(Color.Gray) } else { - Text(globalWantParams?.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')) @@ -910,7 +910,7 @@ export default struct FaceAuth { .height($r('app.float.size_24')) .fontWeight(FontWeight.Medium) .id('titleFaceAuth') - Image(this.prompt !== globalContext.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) @@ -930,12 +930,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, globalContext)) + .fontColor(this.onFontColor(this.prompt, (AppStorage.get("context") as common.ExtensionContext))) .onClick(() => { this.sendFaceEvent(); }) } - if (!(globalWantParams?.navigationButtonText as string)) { + if (!((AppStorage.get("wantParams") as WantParams)?.navigationButtonText as string)) { Row() { Column() { Button($r('app.string.unified_authwidget_cancel'), { stateEffect: true }) @@ -976,10 +976,10 @@ export default struct FaceAuth { .color($r('sys.color.ohos_id_color_list_separator')) .width($r('app.float.divider_width')) Column() { - Button(globalWantParams?.navigationButtonText as string) + Button((AppStorage.get("wantParams") as WantParams)?.navigationButtonText as string) .onClick(() => { AuthUtils.getInstance().sendNotice('EVENT_AUTH_USER_NAVIGATION', [Constants.noticeTypeFace]); - globalSession?.terminateSelf?.(); + (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); }) .margin({ right: $r('app.float.content_padding') }) .width(Constants.ninetyPercentWidth) diff --git a/entry/src/main/ets/pages/components/FingerprintAuth.ets b/entry/src/main/ets/pages/components/FingerprintAuth.ets index d0788deb0d9be2175653d0e0426da67aa3909d75..f04c89a49756a5722ed8d81b8397a7a85a05b92d 100644 --- a/entry/src/main/ets/pages/components/FingerprintAuth.ets +++ b/entry/src/main/ets/pages/components/FingerprintAuth.ets @@ -15,7 +15,7 @@ import account_osAccount from '@ohos.account.osAccount'; import display from '@ohos.display'; -import userAuth from '@ohos.userIAM.userAuth'; +import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSession'; import PassWord from '../../common/components/PassWord'; import SixPassword from '../../common/components/SixPassword'; import { DialogType } from '../../common/module/DialogType'; @@ -23,8 +23,8 @@ import AuthUtils from '../../common/utils/AuthUtils'; import FuncUtils from '../../common/utils/FuncUtils'; import LogUtils from '../../common/utils/LogUtils'; import TimeUtils from '../../common/utils/TimeUtils'; -import Constants, { CmdData, CmdType, FingerPosition } from '../../common/vm/Constants'; -import { globalContext, globalSession, globalWantParams } from '../../extensionability/UserAuthAbility'; +import Constants, { CmdData, CmdType, FingerPosition, WantParams } from '../../common/vm/Constants'; +import common from '@ohos.app.ability.common'; const TAG = 'FingerprintAuth'; const INTERVAL = 1000; @@ -53,7 +53,7 @@ export default struct FingerprintAuth { @Link type: string; @Link pinSubType: string; @Link dialogType: DialogType; - @State prompt: string = globalContext.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; @@ -100,7 +100,7 @@ export default struct FingerprintAuth { }); } catch (error) { LogUtils.error(TAG, 'aboutToAppear PINAuth catch error: ' + error?.code); - globalSession?.terminateSelf?.(); + (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); } } @@ -118,19 +118,19 @@ export default struct FingerprintAuth { const payload: CmdData = item.payload; if (payload.type === Constants.noticeTypePin) { if (payload.result === 0) { - globalSession?.terminateSelf(); + (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); } else { if (payload.remainAttempts) { - this.inputValue = globalContext.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 = globalContext.resourceManager + this.inputValue = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_pwd_error_can_try').id) + - payload.remainAttempts + globalContext.resourceManager + payload.remainAttempts + (AppStorage.get("context") as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_frequency').id); } } @@ -166,7 +166,7 @@ export default struct FingerprintAuth { } } if (payload.remainAttempts && payload.result !== 0) { - this.prompt = globalContext.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) { @@ -176,13 +176,13 @@ export default struct FingerprintAuth { } } if (num === 'first') { - this.prompt = globalContext.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 = globalContext.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) { @@ -195,15 +195,15 @@ export default struct FingerprintAuth { } } if (payload.result === 0) { - this.prompt = globalContext.resourceManager + this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_fp_verify_success').id) setTimeout(() => { - globalSession?.terminateSelf?.(); + (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); }, SECOND); } } else { LogUtils.error(TAG, 'onCmdDataChange default'); - globalSession?.terminateSelf?.(); + (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); } }) } @@ -215,14 +215,14 @@ export default struct FingerprintAuth { } countTime(freezingTime: number): void { - const TRY_AGAIN = globalContext.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, globalContext); - promptText = globalContext.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(freezingTime), INTERVAL, freezingTime - INTERVAL); } else { @@ -263,9 +263,9 @@ export default struct FingerprintAuth { AuthUtils.getInstance().sendNotice(Constants.noticeEventCancel, [Constants.noticeTypePin]); } else { AuthUtils.getInstance().sendNotice(Constants.noticeEventCancel, [] || - globalWantParams?.type as string[]); + (AppStorage.get("wantParams") as WantParams)?.type as string[]); } - globalSession?.terminateSelf?.(); + (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); } toPin(): void { @@ -294,10 +294,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 < globalWantParams?.title.length) { + if (AppStorage.Get('titleLength') as number < (AppStorage.get("wantParams") as WantParams)?.title.length) { Scroll() { Column() { - Text(globalWantParams?.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')) @@ -310,7 +310,7 @@ export default struct FingerprintAuth { .id('outFingerImage') Text(this.prompt) .draggable(false) - .fontColor(this.onFingerPrintFontColor(this.prompt, globalContext)) + .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')}) } @@ -320,7 +320,7 @@ export default struct FingerprintAuth { .scrollable(ScrollDirection.Vertical) .scrollBarColor(Color.Gray) } else { - Text(globalWantParams?.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')) @@ -335,7 +335,7 @@ export default struct FingerprintAuth { .id('outFingerImage') Text(this.prompt) .draggable(false) - .fontColor(this.onFingerPrintFontColor(this.prompt, globalContext)) + .fontColor(this.onFingerPrintFontColor(this.prompt, (AppStorage.get("context") as common.ExtensionContext))) .fontSize($r('sys.float.ohos_id_text_size_body2')) } } @@ -382,7 +382,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 (!(globalWantParams?.navigationButtonText as string)) { + if (!((AppStorage.get("wantParams") as WantParams)?.navigationButtonText as string)) { Row() { Column() { Button($r('app.string.unified_authwidget_cancel'), { stateEffect: true }) @@ -424,11 +424,11 @@ export default struct FingerprintAuth { .color($r('sys.color.ohos_id_color_list_separator')) .width($r('app.float.divider_width')) Column() { - Button(globalWantParams?.navigationButtonText as string) + Button((AppStorage.get("wantParams") as WantParams)?.navigationButtonText as string) .onClick(() => { AuthUtils.getInstance() .sendNotice('EVENT_AUTH_USER_NAVIGATION', [Constants.noticeTypeFinger]); - globalSession?.terminateSelf?.(); + (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); }) .margin({ right: $r('app.float.content_padding') }) .width(Constants.ninetyPercentWidth) @@ -614,9 +614,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 < globalWantParams?.title.length) { + if (AppStorage.Get('titleLength') as number < (AppStorage.get("wantParams") as WantParams)?.title.length) { Scroll() { - Text(globalWantParams?.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')) @@ -629,7 +629,7 @@ export default struct FingerprintAuth { .scrollable(ScrollDirection.Vertical) .scrollBarColor(Color.Gray) } else { - Text(globalWantParams?.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')) @@ -637,7 +637,7 @@ export default struct FingerprintAuth { .height($r('app.float.size_24')) .fontWeight(FontWeight.Medium) } - Image(this.prompt === globalContext.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) @@ -654,7 +654,7 @@ export default struct FingerprintAuth { }) Text(this.prompt) .draggable(false) - .fontColor(this.onFingerPrintFontColor(this.prompt, globalContext)) + .fontColor(this.onFingerPrintFontColor(this.prompt, (AppStorage.get("context") as common.ExtensionContext))) .fontSize($r('sys.float.ohos_id_text_size_body2')) Row() { Column() { @@ -728,10 +728,10 @@ export default struct FingerprintAuth { }) } - if (AppStorage.Get('titleLength') as number < globalWantParams?.title.length) { + if (AppStorage.Get('titleLength') as number < (AppStorage.get("wantParams") as WantParams)?.title.length) { Scroll() { Column() { - Text(globalWantParams?.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')) @@ -741,7 +741,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, globalContext)) + .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%') @@ -749,7 +749,7 @@ export default struct FingerprintAuth { .scrollable(ScrollDirection.Vertical) .scrollBarColor(Color.Gray) } else { - Text(globalWantParams?.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')) @@ -760,9 +760,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, globalContext)) + .fontColor(this.onFingerPrintFontColor(this.prompt, (AppStorage.get("context") as common.ExtensionContext))) } - Image(this.prompt === globalContext.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) @@ -789,9 +789,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 < globalWantParams?.title.length) { + if (AppStorage.Get('titleLength') as number < (AppStorage.get("wantParams") as WantParams)?.title.length) { Scroll() { - Text(globalWantParams?.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')) @@ -804,7 +804,7 @@ export default struct FingerprintAuth { .scrollable(ScrollDirection.Vertical) .scrollBarColor(Color.Gray) } else { - Text(globalWantParams?.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')) @@ -812,7 +812,7 @@ export default struct FingerprintAuth { .height($r('app.float.size_24')) .fontWeight(FontWeight.Medium) } - Image(this.prompt === globalContext.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) @@ -829,9 +829,9 @@ export default struct FingerprintAuth { }) Text(this.prompt) .draggable(false) - .fontColor(this.onFingerPrintFontColor(this.prompt, globalContext)) + .fontColor(this.onFingerPrintFontColor(this.prompt, (AppStorage.get("context") as common.ExtensionContext))) .fontSize($r('sys.float.ohos_id_text_size_body2')) - if (!(globalWantParams?.navigationButtonText as string)) { + if (!((AppStorage.get("wantParams") as WantParams)?.navigationButtonText as string)) { Row() { Column() { Button($r('app.string.unified_authwidget_cancel'), { stateEffect: true }) @@ -873,11 +873,11 @@ export default struct FingerprintAuth { .color($r('sys.color.ohos_id_color_list_separator')) .width($r('app.float.divider_width')) Column() { - Button((globalWantParams?.navigationButtonText as string)) + Button(((AppStorage.get("wantParams") as WantParams)?.navigationButtonText as string)) .onClick(() => { AuthUtils.getInstance() .sendNotice('EVENT_AUTH_USER_NAVIGATION', [Constants.noticeTypeFinger]); - globalSession?.terminateSelf?.(); + (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); }) .id('navigationButtonTextFingerprintAuth') .margin({ right: $r('app.float.content_padding') }) @@ -907,8 +907,8 @@ export default struct FingerprintAuth { this.handleCancel(); this.textValue = ''; }) - if (globalWantParams?.navigationButtonText as string) { - Button(globalWantParams?.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')) @@ -923,15 +923,15 @@ export default struct FingerprintAuth { .onClick(() => { AuthUtils.getInstance() .sendNotice('EVENT_AUTH_USER_NAVIGATION', [Constants.noticeTypeFinger]); - globalSession?.terminateSelf?.(); + (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); }) } } - if (AppStorage.Get('titleLength') as number < globalWantParams?.title.length) { + if (AppStorage.Get('titleLength') as number < (AppStorage.get("wantParams") as WantParams)?.title.length) { Scroll() { Column() { - Text(globalWantParams?.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')) @@ -941,7 +941,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, globalContext)) + .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%') @@ -949,7 +949,7 @@ export default struct FingerprintAuth { .scrollable(ScrollDirection.Vertical) .scrollBarColor(Color.Gray) } else { - Text(globalWantParams?.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')) @@ -960,9 +960,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, globalContext)) + .fontColor(this.onFingerPrintFontColor(this.prompt, (AppStorage.get("context") as common.ExtensionContext))) } - Image(this.prompt === globalContext.resourceManager + Image(this.prompt === (AppStorage.get("context") as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_fp_verify_success').id) ? $r('app.media.right_faceID') : $r('app.media.ic_blue_fingerprint')) .draggable(false) diff --git a/entry/src/main/ets/pages/components/PasswordAuth.ets b/entry/src/main/ets/pages/components/PasswordAuth.ets index 9d0867ccd4c8b6a54fc5811ba699c064f7f02f65..01d74458e6d6f2199538c291931500e895032361 100644 --- a/entry/src/main/ets/pages/components/PasswordAuth.ets +++ b/entry/src/main/ets/pages/components/PasswordAuth.ets @@ -14,14 +14,15 @@ */ import account_osAccount from '@ohos.account.osAccount'; +import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSession'; +import common from '@ohos.app.ability.common'; import PassWord from '../../common/components/PassWord'; import SixPassword from '../../common/components/SixPassword'; import AuthUtils from '../../common/utils/AuthUtils'; import FuncUtils from '../../common/utils/FuncUtils'; import LogUtils from '../../common/utils/LogUtils'; import TimeUtils from '../../common/utils/TimeUtils'; -import Constants, { CmdData, CmdType } from '../../common/vm/Constants'; -import { globalContext, globalSession, globalWantParams } from '../../extensionability/UserAuthAbility'; +import Constants, { CmdData, CmdType, WantParams } from '../../common/vm/Constants'; const TAG = 'PasswordAuth'; const INTERVAL = 1000; @@ -53,15 +54,15 @@ export default struct PasswordAuth { const payload: CmdData = item.payload; if (payload.type === Constants.noticeTypePin) { if (payload.remainAttempts && payload.remainAttempts < MAX_FAIL_TIMES) { - this.inputValue = globalContext.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 = globalContext.resourceManager + this.inputValue = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_pwd_error_can_try').id) - + payload.remainAttempts + globalContext.resourceManager + + payload.remainAttempts + (AppStorage.get("context") as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_frequency').id); } if (num === 'first') { @@ -77,7 +78,7 @@ export default struct PasswordAuth { return; } if (payload.result === 0) { - globalSession?.terminateSelf(); + (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); } this.inputValue = ' '; this.textValue = ''; @@ -102,7 +103,7 @@ export default struct PasswordAuth { }); } catch (error) { LogUtils.error(TAG, 'aboutToAppear PINAuth catch error: ' + error?.code); - globalSession?.terminateSelf?.(); + (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); } } @@ -112,12 +113,12 @@ export default struct PasswordAuth { } countTime(freezingTime: number): void { - const TRY_AGAIN = globalContext.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, globalContext); - promptText = globalContext.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(freezingTime), INTERVAL, freezingTime - INTERVAL); } else { @@ -129,8 +130,8 @@ export default struct PasswordAuth { handleCancel(): void { AuthUtils.getInstance().sendNotice(Constants.noticeEventCancel, [] || - globalWantParams?.type as string[]); - globalSession?.terminateSelf?.(); + (AppStorage.get("wantParams") as WantParams)?.type as string[]); + (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); } build() { diff --git a/entry/src/ohosTest/ets/extensionability/UserAuthAbility.ts b/entry/src/ohosTest/ets/extensionability/UserAuthAbility.ts deleted file mode 100644 index dbfc99b9bb4d8dd3428b7e22f34b7cb5d8134a9f..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/extensionability/UserAuthAbility.ts +++ /dev/null @@ -1,66 +0,0 @@ -/** - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import LogUtils from '../../../main/ets/common/utils/LogUtils'; -import UserAuthExtensionAbility from '@ohos.app.ability.UserAuthExtensionAbility'; -import WindowPrivacyUtils from '../../../main/ets/common/utils/WindowPrivacyUtils'; - -const TAG = 'UserAuthAbility'; -// The current interface only support string type -const TRANSPARENT_COLOR = '#00000000'; -const MASK_THIN_COLOR = '#33182431'; - -export default class UserAuthAbility extends UserAuthExtensionAbility { - onCreate() { - LogUtils.info(TAG, 'UserAuthExtensionAbility onCreate'); - globalThis.context = this.context; - } - - onForeground(): void { - LogUtils.info(TAG, 'UserAuthExtensionAbility onForeground'); - } - - onBackground(): void { - LogUtils.info(TAG, 'UserAuthExtensionAbility onBackground'); - globalThis.session?.terminateSelf(); - } - - onDestroy(): void | Promise { - LogUtils.info(TAG, 'UserAuthExtensionAbility onDestroy'); - } - - onSessionCreate(want, session): void { - LogUtils.info(TAG, 'UserAuthExtensionAbility onSessionCreate'); - globalThis.wantParams = want?.parameters?.useriamCmdData; - globalThis.session = session; - session?.loadContent('pages/Index'); - try { - if (globalThis.wantParams?.windowModeType === 'DIALOG_BOX') { - session?.setWindowBackgroundColor(MASK_THIN_COLOR); - } else { - session?.setWindowBackgroundColor(TRANSPARENT_COLOR); - } - } catch (error) { - LogUtils.error(TAG, 'UserAuthExtensionAbility onSessionCreate error: ' + error?.code); - session?.terminateSelf(); - } - WindowPrivacyUtils.setWindowPrivacyMode(session, true); - } - - onSessionDestroy(session): void { - LogUtils.info(TAG, 'UserAuthExtensionAbility onSessionDestroy'); - WindowPrivacyUtils.setWindowPrivacyMode(session, false); - } -} diff --git a/entry/src/ohosTest/ets/test/List.test.ets b/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 77e53216ae2fd6430126ac9cc97dffb79ff467a8..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,102 +0,0 @@ -/** - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import ConstantsTest from './jsunit/Constants.test'; -import FuncUtilsTest from './jsunit/FuncUtils.test'; -import PageComTest from './jsunit/PageCom.test'; -import FindWindowExampleTest from './uitest/FindWindowExample.test'; -import PinNumberTest from './uitest/PinNumber.test'; -import CustomPinTest from './uitest/CustomPin.test'; -import CustomMixFailTest from './uitest/CustomMixFail.test'; -import CustomMixFailTimesTest from './uitest/CustomMixFailTimes.test'; -import CustomPasswordNumberTest from './uitest/CustomPasswordNumber.test'; -import PinTest from './uitest/Pin.test'; -import PinFailTimesTest from './uitest/PinFailTimes.test'; -import FingerLock from './uitest/FingerLock.test'; -import PinFaceTest from './uitest/PinFace.test'; -import FaceTest from './uitest/Face.test'; -import FaceFailTimesTest from './uitest/FaceFailTimes.test'; -import FaceMixTimesAuthTest from './uitest/FaceMixAuth.test'; -import PinFaceFailTest from './uitest/PinFaceFail.test'; -import FaceMixFailAuthTest from './uitest/FaceMixFailAuth.test'; -import FaceMixSuccessAllTest from './uitest/FaceMixSuccessAll.test'; -import FaceMixFailAllTest from './uitest/FaceMixFailAll.test'; -import FacePinFailTimesTest from './uitest/FacePinFailTimes.test'; -import FaceFingerFailTimesTest from './uitest/FaceFingerFailTimes.test'; -import FaceFingerFailTest from './uitest/FaceFingerFail.test'; -import FaceMixSuccessLandscapeTest from './uitest/FaceMixSuccessLandscape.test'; -import FingerTest from './uitest/finger.test'; -import PinFingerTest from './uitest/PinFinger.test'; -import FingerFailAuthTest from './uitest/FingerFailTimesAuth.test'; -import PinFingerFailTest from './uitest/PinFingerFail.test'; -import FingerUnderTest from './uitest/FingerUnder.test'; -import PinFingerOnTest from './uitest/PinFingerOn.test'; -import PinFingerUnderTest from './uitest/PinFingerUnder.test'; -import FingerOnTest from './uitest/FingerOn.test'; -import PinFingerOnFailTest from './uitest/PinFingerOnFail.test'; -import PinFingerUnderFailTest from './uitest/PinFingerUnderFail.test'; -import FingerOnNullTest from './uitest/FingerOnNull.test'; -import FingerUnderNullTest from './uitest/FingerUnderNull.test'; -import FingerOutBackTest from './uitest/FingerOutBack.test'; -import FingerOutFrontTest from './uitest/FingerOutFront.test'; -import FingerOutSideTest from './uitest/FingerOutSide.test'; -import PinFingerOutBackTest from './uitest/PinFingerOutBack.test'; -import PinFingerOutFrontTest from './uitest/PinFingerOutFront.test'; -import PinFingerOutSideTest from './uitest/PinFingerOutSide.test'; - -export default function testsuite() { - PageComTest(); - FuncUtilsTest(); - ConstantsTest(); - FindWindowExampleTest(); - FingerTest(); - PinFingerTest(); - FingerFailAuthTest(); - PinFingerFailTest(); - PinNumberTest(); - CustomPinTest(); - CustomMixFailTest(); - CustomMixFailTimesTest(); - CustomPasswordNumberTest(); - FaceTest(); - FaceFailTimesTest(); - FaceMixTimesAuthTest(); - PinTest(); - PinFailTimesTest(); - FingerLock(); - PinFaceTest(); - PinFaceFailTest(); - FaceMixFailAuthTest(); - FaceMixSuccessAllTest(); - FaceMixFailAllTest(); - FacePinFailTimesTest(); - FaceFingerFailTimesTest(); - FaceFingerFailTest(); - FaceMixSuccessLandscapeTest(); - FingerOnTest(); - FingerUnderTest(); - PinFingerOnTest(); - PinFingerUnderTest(); - PinFingerOnFailTest(); - PinFingerUnderFailTest(); - FingerOnNullTest(); - FingerUnderNullTest(); - FingerOutBackTest(); - FingerOutFrontTest(); - FingerOutSideTest(); - PinFingerOutBackTest(); - PinFingerOutFrontTest(); - PinFingerOutSideTest(); -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/jsunit/Constants.test.ets b/entry/src/ohosTest/ets/test/jsunit/Constants.test.ets deleted file mode 100644 index ecd455b6cead00a7bd259f369e1a132eab652aba..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/jsunit/Constants.test.ets +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { describe, expect, it } from '@ohos/hypium'; -import Constants from '../../../../main/ets/common/vm/Constants'; - -export default function ConstantsTest() { - describe('ConstantsTest', function () { - it('constants_test', 0, function (done) { - expect(Constants.pinSix).assertEqual('PIN_SIX'); - expect(Constants.pinNumber).assertEqual('PIN_NUMBER'); - expect(Constants.pinMixed).assertEqual('PIN_MIXED'); - expect(Constants.userAuthWidgetMgrVersion).assertEqual(1); - expect(Constants.userAuthWidgetMgrSuccess).assertEqual(0); - expect(Constants.noticeVersion).assertEqual('1'); - expect(Constants.noticeTypePin).assertEqual('pin'); - expect(Constants.noticeTypeFace).assertEqual('face'); - expect(Constants.noticeTypeFinger).assertEqual('fingerprint'); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/jsunit/FuncUtils.test.ets b/entry/src/ohosTest/ets/test/jsunit/FuncUtils.test.ets deleted file mode 100644 index f15d34c1f714c91c915f7124829460f3526f57f9..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/jsunit/FuncUtils.test.ets +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import userAuth from '@ohos.userIAM.userAuth'; -import { beforeAll, describe, expect, it } from '@ohos/hypium'; -import AuthUtils from '../../../../main/ets/common/utils/AuthUtils'; -import FuncUtils from '../../../../main/ets/common/utils/FuncUtils'; -import LogUtils from '../../../../main/ets/common/utils/LogUtils'; -import TimeUtils from '../../../../main/ets/common/utils/TimeUtils'; -import WindowPrivacyUtils from '../../../../main/ets/common/utils/WindowPrivacyUtils'; - -const TAG = 'FuncUtilsTest'; - -export default function FuncUtilsTest() { - describe('FuncUtilsTest', function () { - beforeAll(async function () { - let userAuthInstance = null; - const authParam = { - challenge: new Uint8Array([49, 49, 49, 49, 49, 49]), - authType: [1], - authTrustLevel: 10000, - }; - const widgetParam = { - title: '', - windowMode: 1, - navigationButtonText: '', - }; - userAuthInstance = await userAuth.getUserAuthInstance(authParam, widgetParam); - userAuthInstance.on('result', { - callback: function (result) { - LogUtils.info(TAG, 'userAuthInstance callback result = ' + JSON.stringify(result)); - } - }); - userAuthInstance.start(); - }) - - it('getUint8PWFunc_test', 0, function (done) { - const data1 = FuncUtils.getUint8PW('111111'); - const data2 = FuncUtils.getUint8PW('11111111'); - FuncUtils.getWindowHeight(); - expect(data1).assertInstanceOf('Uint8Array'); - expect(data2).assertInstanceOf('Uint8Array'); - done(); - }) - - it('getDialogTypeFunc_test', 0, function (done) { - const data1 = FuncUtils.getDialogType([1]); - const data2 = FuncUtils.getDialogType([1, 2, 4]); - const data3 = FuncUtils.getDialogType([]); - const data4 = FuncUtils.getDialogType(null); - const data5 = FuncUtils.getDialogType(undefined); - const data6 = FuncUtils.getDialogType([1, 2]); - const data7 = FuncUtils.getDialogType([1, 4]); - const data8 = FuncUtils.getDialogType([2]); - const data9 = FuncUtils.getDialogType([4]); - expect(data1).assertEqual(1); - expect(data2).assertEqual(10); - expect(data3).assertEqual(1); - expect(data4).assertEqual(1); - expect(data5).assertEqual(1); - expect(data6).assertEqual(6); - expect(data7).assertEqual(7); - expect(data8).assertEqual(2); - expect(data9).assertEqual(3); - done(); - }) - - it('getWindowHeightFunc_test', 0, function (done) { - FuncUtils.getWindowHeight(); - done(); - }) - - it('judgmentOverflowFunc_test', 0, function (done) { - FuncUtils.judgmentOverflow(Number.POSITIVE_INFINITY); - FuncUtils.judgmentOverflow(Number.NEGATIVE_INFINITY); - done(); - }) - - it('sendNoticeFunc_test', 0, async function (done) { - AuthUtils.getInstance().sendNotice('EVENT_AUTH_TYPE_READY', ['pin']); - AuthUtils.getInstance().sendNotice('EVENT_AUTH_TYPE_START', ['pin']); - done(); - }) - - it('logFunc_test', 0, async function (done) { - LogUtils.debug(TAG, 'debug log test'); - LogUtils.info(TAG, 'info log test'); - LogUtils.warn(TAG, 'warning log test'); - LogUtils.error(TAG, 'error log test'); - LogUtils.fatal(TAG, 'fatal log test'); - done(); - }) - - it('getFreezingTimeNmFunc_test', 0, async function (done) { - TimeUtils.getFreezingTimeNm(10000, globalThis.context); - TimeUtils.getFreezingTimeNm(100000, globalThis.context); - done(); - }) - - it('setWindowPrivacyModeFunc_test', 0, async function (done) { - WindowPrivacyUtils.setWindowPrivacyMode(null, false); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/jsunit/PageCom.test.ets b/entry/src/ohosTest/ets/test/jsunit/PageCom.test.ets deleted file mode 100644 index a5e6fc609b504353f5223cb5fd480651f5747cef..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/jsunit/PageCom.test.ets +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { describe, expect, it } from '@ohos/hypium'; -import userAuth from '@ohos.userIAM.userAuth'; -import LogUtils from '../../../../main/ets/common/utils/LogUtils'; - -const TAG = 'PageComTest'; - -export default function PageComTest() { - describe('PageComTest', function () { - it('clickEventOk_Input', 0, async function (done) { - let userAuthInstance = null; - const authParam = { - challenge: new Uint8Array([49, 49, 49, 49, 49, 49]), - authType: [1, 2, 4], - authTrustLevel: 10000, - }; - const widgetParam = { - title: '使用密码验证', - windowMode: 1, - navigationButtonText: '确认', - }; - userAuthInstance = await userAuth.getUserAuthInstance(authParam, widgetParam); - userAuthInstance.on('result', { - callback: function (result) { - LogUtils.info(TAG, 'userAuthInstance onResult: ' + JSON.stringify(result)); - } - }); - expect(userAuthInstance).not().assertNull(); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/uitest/CustomMixFail.test.ets b/entry/src/ohosTest/ets/test/uitest/CustomMixFail.test.ets deleted file mode 100644 index 856210de0bd5f90265cd06b00a9c41ab93e4ee58..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/uitest/CustomMixFail.test.ets +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Driver, ON } from '@ohos.UiTest'; -import { beforeAll, describe, expect, it } from '@ohos/hypium'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -const delayTime: number = 1000; - -export default function CustomMixFailTest() { - describe('CustomMixFailTest', function () { - beforeAll(async function () { - const data = { - "cmd": [{ - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 23333, "remainAttempts": 0, "type": "pin", "sensorInfo": "" - }, "version": "1" - }, { - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 10000, "remainAttempts": 0, "type": "face", "sensorInfo": "" - }, "version": "1" - }, { - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 110, - "remainAttempts": 0, - "sensorInfo": "{\"sensorType\":\"SensorType1\",\"udSensorCenterXInThousandth\":500,\"udSensorCenterYInThousandth\":500,\"udSensorRadiusInPx\":30}", - "type": "fingerprint" - }, "version": "1" - }], - "pinSubType": "PIN_MIXED", - "title": "", - "type": ["pin", "face", "fingerprint"], - "widgetContextId": 6711153399710207000, - "windowModeType": "FULLSCREEN" - }; - globalThis.wantParams = data; - - let want = { - bundleName: bundleName, - abilityName: 'CustomMixFailAbility' - } - await delegator.startAbility(want); - }) - - it('pinInput_full_customPwd_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('pinInput')); - expect(true).assertTrue(); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/uitest/CustomMixFailTimes.test.ets b/entry/src/ohosTest/ets/test/uitest/CustomMixFailTimes.test.ets deleted file mode 100644 index 5ee10c5643b134d5a5f2c5de01c1f47c6adcf033..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/uitest/CustomMixFailTimes.test.ets +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Driver, ON } from '@ohos.UiTest'; -import { beforeAll, describe, expect, it } from '@ohos/hypium'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -const delayTime: number = 1000; - -export default function CustomMixFailTimesTest() { - describe('CustomMixFailTimes', function () { - beforeAll(async function () { - const data = { - "cmd": [{ - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, "remainAttempts": 2, "type": "pin", "sensorInfo": "" - }, "version": "1" - }, { - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, "remainAttempts": 1, "type": "face", "sensorInfo": "" - }, "version": "1" - }, { - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, - "remainAttempts": 2, - "sensorInfo": "{\"sensorType\":\"SensorType1\",\"udSensorCenterXInThousandth\":500,\"udSensorCenterYInThousandth\":500,\"udSensorRadiusInPx\":30}", - "type": "fingerprint" - }, "version": "1" - }], - "pinSubType": "PIN_MIXED", - "title": "", - "type": ["pin", "face", "fingerprint"], - "widgetContextId": 6711153399710207000, - "windowModeType": "FULLSCREEN" - }; - globalThis.wantParams = data; - - let want = { - bundleName: bundleName, - abilityName: 'CustomMixFailTimesAbility' - } - await delegator.startAbility(want); - }) - - it('pinInput_full_customPwd_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('pinInput')); - expect(true).assertTrue(); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/uitest/CustomPasswordFingerTimes.test.ets b/entry/src/ohosTest/ets/test/uitest/CustomPasswordFingerTimes.test.ets deleted file mode 100644 index 93d74cae4ad3b859dd529cc348d86b28ef0ca7f2..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/uitest/CustomPasswordFingerTimes.test.ets +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Driver, ON } from '@ohos.UiTest'; -import { beforeAll, describe, expect, it } from '@ohos/hypium'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -const delayTime: number = 1000; - -export default function CustomPasswordFingerTimesTest() { - describe('CustomPasswordFingerTimesTest', function () { - beforeAll(async function () { - const data = { - "cmd": [{ - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, "remainAttempts": 2, "type": "pin", "sensorInfo": "" - }, "version": "1" - }, { - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, "remainAttempts": 1, "type": "face", "sensorInfo": "" - }, "version": "1" - }, { - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, - "remainAttempts": 1, - "sensorInfo": "{\"sensorType\":\"SensorType1\",\"udSensorCenterXInThousandth\":500,\"udSensorCenterYInThousandth\":500,\"udSensorRadiusInPx\":30}", - "type": "fingerprint" - }, "version": "1" - }], - "pinSubType": "PIN_MIXED", - "title": "", - "type": ["pin", "face", "fingerprint"], - "widgetContextId": 6711153399710207000, - "windowModeType": "FULLSCREEN" - }; - globalThis.wantParams = data; - - let want = { - bundleName: bundleName, - abilityName: 'FingerprintAbility' - } - await delegator.startAbility(want); - }) - - it('pinInput_full_customPwd_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('pinInput')); - expect(true).assertTrue(); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/uitest/CustomPasswordNumber.test.ets b/entry/src/ohosTest/ets/test/uitest/CustomPasswordNumber.test.ets deleted file mode 100644 index 87156d97e225e1b2580ae418818211b689804e95..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/uitest/CustomPasswordNumber.test.ets +++ /dev/null @@ -1,273 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Driver, ON } from '@ohos.UiTest'; -import { beforeAll, describe, expect, it } from '@ohos/hypium'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; -import userAuth from '@ohos.userIAM.userAuth'; -import Constants from '../../../../main/ets/common/vm/Constants'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -const delayTime: number = 1000; - -export default function CustomPasswordNumberTest() { - describe('CustomPasswordNumberTest', function () { - beforeAll(async function () { - let userAuthInstance = null; - const authParam = { - challenge: new Uint8Array([49, 49, 49, 49, 49, 49]), - authType: [1], - authTrustLevel: 10000, - }; - const widgetParam = { - title: '使用密码验证', - windowMode: 2, - navigationButtonText: '确认', - }; - userAuthInstance = await userAuth.getUserAuthInstance(authParam, widgetParam); - userAuthInstance.start(); - - const data = { - "cmd": [{ - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, "remainAttempts": 5, "type": "pin", "sensorInfo": "" - }, "version": "1" - }], - "pinSubType": "PIN_SIX", - "title": "", - "type": ["pin"], - "widgetContextId": 7932856209793250000, - "windowModeType": "FULLSCREEN", - }; - globalThis.wantParams = data; - - let want = { - bundleName: bundleName, - abilityName: 'CustomPwdNumberAbility' - } - await delegator.startAbility(want); - }) - - it('numKeyBord0_customPwd_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('numKeyBordCustomPwd0')); - expect(true).assertTrue(); - done(); - }) - - it('numKeyBord1_customPwd_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('numKeyBordCustomPwd1')); - expect(true).assertTrue(); - done(); - }) - - it('numKeyBord2_customPwd_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('numKeyBordCustomPwd2')); - expect(true).assertTrue(); - done(); - }) - - it('numKeyBord3_customPwd_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('numKeyBordCustomPwd3')); - expect(true).assertTrue(); - done(); - }) - - it('numKeyBord4_customPwd_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('numKeyBordCustomPwd4')); - expect(true).assertTrue(); - done(); - }) - - it('numKeyBord5_customPwd_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('numKeyBordCustomPwd5')); - expect(true).assertTrue(); - done(); - }) - - it('numKeyBord6_customPwd_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('numKeyBordCustomPwd6')); - expect(true).assertTrue(); - done(); - }) - - it('numKeyBord7_customPwd_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('numKeyBordCustomPwd7')); - expect(true).assertTrue(); - done(); - }) - - it('numKeyBord8_customPwd_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('numKeyBordCustomPwd8')); - expect(true).assertTrue(); - done(); - }) - - it('numKeyBord10_customPwd_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('numKeyBordCustomPwd10')); - expect(true).assertTrue(); - done(); - }) - - it('numKeyBord9_customPwd_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('numKeyBordCustomPwd9')); - expect(true).assertTrue(); - done(); - }) - - it('numKeyBord11_customPwd_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('numKeyBordCustomPwd11')); - expect(true).assertTrue(); - done(); - }) - - it('textNumKeyBord0_customPwd_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('textNumKeyBordCustomPwd0')); - expect(true).assertTrue(); - done(); - }) - - it('textNumKeyBord1_customPwd_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('textNumKeyBordCustomPwd1')); - expect(true).assertTrue(); - done(); - }) - - it('teNtnumKeyBord2_customPwd_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('textNumKeyBordCustomPwd2')); - expect(true).assertTrue(); - done(); - }) - - it('textNumKeyBord3_customPwd_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('textNumKeyBordCustomPwd3')); - expect(true).assertTrue(); - done(); - }) - - it('textNumKeyBord4_customPwd_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('textNumKeyBordCustomPwd4')); - expect(true).assertTrue(); - done(); - }) - - it('textNumKeyBord5_customPwd_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('textNumKeyBordCustomPwd5')); - expect(true).assertTrue(); - done(); - }) - - it('textNumKeyBord6_customPwd_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('textNumKeyBordCustomPwd6')); - expect(true).assertTrue(); - done(); - }) - - it('textNumKeyBord7_customPwd_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('textNumKeyBordCustomPwd7')); - expect(true).assertTrue(); - done(); - }) - - it('textNumKeyBord8_customPwd_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('textNumKeyBordCustomPwd8')); - expect(true).assertTrue(); - done(); - }) - - it('textNumKeyBord10_customPwd_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('textNumKeyBordCustomPwd10')); - expect(true).assertTrue(); - done(); - }) - - it('textNumKeyBord9_customPwd_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('textNumKeyBordCustomPwd9')); - expect(true).assertTrue(); - done(); - }) - - it('textNumKeyBord11_customPwd_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('textNumKeyBordCustomPwd11')); - expect(true).assertTrue(); - done(); - }) - - it('textPrompt_customPwd_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('cancelIconCustomPwd')); - expect(true).assertTrue(); - done(); - }) - - it('clickEventCancal_Input', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('pinSix')); - expect(true).assertTrue(); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/uitest/CustomPin.test.ets b/entry/src/ohosTest/ets/test/uitest/CustomPin.test.ets deleted file mode 100644 index 7f681dd0cd146bb218d75dec876efd3dccb77f42..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/uitest/CustomPin.test.ets +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Driver, ON } from '@ohos.UiTest'; -import { beforeAll, describe, expect, it } from '@ohos/hypium'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -const delayTime: number = 1000; - -export default function CustomPinTest() { - describe('CustomPinTest', function () { - beforeAll(async function () { - const data = { - "cmd": [{ - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, "remainAttempts": 5, "type": "pin", "sensorInfo": "" - }, "version": "1" - }], - "pinSubType": "PIN_SIX", - "title": "请输入密码", - "type": ["pin"], - "widgetContextId": 6711153399710207000, - "windowModeType": "FULLSCREEN" - }; - globalThis.wantParams = data; - - let want = { - bundleName: bundleName, - abilityName: 'CustomPwdAbility' - } - await delegator.startAbility(want); - }) - - it('title_full_screen_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('titleFullScreen')); - expect(true).assertTrue(); - done(); - }) - - it('cancelImgCustomPwd_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('cancelImgCustomPwd')); - expect(true).assertTrue(); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/uitest/Face.test.ets b/entry/src/ohosTest/ets/test/uitest/Face.test.ets deleted file mode 100644 index 96e12f4876ec74834ab40fde44978a3beca5fd8d..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/uitest/Face.test.ets +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Driver, ON } from '@ohos.UiTest'; -import { beforeAll, describe, expect, it } from '@ohos/hypium'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; -import userAuth from '@ohos.userIAM.userAuth'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -const delayTime: number = 1000; - -export default function FaceTest() { - describe('FaceTest', function () { - beforeAll(async function () { - let userAuthInstance = null; - const authParam = { - challenge: new Uint8Array([49, 49, 49, 49, 49, 49]), - authType: [2], - authTrustLevel: 10000, - }; - const widgetParam = { - title: '使用人脸验证', - windowMode: 1, - navigationButtonText: '确认', - }; - userAuthInstance = await userAuth.getUserAuthInstance(authParam, widgetParam); - userAuthInstance.start(); - - const data = { - "cmd": [{ - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, "remainAttempts": 5, "type": "face" - }, "version": "1" - }], - "title": "请输入密码", - "type": ["face"], - "widgetContextId": 13808827370146417000, - "windowModeType": "DIALOG_BOX" - } - globalThis.wantParams = data; - - let want = { - bundleName: bundleName, - abilityName: 'FaceAbility' - } - await delegator.startAbility(want); - }) - - it('title_faceAuth_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('titleFaceAuth')); - expect(true).assertTrue(); - done(); - }) - - it('image_faceAuth_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('imageFaceAuth')); - expect(true).assertTrue(); - done(); - }) - - it('text_faceAuth_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('textFaceAuth')); - expect(true).assertTrue(); - done(); - }) - - it('cancelBtn_allFace_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('cancelBtnAllFace')); - expect(true).assertTrue(); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/uitest/FaceFailTimes.test.ets b/entry/src/ohosTest/ets/test/uitest/FaceFailTimes.test.ets deleted file mode 100644 index f9c05f5020537838b21d04246f07e7ebfe7b0608..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/uitest/FaceFailTimes.test.ets +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Driver, ON } from '@ohos.UiTest'; -import { beforeAll, describe, expect, it } from '@ohos/hypium'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -const delayTime: number = 1000; - -export default function FaceFailTimesTest() { - describe('FaceFailTimesTest', function () { - beforeAll(async function () { - const data = { - "cmd": [{ - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, "remainAttempts": 1, "type": "face" - }, "version": "1" - }], - "pinSubType": "", - "title": "", - "type": ["face"], - "widgetContextId": 13808827370146417000, - "windowModeType": "DIALOG_BOX", - "navigationButtonText": "确定!" - } - globalThis.wantParams = data; - - let want = { - bundleName: bundleName, - abilityName: 'FaceFailTimesAbility' - } - await delegator.startAbility(want); - }) - - it('navigationBtnFace_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('navigationBtnFace')); - expect(true).assertTrue(); - done(); - }) - - it('imageFaceAuth_fail_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('textFaceAuth')); - expect(true).assertTrue(); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/uitest/FaceFingerFail.test.ets b/entry/src/ohosTest/ets/test/uitest/FaceFingerFail.test.ets deleted file mode 100644 index 61f81c1b00aa8b85def3cf49c377de06743a8082..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/uitest/FaceFingerFail.test.ets +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Driver, ON } from '@ohos.UiTest'; -import { beforeAll, describe, expect, it } from '@ohos/hypium'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -const delayTime: number = 1000; - -export default function FaceFingerFailTest() { - describe('FaceFingerFailTest', function () { - beforeAll(async function () { - const data = { - "cmd": [{ - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 555, "remainAttempts": 0, "type": "face" - }, "version": "1" - }, { - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 10000, - "remainAttempts": 0, - "sensorInfo": "{\"sensorType\":\"NON_SENSOR\",\"udSensorCenterXInThousandth\":500,\"udSensorCenterYInThousandth\":500,\"udSensorRadiusInPx\":30}", - "type": "fingerprint" - }, "version": "1" - }], - "pinSubType": "", - "title": "", - "type": ["face", "fingerprint"], - "widgetContextId": 7728484037972500000, - "windowModeType": "DIALOG_BOX" - } - globalThis.wantParams = data; - - let want = { - bundleName: bundleName, - abilityName: 'FaceMixSuccess3Ability' - } - await delegator.startAbility(want); - }) - - it('cancelImg_allFaceAuth_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('cancelImgAllFaceAuth')); - expect(true).assertTrue(); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/uitest/FaceFingerFailTimes.test.ets b/entry/src/ohosTest/ets/test/uitest/FaceFingerFailTimes.test.ets deleted file mode 100644 index d16006e5555c5cc9d33ce9874b8b66a0d956b58e..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/uitest/FaceFingerFailTimes.test.ets +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Driver, ON } from '@ohos.UiTest'; -import { beforeAll, describe, expect, it } from '@ohos/hypium'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -const delayTime: number = 1000; - -export default function FaceFingerFailTimesTest() { - describe('FaceFingerFailTimesTest', function () { - beforeAll(async function () { - const data = { - "cmd": [{ - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, "remainAttempts": 3, "type": "face" - }, "version": "1" - }, { - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, - "remainAttempts": 4, - "sensorInfo": "{\"sensorType\":\"SensorType1\",\"udSensorCenterXInThousandth\":500,\"udSensorCenterYInThousandth\":1280,\"udSensorRadiusInPx\":30}", - "type": "fingerprint" - }, "version": "1" - }], - "pinSubType": "", - "title": "", - "type": ["face", "fingerprint"], - "widgetContextId": 7728484037972500000, - "windowModeType": "DIALOG_BOX" - } - globalThis.wantParams = data; - - let want = { - bundleName: bundleName, - abilityName: 'FaceFingerFailNonAbility' - } - await delegator.startAbility(want); - }) - - it('faceFingerFailTimes_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('cancelImgAllFaceAuth')); - expect(true).assertTrue(); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/uitest/FaceMixAuth.test.ets b/entry/src/ohosTest/ets/test/uitest/FaceMixAuth.test.ets deleted file mode 100644 index d0d6f2165f0a3b61b76761fc587f6dd09e8ac6ae..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/uitest/FaceMixAuth.test.ets +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Driver, ON } from '@ohos.UiTest'; -import { beforeAll, describe, expect, it } from '@ohos/hypium'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -const delayTime: number = 1000; - -export default function FaceMixTimesAuthTest() { - describe('FaceMixTimesAuthTest', function () { - beforeAll(async function () { - const data = { - "cmd": [{ - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, "remainAttempts": 2, "type": "face" - }, "version": "1" - }, { - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, - "remainAttempts": 2, - "sensorInfo": "{\"sensorType\":\"NON_SENSOR22\",\"udSensorCenterXInThousandth\":500,\"udSensorCenterYInThousandth\":100,\"udSensorRadiusInPx\":30}", - "type": "fingerprint" - }, "version": "1" - }], - "pinSubType": "PIN_SIX", - "title": "", - "type": ["face", "fingerprint"], - "widgetContextId": 7728484037972500000, - "windowModeType": "DIALOG_BOX" - } - globalThis.wantParams = data; - - let want = { - bundleName: bundleName, - abilityName: 'FaceMixAbility' - } - await delegator.startAbility(want); - }) - - it('cancelImg_allFaceAuth_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('cancelImgAllFaceAuth')); - expect(true).assertTrue(); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/uitest/FaceMixFailAll.test.ets b/entry/src/ohosTest/ets/test/uitest/FaceMixFailAll.test.ets deleted file mode 100644 index a4e7e00b6c34b356cbe2dd4fc94b1c3a04ab8cb0..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/uitest/FaceMixFailAll.test.ets +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Driver, ON } from '@ohos.UiTest'; -import { beforeAll, describe, expect, it } from '@ohos/hypium'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -const delayTime: number = 1000; - -export default function FaceMixFailAllTest() { - describe('FaceMixFailAllTest', function () { - beforeAll(async function () { - const data = { - "cmd": [{ - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, "remainAttempts": 2, "type": "pin" - }, "version": "1" - }, { - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 10000, "remainAttempts": 0, "type": "face" - }, "version": "1" - }, { - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 10000, - "remainAttempts": 0, - "sensorInfo": "{\"sensorType\":\"SensorType1\",\"udSensorCenterXInThousandth\":500,\"udSensorCenterYInThousandth\":500,\"udSensorRadiusInPx\":30}", - "type": "fingerprint" - }, "version": "1" - }], - "pinSubType": "PIN_SIX", - "title": "", - "type": ["pin", "face", "fingerprint"], - "widgetContextId": 7728484037972500000, - "windowModeType": "DIALOG_BOX" - } - globalThis.wantParams = data; - - let want = { - bundleName: bundleName, - abilityName: 'FaceMixSuccessAllAbility' - } - await delegator.startAbility(want); - }) - - it('cancelImg_allFaceAuth_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('cancelImgAllFaceAuth')); - expect(true).assertTrue(); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/uitest/FaceMixFailAuth.test.ets b/entry/src/ohosTest/ets/test/uitest/FaceMixFailAuth.test.ets deleted file mode 100644 index 8d1c0a63fbdf7edcb50dd0fb04876d58c6b06af7..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/uitest/FaceMixFailAuth.test.ets +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Driver, ON } from '@ohos.UiTest'; -import { beforeAll, describe, expect, it } from '@ohos/hypium'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -const delayTime: number = 1000; - -export default function FaceMixFailAuthTest() { - describe('FaceMixFailAuthTest', function () { - beforeAll(async function () { - const data = { - "cmd": [{ - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 1234, "remainAttempts": 0, "type": "face" - }, "version": "1" - }, { - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 5555, - "remainAttempts": 0, - "sensorInfo": "{\"sensorType\":\"OUT_OF_SCREEN_SENSOR\",\"udSensorCenterXInThousandth\":500,\"udSensorCenterYInThousandth\":500,\"udSensorRadiusInPx\":30}", - "type": "fingerprint" - }, "version": "1" - }], - "pinSubType": "PIN_SIX", - "title": "", - "type": ["face", "fingerprint"], - "widgetContextId": 7728484037972500000, - "windowModeType": "DIALOG_BOX" - } - globalThis.wantParams = data; - - let want = { - bundleName: bundleName, - abilityName: 'FaceMixSuccess3Ability' - } - await delegator.startAbility(want); - }) - - it('cancelImg_allFaceAuth_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('cancelImgAllFaceAuth')); - expect(true).assertTrue(); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/uitest/FaceMixSuccessAll.test.ets b/entry/src/ohosTest/ets/test/uitest/FaceMixSuccessAll.test.ets deleted file mode 100644 index a929e7794fe3732f7b2d79966960a8a7e6f1faed..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/uitest/FaceMixSuccessAll.test.ets +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Driver, ON } from '@ohos.UiTest'; -import { beforeAll, describe, expect, it } from '@ohos/hypium'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -const delayTime: number = 1000; - -export default function FaceMixSuccessAllTest() { - describe('FaceMixSuccessAllTest', function () { - beforeAll(async function () { - const data = { - "cmd": [{ - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, "remainAttempts": 5, "type": "pin" - }, "version": "1" - }, { - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, "remainAttempts": 5, "type": "face" - }, "version": "1" - }, { - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, - "remainAttempts": 5, - "sensorInfo": "{\"sensorType\":\"SensorType1\",\"udSensorCenterXInThousandth\":500,\"udSensorCenterYInThousandth\":500,\"udSensorRadiusInPx\":30}", - "type": "fingerprint" - }, "version": "1" - }], - "pinSubType": "PIN_SIX", - "title": "", - "type": ["pin", "face", "fingerprint"], - "widgetContextId": 7728484037972500000, - "windowModeType": "DIALOG_BOX" - } - globalThis.wantParams = data; - - let want = { - bundleName: bundleName, - abilityName: 'FaceMixSuccessAllAbility' - } - await delegator.startAbility(want); - }) - - it('errFaceImgFaceAuth_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('cancelBtnFaceAuth')); - expect(true).assertTrue(); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/uitest/FaceMixSuccessLandscape.test.ets b/entry/src/ohosTest/ets/test/uitest/FaceMixSuccessLandscape.test.ets deleted file mode 100644 index 31c69eddb8d2ba5bbaea07780a124f123fe958a4..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/uitest/FaceMixSuccessLandscape.test.ets +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Driver, ON } from '@ohos.UiTest'; -import { beforeAll, describe, expect, it } from '@ohos/hypium'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -const delayTime: number = 1000; - -export default function FaceMixSuccessLandscapeTest() { - describe('FaceMixSuccessLandscapeTest', function () { - beforeAll(async function () { - const data = { - "cmd": [{ - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, "remainAttempts": 5, "type": "pin" - }, "version": "1" - }, { - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, "remainAttempts": 5, "type": "face" - }, "version": "1" - }, { - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, - "remainAttempts": 5, - "sensorInfo": "{\"sensorType\":\"SensorType1\",\"udSensorCenterXInThousandth\":500,\"udSensorCenterYInThousandth\":500,\"udSensorRadiusInPx\":30}", - "type": "fingerprint" - }, "version": "1" - }, { - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, "remainAttempts": 5, "type": "test" - }, "version": "1" - }], - "pinSubType": "PIN_SIX", - "title": "", - "type": ["pin", "face", "fingerprint"], - "widgetContextId": 7728484037972500000, - "windowModeType": "DIALOG_BOX" - } - globalThis.wantParams = data; - - let want = { - bundleName: bundleName, - abilityName: 'FaceMixSuccessLandscapeAbility' - } - await delegator.startAbility(want); - AppStorage.SetOrCreate('IS_LANDSCAPE', true); - }) - - it('faceMixSuccessLandscape_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('cancelBtnFaceAuth')); - expect(true).assertTrue(); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/uitest/FacePinFailTimes.test.ets b/entry/src/ohosTest/ets/test/uitest/FacePinFailTimes.test.ets deleted file mode 100644 index 6e395cdbbb08e6801183429108f763a7b702094f..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/uitest/FacePinFailTimes.test.ets +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Driver, ON } from '@ohos.UiTest'; -import { beforeAll, describe, expect, it } from '@ohos/hypium'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -const delayTime: number = 1000; - -export default function FacePinFailTimesTest() { - describe('FacePinFailTimesTest', function () { - beforeAll(async function () { - const data = { - "cmd": [{ - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, "remainAttempts": 2, "type": "pin" - }, "version": "1" - }, { - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, - "remainAttempts": 2, - "type": "face" - }, "version": "1" - }], - "pinSubType": "PIN_SIX", - "title": "", - "type": ["pin", "face"], - "widgetContextId": 7728484037972500000, - "windowModeType": "DIALOG_BOX" - } - globalThis.wantParams = data; - - let want = { - bundleName: bundleName, - abilityName: 'FacePinFailTimesAbility' - } - await delegator.startAbility(want); - }) - - it('cancelImg_allFaceAuth_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('cancelImgAllFaceAuth')); - expect(true).assertTrue(); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/uitest/FindWindowExample.test.ets b/entry/src/ohosTest/ets/test/uitest/FindWindowExample.test.ets deleted file mode 100644 index 815f5736372d99320f1ddc314302bc11058851df..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/uitest/FindWindowExample.test.ets +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { describe, expect, it, TestType } from '@ohos/hypium'; -import { Driver } from '@ohos.UiTest'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -const delays = 1000; - -export default function FindWindowExampleTest() { - describe('FindWindowExampleTest', function () { - it('findWindowExampleTest_bundleName', TestType.FUNCTION, async function (done) { - let want = { - bundleName: bundleName, - abilityName: "TestAbility" - } - await delegator.startAbility(want); - let driver = Driver.create(); - await driver.delayMs(delays); - await driver.findWindow({ - bundleName: bundleName - }); - expect(true).assertTrue(); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/uitest/Finger.test.ets b/entry/src/ohosTest/ets/test/uitest/Finger.test.ets deleted file mode 100644 index 6cbab36d6c5df0bee990577e99233509b40281ea..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/uitest/Finger.test.ets +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Driver, ON } from '@ohos.UiTest'; -import { beforeAll, describe, expect, it } from '@ohos/hypium'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -const delayTime: number = 1000; - -export default function FingerTest() { - describe('FingerTest', function () { - beforeAll(async function () { - const data = { - "cmd": [{ - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, - "remainAttempts": 5, - "sensorInfo": "{\"sensorType\":\"SensorType1\",\"udSensorCenterXInThousandth\":500,\"udSensorCenterYInThousandth\":500,\"udSensorRadiusInPx\":30}", - "type": "fingerprint" - }, "version": "1" - }], - "pinSubType": "", - "title": "", - "type": ["fingerprint"], - "widgetContextId": 10234972519197798000, - "windowModeType": "DIALOG_BOX" - } - globalThis.wantParams = data; - - let want = { - bundleName: bundleName, - abilityName: 'FingerprintAbility' - } - await delegator.startAbility(want); - }) - - it('cancelBth_state3_fingerprintAuth_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('cancelBthState3FingerprintAuth')); - expect(true).assertTrue(); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/uitest/FingerFailTimesAuth.test.ets b/entry/src/ohosTest/ets/test/uitest/FingerFailTimesAuth.test.ets deleted file mode 100644 index b359246f0f9cd9e35369c4feee42032ea4307fab..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/uitest/FingerFailTimesAuth.test.ets +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Driver, ON } from '@ohos.UiTest'; -import { beforeAll, describe, expect, it } from '@ohos/hypium'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -const delayTime: number = 1000; - -export default function FingerFailAuthTest() { - describe('FingerFailAuthTest', function () { - beforeAll(async function () { - const data = { - "cmd": [{ - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, "remainAttempts": 2, "type": "pin" - }, "version": "1" - }, { - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, - "remainAttempts": 2, - "sensorInfo": "{\"sensorType\":\"UNDER_SCREEN_SENSOR\",\"udSensorCenterXInThousandth\":500,\"udSensorCenterYInThousandth\":500,\"udSensorRadiusInPx\":30}", - "type": "fingerprint" - }, "version": "1" - }], - "pinSubType": "PIN_SIX", - "title": "请输入密码", - "type": ["pin", "fingerprint"], - "widgetContextId": 10234972519197798000, - "windowModeType": "DIALOG_BOX" - } - globalThis.wantParams = data; - - let want = { - bundleName: bundleName, - abilityName: 'FingerFailTimesAbility' - } - await delegator.startAbility(want); - }) - - it('cancelBth_state3_fingerprintAuth_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('cancelBthState3FingerprintAuth')); - expect(true).assertTrue(); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/uitest/FingerLock.test.ets b/entry/src/ohosTest/ets/test/uitest/FingerLock.test.ets deleted file mode 100644 index 317d9868f871252b92b67e9ada9c17ba233e8f84..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/uitest/FingerLock.test.ets +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Driver, ON } from '@ohos.UiTest'; -import { beforeAll, describe, expect, it } from '@ohos/hypium'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -const delayTime: number = 1000; - -export default function FingerLock() { - describe('FingerLock', function () { - beforeAll(async function () { - const data = { - "cmd": [{ - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, "remainAttempts": 0, "type": "PIN_NUM" - }, "version": "1" - }, { - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, "remainAttempts": 0, "type": "123" - }, "version": "1" - }, { - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, - "remainAttempts": 0, - "sensorInfo": "{\"sensorType\":\"OUT_OF_SCREEN_SENSOR\",\"udSensorCenterXInThousandth\":500,\"udSensorCenterYInThousandth\":500,\"udSensorRadiusInPx\":30}", - "type": "fingerprint" - }, "version": "1" - }], - "pinSubType": "PIN_SIX", - "title": "", - "type": ["pin", "fingerprint"], - "widgetContextId": 10234972519197798000, - "windowModeType": "DIALOG_BOX" - } - globalThis.wantParams = data; - - let want = { - bundleName: bundleName, - abilityName: 'FingerprintLockAbility' - } - await delegator.startAbility(want); - }) - - it('cancelBth_state3_fingerprintLock_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('cancelBthState3FingerprintLock')); - expect(true).assertTrue(); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/uitest/FingerOn.test.ets b/entry/src/ohosTest/ets/test/uitest/FingerOn.test.ets deleted file mode 100644 index 5236faf284dd531c9a484236154ac831908e9195..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/uitest/FingerOn.test.ets +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Driver, ON } from '@ohos.UiTest'; -import { beforeAll, describe, expect, it } from '@ohos/hypium'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -const delayTime: number = 1000; - -export default function FingerOnTest() { - describe('FingerOnTest', function () { - - function sleep(ms) { - return new Promise(resolve => setTimeout(resolve, ms)); - } - - beforeAll(async function () { - const data = { - "cmd": [{ - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, - "remainAttempts": 5, - "sensorInfo": "{\"sensorType\":\"UNDER_SCREEN_SENSOR\",\"udSensorCenterXInThousandth\":500,\"udSensorCenterYInThousandth\":500,\"udSensorRadiusInPx\":50}", - "type": "fingerprint" - }, "version": "1" - }], - "title": "请输入密码", - "type": ["fingerprint"], - "navigationButtonText": "按钮", - "widgetContextId": 10234972519197798020, - "windowModeType": "DIALOG_BOX" - } - globalThis.wantParams = data; - sleep(delayTime); - - let want = { - bundleName: bundleName, - abilityName: 'FingerOnAbility' - } - await delegator.startAbility(want); - sleep(delayTime); - }) - - it('cancel_fingerUnder_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('navigationButtonTextFingerprintAuth')); - expect(true).assertTrue(); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/uitest/FingerOnNull.test.ets b/entry/src/ohosTest/ets/test/uitest/FingerOnNull.test.ets deleted file mode 100644 index 5d973606fc997e7d0bed5b1d1a924c81dabac28b..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/uitest/FingerOnNull.test.ets +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Driver, ON } from '@ohos.UiTest'; -import { beforeAll, describe, expect, it } from '@ohos/hypium'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -const delayTime: number = 1000; - -export default function FingerOnTest() { - describe('FingerOnTest', function () { - - function sleep(ms) { - return new Promise(resolve => setTimeout(resolve, ms)); - } - - beforeAll(async function () { - const data = { - "cmd": [{ - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, - "remainAttempts": 5, - "sensorInfo": "{\"sensorType\":\"UNDER_SCREEN_SENSOR\",\"udSensorCenterXInThousandth\":500,\"udSensorCenterYInThousandth\":500,\"udSensorRadiusInPx\":50}", - "type": "fingerprint" - }, "version": "1" - }], - "title": "请输入密码", - "type": ["fingerprint"], - "widgetContextId": 10234972519197798120, - "windowModeType": "DIALOG_BOX" - } - globalThis.wantParams = data; - sleep(delayTime); - - let want = { - bundleName: bundleName, - abilityName: 'FingerOnNullAbility' - } - await delegator.startAbility(want); - sleep(delayTime); - }) - - it('cancel_fingerUnder_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('cancelDefBtnState1FingerprintAuth')); - expect(true).assertTrue(); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/uitest/FingerOutBack.test.ets b/entry/src/ohosTest/ets/test/uitest/FingerOutBack.test.ets deleted file mode 100644 index 37ad97cb1d128367a01783d4387dec14a6859653..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/uitest/FingerOutBack.test.ets +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Driver, ON } from '@ohos.UiTest'; -import { beforeAll, describe, expect, it } from '@ohos/hypium'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -const delayTime: number = 1000; - -export default function FingerOutBackTest() { - describe('FingerOutBackTest', function () { - - function sleep(ms) { - return new Promise(resolve => setTimeout(resolve, ms)); - } - - beforeAll(async function () { - const data = { - "cmd": [{ - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, - "remainAttempts": 5, - "sensorInfo": "{\"sensorType\":\"OUT_OF_SCREEN_SENSOR\",\"outOfScreenSensorType\":\"BACK\"}", - "type": "fingerprint" - }, "version": "1" - }], - "title": "请输入密码", - "type": ["fingerprint"], - "navigationButtonText": "按钮", - "widgetContextId": 10234972519197798021, - "windowModeType": "DIALOG_BOX" - } - globalThis.wantParams = data; - sleep(delayTime); - - let want = { - bundleName: bundleName, - abilityName: 'FingerOutBackAbility' - } - await delegator.startAbility(want); - sleep(delayTime); - }) - - it('cancel_fingerOutBack_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('outFingerImage')); - expect(true).assertTrue(); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/uitest/FingerOutFront.test.ets b/entry/src/ohosTest/ets/test/uitest/FingerOutFront.test.ets deleted file mode 100644 index f6d241011e2f3832ea87ea0a7c9c38d5efdf99cf..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/uitest/FingerOutFront.test.ets +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Driver, ON } from '@ohos.UiTest'; -import { beforeAll, describe, expect, it } from '@ohos/hypium'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -const delayTime: number = 1000; - -export default function FingerOutFrontTest() { - describe('FingerOutFrontTest', function () { - - function sleep(ms) { - return new Promise(resolve => setTimeout(resolve, ms)); - } - - beforeAll(async function () { - const data = { - "cmd": [{ - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, - "remainAttempts": 5, - "sensorInfo": "{\"sensorType\":\"OUT_OF_SCREEN_SENSOR\",\"outOfScreenSensorType\":\"FRONT\"}", - "type": "fingerprint" - }, "version": "1" - }], - "title": "请输入密码", - "type": ["fingerprint"], - "navigationButtonText": "按钮", - "widgetContextId": 10234972529197798021, - "windowModeType": "DIALOG_BOX" - } - globalThis.wantParams = data; - sleep(delayTime); - - let want = { - bundleName: bundleName, - abilityName: 'FingerOutFrontAbility' - } - await delegator.startAbility(want); - sleep(delayTime); - }) - - it('cancel_fingerOutFront_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('outFingerImage')); - expect(true).assertTrue(); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/uitest/FingerOutSide.test.ets b/entry/src/ohosTest/ets/test/uitest/FingerOutSide.test.ets deleted file mode 100644 index 1ea3097026a29762637fe7b8e1a319b85b37a8ac..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/uitest/FingerOutSide.test.ets +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Driver, ON } from '@ohos.UiTest'; -import { beforeAll, describe, expect, it } from '@ohos/hypium'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -const delayTime: number = 1000; - -export default function FingerOutSideTest() { - describe('FingerOutSideTest', function () { - - function sleep(ms) { - return new Promise(resolve => setTimeout(resolve, ms)); - } - - beforeAll(async function () { - const data = { - "cmd": [{ - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, - "remainAttempts": 5, - "sensorInfo": "{\"sensorType\":\"OUT_OF_SCREEN_SENSOR\",\"outOfScreenSensorType\":\"SIDE\"}", - "type": "fingerprint" - }, "version": "1" - }], - "title": "请输入密码", - "type": ["fingerprint"], - "navigationButtonText": "按钮", - "widgetContextId": 10234972519197718021, - "windowModeType": "DIALOG_BOX" - } - globalThis.wantParams = data; - sleep(delayTime); - - let want = { - bundleName: bundleName, - abilityName: 'FingerOutSideAbility' - } - await delegator.startAbility(want); - sleep(delayTime); - }) - - it('cancel_fingerSide_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('outFingerImage')); - expect(true).assertTrue(); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/uitest/FingerUnder.test.ets b/entry/src/ohosTest/ets/test/uitest/FingerUnder.test.ets deleted file mode 100644 index ea437e680cd74cd004ede5e71b5367dc845c9963..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/uitest/FingerUnder.test.ets +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Driver, ON } from '@ohos.UiTest'; -import { beforeAll, describe, expect, it } from '@ohos/hypium'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -const delayTime: number = 1000; - -export default function FingerUnderTest() { - describe('FingerUnderTest', function () { - - function sleep(ms) { - return new Promise(resolve => setTimeout(resolve, ms)); - } - - beforeAll(async function () { - const data = { - "cmd": [{ - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, - "remainAttempts": 5, - "sensorInfo": "{\"sensorType\":\"UNDER_SCREEN_SENSOR\",\"udSensorCenterXInThousandth\":500,\"udSensorCenterYInThousandth\":980,\"udSensorRadiusInPx\":50}", - "type": "fingerprint" - }, "version": "1" - }], - "title": "请输入密码", - "type": ["fingerprint"], - "navigationButtonText": "按钮", - "widgetContextId": 10234972519197798021, - "windowModeType": "DIALOG_BOX" - } - globalThis.wantParams = data; - sleep(delayTime); - - let want = { - bundleName: bundleName, - abilityName: 'FingerUnderAbility' - } - await delegator.startAbility(want); - sleep(delayTime); - }) - - it('cancel_fingerUnder_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('fingerUnderButton')); - expect(true).assertTrue(); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/uitest/FingerUnderNull.test.ets b/entry/src/ohosTest/ets/test/uitest/FingerUnderNull.test.ets deleted file mode 100644 index 502cd19bc3ad83f4b6b7493090fa49b50b0efa47..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/uitest/FingerUnderNull.test.ets +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Driver, ON } from '@ohos.UiTest'; -import { beforeAll, describe, expect, it } from '@ohos/hypium'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -const delayTime: number = 1000; - -export default function FingerUnderNullTest() { - describe('FingerUnderNullTest', function () { - - function sleep(ms) { - return new Promise(resolve => setTimeout(resolve, ms)); - } - - beforeAll(async function () { - const data = { - "cmd": [{ - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, - "remainAttempts": 5, - "sensorInfo": "{\"sensorType\":\"UNDER_SCREEN_SENSOR\",\"udSensorCenterXInThousandth\":500,\"udSensorCenterYInThousandth\":980,\"udSensorRadiusInPx\":50}", - "type": "fingerprint" - }, "version": "1" - }], - "title": "请输入密码", - "type": ["fingerprint"], - "widgetContextId": 10234972519197798120, - "windowModeType": "DIALOG_BOX" - } - globalThis.wantParams = data; - sleep(delayTime); - - let want = { - bundleName: bundleName, - abilityName: 'FingerUnderNullAbility' - } - await delegator.startAbility(want); - sleep(delayTime); - }) - - it('cancel_fingerUnder_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('fingerUnderImage')); - expect(true).assertTrue(); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/uitest/Pin.test.ets b/entry/src/ohosTest/ets/test/uitest/Pin.test.ets deleted file mode 100644 index add4fbbc7a954b7d81e5ee0608f2e8d1a2a8d92a..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/uitest/Pin.test.ets +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Driver, ON } from '@ohos.UiTest'; -import { beforeAll, describe, expect, it } from '@ohos/hypium'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -const delayTime: number = 1000; - -export default function PinTest() { - describe('PinTest', function () { - beforeAll(async function () { - const data = { - "cmd": [{ - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 1123, "remainAttempts": 0, "type": "pin" - }, "version": "1" - }], - "pinSubType": "PIN_SIX", - "title": "", - "type": ["pin"], - "widgetContextId": 17202660292065450000, - "windowModeType": "DIALOG_BOX" - } - globalThis.wantParams = data; - - let want = { - bundleName: bundleName, - abilityName: "PasswordSixAbility" - } - await delegator.startAbility(want); - }) - - it('pinSix_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('pinSix')); - expect(true).assertTrue(); - done(); - }) - - it('cancelBtn_dialog_sixPwd_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('cancelBtnDialogSixPwd')); - expect(true).assertTrue(); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/uitest/PinFace.test.ets b/entry/src/ohosTest/ets/test/uitest/PinFace.test.ets deleted file mode 100644 index d97c52463530c5e0c55bd1b44b3915e1d764ecba..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/uitest/PinFace.test.ets +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Driver, ON } from '@ohos.UiTest'; -import { beforeAll, describe, expect, it } from '@ohos/hypium'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -const delayTime: number = 1000; - -export default function PinFaceTest() { - describe('PinFaceTest', function () { - beforeAll(async function () { - const data = { - "cmd": [{ - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, "remainAttempts": 5, "type": "pin" - }, "version": "1" - }, { - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, "remainAttempts": 5, "type": "face" - }, "version": "1" - }], - "pinSubType": "PIN_NUMBER", - "title": "口令人脸", - "type": ["pin", "face"], - "widgetContextId": 13808827370146417000, - "windowModeType": "DIALOG_BOX" - } - globalThis.wantParams = data; - - let want = { - bundleName: bundleName, - abilityName: 'FaceSingleAbility' - } - await delegator.startAbility(want); - }) - - it('title_pinFace_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('titlePinFace')); - expect(true).assertTrue(); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/uitest/PinFaceFail.test.ets b/entry/src/ohosTest/ets/test/uitest/PinFaceFail.test.ets deleted file mode 100644 index 5dd740431edceb68add38f4bb3cb5f6cd5bbfbea..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/uitest/PinFaceFail.test.ets +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Driver, ON } from '@ohos.UiTest'; -import { beforeAll, describe, expect, it } from '@ohos/hypium'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -const delayTime: number = 1000; - -export default function PinFaceFailTest() { - describe('PinFaceFailTest', function () { - beforeAll(async function () { - const data = { - "cmd": [{ - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 2147483647, "remainAttempts": 0, "type": "pin" - }, "version": "1" - }, { - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 2147483647, "remainAttempts": 0, "type": "face" - }, "version": "1" - }], - "pinSubType": "PIN_SIX", - "title": "", - "type": ["pin", "face"], - "widgetContextId": 7728484037972500000, - "windowModeType": "DIALOG_BOX" - } - globalThis.wantParams = data; - - let want = { - bundleName: bundleName, - abilityName: 'FaceMixSuccessAbility' - } - await delegator.startAbility(want); - }) - - it('cancelImg_allFaceAuth_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('cancelImgAllFaceAuth')); - expect(true).assertTrue(); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/uitest/PinFaceFinger.test.ets b/entry/src/ohosTest/ets/test/uitest/PinFaceFinger.test.ets deleted file mode 100644 index d6a7ea419843c1dd8783a9e83d8f5e8294b6a9db..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/uitest/PinFaceFinger.test.ets +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Driver, ON } from '@ohos.UiTest'; -import { beforeAll, describe, expect, it } from '@ohos/hypium'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -const delayTime: number = 1000; - -export default function FaceFingerFailTest() { - describe('FaceFingerFailTest', function () { - beforeAll(async function () { - const data = { - "cmd": [{ - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 1111111, "remainAttempts": 0, "type": "face" - }, "version": "1" - }, { - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 111110, - "remainAttempts": 0, - "sensorInfo": "{\"sensorType\":\"SensorType1\",\"udSensorCenterXInThousandth\":500,\"udSensorCenterYInThousandth\":500,\"udSensorRadiusInPx\":30}", - "type": "fingerprint" - }, "version": "1" - }], - "pinSubType": "PIN_SIX", - "title": "", - "type": ["face", "fingerprint"], - "widgetContextId": 7728484037972500000, - "windowModeType": "DIALOG_BOX" - } - globalThis.wantParams = data; - - let want = { - bundleName: bundleName, - abilityName: 'FaceMixTimesAbility' - } - await delegator.startAbility(want); - }) - - it('cancelImg_allFaceAuth_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('cancelImgAllFaceAuth')); - expect(true).assertTrue(); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/uitest/PinFailTimes.test.ets b/entry/src/ohosTest/ets/test/uitest/PinFailTimes.test.ets deleted file mode 100644 index 8b6c7b70ada72eb3de5143e3fc7e64f6055a93d5..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/uitest/PinFailTimes.test.ets +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Driver, ON } from '@ohos.UiTest'; -import { beforeAll, describe, expect, it } from '@ohos/hypium'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -const delayTime: number = 1000; - -export default function PinFailTimesTest() { - describe('PinFailTimesTest', function () { - beforeAll(async function () { - const data = { - "cmd": [{ - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, "remainAttempts": 1, "type": "pin" - }, "version": "1" - }], - "pinSubType": "PIN_MIXED", - "title": "", - "type": ["pin"], - "widgetContextId": 17202660292065450000, - "windowModeType": "DIALOG_BOX" - } - globalThis.wantParams = data; - - let want = { - bundleName: bundleName, - abilityName: "PasswordFailTimesAbility" - } - await delegator.startAbility(want); - }) - - it('pinFailTimes_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('pinSix')); - expect(true).assertTrue(); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/uitest/PinFinger.test.ets b/entry/src/ohosTest/ets/test/uitest/PinFinger.test.ets deleted file mode 100644 index 9f47825e21a7715376015556019f5a27f8ab8fda..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/uitest/PinFinger.test.ets +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Driver, ON } from '@ohos.UiTest'; -import { beforeAll, describe, expect, it } from '@ohos/hypium'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -const delayTime: number = 1000; - -export default function PinFingerTest() { - describe('PinFingerTest', function () { - beforeAll(async function () { - const data = { - "cmd": [{ - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, "remainAttempts": 5, "type": "pin" - }, "version": "1" - }, { - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, - "remainAttempts": 5, - "sensorInfo": "{\"OUT_OF_SCREEN_SENSOR\":\"SensorType1\",\"udSensorCenterXInThousandth\":500,\"udSensorCenterYInThousandth\":500,\"udSensorRadiusInPx\":30}", - "type": "fingerprint" - }, "version": "1" - }], - "pinSubType": "PIN_SIX", - "title": "请输入密码", - "type": ["pin", "fingerprint"], - "widgetContextId": 10234972519197798000, - "windowModeType": "DIALOG_BOX" - } - globalThis.wantParams = data; - - let want = { - bundleName: bundleName, - abilityName: 'FingerprintAbility' - } - await delegator.startAbility(want); - }) - - it('cancelBth_state3_fingerprintAuth_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('cancelBthState3FingerprintAuth')); - expect(true).assertTrue(); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/uitest/PinFingerFail.test.ets b/entry/src/ohosTest/ets/test/uitest/PinFingerFail.test.ets deleted file mode 100644 index d257c79a41a54f54fa892ef067bacb648623511b..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/uitest/PinFingerFail.test.ets +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Driver, ON } from '@ohos.UiTest'; -import { beforeAll, describe, expect, it } from '@ohos/hypium'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -const delayTime: number = 1000; - -export default function PinFingerFailTest() { - describe('PinFingerFailTest', function () { - beforeAll(async function () { - const data = { - "cmd": [{ - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 34343, "remainAttempts": 0, "type": "pin" - }, "version": "1" - }, { - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 2343, - "remainAttempts": 0, - "sensorInfo": "{\"sensorType\":\"SensorType1\",\"udSensorCenterXInThousandth\":500,\"udSensorCenterYInThousandth\":500,\"udSensorRadiusInPx\":30}", - "type": "fingerprint" - }, "version": "1" - }], - "pinSubType": "PIN_SIX", - "title": "", - "type": ["pin", "fingerprint"], - "widgetContextId": 10234972519197798000, - "windowModeType": "DIALOG_BOX" - } - globalThis.wantParams = data; - - let want = { - bundleName: bundleName, - abilityName: 'FingerFailAbility' - } - await delegator.startAbility(want); - }) - - it('cancelBth_state3_fingerprintAuth_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('cancelBthState3FingerprintAuth')); - expect(true).assertTrue(); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/uitest/PinFingerOn.test.ets b/entry/src/ohosTest/ets/test/uitest/PinFingerOn.test.ets deleted file mode 100644 index ccef05a50892aebe8d00458bfd555a9ecc2db073..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/uitest/PinFingerOn.test.ets +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Driver, ON } from '@ohos.UiTest'; -import { beforeAll, describe, expect, it } from '@ohos/hypium'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -const delayTime: number = 1000; - -export default function PinFingerOnTest() { - describe('PinFingerOnTest', function () { - - function sleep(ms) { - return new Promise(resolve => setTimeout(resolve, ms)); - } - - beforeAll(async function () { - const data = { - "cmd": [{ - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, - "remainAttempts": 5, - "type": "pin" - }, "version": "1" - }, { - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, - "remainAttempts": 5, - "sensorInfo": "{\"sensorType\":\"UNDER_SCREEN_SENSOR\",\"udSensorCenterXInThousandth\":500,\"udSensorCenterYInThousandth\":500,\"udSensorRadiusInPx\":50}", - "type": "fingerprint" - }, "version": "1" - }], - "pinSubType": "PIN_SIX", - "title": "请输入密码", - "type": ["pin", "fingerprint"], - "widgetContextId": 10234972519197798100, - "windowModeType": "DIALOG_BOX" - } - globalThis.wantParams = data; - sleep(delayTime); - - let want = { - bundleName: bundleName, - abilityName: 'PinFingerOnAbility' - } - await delegator.startAbility(want); - sleep(delayTime); - }) - - it('cancel_pinFingerOn_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('blueFingerprintImgState2FingerprintAuth')); - expect(true).assertTrue(); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/uitest/PinFingerOnFail.test.ets b/entry/src/ohosTest/ets/test/uitest/PinFingerOnFail.test.ets deleted file mode 100644 index 59d4ca2bf4804a3a3808378a2818f856288fa71c..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/uitest/PinFingerOnFail.test.ets +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Driver, ON } from '@ohos.UiTest'; -import { beforeAll, describe, expect, it } from '@ohos/hypium'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -const delayTime: number = 1000; - -export default function PinFingerOnFailTest() { - describe('PinFingerOnFailTest', function () { - - function sleep(ms) { - return new Promise(resolve => setTimeout(resolve, ms)); - } - - beforeAll(async function () { - const data = { - "cmd": [{ - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, - "remainAttempts": 5, - "type": "pin" - }, "version": "1" - }, { - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 15415, - "remainAttempts": 0, - "sensorInfo": "{\"sensorType\":\"UNDER_SCREEN_SENSOR\",\"udSensorCenterXInThousandth\":500,\"udSensorCenterYInThousandth\":500,\"udSensorRadiusInPx\":50}", - "type": "fingerprint" - }, "version": "1" - }], - "pinSubType": "PIN_NUMBER", - "title": "请输入密码", - "type": ["pin", "fingerprint"], - "widgetContextId": 10234972519197798110, - "windowModeType": "DIALOG_BOX" - } - globalThis.wantParams = data; - sleep(delayTime); - - let want = { - bundleName: bundleName, - abilityName: 'PinFingerOnFailAbility' - } - await delegator.startAbility(want); - sleep(delayTime); - }) - - it('cancel_pinFingerOn_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('cancelBtnState5FingerprintAuth')); - expect(true).assertTrue(); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/uitest/PinFingerOutBack.test.ets b/entry/src/ohosTest/ets/test/uitest/PinFingerOutBack.test.ets deleted file mode 100644 index 52db3156df388492d55d363ecc4f77db08e5e943..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/uitest/PinFingerOutBack.test.ets +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Driver, ON } from '@ohos.UiTest'; -import { beforeAll, describe, expect, it } from '@ohos/hypium'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -const delayTime: number = 1000; - -export default function PinFingerOutBackTest() { - describe('PinFingerOutBackTest', function () { - - function sleep(ms) { - return new Promise(resolve => setTimeout(resolve, ms)); - } - - beforeAll(async function () { - const data = { - "cmd": [{ - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, - "remainAttempts": 5, - "type": "pin" - }, "version": "1" - }, { - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 1321, - "remainAttempts": 0, - "sensorInfo": "{\"sensorType\":\"OUT_OF_SCREEN_SENSOR\",\"outOfScreenSensorType\":\"BACK\"}", - "type": "fingerprint" - }, "version": "1" - }], - "pinSubType": "PIN_SIX", - "title": "请输入密码", - "type": ["pin", "fingerprint"], - "widgetContextId": 10234972549197798121, - "windowModeType": "DIALOG_BOX" - } - globalThis.wantParams = data; - sleep(delayTime); - - let want = { - bundleName: bundleName, - abilityName: 'PinFingerOutBackAbility' - } - await delegator.startAbility(want); - sleep(delayTime); - }) - - it('cancel_pinFingerOutBack_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('cancelState6FingerprintAuth')); - expect(true).assertTrue(); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/uitest/PinFingerOutFront.test.ets b/entry/src/ohosTest/ets/test/uitest/PinFingerOutFront.test.ets deleted file mode 100644 index 5748216baf9158e14d792594d9506bf4ac6ff12e..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/uitest/PinFingerOutFront.test.ets +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Driver, ON } from '@ohos.UiTest'; -import { beforeAll, describe, expect, it } from '@ohos/hypium'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -const delayTime: number = 1000; - -export default function PinFingerOutFrontTest() { - describe('PinFingerOutFrontTest', function () { - - function sleep(ms) { - return new Promise(resolve => setTimeout(resolve, ms)); - } - - beforeAll(async function () { - const data = { - "cmd": [{ - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, - "remainAttempts": 5, - "type": "pin" - }, "version": "1" - }, - { - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 1123, - "remainAttempts": 0, - "sensorInfo": "{\"sensorType\":\"OUT_OF_SCREEN_SENSOR\",\"outOfScreenSensorType\":\"FRONT\"}", - "type": "fingerprint" - }, "version": "1" - }], - "pinSubType": "PIN_NUMBER", - "title": "请输入密码", - "type": ["pin", "fingerprint"], - "widgetContextId": 10234972526197798021, - "windowModeType": "DIALOG_BOX" - } - globalThis.wantParams = data; - sleep(delayTime); - - let want = { - bundleName: bundleName, - abilityName: 'PinFingerOutFrontAbility' - } - await delegator.startAbility(want); - sleep(delayTime); - }) - - it('cancel_pinFingerOutFront_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('cancelStateMultiFingerprintAuth')); - expect(true).assertTrue(); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/uitest/PinFingerOutSide.test.ets b/entry/src/ohosTest/ets/test/uitest/PinFingerOutSide.test.ets deleted file mode 100644 index e9d16b2b78938997a62659b4528ce0358c2c925a..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/uitest/PinFingerOutSide.test.ets +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Driver, ON } from '@ohos.UiTest'; -import { beforeAll, describe, expect, it } from '@ohos/hypium'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -const delayTime: number = 1000; - -export default function PinFingerOutSideTest() { - describe('PinFingerOutSideTest', function () { - - function sleep(ms) { - return new Promise(resolve => setTimeout(resolve, ms)); - } - - beforeAll(async function () { - const data = { - "cmd": [{ - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, - "remainAttempts": 5, - "type": "pin" - }, "version": "1" - }, { - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 4556, - "remainAttempts": 0, - "sensorInfo": "{\"sensorType\":\"OUT_OF_SCREEN_SENSOR\",\"outOfScreenSensorType\":\"SIDE\"}", - "type": "fingerprint" - }, "version": "1" - }], - "pinSubType": "PIN_MIXED", - "title": "请输入密码", - "type": ["pin", "fingerprint"], - "widgetContextId": 14234972519197718021, - "windowModeType": "DIALOG_BOX" - } - globalThis.wantParams = data; - sleep(delayTime); - - let want = { - bundleName: bundleName, - abilityName: 'PinFingerOutSideAbility' - } - await delegator.startAbility(want); - sleep(delayTime); - }) - - it('cancel_pinFingerSide_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('cancelStateMultiFingerprintAuth')); - expect(true).assertTrue(); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/uitest/PinFingerUnder.test.ets b/entry/src/ohosTest/ets/test/uitest/PinFingerUnder.test.ets deleted file mode 100644 index 592bd8ae8a554820abe051a0a06677e295b80b8b..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/uitest/PinFingerUnder.test.ets +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Driver, ON } from '@ohos.UiTest'; -import { beforeAll, describe, expect, it } from '@ohos/hypium'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -const delayTime: number = 1000; - -export default function PinFingerUnderTest() { - describe('PinFingerUnderTest', function () { - - function sleep(ms) { - return new Promise(resolve => setTimeout(resolve, ms)); - } - - beforeAll(async function () { - const data = { - "cmd": [{ - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, - "remainAttempts": 5, - "type": "pin" - }, "version": "1" - }, { - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, - "remainAttempts": 5, - "sensorInfo": "{\"sensorType\":\"UNDER_SCREEN_SENSOR\",\"udSensorCenterXInThousandth\":500,\"udSensorCenterYInThousandth\":980,\"udSensorRadiusInPx\":50}", - "type": "fingerprint" - }, "version": "1" - }], - "pinSubType": "PIN_SIX", - "title": "请输入密码", - "type": ["pin", "fingerprint"], - "widgetContextId": 10234972519197798001, - "windowModeType": "DIALOG_BOX" - } - globalThis.wantParams = data; - sleep(delayTime); - - let want = { - bundleName: bundleName, - abilityName: 'PinFingerUnderAbility' - } - await delegator.startAbility(want); - sleep(delayTime); - }) - - it('cancel_pinFingerOn_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('blueFingerprintImgState2FingerprintAuth')); - expect(true).assertTrue(); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/uitest/PinFingerUnderFail.test.ets b/entry/src/ohosTest/ets/test/uitest/PinFingerUnderFail.test.ets deleted file mode 100644 index 8f50b52b4604a5488e051ed1edf751a86373b18b..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/uitest/PinFingerUnderFail.test.ets +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Driver, ON } from '@ohos.UiTest'; -import { beforeAll, describe, expect, it } from '@ohos/hypium'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -const delayTime: number = 1000; - -export default function PinFingerUnderFailTest() { - describe('PinFingerUnderFailTest', function () { - - function sleep(ms) { - return new Promise(resolve => setTimeout(resolve, ms)); - } - - beforeAll(async function () { - const data = { - "cmd": [{ - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, - "remainAttempts": 5, - "type": "pin" - }, "version": "1" - }, { - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 54545, - "remainAttempts": 0, - "sensorInfo": "{\"sensorType\":\"UNDER_SCREEN_SENSOR\",\"udSensorCenterXInThousandth\":500,\"udSensorCenterYInThousandth\":980,\"udSensorRadiusInPx\":50}", - "type": "fingerprint" - }, "version": "1" - }], - "pinSubType": "PIN_MIXED", - "title": "请输入密码", - "type": ["pin", "fingerprint"], - "widgetContextId": 10234972519197798011, - "windowModeType": "DIALOG_BOX" - } - globalThis.wantParams = data; - sleep(delayTime); - - let want = { - bundleName: bundleName, - abilityName: 'PinFingerUnderFailAbility' - } - await delegator.startAbility(want); - sleep(delayTime); - }) - - it('cancel_pinFingerOn_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('cancelBtnState5FingerprintAuth')); - expect(true).assertTrue(); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/uitest/PinNumber.test.ets b/entry/src/ohosTest/ets/test/uitest/PinNumber.test.ets deleted file mode 100644 index ab0fa89a21de3b37ead2fb30a91c031dfb74d255..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/test/uitest/PinNumber.test.ets +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Driver, ON } from '@ohos.UiTest'; -import { beforeAll, describe, expect, it } from '@ohos/hypium'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -const delayTime: number = 1000; - -export default function PinNumberTest() { - describe('PinNumberTest', function () { - beforeAll(async function () { - const data = { - "cmd": [{ - "event": "CMD_NOTIFY_AUTH_START", "payload": { - "lockoutDuration": 0, "remainAttempts": 5, "type": "pin", "sensorInfo": "" - }, "version": "1" - }], - "pinSubType": "PIN_NUMBER", - "title": "使用密码验证", - "type": ["pin"], - "widgetContextId": 7932856209793250000, - "windowModeType": "DIALOG_BOX" - }; - globalThis.wantParams = data; - - let want = { - bundleName: bundleName, - abilityName: "PasswordAbility" - } - await delegator.startAbility(want); - }) - - it('title_pwd_auth_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('titlePwdAuth')); - expect(true).assertTrue(); - done(); - }) - - it('input_dialog_pwd_fail_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('pinInputMix')); - expect(true).assertTrue(); - done(); - }) - - it('input_dialog_pwd_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('pinInputMix')); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('okBtn')); - expect(true).assertTrue(); - done(); - }) - - it('cancelBtn_dialog_pwd_test', 0, async function (done) { - let driver = Driver.create(); - await driver.delayMs(delayTime); - await driver.findComponent(ON.id('cancelBtnDialogPwd')); - expect(true).assertTrue(); - done(); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/testability/CustomMixFailAbility.ets b/entry/src/ohosTest/ets/testability/CustomMixFailAbility.ets deleted file mode 100644 index 86f99f94d2b462312095e535eb6db4ba1407e8ec..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/testability/CustomMixFailAbility.ets +++ /dev/null @@ -1,35 +0,0 @@ -/* -* Copyright (c) 2023 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License") -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import UIAbility from '@ohos.app.ability.UIAbility'; -import window from '@ohos.window'; - -export default class CustomMixFailAbility extends UIAbility { - onCreate(want, launchParam) { - globalThis.context = this.context; - globalThis.session = {}; - } - - onDestroy() { - } - - onWindowStageCreate(windowStage: window.WindowStage) { - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - return; - } - }); - } -} diff --git a/entry/src/ohosTest/ets/testability/CustomMixFailTimesAbility.ets b/entry/src/ohosTest/ets/testability/CustomMixFailTimesAbility.ets deleted file mode 100644 index 61d9f5a61ac24363f9b36f6a8717d7aef59efe62..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/testability/CustomMixFailTimesAbility.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2023 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License") -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import UIAbility from '@ohos.app.ability.UIAbility'; -import window from '@ohos.window'; - -export default class CustomMixFailTimesAbility extends UIAbility { - onCreate(want, launchParam) { - globalThis.context = this.context; - globalThis.session = {}; - } - - onWindowStageCreate(windowStage: window.WindowStage) { - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - return; - } - }); - } -} diff --git a/entry/src/ohosTest/ets/testability/CustomPwdAbility.ets b/entry/src/ohosTest/ets/testability/CustomPwdAbility.ets deleted file mode 100644 index 904a6e09daf00d838326a2e5e9f3a9b9b3c2f881..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/testability/CustomPwdAbility.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2023 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License") -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import UIAbility from '@ohos.app.ability.UIAbility'; -import window from '@ohos.window'; - -export default class CustomPwdAbility extends UIAbility { - onCreate(want, launchParam) { - globalThis.context = this.context; - globalThis.session = {}; - } - - onWindowStageCreate(windowStage: window.WindowStage) { - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - return; - } - }); - } -} diff --git a/entry/src/ohosTest/ets/testability/CustomPwdNumberAbility.ets b/entry/src/ohosTest/ets/testability/CustomPwdNumberAbility.ets deleted file mode 100644 index 3dea1fad4695e1a1954000f35d0746ec33a4512a..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/testability/CustomPwdNumberAbility.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2023 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License") -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import UIAbility from '@ohos.app.ability.UIAbility'; -import window from '@ohos.window'; - -export default class CustomPwdNumberAbility extends UIAbility { - onCreate(want, launchParam) { - globalThis.context = this.context; - globalThis.session = {}; - } - - onWindowStageCreate(windowStage: window.WindowStage) { - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - return; - } - }); - } -} diff --git a/entry/src/ohosTest/ets/testability/FaceAbility.ets b/entry/src/ohosTest/ets/testability/FaceAbility.ets deleted file mode 100644 index b8cec36dc50bff54f4513b1f0dd9333e86d5bb44..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/testability/FaceAbility.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2023 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License") -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import UIAbility from '@ohos.app.ability.UIAbility'; -import window from '@ohos.window'; - -export default class FaceAbility extends UIAbility { - onCreate(want, launchParam) { - globalThis.context = this.context; - globalThis.session = {}; - } - - onWindowStageCreate(windowStage: window.WindowStage) { - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - return; - } - }); - } -} diff --git a/entry/src/ohosTest/ets/testability/FaceFailTimesAbility.ets b/entry/src/ohosTest/ets/testability/FaceFailTimesAbility.ets deleted file mode 100644 index 3270b3e888c15c4120e7de2b224e675e3e85825c..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/testability/FaceFailTimesAbility.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2023 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License") -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import UIAbility from '@ohos.app.ability.UIAbility'; -import window from '@ohos.window'; - -export default class FaceFailTimesAbility extends UIAbility { - onCreate(want, launchParam) { - globalThis.context = this.context; - globalThis.session = {}; - } - - onWindowStageCreate(windowStage: window.WindowStage) { - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - return; - } - }); - } -} diff --git a/entry/src/ohosTest/ets/testability/FaceFingerFailNonAbility.ets b/entry/src/ohosTest/ets/testability/FaceFingerFailNonAbility.ets deleted file mode 100644 index 208717a1395ed197728a221222b1aefe5eb48311..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/testability/FaceFingerFailNonAbility.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2023 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License") -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import UIAbility from '@ohos.app.ability.UIAbility'; -import window from '@ohos.window'; - -export default class FaceFingerFailNonAbility extends UIAbility { - onCreate(want, launchParam) { - globalThis.context = this.context; - globalThis.session = {}; - } - - onWindowStageCreate(windowStage: window.WindowStage) { - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - return; - } - }); - } -} diff --git a/entry/src/ohosTest/ets/testability/FaceMixAbility.ets b/entry/src/ohosTest/ets/testability/FaceMixAbility.ets deleted file mode 100644 index 9875a8404afa56ac08b2702ff10f0f534ae1e985..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/testability/FaceMixAbility.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2023 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License") -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import UIAbility from '@ohos.app.ability.UIAbility'; -import window from '@ohos.window'; - -export default class FaceMixAbility extends UIAbility { - onCreate(want, launchParam) { - globalThis.context = this.context; - globalThis.session = {}; - } - - onWindowStageCreate(windowStage: window.WindowStage) { - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - return; - } - }); - } -} diff --git a/entry/src/ohosTest/ets/testability/FaceMixSuccess3Ability.ets b/entry/src/ohosTest/ets/testability/FaceMixSuccess3Ability.ets deleted file mode 100644 index 33e246722271d32514db7650ad06dca0a4337f31..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/testability/FaceMixSuccess3Ability.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2023 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License") -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import UIAbility from '@ohos.app.ability.UIAbility'; -import window from '@ohos.window'; - -export default class FaceMixSuccess3Ability extends UIAbility { - onCreate(want, launchParam) { - globalThis.context = this.context; - globalThis.session = {}; - } - - onWindowStageCreate(windowStage: window.WindowStage) { - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - return; - } - }); - } -} diff --git a/entry/src/ohosTest/ets/testability/FaceMixSuccessAbility.ets b/entry/src/ohosTest/ets/testability/FaceMixSuccessAbility.ets deleted file mode 100644 index daa5ff2fd0bf5826e59b4c4ea353b095d4e67691..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/testability/FaceMixSuccessAbility.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2023 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License") -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import UIAbility from '@ohos.app.ability.UIAbility'; -import window from '@ohos.window'; - -export default class FaceMixSuccessAbility extends UIAbility { - onCreate(want, launchParam) { - globalThis.context = this.context; - globalThis.session = {}; - } - - onWindowStageCreate(windowStage: window.WindowStage) { - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - return; - } - }); - } -} diff --git a/entry/src/ohosTest/ets/testability/FaceMixSuccessAllAbility.ets b/entry/src/ohosTest/ets/testability/FaceMixSuccessAllAbility.ets deleted file mode 100644 index fefca63a2bb80dd64beb62101b1abac5694d8bbc..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/testability/FaceMixSuccessAllAbility.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2023 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License") -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import UIAbility from '@ohos.app.ability.UIAbility'; -import window from '@ohos.window'; - -export default class FaceMixSuccessAllAbility extends UIAbility { - onCreate(want, launchParam) { - globalThis.context = this.context; - globalThis.session = {}; - } - - onWindowStageCreate(windowStage: window.WindowStage) { - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - return; - } - }); - } -} diff --git a/entry/src/ohosTest/ets/testability/FaceMixSuccessLandscapeAbility.ets b/entry/src/ohosTest/ets/testability/FaceMixSuccessLandscapeAbility.ets deleted file mode 100644 index 93734ec447033274f4c1d0344cf5e96d92341e67..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/testability/FaceMixSuccessLandscapeAbility.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2023 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License") -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import UIAbility from '@ohos.app.ability.UIAbility'; -import window from '@ohos.window'; - -export default class FaceMixSuccessLandscapeAbility extends UIAbility { - onCreate(want, launchParam) { - globalThis.context = this.context; - globalThis.session = {}; - } - - onWindowStageCreate(windowStage: window.WindowStage) { - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - return; - } - }); - } -} diff --git a/entry/src/ohosTest/ets/testability/FaceMixTimesAbility.ets b/entry/src/ohosTest/ets/testability/FaceMixTimesAbility.ets deleted file mode 100644 index 087fe942047dbeea41bcf7bd469dd907ae4a8629..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/testability/FaceMixTimesAbility.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2023 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License") -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import UIAbility from '@ohos.app.ability.UIAbility'; -import window from '@ohos.window'; - -export default class FaceMixTimesAbility extends UIAbility { - onCreate(want, launchParam) { - globalThis.context = this.context; - globalThis.session = {}; - } - - onWindowStageCreate(windowStage: window.WindowStage) { - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - return; - } - }); - } -} diff --git a/entry/src/ohosTest/ets/testability/FacePinFailTimesAbility.ets b/entry/src/ohosTest/ets/testability/FacePinFailTimesAbility.ets deleted file mode 100644 index 80d412cedff9db8d0b9be6e9f6a57d6ac72ce103..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/testability/FacePinFailTimesAbility.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2023 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License") -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import UIAbility from '@ohos.app.ability.UIAbility'; -import window from '@ohos.window'; - -export default class FacePinFailTimesAbility extends UIAbility { - onCreate(want, launchParam) { - globalThis.context = this.context; - globalThis.session = {}; - } - - onWindowStageCreate(windowStage: window.WindowStage) { - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - return; - } - }); - } -} diff --git a/entry/src/ohosTest/ets/testability/FaceSingleAbility.ets b/entry/src/ohosTest/ets/testability/FaceSingleAbility.ets deleted file mode 100644 index a09d5ec60f61362a707d202c2abe01ddfc83350b..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/testability/FaceSingleAbility.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2023 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License") -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import UIAbility from '@ohos.app.ability.UIAbility'; -import window from '@ohos.window'; - -export default class FaceSingleAbility extends UIAbility { - onCreate(want, launchParam) { - globalThis.context = this.context; - globalThis.session = {}; - } - - onWindowStageCreate(windowStage: window.WindowStage) { - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - return; - } - }); - } -} diff --git a/entry/src/ohosTest/ets/testability/FingerFailAbility.ets b/entry/src/ohosTest/ets/testability/FingerFailAbility.ets deleted file mode 100644 index f93898763a67ae1abc22e4ffcc633633dc099f4e..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/testability/FingerFailAbility.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2023 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License") -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import UIAbility from '@ohos.app.ability.UIAbility'; -import window from '@ohos.window'; - -export default class FingerFailAbility extends UIAbility { - onCreate(want, launchParam) { - globalThis.context = this.context; - globalThis.session = {}; - } - - onWindowStageCreate(windowStage: window.WindowStage) { - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - return; - } - }); - } -} diff --git a/entry/src/ohosTest/ets/testability/FingerFailTimesAbility.ets b/entry/src/ohosTest/ets/testability/FingerFailTimesAbility.ets deleted file mode 100644 index 078c510c7763fbf36aeacf474492e33815a3388e..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/testability/FingerFailTimesAbility.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2023 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License") -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import UIAbility from '@ohos.app.ability.UIAbility'; -import window from '@ohos.window'; - -export default class FingerFailTimesAbility extends UIAbility { - onCreate(want, launchParam) { - globalThis.context = this.context; - globalThis.session = {}; - } - - onWindowStageCreate(windowStage: window.WindowStage) { - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - return; - } - }); - } -} diff --git a/entry/src/ohosTest/ets/testability/FingerOnAbility.ets b/entry/src/ohosTest/ets/testability/FingerOnAbility.ets deleted file mode 100644 index 026e5c78aa9af2fed922175c17c09dafa30964ce..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/testability/FingerOnAbility.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2023 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License") -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import UIAbility from '@ohos.app.ability.UIAbility'; -import window from '@ohos.window'; - -export default class FingerOnAbility extends UIAbility { - onCreate(want, launchParam) { - globalThis.context = this.context; - globalThis.session = {}; - } - - onWindowStageCreate(windowStage: window.WindowStage) { - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - return; - } - }); - } -} diff --git a/entry/src/ohosTest/ets/testability/FingerOnNullAbility.ets b/entry/src/ohosTest/ets/testability/FingerOnNullAbility.ets deleted file mode 100644 index 2027d5cb4122d2dfc9fd2306845d5054a262b6f0..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/testability/FingerOnNullAbility.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2023 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License") -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import UIAbility from '@ohos.app.ability.UIAbility'; -import window from '@ohos.window'; - -export default class FingerOnNullAbility extends UIAbility { - onCreate(want, launchParam) { - globalThis.context = this.context; - globalThis.session = {}; - } - - onWindowStageCreate(windowStage: window.WindowStage) { - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - return; - } - }); - } -} diff --git a/entry/src/ohosTest/ets/testability/FingerOutBackAbility.ets b/entry/src/ohosTest/ets/testability/FingerOutBackAbility.ets deleted file mode 100644 index cf85ce6fb781f262408bbb4040c092d27b3e5f00..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/testability/FingerOutBackAbility.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2023 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License") -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import UIAbility from '@ohos.app.ability.UIAbility'; -import window from '@ohos.window'; - -export default class FingerOutBackAbility extends UIAbility { - onCreate(want, launchParam) { - globalThis.context = this.context; - globalThis.session = {}; - } - - onWindowStageCreate(windowStage: window.WindowStage) { - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - return; - } - }); - } -} diff --git a/entry/src/ohosTest/ets/testability/FingerOutFrontAbility.ets b/entry/src/ohosTest/ets/testability/FingerOutFrontAbility.ets deleted file mode 100644 index a6424b8d256dd62ce52402e2b7929e62b51a0706..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/testability/FingerOutFrontAbility.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2023 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License") -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import UIAbility from '@ohos.app.ability.UIAbility'; -import window from '@ohos.window'; - -export default class FingerOutFrontAbility extends UIAbility { - onCreate(want, launchParam) { - globalThis.context = this.context; - globalThis.session = {}; - } - - onWindowStageCreate(windowStage: window.WindowStage) { - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - return; - } - }); - } -} diff --git a/entry/src/ohosTest/ets/testability/FingerOutSideAbility.ets b/entry/src/ohosTest/ets/testability/FingerOutSideAbility.ets deleted file mode 100644 index f4794798493c710cf6065d4c84ae7f246cf216d1..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/testability/FingerOutSideAbility.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2023 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License") -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import UIAbility from '@ohos.app.ability.UIAbility'; -import window from '@ohos.window'; - -export default class FingerOutSideAbility extends UIAbility { - onCreate(want, launchParam) { - globalThis.context = this.context; - globalThis.session = {}; - } - - onWindowStageCreate(windowStage: window.WindowStage) { - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - return; - } - }); - } -} diff --git a/entry/src/ohosTest/ets/testability/FingerUnderAbility.ets b/entry/src/ohosTest/ets/testability/FingerUnderAbility.ets deleted file mode 100644 index 85820cb9f58b82850af8b32e649fe9c56a2baa42..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/testability/FingerUnderAbility.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2023 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License") -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import UIAbility from '@ohos.app.ability.UIAbility'; -import window from '@ohos.window'; - -export default class FingerUnderAbility extends UIAbility { - onCreate(want, launchParam) { - globalThis.context = this.context; - globalThis.session = {}; - } - - onWindowStageCreate(windowStage: window.WindowStage) { - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - return; - } - }); - } -} diff --git a/entry/src/ohosTest/ets/testability/FingerUnderNullAbility.ets b/entry/src/ohosTest/ets/testability/FingerUnderNullAbility.ets deleted file mode 100644 index e16f6893c91c97c96d9203a2741acaea5425bd88..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/testability/FingerUnderNullAbility.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2023 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License") -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import UIAbility from '@ohos.app.ability.UIAbility'; -import window from '@ohos.window'; - -export default class FingerUnderNullAbility extends UIAbility { - onCreate(want, launchParam) { - globalThis.context = this.context; - globalThis.session = {}; - } - - onWindowStageCreate(windowStage: window.WindowStage) { - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - return; - } - }); - } -} diff --git a/entry/src/ohosTest/ets/testability/FingerprintAbility.ets b/entry/src/ohosTest/ets/testability/FingerprintAbility.ets deleted file mode 100644 index 7017563fa08043b8a7cc3c44b8942dd69d7ddc68..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/testability/FingerprintAbility.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2023 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License") -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import UIAbility from '@ohos.app.ability.UIAbility'; -import window from '@ohos.window'; - -export default class FingerprintAbility extends UIAbility { - onCreate(want, launchParam) { - globalThis.context = this.context; - globalThis.session = {}; - } - - onWindowStageCreate(windowStage: window.WindowStage) { - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - return; - } - }); - } -} diff --git a/entry/src/ohosTest/ets/testability/FingerprintLockAbility.ets b/entry/src/ohosTest/ets/testability/FingerprintLockAbility.ets deleted file mode 100644 index bc1a50216eab25156b567863f73efe2ed7d35313..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/testability/FingerprintLockAbility.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2023 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License") -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import UIAbility from '@ohos.app.ability.UIAbility'; -import window from '@ohos.window'; - -export default class FingerprintLockAbility extends UIAbility { - onCreate(want, launchParam) { - globalThis.context = this.context; - globalThis.session = {}; - } - - onWindowStageCreate(windowStage: window.WindowStage) { - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - return; - } - }); - } -} diff --git a/entry/src/ohosTest/ets/testability/PasswordAbility.ets b/entry/src/ohosTest/ets/testability/PasswordAbility.ets deleted file mode 100644 index f1c222c5f94cf4cc46385a4379151be488235ba9..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/testability/PasswordAbility.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2023 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License") -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import UIAbility from '@ohos.app.ability.UIAbility'; -import window from '@ohos.window'; - -export default class PasswordAbility extends UIAbility { - onCreate(want, launchParam) { - globalThis.context = this.context; - globalThis.session = {}; - } - - onWindowStageCreate(windowStage: window.WindowStage) { - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - return; - } - }); - } -} diff --git a/entry/src/ohosTest/ets/testability/PasswordFailTimesAbility.ets b/entry/src/ohosTest/ets/testability/PasswordFailTimesAbility.ets deleted file mode 100644 index 044d5a0c5e8556180e7346b80aad97b81aa46c0e..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/testability/PasswordFailTimesAbility.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2023 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License") -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import UIAbility from '@ohos.app.ability.UIAbility'; -import window from '@ohos.window'; - -export default class PasswordFailTimesAbility extends UIAbility { - onCreate(want, launchParam) { - globalThis.context = this.context; - globalThis.session = {}; - } - - onWindowStageCreate(windowStage: window.WindowStage) { - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - return; - } - }); - } -} diff --git a/entry/src/ohosTest/ets/testability/PasswordSixAbility.ets b/entry/src/ohosTest/ets/testability/PasswordSixAbility.ets deleted file mode 100644 index d28abf9e2ed2081f35578018cdb8eba891a12603..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/testability/PasswordSixAbility.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2023 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License") -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import UIAbility from '@ohos.app.ability.UIAbility'; -import window from '@ohos.window'; - -export default class PasswordSixAbility extends UIAbility { - onCreate(want, launchParam) { - globalThis.context = this.context; - globalThis.session = {}; - } - - onWindowStageCreate(windowStage: window.WindowStage) { - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - return; - } - }); - } -} diff --git a/entry/src/ohosTest/ets/testability/PinFingerOnAbility.ets b/entry/src/ohosTest/ets/testability/PinFingerOnAbility.ets deleted file mode 100644 index d6df62ec34ab8032da07c46b615e0b55d45dffa6..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/testability/PinFingerOnAbility.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2023 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License") -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import UIAbility from '@ohos.app.ability.UIAbility'; -import window from '@ohos.window'; - -export default class PinFingerOnAbility extends UIAbility { - onCreate(want, launchParam) { - globalThis.context = this.context; - globalThis.session = {}; - } - - onWindowStageCreate(windowStage: window.WindowStage) { - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - return; - } - }); - } -} diff --git a/entry/src/ohosTest/ets/testability/PinFingerOnFailAbility.ets b/entry/src/ohosTest/ets/testability/PinFingerOnFailAbility.ets deleted file mode 100644 index ae9c496510e26d8ad931d917acb62fc103d0afd8..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/testability/PinFingerOnFailAbility.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2023 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License") -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import UIAbility from '@ohos.app.ability.UIAbility'; -import window from '@ohos.window'; - -export default class PinFingerOnFailAbility extends UIAbility { - onCreate(want, launchParam) { - globalThis.context = this.context; - globalThis.session = {}; - } - - onWindowStageCreate(windowStage: window.WindowStage) { - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - return; - } - }); - } -} diff --git a/entry/src/ohosTest/ets/testability/PinFingerOutBackAbility.ets b/entry/src/ohosTest/ets/testability/PinFingerOutBackAbility.ets deleted file mode 100644 index 7104d14c6fe47ca29d85f0e7d8d63b5ded469c75..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/testability/PinFingerOutBackAbility.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2023 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License") -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import UIAbility from '@ohos.app.ability.UIAbility'; -import window from '@ohos.window'; - -export default class PinFingerOutBackAbility extends UIAbility { - onCreate(want, launchParam) { - globalThis.context = this.context; - globalThis.session = {}; - } - - onWindowStageCreate(windowStage: window.WindowStage) { - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - return; - } - }); - } -} diff --git a/entry/src/ohosTest/ets/testability/PinFingerOutFrontAbility.ets b/entry/src/ohosTest/ets/testability/PinFingerOutFrontAbility.ets deleted file mode 100644 index 7f95b3c97853a3e7f9047d3e7ed0adec654e7dbd..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/testability/PinFingerOutFrontAbility.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2023 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License") -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import UIAbility from '@ohos.app.ability.UIAbility'; -import window from '@ohos.window'; - -export default class PinFingerOutFrontAbility extends UIAbility { - onCreate(want, launchParam) { - globalThis.context = this.context; - globalThis.session = {}; - } - - onWindowStageCreate(windowStage: window.WindowStage) { - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - return; - } - }); - } -} diff --git a/entry/src/ohosTest/ets/testability/PinFingerOutSideAbility.ets b/entry/src/ohosTest/ets/testability/PinFingerOutSideAbility.ets deleted file mode 100644 index 55fee4bf81e66584bd52f0a92122bd0236746f21..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/testability/PinFingerOutSideAbility.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2023 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License") -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import UIAbility from '@ohos.app.ability.UIAbility'; -import window from '@ohos.window'; - -export default class PinFingerOutSideAbility extends UIAbility { - onCreate(want, launchParam) { - globalThis.context = this.context; - globalThis.session = {}; - } - - onWindowStageCreate(windowStage: window.WindowStage) { - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - return; - } - }); - } -} diff --git a/entry/src/ohosTest/ets/testability/PinFingerUnderAbility.ets b/entry/src/ohosTest/ets/testability/PinFingerUnderAbility.ets deleted file mode 100644 index 23e48168d1711bf70298103a85e64f1680ffb496..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/testability/PinFingerUnderAbility.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2023 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License") -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import UIAbility from '@ohos.app.ability.UIAbility'; -import window from '@ohos.window'; - -export default class PinFingerUnderAbility extends UIAbility { - onCreate(want, launchParam) { - globalThis.context = this.context; - globalThis.session = {}; - } - - onWindowStageCreate(windowStage: window.WindowStage) { - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - return; - } - }); - } -} diff --git a/entry/src/ohosTest/ets/testability/PinFingerUnderFailAbility.ets b/entry/src/ohosTest/ets/testability/PinFingerUnderFailAbility.ets deleted file mode 100644 index cabb7599d5083605afe4ad653fc96f71a54f0c3e..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/testability/PinFingerUnderFailAbility.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2023 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License") -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import UIAbility from '@ohos.app.ability.UIAbility'; -import window from '@ohos.window'; - -export default class PinFingerUnderFailAbility extends UIAbility { - onCreate(want, launchParam) { - globalThis.context = this.context; - globalThis.session = {}; - } - - onWindowStageCreate(windowStage: window.WindowStage) { - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - return; - } - }); - } -} diff --git a/entry/src/ohosTest/ets/testability/TestAbility.ets b/entry/src/ohosTest/ets/testability/TestAbility.ets deleted file mode 100644 index adcbc97b189e2dab4c8d3daf35cfae5443387b98..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/testability/TestAbility.ets +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; -import UIAbility from '@ohos.app.ability.UIAbility'; -import window from '@ohos.window'; -import { Hypium } from '@ohos/hypium'; -import testsuite from '../test/List.test'; - -export default class TestAbility extends UIAbility { - onCreate(want, launchParam) { - var abilityDelegator: any; - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); - var abilityDelegatorArguments: any; - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments(); - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite); - globalThis.context = this.context; - globalThis.session = {}; - } - - onWindowStageCreate(windowStage: window.WindowStage) { - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - return; - } - }); - } -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/testability/pages/Index.ets b/entry/src/ohosTest/ets/testability/pages/Index.ets deleted file mode 100644 index 15ab0a06cdd44400c6032696483e8feb38fc19af..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/testability/pages/Index.ets +++ /dev/null @@ -1,197 +0,0 @@ -/** - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import userAuth from '@ohos.userIAM.userAuth'; -import window from '@ohos.window'; -import { DialogType } from '../../../../main/ets/common/module/DialogType'; -import FuncUtils from '../../../../main/ets/common/utils/FuncUtils'; -import LogUtils from '../../../../main/ets/common/utils/LogUtils'; -import Constants, { CmdType } from '../../../../main/ets/common/vm/Constants'; -import CustomPassword from '../../../../main/ets/pages/components/CustomPassword'; -import FaceAuth from '../../../../main/ets/pages/components/FaceAuth'; -import FingerprintAuth from '../../../../main/ets/pages/components/FingerprintAuth'; -import PasswordAuth from '../../../../main/ets/pages/components/PasswordAuth'; - -const TAG = 'Index'; -const defaultSize = 72; -let userAuthWidgetMgr; - -@Entry -@Component -struct Index { - @State authType: Array = [userAuth.UserAuthType.PIN]; - @State type: string[] = []; - @State topHeight: number = defaultSize; - @State bottomHeight: number = defaultSize; - @State pinSubType: string = Constants.pinNumber; - @State dialogType: DialogType = DialogType.ALL; - @State windowModeType: string = 'DIALOG_BOX'; - @State cmdData: Array = []; - @Provide isLandscape: boolean = false; - @Provide underFingerPrint: boolean = false; - - onCancel(): void { - LogUtils.debug(TAG, 'Callback when the first button is clicked'); - globalThis.session?.terminateSelf(); - } - - onAccept(): void { - LogUtils.debug(TAG, 'Callback when the second button is clicked'); - } - - existApp(): void { - LogUtils.debug(TAG, 'Click the callback in the blank area'); - globalThis.session?.terminateSelf(); - } - - handleAuthStart(): void { - try { - userAuthWidgetMgr = userAuth.getUserAuthWidgetMgr(Constants.userAuthWidgetMgrVersion); - LogUtils.info(TAG, 'getUserAuthWidgetMgr success'); - let that = this; - userAuthWidgetMgr.on('command', { - callback: function (result) { - LogUtils.info(TAG, 'userAuthWidgetMgr onCommand result: ' + JSON.stringify(result)); - const cmdDataObj = JSON.parse(result?.cmdData || '{}'); - if (cmdDataObj?.cmd?.[0]?.payload?.result === Constants.userAuthWidgetMgrSuccess) { - that.onCancel(); - } else { - that.cmdData = cmdDataObj?.cmd || []; - that.pinSubType = cmdDataObj?.pinSubType; - } - } - }); - } catch (error) { - LogUtils.error(TAG, 'getUserAuthWidgetMgr catch error: ' + error?.code); - } - } - - aboutToAppear(): void { - LogUtils.debug(TAG, 'aboutToAppear test'); - if (globalThis.wantParams) { - LogUtils.debug(TAG, 'globalThis.wantParams: ' + JSON.stringify(globalThis.wantParams)); - this.getParams(globalThis.wantParams); - } else { - LogUtils.error(TAG, 'aboutToAppear wantParams null'); - } - this.getWindowHeight(); - } - - aboutToDisappear(): void { - LogUtils.info(TAG, 'aboutToDisappear'); - if (userAuthWidgetMgr) { - userAuthWidgetMgr.off('command', { - callback: function (result) { - LogUtils.info(TAG, 'aboutToDisappear userAuthWidgetMgr offCommand result: ' + JSON.stringify(result)); - } - }); - } - } - - onPageShow(): void { - LogUtils.info(TAG, 'onPageShow'); - } - - onPageHide(): void { - LogUtils.info(TAG, 'onPageHide'); - } - - onBackPress(): void { - LogUtils.info(TAG, 'onBackPress'); - } - - getParams(result): void { - LogUtils.info(TAG, 'getParams'); - const { pinSubType, windowModeType, cmd, type, widgetContextId } = result; - this.pinSubType = pinSubType; - const newType = type && type.map(item => { - switch (item) { - case Constants.noticeTypePin: - return userAuth.UserAuthType.PIN; - case Constants.noticeTypeFinger: - return userAuth.UserAuthType.FINGERPRINT; - case Constants.noticeTypeFace: - return userAuth.UserAuthType.FACE; - } - }) - globalThis.widgetContextId = widgetContextId; - this.authType = newType; - this.type = type; - this.windowModeType = windowModeType; - this.dialogType = FuncUtils.getDialogType(newType); - this.cmdData = cmd || []; - } - - getWindowHeight(): void { - LogUtils.info(TAG, 'getWindowHeight'); - try { - window.on('systemBarTintChange', (data) => { - LogUtils.debug(TAG, 'Succeeded in enabling the listener for window stage event changes. Data: ' + - JSON.stringify(data)); - for (let i = 0; i < data.regionTint.length; i++) { - let regionData = data.regionTint[i]; - if (regionData.type === window.WindowType.TYPE_STATUS_BAR) { - this.topHeight = px2vp(regionData.region.height); - continue; - } - if (regionData.type === window.WindowType.TYPE_NAVIGATION_BAR) { - this.bottomHeight = px2vp(regionData.region.top); - continue; - } - } - }); - } catch (error) { - LogUtils.error(TAG, 'Failed to enable the listener for window stage event changes. error: ' + error?.code); - } - } - - build() { - Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.SpaceAround, alignItems: ItemAlign.Center }) { - if ('DIALOG_BOX' === this.windowModeType) { - if (this.authType.includes(userAuth.UserAuthType.FACE)) { - FaceAuth({ - type: $windowModeType, - pinSubType: $pinSubType, - dialogType: $dialogType, - cmdData: $cmdData, - }) - } else if (this.authType.includes(userAuth.UserAuthType.FINGERPRINT)) { - FingerprintAuth({ - type: $windowModeType, - pinSubType: $pinSubType, - dialogType: $dialogType, - cmdData: $cmdData, - }) - } else { - PasswordAuth({ - pinSubType: $pinSubType, - cmdData: $cmdData - }) - } - - } else { - // full screen PIN - CustomPassword({ - authType: $authType, - pinSubType: $pinSubType, - cmdData: $cmdData - }) - } - } - .backgroundColor(Color.Transparent) - .position({ x: 0, y: this.topHeight }) - .height((this.bottomHeight - this.topHeight)) - } -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts b/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts deleted file mode 100644 index 6dc1c9b4ee7d3684514006dc474fbbad6250faec..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; -import hilog from '@ohos.hilog'; -import TestRunner from '@ohos.application.testRunner'; - -let abilityDelegator; -let abilityDelegatorArguments; - -async function onAbilityCreateCallback(): Promise { - hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); -} - -async function addAbilityMonitorCallback(err: Error): Promise { - hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); -} - -export default class OpenHarmonyTestRunner implements TestRunner { - constructor() { - } - - onPrepare(): void { - hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare '); - } - - async onRun(): Promise { - hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments(); - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); - let testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility'; - let lMonitor = { - abilityName: testAbilityName, - onAbilityCreate: onAbilityCreateCallback, - }; - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback); - let cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName; - let debug = abilityDelegatorArguments.parameters['-D']; - if (debug === 'true') { - cmd += ' -D'; - } - hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); - abilityDelegator.executeShellCommand(cmd, () => { - }); - hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); - } -} \ No newline at end of file diff --git a/entry/src/ohosTest/module.json b/entry/src/ohosTest/module.json deleted file mode 100644 index 0da934b6492e85660b5739b01c140e36a6067e99..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/module.json +++ /dev/null @@ -1,232 +0,0 @@ -{ - "module": { - "name": "entry_test", - "type": "feature", - "description": "$string:module_test_desc", - "mainElement": "TestAbility", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:test_pages", - "abilities": [ - { - "name": "TestAbility", - "srcEntrance": "./ets/testability/TestAbility.ets", - "description": "$string:TestAbility_desc", - "icon": "$media:icon", - "label": "$string:TestAbility_label", - "visible": true, - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - }, - { - "name": "PasswordAbility", - "srcEntrance": "./ets/testability/PasswordAbility.ets", - "description": "$string:TestAbility_desc", - "icon": "$media:icon", - "label": "$string:TestAbility_label", - "visible": true, - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - }, - { - "name": "PasswordSixAbility", - "srcEntrance": "./ets/testability/PasswordSixAbility.ets", - "description": "$string:TestAbility_desc", - "icon": "$media:icon", - "label": "$string:TestAbility_label", - "visible": true, - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - }, - { - "name": "CustomPwdAbility", - "srcEntrance": "./ets/testability/CustomPwdAbility.ets", - "description": "$string:TestAbility_desc", - "icon": "$media:icon", - "label": "$string:TestAbility_label", - "visible": true, - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - }, - { - "name": "CustomPwdNumberAbility", - "srcEntrance": "./ets/testability/CustomPwdNumberAbility.ets", - "description": "$string:TestAbility_desc", - "icon": "$media:icon", - "label": "$string:TestAbility_label", - "visible": true, - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - }, - { - "name": "CustomMixFailAbility", - "srcEntrance": "./ets/testability/CustomMixFailAbility.ets", - "description": "$string:TestAbility_desc", - "icon": "$media:icon", - "label": "$string:TestAbility_label", - "visible": true, - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - }, - { - "name": "CustomMixFailTimesAbility", - "srcEntrance": "./ets/testability/CustomMixFailTimesAbility.ets", - "description": "$string:TestAbility_desc", - "icon": "$media:icon", - "label": "$string:TestAbility_label", - "visible": true, - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - }, - { - "name": "FaceAbility", - "srcEntrance": "./ets/testability/FaceAbility.ets", - "description": "$string:TestAbility_desc", - "icon": "$media:icon", - "label": "$string:TestAbility_label", - "visible": true, - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - }, - { - "name": "FaceFailTimesAbility", - "srcEntrance": "./ets/testability/FaceFailTimesAbility.ets", - "description": "$string:TestAbility_desc", - "icon": "$media:icon", - "label": "$string:TestAbility_label", - "visible": true, - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - }, - { - "name": "FaceMixAbility", - "srcEntrance": "./ets/testability/FaceMixAbility.ets", - "description": "$string:TestAbility_desc", - "icon": "$media:icon", - "label": "$string:TestAbility_label", - "visible": true, - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - }, - { - "name": "FaceMixSuccess3Ability", - "srcEntrance": "./ets/testability/FaceMixSuccess3Ability.ets", - "description": "$string:TestAbility_desc", - "icon": "$media:icon", - "label": "$string:TestAbility_label", - "visible": true, - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - }, - { - "name": "FaceMixSuccessAbility", - "srcEntrance": "./ets/testability/FaceMixSuccessAbility.ets", - "description": "$string:TestAbility_desc", - "icon": "$media:icon", - "label": "$string:TestAbility_label", - "visible": true, - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - }, - { - "name": "FaceMixTimesAbility", - "srcEntrance": "./ets/testability/FaceMixTimesAbility.ets", - "description": "$string:TestAbility_desc", - "icon": "$media:icon", - "label": "$string:TestAbility_label", - "visible": true, - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - }, - { - "name": "FaceSingleAbility", - "srcEntrance": "./ets/testability/FaceSingleAbility.ets", - "description": "$string:TestAbility_desc", - "icon": "$media:icon", - "label": "$string:TestAbility_label", - "visible": true, - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - }, - { - "name": "FingerprintAbility", - "srcEntrance": "./ets/testability/FingerprintAbility.ets", - "description": "$string:TestAbility_desc", - "icon": "$media:icon", - "label": "$string:TestAbility_label", - "visible": true, - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - }, - { - "name": "FingerFailAbility", - "srcEntrance": "./ets/testability/FingerFailAbility.ets", - "description": "$string:TestAbility_desc", - "icon": "$media:icon", - "label": "$string:TestAbility_label", - "visible": true, - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - }, - { - "name": "FingerFailTimesAbility", - "srcEntrance": "./ets/testability/FingerFailTimesAbility.ets", - "description": "$string:TestAbility_desc", - "icon": "$media:icon", - "label": "$string:TestAbility_label", - "visible": true, - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - } - ], - "extensionAbilities": [ - { - "name": "userauthuiextensionability", - "srcEntry": "./ets/extensionability/UserAuthAbility.ts", - "icon": "$media:app_icon", - "label": "$string:EntryAbility_label", - "type": "sysDialog/userAuth", - "permissions": [ - "ohos.permission.ACCESS_PIN_AUTH", - "ohos.permission.ACCESS_BIOMETRIC", - "ohos.permission.SUPPORT_USER_AUTH", - "ohos.permission.PRIVACY_WINDOW" - ], - "metadata": [ - { - "name": "ohos.extension.servicetype", - "value": "commonDialog" - } - ] - } - ], - "requestPermissions": [ - { - "name": "ohos.permission.ACCESS_PIN_AUTH" - }, - { - "name": "ohos.permission.ACCESS_BIOMETRIC" - }, - { - "name": "ohos.permission.SUPPORT_USER_AUTH" - }, - { - "name": "ohos.permission.PRIVACY_WINDOW" - } - ] - } -} diff --git a/entry/src/ohosTest/resources/base/element/color.json b/entry/src/ohosTest/resources/base/element/color.json deleted file mode 100644 index 060bfc825224cedb0d9983791a98f27179401ee4..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/resources/base/element/color.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - }, - { - "name": "full_screen_background", - "value": "#0d0d0d" - }, - { - "name": "button_color", - "value": "#00FFFFFF" - } - ] -} \ No newline at end of file diff --git a/entry/src/ohosTest/resources/base/element/float.json b/entry/src/ohosTest/resources/base/element/float.json deleted file mode 100644 index 1a7d2b8ceb9c8f15e8aaa2c395f05437ecb8f9ce..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/resources/base/element/float.json +++ /dev/null @@ -1,428 +0,0 @@ -{ - "float": [ - { - "name": "lockicon_width", - "value": "40px" - }, - { - "name": "lockicon_height", - "value": "45px" - }, - { - "name": "lockicon_top_margin", - "value": "10px" - }, - { - "name": "lockicon_bottom_margin", - "value": "10px" - }, - { - "name": "lockicon_right_margin", - "value": "0" - }, - { - "name": "lock_prompt_font_size", - "value": "32px" - }, - { - "name": "lock_Text_top_margin", - "value": "0" - }, - { - "name": "batterysoc_font_size", - "value": "36px" - }, - { - "name": "accounts_component_height", - "value": "120px" - }, - { - "name": "accounts_ic_width", - "value": "72px" - }, - { - "name": "accounts_ic_height", - "value": "72px" - }, - { - "name": "accounts_name_font_size", - "value": "24px" - }, - { - "name": "accounts_block", - "value": "8px" - }, - { - "name": "digital_password_prompt_font_size", - "value": "32px" - }, - { - "name": "digital_password_prompt_margin_bottom", - "value": "48px" - }, - { - "name": "digital_password_prompt_width", - "value": "800px" - }, - { - "name": "digital_password_prompt_height", - "value": "72px" - }, - { - "name": "digital_password_mask_width", - "value": "400px" - }, - { - "name": "digital_password_mask_height", - "value": "24vp" - }, - { - "name": "digital_password_mask_margin_bottom", - "value": "128px" - }, - { - "name": "digital_password_input_area_height", - "value": "200px" - }, - { - "name": "digital_password_row1_font_size", - "value": "48px" - }, - { - "name": "digital_password_row2_font_size", - "value": "24px" - }, - { - "name": "digital_password_row_height", - "value": "200px" - }, - { - "name": "digital_password_key_area_height", - "value": "800px" - }, - { - "name": "digital_password_key_area_margin_bottom", - "value": "64px" - }, - { - "name": "digital_password_key_area_margin_bottom_portrait", - "value": "128px" - }, - { - "name": "mixed_password_prompt_font_size", - "value": "32px" - }, - { - "name": "mixed_password_prompt_text_font_size", - "value": "32px" - }, - { - "name": "mixed_password_prompt_margin_bottom", - "value": "48px" - }, - { - "name": "mixed_password_prompt_margin_top", - "value": "0" - }, - { - "name": "mixed_password_prompt_width", - "value": "800px" - }, - { - "name": "mixed_password_prompt_height", - "value": "72px" - }, - { - "name": "mixed_password_input_maxlen", - "value": "30px" - }, - { - "name": "mixed_password_input_width", - "value": "600px" - }, - { - "name": "mixed_password_input_height", - "value": "72px" - }, - { - "name": "mixed_password_input_margin_bottom", - "value": "64px" - }, - { - "name": "custom_password_prompt_font_size", - "value": "32px" - }, - { - "name": "custom_password_prompt_margin_bottom", - "value": "48px" - }, - { - "name": "custom_password_prompt_width", - "value": "800px" - }, - { - "name": "custom_password_prompt_height", - "value": "72px" - }, - { - "name": "custom_password_input_width", - "value": "600px" - }, - { - "name": "custom_password_input_width_portrait", - "value": "700px" - }, - { - "name": "custom_password_input_height", - "value": "72px" - }, - { - "name": "custom_password_input_margin", - "value": "36px" - }, - { - "name": "custom_password_input_radius", - "value": "36px" - }, - { - "name": "custom_password_input_margin_bottom", - "value": "90px" - }, - { - "name": "custom_password_mask_margin_bottom", - "value": "128px" - }, - { - "name": "custom_password_input_area_height", - "value": "400px" - }, - { - "name": "custom_password_key_area_height", - "value": "800px" - }, - { - "name": "custom_password_key_area_margin_bottom", - "value": "64px" - }, - { - "name": "custom_password_key_area_margin_bottom_portrait", - "value": "128px" - }, - { - "name": "custom_password_text_opacity", - "value": "1px" - }, - { - "name": "custom_password_digital_password_ic_diameter", - "value": "12vp" - }, - { - "name": "custom_password_button_height", - "value": "36vp" - }, - { - "name": "numkeyBoard_text_opacity", - "value": "1" - }, - { - "name": "numkeyBoard_rowsGap", - "value": "0" - }, - { - "name": "status_bar_height", - "value": "48vp" - }, - { - "name": "status_bar_padding_left_right", - "value": "0" - }, - { - "name": "status_bar_margin_top", - "value": "0" - }, - { - "name": "status_bar_opacity", - "value": "1" - }, - { - "name": "hap_title_font_size", - "value": "30" - }, - { - "name": "hap_label_font_size", - "value": "20" - }, - { - "name": "hap_label_font_size_big", - "value": "25" - }, - { - "name": "hap_label_font_size_small", - "value": "15" - }, - { - "name": "hap_input_width", - "value": "240" - }, - { - "name": "hap_Item_height", - "value": "40" - }, - { - "name": "title_padding_top", - "value": "32vp" - }, - { - "name": "content_padding", - "value": "16vp" - }, - { - "name": "content_padding_top", - "value": "32vp" - }, - { - "name": "btn_height", - "value": "40vp" - }, - { - "name": "divider_width", - "value": "2vp" - }, - { - "name": "element_top", - "value": "8vp" - }, - { - "name": "element_margin", - "value": "8vp" - }, - { - "name": "margin_16", - "value": "16vp" - }, - { - "name": "input_height", - "value": "40vp" - }, - { - "name": "input_border", - "value": "1vp" - }, - { - "name": "input_btn_size", - "value": "12vp" - }, - { - "name": "input_btn_padding_around", - "value": "24vp" - }, - { - "name": "input_btn_padding_up_down", - "value": "3vp" - }, - { - "name": "image_back_size", - "value": "24vp" - }, - { - "name": "image_size", - "value": "66vp" - }, - { - "name": "image_small", - "value": "30vp" - }, - { - "name": "image_medium", - "value": "60vp" - }, - { - "name": "image_big", - "value": "120vp" - }, - { - "name": "title_size", - "value": "20vp" - }, - { - "name": "size_24", - "value": "24vp" - }, - { - "name": "back_width", - "value": "97vp" - }, - { - "name": "back_padding", - "value": "10vp" - }, - { - "name": "keyboard_key_high", - "value": "120vp" - }, - { - "name": "button_border_width", - "value": "6vp" - }, - { - "name": "cancel_margin_top", - "value": "2vp" - }, - { - "name": "margin_12", - "value": "12vp" - }, - { - "name": "margin_14", - "value": "14vp" - }, - { - "name": "text_high", - "value": "40vp" - }, - { - "name": "finger_high", - "value": "72vp" - }, - { - "name": "three_hundred_size", - "value": "300vp" - }, - { - "name": "padding_8", - "value": "8vp" - }, - { - "name": "padding_16", - "value": "16vp" - }, - { - "name": "margin_64", - "value": "64vp" - }, - { - "name": "fullScreen_input_width", - "value": "288vp" - }, - { - "name": "textArea_height", - "value": "44vp" - }, - { - "name": "numKeyBoard_row1_16", - "value": "16vp" - }, - { - "name": "numKeyBoard_row1_28", - "value": "28vp" - }, - { - "name": "numKeyBoard_row2", - "value": "12vp" - }, - { - "name": "keyBoard_key_high_phone", - "value": "54vp" - } - ] -} \ No newline at end of file diff --git a/entry/src/ohosTest/resources/base/element/image.json b/entry/src/ohosTest/resources/base/element/image.json deleted file mode 100644 index 75452889f20a409b493c4e37e6cdb86dcf9395f7..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/resources/base/element/image.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "boolean": [ - { - "name": "boolean_1", - "value": true - } - ] -} \ No newline at end of file diff --git a/entry/src/ohosTest/resources/base/element/string.json b/entry/src/ohosTest/resources/base/element/string.json deleted file mode 100644 index c360f26e5b33ee3f305fc5613fe42ce9bd7af261..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/resources/base/element/string.json +++ /dev/null @@ -1,204 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "AuthWidget" - }, - { - "name": "unified_authwidget_forgotpwd", - "value": "Forgot password" - }, - { - "name": "unified_authwidget_locked", - "value": "Locked" - }, - { - "name": "unified_authwidget_confirm", - "value": "OK" - }, - { - "name": "unified_authwidget_cancel", - "value": "Cancel" - }, - { - "name": "unified_authwidget_delete", - "value": "Delete" - }, - { - "name": "unified_authwidget_back", - "value": "Back" - }, - { - "name": "unified_authwidget_usepwd", - "value": "Use password" - }, - { - "name": "unified_authwidget_hint_pwd_error", - "value": "Incorrect password" - }, - { - "name": "fingerprint_matching_failed", - "value": "Fingerprint matching failed" - }, - { - "name": "unified_authwidget_hint_inscreen_fp", - "value": "Press the fingerprint sensor to verify your fingerprint." - }, - { - "name": "unified_authwidget_hint_normal_fp_only", - "value": "Press the fingerprint sensor to verify your fingerprint." - }, - { - "name": "unified_authwidget_hint_fp_verify_success", - "value": "Verification successful." - }, - { - "name": "unified_authwidget_hint_fp_retry_s1", - "value": "Fingerprint not recognized. Make sure your finger and the sensor are clean." - }, - { - "name": "unified_authwidget_title_fp_forbidden_enter_pwd", - "value": "Fingerprint ID disabled. Enter your password." - }, - { - "name": "unified_authwidget_title_fp_forbidden_enter_pin", - "value": "Fingerprint ID disabled. Enter your PIN." - }, - { - "name": "unified_authwidget_title_fp_forbidden_use_face_pattern", - "value": "Fingerprint ID disabled. Use Face Recognition or your pattern." - }, - { - "name": "unified_authwidget_title_fp_forbidden_use_face_pwd", - "value": "Fingerprint ID disabled. Use Face Recognition or your password." - }, - { - "name": "unified_authwidget_title_fp_forbidden_use_face_pin", - "value": "Fingerprint ID disabled. Use Face Recognition or your PIN." - }, - { - "name": "unified_authwidget_hint_recognizing", - "value": "Scanning" - }, - { - "name": "unified_authwidget_hint_recognize_success", - "value": "Verification successful." - }, - { - "name": "unified_authwidget_hint_face_verify_fail_click_retry_s1", - "value": "Face not recognized. Touch here to try again." - }, - { - "name": "unified_authwidget_hint_face_verify_fail_click_retry_s2", - "value": "Face not recognized. Double-tap to try again." - }, - { - "name": "unified_authwidget_title_face_forbidden_use_pwd", - "value": "Face Recognition disabled. Enter your password." - }, - { - "name": "unified_authwidget_title_face_forbidden_use_pin", - "value": "Face Recognition disabled. Enter your PIN." - }, - { - "name": "unified_authwidget_title_face_forbidden_use_fp_pwd", - "value": "Face Recognition disabled. Use your fingerprint or password." - }, - { - "name": "unified_authwidget_title_face_fp_forbidden_use_pwd", - "value": "Face Recognition and Fingerprint ID disabled. Enter your password." - }, - { - "name": "unified_authwidget_title_face_fp_forbidden_use_pin", - "value": "Face Recognition and Fingerprint ID disabled. Enter your PIN." - }, - { - "name": "unified_authwidget_title_face_fp_forbidden_use_pattern", - "value": "Face Recognition and Fingerprint ID disabled. Draw your pattern." - }, - { - "name": "unified_authwidget_hint_pin_error", - "value": "Incorrect PIN" - }, - { - "name": "unified_authwidget_use_pwd", - "value": "Enter password" - }, - { - "name": "unified_authwidget_title_face_forbidden", - "value": "Face Recognition disabled." - }, - { - "name": "unified_authwidget_hint_fp_retry_s2", - "value": "Fingerprint not recognized. Press down a little longer." - }, - { - "name": "unified_authwidget_title_fp_forbidden", - "value": "Fingerprint ID disabled." - }, - { - "name": "unified_authwidget_hint_recognition", - "value": "Face Scanning" - }, - { - "name": "unified_authwidget_title_number_failed_fp_forbidden", - "value": "Excessive failure, fingerprint is disabled" - }, - { - "name": "unified_authwidget_tip_verify_in_portrait_mode", - "value": "Verify in portrait mode" - }, - { - "name": "unified_authwidget_pwd_error_can_try_frequency", - "value": "Password error, can still try %d frequency" - }, - { - "name": "unified_authwidget_pwd_error_can_try", - "value": "Password error, can still try " - }, - { - "name": "unified_authwidget_frequency", - "value": " frequency" - }, - { - "name": "unified_authwidget_many_failures", - "value": "Too many failures, please " - }, - { - "name": "unified_authwidget_pleaseretry", - "value": "Please" - }, - { - "name": "unified_authwidget_postretry", - "value": "retry" - }, - { - "name": "unified_authwidget_hour", - "value": "hour" - }, - { - "name": "unified_authwidget_minutes", - "value": "minutes " - }, - { - "name": "unified_authwidget_seconds", - "value": "seconds " - }, - { - "name": "unified_authwidget_notarize", - "value": "OK" - }, - { - "name": "unified_authwidget_title_number_failed_face_forbidden", - "value": "Excessive failure, face is disabled" - } - ] -} \ No newline at end of file diff --git a/entry/src/ohosTest/resources/base/media/error_faceID.svg b/entry/src/ohosTest/resources/base/media/error_faceID.svg deleted file mode 100644 index 6329960c7aa012ff007c80af8d6e9b694ba85fd0..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/resources/base/media/error_faceID.svg +++ /dev/null @@ -1,54 +0,0 @@ - - - - - error - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/entry/src/ohosTest/resources/base/media/finger_guide.svg b/entry/src/ohosTest/resources/base/media/finger_guide.svg deleted file mode 100644 index 21ec46132c94917e4e43b36c287e5c21f6080529..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/resources/base/media/finger_guide.svg +++ /dev/null @@ -1,48 +0,0 @@ - - - 画板 - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/entry/src/ohosTest/resources/base/media/finger_white.svg b/entry/src/ohosTest/resources/base/media/finger_white.svg deleted file mode 100644 index 02f1f0bd2c8ef3f654a973616bbae0287cf15141..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/resources/base/media/finger_white.svg +++ /dev/null @@ -1,48 +0,0 @@ - - - 画板 - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/entry/src/ohosTest/resources/base/media/ic_blue_fingerprint.svg b/entry/src/ohosTest/resources/base/media/ic_blue_fingerprint.svg deleted file mode 100644 index 585905cfbace9aa8272223796d518d4886b5422e..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/resources/base/media/ic_blue_fingerprint.svg +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - diff --git a/entry/src/ohosTest/resources/base/media/ic_public_cancel.svg b/entry/src/ohosTest/resources/base/media/ic_public_cancel.svg deleted file mode 100644 index bdec70bf0fec90a8e881366d2bb32340a699138f..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/resources/base/media/ic_public_cancel.svg +++ /dev/null @@ -1,30 +0,0 @@ - - - Public/ic_public_cancel - - - - - - - - - - \ No newline at end of file diff --git a/entry/src/ohosTest/resources/base/media/ic_public_password_unvisible.svg b/entry/src/ohosTest/resources/base/media/ic_public_password_unvisible.svg deleted file mode 100644 index 45fab35c17a2659c26cf5012e62ddc646b673b22..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/resources/base/media/ic_public_password_unvisible.svg +++ /dev/null @@ -1,46 +0,0 @@ - - - Public/ic_public_password_unvisible - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/entry/src/ohosTest/resources/base/media/ic_public_password_visible.svg b/entry/src/ohosTest/resources/base/media/ic_public_password_visible.svg deleted file mode 100644 index 87c465bed9721aa9ba0e0b24eb4c6675bab8395f..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/resources/base/media/ic_public_password_visible.svg +++ /dev/null @@ -1,46 +0,0 @@ - - - Public/ic_public_password_visible - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/entry/src/ohosTest/resources/base/media/ic_solid_dot.svg b/entry/src/ohosTest/resources/base/media/ic_solid_dot.svg deleted file mode 100644 index 5a04c1b7e7c2e5f2c7677b408eae7d53922b3a0b..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/resources/base/media/ic_solid_dot.svg +++ /dev/null @@ -1,35 +0,0 @@ - - - Rectangle 9 Copy 5 - - - - - - - - - - \ No newline at end of file diff --git a/entry/src/ohosTest/resources/base/media/ic_unlock_fingerprint.svg b/entry/src/ohosTest/resources/base/media/ic_unlock_fingerprint.svg deleted file mode 100644 index 1a16dc6c931f700fcc5c396fbe7c7335a140e2a5..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/resources/base/media/ic_unlock_fingerprint.svg +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - diff --git a/entry/src/ohosTest/resources/base/media/ic_white_cancel.svg b/entry/src/ohosTest/resources/base/media/ic_white_cancel.svg deleted file mode 100644 index 99200b4813abc921ad83e5724a224710c9a4d9e4..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/resources/base/media/ic_white_cancel.svg +++ /dev/null @@ -1,30 +0,0 @@ - - - Public/ic_public_cancel - - - - - - - - - - \ No newline at end of file diff --git a/entry/src/ohosTest/resources/base/media/icon.png b/entry/src/ohosTest/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/entry/src/ohosTest/resources/base/media/icon.png and /dev/null differ diff --git a/entry/src/ohosTest/resources/base/media/icon_applock_2.png b/entry/src/ohosTest/resources/base/media/icon_applock_2.png deleted file mode 100644 index f7bc1d8329a4fc8f7e34db40e9cb7cbb8b52a3ea..0000000000000000000000000000000000000000 Binary files a/entry/src/ohosTest/resources/base/media/icon_applock_2.png and /dev/null differ diff --git a/entry/src/ohosTest/resources/base/media/icon_applock_3.png b/entry/src/ohosTest/resources/base/media/icon_applock_3.png deleted file mode 100644 index 82d10ccfa5862954c52f516a73ae49c916838f96..0000000000000000000000000000000000000000 Binary files a/entry/src/ohosTest/resources/base/media/icon_applock_3.png and /dev/null differ diff --git a/entry/src/ohosTest/resources/base/media/icon_applock_4.png b/entry/src/ohosTest/resources/base/media/icon_applock_4.png deleted file mode 100644 index c900ef3d350c1117da056fa2982e2344b6d192da..0000000000000000000000000000000000000000 Binary files a/entry/src/ohosTest/resources/base/media/icon_applock_4.png and /dev/null differ diff --git a/entry/src/ohosTest/resources/base/media/right_faceID.svg b/entry/src/ohosTest/resources/base/media/right_faceID.svg deleted file mode 100644 index f6b6acba1e76fbb3a6789d5188e8d67963b47281..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/resources/base/media/right_faceID.svg +++ /dev/null @@ -1,30 +0,0 @@ - - - - - right - - - - - - - - \ No newline at end of file diff --git a/entry/src/ohosTest/resources/base/media/white_faceID.svg b/entry/src/ohosTest/resources/base/media/white_faceID.svg deleted file mode 100644 index 3d3e4740623d4ac17e5fefcae2d05d4381f059a4..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/resources/base/media/white_faceID.svg +++ /dev/null @@ -1,54 +0,0 @@ - - - - - error - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/entry/src/ohosTest/resources/base/profile/test_pages.json b/entry/src/ohosTest/resources/base/profile/test_pages.json deleted file mode 100644 index b7e7343cacb32ce982a45e76daad86e435e054fe..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/resources/base/profile/test_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "testability/pages/Index" - ] -} diff --git a/entry/src/ohosTest/resources/en_US/element/string.json b/entry/src/ohosTest/resources/en_US/element/string.json deleted file mode 100644 index 4f36890df536e6811c472aa48f5c6ac3071de56a..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/resources/en_US/element/string.json +++ /dev/null @@ -1,216 +0,0 @@ -{ - "string": [ - { - "name": "module_test_desc", - "value": "test ability description" - }, - { - "name": "TestAbility_desc", - "value": "the test ability" - }, - { - "name": "TestAbility_label", - "value": "test label" - }, - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "AuthWidget" - }, - { - "name": "unified_authwidget_forgotpwd", - "value": "Forgot password" - }, - { - "name": "unified_authwidget_locked", - "value": "Locked" - }, - { - "name": "unified_authwidget_confirm", - "value": "OK" - }, - { - "name": "unified_authwidget_cancel", - "value": "Cancel" - }, - { - "name": "unified_authwidget_delete", - "value": "Delete" - }, - { - "name": "unified_authwidget_back", - "value": "Back" - }, - { - "name": "unified_authwidget_usepwd", - "value": "Use password" - }, - { - "name": "unified_authwidget_hint_pwd_error", - "value": "Incorrect password" - }, - { - "name": "fingerprint_matching_failed", - "value": "Fingerprint matching failed" - }, - { - "name": "unified_authwidget_hint_inscreen_fp", - "value": "Press the fingerprint sensor to verify your fingerprint." - }, - { - "name": "unified_authwidget_hint_normal_fp_only", - "value": "Press the fingerprint sensor to verify your fingerprint." - }, - { - "name": "unified_authwidget_hint_fp_verify_success", - "value": "Verification successful." - }, - { - "name": "unified_authwidget_hint_fp_retry_s1", - "value": "Fingerprint not recognized. Make sure your finger and the sensor are clean." - }, - { - "name": "unified_authwidget_title_fp_forbidden_enter_pwd", - "value": "Fingerprint ID disabled. Enter your password." - }, - { - "name": "unified_authwidget_title_fp_forbidden_enter_pin", - "value": "Fingerprint ID disabled. Enter your PIN." - }, - { - "name": "unified_authwidget_title_fp_forbidden_use_face_pattern", - "value": "Fingerprint ID disabled. Use Face Recognition or your pattern." - }, - { - "name": "unified_authwidget_title_fp_forbidden_use_face_pwd", - "value": "Fingerprint ID disabled. Use Face Recognition or your password." - }, - { - "name": "unified_authwidget_title_fp_forbidden_use_face_pin", - "value": "Fingerprint ID disabled. Use Face Recognition or your PIN." - }, - { - "name": "unified_authwidget_hint_recognizing", - "value": "Scanning…" - }, - { - "name": "unified_authwidget_hint_recognize_success", - "value": "Verification successful." - }, - { - "name": "unified_authwidget_hint_face_verify_fail_click_retry_s1", - "value": "Face not recognized. Touch here to try again." - }, - { - "name": "unified_authwidget_hint_face_verify_fail_click_retry_s2", - "value": "Face not recognized. Double-tap to try again." - }, - { - "name": "unified_authwidget_title_face_forbidden_use_pwd", - "value": "Face Recognition disabled. Enter your password." - }, - { - "name": "unified_authwidget_title_face_forbidden_use_pin", - "value": "Face Recognition disabled. Enter your PIN." - }, - { - "name": "unified_authwidget_title_face_forbidden_use_fp_pwd", - "value": "Face Recognition disabled. Use your fingerprint or password." - }, - { - "name": "unified_authwidget_title_face_fp_forbidden_use_pwd", - "value": "Face Recognition and Fingerprint ID disabled. Enter your password." - }, - { - "name": "unified_authwidget_title_face_fp_forbidden_use_pin", - "value": "Face Recognition and Fingerprint ID disabled. Enter your PIN." - }, - { - "name": "unified_authwidget_title_face_fp_forbidden_use_pattern", - "value": "Face Recognition and Fingerprint ID disabled. Draw your pattern." - }, - { - "name": "unified_authwidget_hint_pin_error", - "value": "Incorrect PIN" - }, - { - "name": "unified_authwidget_use_pwd", - "value": "Enter password" - }, - { - "name": "unified_authwidget_title_face_forbidden", - "value": "Face Recognition disabled." - }, - { - "name": "unified_authwidget_hint_fp_retry_s2", - "value": "Fingerprint not recognized. Press down a little longer." - }, - { - "name": "unified_authwidget_title_fp_forbidden", - "value": "Fingerprint ID disabled." - }, - { - "name": "unified_authwidget_hint_recognition", - "value": "Face Scanning…" - }, - { - "name": "unified_authwidget_title_number_failed_fp_forbidden", - "value": "Excessive failure, fingerprint is disabled" - }, - { - "name": "unified_authwidget_tip_verify_in_portrait_mode", - "value": "Verify in portrait mode" - }, - { - "name": "unified_authwidget_pwd_error_can_try_frequency", - "value": "Password error, can still try %d frequency" - }, - { - "name": "unified_authwidget_pwd_error_can_try", - "value": "Password error, can still try " - }, - { - "name": "unified_authwidget_frequency", - "value": " frequency" - }, - { - "name": "unified_authwidget_many_failures", - "value": "Too many failures, please " - }, - { - "name": "unified_authwidget_pleaseretry", - "value": "Please" - }, - { - "name": "unified_authwidget_postretry", - "value": "retry" - }, - { - "name": "unified_authwidget_hour", - "value": "hour" - }, - { - "name": "unified_authwidget_minutes", - "value": "minutes " - }, - { - "name": "unified_authwidget_seconds", - "value": "seconds " - }, - { - "name": "unified_authwidget_notarize", - "value": "OK" - }, - { - "name": "unified_authwidget_title_number_failed_face_forbidden", - "value": "Excessive failure, face is disabled" - } - ] -} \ No newline at end of file diff --git a/entry/src/ohosTest/resources/zh_CN/element/string.json b/entry/src/ohosTest/resources/zh_CN/element/string.json deleted file mode 100644 index ba2baf2609380349f3cad1aaa2f77e9b179554d7..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/resources/zh_CN/element/string.json +++ /dev/null @@ -1,216 +0,0 @@ -{ - "string": [ - { - "name": "module_test_desc", - "value": "测试模块描述" - }, - { - "name": "TestAbility_desc", - "value": "the test ability" - }, - { - "name": "TestAbility_label", - "value": "test label" - }, - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "AuthWidget" - }, - { - "name": "unified_authwidget_forgotpwd", - "value": "忘记密码" - }, - { - "name": "unified_authwidget_locked", - "value": "已锁定" - }, - { - "name": "unified_authwidget_confirm", - "value": "确定" - }, - { - "name": "unified_authwidget_cancel", - "value": "取消" - }, - { - "name": "unified_authwidget_delete", - "value": "删除" - }, - { - "name": "unified_authwidget_back", - "value": "返回" - }, - { - "name": "unified_authwidget_usepwd", - "value": "使用密码" - }, - { - "name": "unified_authwidget_hint_pwd_error", - "value": "密码错误" - }, - { - "name": "fingerprint_matching_failed", - "value": "指纹匹配失败" - }, - { - "name": "unified_authwidget_hint_inscreen_fp", - "value": "请按压屏内指纹感应区验证指纹" - }, - { - "name": "unified_authwidget_hint_normal_fp_only", - "value": "请轻触感应器验证指纹" - }, - { - "name": "unified_authwidget_hint_fp_verify_success", - "value": "指纹识别成功" - }, - { - "name": "unified_authwidget_hint_fp_retry_s1", - "value": "指纹不匹配,请保持手指和感应器清洁" - }, - { - "name": "unified_authwidget_title_fp_forbidden_enter_pwd", - "value": "指纹已禁用,请输入密码" - }, - { - "name": "unified_authwidget_title_fp_forbidden_enter_pin", - "value": "指纹已禁用,请输入密码" - }, - { - "name": "unified_authwidget_title_fp_forbidden_use_face_pattern", - "value": "指纹已禁用,请使用人脸或图案" - }, - { - "name": "unified_authwidget_title_fp_forbidden_use_face_pwd", - "value": "指纹已禁用,请使用人脸或密码" - }, - { - "name": "unified_authwidget_title_fp_forbidden_use_face_pin", - "value": "指纹已禁用,请使用人脸或密码" - }, - { - "name": "unified_authwidget_hint_recognizing", - "value": "正在识别中" - }, - { - "name": "unified_authwidget_hint_recognize_success", - "value": "人脸识别成功" - }, - { - "name": "unified_authwidget_hint_face_verify_fail_click_retry_s1", - "value": "未识别成功,点击此处重试" - }, - { - "name": "unified_authwidget_hint_face_verify_fail_click_retry_s2", - "value": "未识别成功,双击屏幕重试" - }, - { - "name": "unified_authwidget_title_face_forbidden_use_pwd", - "value": "人脸已禁用,请输入密码" - }, - { - "name": "unified_authwidget_title_face_forbidden_use_pin", - "value": "人脸已禁用,请输入密码" - }, - { - "name": "unified_authwidget_title_face_forbidden_use_fp_pwd", - "value": "人脸已禁用,请使用指纹或密码" - }, - { - "name": "unified_authwidget_title_face_fp_forbidden_use_pwd", - "value": "人脸和指纹已禁用,请输入密码" - }, - { - "name": "unified_authwidget_title_face_fp_forbidden_use_pin", - "value": "人脸和指纹已禁用,请输入密码" - }, - { - "name": "unified_authwidget_title_face_fp_forbidden_use_pattern", - "value": "人脸和指纹已禁用,请绘制图案" - }, - { - "name": "unified_authwidget_hint_pin_error", - "value": "密码错误" - }, - { - "name": "unified_authwidget_use_pwd", - "value": "请输入密码" - }, - { - "name": "unified_authwidget_title_face_forbidden", - "value": "人脸已禁用" - }, - { - "name": "unified_authwidget_hint_fp_retry_s2", - "value": "指纹不匹配,请稍许用力并适当停留" - }, - { - "name": "unified_authwidget_title_fp_forbidden", - "value": "指纹已禁用" - }, - { - "name": "unified_authwidget_hint_recognition", - "value": "人脸识别中" - }, - { - "name": "unified_authwidget_title_number_failed_fp_forbidden", - "value": "失败次数过多,指纹已禁用" - }, - { - "name": "unified_authwidget_tip_verify_in_portrait_mode", - "value": "请在竖屏状态下进行验证" - }, - { - "name": "unified_authwidget_pwd_error_can_try_frequency", - "value": "密码错误,还可尝试%d次" - }, - { - "name": "unified_authwidget_pwd_error_can_try", - "value": "密码错误,还可尝试" - }, - { - "name": "unified_authwidget_frequency", - "value": "次" - }, - { - "name": "unified_authwidget_many_failures", - "value": "失败次数过多,请" - }, - { - "name": "unified_authwidget_pleaseretry", - "value": "请" - }, - { - "name": "unified_authwidget_postretry", - "value": "后重试" - }, - { - "name": "unified_authwidget_hour", - "value": "小时" - }, - { - "name": "unified_authwidget_minutes", - "value": "分钟" - }, - { - "name": "unified_authwidget_seconds", - "value": "秒" - }, - { - "name": "unified_authwidget_notarize", - "value": "确认" - }, - { - "name": "unified_authwidget_title_number_failed_face_forbidden", - "value": "失败次数过多,人脸已禁用" - } - ] -} \ No newline at end of file