Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

build.gradle 13KB

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