0. Prerequisites
The following tools are assumed to be in your PATH.
1. Get the APKs
- Install the app from the play store
- Establish an ADB connection with your device
- Determine the install path, e.g.
adb shell pm path com.byonoy.absorbance1 - Pull all the APKs in that path, e.g.
adb pull /path/to/app/base.apk
adb pull /path/to/app/split_config.arm64_v8a.apk
...
2. Replace the Libraries
- Unpack the APK called
split_config.$ARCH.apk, where$ARCHis your device’s CPU architecture, e.g.
apktool d -f -r -s split_config.arm64_v8a.apk - Replace the SO file(s) in the unpacked APK lib directory, e.g.
split_config.arm64_v8a/lib/arm64-v8a/libkdreports_arm64-v8a.so
3. Rebuild the APKs
- Pack the modified APK, e.g.
apktool b -f --use-aapt2 split_config.arm64_v8a/ - Zipalign the newly created APK, e.g.
zipalign -p -f -v 4 split_config.arm64_v8a/dist/split_config.arm64_v8a.apk split_config.arm64_v8a.apk - Sign all of the APKs, e.g.
apksigner sign --ks debug.jks base.apk
apksigner sign --ks debug.jks split_config.arm64_v8a.apk
...
4. Install
- Remove any existing installation of the app
- Install all of the APKs in one go, e.g.
adb install-multiple base.apk split_config.arm64_v8a.apk ...