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.cppandhook_main.h - Run gradle task
:module:assembleReleasetask from Android Studio or command line, zip will be saved inout.
- DO NOT overwrite
android.os.SystemProperties#native_setin 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-x18to both compiler and linker parameter, or it will cause problems on Android Q (see template)