You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow nightlies to be built & signed automatically via a cron job (squashed commits)
This is a combination of 2 commits.
----------
Allow nightlies to be built & signed automatically via a cron job (part 1 - gradle)
This commit modifies dSploit's build.gradle to fetch the signing configuration from Bash environment variables.
The following environment variables need to be set (i.e: in ~/.bashrc) for the apk signing to work properly.
$KEYSTORE_PATH -> the absolute path where the keystore is located
$KEYSTORE_PWD -> the keystore passphrase
$KEYSTORE_ALIAS -> the keystore alias to use
$KEYSTORE_ALIAS_PWD -> the password of the alias defined in the previous variable
$NIGHTLIES_OUT_DIR -> the directory where the signed apk should be copied-over once the build has completed successfully (see next commit)
Gradle debug tasks don't require those, so we can keep working in Android Studio peacefully.
But the `assembleRelease` gradle task will pick those up and sign the apk as defined in the environment variables.
See next commit for the crontab and the build script.
----------
Allow nightlies to be built & signed automatically via a cron job (part 2 - bash scripts/cron job)
This commit adds 2 scripts: `setup-cronjob.sh` & `nightly-build.sh`
+ setup-cronjob.sh:
This script is a wrapper used to generate a cronjob that will execute `nightly-build.sh` everyday at midnight.
The reason we use this script is to get the correct absolute path to the dsploit repository on the machine for the cronjob.
Alternatively, you can manually copy `nightly-build.sh` to /etc/cron.daily/ and modify its $DIR variable to point to the dsploit repo.
Another way would be to use crontab -e and add the following job:
00 00 * * * /bin/bash /path/to/dsploit/repo/nightly-build.sh
+ nightly-build.sh:
This script is used to build a signed version of the release flavor of dsploit.
It will:
* build the signed apk
* copy the signed apk to the directory the $NIGHTLIES_OUT_DIR environment variable points to, renamed with a timestamp
* same as the above, but renamed `latest.apk`
The main purpose of this script is to be executed automatically by cron everyday, on a server where the $NIGHTLIES_OUT_DIR points to an accessible location of its web server (i.e: that allows the download of the apk).
However, it can be used as a commodity script to manually build signed version of dsploit as well.
0 commit comments