How to sign aab bundle with new upload key (without key password)

Viewed 132

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!

0 Answers
Related