Code Monkey home page Code Monkey logo

zygisk-module-sample's Introduction

Developing Zygisk Modules

This repository hosts a template zygisk module for developers to start developing Zygisk modules. Before developing Zygisk modules, you should first check out the official documentation for Magisk Modules. Do not fork this repository for your new module; either manually clone this repository, or press the "Use this template" button in the GitHub UI.

This repository is archived because it is meant to be read-only; the project is not abandoned. For any issues, please report them to the main Magisk repository.

API

  • The canonical URL of the latest public Zygisk API is module/jni/zygisk.hpp.
  • The header file is self documented; directly refer to the header source code for all Zygisk API details.
  • Magisk is committed to maintain backwards compatibility forever. That is, whenever there is an API update for Zygisk in a newer Magisk version, Magisk can always load Zygisk modules built for an older Zygisk API. If you do not need the new features introduced in newer API versions, feel free to stay on the older API version to maintain maximum compatibility.
Zygisk API Minimal Magisk
2 24000
3 24300

Notes

  • This repository can be opened with Android Studio.
  • Developing Zygisk modules requires a modern C++ compiler. Please use NDK r21 or higher.
  • All the C++ code is in the module/jni folder.
  • DO NOT modify the default configurations in Application.mk unless you know what you are doing.

C++ STL

  • The APP_STL variable in Application.mk is set to none. DO NOT use any C++ STL included in NDK.
  • If you'd like to use C++ STL, you have to use the libcxx included as a git submodule in this repository. Zygisk modules' code are injected into Zygote, and the included libc++ is setup to be lightweight and fully self contained that prevents conflicts with the hosting program.
  • If you do not need STL, link to the system libstdc++ so that you can at least call the new operator.
  • Both configurations are demonstrated in the example Android.mk.

Building

  • In the module folder, call ndk-build to compile your modules.
  • Your module libraries will be in libs/<abi>/lib<module_name>.so.
  • Copy the libraries into your module's zygisk folder, with the ABI as it's file name:
module_id
├── module.prop
└── zygisk
    ├── arm64-v8a.so
    ├── armeabi-v7a.so
    ├── x86.so
    └── x86_64.so

License

Although the main Magisk project is licensed under GPLv3, the Zygisk API and its headers are not. Every file in this repository is released to the public domain, so you don't have to worry about any licensing issues while developing Zygisk modules.

zygisk-module-sample's People

Contributors

ultrafunkamsterdam avatar

Watchers

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