From 64502d7d4c00bae3427700c253f9b6ee981779cc Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 21 Nov 2026 23:42:18 -0600 Subject: [PATCH] fix(pm-stack): sign.sh reads the keystore password once apksigner takes one line from a password file each time the file is named. Passing the same file for --ks-pass and --key-pass made the second read hit end of file, so the first real signing run failed ("Failed to read Key password ... end of file reached"). The key in a PKCS#12 keystore uses the keystore password, which is apksigner's default when --key-pass is absent. Found by running it: workflow run 44988192986 built the unsigned APK, and this script failed on it on the host. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_01YLT5K1QVuzZjfWGFhXSSNF --- pm-stack/console/android/sign.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pm-stack/console/android/sign.sh b/pm-stack/console/android/sign.sh index eaf120ea80..3801ebdaef 100644 --- a/pm-stack/console/android/sign.sh +++ b/pm-stack/console/android/sign.sh @@ -37,8 +37,12 @@ if ! command -v apksigner >/dev/null 2>&1; then exit 1 fi +# No --key-pass: apksigner reads one line of a password file per use, so +# naming the same file twice fails with "end of file reached" on the +# second read. Without it, apksigner uses the keystore password for the +# key, which is how a PKCS#12 keystore is protected anyway. apksigner sign --ks "$keystore" --ks-type pkcs12 --ks-key-alias pmconsole \ - --ks-pass "file:$password_file" --key-pass "file:$password_file" \ + --ks-pass "file:$password_file" \ --out "$out" "$in" got="$(apksigner verify --print-certs "$out" | sed -n 's/^Signer #1 certificate SHA-256 digest: //p' | tr 'a-f' 'A-F' | sed 's/../&:/g; s/:$//')"