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