1
0
Fork 0
mirror of https://github.com/HamletDuFromage/aio-switch-updater.git synced 2024-12-01 05:42:02 +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(){ CFW getCFW(){
bool res = false; bool res = false;
smAtmosphereHasService(&res, (SmServiceName) {"rnx"}); if(R_SUCCEEDED(smAtmosphereHasService(&res, smEncodeName("rnx")))) {
if(res) if(res)
return rnx; return rnx;
smAtmosphereHasService(&res, (SmServiceName) {"tx"}); smAtmosphereHasService(&res, smEncodeName("tx"));
if(res) if(res)
return sxos; return sxos;
}
else { // use old method just in case
if(isServiceRunning("rnx")) return rnx;
else if(isServiceRunning("tx")) return sxos;
}
return ams; return ams;
}; };