客户端默认指向 jxd.jinniu.ink 的 HTTPS/WSS;登录后把 OpenIM userID 设为极光 alias。 华为 agconnect-services.json 不伪造、不入库。Master Secret 只从服务器文件注入。 Co-authored-by: multica-agent <github@multica.ai>
80 lines
2.8 KiB
Kotlin
80 lines
2.8 KiB
Kotlin
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")
|
||
}
|
||
|
||
// 华为 agconnect-services.json 到位后才启用 AGConnect 插件,避免缺文件时整包编不过。
|
||
// 文件从华为 AppGallery Connect 下载,放到本目录,不要提交进 Git。
|
||
val agconnectServices = file("agconnect-services.json")
|
||
if (agconnectServices.exists()) {
|
||
apply(plugin = "com.huawei.agconnect")
|
||
}
|
||
|
||
android {
|
||
namespace = "cn.solsum.jinxunda"
|
||
compileSdk = flutter.compileSdkVersion
|
||
ndkVersion = flutter.ndkVersion
|
||
|
||
compileOptions {
|
||
sourceCompatibility = JavaVersion.VERSION_17
|
||
targetCompatibility = JavaVersion.VERSION_17
|
||
}
|
||
|
||
defaultConfig {
|
||
applicationId = "cn.solsum.jinxunda"
|
||
// 极光厂商通道插件要求 minSdk 24
|
||
minSdk = 24
|
||
targetSdk = flutter.targetSdkVersion
|
||
versionCode = flutter.versionCode
|
||
versionName = flutter.versionName
|
||
manifestPlaceholders["JPUSH_PKGNAME"] = "cn.solsum.jinxunda"
|
||
manifestPlaceholders["JPUSH_APPKEY"] = "95fc2352648a7d4568ac8d72"
|
||
manifestPlaceholders["JPUSH_CHANNEL"] = "developer-default"
|
||
}
|
||
|
||
// 压缩打包 .so(默认未压缩存储,OpenIM/WebRTC 的 native 库让包多占近一倍体积);
|
||
// 代价是安装时多解压一次,对内网分发来说体积更关键。
|
||
packaging {
|
||
jniLibs {
|
||
useLegacyPackaging = true
|
||
}
|
||
}
|
||
|
||
buildTypes {
|
||
release {
|
||
// OpenIM 插件靠反射按字段名分发方法调用,R8/混淆会把字段改名导致
|
||
// 所有 SDK 调用静默无响应(表现为 initSDK 永久不返回)。
|
||
// 与官方样板工程一致:release 关闭混淆和资源压缩。
|
||
isMinifyEnabled = false
|
||
isShrinkResources = false
|
||
// 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")
|
||
}
|
||
}
|
||
}
|
||
|
||
kotlin {
|
||
compilerOptions {
|
||
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
|
||
}
|
||
}
|
||
|
||
flutter {
|
||
source = "../.."
|
||
}
|
||
|
||
// livekit_client 插件硬编码 compileSdk = 34,但它依赖的 flutter_webrtc 要求消费者 ≥36,
|
||
// AAR 元数据校验会因此失败。:app 先于各插件求值(根脚本有 evaluationDependsOn(":app")),
|
||
// 所以在插件求值完成后把它的 compileSdk 抬到 36。
|
||
rootProject.subprojects {
|
||
if (name == "livekit_client") {
|
||
afterEvaluate {
|
||
extensions.configure<com.android.build.gradle.LibraryExtension> {
|
||
compileSdk = 36
|
||
}
|
||
}
|
||
}
|
||
}
|