diff --git a/interfaces/innerkits/appverify/include/interfaces/hap_verify.h b/interfaces/innerkits/appverify/include/interfaces/hap_verify.h index 8db68e150b0ff1a49b651a30597d57329b42c84a..3240eac6ba31dd60f7824e979d179e413210a01a 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 e59038af778b88128ac82cc74f779756c1e3c6fb..b79f5ddf3b09ba238495ca17a9171e685c29cb8f 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()) {