SaveLib PR related fixes (#1011)

* Safety checks in all SFO readings

* SaveData: log backup error and continue & fix possible concurrent file editing

* SaveData: Fix issue with old firmwares
This commit is contained in:
Vinicius Rangel
2024-09-22 02:16:06 -03:00
committed by GitHub
parent edde0a3e7e
commit 581ddfec4d
11 changed files with 163 additions and 74 deletions

View File

@@ -4,6 +4,7 @@
#include <cmath>
#include "app_content.h"
#include "common/assert.h"
#include "common/io_file.h"
#include "common/logging/log.h"
#include "common/path_util.h"
@@ -246,7 +247,11 @@ int PS4_SYSV_ABI sceAppContentInitialize(const OrbisAppContentInitParam* initPar
auto* param_sfo = Common::Singleton<PSF>::Instance();
const auto addons_dir = Common::FS::GetUserPath(Common::FS::PathType::AddonsDir);
title_id = *param_sfo->GetString("TITLE_ID");
if (const auto value = param_sfo->GetString("TITLE_ID"); value.has_value()) {
title_id = *value;
} else {
UNREACHABLE_MSG("Failed to get TITLE_ID");
}
auto addon_path = addons_dir / title_id;
if (std::filesystem::exists(addon_path)) {
for (const auto& entry : std::filesystem::directory_iterator(addon_path)) {