JS symbol parse

Signed-off-by: yuyanqinghw <yuyanqing539@huawei.com>
This commit is contained in:
yuyanqinghw 2024-08-25 15:01:36 +08:00
parent afb6a65c93
commit 1ffe995a15
3 changed files with 4 additions and 4 deletions

View File

@ -343,7 +343,7 @@ bool IsArkJsFile(const std::string& filepath);
std::string GetProcessName(int pid);
bool NeedAdaptSandboxPath(char *filename, int pid, u16 &headerSize);
bool NeedAdaptHMBundlePath(std::string& filename, const std::string& threadname);
bool checkApplicationEncryped(int pid);
bool IsApplicationEncryped(const int pid);
template <typename Func>
class ScopeGuard {

View File

@ -906,7 +906,7 @@ public:
}
hapExtracted_ = true;
HLOGD("the symbol file is %s, pid is %d.", filePath_.c_str(), pid_);
if (checkApplicationEncryped(pid_)) {
if (IsApplicationEncryped(pid_)) {
HLOGD("no need to parse js symbols");
return false;
}

View File

@ -842,12 +842,12 @@ bool IsHiviewCall()
#endif
}
bool checkApplicationEncryped(int pid)
bool IsApplicationEncryped(const int pid)
{
#if defined(is_ohos) && is_ohos && defined(BUNDLE_FRAMEWORK_ENABLE)
CHECK_TRUE(pid <= 0, false, LOG_TYPE_PRINTF, "Invalid -p value '%d', the pid should be larger than 0\n", pid);
std::string bundleName = GetProcessName(pid);
CHECK_TRUE(bundleName.empty(), false, LOG_TYPE_PRINTF, "bundleName is empty!\n");
CHECK_TRUE(bundleName.empty(), false, 1, "bundleName is empty,pid is %d", pid);
sptr<ISystemAbilityManager> sam = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager();
CHECK_TRUE(sam == nullptr, false, LOG_TYPE_PRINTF, "GetSystemAbilityManager failed!\n");
sptr<IRemoteObject> remoteObject = sam->GetSystemAbility(BUNDLE_MGR_SERVICE_SYS_ABILITY_ID);