1// Top-level build file where you can add configuration options common to all
2// sub-projects/modules.
3buildscript {
4 repositories {
5 google()
6 mavenCentral()
7 }
8 dependencies {
9 classpath 'com.android.tools.build:gradle:8.9.1'
10 classpath "com.diffplug.spotless:spotless-plugin-gradle:7.0.2"
11 }
12}
13
14plugins {
15 id 'org.ajoberstar.grgit' version '4.1.1'
16 // PLUGIN INSERT
17}
18
19apply plugin: 'com.android.application'
20apply plugin: "com.diffplug.spotless"
21
22repositories {
23 google()
24 mavenCentral()
25 maven { url='https://jitpack.io'}
26}
27
28def tags = grgit.tag.list().findAll { it.dateTime != null }.sort { it.dateTime }
29
30// ROOT INSERT
31
32configurations {
33 playstoreImplementation
34 freeImplementation
35 conversationsFreeImplementation
36 cheogramPlaystoreImplementation
37 conversationsPlaystoreImplementation
38 quicksyPlaystoreImplementation
39 quicksyPlaystoreImplementation
40 quicksyFreeImplementation
41 quicksyImplementation
42}
43
44spotless {
45 ratchetFrom '2.17.4'
46 java {
47 target '**/*.java'
48 googleJavaFormat().aosp().reflowLongStrings()
49 }
50}
51
52
53dependencies {
54 androidTestImplementation 'tools.fastlane:screengrab:2.1.1'
55 androidTestImplementation 'junit:junit:4.13.2'
56 androidTestImplementation 'androidx.test:runner:1.3.0'
57 androidTestImplementation 'androidx.test:rules:1.3.0'
58 androidTestImplementation 'androidx.test.ext:junit:1.1.2'
59 androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
60
61 implementation "androidx.core:core:1.10.1"
62 coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5'
63
64 implementation project(':libs:annotation')
65 annotationProcessor project(':libs:annotation-processor')
66
67 implementation 'androidx.viewpager:viewpager:1.1.0'
68
69 playstoreImplementation('com.google.firebase:firebase-messaging:24.1.1') {
70 exclude group: 'com.google.firebase', module: 'firebase-core'
71 exclude group: 'com.google.firebase', module: 'firebase-analytics'
72 exclude group: 'com.google.firebase', module: 'firebase-measurement-connector'
73 }
74 cheogramPlaystoreImplementation("com.android.installreferrer:installreferrer:2.2")
75 cheogramPlaystoreImplementation 'com.github.singpolyma:play-licensing:1c637ea03c'
76 conversationsPlaystoreImplementation("com.android.installreferrer:installreferrer:2.2")
77 quicksyPlaystoreImplementation 'com.google.android.gms:play-services-auth-api-phone:18.2.0'
78 implementation 'com.github.open-keychain.open-keychain:openpgp-api:v5.7.1'
79 implementation("com.vanniktech:android-image-cropper:4.6.0")
80 implementation "androidx.sharetarget:sharetarget:1.2.0"
81
82 implementation 'androidx.appcompat:appcompat:1.7.0'
83 implementation 'androidx.exifinterface:exifinterface:1.4.0'
84 implementation 'androidx.cardview:cardview:1.0.0'
85 implementation "androidx.preference:preference:1.2.1"
86 implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
87 implementation 'com.google.android.material:material:1.13.0-alpha10'
88 implementation 'androidx.work:work-runtime:2.10.0'
89
90 implementation "androidx.emoji2:emoji2:1.5.0"
91 freeImplementation "androidx.emoji2:emoji2-bundled:1.5.0"
92
93 implementation 'org.bouncycastle:bcmail-jdk18on:1.80'
94 implementation 'org.bouncycastle:bcpg-jdk18on:1.80'
95 implementation 'com.google.zxing:core:3.5.3'
96 implementation 'org.minidns:minidns-hla:1.1.1'
97 implementation 'me.leolin:ShortcutBadger:1.1.22@aar'
98 implementation 'org.whispersystems:signal-protocol-java:2.6.2'
99 implementation "com.wefika:flowlayout:0.4.1"
100
101 //noinspection GradleDependency
102 implementation 'io.deepmedia.community:transcoder-android:0.11.2'
103
104 implementation 'org.jxmpp:jxmpp-jid:1.0.3'
105 implementation 'org.jxmpp:jxmpp-stringprep-libidn:1.0.3'
106 implementation 'org.osmdroid:osmdroid-android:6.1.11'
107 implementation 'org.hsluv:hsluv:0.2'
108 implementation 'org.conscrypt:conscrypt-android:2.5.2'
109 implementation 'me.drakeet.support:toastcompat:1.1.0'
110 implementation "com.leinardi.android:speed-dial:3.3.0"
111
112 implementation "com.squareup.retrofit2:retrofit:2.11.0"
113 implementation "com.squareup.retrofit2:converter-gson:2.11.0"
114 implementation "com.squareup.okhttp3:okhttp:4.12.0"
115
116 implementation 'com.google.guava:guava:33.4.6-android'
117 implementation 'io.michaelrocks:libphonenumber-android:8.13.52'
118 implementation 'im.conversations.webrtc:webrtc-android:129.0.0'
119 implementation 'io.github.nishkarsh:android-permissions:2.1.6'
120 implementation 'androidx.recyclerview:recyclerview:1.1.0'
121 implementation 'androidx.documentfile:documentfile:1.0.1'
122 implementation 'androidx.browser:browser:1.8.0'
123 implementation 'com.github.martin-stone:hsv-alpha-color-picker-android:3.1.0'
124 implementation 'com.github.ipld:java-cid:v1.3.1'
125 //implementation 'com.splitwise:tokenautocomplete:3.0.2'
126 implementation 'com.github.singpolyma:TokenAutoComplete:bfa93780e0'
127 implementation 'com.github.singpolyma:Better-Link-Movement-Method:393d35e453'
128 implementation 'com.github.singpolyma:android-identicons:3361281bd4'
129 implementation 'com.github.woltapp:blurhash:master'
130 implementation 'com.caverock:androidsvg-aar:1.4'
131 implementation 'org.tomlj:tomlj:1.1.0'
132 implementation 'com.tbuonomo:dotsindicator:4.2'
133 implementation 'com.github.singpolyma:OpenGraphParser:d0882eadb2'
134 implementation 'me.xdrop:fuzzywuzzy:1.4.0'
135 implementation 'net.fellbaum:jemoji:1.4.1'
136 implementation 'com.github.natario1:Autocomplete:v1.1.0'
137 implementation 'com.mikepenz:materialdrawer:9.0.1'
138
139 //Testing
140 testImplementation 'junit:junit:4.13.2'
141}
142
143ext {
144 preDexEnabled = System.getProperty("pre-dex", "true")
145 abiCodes = ['armeabi-v7a': 1, 'x86': 2, 'x86_64': 3, 'arm64-v8a': 4]
146}
147
148android {
149 namespace 'eu.siacs.conversations'
150 compileSdk 35
151
152 defaultConfig {
153 minSdkVersion 23
154 targetSdkVersion 35
155 versionCode 42025 + tags.size()
156 versionName grgit.describe(always: true)
157 applicationId "eu.siacs.conversations"
158 def appName = "Conversations"
159 resValue "string", "app_name", appName
160 buildConfigField "String", "APP_NAME", "\"$appName\"";
161 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
162 }
163
164 splits {
165 abi {
166 def isBuildingBundle = gradle.startParameter.taskNames.any { it.toLowerCase().contains("bundle") }
167 universalApk true
168 enable !isBuildingBundle
169 reset()
170 //noinspection ChromeOsAbiSupport
171 include project.ext.abiCodes.keySet() as String[]
172 }
173 }
174
175 configurations {
176 implementation.exclude group: 'org.jetbrains' , module:'annotations'
177 }
178
179 dataBinding {
180 enabled true
181 }
182
183 compileOptions {
184 coreLibraryDesugaringEnabled true
185 sourceCompatibility JavaVersion.VERSION_17
186 targetCompatibility JavaVersion.VERSION_17
187 }
188
189 flavorDimensions += "mode"
190 flavorDimensions += "distribution"
191
192 productFlavors {
193
194 quicksy {
195 dimension "mode"
196 applicationId = "im.quicksy.client"
197
198 def appName = "Quicksy"
199 resValue "string", "app_name", appName
200 buildConfigField "String", "APP_NAME", "\"$appName\""
201 buildConfigField "String", "PRIVACY_POLICY", "\"https://quicksy.im/privacy.htm\""
202 }
203
204 conversations {
205 dimension "mode"
206 buildConfigField "String", "PRIVACY_POLICY", "\"https://conversations.im/privacy.html\""
207 }
208
209 cheogram {
210 dimension "mode"
211
212 applicationId = "com.cheogram.android"
213
214 def appName = "Cheogram"
215 resValue "string", "app_name", appName
216 buildConfigField "String", "APP_NAME", "\"$appName\"";
217 buildConfigField "String", "PRIVACY_POLICY", "\"https://cheogram.com/android-privacy.html\""
218 }
219
220 playstore {
221 dimension "distribution"
222 versionNameSuffix "+playstore"
223 applicationIdSuffix "playstore"
224 }
225 free {
226 dimension "distribution"
227 versionNameSuffix "+free"
228 }
229 }
230
231 applicationVariants.all { variant ->
232 variant.resValue "string", "applicationId", applicationId
233 }
234
235 sourceSets {
236 quicksyFree {
237 java {
238 srcDir 'src/quicksyFree/java'
239 }
240 }
241 quicksyPlaystore {
242 java {
243 srcDir 'src/quicksyPlaystore/java'
244 }
245 res {
246 srcDir 'src/quicksyPlaystore/res'
247 }
248 }
249 conversationsFree {
250 java {
251 srcDir 'src/conversationsFree/java'
252 }
253 }
254 cheogramFree {
255 java {
256 srcDir 'src/conversationsFree/java'
257 }
258 }
259 conversationsPlaystore {
260 java {
261 srcDir 'src/conversationsPlaystore/java'
262 }
263 res {
264 srcDir 'src/conversationsPlaystore/res'
265 }
266 }
267 }
268
269 buildTypes {
270 release {
271 shrinkResources true
272 minifyEnabled true
273 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
274 ndk.debugSymbolLevel = 'full'
275 }
276 }
277
278
279 if (new File("signing.properties").exists()) {
280 Properties props = new Properties()
281 props.load(new FileInputStream(file("signing.properties")))
282
283 signingConfigs {
284 release {
285 storeFile file(props['keystore'])
286 storePassword props['keystore.password']
287 keyAlias props['keystore.alias']
288 keyPassword props['keystore.password']
289 }
290 }
291 buildTypes.release.signingConfig = signingConfigs.release
292 }
293
294 lintOptions {
295 disable 'MissingTranslation', 'InvalidPackage','AppCompatResource'
296 abortOnError false
297 }
298
299 subprojects {
300
301 afterEvaluate {
302 if (getPlugins().hasPlugin('android') ||
303 getPlugins().hasPlugin('android-library')) {
304
305 configure(android.lintOptions) {
306 disable 'AndroidGradlePluginVersion', 'MissingTranslation'
307 abortOnError false
308 }
309 }
310
311 }
312 }
313 packagingOptions {
314 resources {
315 excludes += ['META-INF/BCKEY.DSA', 'META-INF/BCKEY.SF', 'META-INF/versions/9/OSGI-INF/MANIFEST.MF']
316 }
317 }
318 lint {
319 disable 'MissingTranslation', 'InvalidPackage', 'AppCompatResource'
320 }
321 buildFeatures {
322 buildConfig true
323 }
324
325 android.applicationVariants.configureEach { variant ->
326 variant.outputs.each { output ->
327 def baseAbiVersionCode = project.ext.abiCodes.get(output.getFilter(com.android.build.OutputFile.ABI))
328 if (baseAbiVersionCode != null) {
329 output.versionCodeOverride = (100 * project.android.defaultConfig.versionCode) + baseAbiVersionCode
330 } else {
331 output.versionCodeOverride = (100 * project.android.defaultConfig.versionCode) + 3
332 }
333 }
334
335 }
336}