1.2.6 准备分包
This commit is contained in:
254
app/build.gradle
254
app/build.gradle
@@ -1,11 +1,28 @@
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
static def appName() {
|
||||
return "小酷守护"
|
||||
static String getBuildConfigFieldValue(def variant, def fiedName) {
|
||||
def properties = variant.productFlavors[0].properties
|
||||
def name = properties.get("name")
|
||||
if (name != variant.flavorName) {
|
||||
return ""
|
||||
}
|
||||
def configs = properties.get("buildConfigFields")
|
||||
def address = null
|
||||
for (Map.Entry<String, Object> item : configs) {
|
||||
def key = item.key
|
||||
if (key == fiedName) {
|
||||
address = item.value
|
||||
}
|
||||
}
|
||||
if (address == null) return ""
|
||||
def field = address.getClass().getDeclaredField("value")
|
||||
field.setAccessible(true)
|
||||
return field.get(address).toString().replace("\"", "")
|
||||
}
|
||||
|
||||
|
||||
static def releaseTime() {
|
||||
return new Date().format("yyyyMMdd-HHmmss", TimeZone.getDefault())
|
||||
return new Date().format("yyyyMMdd_HHmmss", TimeZone.getDefault())
|
||||
}
|
||||
|
||||
android {
|
||||
@@ -13,11 +30,9 @@ android {
|
||||
buildToolsVersion "29.0.3"
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.uiuipad.find"
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 29
|
||||
versionCode 19
|
||||
versionName "1.1.8"
|
||||
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
@@ -46,6 +61,57 @@ android {
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
//多版本
|
||||
productFlavors {
|
||||
kuxin {
|
||||
flavorDimensions "default"
|
||||
applicationId "com.uiuipad.find"
|
||||
versionCode 27
|
||||
versionName "1.2.6"
|
||||
buildConfigField "String", "app_name", '"小酷守护"'
|
||||
manifestPlaceholders = [
|
||||
ALIPUSH_KEY : "333898263",
|
||||
ALIPUSH_SECRET: "e1b374229ffe479eb34ba74432b7e454",
|
||||
]
|
||||
}
|
||||
|
||||
aiKuxin {
|
||||
flavorDimensions "default"
|
||||
applicationId "com.aole.safe"
|
||||
versionCode 1
|
||||
versionName "1.0.0"
|
||||
buildConfigField "String", "app_name", '"守护中心"'
|
||||
manifestPlaceholders = [
|
||||
ALIPUSH_KEY : "333982424",
|
||||
ALIPUSH_SECRET: "c831992e2de743dcad66f5ec420798a4",
|
||||
]
|
||||
}
|
||||
|
||||
aigo {
|
||||
flavorDimensions "default"
|
||||
applicationId "com.safeos.ae"
|
||||
versionCode 1
|
||||
versionName "1.0.0"
|
||||
buildConfigField "String", "app_name", '"安全守护"'
|
||||
manifestPlaceholders = [
|
||||
ALIPUSH_KEY : "333982410",
|
||||
ALIPUSH_SECRET: "6d8785a73d904055ac00f84d83400be4",
|
||||
]
|
||||
}
|
||||
|
||||
phone {
|
||||
flavorDimensions "default"
|
||||
applicationId "com.dangsafe.kf"
|
||||
versionCode 1
|
||||
versionName "1.0.0"
|
||||
buildConfigField "String", "app_name", '"时间守护"'
|
||||
manifestPlaceholders = [
|
||||
ALIPUSH_KEY : "333982833",
|
||||
ALIPUSH_SECRET: "67a5bf10515947459c04fc000367feca",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
//签名
|
||||
signingConfigs {
|
||||
//iPlay50 mini,iPlay50 android13 共用签名
|
||||
@@ -81,43 +147,173 @@ android {
|
||||
keyPassword "123456"
|
||||
v2SigningEnabled false
|
||||
}
|
||||
|
||||
G10P {
|
||||
storeFile file("keystore/G10PMTK11.jks")
|
||||
storePassword "123456"
|
||||
keyAlias "G10PMTK11"
|
||||
keyPassword "123456"
|
||||
v1SigningEnabled true
|
||||
v2SigningEnabled true
|
||||
}
|
||||
|
||||
teclast8183 {
|
||||
storeFile file("keystore/TeclastMTK12.jks")
|
||||
storePassword "123456"
|
||||
keyAlias "TeclastMTK12"
|
||||
keyPassword "123456"
|
||||
v2SigningEnabled false
|
||||
}
|
||||
|
||||
UnisocS6688 {
|
||||
storeFile file("keystore/UnisocS6688Userdebug.jks")
|
||||
storePassword "123456"
|
||||
keyAlias "unisocs6688userdebug"
|
||||
keyPassword "123456"
|
||||
v1SigningEnabled true
|
||||
v2SigningEnabled true
|
||||
}
|
||||
|
||||
Aigo1071 {
|
||||
storeFile file("keystore/Aigo1071.jks")
|
||||
storePassword "123456"
|
||||
keyAlias "aigo1071"
|
||||
keyPassword "123456"
|
||||
v1SigningEnabled true
|
||||
v2SigningEnabled true
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
Aigo1071Debug.initWith(debug)
|
||||
Aigo1071Debug {
|
||||
versionNameSuffix "-debug"
|
||||
debuggable true
|
||||
signingConfig signingConfigs.Aigo1071
|
||||
buildConfigField "String", "platform", '"W8183"'
|
||||
manifestPlaceholders = [
|
||||
Baidu_AK: "YCmfZSw54O992lChzS3c4roYioitT54h"
|
||||
]
|
||||
}
|
||||
|
||||
Aigo1071Release.initWith(release)
|
||||
Aigo1071Release {
|
||||
signingConfig signingConfigs.Aigo1071
|
||||
buildConfigField "String", "platform", '"W8183"'
|
||||
manifestPlaceholders = [
|
||||
Baidu_AK: "YCmfZSw54O992lChzS3c4roYioitT54h"
|
||||
]
|
||||
}
|
||||
|
||||
UnisocS6688Debug.initWith(debug)
|
||||
UnisocS6688Debug {
|
||||
versionNameSuffix "-debug"
|
||||
debuggable true
|
||||
signingConfig signingConfigs.UnisocS6688
|
||||
buildConfigField "String", "platform", '"S6688"'
|
||||
manifestPlaceholders = [
|
||||
Baidu_AK: "YCmfZSw54O992lChzS3c4roYioitT54h"
|
||||
]
|
||||
}
|
||||
|
||||
UnisocS6688Release.initWith(release)
|
||||
UnisocS6688Release {
|
||||
signingConfig signingConfigs.UnisocS6688
|
||||
buildConfigField "String", "platform", '"S6688"'
|
||||
manifestPlaceholders = [
|
||||
Baidu_AK: "YCmfZSw54O992lChzS3c4roYioitT54h"
|
||||
]
|
||||
}
|
||||
|
||||
teclast8183Debug.initWith(debug)
|
||||
teclast8183Debug {
|
||||
versionNameSuffix "-debug"
|
||||
debuggable true
|
||||
signingConfig signingConfigs.teclast8183
|
||||
buildConfigField "String", "platform", '"A11MTK8183"'
|
||||
manifestPlaceholders = [
|
||||
Baidu_AK: "YCmfZSw54O992lChzS3c4roYioitT54h"
|
||||
]
|
||||
}
|
||||
|
||||
teclast8183Release.initWith(release)
|
||||
teclast8183Release {
|
||||
signingConfig signingConfigs.teclast8183
|
||||
buildConfigField "String", "platform", '"A11MTK8183"'
|
||||
manifestPlaceholders = [
|
||||
Baidu_AK: "YCmfZSw54O992lChzS3c4roYioitT54h"
|
||||
]
|
||||
}
|
||||
|
||||
G10PDebug.initWith(debug)
|
||||
G10PDebug {
|
||||
versionNameSuffix "-debug"
|
||||
debuggable true
|
||||
signingConfig signingConfigs.G10P
|
||||
buildConfigField "String", "platform", '"G10P"'
|
||||
manifestPlaceholders = [
|
||||
Baidu_AK: "YCmfZSw54O992lChzS3c4roYioitT54h"
|
||||
]
|
||||
}
|
||||
|
||||
G10PRelease.initWith(release)
|
||||
G10PRelease {
|
||||
signingConfig signingConfigs.G10P
|
||||
buildConfigField "String", "platform", '"G10P"'
|
||||
manifestPlaceholders = [
|
||||
Baidu_AK: "YCmfZSw54O992lChzS3c4roYioitT54h"
|
||||
]
|
||||
}
|
||||
|
||||
U807UserDebug.initWith(release)
|
||||
U807UserDebug {
|
||||
buildConfigField "String", "platform", '"U807"'
|
||||
// versionNameSuffix "-debug"
|
||||
// debuggable true
|
||||
signingConfig signingConfigs.U807UserDebug
|
||||
buildConfigField "String", "platform", '"U807"'
|
||||
manifestPlaceholders = [
|
||||
Baidu_AK: "yhlCxeBmZ1I7ZO50Emw4ptPtcYGOFg59"
|
||||
]
|
||||
}
|
||||
|
||||
U807Debug.initWith(debug)
|
||||
U807Debug {
|
||||
buildConfigField "String", "platform", '"U807"'
|
||||
versionNameSuffix "-debug"
|
||||
debuggable true
|
||||
signingConfig signingConfigs.U807
|
||||
buildConfigField "String", "platform", '"U807"'
|
||||
manifestPlaceholders = [
|
||||
Baidu_AK: "yhlCxeBmZ1I7ZO50Emw4ptPtcYGOFg59"
|
||||
]
|
||||
}
|
||||
|
||||
U807Release.initWith(release)
|
||||
U807Release {
|
||||
buildConfigField "String", "platform", '"U807"'
|
||||
signingConfig signingConfigs.U807
|
||||
buildConfigField "String", "platform", '"U807"'
|
||||
manifestPlaceholders = [
|
||||
Baidu_AK: "yhlCxeBmZ1I7ZO50Emw4ptPtcYGOFg59"
|
||||
]
|
||||
}
|
||||
|
||||
iPlay50SEDebug.initWith(debug)
|
||||
iPlay50SEDebug {
|
||||
buildConfigField "String", "platform", '"iPaly50SE"'
|
||||
versionNameSuffix "-debug"
|
||||
debuggable true
|
||||
signingConfig signingConfigs.iPlay50SE
|
||||
buildConfigField "String", "platform", '"MTK8183"'
|
||||
manifestPlaceholders = [
|
||||
Baidu_AK: "yhlCxeBmZ1I7ZO50Emw4ptPtcYGOFg59"
|
||||
]
|
||||
}
|
||||
|
||||
iPlay50SERelease.initWith(release)
|
||||
iPlay50SERelease {
|
||||
buildConfigField "String", "platform", '"iPaly50SE"'
|
||||
signingConfig signingConfigs.iPlay50SE
|
||||
buildConfigField "String", "platform", '"MTK8183"'
|
||||
manifestPlaceholders = [
|
||||
Baidu_AK: "yhlCxeBmZ1I7ZO50Emw4ptPtcYGOFg59"
|
||||
]
|
||||
}
|
||||
|
||||
debug {
|
||||
@@ -127,10 +323,14 @@ android {
|
||||
zipAlignEnabled true
|
||||
minifyEnabled false
|
||||
signingConfig signingConfigs.iPlay50mini
|
||||
buildConfigField "String", "platform", '"iPlay50mini"'
|
||||
manifestPlaceholders = [
|
||||
Baidu_AK: "YCmfZSw54O992lChzS3c4roYioitT54h"
|
||||
]
|
||||
applicationVariants.all { variant ->
|
||||
variant.outputs.each { output ->
|
||||
if (outputFile != null) {
|
||||
def fileName = "${appName()}-${variant.versionCode}-V${variant.versionName}-${releaseTime()}-${buildType.name}.apk"
|
||||
def fileName = "${getBuildConfigFieldValue(variant, "app_name")}-${variant.versionCode}-V${variant.versionName}-${releaseTime()}-${buildType.name}.apk"
|
||||
output.outputFileName = fileName
|
||||
}
|
||||
}
|
||||
@@ -146,18 +346,46 @@ android {
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
//签名
|
||||
signingConfig signingConfigs.iPlay50mini
|
||||
buildConfigField "String", "platform", '"iPlay50mini"'
|
||||
manifestPlaceholders = [
|
||||
Baidu_AK: "YCmfZSw54O992lChzS3c4roYioitT54h"
|
||||
]
|
||||
// 将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"
|
||||
def fileName = "${getBuildConfigFieldValue(variant, "app_name")}-${variant.versionCode}-V${variant.versionName}-${releaseTime()}-${buildType.name}.apk"
|
||||
output.outputFileName = new File(outputFile, fileName)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
kuxin {
|
||||
res {
|
||||
srcDirs 'src/res'
|
||||
}
|
||||
}
|
||||
aiKuxin {
|
||||
res {
|
||||
srcDirs 'src/aiKuxin/res'
|
||||
}
|
||||
}
|
||||
aigo {
|
||||
res {
|
||||
srcDirs 'src/aigo/res'
|
||||
}
|
||||
}
|
||||
phone {
|
||||
res {
|
||||
srcDirs 'src/phone/res'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
path file('CMakeLists.txt')
|
||||
|
||||
Reference in New Issue
Block a user