如何使用新上传密钥签署AAB捆绑包(没有密钥密码)

发布于 2025-02-11 08:17:57 字数 2487 浏览 2 评论 0原文

最近,我们必须在Google Play商店(内部轨道)上注册一个新的上传密钥,尽管该设置似乎与以前的方法有所不同,该方法在使用KeyTool上使用键盘上的键时在<<<代码> .jks 格式

我们最初存储corporfile&amp; StorePassword以及多个键&lt; key&lt; straip&gt; passwordkeystore.properties文件中效果正常,我们的build.gradle.gradle在我们的产品上循环循环,将每个签名配置分配给风味。

但是,现在,按照Google Play控制台指示在CLI中运行它以生成新证书:

keytool -genkeypair -alias upload -keyalg RSA -keysize 2048 -validity 9125 -keystore keystore.jks

keytool -export -rfc -alias upload -file upload_certificate.pem -keystore keystore.jks 

创建了上传密钥,但没有提示输入密钥密码。

因此,现在我想知道如何在运行Gradle Bundle&gt; Release&gt;版本命令时如何构建该应用程序?

为了更清楚我们当前的设置:

def keystorePropertiesFile = rootProject.file("keystore.properties")
def keystoreProperties = new Properties()
keystorePropertiesFileExists && keystoreProperties.load(new FileInputStream(keystorePropertiesFile))

android {
    ndkVersion rootProject.ext.ndkVersion
    compileSdkVersion rootProject.ext.compileSdkVersion
    signingConfigs { }
    defaultConfig {
        applicationId <application-id>
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        resValue "string", "build_config_package", <application-id>
    }
    flavorDimensions "default"
    productFlavors {
        Staging { applicationId "<application-id>.staging" }
        RC { applicationId "<application-id>.rc" }
        Production {}
    }
    buildTypes {
        debug { signingConfig null }
        release {
            productFlavors.all { flavor ->
                flavor.signingConfig = android.signingConfigs.create("${flavor.name}")
                flavor.signingConfig.storeFile = rootProject.file(keystoreProperties["storeFile"])
                flavor.signingConfig.storePassword = keystoreProperties["storePassword"]
                flavor.signingConfig.keyAlias = keystoreProperties["keyAlias${flavor.name}"]
                flavor.signingConfig.keyPassword = keystoreProperties["keyPassword${flavor.name}"]
            }
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
            debuggable false
        }
    }

我们还使用Fastlane来处理我们的上传,是否需要对此进行修改的特定命令(我看不到)?

谢谢!

Recently, we had to register a new upload key on our app in the google play store (internal track), though the setup seems a little different from our previous approach that requested a password on the key alias when creating a key using keytool on .jks format

We originally stored the storeFile & storePassword along with multiple key<Flavor>Alias & key<Flavor>Password in a keystore.properties file which worked fine, and our build.gradle looped over our product flavors assigning each signing config to the flavor.

Now though, when running this in the CLI as instructed by google play console to generate a new certificate:

keytool -genkeypair -alias upload -keyalg RSA -keysize 2048 -validity 9125 -keystore keystore.jks

keytool -export -rfc -alias upload -file upload_certificate.pem -keystore keystore.jks 

the upload key was created, but it did not prompt for a key password.

So now I'm wondering how to build the app without having it signed when running the gradle bundle<Flavour>Release command?

For more clarity on our current setup:

def keystorePropertiesFile = rootProject.file("keystore.properties")
def keystoreProperties = new Properties()
keystorePropertiesFileExists && keystoreProperties.load(new FileInputStream(keystorePropertiesFile))

android {
    ndkVersion rootProject.ext.ndkVersion
    compileSdkVersion rootProject.ext.compileSdkVersion
    signingConfigs { }
    defaultConfig {
        applicationId <application-id>
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        resValue "string", "build_config_package", <application-id>
    }
    flavorDimensions "default"
    productFlavors {
        Staging { applicationId "<application-id>.staging" }
        RC { applicationId "<application-id>.rc" }
        Production {}
    }
    buildTypes {
        debug { signingConfig null }
        release {
            productFlavors.all { flavor ->
                flavor.signingConfig = android.signingConfigs.create("${flavor.name}")
                flavor.signingConfig.storeFile = rootProject.file(keystoreProperties["storeFile"])
                flavor.signingConfig.storePassword = keystoreProperties["storePassword"]
                flavor.signingConfig.keyAlias = keystoreProperties["keyAlias${flavor.name}"]
                flavor.signingConfig.keyPassword = keystoreProperties["keyPassword${flavor.name}"]
            }
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
            debuggable false
        }
    }

We also use fastlane to handle our uploads with supply, are the specific commands (I can't see any) that would need to be amended for this?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文