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