build.gradle 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. apply plugin: "com.android.application"
  2. def releaseTime() {
  3. return new Date().format("yyyyMMddHHmmss")
  4. }
  5. android {
  6. compileSdkVersion 28
  7. defaultConfig {
  8. applicationId "com.edufound.android.xyyf"
  9. minSdkVersion 16
  10. targetSdkVersion 28
  11. versionCode 10005
  12. versionName "1.0.0.5"
  13. testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  14. multiDexEnabled true
  15. flavorDimensions "versionCode"
  16. manifestPlaceholders = [UMENG_CHANNEL_VALUE: "2006"]//添加一个默认渠道号
  17. }
  18. signingConfigs {
  19. efunbox {
  20. keyAlias "edufound_key"
  21. keyPassword "edufound321"
  22. storeFile file("C:/Users/Candy/Desktop/edufound.keystore")
  23. storePassword "edufound123"
  24. }
  25. debug {
  26. keyAlias "edufound_key"
  27. keyPassword "edufound321"
  28. storeFile file("C:/Users/Candy/Desktop/edufound.keystore")
  29. storePassword "edufound123"
  30. }
  31. }
  32. buildTypes {
  33. release {
  34. minifyEnabled false
  35. proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
  36. signingConfig signingConfigs.efunbox
  37. // zipAlignEnabled true
  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_mobile_xyyf_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 == ("2001")) {
  48. newoutputFile = "\\应用宝\\"
  49. } else if (channel == ("2002")) {
  50. newoutputFile = "\\360应用市场\\"
  51. } else if (channel == ("2003")) {
  52. newoutputFile = "\\百度手机助手\\"
  53. } else if (channel == ("2008")) {
  54. newoutputFile = "\\小米\\"
  55. } else if (channel == ("2007")) {
  56. newoutputFile = "\\vivo\\"
  57. } else if (channel == ("2004")) {
  58. newoutputFile = "\\oppo\\"
  59. } else if (channel == ("2005")) {
  60. newoutputFile = "\\huawei\\"
  61. } else if (channel == ("2009")) {
  62. newoutputFile = "\\萌庄园\\"
  63. } else if (channel == ("2010")) {
  64. newoutputFile = "\\步步高\\"
  65. }
  66. output.outputFileName = new File(newoutputFile, fileName)
  67. }
  68. }
  69. }
  70. }
  71. debug {
  72. minifyEnabled false
  73. proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
  74. signingConfig signingConfigs.efunbox
  75. }
  76. }
  77. repositories {
  78. flatDir {
  79. dirs "libs"
  80. }
  81. mavenCentral()
  82. }
  83. sourceSets {
  84. main {
  85. jniLibs.srcDirs = ["libs"]
  86. }
  87. }
  88. productFlavors {
  89. //义方
  90. channel_efunbox {
  91. signingConfig signingConfigs.efunbox
  92. manifestPlaceholders = [
  93. appCode: "2006",
  94. appIcon: "@drawable/icon",
  95. ]
  96. }
  97. //应用宝
  98. channel_yyb {
  99. signingConfig signingConfigs.efunbox
  100. manifestPlaceholders = [
  101. appCode: "2001",
  102. appIcon: "@drawable/icon",
  103. ]
  104. }
  105. //360应用市场
  106. channel_360 {
  107. signingConfig signingConfigs.efunbox
  108. manifestPlaceholders = [
  109. appCode: "2002",
  110. appIcon: "@drawable/icon",
  111. ]
  112. }
  113. //百度手机助手
  114. channel_bdsjzs {
  115. signingConfig signingConfigs.efunbox
  116. manifestPlaceholders = [
  117. appCode: "2003",
  118. appIcon: "@drawable/icon",
  119. ]
  120. }
  121. //vivo
  122. channel_vivo {
  123. signingConfig signingConfigs.efunbox
  124. manifestPlaceholders = [
  125. appCode: "2007",
  126. appIcon: "@drawable/icon",
  127. ]
  128. }
  129. //小米
  130. channel_xiaomi {
  131. signingConfig signingConfigs.efunbox
  132. manifestPlaceholders = [
  133. appCode: "2008",
  134. appIcon: "@drawable/icon",
  135. ]
  136. }
  137. //OPPO
  138. channel_oppo {
  139. signingConfig signingConfigs.efunbox
  140. manifestPlaceholders = [
  141. appCode: "2004",
  142. appIcon: "@drawable/icon",
  143. ]
  144. }
  145. //华为
  146. channel_huawei {
  147. signingConfig signingConfigs.efunbox
  148. // applicationIdSuffix ".hw"
  149. manifestPlaceholders = [
  150. appCode: "2005",
  151. appIcon: "@drawable/icon",
  152. ]
  153. }
  154. //萌状元
  155. channel_mengzhuangyuan {
  156. signingConfig signingConfigs.efunbox
  157. manifestPlaceholders = [
  158. appCode: "2009",
  159. appIcon: "@drawable/icon",
  160. ]
  161. }
  162. //步步高
  163. channel_bubugao {
  164. signingConfig signingConfigs.efunbox
  165. manifestPlaceholders = [
  166. appCode: "2010",
  167. appIcon: "@drawable/icon",
  168. ]
  169. }
  170. }
  171. productFlavors.all {
  172. flavor -> flavor.manifestPlaceholders = [UMENG_CHANNEL_VALUE: manifestPlaceholders.appCode, icon: manifestPlaceholders.appIcon]
  173. }
  174. }
  175. allprojects {
  176. repositories {
  177. jcenter()
  178. }
  179. }
  180. dependencies {
  181. implementation fileTree(dir: "libs", include: ["*.jar","*.aar"])
  182. implementation 'com.android.support.constraint:constraint-layout:1.0.2'
  183. implementation "com.android.support:appcompat-v7:28.0.0"
  184. implementation "android.arch.navigation:navigation-fragment:1.0.0"
  185. implementation "android.arch.navigation:navigation-ui:1.0.0"
  186. api files("libs/codec.jar")
  187. api files("libs/commons-codec-1.7.jar")
  188. api files("libs/commons-lang-2.2.jar")
  189. api files("libs/commons-net-3.3.jar")
  190. api files("libs/bcprov-jdk15-136.jar")
  191. api "com.google.code.gson:gson:2.8.6"
  192. implementation 'com.alibaba:fastjson:1.2.73'
  193. //微信登录、微信支付等
  194. implementation "com.tencent.mm.opensdk:wechat-sdk-android-with-mta:+"
  195. //支付宝支付
  196. // implementation files("libs/alipaySdk-20180601.jar")
  197. // implementation files("libs/dom4j-1.6.1.jar")
  198. //okhttp
  199. implementation "com.squareup.okhttp3:okhttp:3.4.1"
  200. //多种seekbar
  201. implementation "com.github.warkiz.widget:indicatorseekbar:2.1.0"
  202. // //PushSDK必须依赖基础组件库,所以需要加入对应依赖
  203. // implementation "com.umeng.umsdk:common:2.1.0"
  204. // //PushSDK
  205. // implementation "com.umeng.umsdk:push:6.0.1"
  206. api project(":push")
  207. //小米Push通道
  208. implementation "com.umeng.umsdk:xiaomi-push:3.6.17"
  209. implementation "com.umeng.umsdk:xiaomi-umengaccs:1.1.0"
  210. //华为Push通道
  211. implementation "com.umeng.umsdk:huawei-basetb:2.6.3.305"
  212. implementation "com.umeng.umsdk:huawei-pushtb:2.6.3.305"
  213. implementation "com.umeng.umsdk:huawei-umengaccs:1.2.1"
  214. //魅族Push通道
  215. implementation "com.umeng.umsdk:meizu-push:3.8.1"
  216. implementation "com.umeng.umsdk:meizu-umengaccs:1.0.6"
  217. //vivo Push通道
  218. implementation "com.umeng.umsdk:vivo-push:2.3.1"
  219. implementation "com.umeng.umsdk:vivo-umengaccs:1.0.4"
  220. //Oppo Push通道
  221. implementation "com.umeng.umsdk:oppo-push:1.0.1"
  222. implementation "com.umeng.umsdk:oppo-umengaccs:1.0.3"
  223. //cardView
  224. implementation 'com.android.support:cardview-v7:28.0.0'
  225. //recyclerview
  226. implementation 'com.android.support:recyclerview-v7:28.0.0'
  227. //wheelview
  228. implementation 'com.cncoderx.wheelview:library:1.2.5'
  229. //阿里一键登录和校验
  230. // implementation(name: 'crashshield-release', ext: 'aar')
  231. // implementation(name: 'phoneNumber-L-AuthSDK-2.11.1.1', ext: 'aar')
  232. }