diff --git a/src/utilities.cpp b/src/utilities.cpp index 2ba0d68fb3b365d7259906ebbe30c1ec76cdb2c4..b6b1592765e628ec45da6d6a609d1b567387e81a 100644 --- a/src/utilities.cpp +++ b/src/utilities.cpp @@ -872,6 +872,10 @@ bool IsApplicationEncryped(const int pid) 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, 1, "bundleName is empty,pid is %d", pid); + auto pos = bundleName.find(":"); + if (pos != std::string::npos) { + bundleName = bundleName.substr(0, pos); + } sptr sam = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); CHECK_TRUE(sam == nullptr, false, LOG_TYPE_PRINTF, "GetSystemAbilityManager failed!\n"); sptr remoteObject = sam->GetSystemAbility(BUNDLE_MGR_SERVICE_SYS_ABILITY_ID);