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