From 4d60f96b151491479bdd2551a20cecc0ef9b811b Mon Sep 17 00:00:00 2001 From: shilei Date: Wed, 21 Sep 2022 11:11:26 +0800 Subject: [PATCH] sync code t monthly0816 Signed-off-by: shilei --- .../appverify/include/interfaces/hap_verify.h | 1 + .../innerkits/appverify/src/interfaces/hap_verify.cpp | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/interfaces/innerkits/appverify/include/interfaces/hap_verify.h b/interfaces/innerkits/appverify/include/interfaces/hap_verify.h index 8db68e1..3240eac 100644 --- a/interfaces/innerkits/appverify/include/interfaces/hap_verify.h +++ b/interfaces/innerkits/appverify/include/interfaces/hap_verify.h @@ -24,6 +24,7 @@ namespace OHOS { namespace Security { namespace Verify { DLL_EXPORT bool EnableDebugMode(); +DLL_EXPORT void DisableDebugMode(); DLL_EXPORT int HapVerify(const std::string& filePath, HapVerifyResult& hapVerifyResult); } // namespace Verify } // namespace Security diff --git a/interfaces/innerkits/appverify/src/interfaces/hap_verify.cpp b/interfaces/innerkits/appverify/src/interfaces/hap_verify.cpp index e59038a..b79f5dd 100644 --- a/interfaces/innerkits/appverify/src/interfaces/hap_verify.cpp +++ b/interfaces/innerkits/appverify/src/interfaces/hap_verify.cpp @@ -64,6 +64,16 @@ bool EnableDebugMode() return ret; } +void DisableDebugMode() +{ + TrustedRootCa& rootCertsObj = TrustedRootCa::GetInstance(); + TrustedSourceManager& trustedAppSourceManager = TrustedSourceManager::GetInstance(); + g_mtx.lock(); + rootCertsObj.DisableDebug(); + trustedAppSourceManager.DisableDebug(); + g_mtx.unlock(); +} + int HapVerify(const std::string& filePath, HapVerifyResult& hapVerifyResult) { if (!g_isInit && !HapVerifyInit()) { -- Gitee