build.gradle 7.6 KB

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