基础组件库
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 

325 linhas
9.2 KiB

  1. // 添加插件
  2. def localProperties = new Properties()
  3. def localPropertiesFile = rootProject.file('local.properties')
  4. if (localPropertiesFile.exists()) {
  5. localPropertiesFile.withReader('UTF-8') { reader ->
  6. localProperties.load(reader)
  7. }
  8. }
  9. def flutterRoot = localProperties.getProperty('flutter.sdk')
  10. if (flutterRoot == null) {
  11. throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
  12. }
  13. def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
  14. if (flutterVersionCode == null) {
  15. flutterVersionCode = '1'
  16. }
  17. def flutterVersionName = localProperties.getProperty('flutter.versionName')
  18. if (flutterVersionName == null) {
  19. flutterVersionName = '1.0'
  20. }
  21. // 获取当前时间(年月日)
  22. def releaseTime() {
  23. return new Date().format("YYYYMMdd", TimeZone.getTimeZone("UTC"))
  24. }
  25. apply plugin: 'com.android.application'
  26. apply plugin: 'com.mob.sdk'
  27. apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
  28. android {
  29. compileSdkVersion 28
  30. lintOptions {
  31. disable 'InvalidPackage'
  32. }
  33. // 默认配置
  34. defaultConfig {
  35. applicationId "cn.zhios.zhiying"
  36. minSdkVersion 21
  37. targetSdkVersion 28
  38. versionCode 1
  39. versionName "1.0"
  40. aaptOptions.cruncherEnabled = false
  41. aaptOptions.useNewCruncher = false
  42. multiDexEnabled true
  43. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  44. ndk {
  45. //选择要添加的对应cpu类型的.so库。
  46. abiFilters 'armeabi', 'armeabi-v7a', 'x86', 'x86_64', 'mips', 'mips64', 'arm64-v8a'
  47. }
  48. }
  49. // 签名配置
  50. signingConfigs {
  51. // 智夜生活
  52. zhiying {
  53. storeFile file('zhiying.jks')
  54. storePassword 'zhioscom'
  55. keyAlias 'zysh'
  56. keyPassword 'zhioscom'
  57. v1SigningEnabled true
  58. v2SigningEnabled true
  59. }
  60. }
  61. flavorDimensions "app"
  62. buildTypes {
  63. debug {
  64. buildConfigField "boolean", "LOG_DEBUG", "true"
  65. minifyEnabled false
  66. zipAlignEnabled true
  67. shrinkResources false
  68. signingConfig signingConfigs.zhiying
  69. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  70. }
  71. release {
  72. buildConfigField "boolean", "LOG_DEBUG", "false"
  73. minifyEnabled false
  74. shrinkResources false
  75. zipAlignEnabled true
  76. signingConfig signingConfigs.zhiying
  77. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  78. }
  79. }
  80. dexOptions {
  81. //最大堆内存
  82. javaMaxHeapSize "4g"//4g
  83. //使用增量模式构建
  84. incremental true
  85. //是否支持大工程模式
  86. jumboMode = true
  87. //预编译
  88. preDexLibraries = false
  89. //线程数
  90. threadCount = 8
  91. }
  92. // // 签名配置
  93. // signingConfigs {
  94. // // 智夜生活
  95. // zhiying {
  96. // storeFile file('zhiying.jks')
  97. // storePassword 'zhioscom'
  98. // keyAlias 'zysh'
  99. // keyPassword 'zhioscom'
  100. // v1SigningEnabled true
  101. // v2SigningEnabled true
  102. // }
  103. //
  104. // }
  105. //
  106. // flavorDimensions "app"
  107. //
  108. //
  109. // // 应用信息配置
  110. // productFlavors {
  111. // // 智夜生活
  112. // zhiying {
  113. // applicationId "cn.zhios.zhiying"
  114. // versionCode 3
  115. // dimension "app"
  116. // versionName '1.0.3'
  117. // // 签名信息
  118. // signingConfig signingConfigs.zhiying
  119. // }
  120. // }
  121. //
  122. // // 打包脚本
  123. // android.applicationVariants.all { variant ->
  124. // if (variant.buildType.name != "debug") {
  125. // variant.getPackageApplicationProvider().get().outputDirectory = new File(project.rootDir.absolutePath + "/app/build/outputs/apk")
  126. // }
  127. //
  128. // variant.outputs.all { output ->
  129. // def outputFile = output.outputFile
  130. // if (outputFile != null && outputFile.name.endsWith('.apk')) {
  131. // //这里修改apk文件名
  132. // def fileName = "${variant.productFlavors[0].name}_${releaseTime()}01_&V${variant.productFlavors[0].versionCode}.apk"
  133. // outputFileName = fileName
  134. // }
  135. // }
  136. // }
  137. configurations.all {
  138. resolutionStrategy.eachDependency { DependencyResolveDetails details ->
  139. def requested = details.requested
  140. if (requested.group == 'com.android.support') {
  141. if (!requested.name.startsWith("multidex")) {
  142. details.useVersion '28.0.3'
  143. }
  144. }
  145. resolutionStrategy.force 'com.android.support:support-v4:28.0.0'
  146. }
  147. }
  148. }
  149. flutter {
  150. source '../..'
  151. }
  152. dependencies {
  153. implementation 'androidx.appcompat:appcompat:1.2.0'
  154. implementation 'androidx.constraintlayout:constraintlayout:2.0.2'
  155. testImplementation 'junit:junit:4.12'
  156. androidTestImplementation 'androidx.test:runner:1.1.1'
  157. androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
  158. //登陆
  159. implementation 'com.ali.auth.sdk:alibabauth_core:2.0.0.11@aar'
  160. implementation 'com.ali.auth.sdk:alibabauth_ui:2.0.0.11@aar'
  161. implementation 'com.ali.auth.sdk:alibabauth_ext:2.0.0.11@aar'
  162. //安全组件
  163. implementation 'com.taobao.android:securityguardaar3:5.4.171@aar'
  164. implementation 'com.taobao.android:securitybodyaar3:5.4.99@aar'
  165. implementation 'com.taobao.android:avmpaar3:5.4.36@aar'
  166. implementation 'com.taobao.android:sgmiddletieraar3:5.4.9@aar'
  167. //Mtop
  168. implementation 'com.taobao.android:mtopsdk_allinone_open:3.1.2.5@jar'
  169. //applink
  170. implementation 'com.alibaba.sdk.android:alibc_link_partner:4.1.15@aar'
  171. //ut
  172. implementation 'com.taobao.android:utdid4all:1.5.2'
  173. implementation 'com.alibaba.mtl:app-monitor-sdk:2.6.4.5_for_bc'
  174. // 电商基础组件
  175. implementation 'com.alibaba.sdk.android:AlibcTradeCommon:4.0.0.16@aar'
  176. implementation 'com.alibaba.sdk.android:AlibcTradeBiz:4.0.0.16@aar'
  177. implementation 'com.alibaba.sdk.android:nb_trade:4.0.0.16@aar'
  178. implementation 'com.alibaba:fastjson:1.2.41@jar'
  179. }
  180. MobSDK {
  181. appKey "30dc33054b635"
  182. appSecret "396e98c293130c9976fb7428b6b434d6"
  183. //手机验证登录
  184. SecVerify {}
  185. //短信
  186. SMSSDK {}
  187. ShareSDK {
  188. // platform configuration information
  189. devInfo {
  190. QQ {
  191. appId "1111030588"
  192. appKey "XoHKlrBybXy7ORBt"
  193. shareByAppClient true
  194. bypassApproval false
  195. enable true
  196. }
  197. WechatMoments {
  198. enable true
  199. }
  200. WechatFavorite {
  201. enable true
  202. }
  203. QZone {
  204. enable true
  205. }
  206. SinaWeibo {
  207. enable true
  208. }
  209. }
  210. }
  211. }
  212. // 注册SecVerify的相关信息
  213. //MobSDK {
  214. //// appKey "2ed488d929488"
  215. //// appSecret "53d4a16298d283828f2444cdd6d6548a"
  216. // //手机验证登录
  217. // SecVerify {}
  218. //
  219. // //短信
  220. // SMSSDK {}
  221. //
  222. // //调用MobPush,推送
  223. //// MobPush {
  224. //// //设置角标开关(不需要可不设置)
  225. ////// badge true
  226. //// //集成其他推送通道(可选)
  227. //// devInfo {
  228. //// //华为推送配置信息
  229. //// HUAWEI {
  230. //// appId "${HUAWEI_PUSH_ID}"
  231. //// }
  232. //// //魅族推送配置信息
  233. //// MEIZU {
  234. //// appId "${MEIZHU_PUSH_APPID}"
  235. //// appKey "${MEIZHU_PUSH_APPKEY}"
  236. //// }
  237. //// //小米推送配置信息
  238. //// XIAOMI {
  239. //// appId "${XIAOMI_PUSH_APPID}"
  240. //// appKey "${XIAOMI_PUSH_APPKEY}"
  241. //// }
  242. //// //FCM推送通道配置
  243. ////// FCM {
  244. //// //设置默认推送通知显示图标
  245. ////// iconRes "@mipmap/ic_launcher"
  246. ////// }
  247. //// //OPPO推送配置信息
  248. //// OPPO {
  249. //// appKey "${OPPO_PUSH_APPKEY}"
  250. //// appSecret "${OPPO_PUSH_APPSECRET}"
  251. //// }
  252. //// //VIVO推送配置信息
  253. //// VIVO {
  254. //// appId "${VIVO_PUSH_APPID}"
  255. //// appKey "${VIVO_PUSH_APPKEY}"
  256. //// }
  257. //// }
  258. //// }
  259. //
  260. // //分享
  261. // ShareSDK {
  262. // loopShare true
  263. // devInfo {
  264. // SinaWeibo {
  265. // enable true
  266. // }
  267. // Wechat {
  268. //// appId "${Wechat_appid}"
  269. //// appSecret "${Wechat_appSecret}"
  270. // enable true
  271. // withShareTicket true
  272. // bypassApproval false
  273. // }
  274. // QQ {
  275. // enable true
  276. // }
  277. // WechatMoments {
  278. // enable true
  279. // }
  280. // WechatFavorite {
  281. // enable true
  282. // }
  283. // QZone {
  284. // enable true
  285. // }
  286. // }
  287. // }
  288. //
  289. // //网页打开app,接受邀请码
  290. // MobLink {
  291. //// uriScheme "${uri_Scheme}"
  292. //// appLinkHost "${app_LinkHost}"
  293. // }
  294. //}