找到项目中的build.gradle 找到位置CV就行
apply plugin: 'com.android.application'
def releaseTime() {
return new Date().format("yyyyMMdd", TimeZone.getTimeZone("UTC"))
}
def appName() {
return "mg_android"
}
signingConfigs {
config {
keyAlias 'xxx'
keyPassword 'xxx'
storeFile file('../sign/xxx.jks')
storePassword 'xxx'
}
}
defaultConfig {
flavorDimensions "versionCode"
}
productFlavors {
yingyongbao {}
xiaomi {}
qh360 {}
baidu {}
huawei {}
vivo {}
oppo {}
ali {}
}
applicationVariants.all { variant ->
variant.outputs.all {
if (outputFileName != null && outputFileName.endsWith('.apk')) {
if (outputFileName.endsWith('release.apk'))
buildType = "release"
else if (outputFileName.endsWith('debug.apk'))
buildType = "debug"
outputFileName = "${appName()}_v${variant.versionName}_${variant.versionCode}_${releaseTime()}_${variant.productFlavors[0].name}_${buildType}.apk"
}
}
}
buildTypes {
release {
//不显示log
buildConfigField "boolean", "LOG_DEBUG", "false"
//zipalign优化
zipAlignEnabled true
//是否混淆
minifyEnabled false
//移除无用的resource文件
shrinkResources false
//混淆地址
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
}
debug {
//不显示log
buildConfigField "boolean", "LOG_DEBUG", "false"
//zipalign优化
zipAlignEnabled true
//是否混淆
minifyEnabled false
//移除无用的resource文件
shrinkResources false
//混淆地址
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
}
}
}
@心存善念
原创文章 63获赞 7访问量 6214
关注
私信
展开阅读全文
作者:@心存善念