【发布时间】:2020-04-13 01:10:51
【问题描述】:
我需要使用特定的签名配置对产品风格进行签名。我在 stackoverflow 上找到了一些参考资料,例如 this 和 this。它适用于我的版本版本,但不适用于调试版本。我在 gradle 中有这个配置:
...
signingConfigs {
release {
storeFile file("../config/keystores/release_keystore")
storePassword "mysecurepassword"
keyAlias "myultrasecurealias"
keyPassword "myreallysecurekeypassword"
}
debug {
storeFile file("../config/keystores/debug.keystore")
storePassword "mysecurepassword"
keyAlias "myultrasecurealias"
keyPassword "myreallysecurekeypassword"
}
other {
storeFile file("../config/keystores/other")
storePassword "mysecurepassword"
keyAlias "myultrasecurealias"
keyPassword "myreallysecurekeypassword"
}
}
flavorDimensions "dim"
productFlavors {
production {
dimension "dim"
}
other {
dimension "dim"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
productFlavors.other.signingConfig signingConfigs.other
productFlavors.production.signingConfig signingConfigs.release
}
debug {
productFlavors.other.signingConfig signingConfigs.other
productFlavors.production.signingConfig signingConfigs.debug
}
}
这很适合otherRelease 的味道。但是当我使用构建配置otherDebug 时,我的APK 没有使用other 签名配置签名。
release 版本已正确签名。
有谁知道为什么在调试模式下签名配置没有按照配置应用?
【问题讨论】:
-
“但它不适用于 otherDebug” 定义“它不起作用”是什么意思。
-
抱歉,我想不清楚。正如我在
productFlavors.other.signingConfig signingConfigs.other中定义的那样,它没有使用我的other签名配置进行签名。我会更新我的问题。 -
它与哪个密钥库 签署?还是根本没有签名?
-
有没有简单的方法来获取签名信息?我没有找到。我所做的是将我的密码更改为无效密码,因此
release版本因密码错误而中断,debug组装了一个有效的 APK。我还在设备中安装了productionDebug,我可以将其替换为otherDebug,这意味着它们具有相同的签名信息(我没有收到任何关于签名差异的警告)。
标签: android gradle android-gradle-plugin build.gradle code-signing