基础组件库
Você não pode selecionar mais de 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.
 
 
 
 
 

330 linhas
9.3 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. MobLink {
  184. uriScheme "fnoos://cn.zhios.zhiying"
  185. appLinkHost "bied.t4m.cn"
  186. }
  187. //手机验证登录
  188. SecVerify {}
  189. //短信
  190. SMSSDK {}
  191. ShareSDK {
  192. // platform configuration information
  193. devInfo {
  194. QQ {
  195. appId "1111030588"
  196. appKey "XoHKlrBybXy7ORBt"
  197. shareByAppClient true
  198. bypassApproval false
  199. enable true
  200. }
  201. WechatMoments {
  202. enable true
  203. }
  204. WechatFavorite {
  205. enable true
  206. }
  207. QZone {
  208. enable true
  209. }
  210. SinaWeibo {
  211. enable true
  212. }
  213. }
  214. }
  215. }
  216. // 注册SecVerify的相关信息
  217. //MobSDK {
  218. //// appKey "2ed488d929488"
  219. //// appSecret "53d4a16298d283828f2444cdd6d6548a"
  220. // //手机验证登录
  221. // SecVerify {}
  222. //
  223. // //短信
  224. // SMSSDK {}
  225. //
  226. // //调用MobPush,推送
  227. //// MobPush {
  228. //// //设置角标开关(不需要可不设置)
  229. ////// badge true
  230. //// //集成其他推送通道(可选)
  231. //// devInfo {
  232. //// //华为推送配置信息
  233. //// HUAWEI {
  234. //// appId "${HUAWEI_PUSH_ID}"
  235. //// }
  236. //// //魅族推送配置信息
  237. //// MEIZU {
  238. //// appId "${MEIZHU_PUSH_APPID}"
  239. //// appKey "${MEIZHU_PUSH_APPKEY}"
  240. //// }
  241. //// //小米推送配置信息
  242. //// XIAOMI {
  243. //// appId "${XIAOMI_PUSH_APPID}"
  244. //// appKey "${XIAOMI_PUSH_APPKEY}"
  245. //// }
  246. //// //FCM推送通道配置
  247. ////// FCM {
  248. //// //设置默认推送通知显示图标
  249. ////// iconRes "@mipmap/ic_launcher"
  250. ////// }
  251. //// //OPPO推送配置信息
  252. //// OPPO {
  253. //// appKey "${OPPO_PUSH_APPKEY}"
  254. //// appSecret "${OPPO_PUSH_APPSECRET}"
  255. //// }
  256. //// //VIVO推送配置信息
  257. //// VIVO {
  258. //// appId "${VIVO_PUSH_APPID}"
  259. //// appKey "${VIVO_PUSH_APPKEY}"
  260. //// }
  261. //// }
  262. //// }
  263. //
  264. // //分享
  265. // ShareSDK {
  266. // loopShare true
  267. // devInfo {
  268. // SinaWeibo {
  269. // enable true
  270. // }
  271. // Wechat {
  272. //// appId "${Wechat_appid}"
  273. //// appSecret "${Wechat_appSecret}"
  274. // enable true
  275. // withShareTicket true
  276. // bypassApproval false
  277. // }
  278. // QQ {
  279. // enable true
  280. // }
  281. // WechatMoments {
  282. // enable true
  283. // }
  284. // WechatFavorite {
  285. // enable true
  286. // }
  287. // QZone {
  288. // enable true
  289. // }
  290. // }
  291. // }
  292. //
  293. // //网页打开app,接受邀请码
  294. // MobLink {
  295. //// uriScheme "${uri_Scheme}"
  296. //// appLinkHost "${app_LinkHost}"
  297. // }
  298. //}