mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-20 10:24:58 +00:00
Storing encryption trophy key in config.toml (#1930)
* get trophy key from toml file * clang format fix * get trophy key from toml file * clang format fix * merge fixes * Update config.cpp
This commit is contained in:
parent
d69341fd31
commit
283442b42f
3 changed files with 33 additions and 0 deletions
|
@ -67,6 +67,7 @@ static int cursorHideTimeout = 5; // 5 seconds (default)
|
|||
static bool separateupdatefolder = false;
|
||||
static bool compatibilityData = false;
|
||||
static bool checkCompatibilityOnStartup = false;
|
||||
static std::string trophyKey = "";
|
||||
|
||||
// Gui
|
||||
std::vector<std::filesystem::path> settings_install_dirs = {};
|
||||
|
@ -91,6 +92,14 @@ std::string emulator_language = "en";
|
|||
// Language
|
||||
u32 m_language = 1; // english
|
||||
|
||||
std::string getTrophyKey() {
|
||||
return trophyKey;
|
||||
}
|
||||
|
||||
void setTrophyKey(std::string key) {
|
||||
trophyKey = key;
|
||||
}
|
||||
|
||||
bool isNeoMode() {
|
||||
return isNeo;
|
||||
}
|
||||
|
@ -652,6 +661,11 @@ void load(const std::filesystem::path& path) {
|
|||
|
||||
m_language = toml::find_or<int>(settings, "consoleLanguage", 1);
|
||||
}
|
||||
|
||||
if (data.contains("Keys")) {
|
||||
const toml::value& keys = data.at("Keys");
|
||||
trophyKey = toml::find_or<std::string>(keys, "TrophyKey", "");
|
||||
}
|
||||
}
|
||||
|
||||
void save(const std::filesystem::path& path) {
|
||||
|
@ -712,6 +726,8 @@ void save(const std::filesystem::path& path) {
|
|||
data["Debug"]["DebugDump"] = isDebugDump;
|
||||
data["Debug"]["CollectShader"] = isShaderDebug;
|
||||
|
||||
data["Keys"]["TrophyKey"] = trophyKey;
|
||||
|
||||
std::vector<std::string> install_dirs;
|
||||
for (const auto& dirString : settings_install_dirs) {
|
||||
install_dirs.emplace_back(std::string{fmt::UTF(dirString.u8string()).data});
|
||||
|
|
|
@ -15,6 +15,9 @@ void load(const std::filesystem::path& path);
|
|||
void save(const std::filesystem::path& path);
|
||||
void saveMainWindow(const std::filesystem::path& path);
|
||||
|
||||
std::string getTrophyKey();
|
||||
void setTrophyKey(std::string key);
|
||||
|
||||
bool isNeoMode();
|
||||
bool isFullscreenMode();
|
||||
bool getPlayBGM();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue