build.gradle 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. plugins {
  2. id 'com.android.application'
  3. }
  4. def releaseTime() {
  5. return new Date().format("yyyyMMddHHmmss", TimeZone.getTimeZone("CTT"))
  6. }
  7. android {
  8. compileSdkVersion 31
  9. defaultConfig {
  10. applicationId "com.edufound.reader"
  11. minSdkVersion 21 //>23导致无法直接签名
  12. targetSdkVersion 31
  13. versionCode 32
  14. versionName "3.2"
  15. flavorDimensions "versionCode"
  16. manifestPlaceholders = [UMENG_CHANNEL_VALUE: "2006"]//添加一个默认渠道号
  17. ndk {
  18. //但是有些手机使用arm64-v8a会导致报错(联想要arm64-v8a,不然无法上传)
  19. abiFilters "arm64-v8a"
  20. abiFilters "armeabi-v7a"
  21. abiFilters "armeabi"
  22. abiFilters "x86"
  23. // 添加x86必须添加x86_64
  24. abiFilters "x86_64"
  25. }
  26. multiDexEnabled true
  27. }
  28. signingConfigs {
  29. efunboxKey {
  30. keyAlias "edufound_key"
  31. keyPassword "edufound321"
  32. storeFile file("C:/Users/candy/Desktop/efunbox/edufound.keystore")
  33. storePassword "edufound123"
  34. v1SigningEnabled true
  35. v2SigningEnabled true
  36. }
  37. }
  38. buildTypes {
  39. release {
  40. minifyEnabled false
  41. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  42. signingConfig signingConfigs.efunboxKey
  43. applicationVariants.all { variant ->
  44. variant.outputs.each { output ->
  45. def outputFile = output.outputFileName
  46. if (outputFile != null && output.outputFileName.endsWith('.apk')) {
  47. def fileName = "efunbox_reader_v${defaultConfig.versionCode}_${releaseTime()}_${variant.productFlavors[0].manifestPlaceholders.UMENG_CHANNEL_VALUE}_r.apk"
  48. def channel = variant.productFlavors[0].manifestPlaceholders.UMENG_CHANNEL_VALUE;
  49. def newoutputFile = "";
  50. if (channel == ("2006")) {
  51. newoutputFile = "\\义方\\"
  52. } else if (channel == ("3002")) {
  53. newoutputFile = "\\天猫精灵\\"
  54. } else if (channel == ("3003")) {
  55. newoutputFile = "\\小度音响\\"
  56. } else if (channel == ("2016")) {
  57. newoutputFile = "\\小爱音响\\"
  58. } else if (channel == ("3004")) {
  59. newoutputFile = "\\联想pad\\"
  60. } else if (channel == ("3007")) {
  61. newoutputFile = "\\京东方\\"
  62. } else if (channel == ("3008")) {
  63. newoutputFile = "\\华为pad联运\\"
  64. } else if (channel == ("3009")) {
  65. newoutputFile = "\\步步高\\"
  66. }
  67. output.outputFileName = new File(newoutputFile, fileName)
  68. }
  69. }
  70. }
  71. }
  72. debug {
  73. minifyEnabled false
  74. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  75. signingConfig signingConfigs.efunboxKey
  76. zipAlignEnabled true
  77. }
  78. }
  79. packagingOptions {
  80. doNotStrip "*/armeabi/*.so"
  81. doNotStrip "*/armeabi-v7a/*.so"
  82. doNotStrip "*/arm64-v8a/*.so"
  83. doNotStrip "*/x86/*.so"
  84. doNotStrip "*/x86_64/*.so"
  85. }
  86. sourceSets {
  87. main {
  88. jniLibs.srcDirs = ['libs']
  89. res.srcDirs = [
  90. 'src/main/res', //默认只有这一个路径
  91. 'src/fragmentRecommend', //首页推荐
  92. 'src/fragmentUser',//首页我的
  93. 'src/activityLoginAlert',//登录弹窗
  94. 'src/exception',//异常弹窗
  95. 'src/testimg'//测试图片
  96. ]
  97. }
  98. }
  99. productFlavors {
  100. //义方
  101. channel_efunbox {
  102. signingConfig signingConfigs.efunboxKey
  103. manifestPlaceholders = [
  104. appCode: "3006",
  105. appIcon: "@drawable/icon",
  106. ]
  107. }
  108. //百度(小度音响)
  109. channel_baidu {
  110. signingConfig signingConfigs.efunboxKey
  111. manifestPlaceholders = [
  112. appCode: "3003",
  113. appIcon: "@drawable/icon",
  114. ]
  115. }
  116. //天猫精灵
  117. channel_tmail {
  118. signingConfig signingConfigs.efunboxKey
  119. manifestPlaceholders = [
  120. appCode: "3002",
  121. appIcon: "@drawable/icon",
  122. ]
  123. }
  124. //小爱音响
  125. channel_xayx {
  126. applicationIdSuffix ".xiaoai"
  127. signingConfig signingConfigs.efunboxKey
  128. manifestPlaceholders = [
  129. appCode: "2016",
  130. appIcon: "@drawable/icon",
  131. ]
  132. }
  133. //联想渠道
  134. channel_lenovo {
  135. signingConfig signingConfigs.efunboxKey
  136. manifestPlaceholders = [
  137. appCode: "3004",
  138. appIcon: "@drawable/icon",
  139. ]
  140. }
  141. //京东方
  142. channel_jingdongfang {
  143. signingConfig signingConfigs.efunboxKey
  144. manifestPlaceholders = [
  145. appCode: "3007",
  146. appIcon: "@drawable/icon",
  147. ]
  148. }
  149. //华为Pad联运
  150. channel_huawei {
  151. applicationIdSuffix ".huawei"
  152. signingConfig signingConfigs.efunboxKey
  153. manifestPlaceholders = [
  154. appCode: "3008",
  155. appIcon: "@drawable/icon",
  156. ]
  157. }
  158. //步步高pad
  159. channel_bubugao {
  160. signingConfig signingConfigs.efunboxKey
  161. manifestPlaceholders = [
  162. appCode: "3009",
  163. appIcon: "@drawable/icon",
  164. ]
  165. }
  166. }
  167. productFlavors.all {
  168. flavor -> flavor.manifestPlaceholders = [UMENG_CHANNEL_VALUE: manifestPlaceholders.appCode, icon: manifestPlaceholders.appIcon]
  169. }
  170. compileOptions {
  171. sourceCompatibility JavaVersion.VERSION_1_8
  172. targetCompatibility JavaVersion.VERSION_1_8
  173. }
  174. aaptOptions {
  175. additionalParameters = ["--warn-manifest-validation"]
  176. }
  177. }
  178. dependencies {
  179. implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
  180. implementation 'androidx.appcompat:appcompat:1.0.0'
  181. implementation 'com.github.bumptech.glide:glide:4.12.0'
  182. annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
  183. implementation 'jp.wasabeef:glide-transformations:4.3.0'
  184. implementation('com.zhousf.lib:okhttp3:2.9.9') {
  185. exclude(module: 'support-annotations')
  186. exclude(module: 'gson')
  187. }
  188. //gson
  189. implementation 'com.google.code.gson:gson:2.8.9'
  190. //logger
  191. implementation 'com.orhanobut:logger:2.2.0'
  192. //mmkv
  193. implementation 'com.tencent:mmkv:1.2.11'
  194. implementation 'com.uber.autodispose2:autodispose:2.0.0'
  195. implementation 'com.uber.autodispose2:autodispose-android:2.0.0'
  196. implementation 'com.uber.autodispose2:autodispose-lifecycle:2.0.0'
  197. implementation 'com.uber.autodispose2:autodispose-androidx-lifecycle:2.0.0'
  198. // 友盟基础组件库(所有友盟业务SDK都依赖基础组件库)
  199. implementation 'com.umeng.umsdk:common:9.4.4'// (必选)
  200. implementation 'com.umeng.umsdk:asms:1.4.1'// asms包依赖必选
  201. // required, enough for most devices.
  202. implementation 'tv.danmaku.ijk.media:ijkplayer-java:0.8.8'
  203. // ExoPlayer as IMediaPlayer: optional, experimental
  204. implementation 'tv.danmaku.ijk.media:ijkplayer-exo:0.8.8'
  205. //JZ播放器
  206. implementation 'cn.jzvd:jiaozivideoplayer:7.7.0'
  207. //recyclerview
  208. implementation 'androidx.recyclerview:recyclerview:1.1.0'
  209. //驰声
  210. implementation 'io.github.ChivoxSupport:vox-sdk:2.2.23+2.0.8.1'
  211. //rxBind
  212. implementation 'com.jakewharton.rxbinding4:rxbinding:4.0.0'
  213. implementation 'com.trello.rxlifecycle4:rxlifecycle:4.0.2'
  214. implementation 'com.trello.rxlifecycle4:rxlifecycle-android:4.0.2'
  215. implementation "androidx.constraintlayout:constraintlayout:2.1.1"
  216. // To use constraintlayout in compose
  217. implementation "androidx.constraintlayout:constraintlayout-compose:1.0.0-rc01"
  218. //解除Android P 反射机制
  219. implementation 'com.github.tiann:FreeReflection:3.1.0'
  220. //百度(小度音响SDK)
  221. implementation 'com.baidu.duer.botsdk:bot-sdk-android:1.56.1'
  222. // 3rd Party
  223. implementation "com.alibaba:fastjson:${FASTJSON_VERSION}"
  224. //zxing
  225. implementation 'com.google.zxing:android-core:3.3.0'
  226. implementation 'com.google.zxing:core:3.3.2'
  227. implementation files('libs/gcs-authservice-1.0.0.21.jar')
  228. implementation files('libs/registry-api-1.1.16-20201203.085134-3.jar')
  229. implementation files('libs/aranger.jar')
  230. //小米音响
  231. implementation files('libs/thirdparty-payment-sdk-2.1.1-20200527.030546-1.jar')
  232. //超长图imageview
  233. implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.5.0'
  234. // 1. Use Guava in your implementation only:
  235. implementation("com.google.guava:guava:31.1-jre")
  236. implementation("com.google.guava:guava:31.1-android")
  237. //FloatingViewLib(https://github.com/UFreedom/FloatingView/blob/master/README_CN.md)
  238. implementation 'com.ufreedom.uikit:FloatingViewLib:1.0.2'
  239. //SimpleRatingBar(https://github.com/williamyyu/SimpleRatingBar)
  240. implementation 'com.github.ome450901:SimpleRatingBar:1.4.0'
  241. }