Files
CubeAoleyunSN/app/build.gradle
Fanhuitong 4f6a6cff93 version:zhanrui 6.3.3,MTK 2.3.3
fix:
update:重置只请求一次接口,增加网络波动记录接口
2023-01-13 18:56:10 +08:00

342 lines
12 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'
apply plugin: "com.tencent.android.tpns"
static def appName() {
return "AoleyunDeviceInfo"
}
static def releaseTime() {
return new Date().format("yyyyMMdd-HHmmss", TimeZone.getDefault())
}
android {
//Android Studio 4.0 之后使用这个但是会把jar打包进apk
// gradle.projectsEvaluated {
// tasks.withType(JavaCompile) {
// Set<File> fileSet = options.bootstrapClasspath.getFiles()
// List<File> newFileList = new ArrayList<>();
// //JAVA语法可连续调用输入参数建议为相对路径
// newFileList.add(new File("libs/framework.jar"))
// //最后将原始参数添加
// newFileList.addAll(fileSet)
// options.bootstrapClasspath = files(
// newFileList.toArray()
// )
// }
// }
compileSdkVersion 29
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.aoleyun.sn"
//There are no CERT files because If the mini sdk version is 23+, the AGP will ignore the V1 scheme signature.
minSdkVersion 24
targetSdkVersion 29
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
ndk {
//选择要添加的对应 cpu 类型的 .so 库。
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86'
// 还可以添加 'armeabi' , 'x86', 'x86_64', 'mips', 'mips64'
}
manifestPlaceholders = [
XG_ACCESS_ID : "1500026372",
XG_ACCESS_KEY: "AR7A1L5M0LPH",
]
buildConfigField "String", "ROOT_URL", '"https://led.aoleyun.cn/api/"'
buildConfigField "String", "SCREEN_BASE_URL", '"https://led.aoleyun.cn:2018/"'
buildConfigField "String", "SCREEN_URL", '"https://led.aoleyun.cn:2018/wm/is_online"'
buildConfigField "String", "WebsocketURL", '"wss://led.aoleyun.cn:2018"'
}
lintOptions {
checkReleaseBuilds false
}
dexOptions {
jumboMode true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
//多渠道
productFlavors {
// 展锐6.2.8.19
// MTK2.2.8.19
//新平台正式
newly {
flavorDimensions "default"
versionCode 21
versionName "3.0"
buildConfigField "String", "platform", '"ZhanRui"'
}
//酷比魔方
cube {
flavorDimensions "default"
versionCode 73
versionName "6.3.3"
buildConfigField "String", "platform", '"ZhanRuiCube"'
}
//MTK
MTKnewly {
flavorDimensions "default"
versionCode 43
versionName "2.3.3"
buildConfigField "String", "platform", '"MTK"'
}
}
sourceSets {
//测试版的图标
// beta.res.srcDirs = ['src/beta/res']
// newly.res.srcDirs = ['src/beta/res']
}
//签名
signingConfigs {
zhanRui {
storeFile file("keystore/zhanxun.keystore")
storePassword "123456"
keyAlias "zhanxun"
keyPassword "123456"
v1SigningEnabled true
v2SigningEnabled false
}
zhanRuiUserdebug {
storeFile file("keystore/zhanxunUserdebug.keystore")
storePassword "123456"
keyAlias "zhanxunUserdebug"
keyPassword "123456"
v1SigningEnabled true
v2SigningEnabled false
}
mtk {
storeFile file("keystore/xueshibaoos.jks")
storePassword "123456"
keyAlias "xueshibaoos"
keyPassword "123456"
v1SigningEnabled true
v2SigningEnabled true
}
}
// Disable release builds for now
android.variantFilter { variant ->
if (variant.buildType.name.endsWith('zhanRuiRelease')) {
variant.setIgnore(variant.getFlavors().get(0).name.equals('official') || variant.getFlavors().get(0).name.equals('zhongyou'))
}
if (name.startsWith('newly')) {
variant.setIgnore(name.endsWith("newlyDebug")
|| name.endsWith('newlyRelease'))
}
if (name.startsWith('cube')) {
variant.setIgnore(name.endsWith("cubeDebug")
|| name.endsWith('cubeRelease'))
}
if (name.contains("MTKnewly")) {
variant.setIgnore(variant.buildType.name.endsWith("zhanRuiRelease")
|| variant.buildType.name.endsWith("zhanRuiDebug")
|| variant.buildType.name.endsWith("zhanRuiUserdebug")
|| variant.buildType.name.endsWith("zhanRuiUserdebugReleas")
|| variant.buildType.name.endsWith("alldocubeDebug")
|| variant.buildType.name.endsWith("alldocubeDebugRelease")
)
}
// // Icon recents is Go only
// if (name.contains("WithQuickstepIconRecents") && !name.contains("l3go")) {
// variant.setIgnore(true)
// }
}
buildTypes {
zhanRuiDebug.initWith(debug)
zhanRuiDebug {
debuggable true
versionNameSuffix "-debug"
signingConfig signingConfigs.zhanRui
}
zhanRuiRelease.initWith(release)
zhanRuiRelease {
signingConfig signingConfigs.zhanRui
}
//userdebug rom使用这个版本
zhanRuiUserdebug.initWith(zhanRuiDebug)
zhanRuiUserdebug {
debuggable true
versionNameSuffix "-debug"
signingConfig signingConfigs.zhanRuiUserdebug
}
zhanRuiUserdebugReleas.initWith(release)
zhanRuiUserdebugReleas {
debuggable true
signingConfig signingConfigs.zhanRuiUserdebug
}
debug {
debuggable true
versionNameSuffix "-debug"
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
//Zipalign优化
zipAlignEnabled true
applicationVariants.all { variant ->
variant.outputs.each { output ->
def outputFile = output.outputFile
if (outputFile != null) {
def fileName = "${appName()}-${variant.versionCode}-V${variant.versionName}-${releaseTime()}-${buildType.name}.apk"
output.outputFileName = fileName
}
}
}
signingConfig signingConfigs.mtk
}
release {
//混淆
minifyEnabled false
//前一部分代表系统默认的android程序的混淆文件该文件已经包含了基本的混淆声明后一个文件是自己的定义混淆文件
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
//Zipalign优化
zipAlignEnabled true
applicationVariants.all { variant ->
variant.outputs.each { output ->
def outputFile = output.outputFile
if (outputFile != null) {
def fileName = "${appName()}-${variant.versionCode}-V${variant.versionName}-${releaseTime()}-${buildType.name}.apk"
output.outputFileName = fileName
}
}
}
signingConfig signingConfigs.mtk
}
}
externalNativeBuild {
cmake {
path file('CMakeLists.txt')
}
}
}
dependencies {
// implementation fileTree(dir: "libs", include: ["*.jar"])
compileOnly files('libs/framework.jar')
compileOnly files('libs/cube_mdm.jar')
compileOnly files('libs/cube_sdk_v1.0.0.jar')
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.1.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
//BindView
implementation 'com.jakewharton:butterknife:10.2.3'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.3'
implementation 'com.squareup.moshi:moshi:1.9.3'
//OkHttp
implementation 'com.squareup.okhttp3:okhttp:4.9.0'
//Retrofit
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.squareup.retrofit2:adapter-rxjava3:2.9.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-components-preference:4.0.2'
implementation 'com.trello.rxlifecycle4:rxlifecycle-android-lifecycle:4.0.2'
//implementation "com.uber.autodispose:autodispose:1.3.0"
//implementation "com.uber.autodispose:autodispose-android-archcomponents:1.3.0"
//Google
implementation 'com.google.code.gson:gson:2.9.0'
implementation 'com.google.zxing:core:3.5.0'
//图片加载框架
implementation 'com.github.bumptech.glide:glide:4.13.2'
annotationProcessor 'com.github.bumptech.glide:compiler:4.13.2'
// debugImplementation because LeakCanary should only run in debug builds.
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.9.1'
//磁盘缓存
implementation 'com.jakewharton:disklrucache:2.0.2'
//fastjson
implementation 'com.alibaba:fastjson:1.2.83'
//百度地图
implementation 'com.baidu.lbsyun:BaiduMapSDK_Location:9.1.8'
//MMKV
implementation 'com.tencent:mmkv-static:1.2.13'
//腾讯移动推送 TPNS
implementation 'com.tencent.tpns:tpns:1.3.2.0-release'
//工具类
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 'org.zeroturnaround:zt-zip:1.15'
//更换字体框架
implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
//Java WebSocket
implementation "org.java-websocket:Java-WebSocket:1.5.3"
//状态栏透明
implementation 'com.gitee.zackratos:UltimateBarX:0.8.0'
// // 基础依赖包,必须要依赖
// implementation 'com.gyf.immersionbar:immersionbar:3.0.0'
// // fragment快速实现可选
// implementation 'com.gyf.immersionbar:immersionbar-components:3.0.0'
// // kotlin扩展可选
// implementation 'com.gyf.immersionbar:immersionbar-ktx:3.0.0'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.24'
}
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
}