6

My question is related to Android apps whose developers push their app to the Play Store in the Android App Bundle format (i.e, *.aab file)

Consider a scenario I installed an app from the Play Store to my Android smartphone and then when I fetched the APK to my PC using the adb pull command, I found there is one base APK and there are some split APKs. Below is the image of the scenario which I am referring to.

Is it possible that I can generate a universal APK from these APKs (base and split APKs) without having the equivalent *.aab file so that I will be able to install the same universal APK to my smartphone?

7

Split APK file formats

Various app download sites were confronted with the same problem. They solved by defining custom file formats and installer for apps that consist of multiple APKs files:

  • There is the APKS file format which is is just a ZIP file containing the APK files. They can be installed using the APK Split installer app. Optionally APKS files can contain JSON based meta data (see linked file format spec).
  • ApkPure uses the XAPK file format. Basically an XAPK file is just a ZIP file containing the APK files plus a manifest.json file.
  • ApkMirror uses the proprietary APKM file format which can be installed using their installer app. Not sure how to build apkm youself

Manual installation of split APK files

You don't need to pack the downloaded split APK files to e.g. an Android Bundle file. adb is capable to install them again as one app, just use the install-multiple command and specify all the APK files that belong to your saved app:

adb install-multiple apk1 apk2 ...

Re-Building an universal APK

On the Internet you can find a tool named "SAP (Split APKs Packer)" which seems to allow to combine multiple split APK files into one universal APK file (if you have all the necessary split APK files)

This "SAP" tool is available for Linux and Windows, however it is closed source and contains a lot of binaries. I am not sure if it is really trustworthy - I would not recommend to execute it outside of a protected environment (e.g. a virtual machine).

The following blog post describes the SAP tool and provides download links.

3
  • Thanks a lot for such a detailed response. Can I create a universal apk from base and split apk such that if I am sharing it to some third person (say, through WhatsApp), he will be able to install that app, assuming we both have the same device configurations. – Nikhil_Coder Nov 22 '20 at 17:14
  • I would go for the APK Split installer app I linked in my answer. It can also export apps to that format and it is open source so the chance that it does only what it is supposed to do is very high. So your friend would only need that app for installing the created APKS file. – Robert Nov 22 '20 at 17:35
  • Actually nowadays you can install them all (XAPK, APKS, APKM,... ) using same app. Example using this one: play.google.com/store/apps/details?id=com.lb.app_manager . To install use any file-manager app and choose this app to install those apps. Can also work as directly on most apps that you got to reach the files, such as chatting apps, web browser apps, downloader apps, cloud apps (Drive) etc... – android developer Jan 18 at 23:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.