mirror of
https://github.com/HamletDuFromage/aio-switch-updater.git
synced 2024-11-09 20:11:48 +00:00
change way to identify cfw
This commit is contained in:
parent
deae6b2c8e
commit
d01eab304b
5 changed files with 22 additions and 4 deletions
|
@ -3,5 +3,6 @@
|
|||
#include "constants.hpp"
|
||||
|
||||
bool isServiceRunning(const char *serviceName);
|
||||
Result smAtmosphereHasService(bool *out, SmServiceName name);
|
||||
CFW getCFW();
|
||||
const extern CFW running_cfw;
|
|
@ -77,6 +77,7 @@
|
|||
"v2_3_1_text": "\uE016 Files for batch copy are now copied according to the json order (formerly alphabetical order).",
|
||||
"v2_3_2_text": "\uE016 Fixed batch copy not copying :^)",
|
||||
"v2_3_3_text": "\uE016 Hide unsupported features for Mariko Switches",
|
||||
"v2_3_4_text": "\uE016 Minor fixes, refactored old switch-cheats updater code and changed way to detect CFW",
|
||||
"Ok_button": "Ok",
|
||||
|
||||
"cheats_page.cpp":"",
|
||||
|
|
|
@ -112,6 +112,9 @@ ChangelogPage::ChangelogPage() : AppletFrame(true, true)
|
|||
verTitles.push_back("v2.3.3");
|
||||
changes.push_back("menus/v2_3_3_text"_i18n );
|
||||
|
||||
verTitles.push_back("v2.3.4");
|
||||
changes.push_back("menus/v2_3_4_text"_i18n );
|
||||
|
||||
for(int i = verTitles.size() -1 ; i >= 0; i--){
|
||||
listItem = new brls::ListItem(verTitles[i]);
|
||||
change = changes[i];
|
||||
|
|
|
@ -12,8 +12,21 @@ bool isServiceRunning(const char *serviceName) {
|
|||
return running;
|
||||
};
|
||||
|
||||
Result smAtmosphereHasService(bool *out, SmServiceName name) {
|
||||
u8 tmp = 0;
|
||||
Result rc = serviceDispatchInOut(smGetServiceSession(), 65100, name, tmp);
|
||||
if (R_SUCCEEDED(rc) && out)
|
||||
*out = tmp;
|
||||
return rc;
|
||||
}
|
||||
|
||||
CFW getCFW(){
|
||||
if(isServiceRunning("rnx")) return rnx;
|
||||
else if(isServiceRunning("tx")) return sxos;
|
||||
else return ams;
|
||||
bool res = false;
|
||||
smAtmosphereHasService(&res, (SmServiceName) {"rnx"});
|
||||
if(res)
|
||||
return rnx;
|
||||
smAtmosphereHasService(&res, (SmServiceName) {"tx"});
|
||||
if(res)
|
||||
return sxos;
|
||||
return ams;
|
||||
};
|
|
@ -221,7 +221,7 @@ void DownloadCheatsPage::WriteCheats(uint64_t tid, std::string bid, std::string
|
|||
path += bid + ".txt";
|
||||
std::ofstream cheatFile;
|
||||
cheatFile.open(path, std::ios::app);
|
||||
cheatFile << "\n" << cheatContent;
|
||||
cheatFile << "\n\n" << cheatContent;
|
||||
std::ofstream updated;
|
||||
updated.open(UPDATED_TITLES_PATH, std::ios::app);
|
||||
updated << "\n" << tidstr;
|
||||
|
|
Loading…
Reference in a new issue