diff --git a/.gitignore b/.gitignore index b1123a0..ef58d03 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ .externalNativeBuild .cxx /.idea/ +/config.gradle diff --git a/app/build.gradle b/app/build.gradle index 42772af..2e56a2b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,5 +1,13 @@ apply plugin: 'com.android.application' +static def appName() { + return "TTStdElderlyDialer" +} + +static def releaseTime() { + return new Date().format("yyyyMMdd_HHmmss", TimeZone.getDefault()) +} + android { compileSdkVersion 29 // buildToolsVersion "36.0.0" @@ -42,12 +50,56 @@ android { dataBinding { enabled true } + + buildConfigField "String", "QweatherId", "\"${qweatherConfigs.credential.id}\"" + buildConfigField "String", "QweatherKey", "\"${qweatherConfigs.credential.key}\"" + } + + signingConfigs { + keypub { + storeFile file(rootProject.ext.signingConfigs.keypub.storeFile) + storePassword rootProject.ext.signingConfigs.keypub.storePassword + keyAlias rootProject.ext.signingConfigs.keypub.keyAlias + keyPassword rootProject.ext.signingConfigs.keypub.keyPassword + } } buildTypes { + debug { + versionNameSuffix "_debug" + debuggable true + minifyEnabled false + //Zipalign优化 + zipAlignEnabled true + signingConfig signingConfigs.keypub + applicationVariants.all { variant -> + variant.outputs.each { output -> + if (outputFile != null) { + def fileName = "${appName()}_V${defaultConfig.versionName}_${releaseTime()}.apk" + output.outputFileName = fileName + } + } + } + } + release { minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + //Zipalign优化 + zipAlignEnabled true + //前一部分代表系统默认的android程序的混淆文件,该文件已经包含了基本的混淆声明,后一个文件是自己的定义混淆文件 + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + //签名 + signingConfig signingConfigs.keypub +// 将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) + } + } + } } } @@ -55,6 +107,8 @@ android { dependencies { // implementation fileTree(dir: 'libs', include: ['*.jar']) + //Android 4.4+ + implementation files('libs/QWeather_Public_Android_V4.20.jar') implementation project(path: ':niceimageview') implementation project(path: ':iconloader') @@ -125,6 +179,14 @@ dependencies { // 要与compiler匹配使用,均使用最新版可以保证兼容 implementation 'com.alibaba:arouter-api:1.5.2' annotationProcessor 'com.alibaba:arouter-compiler:1.5.2' + //地图组件 + implementation 'com.baidu.lbsyun:BaiduMapSDK_Map:7.6.4' + //基础定位组件 + implementation 'com.baidu.lbsyun:BaiduMapSDK_Location:9.6.4' + //全量定位组件 +// implementation 'com.baidu.lbsyun:BaiduMapSDK_Location_All:9.6.4' + //TTS组件 + implementation 'com.baidu.lbsyun:NaviTts:3.2.13' //指示器 implementation 'com.github.hackware1993:MagicIndicator:1.7.0' diff --git a/app/libs/QWeather_Public_Android_V4.20.jar b/app/libs/QWeather_Public_Android_V4.20.jar new file mode 100644 index 0000000..8e18422 Binary files /dev/null and b/app/libs/QWeather_Public_Android_V4.20.jar differ diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index d048109..148ec4d 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -9,6 +9,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { private static final String TAG = "MainActivity"; protected MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE); @@ -150,6 +156,7 @@ public class MainActivity extends BaseMvvmActivity>() { @Override public void onChanged(List appInfos) { @@ -164,10 +171,51 @@ public class MainActivity extends BaseMvvmActivity + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/build.gradle b/build.gradle index e9c351d..8d0ffcd 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,5 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. +apply from: "config.gradle" buildscript {