diff --git a/scripts/signall.sh b/scripts/signall.sh index c15c9f2..2159349 100755 --- a/scripts/signall.sh +++ b/scripts/signall.sh @@ -71,6 +71,15 @@ USIGNCOMMENT="$(iniget "${CONFIG_INI:-config.ini}" "branch $branch" "usign_comme APKSIGNKEY="$(iniget "${CONFIG_INI:-config.ini}" "branch $branch" "apk_key")" fi +if [ -n "$APKSIGNKEY" ]; then + umask 077 + echo "$APKSIGNKEY" > "$tmpdir/apk.pem" + + umask 022 + find "$tmpdir/tar/" -type f -name "packages.adb" -exec \ + "${APK_BIN:-apk}" adbsign --allow-untrusted --sign-key "$(readlink -f "$tmpdir/apk.pem")" "{}" \; || finish 6 +fi + if echo "$GPGKEY" | grep -q "BEGIN PGP PRIVATE KEY BLOCK"; then umask 077 echo "$GPGPASS" > "$tmpdir/gpg.pass" @@ -105,15 +114,6 @@ if [ -n "$USIGNKEY" ]; then signify-openbsd -S -s "$(readlink -f "$tmpdir/usign.sec")" -m "{}" \; || finish 5 fi -if [ -n "$APKSIGNKEY" ]; then - umask 077 - echo "$APKSIGNKEY" > "$tmpdir/apk.pem" - - umask 022 - find "$tmpdir/tar/" -type f -name "packages.adb" -exec \ - "${APK_BIN:-apk}" adbsign --allow-untrusted --sign-key "$(readlink -f "$tmpdir/apk.pem")" "{}" \; || finish 6 -fi - tar -C "$tmpdir/tar/" -czf "$tarball" . || finish 6 finish 0