build.gradle 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  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 == ("3006")) {
  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. } else if (channel == ("3011")) {
  71. newoutputFile = "\\百度学习机\\"
  72. }
  73. output.outputFileName = new File(newoutputFile, fileName)
  74. }
  75. }
  76. }
  77. }
  78. debug {
  79. minifyEnabled false
  80. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  81. signingConfig signingConfigs.efunboxKey
  82. zipAlignEnabled true
  83. }
  84. }
  85. packagingOptions {
  86. doNotStrip "*/armeabi/*.so"
  87. doNotStrip "*/armeabi-v7a/*.so"
  88. doNotStrip "*/arm64-v8a/*.so"
  89. doNotStrip "*/x86/*.so"
  90. doNotStrip "*/x86_64/*.so"
  91. }
  92. sourceSets {
  93. main {
  94. jniLibs.srcDirs = ['libs']
  95. res.srcDirs = [
  96. 'src/main/res', //默认只有这一个路径
  97. 'src/fragmentRecommend', //首页推荐
  98. 'src/fragmentUser',//首页我的
  99. 'src/activityLoginAlert',//登录弹窗
  100. 'src/exception',//异常弹窗
  101. 'src/testimg',//测试图片
  102. ]
  103. }
  104. }
  105. productFlavors {
  106. //义方
  107. channel_efunbox {
  108. signingConfig signingConfigs.efunboxKey
  109. manifestPlaceholders = [
  110. appCode: "3006",
  111. appIcon: "@drawable/icon",
  112. appName: "课文朗读"
  113. ]
  114. }
  115. //百度(小度音响)
  116. channel_baidu {
  117. signingConfig signingConfigs.efunboxKey
  118. manifestPlaceholders = [
  119. appCode: "3003",
  120. appIcon: "@drawable/icon",
  121. appName: "课文朗读"
  122. ]
  123. }
  124. //天猫精灵
  125. channel_tmail {
  126. signingConfig signingConfigs.efunboxKey
  127. manifestPlaceholders = [
  128. appCode: "3002",
  129. appIcon: "@drawable/icon",
  130. appName: "课文朗读"
  131. ]
  132. }
  133. //小爱音响
  134. channel_xayx {
  135. applicationIdSuffix ".xiaoai"
  136. signingConfig signingConfigs.efunboxKey
  137. manifestPlaceholders = [
  138. appCode: "2016",
  139. appIcon: "@drawable/icon",
  140. appName: "课文朗读"
  141. ]
  142. }
  143. //联想渠道
  144. channel_lenovo {
  145. signingConfig signingConfigs.efunboxKey
  146. manifestPlaceholders = [
  147. appCode: "3004",
  148. appIcon: "@drawable/icon",
  149. appName: "课文朗读"
  150. ]
  151. }
  152. //京东方
  153. channel_jingdongfang {
  154. signingConfig signingConfigs.efunboxKey
  155. manifestPlaceholders = [
  156. appCode: "3007",
  157. appIcon: "@drawable/icon",
  158. appName: "课文朗读"
  159. ]
  160. }
  161. //华为Pad联运
  162. channel_huawei_lianyun {
  163. apply plugin: "com.huawei.agconnect"
  164. applicationIdSuffix ".huawei"
  165. signingConfig signingConfigs.efunboxKey
  166. manifestPlaceholders = [
  167. appCode: "3008",
  168. appIcon: "@drawable/icon",
  169. appName: "课文朗读"
  170. ]
  171. }
  172. //步步高pad
  173. channel_bubugao {
  174. signingConfig signingConfigs.efunboxKey
  175. manifestPlaceholders = [
  176. appCode: "3009",
  177. appIcon: "@drawable/icon",
  178. appName: "课文朗读"
  179. ]
  180. }
  181. //讯飞pad
  182. channel_xunfei {
  183. signingConfig signingConfigs.efunboxKey
  184. manifestPlaceholders = [
  185. appCode: "3010",
  186. appIcon: "@drawable/icon",
  187. appName: "课文朗读"
  188. ]
  189. }
  190. //百度学习机
  191. channel_bdxxj {
  192. signingConfig signingConfigs.efunboxKey
  193. manifestPlaceholders = [
  194. appCode: "3011",
  195. appIcon: "@drawable/langduxiaokaciu",
  196. appName: "朗读小咖秀"
  197. ]
  198. }
  199. }
  200. productFlavors.all {
  201. flavor -> flavor.manifestPlaceholders = [UMENG_CHANNEL_VALUE: manifestPlaceholders.appCode, icon: manifestPlaceholders.appIcon, APP_NAME: manifestPlaceholders.appName]
  202. }
  203. compileOptions {
  204. sourceCompatibility JavaVersion.VERSION_1_8
  205. targetCompatibility JavaVersion.VERSION_1_8
  206. }
  207. aaptOptions {
  208. additionalParameters = ["--warn-manifest-validation"]
  209. }
  210. }
  211. dependencies {
  212. implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
  213. implementation 'androidx.appcompat:appcompat:1.0.0'
  214. implementation 'com.github.bumptech.glide:glide:4.12.0'
  215. annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
  216. implementation 'jp.wasabeef:glide-transformations:4.3.0'
  217. implementation('com.zhousf.lib:okhttp3:2.9.9') {
  218. exclude(module: 'support-annotations')
  219. exclude(module: 'gson')
  220. }
  221. //gson
  222. implementation 'com.google.code.gson:gson:2.8.9'
  223. //logger
  224. implementation 'com.orhanobut:logger:2.2.0'
  225. //mmkv
  226. implementation 'com.tencent:mmkv:1.2.11'
  227. implementation 'com.uber.autodispose2:autodispose:2.0.0'
  228. implementation 'com.uber.autodispose2:autodispose-android:2.0.0'
  229. implementation 'com.uber.autodispose2:autodispose-lifecycle:2.0.0'
  230. implementation 'com.uber.autodispose2:autodispose-androidx-lifecycle:2.0.0'
  231. // 友盟基础组件库(所有友盟业务SDK都依赖基础组件库)
  232. implementation 'com.umeng.umsdk:common:9.4.4'// (必选)
  233. implementation 'com.umeng.umsdk:asms:1.4.1'// asms包依赖必选
  234. // required, enough for most devices.
  235. implementation 'tv.danmaku.ijk.media:ijkplayer-java:0.8.8'
  236. // ExoPlayer as IMediaPlayer: optional, experimental
  237. implementation 'tv.danmaku.ijk.media:ijkplayer-exo:0.8.8'
  238. //JZ播放器
  239. implementation 'cn.jzvd:jiaozivideoplayer:7.7.0'
  240. //recyclerview
  241. implementation 'androidx.recyclerview:recyclerview:1.1.0'
  242. //驰声
  243. implementation 'io.github.ChivoxSupport:vox-sdk:2.2.23+2.0.8.1'
  244. //rxBind
  245. implementation 'com.jakewharton.rxbinding4:rxbinding:4.0.0'
  246. implementation 'com.trello.rxlifecycle4:rxlifecycle:4.0.2'
  247. implementation 'com.trello.rxlifecycle4:rxlifecycle-android:4.0.2'
  248. implementation "androidx.constraintlayout:constraintlayout:2.1.1"
  249. // To use constraintlayout in compose
  250. implementation "androidx.constraintlayout:constraintlayout-compose:1.0.0-rc01"
  251. //解除Android P 反射机制
  252. implementation 'com.github.tiann:FreeReflection:3.1.0'
  253. //百度(小度音响SDK)
  254. implementation 'com.baidu.duer.botsdk:bot-sdk-android:1.56.1'
  255. // 3rd Party
  256. implementation "com.alibaba:fastjson:${FASTJSON_VERSION}"
  257. //zxing
  258. implementation 'com.google.zxing:android-core:3.3.0'
  259. implementation 'com.google.zxing:core:3.3.2'
  260. implementation files('libs/gcs-authservice-1.0.0.21.jar')
  261. implementation files('libs/registry-api-1.1.16-20201203.085134-3.jar')
  262. implementation files('libs/aranger.jar')
  263. //小米音响
  264. implementation files('libs/thirdparty-payment-sdk-2.1.1-20200527.030546-1.jar')
  265. //超长图imageview
  266. implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.5.0'
  267. // 1. Use Guava in your implementation only:
  268. implementation("com.google.guava:guava:31.1-jre")
  269. implementation("com.google.guava:guava:31.1-android")
  270. //FloatingViewLib(https://github.com/UFreedom/FloatingView/blob/master/README_CN.md)
  271. implementation 'com.ufreedom.uikit:FloatingViewLib:1.0.2'
  272. //SimpleRatingBar(https://github.com/williamyyu/SimpleRatingBar)
  273. implementation 'com.github.ome450901:SimpleRatingBar:1.4.0'
  274. //华为sdk
  275. implementation 'com.huawei.hms:hwid:6.7.0.300'
  276. implementation 'com.huawei.hms:hmscoreinstaller:6.6.0.300'
  277. implementation 'com.huawei.hms:iap:6.4.0.301'
  278. implementation 'com.huawei.hms:appservice:6.8.0.300'
  279. implementation 'com.huawei.hms:hianalytics:6.9.0.301'
  280. //全局共用一个点击时间
  281. implementation 'cc.taylorzhang:single-click:1.1.0'
  282. }
  283. agcp {
  284. manifest false
  285. }