Experimental Java-based Android ART method-hooking framework
ArtEntryHook explores low level method redirection inside the Android Runtime (ART) using Java reflection and sun.misc.Unsafe rather than a conventional JNI/C++ hook implementation
Warning
Research prototype — not production-ready. The current implementation uses unverified assumptions about ART memory layout. A successful memory write does not prove that a method was hooked. Incorrect memory access can crash the app or corrupt process memory.
ArtEntryHook is an experimental, lightweight, Java-based Android ART (Android Runtime) hooking framework designed to explore low-level method manipulation without relying on native C/C++ code or JNI. The framework automatically initializes through Provider.onCreate(), which invokes Hooker.HookCall() to identify the original and replacement Java methods using a custom reflection utility. It then uses sun.misc.Unsafe and Java reflection to access internal runtime structures, including the Executable.artMethod field, and retrieve the underlying ART method addresses. To investigate the runtime memory layout, its dedicated art_calibrator component examines two Throwable constructors, calculates the distance between their ART method addresses, and uses that information to estimate a possible memory offset. The framework subsequently scans candidate memory locations, compares their values, and attempts to redirect method execution by copying a selected value between ART method structures through direct memory manipulation. This architecture separates method discovery, runtime inspection, address calibration, and hooking operations into reusable components, providing a foundation for researching Android ART internals and developing Java-based runtime instrumentation techniques. However, the current implementation remains experimental: its offset detection is heuristic, successful memory writes do not guarantee working method hooks, and compatibility across Android versions, device architectures, and ART implementations has not yet been established