This is part of my jenkins job configuration:

Build this job, and I get the .apk(s) here:

As you can see, all the .apk(s) are unsigned.
Now, How to sign one/all of these .apk files WITHOUT edit my build.gradle. I want to add a new task after the build, but I don't know where to configure my keystore and the generated apk path

Ahhhhhhh~ finally!! I solve my problem. (LOL....)
Here's the trick:
1. Add build step -> Execute shell:

2. edit command lines, format: jarsigner -verbose -sigalg MD5withRSA -digestalg SHA1 -keystore $KEYSTORE/JKS -storepass $PASSWORD -signedjar $SIGNED.APK $INPUT_UNSIGNED.APK $KEY_ALIAS
3. Post-build Actions -> add post-build action:

4. edit app/build/outputs/apk/*-signed.apk

After the Build Now operation, you will see the target signed apk files:

You can also click the (?) icon next to each field to get help.
The plugin page also links to detailed usage documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With