You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. apply plugin : 'com.android.application'
  2. apply plugin : 'android-aspectjx'
  3. apply from : '../common.gradle'
  4. // Android 代码规范文档:https://github.com/getActivity/AndroidCodeStandard
  5. android {
  6. // 资源目录存放指引:https://developer.android.google.cn/guide/topics/resources/providing-resources
  7. defaultConfig {
  8. // 无痛修改包名:https://www.jianshu.com/p/17327e191d2e
  9. applicationId 'com.huntersun.vkyes.etcopencard'
  10. // 仅保留中文语种的资源
  11. resConfigs 'zh'
  12. // 仅保留 xxhdpi 图片资源(目前主流分辨率 1920 * 1080)
  13. resConfigs 'xxhdpi'
  14. // 混淆配置
  15. proguardFiles 'proguard-sdk.pro', 'proguard-app.pro'
  16. // 日志打印开关
  17. buildConfigField('boolean', 'LOG_ENABLE', '' + LOG_ENABLE + '')
  18. // 测试包下的 BuglyId
  19. buildConfigField('String', 'BUGLY_ID', '"' + BUGLY_ID + '"')
  20. // 测试服务器的主机地址
  21. buildConfigField('String', 'HOST_URL', '"' + HOST_URL + '"')
  22. }
  23. signingConfigs {
  24. release {
  25. storeFile file('C:/android/Android_xm_0.1/sjc/key0.jks')
  26. storePassword '123456'
  27. keyAlias 'key0'
  28. keyPassword '123456'
  29. }
  30. }
  31. // 构建配置:https://developer.android.google.cn/studio/build/build-variants
  32. buildTypes {
  33. debug {
  34. // 给包名添加后缀
  35. applicationIdSuffix ''
  36. // 调试模式开关
  37. debuggable true
  38. jniDebuggable true
  39. // 压缩对齐开关
  40. zipAlignEnabled false
  41. // 移除无用的资源
  42. shrinkResources false
  43. // 代码混淆开关
  44. minifyEnabled false
  45. // 签名信息配置
  46. // 添加清单占位符
  47. addManifestPlaceholders([
  48. 'app_name' : '九州ETC业务员'
  49. // 'app_name' : '亿速行'
  50. ])
  51. // 调试模式下只保留一种架构的 so 库,提升打包速度
  52. ndk {
  53. abiFilters 'armeabi-v7a'
  54. }
  55. }
  56. preview.initWith(debug)
  57. preview {
  58. applicationIdSuffix ''
  59. // 添加清单占位符
  60. addManifestPlaceholders([
  61. 'app_name' : '九州ETC业务员'
  62. ])
  63. }
  64. release {
  65. // 给包名添加后缀
  66. applicationIdSuffix ''
  67. // 调试模式开关
  68. debuggable false
  69. jniDebuggable true
  70. // 压缩对齐开关
  71. zipAlignEnabled false
  72. // 移除无用的资源
  73. shrinkResources false
  74. // 代码混淆开关
  75. minifyEnabled false
  76. // 添加清单占位符
  77. addManifestPlaceholders([
  78. 'app_name' : '@string/app_name'
  79. ])
  80. // 仅保留两种架构的 so 库,根据 Bugly 统计得出
  81. ndk {
  82. // armeabi:万金油架构平台(占用率:0%)
  83. // armeabi-v7a:曾经主流的架构平台(占用率:10%)
  84. // arm64-v8a:目前主流架构平台(占用率:95%)
  85. abiFilters 'armeabi-v7a', 'arm64-v8a'
  86. }
  87. signingConfig signingConfigs.release
  88. }
  89. }
  90. // lintOptions {
  91. // checkReleaseBuilds false
  92. // abortOnError false
  93. // }
  94. packagingOptions {
  95. // 剔除这个包下的所有文件(不会移除签名信息)
  96. exclude 'META-INF/*******'
  97. }
  98. // AOP 配置(exclude 和 include 二选一)
  99. // 需要进行配置,否则就会引发冲突,具体表现为:
  100. // 第一种:编译不过去,报错:java.util.zip.ZipException:Cause: zip file is empty
  101. // 第二种:编译能过去,但运行时报错:ClassNotFoundException: Didn't find class on path: DexPathList
  102. aspectjx {
  103. // 排除一些第三方库的包名(Gson、 LeakCanary 和 AOP 有冲突)
  104. // exclude 'androidx', 'com.google', 'com.squareup', 'org.apache', 'com.alipay', 'com.taobao', 'versions.9'
  105. // 只对以下包名做 AOP 处理
  106. include android.defaultConfig.applicationId
  107. }
  108. applicationVariants.all { variant ->
  109. // apk 输出文件名配置
  110. variant.outputs.all { output ->
  111. outputFileName = rootProject.getName() + '_v' + variant.versionName + '_' + variant.buildType.name
  112. if (variant.buildType.name == buildTypes.release.getName()) {
  113. outputFileName += '_' + new Date().format('MMdd')
  114. }
  115. outputFileName += '.apk'
  116. }
  117. }
  118. buildFeatures {
  119. viewBinding = true
  120. }
  121. repositories {
  122. flatDir {
  123. dirs 'libs'
  124. }
  125. }
  126. }
  127. // 添加构建依赖项:https://developer.android.google.cn/studio/build/dependencies
  128. // api 与 implementation 的区别:https://www.jianshu.com/p/8962d6ba936e
  129. dependencies {
  130. // 基类封装
  131. implementation project(':library:base')
  132. // 控件封装
  133. implementation project(':library:widget')
  134. // 友盟封装
  135. implementation project(':library:umeng')
  136. // OBU封装
  137. implementation project(':library:obublelib')
  138. //车牌键盘
  139. implementation project(':library:keyboard')
  140. // 权限请求框架:https://github.com/getActivity/XXPermissions
  141. implementation 'com.github.getActivity:XXPermissions:12.3'
  142. // 标题栏框架:https://github.com/getActivity/TitleBar
  143. implementation 'com.github.getActivity:TitleBar:9.2'
  144. // 吐司框架:https://github.com/getActivity/ToastUtils
  145. implementation 'com.github.getActivity:ToastUtils:9.5'
  146. // 网络请求框架:https://github.com/getActivity/EasyHttp
  147. implementation 'com.github.getActivity:EasyHttp:10.2'
  148. // OkHttp 框架:https://github.com/square/okhttp
  149. // noinspection GradleDependency
  150. implementation 'com.squareup.okhttp3:okhttp:3.12.13'
  151. // Json 解析框架:https://github.com/google/gson
  152. implementation 'com.google.code.gson:gson:2.8.8'
  153. // Gson 解析容错:https://github.com/getActivity/GsonFactory
  154. implementation 'com.github.getActivity:GsonFactory:5.2'
  155. // Shape 框架:https://github.com/getActivity/ShapeView
  156. implementation 'com.github.getActivity:ShapeView:6.0'
  157. // AOP 插件库:https://mvnrepository.com/artifact/org.aspectj/aspectjrt
  158. implementation 'org.aspectj:aspectjrt:1.9.7'
  159. // 图片加载框架:https://github.com/bumptech/glide
  160. // 官方使用文档:https://github.com/Muyangmin/glide-docs-cn
  161. implementation 'com.github.bumptech.glide:glide:4.12.0'
  162. implementation 'androidx.appcompat:appcompat:1.3.1'
  163. implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
  164. androidTestImplementation 'junit:junit:4.12'
  165. annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
  166. // 沉浸式框架:https://github.com/gyf-dev/ImmersionBar
  167. implementation 'com.gyf.immersionbar:immersionbar:3.0.0'
  168. // 手势 ImageView:https://github.com/Baseflow/PhotoView
  169. implementation 'com.github.Baseflow:PhotoView:2.3.0'
  170. // Bugly 异常捕捉:https://bugly.qq.com/docs/user-guide/instruction-manual-android/?v=20190418140644
  171. implementation 'com.tencent.bugly:crashreport:3.4.4'
  172. implementation 'com.tencent.bugly:nativecrashreport:3.9.2'
  173. // 动画解析库:https://github.com/airbnb/lottie-android
  174. // 动画资源:https://lottiefiles.com、https://icons8.com/animated-icons
  175. implementation 'com.airbnb.android:lottie:4.1.0'
  176. // 上拉刷新下拉加载框架:https://github.com/scwang90/SmartRefreshLayout
  177. implementation 'com.scwang.smart:refresh-layout-kernel:2.0.3'
  178. implementation 'com.scwang.smart:refresh-header-material:2.0.3'
  179. // 日志打印框架:https://github.com/JakeWharton/timber
  180. implementation 'com.jakewharton.timber:timber:4.7.1'
  181. // 指示器框架:https://github.com/ongakuer/CircleIndicator
  182. implementation 'me.relex:circleindicator:2.1.6'
  183. // 腾讯 MMKV:https://github.com/Tencent/MMKV
  184. implementation 'com.tencent:mmkv-static:1.2.10'
  185. // 内存泄漏监测框架:https://github.com/square/leakcanary
  186. // debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.7'
  187. // previewImplementation 'com.squareup.leakcanary:leakcanary-android:2.7'
  188. //RecyclerView最好的适配器,让你的适配器一目了然,告别代码冗余
  189. implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.50'
  190. //标准类型转换器(用于Retrofit的上传问题)
  191. implementation 'com.squareup.retrofit2:converter-scalars:2.8.1'
  192. //FastJson解析
  193. implementation 'org.ligboy.retrofit2:converter-fastjson-android:2.2.0'
  194. //Retrofit(网络请求框架)
  195. implementation 'com.squareup.retrofit2:retrofit:2.8.1'
  196. implementation 'com.squareup.retrofit2:converter-gson:2.8.1'
  197. //retrofit添加RxJava支持
  198. //retrofit rxjava
  199. implementation 'io.reactivex:rxjava:1.3.8'
  200. implementation 'com.squareup.retrofit2:adapter-rxjava:2.8.1'
  201. implementation 'io.reactivex:rxandroid:1.2.1'
  202. //缓存
  203. implementation 'com.squareup.okhttp3:logging-interceptor:4.5.0'
  204. implementation 'com.squareup.okhttp3:okhttp:4.5.0'
  205. //rxjava
  206. implementation 'io.reactivex.rxjava2:rxjava:2.1.9'
  207. implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
  208. //二维码生成 https://blog.csdn.net/xch_yang/article/details/82147461
  209. implementation 'com.google.zxing:core:3.3.3'
  210. //事件总线 https://github.com/JeremyLiao/LiveEventBus
  211. implementation 'io.github.jeremyliao:live-event-bus-x:1.8.0'
  212. //https://blog.csdn.net/developer_min/article/details/108998795
  213. implementation 'androidx.multidex:multidex:2.0.1'
  214. // 工具类:https://github.com/Blankj/AndroidUtilCode
  215. implementation 'com.blankj:utilcodex:1.31.0'
  216. //https://github.com/Curzibn/Luban
  217. implementation 'top.zibin:Luban:1.1.8'
  218. //https://github.com/RuffianZhong/RWidgetHelper
  219. implementation 'com.github.RuffianZhong:RWidgetHelper:androidx.v0.0.13'
  220. //身份证虚影校验 OpenCV 库进行图像处理
  221. // implementation 'org.opencv:opencv-android:4.5.4'
  222. // //注释掉原有bugly的仓库
  223. // //compile 'com.tencent.bugly:crashreport:latest.release'//其中latest.release指代最新版本号,也可以指定明确的版本号,例如2.3.2
  224. // implementation 'com.tencent.bugly:crashreport_upgrade:1.2.0'//其中latest.release指代最新版本号,也可以指定明确的版本号,例如1.2.0
  225. // implementation 'com.tencent.bugly:nativecrashreport:1.2.0' //其中latest.release指代最新版本号,也可以指定明确的版本号,例如2.2.0
  226. // 二维码:https://github.com/bingoogolapple/BGAQRCode-Android
  227. // 多语种:https://github.com/getActivity/MultiLanguages
  228. // 悬浮窗:https://github.com/getActivity/XToast
  229. // 日志输出:https://github.com/getActivity/Logcat
  230. // 跑马灯:https://github.com/sunfusheng/MarqueeView
  231. // 对象注解:https://www.jianshu.com/p/f1f888e4a35f
  232. // 对象存储:https://github.com/leavesC/DoKV
  233. // 多渠道打包:https://github.com/Meituan-Dianping/walle
  234. // 设备唯一标识:http://msa-alliance.cn/col.jsp?id=120
  235. // 嵌套滚动容器:https://github.com/donkingliang/ConsecutiveScroller
  236. // 隐私调用监控:https://github.com/huage2580/PermissionMonitor
  237. }