build.gradle 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. apply plugin: 'com.android.application'
  2. apply plugin: 'com.huawei.agconnect'
  3. repositories {
  4. mavenCentral()
  5. google()
  6. maven { url 'https://developer.huawei.com/repo/' }
  7. }
  8. configurations {
  9. compile.exclude module: 'support-v4'
  10. }
  11. configurations.all {
  12. exclude group: 'com.google.firebase', module: 'firebase-core'
  13. exclude group: 'androidx.recyclerview', module: 'recyclerview'
  14. }
  15. dependencies {
  16. implementation project(':TMessagesProj')
  17. implementation 'androidx.multidex:multidex:2.0.1'
  18. coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
  19. implementation files('../TMessagesProj/libs/libgsaverification-client.aar')
  20. implementation 'com.google.firebase:firebase-messaging:22.0.0'
  21. implementation 'com.huawei.hms:push:6.5.0.300'
  22. implementation 'com.huawei.hms:maps:6.6.0.300'
  23. implementation 'com.huawei.hms:location:6.4.0.300'
  24. }
  25. android {
  26. compileSdkVersion 31
  27. buildToolsVersion '31.0.0'
  28. defaultConfig.applicationId = APP_PACKAGE
  29. sourceSets.main.jniLibs.srcDirs = ['../TMessagesProj/jni/']
  30. lintOptions {
  31. disable 'MissingTranslation'
  32. disable 'ExtraTranslation'
  33. disable 'BlockedPrivateApi'
  34. }
  35. dexOptions {
  36. preDexLibraries = true
  37. jumboMode = true
  38. }
  39. dataBinding {
  40. enabled = true
  41. }
  42. compileOptions {
  43. sourceCompatibility JavaVersion.VERSION_1_8
  44. targetCompatibility JavaVersion.VERSION_1_8
  45. coreLibraryDesugaringEnabled true
  46. }
  47. // signingConfigs {
  48. // debug {
  49. // storeFile file("../TMessagesProj/config/release.keystore")
  50. // storePassword RELEASE_STORE_PASSWORD
  51. // keyAlias RELEASE_KEY_ALIAS
  52. // keyPassword RELEASE_KEY_PASSWORD
  53. // }
  54. //
  55. // release {
  56. // storeFile file("../TMessagesProj/config/release.keystore")
  57. // storePassword RELEASE_STORE_PASSWORD
  58. // keyAlias RELEASE_KEY_ALIAS
  59. // keyPassword RELEASE_KEY_PASSWORD
  60. // }
  61. // }
  62. // buildTypes {
  63. // debug {
  64. // debuggable true
  65. // jniDebuggable true
  66. // signingConfig signingConfigs.debug
  67. // minifyEnabled false
  68. // shrinkResources false
  69. // multiDexEnabled true
  70. // proguardFiles getDefaultProguardFile('proguard-android.txt'), '../TMessagesProj/proguard-rules.pro'
  71. // ndk.debugSymbolLevel = 'FULL'
  72. // }
  73. // release {
  74. // debuggable false
  75. // jniDebuggable false
  76. // signingConfig signingConfigs.release
  77. // minifyEnabled true
  78. // shrinkResources false
  79. // multiDexEnabled true
  80. // proguardFiles getDefaultProguardFile('proguard-android.txt'), '../TMessagesProj/proguard-rules.pro'
  81. // ndk.debugSymbolLevel = 'FULL'
  82. // }
  83. // }
  84. sourceSets.debug {
  85. manifest.srcFile '../TMessagesProj/config/debug/AndroidManifest.xml'
  86. }
  87. sourceSets.release {
  88. manifest.srcFile '../TMessagesProj/config/release/AndroidManifest.xml'
  89. }
  90. flavorDimensions "minApi"
  91. productFlavors {
  92. afat {
  93. ndk {
  94. abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
  95. }
  96. sourceSets.debug {
  97. manifest.srcFile '../TMessagesProj/config/debug/AndroidManifest_SDK23.xml'
  98. }
  99. sourceSets.release {
  100. manifest.srcFile '../TMessagesProj/config/release/AndroidManifest_SDK23.xml'
  101. }
  102. ext {
  103. abiVersionCode = 9
  104. }
  105. }
  106. }
  107. defaultConfig.versionCode = Integer.parseInt(APP_VERSION_CODE)
  108. applicationVariants.all { variant ->
  109. variant.outputs.all { output ->
  110. outputFileName = "app-huawei.apk"
  111. output.versionCodeOverride = defaultConfig.versionCode * 10 + variant.productFlavors.get(0).abiVersionCode
  112. }
  113. }
  114. variantFilter { variant ->
  115. def names = variant.flavors*.name
  116. if (variant.buildType.name != "release" && !names.contains("afat")) {
  117. setIgnore(true)
  118. }
  119. }
  120. defaultConfig {
  121. minSdkVersion 19
  122. targetSdkVersion 30
  123. versionName APP_VERSION_NAME
  124. ndkVersion "21.4.7075529"
  125. multiDexEnabled true
  126. vectorDrawables.generatedDensities = ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi']
  127. externalNativeBuild {
  128. cmake {
  129. version '3.10.2'
  130. arguments '-DANDROID_STL=c++_static', '-DANDROID_PLATFORM=android-16', "-j=16"
  131. }
  132. }
  133. }
  134. buildFeatures {
  135. buildConfig = true
  136. }
  137. lintOptions {
  138. checkReleaseBuilds false
  139. }
  140. }
  141. apply plugin: 'com.google.gms.google-services'