Add logging or performance tracking to any method in your Android app without modifying the original code.
Audit your Android app for calls to sensitive APIs by intercepting them at runtime for security reviews.
Hook into Android system methods to observe or change their behavior without rooting the device.
Replace error handling in a third-party library at runtime when you cannot modify its source code.
Only works on real ARM Android devices (thumb2/ARM64) running Android 5.0, 11, does not work on emulators or x86 hardware.
Epic is a library for Android developers that lets you intercept and modify the behavior of Java methods at runtime, without changing the original source code of those methods. This technique is called AOP, short for Aspect-Oriented Programming, which is a way of adding behavior to existing code from the outside rather than editing it directly. The library is a continuation of an earlier project called Dexposed, which was originally built by Alibaba. Dexposed stopped working on newer versions of Android when Google replaced the older Dalvik runtime with a new one called ART. Epic picks up where Dexposed left off and adds support for ART, covering Android versions 5.0 through 11. The way it works is straightforward from a developer's perspective. You pick a method in any Java class, including Android system classes running inside your app, and tell Epic to run your own code before it, after it, or instead of it. The library handles the low-level work of redirecting method calls at the processor instruction level. Integration requires adding one line to your project's build file and loading a small native library when your app starts. Typical use cases listed in the README include monitoring what your app is doing at runtime (useful for testing and measuring performance), checking for calls to sensitive APIs for security audits, and general AOP patterns such as adding logging or error tracking without modifying every method individually. There are some limitations to be aware of. The library only works on real Android devices using ARM processors (thumb2 and ARM64 instruction sets). It does not work on Android emulators or on x86 hardware. Very short methods that compile down to fewer than a certain number of processor instructions are also not supported because there is not enough space to insert the redirection. Epic is open source and welcomes bug reports and pull requests.
← tiann on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.