diff --git a/services/bundlemgr_lite/src/bundle_manager_service.cpp b/services/bundlemgr_lite/src/bundle_manager_service.cpp index bb81de6..f72805e 100644 --- a/services/bundlemgr_lite/src/bundle_manager_service.cpp +++ b/services/bundlemgr_lite/src/bundle_manager_service.cpp @@ -648,8 +648,7 @@ uint32_t ManagerService::GetBundleSize(const char *bundleName) std::string ManagerService::GetCodeDirPath() const { if (installer_ == nullptr) { - std::string codeDirPath; - return codeDirPath; + return ""; } return installer_->GetCodeDirPath(); } @@ -657,8 +656,7 @@ std::string ManagerService::GetCodeDirPath() const std::string ManagerService::GetDataDirPath() const { if (installer_ == nullptr) { - std::string dataDirPath; - return dataDirPath; + return ""; } return installer_->GetDataDirPath(); } diff --git a/services/bundlemgr_lite/src/gt_bundle_manager_service.cpp b/services/bundlemgr_lite/src/gt_bundle_manager_service.cpp index f83af62..4b00319 100755 --- a/services/bundlemgr_lite/src/gt_bundle_manager_service.cpp +++ b/services/bundlemgr_lite/src/gt_bundle_manager_service.cpp @@ -320,17 +320,17 @@ void GtManagerService::InstallAllSystemBundle(InstallerCallback installerCallbac if (currentNode == nullptr) { return; } - if ((strcmp((reinterpret_cast(currentNode))->filePath, ".") == 0) || - (strcmp((reinterpret_cast(currentNode))->filePath, "..") == 0)) { + if ((strcmp(((AppInfoList *)currentNode)->filePath, ".") == 0) || + (strcmp(((AppInfoList *)currentNode)->filePath, "..") == 0)) { continue; } - if (!BundleUtil::IsFile((reinterpret_cast(currentNode))->filePath) || - !BundleUtil::EndWith((reinterpret_cast(currentNode))->filePath, INSTALL_FILE_SUFFIX)) { + if (!BundleUtil::IsFile(((AppInfoList *)currentNode)->filePath) || + !BundleUtil::EndWith(((AppInfoList *)currentNode)->filePath, INSTALL_FILE_SUFFIX)) { GtManagerService::APP_FreeAllAppInfo(list); return; } - (void) Install((reinterpret_cast(currentNode))->filePath, nullptr, installerCallback); + (void) Install(((AppInfoList *)currentNode)->filePath, nullptr, installerCallback); } GtManagerService::APP_FreeAllAppInfo(list); } @@ -441,21 +441,21 @@ void GtManagerService::ScanSystemApp(const cJSON *uninstallRecord, List(currentNode))->filePath, ".") == 0) || - (strcmp((reinterpret_cast(currentNode))->filePath, "..") == 0)) { + if ((strcmp(((AppInfoList *)currentNode)->filePath, ".") == 0) || + (strcmp(((AppInfoList *)currentNode)->filePath, "..") == 0)) { continue; } - if (BundleUtil::StartWith((reinterpret_cast(currentNode))->filePath, SYSTEM_BUNDLE_PATH)) { + if (BundleUtil::StartWith(((AppInfoList *)currentNode)->filePath, SYSTEM_BUNDLE_PATH)) { scanFlag = SYSTEM_APP_FLAG; - } else if (BundleUtil::StartWith((reinterpret_cast(currentNode))->filePath, THIRD_SYSTEM_BUNDLE_PATH)) { + } else if (BundleUtil::StartWith(((AppInfoList *)currentNode)->filePath, THIRD_SYSTEM_BUNDLE_PATH)) { scanFlag = THIRD_SYSTEM_APP_FLAG; } else { continue; // skip third app } // scan system app - bool res = CheckSystemBundleIsValid((reinterpret_cast(currentNode))->filePath, &bundleName, versionCode); + bool res = CheckSystemBundleIsValid(((AppInfoList *)currentNode)->filePath, &bundleName, versionCode); if (!res) { APP_ERRCODE_EXTRA(EXCE_ACE_APP_SCAN, EXCE_ACE_APP_SCAN_INVALID_SYSTEM_APP); AdapterFree(bundleName); @@ -469,7 +469,7 @@ void GtManagerService::ScanSystemApp(const cJSON *uninstallRecord, List(currentNode))->filePath, bundleName, + ReloadEntireBundleInfo(((AppInfoList *)currentNode)->filePath, bundleName, systemPathList, versionCode, scanFlag); AdapterFree(bundleName); } @@ -979,7 +979,7 @@ int32_t GtManagerService::ReportUninstallCallback(uint8_t errCode, uint8_t insta AppInfoList *GtManagerService::APP_InitAllAppInfo() { - AppInfoList *list = reinterpret_cast(AdapterMalloc(sizeof(AppInfoList))); + AppInfoList *list = (AppInfoList *)AdapterMalloc(sizeof(AppInfoList)); if (list == nullptr) { return nullptr; } @@ -1054,7 +1054,7 @@ void GtManagerService::APP_InsertAppInfo(char *filePath, AppInfoList *list) return; } - AppInfoList *app = reinterpret_cast(AdapterMalloc(sizeof(AppInfoList))); + AppInfoList *app = (AppInfoList *)AdapterMalloc(sizeof(AppInfoList)); if (app == nullptr) { return; } @@ -1110,7 +1110,7 @@ void SetCurrentBundle(const char *name) } int len = strlen(name); - g_currentBundle = static_cast(AdapterMalloc(len + 1)); + g_currentBundle = (char *)AdapterMalloc(len + 1); if (g_currentBundle == nullptr || strncpy_s(g_currentBundle, len + 1, name, len) < 0) { AdapterFree(g_currentBundle); } @@ -1126,7 +1126,7 @@ const char *GetCurrentBundle() } int len = strlen(g_currentBundle); - char *bundleName = static_cast(AdapterMalloc(len + 1)); + char *bundleName = (char *)AdapterMalloc(len + 1); if (bundleName == nullptr || strncpy_s(bundleName, len + 1, g_currentBundle, len) < 0) { AdapterFree(bundleName); MutexRelease(&g_currentBundleMutex);