How springmusk026/android-modmenu-semijni works
1. What this repository is
- An Android mod-menu template for native/IL2CPP games.
- It is split into a small Java Android shell plus a substantial native C++ layer that does the actual game interaction and menu rendering.
2. Top-level runtime boundary
- The Android app is the packaging and entry point.
- The real “payload” is a JNI-loaded native library that hooks/patches the target game process and drives the menu state.
- The target game is an external boundary: this repo does not contain the game, only the overlay and native modding layer that attaches to it.
3. Android application shell
- MainActivity.java is the launcher-side entry point and permission gate.
- It handles the Android-side startup flow, especially overlay permission checks before the menu is shown.
- AndroidManifest.xml is used to declare the app, overlay permission, and service/activity wiring.
4. Java UI and app state layer
- Menu.java, Views.java, Preferences.java, LGLClickListener.java, and Logcat.java make up the Java-side support layer.
- This layer holds UI state, view helpers, click handling, saved preferences, and log collection/diagnostics.
- Java mostly acts as the bridge between Android framework events and native feature toggles.
5. Native core and JNI boundary
- app/src/main/jni/Main.cpp is the main native control point.
- Jni/Api.h and Jni/JniP.h define the JNI-facing contract between Java and C++.
- This boundary is where menu events, settings, and lifecycle calls are transferred from Java into the native mod logic.
6. Menu definition and feature routing
- Menu.h defines the feature list and menu metadata consumed by the UI.
- The repo uses a feature-number / feature-string model so UI selections map to specific native actions.
- This is the main bridge between visible menu items and runtime behavior in the modding layer.
7. Game interaction layer
- KittyMemory/ provides patching and memory backup/restore utilities.
- LGL2Cpp/ contains IL2CPP-related helpers for locating types, fields, and methods in Unity-based targets.
- This is the subsystem that reads, patches, or hooks the target game’s native code and runtime structures.
8. Hooking and low-level compatibility
- The native layer includes support for function hooks and architecture-specific paths.
- The codebase is built to handle ARMv7 and ARM64 targets, with x86 present only as legacy support.
- This architecture awareness matters because the mod logic depends on the target game’s library ABI.
9. Overlay/menu rendering
- ImGui/ contains Dear ImGui and Android/OpenGL backend code.
- The floating menu is rendered natively rather than through standard Android widgets.
- This creates a separate rendering path from the Java UI: Android launches the app, but the actual floating control surface is drawn by native code over the game.
10. Supporting native utilities
- Includes/ contains logger, macro, utility, and string obfuscation helpers.
- Codes/ and Stuffs/ hold shared structs and math types like vectors and quaternions.
- These are support libraries used across patching, hooks, geometry/math, and diagnostics.
11. Build and packaging structure
- The project is a standard Gradle Android app under app/, with native code compiled as part of the Android build.
- app/src/main/jni/CMakeLists.txt defines the native build, and the workflow file under .github/workflows/ suggests CI build automation.
- The output is an Android APK that includes both the Java shell and the native shared library.
12. Typical data flow at runtime
- App launch starts in MainActivity.
- Android permissions and startup logic enable the overlay/menu path.
- Java state and user actions flow through JNI into Main.cpp.
- Native code updates feature state, applies memory patches/hooks to the game, and renders the overlay via ImGui.
13. External dependencies that shape the design
- Android SDK/NDK are required because the app is both an Android app and a native library project.
- OpenGL ES is implied by the ImGui Android backend.
- IL2CPP/Unity-style native game binaries are the intended target domain for the memory and hook utilities.
14. How to diagram it
- Draw three main zones: Android app shell, native mod engine, and external target game.
- Inside the app shell, show activity/service/UI/preferences/logging.
- Inside the native zone, show JNI bridge, feature menu, memory patching/hooking, IL2CPP helpers, and ImGui rendering.
- Show arrows from Android UI actions into JNI, then from native code into the target game process/libraries, plus a separate rendering path for the floating overlay.
Main entry points: Main.cpp Main C++ · MainActivity.java Main Activity · Menu.java Menu UI · LGLClickListener.java Click Listener
Components 22
Android shell
Launcher app, UI state, and permission flow on the Android side.
- Manifest · Declares the app, activities, overlay permissions, and component wiring.
app/src/main/AndroidManifest.xml - Main Activity · Entry point and permission gate for starting the overlay/menu flow.
app/src/main/java/com/android/support/MainActivity.java - Menu UI · Java-side menu state and feature presentation bridge.
app/src/main/java/com/android/support/Menu.java - Views · View helpers and Android UI construction support.
app/src/main/java/com/android/support/Views.java - Preferences · Persistent settings and saved menu state.
app/src/main/java/com/android/support/Preferences.java - Click Listener · Handles UI events and forwards actions into the app flow.
app/src/main/java/com/android/support/LGLClickListener.java - Logcat · Java-side logging and log collection support.
app/src/main/java/com/android/support/Logcat.java
Native mod engine
JNI boundary, menu routing, game memory patching, hooks, rendering, and shared native utilities.
- JNI API · Java-to-native entry declarations and callable interface.
app/src/main/jni/Jni/Api.h - JNI Privates · Private JNI helpers and internal glue for the native bridge.
app/src/main/jni/Jni/JniP.h - Main C++ · Primary native control point for lifecycle, hooks, and feature dispatch.
app/src/main/jni/Main.cpp - Feature Menu · Feature-number and feature-string mapping used by the native runtime.
app/src/main/jni/Menu.h - KittyMemory · Memory backup, patch, and restore utilities for target process modification.
app/src/main/jni/KittyMemory/KittyMemory.cpp - IL2CPP Helpers · Helpers for locating Unity/IL2CPP types, fields, and methods.
app/src/main/jni/LGL2Cpp/Il2Cpp.cpp - ImGui Backend · Android and OpenGL backend code for native overlay rendering.
app/src/main/jni/ImGui/backends/imgui_impl_android.cpp - ImGui Core · Dear ImGui core used to draw the floating menu overlay.
app/src/main/jni/ImGui/imgui.cpp - Native Utils · Logging, macros, utility helpers, and string obfuscation support.
app/src/main/jni/Includes/Utils.h - Math Types · Vector and quaternion types shared across native subsystems.
app/src/main/jni/Stuffs/Vector3.hpp
Target game
External game process and libraries this template attaches to at runtime.
- Game Process · External native game binary and runtime state modified by the mod menu.
Build and CI
Android/Gradle build definition and workflow automation.
- Gradle Build · Top-level Gradle build configuration for the Android app.
build.gradle - App Build · App module configuration and native build integration.
app/build.gradle - CMake Build · Native library build definition for the JNI layer.
app/src/main/jni/CMakeLists.txt - CI Workflow · GitHub Actions workflow for automated Gradle builds.
.github/workflows/gradle.yml
Connections 23
- Manifest → Main Activity: launches · Declares the launcher entry point and app wiring.
- Main Activity → Menu UI: opens · Starts the menu flow after Android-side checks.
- Main Activity → Preferences: loads · Restores saved app and menu state.
- Main Activity → Click Listener: routes · Sends UI events into the app interaction layer.
- Menu UI → Views: builds · Uses view helpers to present menu controls.
- Click Listener → Menu UI: updates · Applies user actions to menu state.
- Logcat → Main Activity: diagnoses · Supports Android-side diagnostics and troubleshooting.
- Menu UI → JNI API: bridges · Exposes menu selections to native code through JNI.
- JNI API → Main C++: enters · Transfers lifecycle and feature calls into native control flow.
- JNI Privates → Main C++: supports · Provides private native-side JNI glue.
- Main C++ → Feature Menu: dispatches · Maps feature selections to runtime behavior.
- Main C++ → KittyMemory: patches · Applies memory edits and restores backups.
- Main C++ → IL2CPP Helpers: resolves · Finds IL2CPP types, fields, and methods in the target game.
- Main C++ → ImGui Backend: renders via · Uses backend bindings for the native overlay path.
- ImGui Backend → ImGui Core: drives · Backend feeds input and frame setup into Dear ImGui.
- ImGui Core → Main C++: draws · Menu rendering is orchestrated by the native control loop.
- KittyMemory → Game Process: modifies · Patches the external game process and libraries.
- IL2CPP Helpers → Game Process: inspects · Reads game runtime metadata and IL2CPP structures.
- Main C++ → Native Utils: uses · Relies on shared native logging and utility code.
- Main C++ → Math Types: shares · Uses shared vector and quaternion types.
- App Build → CMake Build: includes · Connects the Android module build to the native library build.
- Gradle Build → App Build: configures · Top-level Gradle setup drives the app module.
- CI Workflow → Gradle Build: runs · Automates project builds through Gradle.