Skip to content

Commit

Permalink
fix issues
Browse files Browse the repository at this point in the history
  • Loading branch information
lvyitian committed Aug 20, 2023
1 parent 1289259 commit 753b716
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion module.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
10 changes: 7 additions & 3 deletions module/src/main/cpp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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;
Expand Down Expand Up @@ -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);
}*/
}
}
};

Expand Down

0 comments on commit 753b716

Please sign in to comment.