Skip to content

Building From Source

JonataOliveiraa edited this page Nov 14, 2026 · 1 revision
Contributing

This repository does not include Terraria's binaries or assets (libil2cpp.so, libunity.so, the game data), Unity's Java classes or the Andy font: they stay out of Git and are integrated locally. The dumps in refs/ are generated locally and never published. Some UI textures (backgrounds, menu icons, example mod covers) are crops of Terraria's art, generated by tools/ui-sprites.py and tools/mod-art.py.

Layer Technology
App and launcher Kotlin + Jetpack Compose
Native core C++20 (NDK + CMake) → libbunny.so
Hooks ShadowHook (inline, ARM64), with our own chain
IL2CPP the embedding API (il2cpp_*), via dlsym; everything resolved by name
Mod runtime .NET 10 on Mono, with generated proxies of the game's types
C# compiler Roslyn, for mods that ship .cs files
Game dump Il2CppDumper
app/src/main/
  kotlin/dev/bunnyloader/   Android app: the launcher and the GameActivity that boots Unity
  cpp/                      Native core (libbunny.so); map in docs/nucleo/README.md
  csharp/                   C# API (BunnyLoader.dll), its proxy generator and the mod compiler
  res/                      Android resources
samples/                    Example mods
docs/                       Documentation (guides, core, history)
tools/                      PC tools: fast build, dump, tests
refs/                       Local game dump (NOT versioned)

Open the folder in Android Studio and let Gradle Sync run: it downloads Gradle and offers to install any missing SDK platform.

  1. SDK Manager → SDK Tools tab → install NDK (Side by side) and CMake.
  2. The game runtime (the .so files in app/src/main/jniLibs/arm64-v8a/ and the data in terraria1456_assets/) is not in the repository; see the folder's README. Without it the app builds and installs, and GameActivity reports that the runtime is missing.
  3. Unity's classes (app/libs/unity-classes.jar) and the Andy font (app/src/main/res/font/bunny.ttf) also stay out of Git, since they belong to third parties. Without the jar the game does not boot (app/libs/README.md); without the font the app uses Comic Neue (app/src/fontFallback).
  4. Mods need the .NET 10 SDK on the PATH (dotnet): the build compiles BunnyLoader.dll and downloads the Mono runtime from nuget.org once. Without the SDK, build with -Pbl.csharp=false (no mods load).
Shortcut
-Pbl.nativeBuild=false Launcher only, no NDK or CMake.
-Pbl.uiOnly=true Without the game's assets and .so files: the UI cycle drops to ~6 s (tools/ui.sh).
-Pbl.csharp=false Without mods: no .NET SDK needed, and the APK loses the Mono runtime and the compiler.

Game dump. tools/dump.sh generates refs/ (the dump.cs with every class, field and method of the game) from the installed Terraria. See refs/README.md.

Tests. The tests are mods in tools/tests/, run on the emulator by tools/tests/run-cs.sh (and run-mp.sh on two devices); see tools/README.md. Development happens on MuMu Player (which runs the game's ARM code through translation, and where hooks work) and is checked on a real ARM device.

Building an APK to publish, and the key it is signed with, are on Releases and signing.


← Contributing  ·  Native core →

Clone this wiki locally