Dexmaker
A Java API for compile-time or runtime code generation targeting Android's Dalvik VM, most commonly used to let the Mockito mocking library create class proxies in Android instrumentation tests.
Dexmaker generates Dalvik .dex bytecode rather than Java .class files, giving a close-to-the-metal API that mirrors the Dalvik bytecode specification for instruction-by-instruction code generation, backed by Dalvik's dx tool for efficient register allocation.
Its main use is enabling the Mockito mocking library inside Android instrumentation tests: adding a dependency on dexmaker-mockito lets a test use Mockito as normal, and dexmaker-mockito-inline additionally supports mocking final classes and methods on Android P and later. It also includes a stock code generator for class proxies for AOP or mocking use cases without handling bytecode directly, and supports generating and loading a class and invoking its methods at runtime.
It is distributed as a Maven/Gradle dependency, with its version tracking the Mockito version it targets.