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