<app dir>/android/app/src/main/res/
keytool -genkey -v -keystore ~/key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key
keytool -genkey -v -keystore ./key.jks -storetype JKS -keyalg RSA -keysize 2048 -validity 10000 -alias key
<app dir>\android\key.properties
檔案
storePassword=密碼
keyPassword=密碼
keyAlias=key
storeFile=../../key.jks
<app dir>\android\app\build.gradle
檔
略
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android {
略
defaultConfig {
略
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.release
}
}
}
<app dir>/android/app/src/main/AndroidManifest.xml
修改app 顯示名稱
flutter build apk --split-per-abi --target-platform android-arm,android-arm64,android-x64