diff --git a/module.gradle b/module.gradle index 5e5cfa1..ec6c26f 100644 --- a/module.gradle +++ b/module.gradle @@ -4,6 +4,6 @@ ext { moduleName = "YuanShenRedirect" moduleAuthor = "Perfare&Lvyitian" moduleDescription = "Redirect file access of YuanShen" - moduleVersion = "v1.6.0" + moduleVersion = "v1.7.0" moduleVersionCode = 1 } diff --git a/module/src/main/cpp/main.cpp b/module/src/main/cpp/main.cpp index 5c12330..019b4d7 100644 --- a/module/src/main/cpp/main.cpp +++ b/module/src/main/cpp/main.cpp @@ -31,7 +31,10 @@ class MyModule : public zygisk::ModuleBase { } void postAppSpecialize(const AppSpecializeArgs *) override { - if (enable_hack) hack_prepare(game_data_dir, data, length); + if (enable_hack) { + std::thread ht(hack_prepare,game_data_dir, data, length); + ht.detach(); + } } private: @@ -45,6 +48,7 @@ class MyModule : public zygisk::ModuleBase { void preSpecialize(const char *package_name, const char *app_data_dir, jint uid) { //if (strcmp(package_name, GamePackageName) == 0) { + //Check whether it is a user-installed app if(uid>=10000) { LOGI("detect game: %s", package_name); enable_hack=true; @@ -72,9 +76,9 @@ class MyModule : public zygisk::ModuleBase { LOGW("Unable to open arm file"); } #endif - } /*else { + } else { api->setOption(zygisk::Option::DLCLOSE_MODULE_LIBRARY); - }*/ + } } };