- 生成 release.jks 正式签名密钥库 - build.gradle.kts 配置 release 签名自动读取 key.properties - .gitignore 排除 keystore 和 key.properties - 截图调整为 6.5 寸规格 (1242x2688) Co-Authored-By: Claude <noreply@anthropic.com>
59 lines
1.6 KiB
Plaintext
59 lines
1.6 KiB
Plaintext
plugins {
|
|
id("com.android.application")
|
|
id("kotlin-android")
|
|
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
|
|
id("dev.flutter.flutter-gradle-plugin")
|
|
}
|
|
|
|
// 加载正式签名配置
|
|
val keystorePropertiesFile = rootProject.file("key.properties")
|
|
val keystoreProperties = java.util.Properties()
|
|
if (keystorePropertiesFile.exists()) {
|
|
keystoreProperties.load(keystorePropertiesFile.inputStream())
|
|
}
|
|
|
|
android {
|
|
namespace = "com.datalumina.YYA"
|
|
compileSdk = flutter.compileSdkVersion
|
|
ndkVersion = flutter.ndkVersion
|
|
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
}
|
|
|
|
kotlinOptions {
|
|
jvmTarget = JavaVersion.VERSION_17.toString()
|
|
}
|
|
|
|
defaultConfig {
|
|
applicationId = "com.datalumina.YYA"
|
|
minSdk = flutter.minSdkVersion
|
|
targetSdk = flutter.targetSdkVersion
|
|
versionCode = flutter.versionCode
|
|
versionName = flutter.versionName
|
|
}
|
|
|
|
// 正式签名配置
|
|
signingConfigs {
|
|
create("release") {
|
|
if (keystorePropertiesFile.exists()) {
|
|
keyAlias = keystoreProperties["keyAlias"] as String?
|
|
keyPassword = keystoreProperties["keyPassword"] as String?
|
|
storeFile = keystoreProperties["storeFile"]?.let { file(it) }
|
|
storePassword = keystoreProperties["storePassword"] as String?
|
|
}
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
signingConfig = signingConfigs.getByName("release")
|
|
}
|
|
}
|
|
}
|
|
|
|
flutter {
|
|
source = "../.."
|
|
}
|