自习室优化ok

This commit is contained in:
zhutao
2025-11-28 13:31:23 +08:00
parent 4ecb0c35d6
commit 57305c5804
57 changed files with 2500 additions and 597 deletions

View File

@@ -1,10 +1,18 @@
import java.util.Properties
import java.io.FileInputStream
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
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 = Properties().apply {
load(FileInputStream(keystorePropertiesFile))
}
android {
namespace = "com.zkwl.xueguang"
compileSdk = flutter.compileSdkVersion
@@ -18,7 +26,14 @@ android {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
}
packagingOptions {
pickFirsts += setOf(
"lib/x86/libaosl.so",
"lib/x86_64/libaosl.so",
"lib/armeabi-v7a/libaosl.so",
"lib/arm64-v8a/libaosl.so"
)
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId = "com.zkwl.xueguang"
@@ -28,13 +43,31 @@ android {
targetSdk = flutter.targetSdkVersion
versionCode = flutter.versionCode
versionName = flutter.versionName
ndk {
abiFilters += listOf("arm64-v8a") // 只保留 arm64
}
}
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")
getByName("release") {
signingConfig = signingConfigs.getByName("release")
isMinifyEnabled = true // 开启混淆和代码压缩
}
}
val env = project.findProperty("env")?.toString() ?: "dev"
val channel = project.findProperty("channel")?.toString() ?: "dev"
applicationVariants.all {
outputs.all {
if (this is com.android.build.gradle.internal.api.ApkVariantOutputImpl) {
outputFileName = "学光_${channel}_${versionName}.apk"
}
}
}
}