181 lines
6.3 KiB
Groovy
181 lines
6.3 KiB
Groovy
apply plugin: 'com.android.application'
|
||
|
||
def appName() {
|
||
return "Mir4Updater"
|
||
}
|
||
|
||
def releaseTime() {
|
||
return new Date().format("yyyyMMdd_HHmmss", TimeZone.getDefault())
|
||
}
|
||
|
||
android {
|
||
compileSdkVersion 30
|
||
// buildToolsVersion "34.0.0"
|
||
|
||
defaultConfig {
|
||
applicationId "com.example.mir4updater"
|
||
minSdkVersion 24
|
||
targetSdkVersion 30
|
||
versionCode 1
|
||
versionName "1.0"
|
||
|
||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||
|
||
ndk {
|
||
//可以根据需要来自行选择并添加对应cpu类型的.so库。
|
||
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
||
// 还可以添加 'armeabi', 'x86', 'x86_64', 'mips', 'mips64'
|
||
}
|
||
|
||
compileOptions {
|
||
sourceCompatibility JavaVersion.VERSION_1_8
|
||
targetCompatibility JavaVersion.VERSION_1_8
|
||
}
|
||
|
||
vectorDrawables.useSupportLibrary = true
|
||
|
||
viewBinding {
|
||
enabled = true
|
||
}
|
||
|
||
dataBinding {
|
||
enabled true
|
||
}
|
||
}
|
||
|
||
signingConfigs {
|
||
own {
|
||
storeFile file("keystore/ttstd.jks")
|
||
storePassword "fht19961207"
|
||
keyAlias "key0"
|
||
keyPassword "981964879aa"
|
||
v1SigningEnabled true
|
||
v2SigningEnabled true
|
||
}
|
||
}
|
||
|
||
//多版本
|
||
// productFlavors {
|
||
// official {
|
||
// flavorDimensions "default"
|
||
// versionCode 1
|
||
// versionName "1.0"
|
||
// buildConfigField "String", "ROOT_URL", '"http://139.199.77.221:8080"'
|
||
// }
|
||
//
|
||
// beta {
|
||
// flavorDimensions "default"
|
||
// versionCode 100
|
||
// versionName "1.0"
|
||
// buildConfigField "String", "ROOT_URL", '"http://127.0.0.1:65534"'
|
||
// }
|
||
// }
|
||
|
||
buildTypes {
|
||
debug {
|
||
versionNameSuffix "-debug"
|
||
minifyEnabled false
|
||
//Zipalign优化
|
||
zipAlignEnabled true
|
||
signingConfig signingConfigs.own
|
||
applicationVariants.all { variant ->
|
||
variant.outputs.each { output ->
|
||
if (outputFile != null) {
|
||
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.own
|
||
// 将release版本的包名重命名,加上版本及日期
|
||
applicationVariants.all { variant ->
|
||
variant.outputs.each { output ->
|
||
def outputFile = ""
|
||
if (outputFile != null) {
|
||
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 project(path: ':ttutils')
|
||
|
||
implementation 'androidx.appcompat:appcompat:1.3.1'
|
||
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
||
implementation "androidx.recyclerview:recyclerview:1.2.1"
|
||
implementation "androidx.viewpager2:viewpager2:1.0.0"
|
||
implementation "androidx.fragment:fragment:1.4.1"
|
||
implementation "androidx.documentfile:documentfile:1.0.1"
|
||
|
||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||
testImplementation 'junit:junit:4.12'
|
||
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
|
||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
|
||
|
||
implementation 'com.google.android.play:app-update:2.1.0'
|
||
implementation 'com.google.android.play:app-update-ktx:2.1.0' // Kotlin扩展
|
||
|
||
//RxJava
|
||
implementation 'io.reactivex.rxjava3:rxjava:3.0.0'
|
||
implementation 'io.reactivex.rxjava3:rxandroid:3.0.0'
|
||
|
||
//okhttp
|
||
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
|
||
implementation 'com.squareup.okhttp3:logging-interceptor:4.9.3'
|
||
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
||
implementation 'com.squareup.retrofit2:converter-moshi:2.9.0'
|
||
// implementation 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
|
||
implementation "com.squareup.retrofit2:adapter-rxjava3:2.9.0"
|
||
// gson converter
|
||
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
||
// 标准转换器,去掉 Retrofit以Mutipart上传参数时,String参数会多一对双引号
|
||
implementation 'com.squareup.retrofit2:converter-scalars:2.3.0'
|
||
//google
|
||
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'
|
||
//xcrash
|
||
implementation 'com.iqiyi.xcrash:xcrash-android-lib:3.1.0'
|
||
|
||
//工具类
|
||
implementation 'com.blankj:utilcodex:1.31.1'
|
||
//压缩文件解压
|
||
implementation 'org.zeroturnaround:zt-zip:1.15'
|
||
//动态权限框架
|
||
implementation 'com.github.getActivity:XXPermissions:18.6'
|
||
// 吐司框架:https://github.com/getActivity/Toaster
|
||
implementation 'com.github.getActivity:Toaster:12.6'
|
||
//沉浸状态栏
|
||
implementation 'com.gitee.zackratos:UltimateBarX:0.8.0'
|
||
implementation 'com.github.andywu91:XAPKInstaller:1.0.0'
|
||
}
|