Magisk

Building and Development

Setup Environment

Building

IDE Support

Developing Rust in Android Studio

Because the Magisk NDK package, ONDK (the one installed with ./build.py ndk), contains a fully self contained Clang + Rust toolchain, building the Magisk project alone does not require configuring toolchains. However, due to the way the IntelliJ Rust plugin works, you’ll have to go through some additional setup to make Android Studio work with Magisk’s Rust codebase:

# Link the ONDK toolchain with the name "magisk"
rustup toolchain link magisk "$ANDROID_SDK_ROOT/ndk/magisk/toolchains/rust"
# Set as default
rustup default magisk

Signing and Distribution