2026-10-06 21:25:11 +08:00
|
|
|
|
import java.io.FileInputStream
|
|
|
|
|
|
import java.util.Properties
|
|
|
|
|
|
|
2026-10-06 21:04:38 +08:00
|
|
|
|
plugins {
|
|
|
|
|
|
id("com.android.application")
|
|
|
|
|
|
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
|
|
|
|
|
|
id("dev.flutter.flutter-gradle-plugin")
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-06 21:25:11 +08:00
|
|
|
|
// 正式签名配置:android/key.properties(不入库)提供密钥信息;
|
|
|
|
|
|
// 缺失时回退 debug 签名,保证无密钥环境也能构建。
|
|
|
|
|
|
val keystoreProperties = Properties()
|
|
|
|
|
|
val keystorePropertiesFile = rootProject.file("key.properties")
|
|
|
|
|
|
if (keystorePropertiesFile.exists()) {
|
|
|
|
|
|
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-06 21:04:38 +08:00
|
|
|
|
android {
|
|
|
|
|
|
namespace = "cc.sincos.sequence_diagram"
|
|
|
|
|
|
compileSdk = flutter.compileSdkVersion
|
|
|
|
|
|
ndkVersion = flutter.ndkVersion
|
|
|
|
|
|
|
|
|
|
|
|
compileOptions {
|
|
|
|
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
|
|
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
defaultConfig {
|
2026-10-11 21:38:18 +08:00
|
|
|
|
// 应用身份(applicationId):
|
2026-10-11 23:14:22 +08:00
|
|
|
|
// v1.3.10:sequence_diagram → cc.sincos.edc(首轮换身份);
|
|
|
|
|
|
// v1.3.12:cc.sincos.edc → cc.sincos.yide(名称定为「EDC易得」后
|
|
|
|
|
|
// 再次换新身份,彻底刷新桌面名称)。
|
2026-11-22 10:02:48 +08:00
|
|
|
|
// v1.3.13:品牌更名为「PDS流程设计套件」,applicationId 保持不变,
|
|
|
|
|
|
// 老用户可原地覆盖升级(桌面名称随应用 label 刷新)。
|
2026-10-11 23:14:22 +08:00
|
|
|
|
// 原因:部分安卓桌面会长期保留旧包身份的图标名(不随应用内更新刷新),
|
|
|
|
|
|
// 换新身份安装 = 系统当作全新应用处理,桌面必然按新包内的名称生成图标。
|
2026-10-11 21:38:18 +08:00
|
|
|
|
// 注意:namespace 与 Kotlin 包名保持不变(仅 applicationId 变化),因此
|
|
|
|
|
|
// AndroidManifest 中组件类名需写全限定名(见 android:name)。
|
2026-10-11 23:14:22 +08:00
|
|
|
|
applicationId = "cc.sincos.yide"
|
2026-10-06 21:04:38 +08:00
|
|
|
|
// You can update the following values to match your application needs.
|
|
|
|
|
|
// For more information, see: https://flutter.dev/to/review-gradle-config.
|
|
|
|
|
|
minSdk = flutter.minSdkVersion
|
|
|
|
|
|
targetSdk = flutter.targetSdkVersion
|
|
|
|
|
|
// Uses the version code from pubspec.yaml. When using split APKs, 1000 * ABI_VERSION
|
|
|
|
|
|
// is added automatically by Flutter. (https://developer.android.com/studio/build/configure-apk-splits#configure-APK-versions)
|
|
|
|
|
|
// You can force using the value of versionCode by specifying the `-P force-version-code-ignoring-abi=true`
|
|
|
|
|
|
// flag during build.
|
|
|
|
|
|
versionCode = flutter.versionCode
|
|
|
|
|
|
versionName = flutter.versionName
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-06 21:25:11 +08:00
|
|
|
|
signingConfigs {
|
|
|
|
|
|
create("release") {
|
|
|
|
|
|
if (keystorePropertiesFile.exists()) {
|
|
|
|
|
|
keyAlias = keystoreProperties["keyAlias"] as String
|
|
|
|
|
|
keyPassword = keystoreProperties["keyPassword"] as String
|
|
|
|
|
|
storeFile = rootProject.file(keystoreProperties["storeFile"] as String)
|
|
|
|
|
|
storePassword = keystoreProperties["storePassword"] as String
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-06 21:04:38 +08:00
|
|
|
|
buildTypes {
|
|
|
|
|
|
release {
|
2026-10-06 21:25:11 +08:00
|
|
|
|
// 有 key.properties 时使用正式签名;否则回退 debug 签名。
|
|
|
|
|
|
signingConfig = if (keystorePropertiesFile.exists()) {
|
|
|
|
|
|
signingConfigs.getByName("release")
|
|
|
|
|
|
} else {
|
|
|
|
|
|
signingConfigs.getByName("debug")
|
|
|
|
|
|
}
|
2026-10-06 21:04:38 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
kotlin {
|
|
|
|
|
|
compilerOptions {
|
|
|
|
|
|
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
flutter {
|
|
|
|
|
|
source = "../.."
|
|
|
|
|
|
}
|
2026-10-08 21:08:18 +08:00
|
|
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
|
|
// 应用内更新:FileProvider(把缓存中的新版本 APK 以 content:// 提供给系统安装器)。
|
|
|
|
|
|
implementation("androidx.core:core-ktx:1.13.1")
|
|
|
|
|
|
}
|