build.gradle 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  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 10012
  12. versionName "1.0.0.1.2"
  13. testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  14. multiDexEnabled true
  15. flavorDimensions "versionCode"
  16. manifestPlaceholders = [UMENG_CHANNEL_VALUE: "2006"]//添加一个默认渠道号
  17. ndk {
  18. //选择要添加的对应 cpu 类型的 .so 库。
  19. // abiFilters 'armeabi', 'armeabi-v7a', 'arm64-v8a','x86_64'
  20. // 还可以添加 'x86', , 'mips', 'mips64'
  21. }
  22. }
  23. signingConfigs {
  24. efunbox {
  25. keyAlias "edufound_key"
  26. keyPassword "edufound321"
  27. storeFile file("C:\\Users\\candy\\Desktop\\efunbox\\edufound.keystore")
  28. storePassword "edufound123"
  29. }
  30. debug {
  31. keyAlias "edufound_key"
  32. keyPassword "edufound321"
  33. storeFile file("C:\\Users\\candy\\Desktop\\efunbox\\edufound.keystore")
  34. storePassword "edufound123"
  35. }
  36. }
  37. buildTypes {
  38. release {
  39. minifyEnabled false
  40. proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
  41. signingConfig signingConfigs.efunbox
  42. // zipAlignEnabled true
  43. applicationVariants.all { variant ->
  44. variant.outputs.each { output ->
  45. def outputFile = output.outputFileName
  46. if (outputFile != null && output.outputFileName.endsWith('.apk')) {
  47. def fileName = "efunbox_mobile_xyyf_v${defaultConfig.versionCode}_${releaseTime()}_${variant.productFlavors[0].manifestPlaceholders.UMENG_CHANNEL_VALUE}_r.apk"
  48. def channel = variant.productFlavors[0].manifestPlaceholders.UMENG_CHANNEL_VALUE;
  49. def newoutputFile = "";
  50. if (channel == ("2006")) {
  51. newoutputFile = "\\义方\\"
  52. } else if (channel == ("2001")) {
  53. newoutputFile = "\\应用宝\\"
  54. } else if (channel == ("2002")) {
  55. newoutputFile = "\\360应用市场\\"
  56. } else if (channel == ("2003")) {
  57. newoutputFile = "\\百度手机助手\\"
  58. } else if (channel == ("2008")) {
  59. newoutputFile = "\\小米\\"
  60. } else if (channel == ("2007")) {
  61. newoutputFile = "\\vivo\\"
  62. } else if (channel == ("2004")) {
  63. newoutputFile = "\\oppo\\"
  64. } else if (channel == ("2005")) {
  65. newoutputFile = "\\huawei\\"
  66. } else if (channel == ("2009")) {
  67. newoutputFile = "\\萌庄园\\"
  68. } else if (channel == ("2010")) {
  69. newoutputFile = "\\步步高\\"
  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.efunbox
  80. }
  81. }
  82. repositories {
  83. flatDir {
  84. dirs "libs"
  85. }
  86. mavenCentral()
  87. }
  88. sourceSets {
  89. main {
  90. jniLibs.srcDirs = ["libs"]
  91. }
  92. }
  93. productFlavors {
  94. //义方
  95. channel_efunbox {
  96. signingConfig signingConfigs.efunbox
  97. manifestPlaceholders = [
  98. appCode: "2006",
  99. appIcon: "@drawable/icon",
  100. ]
  101. }
  102. //应用宝
  103. channel_yyb {
  104. signingConfig signingConfigs.efunbox
  105. manifestPlaceholders = [
  106. appCode: "2001",
  107. appIcon: "@drawable/icon",
  108. ]
  109. }
  110. //360应用市场
  111. channel_360 {
  112. signingConfig signingConfigs.efunbox
  113. manifestPlaceholders = [
  114. appCode: "2002",
  115. appIcon: "@drawable/icon",
  116. ]
  117. }
  118. //百度手机助手
  119. channel_bdsjzs {
  120. signingConfig signingConfigs.efunbox
  121. manifestPlaceholders = [
  122. appCode: "2003",
  123. appIcon: "@drawable/icon",
  124. ]
  125. }
  126. //vivo
  127. channel_vivo {
  128. signingConfig signingConfigs.efunbox
  129. manifestPlaceholders = [
  130. appCode: "2007",
  131. appIcon: "@drawable/icon",
  132. ]
  133. }
  134. //小米
  135. channel_xiaomi {
  136. signingConfig signingConfigs.efunbox
  137. manifestPlaceholders = [
  138. appCode: "2008",
  139. appIcon: "@drawable/icon",
  140. ]
  141. }
  142. //OPPO
  143. channel_oppo {
  144. signingConfig signingConfigs.efunbox
  145. manifestPlaceholders = [
  146. appCode: "2004",
  147. appIcon: "@drawable/icon",
  148. ]
  149. }
  150. //华为
  151. channel_huawei {
  152. signingConfig signingConfigs.efunbox
  153. // applicationIdSuffix ".hw"
  154. manifestPlaceholders = [
  155. appCode: "2005",
  156. appIcon: "@drawable/icon",
  157. ]
  158. }
  159. //萌状元
  160. channel_mengzhuangyuan {
  161. signingConfig signingConfigs.efunbox
  162. manifestPlaceholders = [
  163. appCode: "2009",
  164. appIcon: "@drawable/icon",
  165. ]
  166. }
  167. //步步高
  168. channel_bubugao {
  169. signingConfig signingConfigs.efunbox
  170. manifestPlaceholders = [
  171. appCode: "2010",
  172. appIcon: "@drawable/icon",
  173. ]
  174. }
  175. }
  176. productFlavors.all {
  177. flavor -> flavor.manifestPlaceholders = [UMENG_CHANNEL_VALUE: manifestPlaceholders.appCode, icon: manifestPlaceholders.appIcon]
  178. }
  179. }
  180. allprojects {
  181. repositories {
  182. jcenter()
  183. }
  184. }
  185. dependencies {
  186. implementation fileTree(dir: "libs", include: ["*.jar", "*.aar"])
  187. implementation 'com.android.support.constraint:constraint-layout:1.0.2'
  188. implementation "com.android.support:appcompat-v7:28.0.0"
  189. implementation "android.arch.navigation:navigation-fragment:1.0.0"
  190. implementation "android.arch.navigation:navigation-ui:1.0.0"
  191. api files("libs/codec.jar")
  192. api files("libs/commons-codec-1.7.jar")
  193. api files("libs/commons-lang-2.2.jar")
  194. api files("libs/commons-net-3.3.jar")
  195. api files("libs/bcprov-jdk15-136.jar")
  196. api "com.google.code.gson:gson:2.8.6"
  197. implementation 'com.alibaba:fastjson:1.2.73'
  198. //微信登录、微信支付等
  199. implementation "com.tencent.mm.opensdk:wechat-sdk-android-with-mta:+"
  200. //支付宝支付
  201. // implementation files("libs/alipaySdk-20180601.jar")
  202. // implementation files("libs/dom4j-1.6.1.jar")
  203. //okhttp
  204. implementation "com.squareup.okhttp3:okhttp:3.4.1"
  205. //多种seekbar
  206. implementation "com.github.warkiz.widget:indicatorseekbar:2.1.0"
  207. //cardView
  208. implementation 'com.android.support:cardview-v7:28.0.0'
  209. //recyclerview
  210. implementation 'com.android.support:recyclerview-v7:28.0.0'
  211. //wheelview
  212. implementation 'com.cncoderx.wheelview:library:1.2.5'
  213. //阿里一键登录和校验
  214. // implementation(name: 'crashshield-release', ext: 'aar')
  215. // implementation(name: 'phoneNumber-L-AuthSDK-2.11.1.1', ext: 'aar')
  216. // 友盟基础组件库(所有友盟业务SDK都依赖基础组件库)
  217. implementation 'com.umeng.umsdk:common:9.4.4'// (必选)
  218. implementation 'com.umeng.umsdk:asms:1.4.1'// asms包依赖必选
  219. }