一键导入
android-signing
Generate keystores, enrol in Play App Signing, and understand v1/v2/v3/v4 APK signature schemes. Use this when setting up Android release signing.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Generate keystores, enrol in Play App Signing, and understand v1/v2/v3/v4 APK signature schemes. Use this when setting up Android release signing.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use Apple's phased release for automatic updates on iOS — behavior, pausing, resuming, and interaction with manual updates. Use this when shipping production iOS builds.
Use Play percentage rollouts and iOS phased release to limit blast radius. Use this when planning or operating a production release.
Diagnose and fix common Apple and Google code-signing errors. Use this when a release build fails to sign, upload, or install.
Manage Apple certificates, provisioning profiles, automatic vs manual signing, and fastlane match. Use this when setting up iOS release signing.
Publish Android apps to Amazon Appstore, Huawei AppGallery, Samsung Galaxy Store, and deal with HMS vs GMS. Use this when targeting non-Google Android markets.
Release to the App Store using App Store Connect, TestFlight, metadata, and screenshots. Use this when shipping an iOS build to Apple.
| name | android-signing |
| description | Generate keystores, enrol in Play App Signing, and understand v1/v2/v3/v4 APK signature schemes. Use this when setting up Android release signing. |
Signing is the single most brittle step of an Android release. Get it right once, lock it down, and never touch it again.
Generate a 25-year RSA 2048 upload key (never commit the file):
keytool -genkey -v \
-keystore upload-keystore.jks \
-keyalg RSA -keysize 2048 -validity 9125 \
-alias upload \
-storetype JKS \
-storepass "$KEYSTORE_PASSWORD" \
-keypass "$KEY_PASSWORD" \
-dname "CN=My Company, OU=Mobile, O=My Company, L=City, S=State, C=US"
Store the .jks file, KEYSTORE_PASSWORD, KEY_ALIAS, KEY_PASSWORD in your CI secret store and 1Password. Losing the key means losing the ability to update the app unless you're on Play App Signing.
android/key.properties (git-ignored):
storeFile=../upload-keystore.jks
storePassword=...
keyAlias=upload
keyPassword=...
android/app/build.gradle.kts:
val keystoreProperties = Properties().apply {
val f = rootProject.file("key.properties")
if (f.exists()) load(FileInputStream(f))
}
android {
signingConfigs {
create("release") {
storeFile = file(keystoreProperties["storeFile"] as String)
storePassword = keystoreProperties["storePassword"] as String
keyAlias = keystoreProperties["keyAlias"] as String
keyPassword = keystoreProperties["keyPassword"] as String
}
}
buildTypes {
release { signingConfig = signingConfigs.getByName("release") }
}
}
Google holds the app signing key; you hold the upload key. Benefits:
Enrol at Play Console → Setup → App integrity → App signing. Upload your upload certificate (.pem), not the private key.
| Scheme | Protects | Added |
|---|---|---|
| v1 (JAR) | Individual files inside the APK | Android 1.0 |
| v2 (APK) | The entire APK (faster install, tamper-proof) | Android 7.0 |
| v3 (APK) | v2 + key rotation | Android 9.0 |
| v4 (APK) | Incremental install (.apk.idsig) | Android 11 |
AGP 8.4+ signs with v1+v2+v3 by default. v4 is emitted automatically for bundletool build-apks --local-testing.
keytool -export -rfc \
-keystore upload-keystore.jks \
-alias upload \
-file upload_certificate.pem
Upload this .pem to Play Console when enrolling.
apksigner verify --verbose --print-certs app-release.apk
bundletool validate --bundle=app-release.aab
Confirm the SHA-256 matches the fingerprint Play shows under App integrity.
- name: Decode keystore
run: |
echo "$ANDROID_KEYSTORE_BASE64" | base64 -d > android/upload-keystore.jks
cat > android/key.properties <<EOF
storeFile=../upload-keystore.jks
storePassword=${{ secrets.KEYSTORE_PASSWORD }}
keyAlias=${{ secrets.KEY_ALIAS }}
keyPassword=${{ secrets.KEY_PASSWORD }}
EOF
If you suspect the upload key is compromised:
.pem)..jks everywhere.The app signing key is never rotated for existing apps.
jarsigner alone is insufficient for modern Android; always use apksigner (invoked by AGP).storeFile paths are relative to android/, not the project root — a leading ../ is usually required.keytool upgrades. Convert with keytool -importkeystore -srcstoretype JKS -deststoretype PKCS12.key.properties and *.jks git-ignored; CI decodes from base64 secret.signingConfig wired to release build type only.apksigner verify run on CI artifact before upload.docs/signing-rotation.md.