apply plugin: 'com.android.application' repositories { mavenCentral() google() jcenter() } configurations { compile.exclude module: 'support-v4' } dependencies { compile 'com.google.firebase:firebase-messaging:17.1.0' compile 'com.google.firebase:firebase-config:16.0.0' compile 'com.google.android.gms:play-services-maps:15.0.1' compile 'com.google.android.gms:play-services-vision:15.0.2' compile 'com.google.android.gms:play-services-wallet:15.0.1' compile 'com.google.android.gms:play-services-wearable:15.0.1' implementation 'com.android.support:support-core-ui:27.1.1' implementation 'com.android.support:support-compat:27.1.1' implementation 'com.android.support:support-core-utils:27.1.1' implementation 'com.android.support:support-v13:27.1.1' implementation 'com.android.support:palette-v7:27.1.1' implementation 'com.android.support:exifinterface:27.1.1' compile 'net.hockeyapp.android:HockeySDK:5.1.0' compile 'com.googlecode.mp4parser:isoparser:1.0.6' compile 'com.stripe:stripe-android:2.0.2' } android { compileSdkVersion 27 buildToolsVersion '27.0.3' defaultConfig.applicationId = "org.telegram.messenger" sourceSets.main.jniLibs.srcDirs = ['./jni/'] externalNativeBuild { ndkBuild { path "jni/Android.mk" } } lintOptions { disable 'MissingTranslation' disable 'ExtraTranslation' } dexOptions { jumboMode = true } compileOptions { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 } signingConfigs { debug { storeFile file("config/release.keystore") storePassword RELEASE_STORE_PASSWORD keyAlias RELEASE_KEY_ALIAS keyPassword RELEASE_KEY_PASSWORD } release { storeFile file("config/release.keystore") storePassword RELEASE_STORE_PASSWORD keyAlias RELEASE_KEY_ALIAS keyPassword RELEASE_KEY_PASSWORD } } buildTypes { debug { debuggable true jniDebuggable true signingConfig signingConfigs.debug applicationIdSuffix ".beta" minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } release { debuggable false jniDebuggable false signingConfig signingConfigs.release minifyEnabled true shrinkResources false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } foss { debuggable false jniDebuggable false signingConfig signingConfigs.release } } defaultConfig.versionCode = 1340 sourceSets.debug { manifest.srcFile 'config/debug/AndroidManifest.xml' } sourceSets.release { manifest.srcFile 'config/release/AndroidManifest.xml' } sourceSets.foss { manifest.srcFile 'config/foss/AndroidManifest.xml' } flavorDimensions "minApi" productFlavors { armv7 { ndk { abiFilters "armeabi-v7a" } ext { abiVersionCode = 1 } } x86 { ndk { abiFilters "x86" } ext { abiVersionCode = 2 } } armv7_SDK23 { ndk { abiFilters "armeabi-v7a" } sourceSets.debug { manifest.srcFile 'config/debug/AndroidManifest_SDK23.xml' } sourceSets.release { manifest.srcFile 'config/release/AndroidManifest_SDK23.xml' } minSdkVersion 23 ext { abiVersionCode = 3 } } x86_SDK23 { ndk { abiFilters "x86" } sourceSets.debug { manifest.srcFile 'config/debug/AndroidManifest_SDK23.xml' } sourceSets.release { manifest.srcFile 'config/release/AndroidManifest_SDK23.xml' } minSdkVersion 23 ext { abiVersionCode = 4 } } arm64 { ndk { abiFilters "arm64-v8a" } ext { abiVersionCode = 5 } } x64 { ndk { abiFilters "x86_64" } ext { abiVersionCode = 6 } } arm64_SDK23 { ndk { abiFilters "arm64-v8a" } sourceSets.debug { manifest.srcFile 'config/debug/AndroidManifest_SDK23.xml' } sourceSets.release { manifest.srcFile 'config/release/AndroidManifest_SDK23.xml' } minSdkVersion 23 ext { abiVersionCode = 7 } } x64_SDK23 { ndk { abiFilters "x86_64" } sourceSets.debug { manifest.srcFile 'config/debug/AndroidManifest_SDK23.xml' } sourceSets.release { manifest.srcFile 'config/release/AndroidManifest_SDK23.xml' } minSdkVersion 23 ext { abiVersionCode = 8 } } afat { sourceSets.debug { manifest.srcFile 'config/debug/AndroidManifest_SDK23.xml' } sourceSets.release { manifest.srcFile 'config/release/AndroidManifest_SDK23.xml' } ext { abiVersionCode = 0 } } } applicationVariants.all { variant -> variant.outputs.all { output -> output.processManifest.doLast { def abiVersion = variant.productFlavors.get(0).abiVersionCode String manifestPath = "$manifestOutputDirectory/AndroidManifest.xml" def manifestContent = file(manifestPath).getText() manifestContent = manifestContent.replace(String.format('android:versionCode="%d"', defaultConfig.versionCode), String.format('android:versionCode="%s"', defaultConfig.versionCode * 10 + abiVersion)) file(manifestPath).write(manifestContent) } } } defaultConfig { minSdkVersion 16 targetSdkVersion 27 versionName "4.9.0" vectorDrawables.generatedDensities = ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi'] externalNativeBuild { ndkBuild { arguments "NDK_APPLICATION_MK:=jni/Application.mk", "APP_PLATFORM:=android-16", "-j8" abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64" } } } } apply plugin: 'com.google.gms.google-services'