// the find
asLody/legend
A framework for hook java methods.
Legend is a rootless Java method hooking framework for Android that works on both Dalvik and ART runtimes. It lets you intercept and replace arbitrary Java methods via annotations or direct API calls, useful for hotfixing, dynamic debugging, and security research. The README itself redirects you to the successor project, Whale Hook.
The annotation-based hook syntax is clean — `@Hook("android.widget.Toast::show")` reads clearly and keeps hook definitions close to their implementations. Supporting both Dalvik and ART in a single library was non-trivial work; the separate ArtMethodStruct files per API level (19, 22, 23) show the author actually handled the ART internal layout differences rather than guessing. The native JNI layer for memory manipulation is appropriately thin, and the prebuilt .so files for armeabi, mips, and x86 mean you can integrate without an NDK setup.
The project is explicitly abandoned — the README tells you to go elsewhere. The last commit was 2022 and Android has moved through API levels 28–35 since the last tested version (6.0.1); ART internals have changed significantly and this almost certainly breaks on anything modern. The prebuilt .so blobs are checked into the repo with no build reproducibility — you're trusting a binary you can't verify. There's essentially no test coverage beyond stub test files, which matters a lot for something that manipulates method dispatch at the VM level.