ver1.00.00
update2
This commit is contained in:
@@ -1,10 +1,21 @@
|
||||
import com.android.build.api.dsl.SigningConfig
|
||||
import java.util.Properties
|
||||
|
||||
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")
|
||||
}
|
||||
|
||||
// 加载 key.properties 配置 👇
|
||||
val keystoreProperties = Properties()
|
||||
val keystoreFile = rootProject.file("key.properties")
|
||||
if (keystoreFile.exists()) {
|
||||
keystoreFile.inputStream().use { stream ->
|
||||
keystoreProperties.load(stream)
|
||||
}
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "org.ast.unionapp"
|
||||
compileSdk = flutter.compileSdkVersion
|
||||
@@ -20,25 +31,37 @@ android {
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
applicationId = "org.ast.unionapp"
|
||||
// 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
|
||||
versionCode = flutter.versionCode
|
||||
versionName = flutter.versionName
|
||||
}
|
||||
|
||||
// 签名配置 👇
|
||||
signingConfigs {
|
||||
create("release") {
|
||||
keyAlias = keystoreProperties["keyAlias"] as String
|
||||
keyPassword = keystoreProperties["keyPassword"] as String
|
||||
storeFile = file(keystoreProperties["storeFile"] as String)
|
||||
storePassword = keystoreProperties["storePassword"] as String
|
||||
}
|
||||
}
|
||||
|
||||
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.getByName("debug")
|
||||
// 启用正式签名(替换原来的 debug)
|
||||
signingConfig = signingConfigs.getByName("release")
|
||||
isMinifyEnabled = true
|
||||
isShrinkResources = true
|
||||
proguardFiles(
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
"proguard-rules.pro"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
flutter {
|
||||
source = "../.."
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,24 @@
|
||||
allprojects {
|
||||
repositories {
|
||||
// ✅ 阿里云 Maven 镜像(推荐,稳定快速)
|
||||
maven { url = uri("https://maven.aliyun.com/repository/google") }
|
||||
maven { url = uri("https://maven.aliyun.com/repository/public") }
|
||||
maven { url = uri("https://maven.aliyun.com/repository/gradle-plugin") }
|
||||
maven { url = uri("https://storage.googleapis.com/download.flutter.io") }
|
||||
|
||||
// ✅ 腾讯云 Maven 镜像(备用)
|
||||
// maven { url = uri("https://mirrors.cloud.tencent.com/nexus/repository/maven-public/") }
|
||||
|
||||
// 官方源(放在最后作为备用)
|
||||
google()
|
||||
mavenCentral()
|
||||
maven { url = uri("https://storage.googleapis.com/download.flutter.io") }
|
||||
}
|
||||
|
||||
configurations.all {
|
||||
resolutionStrategy {
|
||||
force("androidx.work:work-runtime:2.8.1")
|
||||
force("androidx.work:work-runtime-ktx:2.8.1")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,3 +3,4 @@ distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip
|
||||
org.gradle.java.home=/Users/spasolreisa/Library/Java/JavaVirtualMachines/jbr-17.0.14/Contents/Home
|
||||
Reference in New Issue
Block a user