How 0xp1x3l/lgl-modmenu-template works
Main Components
• Android Application Layer (Java):
• Activities and UI components: MainActivity, Launcher, Menu, etc.
• CrashHandler and Preferences for managing app state and error handling.
• AndroidManifest.xml is the entry point for defining the app’s components and permissions.
• Native Layer (JNI/C++):
• Subdirectories such as And64InlineHook, KittyMemory, Substrate, and Menu hold the native hooking modules.
• These modules handle low-level tasks like hooking functions, memory patching, and inline hooking at runtime.
• They provide the core functionality to alter game behavior without needing assets stored externally (assets are embedded as base64 strings).
• Build and Configuration Artifacts:
• Gradle scripts (build.gradle files, settings.gradle, gradle wrappers) define dependencies and build settings.
• JNI build files like Android.mk and Application.mk for compiling native libraries.
Out Relationships and Interactions
• The Android Java layer acts as the frontend, initializing the mod menu through MainActivity and passing control to the native libraries via JNI interfaces.
• The native modules (And64InlineHook, KittyMemory, Substrate) are tightly integrated:
• And64InlineHook and Substrate modules likely work together to perform function hooking.
• KittyMemory provides memory operations (patching, reading/writing) that the hooks depend upon.
• The Java UI communicates with the native layer through JNI calls, forming a bridge between high-level user interactions and low-level hooking operations.
• Build configuration files connect the components by ensuring both Java and native modules are compiled and packaged properly.
Important Architectural Patterns and Design Principles
• Separation of Concerns:
• Clear division between the UI/Java components and the core hooking logic in native C/C++.
• Modular Design:
• Each native module is encapsulated in its own directory (e.g., And64InlineHook, KittyMemory, Substrate), making it easier to update or replace components independently.
• Cross-Layer Integration:
• The use of JNI as an integration layer calls for careful documentation of data flow between Java and native code.
• Build and Deployment:
• Standard Android Studio and Gradle project structure ensures that build scripts and configurations are modular and maintainable.
Relevant Technologies and Frameworks
• Android SDK and standard UI frameworks for the Java layer.
• JNI for cross-language integration.
• Native build system using Android.mk and Application.mk for C/C++ code.
• Hooking libraries such as And64InlineHook and Substrate for inlining and dynamic patching.
• Memory manipulation and obfuscation functionalities through KittyMemory and included obfuscator libraries.
Specific Elements
• Android Application (UI/Activities)
• JNI Bridge
• Native Modules:
• And64InlineHook
• KittyMemory
• Substrate
• Menu (native UI elements, if any)
• How the UI layer calls into the JNI bridge.
• Data and control flow during the hooking process.
• For example, use rectangles for UI components, hexagons for native libraries, and parallelograms for configuration/build files.
• Annotations:
• Labels that mention important libraries (e.g., “And64InlineHook: Inline hooking for ARM64”, “KittyMemory: Memory patching and reading”), specific build or dependency roles (Gradle scripts), and the integration flow via JNI.