build.gradle 9.6 KB

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