1
0
Fork 0
mirror of https://github.com/HamletDuFromage/aio-switch-updater.git synced 2024-11-10 04:21:44 +00:00

add backup method to detect cfw

This commit is contained in:
flb 2021-02-25 22:05:47 +01:00
parent b2f662fb00
commit 4a76e4e9bf

View file

@ -22,11 +22,16 @@ Result smAtmosphereHasService(bool *out, SmServiceName name) {
CFW getCFW(){
bool res = false;
smAtmosphereHasService(&res, (SmServiceName) {"rnx"});
if(R_SUCCEEDED(smAtmosphereHasService(&res, smEncodeName("rnx")))) {
if(res)
return rnx;
smAtmosphereHasService(&res, (SmServiceName) {"tx"});
smAtmosphereHasService(&res, smEncodeName("tx"));
if(res)
return sxos;
}
else { // use old method just in case
if(isServiceRunning("rnx")) return rnx;
else if(isServiceRunning("tx")) return sxos;
}
return ams;
};