apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: "com.tencent.android.tpns" def appName() { return "UIUIAppStore" } def releaseTime() { return new Date().format("yyyyMMdd-HHmmss", TimeZone.getDefault()) } android { compileSdkVersion 29 buildToolsVersion "29.0.3" defaultConfig { applicationId "com.uiui.appstore" minSdkVersion 26 targetSdkVersion 29 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" ndk { //选择要添加的对应 cpu 类型的 .so 库。 abiFilters 'armeabi', 'armeabi-v7a', 'arm64-v8a' // 还可以添加 'x86', 'x86_64', 'mips', 'mips64' } manifestPlaceholders = [ XG_ACCESS_ID : "1500033122", XG_ACCESS_KEY : "A5QBQVQ7KLQD", ] } compileOptions{ sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } lintOptions { checkReleaseBuilds false } //多版本 productFlavors { official { flavorDimensions "default" versionCode 71 versionName "8.0" } } //签名 signingConfigs { zhanRui { storeFile file("keystore/zhanxun.keystore") storePassword "123456" keyAlias "zhanxun" keyPassword "123456" v1SigningEnabled true v2SigningEnabled true } teclastuserdebug { storeFile file("keystore/TeclastUserDebug.jks") storePassword "123456" keyAlias "teclast" keyPassword "123456" v1SigningEnabled true v2SigningEnabled true } mtk { storeFile file("keystore/xueshibaoos.jks") storePassword "123456" keyAlias "xueshibaoos" keyPassword "123456" v1SigningEnabled true v2SigningEnabled true } mtk12 { storeFile file("keystore/mtkAndroid12.keystore") storePassword "123456" keyAlias "mtk12" keyPassword "123456" v1SigningEnabled true v2SigningEnabled true } } buildTypes { MTKAndroid12Release.initWith(release) MTKAndroid12Release { buildConfigField "String", "platform", '"MTK"' signingConfig signingConfigs.mtk12 } MTKAndroid12Debug.initWith(debug) MTKAndroid12Debug { buildConfigField "String", "platform", '"MTK"' versionNameSuffix "-debug" debuggable true signingConfig signingConfigs.mtk12 } zhanRuiRelease.initWith(release) zhanRuiRelease { buildConfigField "String", "platform", '"ZhanRui"' signingConfig signingConfigs.zhanRui } zhanRuiDebug.initWith(debug) zhanRuiDebug { versionNameSuffix "-debug" buildConfigField "String", "platform", '"ZhanRui"' debuggable true signingConfig signingConfigs.zhanRui } //userdebug rom使用这个版本 zhanRuiUserdebug.initWith(zhanRuiDebug) zhanRuiUserdebug { buildConfigField "String", "platform", '"ZhanRui"' versionNameSuffix "-debug" debuggable true signingConfig signingConfigs.teclastuserdebug } debug { buildConfigField "String", "platform", '"MTK"' versionNameSuffix "-debug" minifyEnabled false //Zipalign优化 zipAlignEnabled true signingConfig signingConfigs.mtk 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 { buildConfigField "String", "platform", '"MTK"' //混淆 minifyEnabled false //Zipalign优化 zipAlignEnabled true //前一部分代表系统默认的android程序的混淆文件,该文件已经包含了基本的混淆声明,后一个文件是自己的定义混淆文件 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' //签名 signingConfig signingConfigs.mtk // 将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 'androidx.appcompat:appcompat:1.3.1' implementation 'androidx.constraintlayout:constraintlayout:2.0.4' implementation 'androidx.recyclerview:recyclerview:1.2.1' implementation 'androidx.cardview:cardview:1.0.0' testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' implementation "androidx.core:core-ktx:1.6.0" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" //butterknife implementation 'com.jakewharton:butterknife:10.2.3' // If you are using Kotlin, replace annotationProcessor with kapt. // annotationProcessor rootProject.ext.dependencies["butterknife-compiler"] annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.3' //github第三方控件 implementation 'io.github.h07000223:flycoTabLayout:3.0.0' //下拉刷新控件 implementation 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.0' //1.0.5及以前版本的老用户升级需谨慎,API改动过大 implementation 'com.scwang.smartrefresh:SmartRefreshHeader:1.1.0' //没有使用特殊Header,可以不加这行 //glide implementation 'com.github.bumptech.glide:glide:4.14.2' annotationProcessor 'com.github.bumptech.glide:compiler:4.14.2' //磁盘缓存 implementation 'com.jakewharton:disklrucache:2.0.2' //aria implementation 'com.arialyy.aria:core:3.8.15' annotationProcessor 'com.arialyy.aria:compiler:3.8.15' //动态权限框架 implementation 'com.hjq:xxpermissions:6.0' //okhttp implementation 'com.squareup.okhttp3:okhttp:4.9.3' //Retrofit implementation 'com.squareup.retrofit2:retrofit:2.9.0' implementation 'com.squareup.retrofit2:converter-gson:2.9.0' // implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.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' //google implementation 'com.google.code.gson:gson:2.9.0' implementation 'com.google.zxing:core:3.5.0' //MMKV implementation 'com.tencent:mmkv-static:1.2.13' //腾讯移动推送 TPNS implementation 'com.tencent.tpns:tpns:1.3.2.0-release' //banner图 implementation 'com.zhpan.library:bannerview:2.6.4' //更换字体框架 implementation 'uk.co.chrisjenx:calligraphy:2.3.0' //工具类 implementation 'com.blankj:utilcodex:1.31.1' //沉浸状态栏 implementation 'com.gitee.zackratos:UltimateBarX:0.8.0' }