@@ -74,13 +74,14 @@ class FastCFWSwitchOverlay : public tsl::Overlay {
74
74
private:
75
75
Result splInitializeResult;
76
76
Result spsmInitializeResult;
77
- bool useClassic;
77
+ bool useClassic = false ;
78
78
public:
79
79
// libtesla already initialized fs, hid, pl, pmdmnt, hid:sys and set:sys
80
80
virtual void initServices () override {
81
81
splInitializeResult = splInitialize ();
82
82
spsmInitializeResult = spsmInitialize ();
83
83
84
+ useClassic = isServiceRunning (" tx" ) || isServiceRunning (" rnx" );
84
85
85
86
} // Called at the start to initialize all services necessary for this Overlay
86
87
virtual void exitServices () override {
@@ -92,6 +93,16 @@ class FastCFWSwitchOverlay : public tsl::Overlay {
92
93
virtual void onShow () override {} // Called before overlay wants to change from invisible to visible state
93
94
virtual void onHide () override {} // Called before overlay wants to change from visible to invisible state
94
95
96
+ bool isServiceRunning (const char *serviceName) {
97
+ u8 tmp=0 ;
98
+ SmServiceName service_name = smEncodeName (serviceName);
99
+ Result rc = serviceDispatchInOut (smGetServiceSession (), 65100 , service_name, tmp);
100
+ if (R_SUCCEEDED (rc) && tmp & 1 )
101
+ return true ;
102
+ else
103
+ return false ;
104
+ }
105
+
95
106
virtual std::unique_ptr<tsl::Gui> loadInitialGui () override {
96
107
if (R_FAILED (splInitializeResult)){
97
108
// unable to init spl, cant reboot this way
0 commit comments