Basic Geometry Dash android mod example meant for beginners or as a template. A port of gd-mod-example for Android featuring a new modloader.
-
Clone the repo
-
To build this project you will need the version r16b of the Native Development Kit for Android.
- Edit the paths inside Build.bat and run it
- The compiled files should be in gd-mod-example-android/libs/armeabi-v7a
To make the mod work we need to edit the java source code of the APK to load the compiled .so files
- Have a Geometry Dash APK ready
- Get an APK Editor that supports smali
There are many APK Edit tools available, personally I recommend APK Editor Studio
- Decompile the APK with smali
To enable smali on APK Editor Studio: Settings -> Options (CTRL + P) -> Apktool -> Decompile source code (smali)
-
Open the contents of the APK
-
Go to this path
/smali/com/robtopx/geometryjump
and openGeometryJump.smali
-
Copy + Paste this code 3 times
-
Change the string to match our .so file names. Note: names are without
lib
and without.so
.line 70
const-string v0, "cocos2dcpp"
invoke-static {v0}, Ljava/lang/System;->loadLibrary(Ljava/lang/String;)V
In the Geometry dash 2.11 APK the method should look like this
# direct methods
.method static constructor <clinit>()V
.locals 1
.prologue
.line 69
const-string v0, "fmod"
invoke-static {v0}, Ljava/lang/System;->loadLibrary(Ljava/lang/String;)V
.line 70
const-string v0, "cocos2dcpp"
invoke-static {v0}, Ljava/lang/System;->loadLibrary(Ljava/lang/String;)V
.line 70
const-string v0, "dobby"
invoke-static {v0}, Ljava/lang/System;->loadLibrary(Ljava/lang/String;)V
.line 70
const-string v0, "hooking"
invoke-static {v0}, Ljava/lang/System;->loadLibrary(Ljava/lang/String;)V
.line 70
const-string v0, "game"
invoke-static {v0}, Ljava/lang/System;->loadLibrary(Ljava/lang/String;)V
.line 85
return-void
.end method
- Last, move the .so files to the
/lib/armeabi-v7a
folder - Compile the APK and if sign it manually if necessary (APK Editor Sutdio signs it for you)
- Install APK
After this one-time setup you only need to update the libgame.so
file inside the lib/armeabi-v7a/
folder.
All the source files contain a lot of comments which you should definitely read if you're just starting out :) (i recommend starting from main.cpp
- Ghidra - A free reverse engineering tool, which is almost mandatory for GD modding
- GD Programming - A discord server where you can ask a lot of questions :D
- Awesome ADB - Everything there's to know about how to use ADB to speed up development
- ADB Logcat - Powerful ADB command to print debug messages to console or to obtain crash logs
- cocos2dx - Documentation for the version of cocos robtop uses as a base (with robtop modifications documented)
- Italian APK Downloader General help, modloader, project setup, gd.h
- mat - Original mod idea, example code, explanations