apply plugin: 'com.android.application' apply plugin: 'kotlin-android' 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' } } compileOptions{ sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } lintOptions { checkReleaseBuilds false } //多版本 productFlavors { beta { flavorDimensions "default" versionCode 22 versionName "3.1" manifestPlaceholders = [ JPUSH_PKGNAME: "com.uiui.appstore", JPUSH_APPKEY : "c93d01f43046fa500d162817", //JPush 上注册的包名对应的 Appkey. JPUSH_CHANNEL: "developer-default", //暂时填写默认值即可. ] } official { flavorDimensions "default" versionCode 1 versionName "1.0" manifestPlaceholders = [ JPUSH_PKGNAME: "com.uiui.appstore", JPUSH_APPKEY : "c93d01f43046fa500d162817", //JPush 上注册的包名对应的 Appkey. JPUSH_CHANNEL: "developer-default", //暂时填写默认值即可. ] } } //签名 signingConfigs { zhanRui { storeFile file("src/keys/zhanxun.keystore") storePassword "123456" keyAlias "zhanxun" keyPassword "123456" v1SigningEnabled true v2SigningEnabled true } teclastuserdebug { storeFile file("src/keys/TeclastUserDebug.jks") storePassword "123456" keyAlias "teclast" keyPassword "123456" v1SigningEnabled true v2SigningEnabled true } mtk { storeFile file("src/keys/xueshibaoos.jks") storePassword "123456" keyAlias "xueshibaoos" keyPassword "123456" v1SigningEnabled true v2SigningEnabled true } } buildTypes { 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.1' // If you are using Kotlin, replace annotationProcessor with kapt. // annotationProcessor rootProject.ext.dependencies["butterknife-compiler"] annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1' //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.11.0' annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0' //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' //RxJava和Retrofit implementation 'io.reactivex.rxjava2:rxjava:2.2.5' implementation 'io.reactivex.rxjava2:rxandroid:2.1.0' implementation 'com.squareup.retrofit2:retrofit:2.3.0' implementation 'com.squareup.retrofit2:converter-gson:2.3.0' implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0' //google implementation 'com.google.code.gson:gson:2.8.7' implementation 'com.google.zxing:core:3.3.0' //fastjson implementation 'com.alibaba:fastjson:1.2.76' //极光推送 implementation 'cn.jiguang.sdk:jpush:3.8.6' // 此处以JPush 3.4.1 版本为例。 implementation 'cn.jiguang.sdk:jcore:2.6.0' // 此处以JCore 2.2.4 版本为例。 //banner图 implementation 'com.zhpan.library:bannerview:2.6.4' //更换字体框架 implementation 'uk.co.chrisjenx:calligraphy:2.3.0' //工具类 implementation 'com.blankj:utilcodex:1.30.6' //沉浸状态栏 implementation 'com.gitee.zackratos:UltimateBarX:0.7.1' }