Example of how to do that here:
https://developer.android.com/build/building-cmdline#bundletool-build
Web Archive: http://web.archive.org/web/20241005113630/https://developer.android.com/build/building-cmdline#bundletool-build
tldr:
- aapt2 link phase use protobuf format, ie. aapt2 link --proto-format --auto-add-overlay
- package zip file differently:
manifest/AndroidManifest.xml <- AndroidManifest.xml no longer in root
dex/... <- will need to move classes.dex to dex/classes.dex
res/... <- stays the same
root/..., assets/..., and lib/... <- stays the same
resources.pb <- likely generated as part of aapt2 link --proto-format
- pass zip to:
bundletool build-bundle --modules=base.zip --output=mybundle.aab
- use
jarsigner for AAB instead of apksigner (only used for .apk files)
How should we approach this?
- Make
apk.installApk pass a flat to the internal function to say its an apk
- Create new
apk.installAab to internally work differently. So we can still build APKs.
- Aesthetics (low priority)
- Consider renaming
apk.zig to just artifact.zig, so android.Apk becomes android.Artifact
Example of how to do that here:
https://developer.android.com/build/building-cmdline#bundletool-build
Web Archive: http://web.archive.org/web/20241005113630/https://developer.android.com/build/building-cmdline#bundletool-build
tldr:
manifest/AndroidManifest.xml<- AndroidManifest.xml no longer in rootdex/...<- will need to moveclasses.dextodex/classes.dexres/...<- stays the sameroot/...,assets/..., andlib/...<- stays the sameresources.pb<- likely generated as part ofaapt2 link --proto-formatbundletool build-bundle --modules=base.zip --output=mybundle.aabjarsignerfor AAB instead ofapksigner(only used for .apk files)How should we approach this?
apk.installApkpass a flat to the internal function to say its anapkapk.installAabto internally work differently. So we can still build APKs.apk.zigto justartifact.zig, soandroid.Apkbecomesandroid.Artifact