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