386 lines
14 KiB
Groovy
386 lines
14 KiB
Groovy
apply plugin: 'com.android.application'
|
||
apply plugin: 'kotlin-android'
|
||
apply from: '../mob.gradle'
|
||
apply plugin: 'android-junk-code'
|
||
apply plugin: 'com.google.gms.google-services'
|
||
apply plugin: 'com.google.firebase.crashlytics'
|
||
apply plugin: "com.bytedance.android.aabResGuard"
|
||
apply plugin: "xml-class-guard"
|
||
|
||
android {
|
||
compileSdkVersion COMPILE_SDK_VERSION.toInteger()
|
||
|
||
defaultConfig {
|
||
applicationId "app.yinm.chat"
|
||
minSdkVersion MIN_SDK_VERSION.toInteger()
|
||
targetSdkVersion TARGET_SDK_VERSION.toInteger()
|
||
versionCode Integer.valueOf(version_code)
|
||
versionName version_name
|
||
|
||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||
multiDexEnabled true
|
||
// ndk {
|
||
// abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86'
|
||
// }
|
||
flavorDimensions 'default'
|
||
}
|
||
|
||
// splits {
|
||
// abi {
|
||
// enable true
|
||
// reset()
|
||
// include 'armeabi-v7a', 'arm64-v8a', 'x86'
|
||
// universalApk true
|
||
// }
|
||
// }
|
||
|
||
bundle {
|
||
density {
|
||
enableSplit = true
|
||
}
|
||
abi {
|
||
enableSplit = true
|
||
}
|
||
}
|
||
|
||
//在apk文件后边生成版本号信息
|
||
android.applicationVariants.configureEach { variant ->
|
||
variant.outputs.configureEach { output ->
|
||
def date = new Date().format("MMddHHmm", TimeZone.getTimeZone("GMT+08"))
|
||
|
||
def outputFile = output.outputFile
|
||
if (outputFile == null || !outputFile.name.endsWith('.apk')) {
|
||
return
|
||
}
|
||
|
||
def abi = output.getFilter(com.android.build.OutputFile.ABI)
|
||
if (abi == null) {
|
||
abi = "universal"
|
||
}
|
||
outputFileName = "yinm_${variant.flavorName}_${buildType.name}_v${defaultConfig.versionName}_${defaultConfig.versionCode}_${abi}_${date}.apk"
|
||
}
|
||
}
|
||
|
||
|
||
lintOptions {
|
||
abortOnError false
|
||
disable 'MissingTranslation'
|
||
disable 'ExtraTranslation'
|
||
}
|
||
|
||
dataBinding {
|
||
enabled = true
|
||
}
|
||
|
||
viewBinding {
|
||
enabled = true
|
||
}
|
||
|
||
packagingOptions {
|
||
exclude 'lib/armeabi-v7a/libagora-crypto.so'
|
||
}
|
||
|
||
signingConfigs {
|
||
|
||
v2 {
|
||
storeFile file('../yinm.jks')
|
||
storePassword "yinm2023"
|
||
keyAlias "yinm"
|
||
keyPassword "yinm2023"
|
||
v2SigningEnabled true
|
||
v1SigningEnabled true
|
||
}
|
||
}
|
||
|
||
sourceSets {
|
||
|
||
main {
|
||
java.srcDirs = [
|
||
'src/main/java',
|
||
'src/module_public_chat_hall/java',
|
||
'src/module_upgrade_app/java',
|
||
'src/module_mentoring_relationship/java',
|
||
'src/module_labour_union/java',
|
||
'src/module_room_chat/java',
|
||
'src/model_customer_server/java',
|
||
'src/module_music/java',
|
||
'src/module_mini_world/java',
|
||
'src/module_lottery_dialog/java',
|
||
'src/module_bank_card/java',
|
||
'src/module_super_admin/java',
|
||
'src/module_treasure_box/java',
|
||
|
||
'src/module_community/java',
|
||
'src/module_album/java',
|
||
'src/module_quick_pass/java'
|
||
|
||
]
|
||
|
||
res.srcDirs = [
|
||
'src/main/res',
|
||
'src/common/res',
|
||
'src/module_public_chat_hall/res',
|
||
'src/module_upgrade_app/res',
|
||
'src/module_mentoring_relationship/res',
|
||
'src/module_labour_union/res',
|
||
'src/module_room_chat/res',
|
||
'src/model_customer_server/res',
|
||
'src/module_music/res',
|
||
'src/module_mini_world/res',
|
||
'src/module_lottery_dialog/res',
|
||
'src/module_bank_card/res',
|
||
'src/module_super_admin/res',
|
||
'src/module_treasure_box/res',
|
||
|
||
'src/module_community/res',
|
||
'src/module_album/res',
|
||
'src/module_quick_pass/res'
|
||
|
||
]
|
||
|
||
jniLibs.srcDirs = ['libs', 'aliyun-libs']
|
||
}
|
||
}
|
||
|
||
buildTypes {
|
||
release {
|
||
buildConfigField "String", "BASE_URL", "\"https://api.yinm.chat/\""
|
||
buildConfigField "String", "WEB_URL", "\"https://h5.yinm.chat/\""
|
||
buildConfigField "String", "BASE_URL_DEBUG", "BASE_URL"
|
||
buildConfigField "String", "BASE_URL_STAGING", "BASE_URL"
|
||
buildConfigField "String", "BASE_URL_RELEASE", "BASE_URL"
|
||
minifyEnabled true
|
||
shrinkResources true
|
||
signingConfig signingConfigs.v2
|
||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||
manifestPlaceholders = [CRASHLYTICS_COLLECTION_ENABLED: "true"]
|
||
firebaseCrashlytics {
|
||
mappingFileUploadEnabled false
|
||
}
|
||
}
|
||
|
||
debug {
|
||
buildConfigField "String", "BASE_URL", "\"http://beta.api.yinm.chat/\""
|
||
buildConfigField "String", "WEB_URL", "\"http://beta.api.yinm.chat\""
|
||
buildConfigField "String", "BASE_URL_DEBUG", "BASE_URL"
|
||
buildConfigField "String", "BASE_URL_STAGING", "\"https://api.yinm.chat/\""
|
||
buildConfigField "String", "BASE_URL_RELEASE", "\"https://api.yinm.chat/\""
|
||
minifyEnabled false
|
||
shrinkResources false
|
||
signingConfig signingConfigs.v2
|
||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||
firebaseCrashlytics {
|
||
mappingFileUploadEnabled false
|
||
}
|
||
manifestPlaceholders = [CRASHLYTICS_COLLECTION_ENABLED: "false"]
|
||
}
|
||
}
|
||
|
||
compileOptions {
|
||
sourceCompatibility JavaVersion.VERSION_11
|
||
targetCompatibility JavaVersion.VERSION_11
|
||
}
|
||
|
||
kotlinOptions {
|
||
jvmTarget = "11"
|
||
}
|
||
|
||
buildToolsVersion = '30.0.3'
|
||
|
||
productFlavors {
|
||
official {
|
||
ndk {
|
||
abiFilters 'armeabi-v7a', 'arm64-v8a'
|
||
}
|
||
}
|
||
google_yinm {
|
||
ndk {
|
||
abiFilters 'armeabi-v7a', 'arm64-v8a'
|
||
}
|
||
}
|
||
mlq {
|
||
ndk {
|
||
abiFilters 'x86'
|
||
}
|
||
}
|
||
}
|
||
productFlavors.all { flavor ->
|
||
flavor.manifestPlaceholders = [
|
||
// 渠道
|
||
CHANNEL_VALUE : name,
|
||
]
|
||
}
|
||
}
|
||
|
||
|
||
dependencies {
|
||
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
||
implementation fileTree(dir: 'aliyun-libs', include: ['*.jar', '*.aar'])
|
||
implementation 'androidx.appcompat:appcompat:1.4.1'
|
||
implementation 'com.google.android.material:material:1.6.1'
|
||
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
|
||
testImplementation 'junit:junit:4.13.2'
|
||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
||
|
||
api 'androidx.multidex:multidex:2.0.1'
|
||
|
||
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.7'
|
||
|
||
api "com.orhanobut:dialogplus:1.11@aar"
|
||
|
||
api "com.readystatesoftware.systembartint:systembartint:1.0.4"
|
||
api "com.rengwuxian.materialedittext:library:2.1.4"
|
||
api "com.github.flavienlaurent.datetimepicker:library:0.0.2"
|
||
|
||
api "com.darsh.multipleimageselect:multipleimageselect:1.0.4"
|
||
api "me.shaohui.advancedluban:library:1.3.5"
|
||
api "pl.droidsonroids.gif:android-gif-drawable:1.2.7"
|
||
api "com.makeramen:roundedimageview:2.3.0"
|
||
api "com.jzxiang.pickerview:TimePickerDialog:1.0.1"
|
||
api "com.github.zyyoona7:EasyPopup:1.0.2"
|
||
api "com.github.donkingliang:LabelsView:1.6.5"
|
||
api "com.github.yyued:SVGAPlayer-Android:2.6.1"
|
||
implementation "com.orhanobut:logger:2.2.0"
|
||
api "com.ms-square:expandableTextView:0.1.4"
|
||
api "com.jakewharton:butterknife:10.2.3"
|
||
annotationProcessor "com.jakewharton:butterknife-compiler:10.2.3"
|
||
annotationProcessor 'androidx.annotation:annotation:1.2.0'
|
||
|
||
implementation 'io.github.h07000223:flycoTabLayout:3.0.0'
|
||
|
||
api project(':core')
|
||
|
||
implementation 'com.github.qiujayen:sticky-layoutmanager:1.0.1'
|
||
|
||
implementation 'com.github.chenBingX:SuperTextView:v3.0.0'
|
||
|
||
//支付密码输入框
|
||
api 'com.jungly:gridPasswordView:0.3'
|
||
api 'com.google.android.flexbox:flexbox:3.0.0'
|
||
|
||
implementation 'nl.dionsegijn:konfetti:1.1.2'
|
||
|
||
//数字滚动效果
|
||
implementation 'com.github.YvesCheung:RollingText:1.2.3'
|
||
// 引入原有第三方裁图源码,方便修改
|
||
api project(':android_crop_lib')
|
||
|
||
//rx权限请求框架
|
||
implementation('com.github.tbruyelle:rxpermissions:0.10.2') {
|
||
exclude group: 'io.reactivex.rxjava2'
|
||
}
|
||
//验证码控件 https://github.com/JingYeoh/VercodeEditText
|
||
implementation 'com.justkiddingbaby:vercodeedittext:1.1.0'
|
||
|
||
implementation 'it.sephiroth.android.library.imagezoom:library:1.0.4'
|
||
|
||
implementation 'com.github.fodroid:XRadioGroup:v1.5'
|
||
|
||
// api 'com.tencent.vasdolly:helper:3.0.3'
|
||
implementation "io.github.tencent:vap:2.0.24"
|
||
|
||
implementation 'com.github.mmin18:realtimeblurview:1.2.1'
|
||
|
||
implementation 'com.github.yalantis:ucrop:2.2.7'
|
||
}
|
||
|
||
repositories {
|
||
mavenCentral()
|
||
}
|
||
|
||
android.applicationVariants.all { variant ->
|
||
print("variant.name=" + variant.name)
|
||
if (variant.name.contains("release") || variant.name.contains("Release")) {
|
||
androidJunkCode.configMap.put(variant.name, {
|
||
packageBase = "app.yinm.a.u" //生成java类根包名
|
||
packageCount = 30 //生成包数量
|
||
activityCountPerPackage = 30 //每个包下生成Activity类数量
|
||
excludeActivityJavaFile = false
|
||
//是否排除生成Activity的Java文件,默认false(layout和写入AndroidManifest.xml还会执行),主要用于处理类似神策全埋点编译过慢问题
|
||
otherCountPerPackage = 50 //每个包下生成其它类的数量
|
||
methodCountPerClass = 20 //每个类下生成方法数量
|
||
resPrefix = "ymc_" //生成的layout、drawable、string等资源名前缀
|
||
drawableCount = 300 //生成drawable资源数量
|
||
stringCount = 300 //生成string数量
|
||
})
|
||
}
|
||
}
|
||
|
||
aabResGuard {
|
||
mappingFile = file("aab-res-guard-mapping.txt").toPath()
|
||
// Mapping file used for incremental obfuscation
|
||
whiteList = [ // White list rules
|
||
// 魅力财富icon
|
||
"*.R.drawable.charm_ic_*",
|
||
"*.R.drawable.wealth_ic_*",
|
||
// ----------
|
||
"*.R.raw.*",
|
||
"*.R.drawable.icon",
|
||
//谷歌服务
|
||
"*.R.string.default_web_client_id",
|
||
"*.R.string.firebase_database_url",
|
||
"*.R.string.gcm_defaultSenderId",
|
||
"*.R.string.google_api_key",
|
||
"*.R.string.google_app_id",
|
||
"*.R.string.google_crash_reporting_api_key",
|
||
"*.R.string.google_storage_bucket",
|
||
"*.R.string.project_id",
|
||
//所有涉及到 getResources().getIdentifier 对应的资源ID
|
||
"*.R.array.a1",
|
||
"*.R.string.s1",
|
||
"*.R.mipmap.m1",
|
||
"*.R.dimen.d1",
|
||
"*.R.integer.int1",
|
||
//Firebase Crashlytics
|
||
"*.R.string.com.crashlytics.*",
|
||
"*.R.bool.com.crashlytics.useFirebaseAppId",
|
||
"*.R.string.com.crashlytics.useFirebaseAppId",
|
||
"*.R.bool.com.crashlytics.CollectDeviceIdentifiers",
|
||
"*.R.string.com.crashlytics.CollectDeviceIdentifiers",
|
||
"*.R.bool.com.crashlytics.CollectUserIdentifiers",
|
||
"*.R.string.com.crashlytics.CollectUserIdentifiers",
|
||
"*.R.string.com.crashlytics.ApiEndpoint",
|
||
"*.R.string.io.fabric.android.build_id",
|
||
"*.R.string.com.crashlytics.android.build_id",
|
||
"*.R.bool.com.crashlytics.RequireBuildId",
|
||
"*.R.string.com.crashlytics.RequireBuildId",
|
||
"*.R.bool.com.crashlytics.CollectCustomLogs",
|
||
"*.R.string.com.crashlytics.CollectCustomLogs",
|
||
"*.R.bool.com.crashlytics.Trace",
|
||
"*.R.string.com.crashlytics.Trace",
|
||
"*.R.string.com.crashlytics.CollectCustomKeys",
|
||
"*.R.string.com.google.firebase.crashlytics.mapping_file_id",
|
||
"*.R.string.com.google.firebase.crashlytics.unity_version"
|
||
]
|
||
obfuscatedBundleFileName = "yinm-google.aab" // Obfuscated file name, must end with '.aab'
|
||
mergeDuplicatedRes = true // Whether to allow the merge of duplicate resources
|
||
enableFilterFiles = false // Whether to allow filter files
|
||
filterList = [ // file filter rules
|
||
// "*/arm64-v8a/*",
|
||
// "META-INF/*"
|
||
]
|
||
|
||
enableFilterStrings = false // switch of filter strings
|
||
unusedStringPath = file("unused.txt").toPath() // strings will be filtered in this file
|
||
languageWhiteList = ["en", "zh"] // keep en,en-xx,zh,zh-xx etc. remove others.
|
||
}
|
||
|
||
//以下均为非必须
|
||
xmlClassGuard {
|
||
findAabConstraintReferencedIds = true
|
||
//用于增量混淆的 mapping 文件
|
||
mappingFile = file("xml-class-mapping.txt")
|
||
//更改manifest文件的package属性,即包名
|
||
packageChange = ["com.nnbc123.app" : "app.yinm.app",
|
||
"com.nnbc123.core" : "app.yinm.cc",
|
||
"com.nnbc123.library": "app.yinm.ll"]
|
||
|
||
moveDir = []
|
||
|
||
generateObfuscateClassStartName = "ZZZZ"
|
||
|
||
randomObfuscatePackageNamePlaceholder = ["app.yinm.a.#", "app.yinm.a.a.#", "app.yinm.a.b.#", "app.yinm.a.c.#", "app.yinm.a.d.#", "app.yinm.a.e.#"]
|
||
|
||
randomObfuscateClassNamePlaceholder = ["#", "#1", "#2", "#3", "#4", "#5", "#6", "#7", "#8", "#9"]
|
||
}
|