1. Enable the terminal cli mode
If the terminal command line window is not displayed in the lower left corner, right-click = “Open in Terminal” in the root directory of the project
2. Execute one of the following commands (the first one I used)
keytool -genkey -v -keystore F:\APP\sign.jks -keyalg RSA -keysize 2048 -validity 10000 -alias sign keytool -importkeystore -srckeystore D:/wmy. JKS -destkeystore D:/wmy. JKS -deststoreType pkCS12 // Switch to the industry-standard format
F:\APP\sign. JKS Generates the path where the signature is stored. During the execution, the key store password and key password are used for the second step
Select Y
Sign, storePass, and keypass are the alias, key store password, and sign file password respectively
View certificate SHA1:
keytool -list -v -keystore F:\APP\sign.jks -alias sign -storepass 123456 -keypass 123456
3. Set directory files
3.1 in Flutter engineering/android/app/key/sign JKS to create this directory. To create the key folder in the app directory, drag sign.jks in.
3.2 create key. Properites
Create this file in the Flutter project /android/key.properites. It reads as follows:
storePassword=123456
keyPassword=123456
keyAlias=sign
storeFile=key/sign.jks
3.3 configuration/android/app/build. Gradle file
You need to modify the build.gradle file in the app package and add the following configuration:
android { signingConfigs { release { keyAlias 'sign' keyPassword 'android' storeFile file('key/sign2.jks') storePassword 'android' } } buildTypes { release { signingConfig signingConfigs.release } } }
3.4 Run the flutter build APK