https://github.com/spmn/gta.android.asiloader
PoC shared library (.so) loader for Android apps
https://github.com/spmn/gta.android.asiloader
android asi gtasa loader
Last synced: about 1 month ago
JSON representation
PoC shared library (.so) loader for Android apps
- Host: GitHub
- URL: https://github.com/spmn/gta.android.asiloader
- Owner: spmn
- License: gpl-3.0
- Created: 2021-02-02T01:55:45.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-02-02T21:14:30.000Z (over 4 years ago)
- Last Synced: 2023-06-16T00:40:15.256Z (over 2 years ago)
- Topics: android, asi, gtasa, loader
- Language: C
- Homepage:
- Size: 20.5 KB
- Stars: 12
- Watchers: 5
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GTA.Android.ASILoader
Proof of concept shared library (`.so`) loader for GTA III/VC/SA/LCS
## Quick info
Android provides two locations for apps to store files into:
1. internal storage: no permissions needed, **only** the owning app can access the files (not even the user!)
2. 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:
1. APK (hard/time consuming to patch)
2. system directories (not writable by the user/app)
3. 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.## Solution
A master mod (ASI Loader) is packed into the APK like a normal mod.
Everytime the app starts, the ASI Loader scans `Android/data//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.
## Requirements
- GTA .apk file (preferably the latest version, otherwise the .patch file might fail)
- Android NDK
- apktool
- uber-apk-signer## Installation
1. Unpack the APK (apktool)
2. Apply: (patch)
- `src/patches/WarMedia.patch` for GTA III/VC/SA
- `src/patches/GTAActivityBase.patch` for GTA LCS
3. Build the ASI Loader (ndk-build)
4. Copy `libASILoader.so` to `/lib/armeabi-v7a/`
5. Rebuild the APK (apktool)
6. Sign the APK (uber-apk-signer)
7. Copy and install the signed APKIf 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.