diff --git a/interfaces/innerkits/appverify/include/verify/hap_verify_v2.h b/interfaces/innerkits/appverify/include/verify/hap_verify_v2.h index 9b6b993c8e7ece8ef7ea57b0e316cee760f33724..7ee0b30a0acbf2e37586457602d3d511d6752c82 100644 --- a/interfaces/innerkits/appverify/include/verify/hap_verify_v2.h +++ b/interfaces/innerkits/appverify/include/verify/hap_verify_v2.h @@ -58,6 +58,7 @@ private: static const int DIGEST_LEN_OFFSET; static const int DIGEST_OFFSET_IN_CONTENT; static const std::string HAP_APP_PATTERN; + static const std::string HQF_APP_PATTERN; }; } // namespace Verify } // namespace Security diff --git a/interfaces/innerkits/appverify/src/verify/hap_verify_v2.cpp b/interfaces/innerkits/appverify/src/verify/hap_verify_v2.cpp index 2be1572ee68057de94eabe5a0017017179c40e6d..8dd1332cbdd7298657e717e76f753b7d12f05464 100644 --- a/interfaces/innerkits/appverify/src/verify/hap_verify_v2.cpp +++ b/interfaces/innerkits/appverify/src/verify/hap_verify_v2.cpp @@ -38,6 +38,7 @@ const int HapVerifyV2::DIGEST_ALGORITHM_OFFSET = 12; const int HapVerifyV2::DIGEST_LEN_OFFSET = 16; const int HapVerifyV2::DIGEST_OFFSET_IN_CONTENT = 20; const std::string HapVerifyV2::HAP_APP_PATTERN = "[^]*.hap$"; +const std::string HapVerifyV2::HQF_APP_PATTERN = "[^]*.hqf$"; int HapVerifyV2::Verify(const std::string& filePath, HapVerifyResult& hapVerifyV1Result) { @@ -65,8 +66,9 @@ bool HapVerifyV2::CheckFilePath(const std::string& filePath, std::string& standa return false; } standardFilePath = std::string(path); - if (!std::regex_match(standardFilePath, std::regex(HAP_APP_PATTERN))) { - HAPVERIFY_LOG_ERROR(LABEL, "file is not hap package"); + if (!std::regex_match(standardFilePath, std::regex(HAP_APP_PATTERN)) && + !std::regex_match(standardFilePath, std::regex(HQF_APP_PATTERN))) { + HAPVERIFY_LOG_ERROR(LABEL, "file is not hap or hqf package"); return false; } return true;