build.gradle 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. plugins {
  2. id 'com.android.application'
  3. }
  4. android {
  5. compileSdkVersion rootProject.ext.android["compileSdkVersion"]
  6. buildToolsVersion rootProject.ext.android["buildToolsVersion"]
  7. defaultConfig {
  8. applicationId rootProject.ext.android["applicationId"]
  9. minSdkVersion rootProject.ext.android["minSdkVersion"]
  10. targetSdkVersion rootProject.ext.android["targetSdkVersion"]
  11. versionCode rootProject.ext.android["versionCode"]
  12. versionName rootProject.ext.android["versionName"]
  13. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  14. consumerProguardFiles 'consumer-rules.pro'
  15. flavorDimensions "versionCode"
  16. }
  17. signingConfigs {
  18. debug {
  19. storeFile file('./src/main/jks/hh-face.jks')
  20. storePassword 'Nqj##117521'
  21. keyAlias 'hemile'
  22. keyPassword 'Nqj##117521'
  23. }
  24. release {
  25. storeFile file('./src/main/jks/hh-face.jks')
  26. storePassword 'Nqj##117521'
  27. keyAlias 'hemile'
  28. keyPassword 'Nqj##117521'
  29. }
  30. }
  31. buildTypes {
  32. release {
  33. // 服务器地址
  34. buildConfigField("String", "BASE_URL", "\"https://tx.hz-hanghui.com:8088/\"")
  35. buildConfigField("String", "BASE_API_URL", "\"hanghui-server-platform/\"")
  36. buildConfigField("String", "BASE_URL_OMC", "\"https://hhomc.hz-hanghui.com:8096/\"")
  37. // aidl服务端包名
  38. buildConfigField("String", "AIDL_SERVER_APP_PACKAGE_NAME", "\"com.hh.hhomc\"")
  39. resValue "string", "app_name", "HHArome"
  40. signingConfig signingConfigs.release
  41. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  42. shrinkResources false
  43. minifyEnabled false
  44. zipAlignEnabled true
  45. debuggable true
  46. jniDebuggable true
  47. testCoverageEnabled false
  48. // 3.0后的配置
  49. applicationVariants.all { variant ->
  50. variant.outputs.all { output ->
  51. def outputFile = output.outputFile
  52. if (outputFile != null && outputFile.name.endsWith('.apk')) {
  53. // 输出apk名称为jjb_v1.0_wandoujia.apk
  54. def fileName_new = "hharome_v${defaultConfig.versionName}_${variant.productFlavors[0].name}.apk"
  55. outputFileName = fileName_new
  56. }
  57. }
  58. }
  59. }
  60. yufabu {
  61. applicationIdSuffix ".yufabu"
  62. buildConfigField("String", "BASE_URL", "\"http://192.168.11.87:8081/\"")
  63. buildConfigField("String", "BASE_API_URL", "\"hanghui/outapi/\"")
  64. buildConfigField("String", "BASE_URL_OMC", "\"http://192.168.11.9:9086/\"")
  65. // aidl服务端包名
  66. buildConfigField("String", "AIDL_SERVER_APP_PACKAGE_NAME", "\"com.hh.hhomc.yufabu\"")
  67. // 测试的IM信息
  68. // buildConfigField("int", "TIM_SDKAPPID", "1400803088")
  69. // buildConfigField("String", "TIM_SECRETKEY", "\"f942e1545dd5465c6d54fe68d2c42d9af424a2e7f3ed84133bc2f7b40191b271\"")
  70. resValue "string", "app_name", "测试HHArome"
  71. minifyEnabled false
  72. shrinkResources false
  73. jniDebuggable true
  74. debuggable true
  75. signingConfig signingConfigs.release
  76. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  77. }
  78. debug {
  79. applicationIdSuffix ".test"
  80. buildConfigField("String", "BASE_URL", "\"http://192.168.11.17:8081/\"")
  81. buildConfigField("String", "BASE_API_URL", "\"hanghui/outapi/\"")
  82. buildConfigField("String", "BASE_URL_OMC", "\"http://192.168.11.9:9086/\"")
  83. // aidl服务端包名
  84. buildConfigField("String", "AIDL_SERVER_APP_PACKAGE_NAME", "\"com.hh.hhomc.test\"")
  85. resValue "string", "app_name", "开发HHArome"
  86. minifyEnabled false
  87. shrinkResources false
  88. jniDebuggable true
  89. debuggable true
  90. signingConfig signingConfigs.release
  91. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  92. }
  93. }
  94. // 与buildTypes中输出签名后的apk对应
  95. productFlavors {
  96. app {}
  97. }
  98. productFlavors.all {
  99. flavor -> flavor.manifestPlaceholders = [CHANNEL_VALUE: name]
  100. }
  101. dexOptions {
  102. javaMaxHeapSize "4g"
  103. }
  104. repositories {
  105. flatDir {
  106. dirs 'libs'
  107. }
  108. }
  109. sourceSets {
  110. main {
  111. jniLibs.srcDirs = ['libs']
  112. }
  113. }
  114. compileOptions {
  115. sourceCompatibility JavaVersion.VERSION_1_8
  116. targetCompatibility JavaVersion.VERSION_1_8
  117. }
  118. ndkVersion '21.0.6113669'
  119. }
  120. dependencies {
  121. implementation 'androidx.appcompat:appcompat:1.1.0'
  122. implementation 'com.google.android.material:material:1.1.0'
  123. implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
  124. testImplementation 'junit:junit:4.+'
  125. androidTestImplementation 'androidx.test.ext:junit:1.1.1'
  126. androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
  127. // 添加base依赖
  128. implementation project(path: ':lib_base')
  129. // 微信xlog日志
  130. implementation 'com.elvishew:xlog:1.10.1'
  131. // 支付宝刷脸
  132. implementation(name: 'ABCP-API-5.5.2.4-lite', ext: 'aar')
  133. // 在线身份证
  134. implementation files('libs/IDOCR.PubSdk.Android.Std.NFC.Release-11.0.4.jar')
  135. //
  136. implementation files('libs/PosUtil.jar')
  137. // AMPE
  138. implementation(name: 'aromecli-build-1.0.0.230918203554', ext: 'aar')
  139. implementation 'com.alibaba:fastjson:1.2.76'
  140. //串口
  141. implementation 'com.github.licheedev:Android-SerialPort-API:2.0.0'
  142. //二维码串口
  143. implementation 'com.aill:AndroidSerialPort:1.0.8'
  144. // 串口通信
  145. implementation 'com.github.felHR85:UsbSerial:4.5.2'
  146. implementation project(':SeriaApp')
  147. //串口
  148. implementation 'com.github.maybesix:Android-XHLibrary:v1.0.0'
  149. implementation 'com.jakewharton:butterknife:7.0.0'
  150. }