| 7 |
| google() |
| 8 | } |
| 9 |
| 10 | configurations { |
| 11 | compile.exclude module: 'support-v4' |
| 12 | } |
| 13 |
| 14 | configurations.all { |
| 15 | exclude group: 'com.google.firebase', module: 'firebase-core' |
| 16 | exclude group: 'androidx.recyclerview', module: 'recyclerview' |
| 17 | } |
| 18 |
| 19 | dependencies { |
| 20 | implementation 'androidx.core:core:1.16.0' |
| 21 | implementation 'androidx.palette:palette:1.0.0' |
| 22 | implementation 'androidx.exifinterface:exifinterface:1.3.6' |
| 23 | implementation 'androidx.dynamicanimation:dynamicanimation:1.0.0' |
| 24 | implementation "androidx.sharetarget:sharetarget:1.2.0" |
| 25 | implementation 'androidx.interpolator:interpolator:1.0.0' |
| 26 | implementation 'androidx.biometric:biometric:1.1.0' |
| 27 |
| 28 | implementation 'com.google.android.gms:play-services-cast-framework:21.4.0' |
| 29 | implementation "androidx.mediarouter:mediarouter:1.7.0" |
| 30 | implementation 'org.nanohttpd:nanohttpd:2.3.1' |
| 31 |
| 32 | compileOnly 'org.checkerframework:checker-qual:2.5.2' |
| 33 | compileOnly 'org.checkerframework:checker-compat-qual:2.5.0' |
| 34 | implementation 'com.google.firebase:firebase-messaging:22.0.0' |
| 35 | implementation 'com.google.firebase:firebase-config:21.0.1' |
| 36 | implementation 'com.google.firebase:firebase-datatransport:18.1.0' |
| 37 | implementation 'com.google.firebase:firebase-appindexing:20.0.0' |
| 38 | implementation 'com.google.android.gms:play-services-maps:18.1.0' |
| 39 | implementation 'com.google.android.gms:play-services-auth:20.4.0' |
| 40 | implementation 'com.google.android.gms:play-services-vision:20.1.3' |
| 41 | implementation 'com.google.android.gms:play-services-wearable:18.0.0' |
| 42 | implementation 'com.google.android.gms:play-services-location:21.0.1' |
| 43 | implementation 'com.google.android.gms:play-services-wallet:19.1.0' |
| 44 | implementation 'com.googlecode.mp4parser:isoparser:1.0.6' |
| 45 | implementation 'com.stripe:stripe-android:2.0.2' |
| 46 | implementation 'com.google.mlkit:language-id:17.0.6' |
| 47 | implementation 'com.android.billingclient:billing:7.1.1' |
| 48 | implementation 'com.google.code.gson:gson:2.11.0' |
| 49 | implementation 'com.google.guava:guava:31.1-android' |
| 50 | implementation 'com.google.android.play:integrity:1.3.0' |
| 51 | implementation 'com.google.android.gms:play-services-safetynet:18.0.1' |
| 52 |
| 53 | implementation 'com.google.android.gms:play-services-mlkit-subject-segmentation:16.0.0-beta1' |
| 54 | implementation 'com.google.android.gms:play-services-mlkit-image-labeling:16.0.8' |
| 55 |
| 56 | implementation "androidx.credentials:credentials:1.6.0-alpha04" |
| 57 | implementation "androidx.credentials:credentials-play-services-auth:1.6.0-alpha04" |
| 58 |
| 59 | // implementation 'com.google.mlkit:translate:17.0.3' |
| 60 |
| 61 | constraints { |
| 62 | implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.0") { |
| 63 | because("kotlin-stdlib-jdk7 is now a part of kotlin-stdlib") |
| 64 | } |
| 65 | implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0") { |
| 66 | because("kotlin-stdlib-jdk8 is now a part of kotlin-stdlib") |
| 67 | } |
| 68 | } |
| 69 | implementation 'com.google.android.recaptcha:recaptcha:18.7.1' |
| 70 |
| 71 | coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5' |
| 72 | } |
| 73 |
| 74 | def isWindows = String.valueOf(DefaultNativePlatform.currentOperatingSystem.toFamilyName() == OperatingSystemFamily.WINDOWS) |
| 75 | android { |
| 76 | compileSdkVersion 35 |
| 77 | buildToolsVersion '35.0.0' |
| 78 | ndkVersion "21.4.7075529" // 26.3.11579264 |
| 79 |
| 80 | sourceSets.main.jniLibs.srcDirs = ['./jni/'] |
| 81 |
| 82 | externalNativeBuild { |
| 83 | cmake { |
| 84 | path 'jni/CMakeLists.txt' |
| 85 | } |
| 86 | } |
| 87 |
| 88 | lintOptions { |
| 89 | disable 'MissingTranslation' |
| 90 | disable 'ExtraTranslation' |
| 91 | disable 'BlockedPrivateApi' |
| 92 | } |
| 93 |
| 94 | compileOptions { |
| 95 | sourceCompatibility JavaVersion.VERSION_1_8 |
| 96 | targetCompatibility JavaVersion.VERSION_1_8 |
| 97 |
| 98 | coreLibraryDesugaringEnabled true |
| 99 | } |
| 100 |
| 101 |
| 102 | defaultConfig { |
| 103 | minSdkVersion 21 |
| 104 | targetSdkVersion 35 |
| 105 |
| 106 | vectorDrawables.generatedDensities = ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi'] |
| 107 |
| 108 | multiDexEnabled true |
| 109 |
| 110 | externalNativeBuild { |
| 111 | cmake { |
| 112 | version '3.10.2' |
| 113 | arguments '-DANDROID_STL=c++_static', '-DANDROID_PLATFORM=android-21' //, '-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON' |
| 114 | } |
| 115 | } |
| 116 | } |
| 117 |
| 118 | buildTypes { |
| 119 | debug { |
| 120 | jniDebuggable true |
| 121 | minifyEnabled false |
| 122 | shrinkResources false |
| 123 | multiDexEnabled true |
| 124 | proguardFiles getDefaultProguardFile('proguard-android.txt'), '../TMessagesProj/proguard-rules.pro', '../TMessagesProj/proguard-rules-beta.pro' |
| 125 | ndk.debugSymbolLevel = 'FULL' |
| 126 | buildConfigField "String", "BUILD_VERSION_STRING", "\"" + APP_VERSION_NAME + "\"" |
| 127 | buildConfigField "String", "APP_CENTER_HASH", "\"\"" |
| 128 | buildConfigField "String", "BETA_URL", "\"" + getProps("BETA_PRIVATE_URL") + "\"" |
| 129 | buildConfigField "boolean", "DEBUG_VERSION", "true" |
| 130 | buildConfigField "boolean", "DEBUG_PRIVATE_VERSION", "true" |
| 131 | buildConfigField "boolean", "BUILD_HOST_IS_WINDOWS", isWindows |
| 132 | buildConfigField "int", "VERSION_NUM", "0" |
| 133 | } |
| 134 |
| 135 | HA_private { |
| 136 | jniDebuggable false |
| 137 | minifyEnabled true |
| 138 | multiDexEnabled true |
| 139 | proguardFiles getDefaultProguardFile('proguard-android.txt'), '../TMessagesProj/proguard-rules.pro', '../TMessagesProj/proguard-rules-beta.pro' |
| 140 | ndk.debugSymbolLevel = 'FULL' |
| 141 | buildConfigField "String", "BUILD_VERSION_STRING", "\"" + APP_VERSION_NAME + "\"" |
| 142 | buildConfigField "String", "APP_CENTER_HASH", "\"" + getProps("APP_CENTER_HASH_PRIVATE") + "\"" |
| 143 | buildConfigField "String", "BETA_URL", "\"" + getProps("BETA_PRIVATE_URL") + "\"" |
| 144 | buildConfigField "boolean", "DEBUG_VERSION", "true" |
| 145 | buildConfigField "boolean", "DEBUG_PRIVATE_VERSION", "true" |
| 146 | buildConfigField "boolean", "BUILD_HOST_IS_WINDOWS", isWindows |
| 147 | buildConfigField "int", "VERSION_NUM", "1" |
| 148 | } |
| 149 |
| 150 | HA_public { |
| 151 | jniDebuggable false |
| 152 | minifyEnabled true |
| 153 | multiDexEnabled true |
| 154 | proguardFiles getDefaultProguardFile('proguard-android.txt'), '../TMessagesProj/proguard-rules.pro', '../TMessagesProj/proguard-rules-beta.pro' |
| 155 | ndk.debugSymbolLevel = 'FULL' |
| 156 | buildConfigField "String", "BUILD_VERSION_STRING", "\"" + APP_VERSION_NAME + "\"" |
| 157 | buildConfigField "String", "APP_CENTER_HASH", "\"" + getProps("APP_CENTER_HASH_PUBLIC") + "\"" |
| 158 | buildConfigField "String", "BETA_URL", "\"" + getProps("BETA_PUBLIC_URL") + "\"" |
| 159 | buildConfigField "boolean", "DEBUG_VERSION", "true" |
| 160 | buildConfigField "boolean", "DEBUG_PRIVATE_VERSION", "false" |
| 161 | buildConfigField "boolean", "BUILD_HOST_IS_WINDOWS", isWindows |
| 162 | buildConfigField "int", "VERSION_NUM", "4" |
| 163 | } |
| 164 |
| 165 | HA_hardcore { |
| 166 | jniDebuggable false |
| 167 | minifyEnabled true |
| 168 | multiDexEnabled true |
| 169 | proguardFiles getDefaultProguardFile('proguard-android.txt'), '../TMessagesProj/proguard-rules.pro', '../TMessagesProj/proguard-rules-beta.pro' |
| 170 | ndk.debugSymbolLevel = 'FULL' |
| 171 | buildConfigField "String", "BUILD_VERSION_STRING", "\"" + APP_VERSION_NAME + "\"" |
| 172 | buildConfigField "String", "APP_CENTER_HASH", "\"" + getProps("APP_CENTER_HASH_HARDCORE") + "\"" |
| 173 | buildConfigField "String", "BETA_URL", "\"" + getProps("BETA_HARDCORE_URL") + "\"" |
| 174 | buildConfigField "boolean", "DEBUG_VERSION", "true" |
| 175 | buildConfigField "boolean", "DEBUG_PRIVATE_VERSION", "true" |
| 176 | buildConfigField "boolean", "BUILD_HOST_IS_WINDOWS", isWindows |
| 177 | buildConfigField "int", "VERSION_NUM", "5" |
| 178 | } |
| 179 |
| 180 | standalone { |
| 181 | jniDebuggable false |
| 182 | minifyEnabled true |
| 183 | multiDexEnabled true |
| 184 | proguardFiles getDefaultProguardFile('proguard-android.txt'), '../TMessagesProj/proguard-rules.pro' |
| 185 | ndk.debugSymbolLevel = 'FULL' |
| 186 | buildConfigField "String", "BUILD_VERSION_STRING", "\"" + APP_VERSION_NAME + "\"" |
| 187 | buildConfigField "String", "APP_CENTER_HASH", "\"\"" |
| 188 | buildConfigField "String", "BETA_URL", "\"\"" |
| 189 | buildConfigField "boolean", "DEBUG_VERSION", "false" |
| 190 | buildConfigField "boolean", "DEBUG_PRIVATE_VERSION", "false" |
| 191 | buildConfigField "boolean", "BUILD_HOST_IS_WINDOWS", isWindows |
| 192 | buildConfigField "int", "VERSION_NUM", "6" |
| 193 | } |
| 194 |
| 195 | release { |
| 196 | jniDebuggable false |
| 197 | minifyEnabled true |
| 198 | shrinkResources false |
| 199 | multiDexEnabled true |
| 200 | proguardFiles getDefaultProguardFile('proguard-android.txt'), '../TMessagesProj/proguard-rules.pro' |
| 201 | ndk.debugSymbolLevel = 'FULL' |
| 202 | buildConfigField "String", "BUILD_VERSION_STRING", "\"" + APP_VERSION_NAME + "\"" |
| 203 | buildConfigField "String", "APP_CENTER_HASH", "\"\"" |
| 204 | buildConfigField "String", "BETA_URL", "\"\"" |
| 205 | buildConfigField "boolean", "DEBUG_VERSION", "false" |
| 206 | buildConfigField "boolean", "DEBUG_PRIVATE_VERSION", "false" |
| 207 | buildConfigField "boolean", "BUILD_HOST_IS_WINDOWS", isWindows |
| 208 | buildConfigField "int", "VERSION_NUM", "7" |
| 209 | } |
| 210 | } |
| 211 |
| 212 | namespace 'org.telegram.messenger' |
| 213 | } |
| 214 |
| 215 |
| 216 | def getProps(String propName) { |
| 217 | def propsFile = rootProject.file('local.properties') |
| 218 | if (propsFile.exists()) { |
| 219 | def props = new Properties() |
| 220 | props.load(new FileInputStream(propsFile)) |
| 221 | return props[propName] |
| 222 | } else { |
| 223 | return ""; |
| 224 | } |
| 225 | } |
| 226 | apply plugin: 'com.google.gms.google-services' |
| 227 |
| 228 | task checkVisibility { |
| 229 | doFirst { |
| 230 | def isPrivateBuild = project.gradle.startParameter.taskNames.find { |
| 231 | it.contains("HA_private") || it.contains("HA_hardcore") || it.contains("Debug") || it.contains("Release") |
| 232 | } |
| 233 | def isPublicAllowed = !project.hasProperty("IS_PRIVATE") || !project.property("IS_PRIVATE").toBoolean() |
| 234 | if (!isPrivateBuild && !isPublicAllowed) { |
| 235 | throw new GradleException("Building public version of private code!") |
| 236 | } |
| 237 | } |
| 238 | doLast { |
| 239 | if (project.gradle.startParameter.taskNames.find { it.contains("HA_public") }) { |
| 240 | def privateBuild = file("${projectDir}_AppHockeyApp/afat/HA_private/Telegram-Beta.apk") |
| 241 | if (privateBuild.exists()) { |
| 242 | privateBuild.delete() |
| 243 | } |
| 244 | } |
| 245 | } |
| 246 | } |
| 247 |
| 248 | preBuild.dependsOn checkVisibility |