374 lines
15 KiB
Groovy
374 lines
15 KiB
Groovy
apply plugin: 'com.android.application'
|
||
|
||
static def appName() {
|
||
return "TTStdElderlyDialer"
|
||
}
|
||
|
||
static def releaseTime() {
|
||
return new Date().format("yyyyMMdd_HHmmss", TimeZone.getDefault())
|
||
}
|
||
|
||
android {
|
||
namespace "com.ttstd.dialer"
|
||
|
||
compileSdkVersion 33
|
||
// buildToolsVersion "36.0.0"
|
||
|
||
defaultConfig {
|
||
applicationId "com.ttstd.dialer"
|
||
|
||
//There are no CERT files because If the mini sdk version is 23+, the AGP will ignore the V1 scheme signature.
|
||
minSdkVersion 22
|
||
targetSdkVersion 33
|
||
versionCode 1
|
||
versionName "1.0"
|
||
|
||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||
|
||
vectorDrawables.useSupportLibrary = true
|
||
|
||
multiDexEnabled true
|
||
|
||
ndk {
|
||
//根据需要 自行选择添加的对应cpu类型的.so库。
|
||
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
||
// 还可以添加 'armeabi', 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64', 'mips', 'mips64'
|
||
}
|
||
|
||
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
|
||
}
|
||
|
||
javaCompileOptions {
|
||
annotationProcessorOptions {
|
||
arguments = [AROUTER_MODULE_NAME: project.getName()]
|
||
}
|
||
}
|
||
|
||
sourceSets {
|
||
main {
|
||
jniLibs.srcDir(['libs'])
|
||
}
|
||
}
|
||
|
||
manifestPlaceholders = [
|
||
JPUSH_PKGNAME : applicationId,
|
||
JPUSH_APPKEY : "d779178d9900d4fb5d633678", //JPush 上注册的包名对应的 Appkey.
|
||
JPUSH_CHANNEL : "developer-default", //暂时填写默认值即可.
|
||
MEIZU_APPKEY : "MZ-魅族的APPKEY",
|
||
MEIZU_APPID : "MZ-魅族的APPID",
|
||
XIAOMI_APPID : "小米的APPID",//JPush5.5.3开始,可以不添加MI-前缀.
|
||
XIAOMI_APPKEY : "小米的APPKEY",//JPush5.5.3开始,可以不添加MI-前缀.
|
||
OPPO_APPKEY : "OP-oppo的APPKEY",
|
||
OPPO_APPID : "OP-oppo的APPID",
|
||
OPPO_APPSECRET: "OP-oppo的APPSECRET",
|
||
VIVO_APPKEY : "vivo的APPKEY",
|
||
VIVO_APPID : "vivo的APPID",
|
||
HONOR_APPID : "honor的APPID",
|
||
NIO_APPID : "nio的APPID"
|
||
]
|
||
}
|
||
|
||
compileOptions {
|
||
sourceCompatibility JavaVersion.VERSION_1_8
|
||
targetCompatibility JavaVersion.VERSION_1_8
|
||
}
|
||
|
||
buildFeatures {
|
||
dataBinding true
|
||
buildConfig true
|
||
}
|
||
|
||
externalNativeBuild {
|
||
cmake {
|
||
path file('CMakeLists.txt')
|
||
}
|
||
}
|
||
|
||
signingConfigs {
|
||
keypub {
|
||
storeFile file(rootProject.ext.signingConfigs.keypub.storeFile)
|
||
storePassword rootProject.ext.signingConfigs.keypub.storePassword
|
||
keyAlias rootProject.ext.signingConfigs.keypub.keyAlias
|
||
keyPassword rootProject.ext.signingConfigs.keypub.keyPassword
|
||
}
|
||
|
||
crosshatch {
|
||
storeFile file(rootProject.ext.signingConfigs.crosshatch.storeFile)
|
||
storePassword rootProject.ext.signingConfigs.crosshatch.storePassword
|
||
keyAlias rootProject.ext.signingConfigs.crosshatch.keyAlias
|
||
keyPassword rootProject.ext.signingConfigs.crosshatch.keyPassword
|
||
}
|
||
|
||
zhanxun {
|
||
storeFile file(rootProject.ext.signingConfigs.zhanxun.storeFile)
|
||
storePassword rootProject.ext.signingConfigs.zhanxun.storePassword
|
||
keyAlias rootProject.ext.signingConfigs.zhanxun.keyAlias
|
||
keyPassword rootProject.ext.signingConfigs.zhanxun.keyPassword
|
||
}
|
||
}
|
||
|
||
buildTypes {
|
||
zhanRuiDebug.initWith(debug)
|
||
zhanRuiDebug {
|
||
debuggable true
|
||
signingConfig signingConfigs.zhanxun
|
||
}
|
||
|
||
zhanRuiRelease.initWith(release)
|
||
zhanRuiRelease {
|
||
signingConfig signingConfigs.zhanxun
|
||
}
|
||
|
||
CrosshatchDebug.initWith(debug)
|
||
CrosshatchDebug {
|
||
debuggable true
|
||
signingConfig signingConfigs.crosshatch
|
||
}
|
||
|
||
CrosshatchRelease.initWith(release)
|
||
CrosshatchRelease {
|
||
signingConfig signingConfigs.crosshatch
|
||
}
|
||
|
||
debug {
|
||
versionNameSuffix "_debug"
|
||
debuggable true
|
||
minifyEnabled false
|
||
//Zipalign优化
|
||
zipAlignEnabled true
|
||
signingConfig signingConfigs.keypub
|
||
}
|
||
|
||
release {
|
||
minifyEnabled false
|
||
//Zipalign优化
|
||
zipAlignEnabled true
|
||
//前一部分代表系统默认的android程序的混淆文件,该文件已经包含了基本的混淆声明,后一个文件是自己的定义混淆文件
|
||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||
//签名
|
||
signingConfig signingConfigs.keypub
|
||
}
|
||
}
|
||
|
||
// Add application variant configuration here instead
|
||
applicationVariants.all { variant ->
|
||
variant.outputs.each { output ->
|
||
def buildType = variant.buildType.name
|
||
def fileName = ""
|
||
|
||
if (buildType.contains("debug")) {
|
||
fileName = "${appName()}_V${defaultConfig.versionName}_${releaseTime()}.apk"
|
||
} else {
|
||
fileName = "${appName()}_${variant.versionCode}_V${variant.versionName}_${releaseTime()}_${buildType}.apk"
|
||
}
|
||
|
||
output.outputFileName = fileName
|
||
}
|
||
}
|
||
}
|
||
|
||
ext {
|
||
jpush = [version: "5.7.0"]
|
||
}
|
||
|
||
dependencies {
|
||
// implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||
compileOnly files('libs/framework.jar')
|
||
|
||
//Android 4.4+
|
||
implementation files('libs/QWeather_Public_Android_V5.1.2.jar')
|
||
implementation 'net.i2p.crypto:eddsa:0.3.0'
|
||
|
||
implementation project(path: ':niceimageview')
|
||
implementation project(path: ':iconloader')
|
||
|
||
//保持1.3.1 更新会报错
|
||
implementation 'androidx.appcompat:appcompat:1.3.1'
|
||
//2.0.4以上无法预览
|
||
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
||
implementation "androidx.multidex:multidex:2.0.1"
|
||
implementation "androidx.recyclerview:recyclerview:1.2.1"
|
||
// For control over item selection of both touch and mouse driven selection
|
||
implementation "androidx.recyclerview:recyclerview-selection:1.1.0"
|
||
// Java language implementation
|
||
implementation "androidx.fragment:fragment:1.4.1"
|
||
implementation "androidx.viewpager2:viewpager2:1.0.0"
|
||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||
// Room依赖
|
||
implementation "androidx.room:room-runtime:2.3.0"
|
||
implementation "androidx.room:room-rxjava3:2.3.0"
|
||
annotationProcessor "androidx.room:room-compiler:2.3.0"
|
||
// ViewModel和LiveData
|
||
implementation "androidx.lifecycle:lifecycle-viewmodel:2.3.0"
|
||
implementation "androidx.lifecycle:lifecycle-livedata:2.3.0"
|
||
implementation "androidx.lifecycle:lifecycle-runtime:2.3.0"
|
||
annotationProcessor "androidx.lifecycle:lifecycle-compiler:2.3.0"
|
||
// LifecycleService 核心库
|
||
implementation "androidx.lifecycle:lifecycle-service:2.3.0"
|
||
|
||
// 添加这行,使用 BOM 统一 Kotlin 相关库的版本
|
||
implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.10"))
|
||
|
||
testImplementation 'junit:junit:4.12'
|
||
androidTestImplementation 'androidx.test.ext:junit:1.3.0'
|
||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.7.0'
|
||
|
||
implementation 'com.google.android.material:material:1.0.0'
|
||
//glide
|
||
implementation 'com.github.bumptech.glide:glide:4.13.1'
|
||
annotationProcessor 'com.github.bumptech.glide:compiler:4.13.1'
|
||
// SVG支持库f
|
||
implementation 'com.caverock:androidsvg:1.4'
|
||
// 如果需要,添加Glide SVG模块(社区版)
|
||
// implementation 'com.github.qoqa:glide-svg:2.0.4'
|
||
|
||
//RxJava
|
||
implementation 'io.reactivex.rxjava3:rxjava:3.0.0'
|
||
implementation 'io.reactivex.rxjava3:rxandroid:3.0.0'
|
||
//
|
||
implementation 'com.squareup.okhttp3:okhttp:4.9.0'
|
||
implementation 'com.squareup.okhttp3:logging-interceptor:4.9.0'
|
||
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
||
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
||
// implementation 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
|
||
implementation "com.squareup.retrofit2:adapter-rxjava3:2.9.0"
|
||
//Gson
|
||
implementation 'com.google.code.gson:gson:2.9.0'
|
||
implementation 'com.google.zxing:core:3.5.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-components-preference:4.0.2'
|
||
implementation 'com.trello.rxlifecycle4:rxlifecycle-android-lifecycle:4.0.2'
|
||
|
||
|
||
implementation 'com.jakewharton.rxbinding4:rxbinding:4.0.0'
|
||
/*https://github.com/JeremyLiao/LiveEventBus*/
|
||
implementation 'com.jeremyliao:live-event-bus-x:1.7.3'
|
||
|
||
implementation 'com.facebook.rebound:rebound:0.3.8'
|
||
//MMKV
|
||
implementation 'com.tencent:mmkv-static:1.2.14'
|
||
//bugly
|
||
implementation 'com.tencent.bugly:crashreport:4.1.9.3'
|
||
implementation 'com.iqiyi.xcrash:xcrash-android-lib:3.0.0'
|
||
|
||
// 替换成最新版本, 需要注意的是api
|
||
// 要与compiler匹配使用,均使用最新版可以保证兼容
|
||
implementation 'com.alibaba:arouter-api:1.5.2'
|
||
annotationProcessor 'com.alibaba:arouter-compiler:1.5.2'
|
||
|
||
//推送
|
||
//阿里云
|
||
implementation 'com.aliyun.ams:alicloud-android-push:3.9.3'
|
||
|
||
//极光
|
||
// 此处以JPush 5.6.0 版本为例,注意:从 5.0.0 版本开始可以自动拉取 JCore 包,无需另外配置
|
||
implementation "cn.jiguang.sdk:jpush:$jpush.version"
|
||
//若不集成厂商通道,可直接跳过以下依赖
|
||
// 极光厂商插件版本与接入 JPush 版本保持一致,下同
|
||
// 接入华为厂商
|
||
implementation 'com.huawei.hms:push:6.13.0.300'
|
||
implementation "cn.jiguang.sdk.plugin:huawei:$jpush.version"
|
||
// 接入 FCM 厂商
|
||
implementation 'com.google.firebase:firebase-messaging:24.1.0'
|
||
implementation "cn.jiguang.sdk.plugin:fcm:$jpush.version"
|
||
// 接入魅族厂商
|
||
implementation "cn.jiguang.sdk.plugin:meizu:$jpush.version"
|
||
// JPush Android SDK v5.2.3 开始,需要单独引入 魅族 厂商 aar ,请下载官网 SDK 包并把 jpush-android-xxx-release/third-push/meizu/libs 下的 aar 文件单独拷贝一份到应用 module/libs 下
|
||
implementation files('libs/push-internal-5.0.5.aar')
|
||
// 接入 VIVO 厂商
|
||
implementation "cn.jiguang.sdk.plugin:vivo:$jpush.version"
|
||
// 接入小米厂商
|
||
implementation "cn.jiguang.sdk.plugin:xiaomi:$jpush.version"
|
||
// 接入 OPPO 厂商
|
||
implementation "cn.jiguang.sdk.plugin:oppo:$jpush.version"
|
||
// JPush Android SDK v4.6.0 开始,需要单独引入 oppo 厂商 aar ,请下载官网 SDK 包并把 jpush-android-xxx-release/third-push/oppo/libs 下的 aar 文件单独拷贝一份到应用 module/libs 下
|
||
implementation files('libs/com.heytap.msp_V3.7.1.aar')
|
||
//以下为 OPPO 3.1.0 aar需要依赖
|
||
implementation 'com.google.code.gson:gson:2.10.1'
|
||
implementation 'commons-codec:commons-codec:1.6'
|
||
implementation 'androidx.annotation:annotation:1.1.0'
|
||
// 接入荣耀厂商
|
||
implementation "cn.jiguang.sdk.plugin:honor:$jpush.version"
|
||
//需要单独引入荣耀厂商 aar ,请下载官网 SDK 包并把 jpush-android-xxx-release/third-push/honor/libs 下的 aar 文件单独拷贝一份到应用 module/libs 下
|
||
implementation files('libs/HiPushSDK-8.0.12.307.aar')
|
||
// 接入蔚来厂商
|
||
implementation "cn.jiguang.sdk.plugin:nio:$jpush.version"
|
||
//JPush Android SDK v5.6.0 开始需要单独引入蔚来厂商 aar ,请下载官网 SDK 包并把 jpush-android-xxx-release/third-push/nio/libs 下的 aar 文件单独拷贝一份到应用 module/libs 下
|
||
implementation files('libs/niopush-sdk-v1.0.aar')
|
||
|
||
|
||
//地图组件
|
||
implementation 'com.baidu.lbsyun:BaiduMapSDK_Map:7.6.4'
|
||
//基础定位组件
|
||
implementation 'com.baidu.lbsyun:BaiduMapSDK_Location:9.6.4'
|
||
//全量定位组件
|
||
// implementation 'com.baidu.lbsyun:BaiduMapSDK_Location_All:9.6.4'
|
||
|
||
//TTS组件
|
||
implementation 'com.baidu.lbsyun:NaviTts:3.2.13'
|
||
|
||
//指示器
|
||
implementation 'com.github.hackware1993:MagicIndicator:1.7.0'
|
||
//工具类
|
||
implementation 'com.blankj:utilcodex:1.31.0'
|
||
//aria
|
||
implementation 'com.arialyy.aria:core:3.8.15'
|
||
annotationProcessor 'com.arialyy.aria:compiler:3.8.15'
|
||
//状态栏透明
|
||
implementation 'com.gitee.zackratos:UltimateBarX:0.8.0'
|
||
//指示器
|
||
implementation 'com.github.hackware1993:MagicIndicator:1.7.0'
|
||
implementation 'com.opencsv:opencsv:5.5.2'
|
||
|
||
// 吐司框架:https://github.com/getActivity/Toaster
|
||
implementation 'com.github.getActivity:Toaster:12.6'
|
||
// 权限请求框架:https://github.com/getActivity/XXPermissions
|
||
implementation 'com.github.getActivity:XXPermissions:20.0'
|
||
//autosize会改变第三方view的大小
|
||
//https://github.com/JessYanCoding/AndroidAutoSize
|
||
// implementation 'me.jessyan:autosize:1.2.1'
|
||
|
||
}
|
||
|
||
// 在 dependencies 之后添加
|
||
project.afterEvaluate {
|
||
android.applicationVariants.all { variant ->
|
||
variant.javaCompileProvider.get().options.bootstrapClasspath = files(
|
||
file('libs/framework.jar'),
|
||
android.getBootClasspath()
|
||
)
|
||
}
|
||
}
|
||
|
||
//preBuild {
|
||
// doLast {
|
||
// def imlFile = file(project.name + ".iml")
|
||
//// def imlFile = file("..\\.idea\\modules\\" + project.name + "\\" + rootProject.name + "." + project.name + ".iml")
|
||
// println 'Change ' + project.name + '.iml order'
|
||
// try {
|
||
// def parsedXml = (new XmlParser()).parse(imlFile)
|
||
// def jdkNode = parsedXml.component[1].orderEntry.find { it.'@type' == 'jdk' }
|
||
// parsedXml.component[1].remove(jdkNode)
|
||
// def sdkString = "Android API " + android.compileSdkVersion.substring("android-".length()) + " Platform"
|
||
// println 'what' + sdkString
|
||
// new Node(parsedXml.component[1], 'orderEntry', ['type': 'jdk', 'jdkName': sdkString, 'jdkType': 'Android SDK'])
|
||
// groovy.xml.XmlUtil.serialize(parsedXml, new FileOutputStream(imlFile))
|
||
// } catch (FileNotFoundException e) {
|
||
// // nop, iml not found
|
||
// println "no iml found"
|
||
// }
|
||
// }
|
||
// //https://www.pianshen.com/article/93481144911/
|
||
// //https://blog.csdn.net/dhl_1986/article/details/102856026
|
||
// //https://blog.csdn.net/zhonghe1114/article/details/80923730
|
||
// //https://blog.csdn.net/u014175785/article/details/116235760
|
||
// //使用系统编译后的framework.jar
|
||
//}
|