Fix global mode not working properly
This commit is contained in:
parent
0e88cee282
commit
a362c984c9
|
|
@ -19,6 +19,15 @@
|
|||
#define GLOBAL_MODE "/data/misc/riru/modules/edxposed/forceglobal"
|
||||
|
||||
static char package_name[256];
|
||||
static bool global_mode = false;
|
||||
static bool inited = false;
|
||||
|
||||
void initOnce() {
|
||||
if (!inited) {
|
||||
global_mode = access(GLOBAL_MODE, F_OK) == 0;
|
||||
inited = true;
|
||||
}
|
||||
}
|
||||
|
||||
// default is true
|
||||
int is_app_need_hook(JNIEnv *env, jstring appDataDir) {
|
||||
|
|
@ -61,5 +70,6 @@ int is_app_need_hook(JNIEnv *env, jstring appDataDir) {
|
|||
}
|
||||
|
||||
int is_global_mode() {
|
||||
return access(GLOBAL_MODE, F_OK) == 0;
|
||||
initOnce();
|
||||
return global_mode;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue