Skip to content

Commit f783cf2

Browse files
authored
Fix nightly APK signing key format (#654)
1 parent 336c029 commit f783cf2

2 files changed

Lines changed: 2 additions & 8 deletions

File tree

.github/workflows/nightly_android.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ jobs:
134134
shell: bash
135135
env:
136136
ANDROID_NIGHTLY_CERT_PEM_BASE64: ${{ secrets.ANDROID_NIGHTLY_CERT_PEM_BASE64 }}
137-
ANDROID_NIGHTLY_KEY_PASSWORD: ${{ secrets.ANDROID_NIGHTLY_KEY_PASSWORD }}
138137
ANDROID_NIGHTLY_KEY_PK8_BASE64: ${{ secrets.ANDROID_NIGHTLY_KEY_PK8_BASE64 }}
139138
run: |
140139
set -euo pipefail
@@ -168,11 +167,7 @@ jobs:
168167
169168
"${zipalign}" -p -f 4 "${unsigned_apk}" "${aligned_apk}"
170169
171-
sign_args=(sign --key "${key_file}" --cert "${cert_file}" --out "${signed_apk}")
172-
if [[ -n "${ANDROID_NIGHTLY_KEY_PASSWORD:-}" ]]; then
173-
sign_args+=(--key-pass "pass:${ANDROID_NIGHTLY_KEY_PASSWORD}")
174-
fi
175-
"${apksigner}" "${sign_args[@]}" "${aligned_apk}"
170+
"${apksigner}" sign --key "${key_file}" --cert "${cert_file}" --out "${signed_apk}" "${aligned_apk}"
176171
"${apksigner}" verify --print-certs "${signed_apk}" > "${output_dir}/apksigner.txt"
177172
178173
sha256sum "${signed_apk}" > "${output_dir}/${APK_NAME}.sha256"

NIGHTLY_BUILDS.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,8 @@ Nightly signing does not use JKS or Gradle `signing.properties`.
3838

3939
The workflow signs the unsigned APK with Android SDK `apksigner` using:
4040

41-
- `ANDROID_NIGHTLY_KEY_PK8_BASE64`: Base64-encoded PKCS#8 private key file.
41+
- `ANDROID_NIGHTLY_KEY_PK8_BASE64`: Base64-encoded plain PKCS#8 private key file.
4242
- `ANDROID_NIGHTLY_CERT_PEM_BASE64`: Base64-encoded X.509 certificate file.
43-
- `ANDROID_NIGHTLY_KEY_PASSWORD`: optional password for an encrypted private key.
4443

4544
These values should be stored as repository or environment secrets. Do not commit them to the repository.
4645

0 commit comments

Comments
 (0)