|
1 | | -# NativeModMenu |
2 | | - |
3 | | -### High-Performance In-Memory Dex Loader for Android |
4 | | - |
5 | | -`NativeModMenu` is a sophisticated reimplementation of the LGL Android Mod Menu. It leverages `InMemoryDexClassLoader` to load the Java UI layer directly from system memory, eliminating the need for physical `.dex` files on the device storage. |
6 | | - |
7 | | ---- |
8 | | - |
9 | | -## Technical Overview |
10 | | - |
11 | | -This implementation focuses on stealth and efficiency by embedding the `FloatingModMenu.dex` as a HEX-encoded string within the native binary. At runtime, the JNI layer performs a dynamic bootstrap to initialize the menu without leaving any traces in the application's assets or data folders. |
12 | | - |
13 | | -### Key Architectural Differences |
14 | | - |
15 | | -* **Zero Disk Footprint:** No external dex file is shipped; the menu exists only in memory. |
16 | | -* **Volatile Loading:** Utilizes `dalvik.system.InMemoryDexClassLoader` for runtime execution. |
17 | | -* **Native-Led Initialization:** The entire menu lifecycle is managed via JNI native bindings. |
18 | | -* **Reduced Attack Surface:** Eliminates file-based detection vectors by avoiding asset extraction. |
19 | | -* **Native Compatibility:** Fully compatible with existing LGL Java menu logic. |
20 | | - |
21 | | ---- |
22 | | - |
23 | | -## Core Logic Flow |
24 | | - |
25 | | -1. **Data Embedding:** The `FloatingModMenu.dex` is converted to a HEX string and compiled into the C++ source. |
26 | | -2. **Buffer Reconstruction:** At runtime, the HEX string is decoded into a `ByteBuffer`. |
27 | | -3. **Class Loading:** The `InMemoryDexClassLoader` interprets the buffer and loads the `uk.lgl.modmenu.FloatingModMenu` class. |
28 | | -4. **JNI Registration:** Native functions are dynamically bound to the Java class methods. |
29 | | -5. **Execution:** The `binJava()` entry point triggers `FloatingModMenu.antik(Context)` to render the UI. |
30 | | - |
31 | | ---- |
32 | | - |
33 | | -## JNI Native Interface |
34 | | - |
35 | | -The following methods are registered dynamically to bridge the Native and Java layers: |
36 | | - |
37 | | -| Method | Functionality | |
38 | | -| --- | --- | |
39 | | -| `Icon()` | Returns the primary menu icon | |
40 | | -| `IconWebViewData()` | Manages WebView icon resources | |
41 | | -| `getFeatureList()` | Retrieves the feature configuration array | |
42 | | -| `settingsList()` | Retrieves the menu settings configuration | |
43 | | -| `Changes(...)` | Main event handler for feature toggles | |
44 | | -| `setTitleText(...)` | Customizes the UI title appearance | |
45 | | -| `setHeadingText(...)` | Customizes the UI heading appearance | |
46 | | - |
47 | | ---- |
48 | | - |
49 | | -## Implementation Details |
50 | | - |
51 | | -### Requirements |
52 | | - |
53 | | -* **Android Version:** 8.0 (API 26) or higher |
54 | | -* **Architecture:** ARMv7, ARM64-v8a |
55 | | -* **Environment:** Native JNI-based injection |
56 | | - |
57 | | -### Entry Point |
58 | | - |
59 | | -```cpp |
60 | | -// Executed post JNI_OnLoad |
61 | | -void binJava(); |
62 | | - |
63 | | -``` |
64 | | - |
65 | | -The `binJava` function is responsible for retrieving the `Application` context via `ActivityThread` and initiating the memory-loading sequence. |
66 | | - |
67 | | ---- |
68 | | - |
69 | | -## Legal Notice |
70 | | - |
71 | | -This project is developed strictly for **educational and research purposes**. Modifying the runtime behavior of third-party applications may violate their Terms of Service. The developers assume no liability for misuse. |
72 | | - |
73 | | -## Acknowledgments |
74 | | - |
75 | | -* **Original Architecture:** LGL Android Mod Menu |
76 | | -* **Lead Developer:** AntikMods |
77 | | -* **Memory Loading Logic:** NepMods |
| 1 | +# NativeModMenu |
| 2 | + |
| 3 | +### High-Performance In-Memory Dex Loader for Android |
| 4 | + |
| 5 | +`NativeModMenu` is a sophisticated reimplementation of the LGL Android Mod Menu. It leverages `InMemoryDexClassLoader` to load the Java UI layer directly from system memory, eliminating the need for physical `.dex` files on the device storage. |
| 6 | + |
| 7 | +--- |
| 8 | + |
| 9 | +## Technical Overview |
| 10 | + |
| 11 | +This implementation focuses on stealth and efficiency by embedding the `FloatingModMenu.dex` as a HEX-encoded string within the native binary. At runtime, the JNI layer performs a dynamic bootstrap to initialize the menu without leaving any traces in the application's assets or data folders. |
| 12 | + |
| 13 | +### Key Architectural Differences |
| 14 | + |
| 15 | +* **Zero Disk Footprint:** No external dex file is shipped; the menu exists only in memory. |
| 16 | +* **Volatile Loading:** Utilizes `dalvik.system.InMemoryDexClassLoader` for runtime execution. |
| 17 | +* **Native-Led Initialization:** The entire menu lifecycle is managed via JNI native bindings. |
| 18 | +* **Reduced Attack Surface:** Eliminates file-based detection vectors by avoiding asset extraction. |
| 19 | +* **Native Compatibility:** Fully compatible with existing LGL Java menu logic. |
| 20 | + |
| 21 | +--- |
| 22 | + |
| 23 | +## Core Logic Flow |
| 24 | + |
| 25 | +1. **Data Embedding:** The `FloatingModMenu.dex` is converted to a HEX string and compiled into the C++ source. |
| 26 | +2. **Buffer Reconstruction:** At runtime, the HEX string is decoded into a `ByteBuffer`. |
| 27 | +3. **Class Loading:** The `InMemoryDexClassLoader` interprets the buffer and loads the `uk.lgl.modmenu.FloatingModMenu` class. |
| 28 | +4. **JNI Registration:** Native functions are dynamically bound to the Java class methods. |
| 29 | +5. **Execution:** The `binJava()` entry point triggers `FloatingModMenu.antik(Context)` to render the UI. |
| 30 | + |
| 31 | +--- |
| 32 | + |
| 33 | +## JNI Native Interface |
| 34 | + |
| 35 | +The following methods are registered dynamically to bridge the Native and Java layers: |
| 36 | + |
| 37 | +| Method | Functionality | |
| 38 | +| --- | --- | |
| 39 | +| `Icon()` | Returns the primary menu icon | |
| 40 | +| `IconWebViewData()` | Manages WebView icon resources | |
| 41 | +| `getFeatureList()` | Retrieves the feature configuration array | |
| 42 | +| `settingsList()` | Retrieves the menu settings configuration | |
| 43 | +| `Changes(...)` | Main event handler for feature toggles | |
| 44 | +| `setTitleText(...)` | Customizes the UI title appearance | |
| 45 | +| `setHeadingText(...)` | Customizes the UI heading appearance | |
| 46 | + |
| 47 | +--- |
| 48 | + |
| 49 | +## Implementation Details |
| 50 | + |
| 51 | +### Requirements |
| 52 | + |
| 53 | +* **Android Version:** 8.0 (API 26) or higher |
| 54 | +* **Architecture:** ARMv7, ARM64-v8a |
| 55 | +* **Environment:** Native JNI-based injection |
| 56 | + |
| 57 | +### Entry Point |
| 58 | + |
| 59 | +```cpp |
| 60 | +// Executed post JNI_OnLoad |
| 61 | +void binJava(); |
| 62 | + |
| 63 | +``` |
| 64 | + |
| 65 | +The `binJava` function is responsible for retrieving the `Application` context via `ActivityThread` and initiating the memory-loading sequence. |
| 66 | + |
| 67 | +--- |
| 68 | + |
| 69 | +## Legal Notice |
| 70 | + |
| 71 | +This project is developed strictly for **educational and research purposes**. Modifying the runtime behavior of third-party applications may violate their Terms of Service. The developers assume no liability for misuse. |
| 72 | + |
| 73 | +## Acknowledgments |
| 74 | + |
| 75 | +* **Original Architecture:** LGL Android Mod Menu |
| 76 | +* **Lead Developer:** AntikMods |
| 77 | +* **Memory Loading Logic:** NepMods |
0 commit comments