Blame view

app/build.gradle 2.61 KB
0fd093a2   李进   初始提交:手持车牌核销应用
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
  plugins {
      id 'com.android.application'
  }
  
  android {
      namespace 'com.ectrip.checkincar'
      compileSdk 34
  
      defaultConfig {
          applicationId "com.ectrip.checkincar"
          minSdk 23
          targetSdk 34
          versionCode 1
          versionName "1.0.0"
  
          ndk {
              abiFilters 'arm64-v8a', 'armeabi-v7a'
          }
      }
  
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
          }
          debug {
              jniDebuggable true
          }
      }
  
      compileOptions {
          sourceCompatibility JavaVersion.VERSION_1_8
          targetCompatibility JavaVersion.VERSION_1_8
      }
  
      buildFeatures {
          viewBinding true
      }
  
      packaging {
          jniLibs {
              // 百度 SDK 的 .so 预编译且含有效 hash 段,禁止 Gradle strip 破坏 ELF 结构
              doNotStrip '**/*.so'
              // 使用传统打包方式,保证 .so 原样存入 APK 不被修改
              useLegacyPackaging = true
          }
          resources {
              excludes += [
                      'META-INF/DEPENDENCIES',
                      'META-INF/LICENSE',
                      'META-INF/LICENSE.txt',
                      'META-INF/license.txt',
                      'META-INF/NOTICE',
                      'META-INF/NOTICE.txt',
                      'META-INF/notice.txt',
                      'META-INF/*.kotlin_module'
              ]
          }
      }
  }
  
  // APK 输出文件名前缀改为 checkincar
  android.applicationVariants.all { variant ->
      variant.outputs.all { output ->
          String oldName = output.outputFileName
          if (oldName != null && oldName.startsWith("app-")) {
              output.outputFileName = "checkincar" + oldName.substring(3)
          }
      }
  }
  
  dependencies {
      // 百度车牌离线 SDK V7.5(jar + assets 模型 + jniLibs/*.so)
      implementation files('libs/libocrgveplate.jar')
      implementation files('libs/bd_unifylicense.jar')
      implementation files('libs/liantian.jar')
  
      implementation 'androidx.appcompat:appcompat:1.6.1'
      implementation 'com.google.android.material:material:1.11.0'
      implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
  
      // CameraX
      def camerax_version = "1.3.4"
      implementation "androidx.camera:camera-core:${camerax_version}"
      implementation "androidx.camera:camera-camera2:${camerax_version}"
      implementation "androidx.camera:camera-lifecycle:${camerax_version}"
      implementation "androidx.camera:camera-view:${camerax_version}"
  
      // 网络
      implementation 'com.squareup.okhttp3:okhttp:4.12.0'
  }