Skip to content

Commit 8efcf4e

Browse files
DatafyingTechclaude
andcommitted
Android CI: tolerate whitespace in the keystore secret
A secret stored from a Windows pipe carries a CRLF, and base64 -d rejects it as invalid input. Strip whitespace before decoding and fail loudly if the result is empty. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
1 parent 380a2db commit 8efcf4e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

.github/workflows/android.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ jobs:
5757
exit 0
5858
fi
5959
KS="$RUNNER_TEMP/localflow.jks"
60-
printf '%s' "$ANDROID_KEYSTORE_B64" | base64 -d > "$KS"
60+
# Strip any whitespace/CR the secret may carry (a Windows pipe adds CRLF); base64 -d
61+
# rejects stray bytes with "invalid input".
62+
printf '%s' "$ANDROID_KEYSTORE_B64" | tr -d '\r\n\t ' | base64 -d > "$KS"
63+
if [ ! -s "$KS" ]; then echo "::error::keystore decoded to an empty file"; exit 1; fi
6164
chmod 600 "$KS"
6265
echo "ANDROID_KEYSTORE_FILE=$KS" >> "$GITHUB_ENV"
6366
echo "Keystore decoded to $KS ($(stat -c %s "$KS") bytes)"

0 commit comments

Comments
 (0)