build.gradle 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. plugins {
  2. id 'com.android.application'
  3. id 'dagger.hilt.android.plugin'
  4. id 'stringfog'
  5. id 'com.didi.dokit'
  6. id 'com.atmob.protect'
  7. }
  8. def LOCAL = "local", TEST = "test", PROD = "prod"
  9. def getServerHost(String env) {
  10. switch (env) {
  11. case "local":
  12. return "$local_server_host";
  13. case "test":
  14. return "$test_server_host";
  15. case "prod":
  16. return "$prod_server_host";
  17. default:
  18. return "$prod_server_host";
  19. }
  20. }
  21. android {
  22. namespace 'com.datarecovery.master'
  23. compileSdk rootProject.compileSdkVersion
  24. defaultConfig {
  25. applicationId rootProject.applicationId
  26. minSdk rootProject.minSdkVersion
  27. targetSdk rootProject.targetSdkVersion
  28. versionCode rootProject.versionCode
  29. versionName rootProject.versionName
  30. ndk {
  31. //noinspection ChromeOsAbiSupport
  32. abiFilters "arm64-v8a"
  33. }
  34. }
  35. signingConfigs {
  36. debug {
  37. storeFile file("keystore/ltjl.jks")
  38. storePassword "ltjl888"
  39. keyAlias "ltjl"
  40. keyPassword "ltjl888"
  41. }
  42. release {
  43. storeFile file("keystore/ltjl.jks")
  44. storePassword "ltjl888"
  45. keyAlias "ltjl"
  46. keyPassword "ltjl888"
  47. }
  48. }
  49. def env_release = PROD
  50. def env_debug = PROD
  51. buildTypes {
  52. release {
  53. minifyEnabled true
  54. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  55. signingConfig signingConfigs.release
  56. buildConfigField "boolean", "isLocalNetwork", "false"
  57. buildConfigField "boolean", "isSkipVideoAd", "false" //不要修改release的值
  58. buildConfigField "boolean", "isSkipOtherAd", "false" //不要修改release的值
  59. buildConfigField "String", "ENV", "\"$env_release\""
  60. buildConfigField "String", "HOST", "\"${getServerHost(env_release)}\""
  61. buildConfigField "String", "LOCAL", "\"$LOCAL\""
  62. buildConfigField "String", "TEST", "\"$TEST\""
  63. buildConfigField "String", "PROD", "\"$PROD\""
  64. buildConfigField "String", "WECHAT_APP_ID", "\"$wechat_app_id\""
  65. buildConfigField "String", "WECHAT_KF_ID", "\"$wechat_kf_id\""
  66. buildConfigField "String", "WEWORK_CROP_ID", "\"$wework_crop_id\""
  67. buildConfigField "String", "GRAVITY_ACCESS_TOKEN", "\"$gravity_access_token\""
  68. buildConfigField "String", "BUGLY_APP_ID", "\"$bugly_app_id\""
  69. buildConfigField "String", "UMENG_APP_KEY", "\"$umeng_app_key\""
  70. buildConfigField "String", "QIYU_APP_KEY", "\"$qiyu_app_key\""
  71. buildConfigField "String", "ATMOB_CENTRAL_KEY", "\"$atmob_central_key\""
  72. buildConfigField "String", "QUICK_LOGIN_ID", "\"$quick_login_id\""
  73. }
  74. debug {
  75. minifyEnabled false
  76. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  77. signingConfig signingConfigs.debug
  78. buildConfigField "boolean", "isLocalNetwork", "false"
  79. buildConfigField "boolean", "isSkipVideoAd", "false"
  80. buildConfigField "boolean", "isSkipOtherAd", "false"
  81. buildConfigField "String", "ENV", "\"$env_debug\""
  82. buildConfigField "String", "HOST", "\"${getServerHost(env_debug)}\""
  83. buildConfigField "String", "LOCAL", "\"$LOCAL\""
  84. buildConfigField "String", "TEST", "\"$TEST\""
  85. buildConfigField "String", "PROD", "\"$PROD\""
  86. buildConfigField "String", "WECHAT_APP_ID", "\"$wechat_app_id\""
  87. buildConfigField "String", "WECHAT_KF_ID", "\"$wechat_kf_id\""
  88. buildConfigField "String", "WEWORK_CROP_ID", "\"$wework_crop_id\""
  89. buildConfigField "String", "GRAVITY_ACCESS_TOKEN", "\"$gravity_access_token\""
  90. buildConfigField "String", "BUGLY_APP_ID", "\"$bugly_app_id\""
  91. buildConfigField "String", "UMENG_APP_KEY", "\"$umeng_app_key\""
  92. buildConfigField "String", "QIYU_APP_KEY", "\"$qiyu_app_key\""
  93. buildConfigField "String", "ATMOB_CENTRAL_KEY", "\"$atmob_central_key\""
  94. buildConfigField "String", "QUICK_LOGIN_ID", "\"$quick_login_id\""
  95. }
  96. }
  97. compileOptions {
  98. sourceCompatibility JavaVersion.VERSION_1_8
  99. targetCompatibility JavaVersion.VERSION_1_8
  100. }
  101. buildFeatures {
  102. viewBinding true
  103. dataBinding true
  104. }
  105. applicationVariants.configureEach { variant ->
  106. def date = new Date().format("YYMMddHHmmss")
  107. def server = variant.buildType.name == "release" ? env_release : env_debug
  108. variant.outputs.configureEach {
  109. def fileName = "${defaultConfig.applicationId}" +
  110. "-v${defaultConfig.versionName}" +
  111. "-${variant.buildType.name}" +
  112. "-${server}" +
  113. "-${date}" +
  114. ".apk"
  115. outputFileName = fileName
  116. }
  117. }
  118. sourceSets {
  119. main { jniLibs.srcDirs = ['libs'] }
  120. }
  121. configurations.configureEach {
  122. resolutionStrategy {
  123. // don't cache changing modules at all
  124. cacheChangingModulesFor 10, 'seconds'
  125. }
  126. }
  127. }
  128. import com.github.megatronking.stringfog.plugin.kg.RandomKeyGenerator
  129. stringfog {
  130. implementation 'com.github.megatronking.stringfog.xor.StringFogImpl'
  131. fogPackages = ['com.datarecovery.master']
  132. debug false
  133. enable true
  134. kg new RandomKeyGenerator()
  135. mode base64
  136. }
  137. atmobProtect {
  138. enable = true
  139. packageNames = ['com.atmob.central', 'com.datarecovery.master']
  140. abiFilters = ['arm64-v8a']
  141. androidSdkPath = "$sdk_path"
  142. cmakePath = "$cmake_path"
  143. ndkPath = "$ndk_path"
  144. }
  145. dependencies {
  146. //jar or aar
  147. implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
  148. //Atmob SDK
  149. implementation 'extra.common:base:1.0.0-SNAPSHOT'
  150. implementation "extra.pack:channel:1.1.0-SNAPSHOT"
  151. implementation "extra.common:core:2.0.4-SNAPSHOT" //base utils
  152. implementation "extra.common:network:1.1.0-SNAPSHOT"
  153. implementation "extra.common:rxjava:1.1.0-SNAPSHOT"
  154. //中台sdk
  155. implementation "atmob.central:core:1.0.8-SNAPSHOT"
  156. //字节 融合归因
  157. implementation 'atmob.sdk:app-convert:2.0.0-SNAPSHOT'
  158. //引力引擎
  159. implementation 'atmob.sdk:gravity-engine:4.8.25-SNAPSHOT'
  160. //oaid
  161. implementation "extra.common:oaid:1.2.0-SNAPSHOT"
  162. //AppCompat
  163. implementation "androidx.appcompat:appcompat:$rootProject.appcompat_version"
  164. //Material
  165. implementation "com.google.android.material:material:$rootProject.material_version"
  166. //RecyclerView
  167. implementation "androidx.recyclerview:recyclerview:$rootProject.recyclerview_version"
  168. //ConstraintLayout
  169. implementation "androidx.constraintlayout:constraintlayout:$rootProject.constraintlayout_version"
  170. //Gson
  171. implementation "com.google.code.gson:gson:$rootProject.gson_version"
  172. //Lifecycle
  173. implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$rootProject.lifecycle_version"
  174. implementation "androidx.lifecycle:lifecycle-livedata:$rootProject.lifecycle_version"
  175. implementation "androidx.lifecycle:lifecycle-reactivestreams:$rootProject.lifecycle_version"
  176. implementation "androidx.lifecycle:lifecycle-process:$rootProject.lifecycle_version"
  177. //Hilt
  178. implementation "com.google.dagger:hilt-android:$rootProject.hilt_version"
  179. annotationProcessor "com.google.dagger:hilt-compiler:$rootProject.hilt_version"
  180. //Glide
  181. implementation "com.github.bumptech.glide:glide:$rootProject.glide_version"
  182. annotationProcessor "com.github.bumptech.glide:compiler:$rootProject.glide_version"
  183. //MMKV
  184. implementation "com.tencent:mmkv:$rootProject.mmkv_version"
  185. //immersionbar
  186. implementation "com.gyf.immersionbar:immersionbar:$rootProject.immersionbar_version"
  187. implementation "com.gyf.immersionbar:immersionbar-components:$rootProject.immersionbar_version"
  188. //字符串加密算法
  189. implementation "com.github.megatronking.stringfog:xor:$rootProject.stringfog_verstion"
  190. //RefreshLayout
  191. implementation "androidx.swiperefreshlayout:swiperefreshlayout:$rootProject.swiperefreshlayout_version"
  192. //PhotoView
  193. implementation 'com.github.chrisbanes:PhotoView:2.3.0'
  194. //zxing
  195. implementation "third.zxing:zxing:3.5.1"
  196. //Umeng
  197. dependencies {
  198. // 友盟基础组件库(所有友盟业务SDK都依赖基础组件库)
  199. implementation 'com.umeng.umsdk:common:9.8.8'
  200. implementation 'com.umeng.umsdk:asms:1.8.7.2'
  201. implementation 'com.umeng.umsdk:apm:2.0.6'
  202. }
  203. //Bugly
  204. implementation "com.tencent.bugly:crashreport:$rootProject.bugly_version"
  205. //SVGA
  206. implementation 'com.github.svga:SVGAPlayer-Android:2.6.1'
  207. //dokit
  208. debugImplementation("io.github.didi.dokit:dokitx:$rootProject.dokit_version")
  209. {
  210. exclude group: 'com.google.zxing', module: 'core'
  211. }
  212. releaseImplementation("io.github.didi.dokit:dokitx-no-op:$rootProject.dokit_version")
  213. // Atmob Ad
  214. implementation "plus.ad:mediation:3.0.11.0-SNAPSHOT" //广告聚合模块
  215. implementation("plus.ad:mediation-gromore:6.8.4.0.1-SNAPSHOT") {
  216. exclude group: 'plus.bytedance', module: 'mediation-adscope'
  217. } //Gromore adapter
  218. implementation "plus.ad:mediation-tobid:4.5.4.1-SNAPSHOT" //Tobid adapter
  219. implementation "plus.ad:mediation-taku:6.4.87.1-SNAPSHOT"
  220. //VapPlayer 动效
  221. implementation "io.github.tencent:vap:2.0.28"
  222. }