javassist-android
javassist-android copied to clipboard
insertBefore, insertAfter into Android framework methods?
Is it possible to insertBefore/insertAfter a small portion of code into any method inside Android framework, and apply the change at runtime? Say, android.widget.TextView.setText().
I have tried it with CodeConverter with HotSwapper but with no luck. As I know the framework classes are all forked from Zygote in Android which is very different from traditional Java.
We cannot modify any methods inside of Android Framework or imported prebuilt/installed library at runtime. Because Dalvik/ART runtime is not a standard JVM and Instrumentation is not supported. To modify that methods, we should be able to modify the binary image (machine code) loaded on the memory dynamically. But, it cannot. No easy way.