好运测试图标自动切换

This commit is contained in:
lijia 2023-10-10 17:28:45 +08:00
parent 1c3d20ac43
commit a7aee4af57
2 changed files with 35 additions and 32 deletions

View File

@ -40,12 +40,13 @@ android {
versionCode 60 versionCode 60
versionName "3.3.0" versionName "3.3.0"
flavorDimensions "CHANNEL_VALUE" flavorDimensions "CHANNEL_VALUE"
flavorDimensions "app_icon"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
javaCompileOptions { javaCompileOptions {
annotationProcessorOptions { annotationProcessorOptions {
includeCompileClasspath = true includeCompileClasspath = true
arguments = [moduleName :project.getName() ] arguments = [moduleName: project.getName()]
} }
} }
@ -59,17 +60,17 @@ android {
manifestPlaceholders = [ manifestPlaceholders = [
JPUSH_PKGNAME : applicationId, JPUSH_PKGNAME : applicationId,
JPUSH_APPKEY : "571d93ae5117da6dee848c92", //JPush Appkey. JPUSH_APPKEY : "571d93ae5117da6dee848c92", //JPush Appkey.
JPUSH_CHANNEL : "developer-default", //. JPUSH_CHANNEL : "developer-default", //.
MEIZU_APPKEY : "MZ-魅族的APPKEY", MEIZU_APPKEY : "MZ-魅族的APPKEY",
MEIZU_APPID : "MZ-魅族的APPID", MEIZU_APPID : "MZ-魅族的APPID",
XIAOMI_APPID : "MI-小米的APPID", XIAOMI_APPID : "MI-小米的APPID",
XIAOMI_APPKEY : "MI-小米的APPKEY", XIAOMI_APPKEY : "MI-小米的APPKEY",
OPPO_APPKEY : "OP-oppo的APPKEY", OPPO_APPKEY : "OP-oppo的APPKEY",
OPPO_APPID : "OP-oppo的APPID", OPPO_APPID : "OP-oppo的APPID",
OPPO_APPSECRET : "OP-oppo的APPSECRET", OPPO_APPSECRET: "OP-oppo的APPSECRET",
VIVO_APPKEY : "vivo的APPKEY", VIVO_APPKEY : "vivo的APPKEY",
VIVO_APPID : "vivo的APPID" VIVO_APPID : "vivo的APPID"
] ]
} }
// sourceSets { // sourceSets {
@ -107,7 +108,7 @@ android {
} }
} }
repositories{ repositories {
flatDir { flatDir {
dirs 'libs' dirs 'libs'
} }
@ -115,7 +116,8 @@ android {
productFlavors { productFlavors {
qa { qa {
manifestPlaceholders = [CHANNEL_VALUE: "好运司机测试"] manifestPlaceholders = [CHANNEL_VALUE: "好运司机测试",
app_icon : "@drawable/diver_logo_text"]
buildConfigField("String", "OPEN_AL_URL", "\"https://oapi-staging.alct56.com\"") buildConfigField("String", "OPEN_AL_URL", "\"https://oapi-staging.alct56.com\"")
buildConfigField("String", "BASE_URL", "\"http://app.test.dahehuoyun.com/api/\"") buildConfigField("String", "BASE_URL", "\"http://app.test.dahehuoyun.com/api/\"")
buildConfigField "boolean", "isTest", "true" buildConfigField "boolean", "isTest", "true"
@ -123,7 +125,8 @@ android {
resValue "string", "appName", "司机测试" resValue "string", "appName", "司机测试"
} }
product { product {
manifestPlaceholders = [CHANNEL_VALUE: "大河好运司机"] manifestPlaceholders = [CHANNEL_VALUE: "大河好运司机",
app_icon : "@drawable/diver_logo"]
buildConfigField("String", "OPEN_AL_URL", "\"https://oapi.alct56.com\"") buildConfigField("String", "OPEN_AL_URL", "\"https://oapi.alct56.com\"")
buildConfigField("String", "BASE_URL", "\"http://app.dahehuoyun.com/api/\"") buildConfigField("String", "BASE_URL", "\"http://app.dahehuoyun.com/api/\"")
buildConfigField "boolean", "isTest", "false" buildConfigField "boolean", "isTest", "false"
@ -132,22 +135,22 @@ android {
} }
} }
productFlavors.all { flavor -> // productFlavors.all { flavor ->
flavor.manifestPlaceholders = [CHANNEL_VALUE: name] // flavor.manifestPlaceholders = [CHANNEL_VALUE: name]
} // }
android.applicationVariants.all { variant -> android.applicationVariants.all { variant ->
variant.outputs.all { variant.outputs.all {
def date = new Date().format("MMdd_HH-mm" , TimeZone.getTimeZone("GMT+08")) def date = new Date().format("MMdd_HH-mm", TimeZone.getTimeZone("GMT+08"))
def isText = variant.productFlavors[0].properties.get("buildConfigFields").getAt("isTest").properties.get("value") def isText = variant.productFlavors[0].properties.get("buildConfigFields").getAt("isTest").properties.get("value")
def appName = null def appName = null
if (isText=="true") { if (isText == "true") {
appName = '大河好运司机测试_' appName = '大河好运司机测试_'
}else{ } else {
appName = '大河好运司机_' appName = '大河好运司机_'
} }
outputFileName =appName+"${variant.buildType.name}_${defaultConfig.versionName}_${date}.apk" outputFileName = appName + "${variant.buildType.name}_${defaultConfig.versionName}_${date}.apk"
} }
} }
lintOptions { lintOptions {
@ -171,10 +174,10 @@ dependencies {
// //
implementation 'com.haozhang.libary:android-slanted-textview:1.2' implementation 'com.haozhang.libary:android-slanted-textview:1.2'
// //
implementation 'com.scwang.smart:refresh-layout-kernel:2.0.1' implementation 'com.scwang.smart:refresh-layout-kernel:2.0.1'
implementation 'com.scwang.smart:refresh-header-material:2.0.1' implementation 'com.scwang.smart:refresh-header-material:2.0.1'
implementation 'com.scwang.smart:refresh-footer-ball:2.0.1' // implementation 'com.scwang.smart:refresh-footer-ball:2.0.1' //
implementation 'com.scwang.smart:refresh-footer-classics:2.0.1' // implementation 'com.scwang.smart:refresh-footer-classics:2.0.1' //
// //
implementation 'com.github.jenly1314.AppUpdater:app-updater:1.2.0' implementation 'com.github.jenly1314.AppUpdater:app-updater:1.2.0'
implementation 'com.github.jenly1314.AppUpdater:app-dialog:1.2.0' implementation 'com.github.jenly1314.AppUpdater:app-dialog:1.2.0'
@ -189,7 +192,7 @@ dependencies {
implementation 'com.alibaba:fastjson:1.2.61' implementation 'com.alibaba:fastjson:1.2.61'
implementation 'org.bouncycastle:bcprov-jdk15on:1.55' implementation 'org.bouncycastle:bcprov-jdk15on:1.55'
implementation 'org.apache.commons:commons-lang3:3.5' implementation 'org.apache.commons:commons-lang3:3.5'
implementation (name:'locationgd-androidx_2.1.0', ext:'aar')// implementation(name: 'locationgd-androidx_2.1.0', ext: 'aar')//
// //
// implementation 'com.google.code.gson:gson:2.8.6' // implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.loopj.android:android-async-http:1.4.9' implementation 'com.loopj.android:android-async-http:1.4.9'
@ -204,10 +207,10 @@ dependencies {
// //
// SDK根据宿主App是否使用相关业务按需引入 // SDK根据宿主App是否使用相关业务按需引入
// SDK // SDK
implementation 'com.umeng.umsdk:common:9.4.2'// implementation 'com.umeng.umsdk:common:9.4.2'//
implementation 'com.umeng.umsdk:asms:1.4.1'// implementation 'com.umeng.umsdk:asms:1.4.1'//
implementation 'com.umeng.umsdk:apm:1.4.2' // SDKcrash数据请一定集成 implementation 'com.umeng.umsdk:apm:1.4.2' // SDKcrash数据请一定集成
implementation 'com.umeng.umsdk:abtest:1.0.0'//使U-App中ABTest能力 implementation 'com.umeng.umsdk:abtest:1.0.0'//使U-App中ABTest能力
// //
implementation "org.permissionsdispatcher:permissionsdispatcher:4.6.0" implementation "org.permissionsdispatcher:permissionsdispatcher:4.6.0"
kapt "org.permissionsdispatcher:permissionsdispatcher-processor:4.6.0" kapt "org.permissionsdispatcher:permissionsdispatcher-processor:4.6.0"
@ -216,8 +219,8 @@ dependencies {
//EventBus //EventBus
implementation 'org.greenrobot:eventbus:3.1.1' implementation 'org.greenrobot:eventbus:3.1.1'
// //
implementation(name:'EsignSDK', ext:'aar') implementation(name: 'EsignSDK', ext: 'aar')
implementation'pub.devrel:easypermissions:1.3.0' implementation 'pub.devrel:easypermissions:1.3.0'
implementation "com.squareup.retrofit2:retrofit:2.4.0" implementation "com.squareup.retrofit2:retrofit:2.4.0"
// implementation "com.squareup.retrofit2:converter-gson:2.4.0" // implementation "com.squareup.retrofit2:converter-gson:2.4.0"

View File

@ -53,7 +53,7 @@
android:name="com.arpa.hndahesudintocctmsdriver.App" android:name="com.arpa.hndahesudintocctmsdriver.App"
android:allowBackup="true" android:allowBackup="true"
android:excludeFromRecents="true" android:excludeFromRecents="true"
android:icon="@drawable/diver_logo" android:icon="${app_icon}"
android:label="@string/appName" android:label="@string/appName"
android:largeHeap="true" android:largeHeap="true"
android:requestLegacyExternalStorage="true" android:requestLegacyExternalStorage="true"