diff --git a/Privacy/privacy/src/main/ets/pages/Cybersecurity.cpp b/Privacy/privacy/src/main/ets/pages/Cybersecurity.cpp index a35854af6a66d1373a892923d3aa7c962061741e..34acd71e5e9e8511bfa83c7228dc7574b842cd3e 100644 --- a/Privacy/privacy/src/main/ets/pages/Cybersecurity.cpp +++ b/Privacy/privacy/src/main/ets/pages/Cybersecurity.cpp @@ -18,7 +18,7 @@ * 场景一:配置信任系统预置的CA证书 */ // [Start cybersecurity_ca] -curl_easy_setopt( curl, CURLOPT_CATH, "/etc/security/certificates"); +curl_easy_setopt(curl, CURLOPT_CATH, "/etc/security/certificates"); // [End cybersecurity_ca] /** diff --git a/Privacy/privacy/src/main/ets/pages/NetworkTrust.ets b/Privacy/privacy/src/main/ets/pages/NetworkTrust.ets index 8792e61189a9438761c6225d23cb163e62d3bf07..dad031fd772642bae0900077d99b435f5f973d7f 100644 --- a/Privacy/privacy/src/main/ets/pages/NetworkTrust.ets +++ b/Privacy/privacy/src/main/ets/pages/NetworkTrust.ets @@ -44,7 +44,7 @@ httpRequest.request( 'EXAMPLE_URL', { // [Start cybersecurity_rcp_trusting_ca] const caPath: rcp.CertificateAuthority = { - folderPath: '/data/storage/el1/bundle/entry/resources/resfile/appCaCert', // 指定信任的CA证书路径 + folderPath: '/data/storage/el1/bundle/entry/resources/resfile/appCaCert', // Specify trusted CA certificate path } const securityConfig: rcp.SecurityConfiguration = { remoteValidation: caPath diff --git a/Privacy/privacy/src/main/ets/pages/PrivacyMode.ets b/Privacy/privacy/src/main/ets/pages/PrivacyMode.ets index 18b00e010ff1d6be634731503025fca6cb03c747..abfdf7632a581181da5e9024b4919bb55e06726c 100644 --- a/Privacy/privacy/src/main/ets/pages/PrivacyMode.ets +++ b/Privacy/privacy/src/main/ets/pages/PrivacyMode.ets @@ -18,7 +18,9 @@ * 场景七:避免涉及口令输入的应用界面可以被截屏或录屏 */ // [Start privacy_mode] -import { router, window } from '@kit.ArkUI'; +import { window } from '@kit.ArkUI'; +import { BusinessError } from '@kit.BasicServicesKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; @Entry @Component @@ -28,11 +30,15 @@ struct Index { onPageShow(): void { window.getLastWindow(this.getUIContext().getHostContext()).then((windowStage: window.Window) => { windowStage.setWindowPrivacyMode(true); + }).catch((error: BusinessError) => { + hilog.error(0x0000, 'PrivacyMode', `getLastWindow error code ${error.code}`) }); } onPageHide(): void { window.getLastWindow(this.getUIContext().getHostContext()).then((windowStage: window.Window) => { windowStage.setWindowPrivacyMode(false); + }).catch((error: BusinessError) => { + hilog.error(0x0000, 'PrivacyMode', `getLastWindow error code ${error.code}`) }); } build() {