build.gradle 10 KB

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