I'm a template showing how to hook Unity games with Zygisk installed. Since Riru is deprecated soon, we are not providing compatibility with Riru and the old version can be found in master branch
- Replace module info in
module.gradle
- Write you codes in
hook_main.cpp
andhook_main.h
- Run gradle task
:module:assembleRelease
task from Android Studio or command line, zip will be saved inout
.
- DO NOT overwrite
android.os.SystemProperties#native_set
in core, or your data may be wiped (Detail info) (If you really need to hook this, remember to clear exception) - DO NO print log (
__android_log_print
) innativeForkAndSpecialize(Pre/Post)
nativeForkSystemServer(Pre/Post)
when in zygote process, or it may cause zygote not work (magic not confirmed, Detail info) - Add
-ffixed-x18
to both compiler and linker parameter, or it will cause problems on Android Q (see template)