An example about hooking a Jar.
In this project, I put MainActivity.hookXM(String name);
into sayHello
.
the source code of this jar in hello sub-module :
package com.androidyuan;
public class Hello {
public Hello() {
}
public static void sayHello(String name) { //this method would be hooked.
}
}
['methodName': 'sayHello', 'methodDesc': '(Ljava/lang/String;)V'
This code above has the structure is Byte-code. If you have seen some byte-code example, you may be familiar with it.
It modify Byte-code by hibeaber, which work with gradle and building process. And it depend on ASM.