processing / processing-android

Processing mode and core library to create Android apps with Processing
http://android.processing.org
779 stars 293 forks source link

AAB(Android App Bundle) Support #671

Closed rupeshkumar22 closed 2 years ago

rupeshkumar22 commented 3 years ago

Fixes #594

As AAB is the only way to distribute apps on Google Play Console. This PR adds a feature to generate signed AAB and Unsigned AAB. For Testing purposes, a universal APK was created with the help of bundletool.jar(included in SDK) from generated AAB file and installed on the emulator. No issue has been faced by doing so.

Generates AAB files as- Documents/Processing/sketch_210923a/buildBundle/sketch_210923a_release_signed.aab Documents/Processing/sketch_210923a/buildBundle/sketch_210923a_release_unsigned.aab

Regenerates Bundles similar to export-package utility as - Documents/Processing/sketch_210923a/buildBundle.210924.0527/sketch_210923a_release_signed.aab Documents/Processing/sketch_210923a/buildBundle.210924.0527/sketch_210923a_release_unsigned.aab

Method of initiating the task File -> Export Signed Bundle

Keyboard Short Cut Ctrl + B

Capture

ranaaditya commented 3 years ago

Thanks for this amazing contribution @rupesh-kumar-lpu :partying_face:

Do you have any kind of high level design doc for this feature or a rough idea how you have done this with the existing processing-android codebase ?

Thanks.

rupeshkumar22 commented 3 years ago

For implementing this I tried to reuse the existing functions. The implementation is pretty much similar to the "Export Signed Package". The origin of implementation starts from the 'JMenuItem' click handler in the AndroidEditor.java file. All the functions used for "Export Signed Package" were reused with slight modification(providing certain function parameters) to distinguish the use of AAB or APK tasks. For example, KeystoreManager's constructor was modified to pass the boolean type (forBundle) to distinguish about the exporting task.

Thanks for reviewing the changes @ranaaditya

codeanticode commented 2 years ago

@rupesh-kumar-lpu thanks for the PR, will review and merge as soon as I can!

codeanticode commented 2 years ago

@rupesh-kumar-lpu Finally merged, thank you!

rupeshkumar22 commented 2 years ago

Thank you for taking out time to read too many lines of code 😊 @codeanticode @ranaaditya