ax / apk.sh

apk.sh makes reverse engineering Android apps easier, automating some repetitive tasks like pulling, decoding, rebuilding and patching an APK.
GNU General Public License v3.0
3.34k stars 189 forks source link

Make sure com.android.vending.splits.required = false #25

Closed jeromew closed 11 months ago

jeromew commented 1 year ago

Fixes the single apk build as per issue #23

jeromew commented 11 months ago

For a bit of documentation :

the current code patches android:isSplitRequired This attr has been deprecated - cf https://developer.android.com/reference/android/R.attr#isSplitRequired

image

The new requiredSplitTypes is documented as

image

I also found an old (now deleted) answer on stack overflow that stated something along the line of

for APKs generated by Google Play, a meta-data element is added to the Android manifest of the base APK that mentions that splits are required for the app to function properly.
the meta-data is called com.android.vending.splits.required.
Note that the meta-data is only present in the base APK not in the config split APKs. But config split APKs have the "split" attribute set in the manifest.
This is not documented since it's an internal implementation detail.

So there seems to be 2 kind of Bundle/Split Apks :

This PR is a step towards and necessary for rebuilding a single-apk out of a splitted-apk that was bundled / generated by Google Play.