Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.

Latest commit

 

History

History
49 lines (33 loc) · 1.14 KB

README.md

File metadata and controls

49 lines (33 loc) · 1.14 KB

Injector

Injector is a Kotlin / Java library for modifying classes at runtime using ASM

Installation

repositories {
    mavenCentral()
    
    // Required for Koffee, which is a dependency of Injector
    maven("https://maven.hackery.site/")
    
    // Required to retrieve Injector from GitHub
    maven("https://jitpack.io/")
}

dependencies {
    implementation("com.github.cbyrneee:Injector:latest-commit-hash")
}

Usage

Example.kt

fun run() {
    injectMethod<Test>("Test", "main", "()V") { (params, fields, returnInfo) -> // this: Test ->
        println("Injecting before the first instruction in Test#main and returning!")
        returnInfo.cancel()
    }
    
    Test().main() // will simply return
}

For a full example, check out the example project

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please update the example project if making a major change.

License

GPL 3.0