LemonLoader serves as a critical enabler for modding Unity-based games on Android. Rather than modifying game logic during gameplay, it acts as a setup utility that installs and prepares MelonLoader—the mod loader responsible for runtime interaction with Unity games.
Once LemonLoader completes installation and patching, MelonLoader takes over, handling mod loading and execution.
🚀 How LemonLoader Works
1️⃣ Installing MelonLoader
LemonLoader’s core function is to download and install MelonLoader on the Android device.
📦 Application Installation
- LemonLoader is installed as a
.apk
file. - It provides the UI and logic to manage the setup process.
🌐 Downloading MelonLoader Components
- Upon launch, LemonLoader fetches the latest MelonLoader files from remote repositories.
- These include the native libraries and runtime components required for Android-based modding.
📁 Placing Files Correctly
- LemonLoader inserts the downloaded files into the target game’s data directory.
- Files are positioned to ensure MelonLoader is recognized and loaded during the game’s startup sequence.
2️⃣ Patching the Game for Mod Support
This phase is crucial—LemonLoader modifies the game to allow code injection.
🧠 Identifying Injection Points
- LemonLoader locates entry points within Unity’s libraries where mod loading code can be inserted.
🔧 Injection Methods
- Assembly Patching: Modifies compiled native libraries (
.so
files). - Function Hooking: Redirects or intercepts method calls to insert MelonLoader behavior.
- Native Library Injection: Ensures MelonLoader’s libraries are initialized during the game’s boot phase.
3️⃣ Setting Up the Mod Environment
With MelonLoader in place and the game patched, LemonLoader finalizes the environment.
📂 Mods Directory
- A
Mods/
folder is created in the game’s directory. - Users place
.dll
mods and assets here.
⚙️ Configuration Files
- Initial configs are generated to control MelonLoader behavior:
- Enable/disable mods
- Console output options
- Load order and debug settings
4️⃣ MelonLoader Takes Over
Once the game launches, MelonLoader becomes active. LemonLoader’s job is done.
MelonLoader handles:
- ✅ Loading Mods from the
Mods/
folder - 💉 Injecting Mod Code into Unity’s runtime
- 🧵 Hooking Functions using Harmony
- 🎨 Loading Custom Assets (textures, audio, models)
LemonLoader does not interact with the game during gameplay—it only sets the stage.
⚙️ Technical Considerations
🧠 Unity Engine Compatibility
- Supports both Mono and IL2CPP backends.
- Injection methods adapt based on the build type.
🔐 Android OS Restrictions
- May require:
- Storage permissions
- App installation from unknown sources
- Root access is optional but can simplify the process.
📦 Game Updates
- Game updates can break compatibility.
- Re-patching or updating MelonLoader may be necessary.
🛡️ Anti-Cheat Systems
- Online games with anti-cheat may detect MelonLoader.
- Best suited for single-player or mod-friendly games.
🧭 Summary of Responsibilities
Task | LemonLoader | MelonLoader |
---|---|---|
App installation | ✅ | ❌ |
Game patching | ✅ | ❌ |
File placement | ✅ | ❌ |
Creating mod directory | ✅ | ❌ |
Loading/injecting mods | ❌ | ✅ |
Hooking game functionality | ❌ | ✅ |
Runtime asset injection | ❌ | ✅ |
🍋 Final Thoughts
LemonLoader acts as the modding gateway for Unity games on Android. It sets up the environment, installs MelonLoader, and patches the game to support mod injection. After that, MelonLoader takes control, enabling deep integration and modding capabilities.
If you’re modding a Unity game on Android, LemonLoader is your first—and essential—step.