Android build
Flutter官方文档:https://flutterchina.club/android-release/#%E5%88%9B%E5%BB%BA-keystore
签名: keytool,需要提前安装jdk环境
利用Keytool 创建
keytool -genkey -v -keystore ~/key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key
查看key.jks内容
keytool -list -keystore key.jks
配置对应的key.properties
storePassword=123456
keyPassword=123456
keyAlias=android_key
storeFile=/Users/userName/android_key.jks
在app build.gradle中读取key.properties中的数据
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
网友评论