共 4 个文件变更+16-3
@@ -96,6 +96,10 @@ export default class CertPickerUiExtAbility extends UIExtensionAbility {
96 96 
97 onSessionDestroy(): void {97 onSessionDestroy(): void {
98 // Main window is destroyed, release UI related resources98 // Main window is destroyed, release UI related resources
99+ let pwdStore = GlobalContext.getContext().getPwdStore();
100+ if (pwdStore !== undefined) {
101+ pwdStore.clearCertPwd();
102+ }
99 GlobalContext.getContext().clearSession();103 GlobalContext.getContext().clearSession();
100 logger.info('CertPickerUiExtAbility onSessionDestroy');104 logger.info('CertPickerUiExtAbility onSessionDestroy');
101 }105 }
@@ -36,6 +36,9 @@ export class CredentialVo {
36 this.keyUri = '';36 this.keyUri = '';
37 this.certNum = 0;37 this.certNum = 0;
38 this.keyNum = 0;38 this.keyNum = 0;
39+ if (this.credData !== null && this.credData !== undefined) {
40+ this.credData.fill(0);
41+ }
39 this.credData = new Uint8Array();42 this.credData = new Uint8Array();
40 }43 }
41}44}
@@ -61,9 +61,11 @@ export struct DialogComponent {
61 .height($r('app.float.credentials_app_Toggle_hg'))61 .height($r('app.float.credentials_app_Toggle_hg'))
62 .selectedColor($r('app.color.credentials_app_Toggle_selectColor'))62 .selectedColor($r('app.color.credentials_app_Toggle_selectColor'))
63 .onChange((isOn: boolean) => {63 .onChange((isOn: boolean) => {
64- this.uidItem.appInfoList[this.indexNum].status = isOn;64+ if (this.indexNum >= 0 && this.indexNum < this.uidItem.appInfoList.length) {
65- if (!isOn) {65+ this.uidItem.appInfoList[this.indexNum].status = isOn;
66- this.onChanged?.();66+ if (!isOn) {
67+ this.onChanged?.();
68+ }
67 }69 }
68 })70 })
69 .margin({ right: $r('app.float.wh_value_16') })71 .margin({ right: $r('app.float.wh_value_16') })
@@ -148,6 +148,10 @@ export default class CmFaPresenter {
148 }148 }
149 149 
150 startRequestAuth(uri: string): void {150 startRequestAuth(uri: string): void {
151+ if (uri === null || uri === undefined || uri.length === 0) {
152+ logger.error('The uri is invalid');
153+ return;
154+ }
151 let appUidInfo = new RouterAppUidVo(uri);155 let appUidInfo = new RouterAppUidVo(uri);
152 router.pushUrl({156 router.pushUrl({
153 url: 'pages/requestAuth',157 url: 'pages/requestAuth',