Proof of concept shared library (.so
) loader for GTA III/VC/SA/LCS
Android provides two locations for apps to store files into:
- internal storage: no permissions needed, only the owning app can access the files (not even the user!)
- external storage: permissions needed, any app can access the files (including the user)
For security reasons, Android apps can load shared libraries from these locations only:
- APK (hard/time consuming to patch)
- system directories (not writable by the user/app)
- internal storage (readable/writable by the app only)
Usually, mods circumvent this loader restriction by packing the .so
files directly into the APK.
However, this approach comes with a big downside: you have to rebuild and reinstall the APK every time you make a change to the mod.
A master mod (ASI Loader) is packed into the APK like a normal mod.
Everytime the app starts, the ASI Loader scans Android/data/<appid>/files/ASI/
directory for .asi
files,
copies them to internal storage then loads them into the process.
This way libs can be updated with a simple adb push
to the app external directory.
- GTA .apk file (preferably the latest version, otherwise the .patch file might fail)
- Android NDK
- apktool
- uber-apk-signer
- Unpack the APK (apktool)
- Apply: (patch)
src/patches/WarMedia.patch
for GTA III/VC/SAsrc/patches/GTAActivityBase.patch
for GTA LCS
- Build the ASI Loader (ndk-build)
- Copy
libASILoader.so
to<unpack>/lib/armeabi-v7a/
- Rebuild the APK (apktool)
- Sign the APK (uber-apk-signer)
- Copy and install the signed APK
If everything went good, you should see a message in logcat
from the ASI Loader at game startup.
You can also build and load the example mod.