| 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.1.0-beta01' |
| 19 | implementation 'androidx.palette:palette:1.0.0' |
| 20 | implementation 'androidx.exifinterface:exifinterface:1.1.0-beta01' |
| 21 |
| 22 | compileOnly 'org.checkerframework:checker-qual:2.5.2' |
| 23 | compileOnly 'org.checkerframework:checker-compat-qual:2.5.0' |
| 24 | implementation 'com.google.firebase:firebase-messaging:19.0.1' |
| 25 | implementation 'com.google.firebase:firebase-config:18.0.0' |
| 26 | implementation 'com.google.android.gms:play-services-maps:17.0.0' |
| 27 | implementation 'com.google.android.gms:play-services-auth:17.0.0' |
| 28 | implementation 'com.google.android.gms:play-services-vision:16.2.0' |
| 29 | implementation 'com.google.android.gms:play-services-wallet:17.0.0' |
| 30 | implementation 'com.google.android.gms:play-services-wearable:17.0.0' |
| 31 | implementation 'com.google.android.gms:play-services-location:17.0.0' |
| 32 | implementation 'net.hockeyapp.android:HockeySDK:5.1.1' |
| 33 | implementation 'com.googlecode.mp4parser:isoparser:1.0.6' |
| 34 | implementation 'com.stripe:stripe-android:2.0.2' |
| 35 | } |
| 36 |
| 37 | android { |
| 38 | compileSdkVersion 28 |
| 39 | buildToolsVersion '28.0.3' |
| 40 |
| 41 | defaultConfig.applicationId = "org.telegram.messenger" |
| 42 |
| 43 | sourceSets.main.jniLibs.srcDirs = ['./jni/'] |
| 44 |
| 45 | externalNativeBuild { |
| 46 | ndkBuild { |
| 47 | path "jni/Android.mk" |
| 48 | } |
| 49 | } |
| 50 |
| 51 | lintOptions { |
| 52 | disable 'MissingTranslation' |
| 53 | disable 'ExtraTranslation' |
| 54 | } |
| 55 |
| 56 | dexOptions { |
| 57 | jumboMode = true |
| 58 | } |
| 59 |
| 60 | compileOptions { |
| 61 | sourceCompatibility JavaVersion.VERSION_1_8 |
| 62 | targetCompatibility JavaVersion.VERSION_1_8 |
| 63 | } |
| 64 |
| 65 | signingConfigs { |
| 66 | debug { |
| 67 | storeFile file("config/release.keystore") |
| 68 | storePassword RELEASE_STORE_PASSWORD |
| 69 | keyAlias RELEASE_KEY_ALIAS |
| 70 | keyPassword RELEASE_KEY_PASSWORD |
| 71 | } |
| 72 |
| 73 | release { |
| 74 | storeFile file("config/release.keystore") |
| 75 | storePassword RELEASE_STORE_PASSWORD |
| 76 | keyAlias RELEASE_KEY_ALIAS |
| 77 | keyPassword RELEASE_KEY_PASSWORD |
| 78 | } |
| 79 | } |
| 80 |
| 81 | buildTypes { |
| 82 | debug { |
| 83 | debuggable true |
| 84 | jniDebuggable true |
| 85 | signingConfig signingConfigs.debug |
| 86 | applicationIdSuffix ".beta" |
| 87 | minifyEnabled true |
| 88 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' |
| 89 | } |
| 90 |
| 91 | debugMultidex { |
| 92 | initWith debug |
| 93 | minifyEnabled false |
| 94 | multiDexEnabled true |
| 95 | dependencies { |
| 96 | implementation 'com.android.support:multidex:1.0.3' |
| 97 | } |
| 98 | manifestPlaceholders = [applicationClassName: "MultiDexApplicationLoader"] |
| 99 | } |
| 100 |
| 101 | HA { |
| 102 | debuggable false |
| 103 | jniDebuggable false |
| 104 | signingConfig signingConfigs.debug |
| 105 | applicationIdSuffix ".beta" |
| 106 | minifyEnabled true |
| 107 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' |
| 108 | } |
| 109 |
| 110 | release { |
| 111 | debuggable false |
| 112 | jniDebuggable false |
| 113 | signingConfig signingConfigs.release |
| 114 | minifyEnabled true |
| 115 | shrinkResources false |
| 116 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' |
| 117 | } |
| 118 | } |
| 119 |
| 120 | sourceSets.debug { |
| 121 | manifest.srcFile 'config/debug/AndroidManifest.xml' |
| 122 | } |
| 123 |
| 124 | sourceSets.debugMultidex { |
| 125 | manifest.srcFile 'config/debug/AndroidManifest.xml' |
| 126 | java.srcDirs = ['src/multidex/java'] |
| 127 | } |
| 128 |
| 129 | sourceSets.HA { |
| 130 | manifest.srcFile 'config/debug/AndroidManifest.xml' |
| 131 | } |
| 132 |
| 133 | sourceSets.release { |
| 134 | manifest.srcFile 'config/release/AndroidManifest.xml' |
| 135 | } |
| 136 |
| 137 | flavorDimensions "minApi" |
| 138 |
| 139 | productFlavors { |
| 140 | armv7 { |
| 141 | ndk { |
| 142 | abiFilters "armeabi-v7a" |
| 143 | } |
| 144 | ext { |
| 145 | abiVersionCode = 1 |
| 146 | } |
| 147 | } |
| 148 | x86 { |
| 149 | ndk { |
| 150 | abiFilters "x86" |
| 151 | } |
| 152 | ext { |
| 153 | abiVersionCode = 2 |
| 154 | } |
| 155 | } |
| 156 | armv7_SDK23 { |
| 157 | ndk { |
| 158 | abiFilters "armeabi-v7a" |
| 159 | } |
| 160 | sourceSets.debug { |
| 161 | manifest.srcFile 'config/debug/AndroidManifest_SDK23.xml' |
| 162 | } |
| 163 | sourceSets.release { |
| 164 | manifest.srcFile 'config/release/AndroidManifest_SDK23.xml' |
| 165 | } |
| 166 | minSdkVersion 23 |
| 167 | ext { |
| 168 | abiVersionCode = 3 |
| 169 | } |
| 170 | } |
| 171 | x86_SDK23 { |
| 172 | ndk { |
| 173 | abiFilters "x86" |
| 174 | } |
| 175 | sourceSets.debug { |
| 176 | manifest.srcFile 'config/debug/AndroidManifest_SDK23.xml' |
| 177 | } |
| 178 | sourceSets.release { |
| 179 | manifest.srcFile 'config/release/AndroidManifest_SDK23.xml' |
| 180 | } |
| 181 | minSdkVersion 23 |
| 182 | ext { |
| 183 | abiVersionCode = 4 |
| 184 | } |
| 185 | } |
| 186 | arm64 { |
| 187 | ndk { |
| 188 | abiFilters "arm64-v8a" |
| 189 | } |
| 190 | ext { |
| 191 | abiVersionCode = 5 |
| 192 | } |
| 193 | } |
| 194 | x64 { |
| 195 | ndk { |
| 196 | abiFilters "x86_64" |
| 197 | } |
| 198 | ext { |
| 199 | abiVersionCode = 6 |
| 200 | } |
| 201 | } |
| 202 | arm64_SDK23 { |
| 203 | ndk { |
| 204 | abiFilters "arm64-v8a" |
| 205 | } |
| 206 | sourceSets.debug { |
| 207 | manifest.srcFile 'config/debug/AndroidManifest_SDK23.xml' |
| 208 | } |
| 209 | sourceSets.release { |
| 210 | manifest.srcFile 'config/release/AndroidManifest_SDK23.xml' |
| 211 | } |
| 212 | minSdkVersion 23 |
| 213 | ext { |
| 214 | abiVersionCode = 7 |
| 215 | } |
| 216 | } |
| 217 | x64_SDK23 { |
| 218 | ndk { |
| 219 | abiFilters "x86_64" |
| 220 | } |
| 221 | sourceSets.debug { |
| 222 | manifest.srcFile 'config/debug/AndroidManifest_SDK23.xml' |
| 223 | } |
| 224 | sourceSets.release { |
| 225 | manifest.srcFile 'config/release/AndroidManifest_SDK23.xml' |
| 226 | } |
| 227 | minSdkVersion 23 |
| 228 | ext { |
| 229 | abiVersionCode = 8 |
| 230 | } |
| 231 | } |
| 232 | afat { |
| 233 | sourceSets.debug { |
| 234 | manifest.srcFile 'config/debug/AndroidManifest_SDK23.xml' |
| 235 | } |
| 236 | sourceSets.release { |
| 237 | manifest.srcFile 'config/release/AndroidManifest_SDK23.xml' |
| 238 | } |
| 239 | ext { |
| 240 | abiVersionCode = 0 |
| 241 | } |
| 242 | } |
| 243 | } |
| 244 |
| 245 | defaultConfig.versionCode = 1648 |
| 246 |
| 247 | applicationVariants.all { variant -> |
| 248 | variant.outputs.all { output -> |
| 249 | output.getProcessManifestProvider().get().doLast { |
| 250 | def abiVersion = variant.productFlavors.get(0).abiVersionCode |
| 251 |
| 252 | def outputDir = manifestOutputDirectory |
| 253 | File directory |
| 254 | if (outputDir instanceof File) { |
| 255 | directory = outputDir |
| 256 | } else { |
| 257 | directory = outputDir.get().asFile |
| 258 | } |
| 259 |
| 260 | String manifestPath = directory.toString() + "/AndroidManifest.xml" |
| 261 | def manifestContent = file(manifestPath).getText() |
| 262 |
| 263 | manifestContent = manifestContent.replace(String.format('android:versionCode="%d"', defaultConfig.versionCode), String.format('android:versionCode="%s"', defaultConfig.versionCode * 10 + abiVersion)) |
| 264 | file(manifestPath).write(manifestContent) |
| 265 | } |
| 266 | } |
| 267 | } |
| 268 |
| 269 | variantFilter { variant -> |
| 270 | def names = variant.flavors*.name |
| 271 | if (variant.buildType.name != "release" && !names.contains("afat")) { |
| 272 | setIgnore(true) |
| 273 | } |
| 274 | } |
| 275 |
| 276 | defaultConfig { |
| 277 | minSdkVersion 16 |
| 278 | targetSdkVersion 27 |
| 279 | versionName "5.9.0" |
| 280 |
| 281 | vectorDrawables.generatedDensities = ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi'] |
| 282 |
| 283 | externalNativeBuild { |
| 284 | ndkBuild { |
| 285 | arguments "NDK_APPLICATION_MK:=jni/Application.mk", "APP_PLATFORM:=android-16", "-j8" |
| 286 | abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64" |
| 287 | } |
| 288 | } |
| 289 |
| 290 | manifestPlaceholders = [applicationClassName: "ApplicationLoader"] |
| 291 | } |
| 292 | } |
| 293 |
| 294 | apply plugin: 'com.google.gms.google-services' |
| 295 |