From 4f4f4b294fb4509350a53aa55025d4bdec2bbc6c Mon Sep 17 00:00:00 2001 From: Huntereb Date: Thu, 12 Dec 2019 12:36:10 -0500 Subject: [PATCH] gkey can be set in config --- include/util/config.hpp | 2 +- source/util/config.cpp | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/util/config.hpp b/include/util/config.hpp index 25303ca..ea4df2c 100755 --- a/include/util/config.hpp +++ b/include/util/config.hpp @@ -4,9 +4,9 @@ namespace inst::config { static const std::string appDir = "sdmc:/switch/Awoo-Installer"; static const std::string configPath = appDir + "/config.ini"; static const std::string appVersion = "1.2.2"; - static const std::string gAuthKey = {0x41,0x49,0x7a,0x61,0x53,0x79,0x42,0x4d,0x71,0x76,0x34,0x64,0x58,0x6e,0x54,0x4a,0x4f,0x47,0x51,0x74,0x5a,0x5a,0x53,0x33,0x43,0x42,0x6a,0x76,0x66,0x37,0x34,0x38,0x51,0x76,0x78,0x53,0x7a,0x46,0x30}; extern std::string sigPatchesUrl; + extern std::string gAuthKey; extern bool ignoreReqVers; extern bool validateNCAs; extern bool overClock; diff --git a/source/util/config.cpp b/source/util/config.cpp index 99deead..53c71b8 100755 --- a/source/util/config.cpp +++ b/source/util/config.cpp @@ -5,8 +5,9 @@ #include "util/config.hpp" namespace inst::config { - static const char* configBase = "[settings]\nignoreReqVers=%d\nvalidateNCAs=%d\noverClock=%d\ndeletePrompt=%d\ngayMode=%d\nsigPatchesUrl=%s\nusbAck=%d"; + static const char* configBase = "[settings]\nignoreReqVers=%d\nvalidateNCAs=%d\noverClock=%d\ndeletePrompt=%d\ngayMode=%d\nsigPatchesUrl=%s\ngAuthKey=%s\nusbAck=%d"; std::string sigPatchesUrl; + std::string gAuthKey; bool ignoreReqVers; bool validateNCAs; bool overClock; @@ -22,14 +23,15 @@ namespace inst::config { deletePrompt = reader.GetBoolean("settings", "deletePrompt", true); gayMode = reader.GetBoolean("settings", "gayMode", false); sigPatchesUrl = reader.GetString("settings", "sigPatchesUrl", "https://github.com/Huntereb/Awoo-Installer/releases/download/SignaturePatches/patches.zip"); + gAuthKey = reader.GetString("settings", "gAuthKey", {0x41,0x49,0x7a,0x61,0x53,0x79,0x42,0x4d,0x71,0x76,0x34,0x64,0x58,0x6e,0x54,0x4a,0x4f,0x47,0x51,0x74,0x5a,0x5a,0x53,0x33,0x43,0x42,0x6a,0x76,0x66,0x37,0x34,0x38,0x51,0x76,0x78,0x53,0x7a,0x46,0x30}); usbAck = reader.GetBoolean("settings", "usbAck", false); return; } void setConfig() { std::filesystem::remove(inst::config::configPath); - char data[96 + sigPatchesUrl.size()]; - sprintf(data, configBase, ignoreReqVers, validateNCAs, overClock, deletePrompt, gayMode, sigPatchesUrl.c_str(), usbAck); + char data[106 + sigPatchesUrl.size() + gAuthKey.size()]; + sprintf(data, configBase, ignoreReqVers, validateNCAs, overClock, deletePrompt, gayMode, sigPatchesUrl.c_str(), gAuthKey.c_str(), usbAck); FILE * configFile = fopen(inst::config::configPath.c_str(), "w"); fwrite(data, sizeof(char), strlen(data), configFile); fflush(configFile);