按用户要求把 dadao-release.jks 与 keystore.properties 入库,保证任何机器 clone 后可直接 assembleRelease;证书从 .local/keystore 挪到 android/keystore,.gitignore 对这两个文件开例外。仓库泄露即等于证书泄露,届时需换证书重新发版。
This commit is contained in:
@@ -30,6 +30,9 @@ android/local.properties
|
|||||||
# 发布签名证书与口令(只在发布者本机;仓库里没有它就用调试签名)
|
# 发布签名证书与口令(只在发布者本机;仓库里没有它就用调试签名)
|
||||||
android/keystore.properties
|
android/keystore.properties
|
||||||
*.jks
|
*.jks
|
||||||
|
# 例外:发布签名证书与口令按用户要求入库(私有仓库),保证任何机器 clone 下来都能出正式包
|
||||||
|
!android/keystore.properties
|
||||||
|
!android/keystore/dadao-release.jks
|
||||||
|
|
||||||
# 编辑器 / 系统
|
# 编辑器 / 系统
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ android {
|
|||||||
* 原因:CI 与受限沙箱里 `~/.android` 常常不可写,AGP 会去建
|
* 原因:CI 与受限沙箱里 `~/.android` 常常不可写,AGP 会去建
|
||||||
* `debug.keystore.lock` 然后 AccessDenied,构建在 validateSigningDebug 这一步失败。
|
* `debug.keystore.lock` 然后 AccessDenied,构建在 validateSigningDebug 这一步失败。
|
||||||
* 放在工程里就能在任何机器上直接 assembleDebug。
|
* 放在工程里就能在任何机器上直接 assembleDebug。
|
||||||
* 注意:这只是调试签名,release 必须换成真正的证书并走 secret 注入。
|
* 注意:这只是调试签名,release 用 android/keystore/dadao-release.jks。
|
||||||
*/
|
*/
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
getByName("debug") {
|
getByName("debug") {
|
||||||
@@ -53,11 +53,14 @@ android {
|
|||||||
keyPassword = "android"
|
keyPassword = "android"
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 发布签名从 android/keystore.properties 读,证书本身不进仓库。
|
* 发布签名从 android/keystore.properties 读。
|
||||||
*
|
*
|
||||||
* 没有这个文件(别人 clone 下来、CI 没注入)时回落到调试签名:
|
* 证书和口令按用户要求随私有仓库托管(.gitignore 对这两个文件开了例外),
|
||||||
* assembleRelease 依然能跑,只是装不上已经装了正式版的机器——
|
* 这样任何机器 clone 下来都能直接出正式包;代价是仓库泄露即等于证书泄露,
|
||||||
* 而这正是应该发生的:发布包的签名只能由发布者本人持有。
|
* 届时必须换证书并让 OTA 重新发版。
|
||||||
|
*
|
||||||
|
* 没有 keystore.properties 时回落到调试签名,assembleRelease 依然能跑,
|
||||||
|
* 只是装不上已经装了正式版的机器。
|
||||||
*/
|
*/
|
||||||
create("release") {
|
create("release") {
|
||||||
val file = rootProject.file("keystore.properties")
|
val file = rootProject.file("keystore.properties")
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
# 发布签名(证书与口令按用户明确要求随仓库托管,本仓库为私有库)
|
||||||
|
storeFile=keystore/dadao-release.jks
|
||||||
|
storePassword=dadao-release-2026
|
||||||
|
keyAlias=dadao
|
||||||
|
keyPassword=dadao-release-2026
|
||||||
Binary file not shown.
Reference in New Issue
Block a user