Giter Site home page Giter Site logo

jtik's Introduction

Jtik

中文版本

Introduction

Jtik is a runtime dynamic hook framework on the Android platform that operates at the granularity of Java methods.Its implementation is based on ART TI and it is capable of hooking both the application itself and system Java methods. Since it utilizes publicly available system interfaces and does not involve modifications to internal memory structures of the ART virtual machine, such as ArtMethod, it theoretically has strong compatibility.

Usage

1. Add dependency

repositories {
        maven { url 'https://jitpack.io' }
}
dependencies {
   implementation 'com.github.chancerly:jtik:0.0.1-Beta'
}

2. Initialization

//if you want hook framework method,like Activity.onCreate
//JtikConfig.needHookSystemClass = true; 

Jtik.init(context);

3. hook target method:

for example:as a class Test

public class Test {
   public int run(int aint b){
	...
   }
}

hook the method run of class Test

Jtik.hook(classLoader.loadClass("Test").getDeclaredMethod("run", int.class, int.class),
		new com.zxc.jtik.MethodHook.Builder().setMethodEnterListener((o, objects) -> {
            //do something on method enter...
        }).setMethodExitListener((o, o1) -> {
            //do something on method exit...
	        return o1;
        }).setParamModifier(0, (thisObject, inParam) -> {
            //do something if you want to modify the parameter...
	    return 6;//the parameter value you chage to
        }).build());

Support platforms:

Theoretically, Android 8.0+ are fully supported

Reference

  1. ART TI
  2. slicer
  3. android studio
  4. JVMTI Tool Interface

jtik's People

Contributors

chancerly avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.