build.gradle 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. plugins {
  2. id 'com.android.application'
  3. }
  4. def releaseTime() {
  5. return new Date().format("yyyyMMddHHmmss", TimeZone.getTimeZone("UTC"))
  6. }
  7. android {
  8. compileSdkVersion 30
  9. defaultConfig {
  10. applicationId "com.edufound.reader"
  11. minSdkVersion 21 //>23导致无法直接签名
  12. targetSdkVersion 30
  13. versionCode 31
  14. versionName "3.1"
  15. flavorDimensions "versionCode"
  16. manifestPlaceholders = [UMENG_CHANNEL_VALUE: "2006"]//添加一个默认渠道号
  17. ndk {
  18. //只有联想pad需要arm64-v8a,小米音箱、天猫音箱、百度音箱、不需要arm64-v8a
  19. abiFilters "armeabi-v7a", "arm64-v8a", "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. }
  56. output.outputFileName = new File(newoutputFile, fileName)
  57. }
  58. }
  59. }
  60. }
  61. debug {
  62. minifyEnabled false
  63. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  64. signingConfig signingConfigs.efunboxKey
  65. zipAlignEnabled true
  66. }
  67. }
  68. sourceSets {
  69. main {
  70. jniLibs.srcDirs = ['libs']
  71. res.srcDirs = [
  72. 'src/main/res', //默认只有这一个路径
  73. 'src/fragmentRecommend', //首页推荐
  74. 'src/fragmentUser',//首页我的
  75. 'src/activityLoginAlert',//登录弹窗
  76. 'src/exception',//异常弹窗
  77. 'src/testimg'//测试图片
  78. ]
  79. }
  80. }
  81. productFlavors {
  82. //义方
  83. channel_efunbox {
  84. signingConfig signingConfigs.efunboxKey
  85. manifestPlaceholders = [
  86. appCode: "3006",
  87. appIcon: "@drawable/icon",
  88. ]
  89. }
  90. //百度(小度音响)
  91. channel_baidu {
  92. signingConfig signingConfigs.efunboxKey
  93. manifestPlaceholders = [
  94. appCode: "3003",
  95. appIcon: "@drawable/icon",
  96. ]
  97. }
  98. //天猫精灵
  99. channel_tmail {
  100. signingConfig signingConfigs.efunboxKey
  101. manifestPlaceholders = [
  102. appCode: "3002",
  103. appIcon: "@drawable/icon",
  104. ]
  105. }
  106. //小爱音响
  107. channel_xayx {
  108. applicationIdSuffix ".xiaoai"
  109. signingConfig signingConfigs.efunboxKey
  110. manifestPlaceholders = [
  111. appCode: "2016",
  112. appIcon: "@drawable/icon",
  113. ]
  114. }
  115. //联想渠道
  116. channel_lenovo {
  117. signingConfig signingConfigs.efunboxKey
  118. manifestPlaceholders = [
  119. appCode: "3004",
  120. appIcon: "@drawable/icon",
  121. ]
  122. }
  123. }
  124. productFlavors.all {
  125. flavor -> flavor.manifestPlaceholders = [UMENG_CHANNEL_VALUE: manifestPlaceholders.appCode, icon: manifestPlaceholders.appIcon]
  126. }
  127. compileOptions {
  128. sourceCompatibility JavaVersion.VERSION_1_8
  129. targetCompatibility JavaVersion.VERSION_1_8
  130. }
  131. aaptOptions {
  132. additionalParameters = ["--warn-manifest-validation"]
  133. }
  134. }
  135. dependencies {
  136. implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
  137. implementation 'androidx.appcompat:appcompat:1.0.0'
  138. implementation 'com.github.bumptech.glide:glide:4.12.0'
  139. annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
  140. implementation 'jp.wasabeef:glide-transformations:4.3.0'
  141. implementation('com.zhousf.lib:okhttp3:2.9.9') {
  142. exclude(module: 'support-annotations')
  143. exclude(module: 'gson')
  144. }
  145. //gson
  146. implementation 'com.google.code.gson:gson:2.8.9'
  147. //logger
  148. implementation 'com.orhanobut:logger:2.2.0'
  149. //mmkv
  150. implementation 'com.tencent:mmkv:1.2.11'
  151. implementation 'com.uber.autodispose2:autodispose:2.0.0'
  152. implementation 'com.uber.autodispose2:autodispose-android:2.0.0'
  153. implementation 'com.uber.autodispose2:autodispose-lifecycle:2.0.0'
  154. implementation 'com.uber.autodispose2:autodispose-androidx-lifecycle:2.0.0'
  155. // 友盟基础组件库(所有友盟业务SDK都依赖基础组件库)
  156. implementation 'com.umeng.umsdk:common:9.4.4'// (必选)
  157. implementation 'com.umeng.umsdk:asms:1.4.1'// asms包依赖必选
  158. // required, enough for most devices.
  159. implementation 'tv.danmaku.ijk.media:ijkplayer-java:0.8.8'
  160. // ExoPlayer as IMediaPlayer: optional, experimental
  161. implementation 'tv.danmaku.ijk.media:ijkplayer-exo:0.8.8'
  162. //JZ播放器
  163. implementation 'cn.jzvd:jiaozivideoplayer:7.7.0'
  164. //recyclerview
  165. implementation 'androidx.recyclerview:recyclerview:1.1.0'
  166. //驰声
  167. implementation 'io.github.ChivoxSupport:vox-sdk:2.2.23+2.0.8.1'
  168. //rxBind
  169. implementation 'com.jakewharton.rxbinding4:rxbinding:4.0.0'
  170. implementation 'com.trello.rxlifecycle4:rxlifecycle:4.0.2'
  171. implementation 'com.trello.rxlifecycle4:rxlifecycle-android:4.0.2'
  172. implementation "androidx.constraintlayout:constraintlayout:2.1.1"
  173. // To use constraintlayout in compose
  174. implementation "androidx.constraintlayout:constraintlayout-compose:1.0.0-rc01"
  175. //解除Android P 反射机制
  176. implementation 'com.github.tiann:FreeReflection:3.1.0'
  177. //百度(小度音响SDK)
  178. implementation 'com.baidu.duer.botsdk:bot-sdk-android:1.56.1'
  179. // 3rd Party
  180. implementation "com.alibaba:fastjson:${FASTJSON_VERSION}"
  181. //zxing
  182. implementation 'com.google.zxing:android-core:3.3.0'
  183. implementation 'com.google.zxing:core:3.3.2'
  184. implementation files('libs/gcs-authservice-1.0.0.21.jar')
  185. implementation files('libs/registry-api-1.1.16-20201203.085134-3.jar')
  186. implementation files('libs/aranger.jar')
  187. //小米音响
  188. implementation files('libs/thirdparty-payment-sdk-2.1.1-20200527.030546-1.jar')
  189. //超长图imageview
  190. implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.5.0'
  191. // 1. Use Guava in your implementation only:
  192. implementation("com.google.guava:guava:31.1-jre")
  193. implementation("com.google.guava:guava:31.1-android")
  194. //FloatingViewLib(https://github.com/UFreedom/FloatingView/blob/master/README_CN.md)
  195. implementation 'com.ufreedom.uikit:FloatingViewLib:1.0.2'
  196. //SimpleRatingBar(https://github.com/williamyyu/SimpleRatingBar)
  197. implementation 'com.github.ome450901:SimpleRatingBar:1.4.0'
  198. }