0. Prerequisites

The following tools are assumed to be in your PATH.

  • Android Platform Tools link
  • Android Build Tools link
  • apktool link

1. Get the APKs

  1. Install the app from the play store
  2. Establish an ADB connection with your device
  3. Determine the install path, e.g.
    adb shell pm path com.byonoy.absorbance1
  4. 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

  1. Unpack the APK called split_config.$ARCH.apk, where $ARCH is your device’s CPU architecture, e.g.
    apktool d -f -r -s split_config.arm64_v8a.apk
  2. 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

  1. Pack the modified APK, e.g.
    apktool b -f --use-aapt2 split_config.arm64_v8a/
  2. 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
  3. 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

  1. Remove any existing installation of the app
  2. Install all of the APKs in one go, e.g.
    adb install-multiple base.apk split_config.arm64_v8a.apk ...