Skip to content

Commit

Permalink
scripts: signall: fix wrong GPG signature on apk packages.adb index
Browse files Browse the repository at this point in the history
Currently the GPG signature verification of apk's packages.adb index
fails as the file is modified with `apk adbsign` after its GPG signed.

So lets fix by moving the `apk adbsign` before the GPG signing step.

Fixes: a94d4e1 ("add APK signing logic")
Signed-off-by: Petr Štetiar <[email protected]>
  • Loading branch information
ynezz committed Sep 28, 2024
1 parent 339e00d commit 51c39d5
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions scripts/signall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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

0 comments on commit 51c39d5

Please sign in to comment.