diff --git a/interfaces/innerkits/appverify/include/interfaces/hap_verify.h b/interfaces/innerkits/appverify/include/interfaces/hap_verify.h index 919767509dd4fbf85ee8a344dda8e4da19f4a0d0..c7752913832ef0a262b86e09a5976aea1f22b3e1 100644 --- a/interfaces/innerkits/appverify/include/interfaces/hap_verify.h +++ b/interfaces/innerkits/appverify/include/interfaces/hap_verify.h @@ -27,7 +27,8 @@ namespace Verify { DLL_EXPORT bool EnableDebugMode(); DLL_EXPORT void DisableDebugMode(); DLL_EXPORT int32_t HapVerify(const std::string& filePath, HapVerifyResult& hapVerifyResult, bool readFile = false); -DLL_EXPORT int32_t ParseHapProfile(const std::string& filePath, HapVerifyResult& hapVerifyV1Result); +DLL_EXPORT int32_t ParseHapProfile(const std::string& filePath, HapVerifyResult& hapVerifyV1Result, + bool readFile = false); DLL_EXPORT int32_t ParseHapSignatureInfo(const std::string& filePath, SignatureInfo &hapSignInfo); extern "C" DLL_EXPORT int32_t ParseBundleNameAndAppIdentifier(const int32_t fileFd, std::string &bundleName, std::string &appIdentifier); diff --git a/interfaces/innerkits/appverify/include/verify/hap_verify_v2.h b/interfaces/innerkits/appverify/include/verify/hap_verify_v2.h index c2aabbb24bdd04564239a44417585c86d42b0b3f..bbac732007c0720a32ecb05f646deaea4dc5957c 100644 --- a/interfaces/innerkits/appverify/include/verify/hap_verify_v2.h +++ b/interfaces/innerkits/appverify/include/verify/hap_verify_v2.h @@ -31,7 +31,7 @@ class HapVerifyV2 { public: int32_t Verify(const std::string& filePath, HapVerifyResult& hapVerifyV1Result, bool readFile = false); int32_t Verify(const int32_t fileFd, HapVerifyResult& hapVerifyV1Result); - int32_t ParseHapProfile(const std::string& filePath, HapVerifyResult& hapVerifyV1Result); + int32_t ParseHapProfile(const std::string& filePath, HapVerifyResult& hapVerifyV1Result, bool readFile = false); int32_t ParseHapSignatureInfo(const std::string& filePath, SignatureInfo &hapSignInfo); private: diff --git a/interfaces/innerkits/appverify/src/interfaces/hap_verify.cpp b/interfaces/innerkits/appverify/src/interfaces/hap_verify.cpp index e0b3bed915835087f8d523f7f1a9039f8c67afa7..9d366ff540cf7459e3a14675855efa698130bf23 100644 --- a/interfaces/innerkits/appverify/src/interfaces/hap_verify.cpp +++ b/interfaces/innerkits/appverify/src/interfaces/hap_verify.cpp @@ -93,10 +93,10 @@ int32_t HapVerify(const std::string& filePath, HapVerifyResult& hapVerifyResult, return hapVerifyV2.Verify(filePath, hapVerifyResult, readFile); } -int32_t ParseHapProfile(const std::string& filePath, HapVerifyResult& hapVerifyV1Result) +int32_t ParseHapProfile(const std::string& filePath, HapVerifyResult& hapVerifyV1Result, bool readFile) { HapVerifyV2 hapVerifyV2; - return hapVerifyV2.ParseHapProfile(filePath, hapVerifyV1Result); + return hapVerifyV2.ParseHapProfile(filePath, hapVerifyV1Result, readFile); } int32_t ParseHapSignatureInfo(const std::string& filePath, SignatureInfo &hapSignInfo) diff --git a/interfaces/innerkits/appverify/src/verify/hap_verify_v2.cpp b/interfaces/innerkits/appverify/src/verify/hap_verify_v2.cpp index a1193f8f1c24c60111a6bcd4338630fb55caf089..06a4c09096300a7c5d1141f621c8810686ecbf9e 100644 --- a/interfaces/innerkits/appverify/src/verify/hap_verify_v2.cpp +++ b/interfaces/innerkits/appverify/src/verify/hap_verify_v2.cpp @@ -439,7 +439,7 @@ bool HapVerifyV2::GetDigestAndAlgorithm(Pkcs7Context& digest) return true; } -int32_t HapVerifyV2::ParseHapProfile(const std::string& filePath, HapVerifyResult& hapVerifyV1Result) +int32_t HapVerifyV2::ParseHapProfile(const std::string& filePath, HapVerifyResult& hapVerifyV1Result, bool readFile) { HAPVERIFY_LOG_INFO("start to ParseHapProfile"); std::string standardFilePath; @@ -448,7 +448,7 @@ int32_t HapVerifyV2::ParseHapProfile(const std::string& filePath, HapVerifyResul } RandomAccessFile hapFile; - if (!hapFile.Init(standardFilePath)) { + if (!hapFile.Init(standardFilePath, readFile)) { HAPVERIFY_LOG_ERROR("open standard file failed"); return OPEN_FILE_ERROR; }