build.gradle 7.4 KB

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