| 7 |
| } |
| 8 |
| 9 | configurations { |
| 10 | compile.exclude module: 'support-v4' |
| 11 | } |
| 12 |
| 13 | configurations.all { |
| 14 | exclude group: 'com.google.firebase', module: 'firebase-core' |
| 15 | } |
| 16 |
| 17 | dependencies { |
| 18 | implementation 'androidx.core:core:1.3.1' |
| 19 | implementation 'androidx.palette:palette:1.0.0' |
| 20 | implementation 'androidx.exifinterface:exifinterface:1.2.0' |
| 21 | implementation 'androidx.dynamicanimation:dynamicanimation:1.0.0' |
| 22 | implementation 'androidx.multidex:multidex:2.0.1' |
| 23 | implementation "androidx.sharetarget:sharetarget:1.0.0" |
| 24 |
| 25 | compileOnly 'org.checkerframework:checker-qual:2.5.2' |
| 26 | compileOnly 'org.checkerframework:checker-compat-qual:2.5.0' |
| 27 | implementation 'com.google.firebase:firebase-messaging:20.2.4' |
| 28 | implementation 'com.google.firebase:firebase-config:19.2.0' |
| 29 | implementation 'com.google.firebase:firebase-datatransport:17.0.6' |
| 30 | implementation 'com.google.android.gms:play-services-maps:17.0.0' |
| 31 | implementation 'com.google.android.gms:play-services-auth:18.1.0' |
| 32 | implementation 'com.google.android.gms:play-services-vision:16.2.0' |
| 33 | implementation 'com.google.android.gms:play-services-wearable:17.0.0' |
| 34 | implementation 'com.google.android.gms:play-services-location:17.0.0' |
| 35 | implementation "com.microsoft.appcenter:appcenter-distribute:3.2.2" |
| 36 | implementation "com.microsoft.appcenter:appcenter-crashes:3.2.2" |
| 37 | implementation 'com.googlecode.mp4parser:isoparser:1.0.6' |
| 38 | implementation 'com.stripe:stripe-android:2.0.2' |
| 39 | implementation files('libs/libgsaverification-client.aar') |
| 40 |
| 41 | coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.0.10' |
| 42 | } |
| 43 |
| 44 | android { |
| 45 | compileSdkVersion 30 |
| 46 | buildToolsVersion '30.0.2' |
| 47 | ndkVersion "21.1.6352462" |
| 48 |
| 49 | defaultConfig.applicationId = "org.telegram.messenger" |
| 50 |
| 51 | sourceSets.main.jniLibs.srcDirs = ['./jni/'] |
| 52 |
| 53 | externalNativeBuild { |
| 54 | ndkBuild { |
| 55 | path "jni/Android.mk" |
| 56 | } |
| 57 | } |
| 58 |
| 59 | lintOptions { |
| 60 | disable 'MissingTranslation' |
| 61 | disable 'ExtraTranslation' |
| 62 | disable 'BlockedPrivateApi' |
| 63 | } |
| 64 |
| 65 | dexOptions { |
| 66 | jumboMode = true |
| 67 | } |
| 68 |
| 69 | compileOptions { |
| 70 | sourceCompatibility JavaVersion.VERSION_1_8 |
| 71 | targetCompatibility JavaVersion.VERSION_1_8 |
| 72 |
| 73 | coreLibraryDesugaringEnabled true |
| 74 | } |
| 75 |
| 76 | signingConfigs { |
| 77 | debug { |
| 78 | storeFile file("config/release.keystore") |
| 79 | storePassword RELEASE_STORE_PASSWORD |
| 80 | keyAlias RELEASE_KEY_ALIAS |
| 81 | keyPassword RELEASE_KEY_PASSWORD |
| 82 | } |
| 83 |
| 84 | release { |
| 85 | storeFile file("config/release.keystore") |
| 86 | storePassword RELEASE_STORE_PASSWORD |
| 87 | keyAlias RELEASE_KEY_ALIAS |
| 88 | keyPassword RELEASE_KEY_PASSWORD |
| 89 | } |
| 90 | } |
| 91 |
| 92 | buildTypes { |
| 93 | debug { |
| 94 | debuggable true |
| 95 | jniDebuggable true |
| 96 | signingConfig signingConfigs.debug |
| 97 | applicationIdSuffix ".beta" |
| 98 | minifyEnabled true |
| 99 | multiDexEnabled true |
| 100 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' |
| 101 | } |
| 102 |
| 103 | /*debugAsan { |
| 104 | debuggable true |
| 105 | jniDebuggable true |
| 106 | signingConfig signingConfigs.debug |
| 107 | applicationIdSuffix ".beta" |
| 108 | minifyEnabled true |
| 109 | multiDexEnabled true |
| 110 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' |
| 111 |
| 112 | packagingOptions { |
| 113 | doNotStrip "**.so" |
| 114 | } |
| 115 |
| 116 | sourceSets { |
| 117 | main { |
| 118 | jniLibs { |
| 119 | srcDir { |
| 120 | 'jniLibs' |
| 121 | } |
| 122 | } |
| 123 | resources { |
| 124 | srcDir { |
| 125 | 'jniRes' |
| 126 | } |
| 127 | } |
| 128 | } |
| 129 | } |
| 130 | }*/ |
| 131 |
| 132 | HA { |
| 133 | debuggable false |
| 134 | jniDebuggable false |
| 135 | signingConfig signingConfigs.debug |
| 136 | applicationIdSuffix ".beta" |
| 137 | minifyEnabled true |
| 138 | multiDexEnabled true |
| 139 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' |
| 140 | } |
| 141 |
| 142 | release { |
| 143 | debuggable false |
| 144 | jniDebuggable false |
| 145 | signingConfig signingConfigs.release |
| 146 | minifyEnabled true |
| 147 | shrinkResources false |
| 148 | multiDexEnabled true |
| 149 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' |
| 150 | } |
| 151 | } |
| 152 |
| 153 | sourceSets.debug { |
| 154 | manifest.srcFile 'config/debug/AndroidManifest.xml' |
| 155 | } |
| 156 |
| 157 | /*sourceSets.debugAsan { |
| 158 | manifest.srcFile 'config/debug/AndroidManifest.xml' |
| 159 | }*/ |
| 160 |
| 161 | sourceSets.HA { |
| 162 | manifest.srcFile 'config/debug/AndroidManifest.xml' |
| 163 | } |
| 164 |
| 165 | sourceSets.release { |
| 166 | manifest.srcFile 'config/release/AndroidManifest.xml' |
| 167 | } |
| 168 |
| 169 | flavorDimensions "minApi" |
| 170 |
| 171 | productFlavors { |
| 172 | armv7 { |
| 173 | ndk { |
| 174 | abiFilters "armeabi-v7a" |
| 175 | } |
| 176 | ext { |
| 177 | abiVersionCode = 1 |
| 178 | } |
| 179 | } |
| 180 | x86 { |
| 181 | ndk { |
| 182 | abiFilters "x86" |
| 183 | } |
| 184 | ext { |
| 185 | abiVersionCode = 2 |
| 186 | } |
| 187 | } |
| 188 | armv7_SDK23 { |
| 189 | ndk { |
| 190 | abiFilters "armeabi-v7a" |
| 191 | } |
| 192 | sourceSets.debug { |
| 193 | manifest.srcFile 'config/debug/AndroidManifest_SDK23.xml' |
| 194 | } |
| 195 | sourceSets.release { |
| 196 | manifest.srcFile 'config/release/AndroidManifest_SDK23.xml' |
| 197 | } |
| 198 | minSdkVersion 23 |
| 199 | ext { |
| 200 | abiVersionCode = 3 |
| 201 | } |
| 202 | } |
| 203 | x86_SDK23 { |
| 204 | ndk { |
| 205 | abiFilters "x86" |
| 206 | } |
| 207 | sourceSets.debug { |
| 208 | manifest.srcFile 'config/debug/AndroidManifest_SDK23.xml' |
| 209 | } |
| 210 | sourceSets.release { |
| 211 | manifest.srcFile 'config/release/AndroidManifest_SDK23.xml' |
| 212 | } |
| 213 | minSdkVersion 23 |
| 214 | ext { |
| 215 | abiVersionCode = 4 |
| 216 | } |
| 217 | } |
| 218 | arm64 { |
| 219 | ndk { |
| 220 | abiFilters "arm64-v8a" |
| 221 | } |
| 222 | ext { |
| 223 | abiVersionCode = 5 |
| 224 | } |
| 225 | } |
| 226 | x64 { |
| 227 | ndk { |
| 228 | abiFilters "x86_64" |
| 229 | } |
| 230 | ext { |
| 231 | abiVersionCode = 6 |
| 232 | } |
| 233 | } |
| 234 | arm64_SDK23 { |
| 235 | ndk { |
| 236 | abiFilters "arm64-v8a" |
| 237 | } |
| 238 | sourceSets.debug { |
| 239 | manifest.srcFile 'config/debug/AndroidManifest_SDK23.xml' |
| 240 | } |
| 241 | /*sourceSets.debugAsan { |
| 242 | manifest.srcFile 'config/debug/AndroidManifest_SDK23.xml' |
| 243 | }*/ |
| 244 | sourceSets.release { |
| 245 | manifest.srcFile 'config/release/AndroidManifest_SDK23.xml' |
| 246 | } |
| 247 | minSdkVersion 23 |
| 248 | ext { |
| 249 | abiVersionCode = 7 |
| 250 | } |
| 251 | } |
| 252 | x64_SDK23 { |
| 253 | ndk { |
| 254 | abiFilters "x86_64" |
| 255 | } |
| 256 | sourceSets.debug { |
| 257 | manifest.srcFile 'config/debug/AndroidManifest_SDK23.xml' |
| 258 | } |
| 259 | sourceSets.release { |
| 260 | manifest.srcFile 'config/release/AndroidManifest_SDK23.xml' |
| 261 | } |
| 262 | minSdkVersion 23 |
| 263 | ext { |
| 264 | abiVersionCode = 8 |
| 265 | } |
| 266 | } |
| 267 | afat { |
| 268 | sourceSets.debug { |
| 269 | manifest.srcFile 'config/debug/AndroidManifest_SDK23.xml' |
| 270 | } |
| 271 | /*sourceSets.debugAsan { |
| 272 | manifest.srcFile 'config/debug/AndroidManifest_SDK23.xml' |
| 273 | }*/ |
| 274 | sourceSets.release { |
| 275 | manifest.srcFile 'config/release/AndroidManifest_SDK23.xml' |
| 276 | } |
| 277 | ext { |
| 278 | abiVersionCode = 9 |
| 279 | } |
| 280 | } |
| 281 | } |
| 282 |
| 283 | defaultConfig.versionCode = 2065 |
| 284 |
| 285 | applicationVariants.all { variant -> |
| 286 | variant.outputs.all { output -> |
| 287 | outputFileName = "app.apk" |
| 288 | output.getProcessManifestProvider().get().doLast { |
| 289 | def abiVersion = variant.productFlavors.get(0).abiVersionCode |
| 290 |
| 291 | def outputDir = manifestOutputDirectory |
| 292 | File directory |
| 293 | if (outputDir instanceof File) { |
| 294 | directory = outputDir |
| 295 | } else { |
| 296 | directory = outputDir.get().asFile |
| 297 | } |
| 298 |
| 299 | String manifestPath = directory.toString() + "/AndroidManifest.xml" |
| 300 | def manifestContent = file(manifestPath).getText() |
| 301 |
| 302 | manifestContent = manifestContent.replace(String.format('android:versionCode="%d"', defaultConfig.versionCode), String.format('android:versionCode="%s"', defaultConfig.versionCode * 10 + abiVersion)) |
| 303 | file(manifestPath).write(manifestContent) |
| 304 | } |
| 305 | } |
| 306 | } |
| 307 |
| 308 | variantFilter { variant -> |
| 309 | def names = variant.flavors*.name |
| 310 | if (variant.buildType.name != "release" && !names.contains("afat")) { |
| 311 | setIgnore(true) |
| 312 | } |
| 313 | } |
| 314 |
| 315 | defaultConfig { |
| 316 | minSdkVersion 16 |
| 317 | targetSdkVersion 28 |
| 318 | versionName "7.0.1" |
| 319 |
| 320 | vectorDrawables.generatedDensities = ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi'] |
| 321 |
| 322 | externalNativeBuild { |
| 323 | ndkBuild { |
| 324 | arguments "NDK_APPLICATION_MK:=jni/Application.mk", "APP_PLATFORM:=android-16", "--jobs=16" |
| 325 | abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64" |
| 326 | } |
| 327 | } |
| 328 | } |
| 329 | } |
| 330 |
| 331 | apply plugin: 'com.google.gms.google-services' |
| 332 |