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
13apply plugin: 'com.android.application'
14
15repositories {
16 google()
17 mavenCentral()
18 maven { url='https://jitpack.io'}
19}
20
21configurations {
22 playstoreImplementation
23 freeImplementation
24 conversationsFreeImplementation
25 conversationsPlaystorImplementation
26 conversationsPlaystoreImplementation
27 quicksyPlaystoreImplementation
28 quicksyPlaystoreImplementation
29 quicksyFreeImplementation
30 quicksyImplementation
31}
32
33dependencies {
34 coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4'
35
36 implementation 'androidx.viewpager:viewpager:1.0.0'
37
38 playstoreImplementation('com.google.firebase:firebase-messaging:23.4.1') {
39 exclude group: 'com.google.firebase', module: 'firebase-core'
40 exclude group: 'com.google.firebase', module: 'firebase-analytics'
41 exclude group: 'com.google.firebase', module: 'firebase-measurement-connector'
42 }
43 conversationsPlaystoreImplementation("com.android.installreferrer:installreferrer:2.2")
44 quicksyPlaystoreImplementation 'com.google.android.gms:play-services-auth-api-phone:18.0.2'
45 implementation 'com.github.open-keychain.open-keychain:openpgp-api:v5.7.1'
46 implementation("com.github.CanHub:Android-Image-Cropper:2.0.0")
47 implementation 'androidx.appcompat:appcompat:1.6.1'
48 implementation 'androidx.exifinterface:exifinterface:1.3.7'
49 implementation 'androidx.cardview:cardview:1.0.0'
50 implementation "androidx.preference:preference:1.2.1"
51 implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
52 implementation 'com.google.android.material:material:1.11.0'
53
54 implementation "androidx.emoji2:emoji2:1.4.0"
55 freeImplementation "androidx.emoji2:emoji2-bundled:1.4.0"
56
57 implementation 'org.bouncycastle:bcmail-jdk15on:1.64'
58 //zxing stopped supporting Java 7 so we have to stick with 3.3.3
59 //https://github.com/zxing/zxing/issues/1170
60 implementation 'com.google.zxing:core:3.3.3'
61 implementation 'de.measite.minidns:minidns-hla:0.2.4'
62 implementation 'me.leolin:ShortcutBadger:1.1.22@aar'
63 implementation 'org.whispersystems:signal-protocol-java:2.6.2'
64 implementation 'com.makeramen:roundedimageview:2.3.0'
65
66 //noinspection GradleDependency
67 implementation('com.github.natario1:Transcoder:v0.9.1') {
68 exclude group: 'com.otaliastudios.opengl', module: 'egloo'
69 }
70 implementation 'com.github.natario1:Egloo:v0.4.0'
71
72 implementation 'org.jxmpp:jxmpp-jid:1.0.3'
73 implementation 'org.jxmpp:jxmpp-stringprep-libidn:1.0.3'
74 implementation 'org.osmdroid:osmdroid-android:6.1.11'
75 implementation 'org.hsluv:hsluv:0.2'
76 implementation 'org.conscrypt:conscrypt-android:2.5.2'
77 implementation 'me.drakeet.support:toastcompat:1.1.0'
78 implementation "com.leinardi.android:speed-dial:3.3.0"
79
80 implementation "com.squareup.retrofit2:retrofit:2.9.0"
81 implementation "com.squareup.retrofit2:converter-gson:2.9.0"
82 implementation "com.squareup.okhttp3:okhttp:4.12.0"
83
84 implementation 'com.google.guava:guava:32.1.3-android'
85 quicksyImplementation 'io.michaelrocks:libphonenumber-android:8.13.28'
86 implementation 'im.conversations.webrtc:webrtc-android:119.0.1'
87}
88
89ext {
90 preDexEnabled = System.getProperty("pre-dex", "true")
91 abiCodes = ['armeabi-v7a': 1, 'x86': 2, 'x86_64': 3, 'arm64-v8a': 4]
92}
93
94android {
95 namespace 'eu.siacs.conversations'
96 compileSdk 34
97
98 defaultConfig {
99 minSdkVersion 23
100 targetSdkVersion 34
101 versionCode 42110
102 versionName "2.15.3"
103 archivesBaseName += "-$versionName"
104 applicationId "eu.siacs.conversations"
105 resValue "string", "applicationId", applicationId
106 def appName = "Conversations"
107 resValue "string", "app_name", appName
108 buildConfigField "String", "APP_NAME", "\"$appName\""
109 }
110
111 splits {
112 abi {
113 universalApk true
114 enable true
115 reset()
116 //noinspection ChromeOsAbiSupport
117 include project.ext.abiCodes.keySet() as String[]
118 }
119 }
120
121 configurations {
122 implementation.exclude group: 'org.jetbrains' , module:'annotations'
123 }
124
125 dataBinding {
126 enabled true
127 }
128
129 compileOptions {
130 coreLibraryDesugaringEnabled true
131 sourceCompatibility JavaVersion.VERSION_17
132 targetCompatibility JavaVersion.VERSION_17
133 }
134
135 flavorDimensions += "mode"
136 flavorDimensions += "distribution"
137
138 productFlavors {
139
140 quicksy {
141 dimension "mode"
142 applicationId = "im.quicksy.client"
143 resValue "string", "applicationId", applicationId
144
145 def appName = "Quicksy"
146 resValue "string", "app_name", appName
147 buildConfigField "String", "APP_NAME", "\"$appName\""
148 buildConfigField "String", "PRIVACY_POLICY", "\"https://quicksy.im/privacy.htm\""
149 }
150
151 conversations {
152 dimension "mode"
153 buildConfigField "String", "PRIVACY_POLICY", "\"https://conversations.im/privacy.html\""
154 }
155
156 playstore {
157 dimension "distribution"
158 versionNameSuffix "+playstore"
159 }
160 free {
161 dimension "distribution"
162 versionNameSuffix "+free"
163 }
164 }
165
166 sourceSets {
167 quicksyFree {
168 java {
169 srcDir 'src/quicksyFree/java'
170 }
171 }
172 quicksyPlaystore {
173 java {
174 srcDir 'src/quicksyPlaystore/java'
175 }
176 res {
177 srcDir 'src/quicksyPlaystore/res'
178 }
179 }
180 conversationsFree {
181 java {
182 srcDir 'src/conversationsFree/java'
183 }
184 }
185 conversationsPlaystore {
186 java {
187 srcDir 'src/conversationsPlaystore/java'
188 }
189 res {
190 srcDir 'src/conversationsPlaystore/res'
191 }
192 }
193 }
194
195 buildTypes {
196 release {
197 shrinkResources true
198 minifyEnabled true
199 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
200 }
201 debug {
202 shrinkResources true
203 minifyEnabled true
204 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
205 }
206 }
207
208
209 if (new File("signing.properties").exists()) {
210 Properties props = new Properties()
211 props.load(new FileInputStream(file("signing.properties")))
212
213 signingConfigs {
214 release {
215 storeFile file(props['keystore'])
216 storePassword props['keystore.password']
217 keyAlias props['keystore.alias']
218 keyPassword props['keystore.password']
219 }
220 }
221 buildTypes.release.signingConfig = signingConfigs.release
222 }
223
224
225 subprojects {
226
227 afterEvaluate {
228 if (getPlugins().hasPlugin('android') ||
229 getPlugins().hasPlugin('android-library')) {
230
231 configure(android.lintOptions) {
232 disable 'AndroidGradlePluginVersion', 'MissingTranslation'
233 }
234 }
235
236 }
237 }
238 packagingOptions {
239 resources {
240 excludes += ['META-INF/BCKEY.DSA', 'META-INF/BCKEY.SF']
241 }
242 }
243 lint {
244 disable 'MissingTranslation', 'InvalidPackage', 'AppCompatResource'
245 }
246 buildFeatures {
247 buildConfig true
248 }
249
250 android.applicationVariants.configureEach { variant ->
251 variant.outputs.each { output ->
252 def baseAbiVersionCode = project.ext.abiCodes.get(output.getFilter(com.android.build.OutputFile.ABI))
253 if (baseAbiVersionCode != null) {
254 output.versionCodeOverride = (100 * project.android.defaultConfig.versionCode) + baseAbiVersionCode
255 } else {
256 output.versionCodeOverride = 100 * project.android.defaultConfig.versionCode
257 }
258 }
259
260 }
261}