build.gradle 9.4 KB

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