Closed asit-fdraschbacher closed 1 year ago
In fact, it seems the only way to make apkeep obtain a complete (executable) set of APKs is by running it twice: Once with -o split_apk=true
and once with split_apk=false
.
Unless I'm missing something, the APK obtained with split_apk=false is incomplete as well (it is in fact the base APK of the split APK set, not a multi APK).
By "base APK" do you mean the original, uploaded package? As I understand it, Google Play does not make this available, since it is in aab
format and not suitable for publication.
When an app (that was submitted as an AAB to Google Play) is downloaded on a device, Google Play servers generate a series of APK files that all need to be installed on the device. For all devices, the series includes the same "base" APK that contains the dex files (compiled Java code). The other "split" APK files depend on the specific device (there's a usually a split for the particular screen density, the particular language, and the processor ISA).
So, the installed app is effectively formed from multiple APK files that all need to be installed on the device, eg:
Your code only either downloads the base apk (base.apk - containing DEX files) or the split files (hdpi.apk, armeabi.apk). Both options are insufficient, as all APK files (base + all splits) are required to form a usable app installation.
It's a shame I cannot link to an official Google documentation here - they have used split APKs and multi APKs in different meanings over time. I recommend inspecting a real device using adb shell pm path com.example.someapp
- this will list all APK files that form the installation.
Thanks for the explainer. Prioritizing this issue.
Is it intentional that
-d google-play -o split_apk=true
only downloads the split APKs and not the base APK (which usually contains the dex code)? IMHO this renders the option unusable, since the downloaded packages cannot be installed and executed.