Files
Xuewang365OSHonor/app/build.gradle
tongtongstudio 34258d8758 version:2.1.3
bugfixes:
update:样式修改
2025-10-23 09:30:10 +08:00

320 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'
def appName() {
return "CubeZYLauncher"
}
def releaseTime() {
return new Date().format("yyyyMMdd-HHmmss", TimeZone.getDefault())
}
android {
compileSdkVersion 29
defaultConfig {
applicationId "com.uiui.zyos"
minSdkVersion 24
targetSdkVersion 29
versionCode 104
versionName "2.1.3"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
ndk {
//根据需要 自行选择添加的对应cpu类型的.so库。
abiFilters 'armeabi', 'armeabi-v7a', 'arm64-v8a'
// 还可以添加 'x86', 'x86_64', 'mips', 'mips64'
}
buildConfigField "String", "WEBSOCKET_URL", '"wss://led.aolelearn.com/wss/device"'
}
dataBinding {
enabled 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
}
aaptOptions.cruncherEnabled = false
aaptOptions.useNewCruncher = false
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
signingConfigs {
tuixin {
storeFile file("keystore/tuixin.jks")
storePassword "123456"
keyAlias "universal"
keyPassword "123456"
v2SigningEnabled false
}
// iPlay50SE {
// storeFile file("keystore/iPlay50SE.keystore")
// storePassword "123456"
// keyAlias "iplay50se"
// keyPassword "123456"
// v1SigningEnabled true
// v2SigningEnabled true
// }
U807 {
storeFile file("keystore/AllwinnerU807.jks")
storePassword "123456"
keyAlias "u807"
keyPassword "123456"
v2SigningEnabled false
}
T1102 {
storeFile file("keystore/T1102.jks")
storePassword "123456"
keyAlias "t1102"
keyPassword "123456"
v1SigningEnabled true
v2SigningEnabled true
}
iPlay50P {
storeFile file("keystore/iPlay50P.jks")
storePassword "123456"
keyAlias "iplay50p"
keyPassword "123456"
v1SigningEnabled true
v2SigningEnabled true
}
}
buildTypes {
iPlay50PDebug.initWith(debug)
iPlay50PDebug {
buildConfigField "String", "platform", '"T1102"'
versionNameSuffix "-debug"
debuggable true
signingConfig signingConfigs.iPlay50P
manifestPlaceholders = [
AMAP_KEY: "aed54e2ec50c45151d17b512c9e4f34c"
]
}
iPlay50PRelease.initWith(release)
iPlay50PRelease {
buildConfigField "String", "platform", '"T1102"'
signingConfig signingConfigs.iPlay50P
manifestPlaceholders = [
AMAP_KEY: "aed54e2ec50c45151d17b512c9e4f34c"
]
}
MTKT1102Debug.initWith(debug)
MTKT1102Debug {
buildConfigField "String", "platform", '"MTKT1102"'
versionNameSuffix "-debug"
debuggable true
signingConfig signingConfigs.T1102
manifestPlaceholders = [
AMAP_KEY: "aed54e2ec50c45151d17b512c9e4f34c"
]
}
MTKT1102Release.initWith(release)
MTKT1102Release {
buildConfigField "String", "platform", '"MTKT1102"'
signingConfig signingConfigs.T1102
manifestPlaceholders = [
AMAP_KEY: "aed54e2ec50c45151d17b512c9e4f34c"
]
}
U807Debug.initWith(debug)
U807Debug {
versionNameSuffix "-debug"
debuggable true
signingConfig signingConfigs.U807
buildConfigField "String", "platform", '"U807"'
manifestPlaceholders = [
AMAP_KEY: "8200776fc8cad995184a9a3a17a552e4"
]
}
U807Release.initWith(release)
U807Release {
signingConfig signingConfigs.U807
buildConfigField "String", "platform", '"U807"'
manifestPlaceholders = [
AMAP_KEY: "8200776fc8cad995184a9a3a17a552e4"
]
}
debug {
versionNameSuffix "-debug"
minifyEnabled false
//Zipalign优化
zipAlignEnabled true
buildConfigField "String", "platform", '"tuixin"'
manifestPlaceholders = [
AMAP_KEY: "9c9fabf3934df224e927b2f9fbc51064"
]
signingConfig signingConfigs.tuixin
applicationVariants.all { variant ->
variant.outputs.each { output ->
if (outputFile != null) {
// def app_name = getResValues().get("app_name").value
def fileName = "${appName()}-${variant.versionCode}-V${variant.versionName}-${releaseTime()}-${buildType.name}.apk"
output.outputFileName = fileName
}
}
}
}
release {
minifyEnabled false
//Zipalign优化
zipAlignEnabled true
//前一部分代表系统默认的android程序的混淆文件该文件已经包含了基本的混淆声明后一个文件是自己的定义混淆文件
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
//签名
signingConfig signingConfigs.tuixin
buildConfigField "String", "platform", '"tuixin"'
manifestPlaceholders = [
AMAP_KEY: "9c9fabf3934df224e927b2f9fbc51064"
]
// 将release版本的包名重命名加上版本及日期
applicationVariants.all { variant ->
variant.outputs.each { output ->
def outputFile = ""
if (outputFile != null) {
// def app_name = getResValues().get("app_name").value
def fileName = "${appName()}-${variant.versionCode}-V${variant.versionName}-${releaseTime()}-${buildType.name}.apk"
output.outputFileName = new File(outputFile, fileName)
}
}
}
}
}
}
dependencies {
// implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
compileOnly files('libs/framework.jar')
implementation project(path: ':niceimageview')
implementation project(path: ':FlycoTabLayoutZ_Lib')
implementation project(path: ':verification-view')
implementation project(path: ':PhotoPreview')
//保持1.3.1 更新会报错
implementation 'androidx.appcompat:appcompat:1.3.1'
//2.0.4以上无法预览
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
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"
implementation "androidx.viewpager2:viewpager2:1.0.0"
// Java language implementation
implementation "androidx.fragment:fragment:1.4.1"
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation "androidx.room:room-runtime:2.4.3"
annotationProcessor "androidx.room:room-compiler:2.4.3"
//内存泄漏检测
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.14'
//磁盘缓存
implementation 'com.jakewharton:disklrucache:2.0.2'
//Java WebSocket
implementation "org.java-websocket:Java-WebSocket:1.5.3"
//glide
implementation 'com.github.bumptech.glide:glide:4.13.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.13.1'
//RxJava
implementation 'io.reactivex.rxjava3:rxjava:3.0.0'
implementation 'io.reactivex.rxjava3:rxandroid:3.0.0'
//
implementation 'com.squareup.okhttp3:okhttp:4.9.1'
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'
implementation 'com.jeremyliao:live-event-bus-x:1.7.3'
//MMKV
implementation 'com.tencent:mmkv-static:1.2.14'
//bugly
implementation 'com.tencent.bugly:crashreport:4.1.9.2'
//阿里云推送
implementation 'com.aliyun.ams:alicloud-android-push:3.8.0'
//高德地图定位
implementation 'com.amap.api:location:5.1.0'
//状态栏透明
implementation 'com.gitee.zackratos:UltimateBarX:0.8.0'
//指示器
implementation 'com.github.hackware1993:MagicIndicator:1.7.0' // for androidx
// implementation 'io.github.h07000223:flycoTabLayout:3.0.0'
// implementation 'com.github.liyujiang-gzu:FlycoTabLayout:781b8829a7'
implementation 'com.king.view:circleprogressview:1.1.2'
//工具类
implementation 'com.blankj:utilcodex:1.31.0'
//aria
implementation 'com.arialyy.aria:core:3.8.15'
annotationProcessor 'com.arialyy.aria:compiler:3.8.15'
//videoplayer
implementation 'cn.jzvd:jiaozivideoplayer:7.7.0'
implementation 'com.github.wseemann:FFmpegMediaMetadataRetriever-core:1.0.16'
implementation 'com.github.wseemann:FFmpegMediaMetadataRetriever-native:1.0.16'
//验证码输入
// implementation 'com.jacktuotuo.customview:verificationcodeview:1.0.5'
//动态权限框架
implementation 'com.github.getActivity:XXPermissions:18.63'
// 吐司框架https://github.com/getActivity/Toaster
implementation 'com.github.getActivity:Toaster:12.6'
//图片选择
implementation 'io.github.lucksiege:pictureselector:v3.11.1'
// implementation 'com.github.wanglu1209:PhotoViewer:0.50'
// implementation 'com.github.wanggaowan:PhotoPreview:2.5.5'
}
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"
}
}
}