Zygote Loader

A library for building Java only Zygisk/Riru modules.

Getting Start

  1. Add gradle plugin to project

buildscript {
    repositories {
        // ... other repositories
        maven(url = "https://maven.kr328.app/releases")
    }
    dependencies {
        // ... other dependencies
        classpath("com.github.kr328.zloader:gradle-plugin:2.1")
    }
}
  1. Add an android application module and create entrypoint

class Entrypoint {
    // ZygoteLoader will invoke this method after injected to target project
    public static void main() {
        // ... your code
    }
}
  1. Apply zygote-loader plugin

plugins {
    id("com.android.application") // required
    id("zygote-loader") // apply plugin
    // ... other plugins
}
  1. Configure your module properties

zygote {
    // initial inject packages
    packages(ZygoteLoader.PACKAGE_SYSTEM_SERVER) // initial inject to system_server

    // riru related properties
    riru {
        id = "your module id"
        name = "your module name"
        author = "your name"
        description = "your module description"
        entrypoint = "your entrypoint class qualified name" // see also step 2
        archiveName = "generated zip archive name" // optional
        updateJson = "your updateJson property" // optional, see also https://topjohnwu.github.io/Magisk/guides.html#moduleprop
    }

    // zygisk related properties
    zygisk {
        // same with riru
    }
}
  1. Build module

    1. Run gradle task <module>:assembleRelease

    2. Pick generated zip from <module>/build/outputs/magsisk

Examples

GitHub

View Github