Files
ElderlyDialerMdm/app/build.gradle
T
tongtong 2fbe3a6a66 build(mdm): 改用 UltimateBarX 0.8.1 本地 AAR
本地 AAR 不携带传递依赖,显式补充 fragment、startup-runtime 与 material;
.gitignore 放行该 AAR 以便随仓库分发。
2026-11-14 16:06:37 +08:00

156 lines
5.1 KiB
Groovy
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
apply plugin: 'com.android.application'
static def appName() {
return "ElderlyDialerMdm"
}
static def releaseTime() {
return new Date().format("yyyyMMdd_HHmmss", TimeZone.getDefault())
}
android {
namespace "com.ttstd.sn"
compileSdkVersion 33
defaultConfig {
applicationId "com.ttstd.sn"
//There are no CERT files because If the mini sdk version is 23+, the AGP will ignore the V1 scheme signature.
minSdkVersion 23
targetSdkVersion 33
versionCode 1
versionName "1.0.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
ndk {
//选择要添加的对应 cpu 类型的 .so 库。
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildFeatures {
dataBinding true
buildConfig true
aidl true
}
// 平台维度:honor(荣耀 MagicOS)/ huawei(华为 MDM Kit)/ emui(华为 EMUI)
flavorDimensions "platform"
productFlavors {
honor {
dimension "platform"
versionNameSuffix "_honor"
buildConfigField "String", "PLATFORM", '"honor"'
}
huawei {
dimension "platform"
versionNameSuffix "_huawei"
buildConfigField "String", "PLATFORM", '"huawei"'
}
emui {
dimension "platform"
versionNameSuffix "_emui"
buildConfigField "String", "PLATFORM", '"emui"'
}
}
buildTypes {
debug {
debuggable true
versionNameSuffix "_debug"
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
release {
//混淆
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
// Add application variant configuration here instead
applicationVariants.all { variant ->
variant.outputs.each { output ->
def buildType = variant.buildType.name
def flavorName = variant.flavorName
if (buildType.contains("debug")) {
output.outputFileName = "app_${flavorName}_debug.apk"
} else {
output.outputFileName = "${appName()}_${flavorName}_${variant.versionCode}_V${variant.versionName}_${releaseTime()}_${buildType}.apk"
}
}
}
}
dependencies {
// 荣耀 MDM SDK(compileOnly,仅编译期)
honorCompileOnly files('libs/magic-android-34.38.1.200.jar')
// 华为 MDM Kit(compileOnly,仅编译期)
huaweiCompileOnly 'com.huawei.mdm:mdmkit:11.1.0.300'
// 华为 HEM License SDK(可选,需要授权校验时放开)
//huaweiImplementation 'com.huawei.hms:hemsdk:1.0.4.303'
// 华为 EMUI MDM SDK(compileOnly,仅编译期)
emuiCompileOnly files('libs/hw_emui_11.0.1_20210408.jar')
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.1.0'
//Annotations(BaseRxService 使用 @NotNull)
implementation 'org.jetbrains:annotations:24.0.1'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
//RxJava
implementation 'io.reactivex.rxjava3:rxjava:3.0.0'
implementation 'io.reactivex.rxjava3:rxandroid:3.0.0'
//生命周期管理
implementation 'com.trello.rxlifecycle4:rxlifecycle:4.0.2'
implementation 'com.trello.rxlifecycle4:rxlifecycle-android:4.0.2'
implementation 'com.trello.rxlifecycle4:rxlifecycle-components:4.0.2'
implementation 'com.trello.rxlifecycle4:rxlifecycle-android-lifecycle:4.0.2'
//图片加载框架
implementation 'com.github.bumptech.glide:glide:4.13.2'
annotationProcessor 'com.github.bumptech.glide:compiler:4.13.2'
//状态栏透明
// UltimateBarX-Java :ultimatebarx:assembleRelease 产物;本地 AAR 不携带传递依赖。
implementation files('libs/ultimatebarx-0.8.1-release.aar')
implementation 'androidx.fragment:fragment:1.3.1'
implementation 'androidx.startup:startup-runtime:1.0.0'
implementation 'com.google.android.material:material:1.2.1'
}
// 在 dependencies 之后添加
project.afterEvaluate {
android.applicationVariants.all { variant ->
variant.javaCompileProvider.get().options.bootstrapClasspath = files(
file('libs/framework.jar'),
android.getBootClasspath()
)
}
}