Skip to content

Instantly share code, notes, and snippets.

@samuelchanx
Last active October 28, 2022 10:26
Show Gist options
  • Select an option

  • Save samuelchanx/9fb78e8d3546cfda601f1b85b8427896 to your computer and use it in GitHub Desktop.

Select an option

Save samuelchanx/9fb78e8d3546cfda601f1b85b8427896 to your computer and use it in GitHub Desktop.
Android create a new secret key #android

How to create a new key

mkdir secrets
keytool -genkey -v -keystore ./secrets/upload-keystore.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key

Android setup

build.gradle update

signingConfigs {
    release {
        keyAlias localProperties['keyAlias']
        keyPassword localProperties['keyPassword']
        storeFile localProperties['storeFile'] ? file(localProperties['storeFile']) : null
        storePassword localProperties['storePassword']
    }
}

buildTypes {
    release {
        signingConfig signingConfigs.release
        minifyEnabled true
        shrinkResources true
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}

local.properties update

storePassword=xxxxxxx
keyPassword=xxxxxxx
keyAlias=key
storeFile=./../../secrets/key.jks

REF

https://docs.flutter.dev/deployment/android#create-an-upload-keystore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment