Android Question B4ABuilder, how do i make it perform custom build action and sign with specific key?

ema01

Member
Licensed User
Longtime User
Hello, I want to use B4ABuilder (B4A 10.7) to automate builds of a project that has multiple configurations, but i have two questions.

The first is: does B4ABuilder perform CustomBuildAction(s)?
It seems not. This project uses different assets depending on configuration.
Before compilation the assets (including icons) are copied to the file section using a CustomBuildAction.
After result.apk is generated there is another CustomBuildAction that copies result.apk to another folder and set the appropriate name for the package.
Both actions are not being performed.
Not a big deal as i can just add them in the script (though having to remember to sync project file and script if anything changes) but i wanted to know if it's expected or if it should work instead

The second question is: Can i pass the keystore file + password to the builder so it can be signed with it without having to change in the project file from debug key (during development) and store key (for release)?
If it can't i suppose i will have to edit the script to manually sign the APK after generation, which again is not a big deal, i'm already using it in a project in which i had to switch over to google play signing that doesn't use keystore files as it is in default B4A, altough i don't know how it will work for app bundles

(clarification: i've not used app bundles yet so i don't know what steps are required)

Thanks :)
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
The first is: does B4ABuilder perform CustomBuildAction(s)?
No. As you write, it shouldn't be too complicated to integrate these actions in a batch file that copies the files and then runs B4ABuilder.

About the keys, you have several options. You can use the various #SignKey attributes together with different build configurations, or you can compile without signing and sign yourself in the batch file.
 
Upvote 0

ema01

Member
Licensed User
Longtime User
Thanks Erel for confirming, i will change the script as needed.

I don't know if it's possible but i wish for you to consider adding a flag to B4ABuilder so it can optionally execute CustomBuildActions.
The reason is simple: i'll have to write the custom actions only in one place so there is no risk of forgetting to update the script or the project file when something is changed

For the key, i think i'll go with manually signing the package. the SignKey attribute is not what i'm looking for, unless there was a way i can pass a conditional symbol from B4ABuilder, like if i the symbol SIGNWITHKEY is defined then #SignKey
 
Upvote 0
Top