Simple tool to make generation of ASM API calls easier.
Basically, it parses javac
's classfile output and creates a
ClassFileTransformer
that appends and / or replaces method calls.
python-javatools version >= 1.4.0. Currently PyPI only has 1.3.0, so install it from GitHub.
asm-4.1.jar. Put this in the source directory.
No branching / exception handling opcodes have been implemented. But you can insert method calls to external functions and do all your control flow there, so this shouldn't be a real issue.
Example.java:
@interface prepend {}
@interface replace {}
public class Example {
@prepend
public void foo() {
System.out.println("Hello world");
}
@replace
public void bar() {
System.out.println("Hello world");
}
}
javac Example.java && PATCHES=Example.class make