From 3515be11a3ff0ab6d3aeabcc1c25c24374e71de9 Mon Sep 17 00:00:00 2001 From: "1362134550@qq.com" <1362134550@qq.com> Date: Tue, 2 Sep 2025 10:15:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=80=E4=BD=B3=E5=AE=9E=E8=B7=B5=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Privacy/privacy/src/main/ets/pages/Cybersecurity.cpp | 2 +- Privacy/privacy/src/main/ets/pages/NetworkTrust.ets | 2 +- Privacy/privacy/src/main/ets/pages/PrivacyMode.ets | 8 +++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Privacy/privacy/src/main/ets/pages/Cybersecurity.cpp b/Privacy/privacy/src/main/ets/pages/Cybersecurity.cpp index a35854af..34acd71e 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 8792e611..dad031fd 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 18b00e01..abfdf763 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() { -- Gitee