build.gradle 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. plugins {
  2. id 'com.android.application'
  3. id 'dagger.hilt.android.plugin'
  4. id 'stringfog'
  5. id 'com.didi.dokit'
  6. }
  7. def LOCAL = "local", TEST = "test", PROD = "prod"
  8. def getServerHost(String env) {
  9. switch (env) {
  10. case "local":
  11. return "$local_server_host";
  12. case "test":
  13. return "$test_server_host";
  14. case "prod":
  15. return "$prod_server_host";
  16. default:
  17. return "$prod_server_host";
  18. }
  19. }
  20. android {
  21. namespace 'com.datarecovery.master'
  22. compileSdk rootProject.compileSdkVersion
  23. defaultConfig {
  24. applicationId rootProject.applicationId
  25. minSdk rootProject.minSdkVersion
  26. targetSdk rootProject.targetSdkVersion
  27. versionCode rootProject.versionCode
  28. versionName rootProject.versionName
  29. ndk {
  30. //noinspection ChromeOsAbiSupport
  31. abiFilters "arm64-v8a"
  32. }
  33. }
  34. signingConfigs {
  35. debug {
  36. storeFile file("keystore/recover.jks")
  37. storePassword "recover888"
  38. keyAlias "recover"
  39. keyPassword "recover888"
  40. }
  41. release {
  42. storeFile file("keystore/recover.jks")
  43. storePassword "recover888"
  44. keyAlias "recover"
  45. keyPassword "recover888"
  46. }
  47. }
  48. def env_release = PROD
  49. def env_debug = LOCAL
  50. buildTypes {
  51. release {
  52. minifyEnabled true
  53. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  54. signingConfig signingConfigs.release
  55. buildConfigField "String", "ENV", "\"$env_release\""
  56. buildConfigField "String", "HOST", "\"${getServerHost(env_release)}\""
  57. buildConfigField "String", "LOCAL", "\"$LOCAL\""
  58. buildConfigField "String", "TEST", "\"$TEST\""
  59. buildConfigField "String", "PROD", "\"$PROD\""
  60. buildConfigField "String", "WECHAT_APP_ID", "\"$wechat_app_id\""
  61. buildConfigField "String", "WECHAT_KF_ID", "\"$wechat_kf_id\""
  62. buildConfigField "String", "WEWORK_CROP_ID", "\"$wework_crop_id\""
  63. buildConfigField "String", "GRAVITY_ACCESS_TOKEN", "\"$gravity_access_token\""
  64. buildConfigField "String", "BUGLY_APP_ID", "\"$bugly_app_id\""
  65. buildConfigField "String", "UMENG_APP_KEY", "\"$umeng_app_key\""
  66. buildConfigField "String", "QIYU_APP_KEY", "\"$qiyu_app_key\""
  67. }
  68. debug {
  69. minifyEnabled false
  70. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  71. signingConfig signingConfigs.debug
  72. buildConfigField "String", "ENV", "\"$env_debug\""
  73. buildConfigField "String", "HOST", "\"${getServerHost(env_debug)}\""
  74. buildConfigField "String", "LOCAL", "\"$LOCAL\""
  75. buildConfigField "String", "TEST", "\"$TEST\""
  76. buildConfigField "String", "PROD", "\"$PROD\""
  77. buildConfigField "String", "WECHAT_APP_ID", "\"$wechat_app_id\""
  78. buildConfigField "String", "WECHAT_KF_ID", "\"$wechat_kf_id\""
  79. buildConfigField "String", "WEWORK_CROP_ID", "\"$wework_crop_id\""
  80. buildConfigField "String", "GRAVITY_ACCESS_TOKEN", "\"$gravity_access_token\""
  81. buildConfigField "String", "BUGLY_APP_ID", "\"$bugly_app_id\""
  82. buildConfigField "String", "UMENG_APP_KEY", "\"$umeng_app_key\""
  83. buildConfigField "String", "QIYU_APP_KEY", "\"$qiyu_app_key\""
  84. }
  85. }
  86. compileOptions {
  87. sourceCompatibility JavaVersion.VERSION_1_8
  88. targetCompatibility JavaVersion.VERSION_1_8
  89. }
  90. buildFeatures {
  91. viewBinding true
  92. dataBinding true
  93. }
  94. applicationVariants.configureEach { variant ->
  95. def date = new Date().format("YYMMddHHmmss")
  96. def server = variant.buildType.name == "release" ? env_release : env_debug
  97. variant.outputs.configureEach {
  98. def fileName = "${defaultConfig.applicationId}" +
  99. "-v${defaultConfig.versionName}" +
  100. "-${variant.buildType.name}" +
  101. "-${server}" +
  102. "-${date}" +
  103. ".apk"
  104. outputFileName = fileName
  105. }
  106. }
  107. sourceSets {
  108. main { jniLibs.srcDirs = ['libs'] }
  109. }
  110. configurations.configureEach {
  111. resolutionStrategy {
  112. // don't cache changing modules at all
  113. cacheChangingModulesFor 10, 'seconds'
  114. }
  115. }
  116. }
  117. import com.github.megatronking.stringfog.plugin.kg.RandomKeyGenerator
  118. stringfog {
  119. implementation 'com.github.megatronking.stringfog.xor.StringFogImpl'
  120. fogPackages = ['com.datarecovery.master']
  121. debug false
  122. enable true
  123. kg new RandomKeyGenerator()
  124. mode base64
  125. }
  126. dependencies {
  127. //jar or aar
  128. implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
  129. //Atmob SDK
  130. implementation 'extra.common:base:1.0.0-SNAPSHOT'
  131. implementation "extra.pack:channel:1.1.0-SNAPSHOT"
  132. implementation "extra.common:core:2.0.3-SNAPSHOT" //base utils
  133. implementation "extra.common:network:1.1.0-SNAPSHOT"
  134. implementation "extra.common:rxjava:1.1.0-SNAPSHOT"
  135. implementation "extra.common:user:1.0.1-SNAPSHOT" //get user data(includes device info)
  136. implementation("plus.pay:pay:1.1.0-SNAPSHOT") {
  137. exclude group: 'third.pay', module: 'ali'
  138. }
  139. api 'com.alipay.sdk:alipaysdk-android:15.8.16@aar'
  140. //oaid
  141. implementation "extra.common:oaid:1.2.0-SNAPSHOT"
  142. //AppCompat
  143. implementation "androidx.appcompat:appcompat:$rootProject.appcompat_version"
  144. //Material
  145. implementation "com.google.android.material:material:$rootProject.material_version"
  146. //RecyclerView
  147. implementation "androidx.recyclerview:recyclerview:$rootProject.recyclerview_version"
  148. //ConstraintLayout
  149. implementation "androidx.constraintlayout:constraintlayout:$rootProject.constraintlayout_version"
  150. //Gson
  151. implementation "com.google.code.gson:gson:$rootProject.gson_version"
  152. //Lifecycle
  153. implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$rootProject.lifecycle_version"
  154. implementation "androidx.lifecycle:lifecycle-livedata:$rootProject.lifecycle_version"
  155. implementation "androidx.lifecycle:lifecycle-reactivestreams:$rootProject.lifecycle_version"
  156. implementation "androidx.lifecycle:lifecycle-process:$rootProject.lifecycle_version"
  157. //Hilt
  158. implementation "com.google.dagger:hilt-android:$rootProject.hilt_version"
  159. annotationProcessor "com.google.dagger:hilt-compiler:$rootProject.hilt_version"
  160. //Glide
  161. implementation "com.github.bumptech.glide:glide:$rootProject.glide_version"
  162. annotationProcessor "com.github.bumptech.glide:compiler:$rootProject.glide_version"
  163. //MMKV
  164. implementation "com.tencent:mmkv:$rootProject.mmkv_version"
  165. //immersionbar
  166. implementation "com.gyf.immersionbar:immersionbar:$rootProject.immersionbar_version"
  167. implementation "com.gyf.immersionbar:immersionbar-components:$rootProject.immersionbar_version"
  168. //字符串加密算法
  169. implementation "com.github.megatronking.stringfog:xor:$rootProject.stringfog_verstion"
  170. //RefreshLayout
  171. implementation "androidx.swiperefreshlayout:swiperefreshlayout:$rootProject.swiperefreshlayout_version"
  172. //PhotoView
  173. implementation 'com.github.chrisbanes:PhotoView:2.3.0'
  174. //zxing
  175. implementation "third.zxing:zxing:3.5.1"
  176. //引力引擎
  177. implementation "cn.gravity.android:GravityEngineSDK:4.6.3"
  178. //Umeng
  179. dependencies {
  180. // 友盟基础组件库(所有友盟业务SDK都依赖基础组件库)
  181. implementation 'com.umeng.umsdk:common:9.6.7'
  182. implementation 'com.umeng.umsdk:asms:1.8.0'
  183. implementation 'com.umeng.umsdk:apm:1.9.4'
  184. }
  185. //Bugly
  186. implementation "com.tencent.bugly:crashreport:$rootProject.bugly_version"
  187. //SVGA
  188. implementation 'com.github.svga:SVGAPlayer-Android:2.6.1'
  189. //网易七鱼客服
  190. implementation 'com.qiyukf.unicorn:unicorn:9.2.0'
  191. //dokit
  192. debugImplementation("io.github.didi.dokit:dokitx:$rootProject.dokit_version")
  193. {
  194. exclude group: 'com.google.zxing', module: 'core'
  195. }
  196. releaseImplementation("io.github.didi.dokit:dokitx-no-op:$rootProject.dokit_version")
  197. }