build.gradle 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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. consumerProguardFiles 'consumer-rules.pro'
  16. flavorDimensions "versionCode"
  17. ndk {
  18. abiFilters "armeabi-v7a","armeabi"
  19. // abiFilters "arm64-v8a"
  20. }
  21. }
  22. signingConfigs {
  23. debug {
  24. storeFile file('./src/main/jks/hh-face.jks')
  25. storePassword 'Nqj##117521'
  26. keyAlias 'hemile'
  27. keyPassword 'Nqj##117521'
  28. }
  29. release {
  30. storeFile file('./src/main/jks/hh-face.jks')
  31. storePassword 'Nqj##117521'
  32. keyAlias 'hemile'
  33. keyPassword 'Nqj##117521'
  34. }
  35. }
  36. buildTypes {
  37. // 因为支付宝刷脸需要包名一致,所以以后仅使用release版本,不再使用debug版本
  38. release {
  39. // 服务器地址
  40. // 正式
  41. buildConfigField("String", "BASE_URL", "\"https://tx.hz-hanghui.com:8088/\"")
  42. buildConfigField("String", "BASE_API_URL", "\"hanghui-server-platform/\"")
  43. buildConfigField("String", "BASE_URL_OMC", "\"https://hhomc.hz-hanghui.com:8096/\"")
  44. // aidl服务端包名
  45. buildConfigField("String", "AIDL_SERVER_APP_PACKAGE_NAME", "\"com.hh.hhomc\"")
  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. }
  67. // 与buildTypes中输出签名后的apk对应
  68. productFlavors {
  69. app {}
  70. }
  71. productFlavors.all {
  72. flavor -> flavor.manifestPlaceholders = [CHANNEL_VALUE: name]
  73. }
  74. dexOptions {
  75. javaMaxHeapSize "4g"
  76. }
  77. repositories {
  78. flatDir {
  79. dirs 'libs'
  80. }
  81. }
  82. sourceSets {
  83. main {
  84. jniLibs.srcDirs = ['libs']
  85. }
  86. }
  87. compileOptions {
  88. sourceCompatibility JavaVersion.VERSION_1_8
  89. targetCompatibility JavaVersion.VERSION_1_8
  90. }
  91. ndkVersion '21.0.6113669'
  92. // 去除重复的so
  93. packagingOptions {
  94. // pickFirsts:当出现重复文件,会使用第一个匹配的文件打包进入apk
  95. pickFirst 'lib/armeabi-v7a/libandroid_serial_port.so'
  96. pickFirst 'lib/armeabi-v7a/libserial_port.so'
  97. pickFirst 'lib/armeabi/libserial_port.so'
  98. //天波身份证和打印机用的是同一个架包
  99. pickFirst 'lib/armeabi-v7a/libidcard.so'
  100. pickFirst 'lib/armeabi-v7a/libsystem_util.so'
  101. pickFirst 'lib/armeabi-v7a/libtb_wlt2bmp.so'
  102. pickFirst 'lib/armeabi-v7a/libtelpo_serial.so'
  103. exclude 'META-INF/DEPENDENCIES'
  104. exclude 'META-INF/NOTICE'
  105. exclude 'META-INF/LICENSE'
  106. exclude 'okhttp3/internal/publicsuffix/publicsuffixes.gz'
  107. }
  108. configurations.all {
  109. resolutionStrategy {
  110. force 'androidx.appcompat:appcompat:1.1.0'
  111. }
  112. }
  113. }
  114. dependencies {
  115. implementation rootProject.ext.dependencies["appcompat"]
  116. implementation rootProject.ext.dependencies["material"]
  117. implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
  118. // 添加base依赖
  119. implementation project(path: ':lib_base')
  120. implementation project(path: ':lib_common')
  121. implementation rootProject.ext.dependencies["rxjava2"]
  122. implementation rootProject.ext.dependencies["rxandroid2"]
  123. implementation rootProject.ext.dependencies["okhttp3"]
  124. implementation rootProject.ext.dependencies["okhttp3-log"]
  125. implementation rootProject.ext.dependencies["retrofit"]
  126. implementation rootProject.ext.dependencies["retrofit-gson"]
  127. implementation rootProject.ext.dependencies["gson"]
  128. implementation rootProject.ext.dependencies["eventbus"]
  129. implementation rootProject.ext.dependencies["glide"]
  130. //国密ma4加解密及签名
  131. implementation 'com.blankj:utilcodex:1.31.1'
  132. //TTS
  133. implementation project(path: ':lib_tts')
  134. //各设备厂商提供的控制代码
  135. implementation project(path: ':lib_device')
  136. //AMPE
  137. implementation project(path: ':lib_ampe')
  138. //刷脸、FACE
  139. implementation project(path: ':lib_face')
  140. //身份证
  141. implementation project(path: ':lib_idcard')
  142. implementation project(path: ':lib_idcard:lib_idcard_base')
  143. implementation project(path: ':lib_idcard:lib_nfc_readcard')
  144. //副屏库
  145. implementation project(':secondaryscreen')
  146. //红外线
  147. implementation project(':lib_infrared')
  148. //二维码
  149. implementation project(':lib_qr')
  150. //实时语音
  151. implementation project(':lib_record')
  152. //社保卡
  153. implementation project(':lib_social_security_card')
  154. //NFC
  155. implementation project(':lib_nfc')
  156. //打印机
  157. implementation project(':lib_print')
  158. //东信多合一基础包
  159. implementation project(':lib_dx_base_multi')
  160. //数科 ASR 语音识别
  161. implementation project(':lib_asr')
  162. }
  163. repositories {
  164. mavenCentral()
  165. }