Fix global mode not working properly

This commit is contained in:
solohsu 2019-01-29 20:19:50 +08:00
parent 0e88cee282
commit a362c984c9
1 changed files with 11 additions and 1 deletions

View File

@ -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;
}