bytedance/android-inline-hook — reverse-engineered prompt

Reverse engineered prompt

GitHub

Build me an Android inline hook library called ShadowHook.

I want it to let an Android app hook or intercept native functions on armeabi v7a and arm64 v8a, from Android 4.1 through current Android 16. It should let developers target a function either by raw address or by library name plus function name, then call their own proxy function and optionally call the original function. It should also support instruction level intercepts where code can inspect and change register values.

Please include a small demo app that initializes the library from Java, uses JNI and native C code, shows hook and unhook, shows intercept and unintercept, and logs useful errors. Make it work with Gradle, CMake, NDK, Prefab, and Maven style dependency usage.

Also add practical production details, like avoiding recursive hook loops, handling newly loaded native libraries automatically, exporting hook operation records, linker init and fini callbacks, symbol lookup across loaded libraries, and clear documentation. Look up current Android build docs online if you need to.

Want more depth? Deep Reverse