1
0
Fork 0
mirror of https://github.com/HamletDuFromage/aio-switch-updater.git synced 2024-12-02 22:32:04 +00:00
AIO-switch-updater/source/current_cfw.cpp

19 lines
544 B
C++
Raw Normal View History

2021-02-10 16:28:47 +00:00
#include "current_cfw.hpp"
#include <switch.h>
bool isServiceRunning(const char *serviceName) {
Handle handle;
SmServiceName service_name = smEncodeName(serviceName);
bool running = R_FAILED(smRegisterService(&handle, service_name, false, 1));
svcCloseHandle(handle);
if (!running)
smUnregisterService(service_name);
return running;
};
CFW getCFW(){
if(isServiceRunning("rnx")) return rnx;
else if(isServiceRunning("tx")) return sxos;
else return ams;
};