BruceWind / JarHook

An example about hooking a method in jar.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JarHook

An example about hooking a Jar.

中文

my goal

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.
    }
}

important code in build.gradle

    ['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.

Priciple

It modify Byte-code by hibeaber, which work with gradle and building process. And it depend on ASM.

Thanks

hibeaver

ASM

About

An example about hooking a method in jar.

License:Apache License 2.0


Languages

Language:Java 100.0%