1import com.android.build.OutputFile
2
3// Top-level build file where you can add configuration options common to all
4// sub-projects/modules.
5buildscript {
6 repositories {
7 google()
8 mavenCentral()
9 }
10 dependencies {
11 classpath 'com.android.tools.build:gradle:7.0.2'
12 }
13}
14
15apply plugin: 'com.android.application'
16
17repositories {
18 google()
19 mavenCentral()
20 jcenter()
21}
22
23configurations {
24 playstoreImplementation
25 compatImplementation
26 conversationsFreeCompatImplementation
27 conversationsPlaystoreCompatImplementation
28 conversationsPlaystoreSystemImplementation
29 quicksyPlaystoreCompatImplementation
30 quicksyPlaystoreSystemImplementation
31 quicksyFreeCompatImplementation
32 quicksyImplementation
33}
34
35dependencies {
36 implementation 'androidx.viewpager:viewpager:1.0.0'
37
38 playstoreImplementation('com.google.firebase:firebase-messaging:22.0.0') {
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 conversationsPlaystoreCompatImplementation("com.android.installreferrer:installreferrer:2.2")
44 conversationsPlaystoreSystemImplementation("com.android.installreferrer:installreferrer:2.2")
45 quicksyPlaystoreCompatImplementation 'com.google.android.gms:play-services-auth-api-phone:17.5.1'
46 quicksyPlaystoreSystemImplementation 'com.google.android.gms:play-services-auth-api-phone:17.5.1'
47 implementation 'org.sufficientlysecure:openpgp-api:10.0'
48 implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
49 implementation 'androidx.appcompat:appcompat:1.3.1'
50 implementation 'androidx.exifinterface:exifinterface:1.3.3'
51 implementation 'androidx.cardview:cardview:1.0.0'
52 implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
53 implementation 'androidx.emoji:emoji:1.1.0'
54 implementation 'com.google.android.material:material:1.4.0'
55 compatImplementation 'androidx.emoji:emoji-appcompat:1.1.0'
56 conversationsFreeCompatImplementation 'androidx.emoji:emoji-bundled:1.1.0'
57 quicksyFreeCompatImplementation 'androidx.emoji:emoji-bundled:1.1.0'
58 implementation 'org.bouncycastle:bcmail-jdk15on:1.64'
59 //zxing stopped supporting Java 7 so we have to stick with 3.3.3
60 //https://github.com/zxing/zxing/issues/1170
61 implementation 'com.google.zxing:core:3.3.3'
62 implementation 'de.measite.minidns:minidns-hla:0.2.4'
63 implementation 'me.leolin:ShortcutBadger:1.1.22@aar'
64 implementation 'org.whispersystems:signal-protocol-java:2.6.2'
65 implementation 'com.makeramen:roundedimageview:2.3.0'
66 implementation "com.wefika:flowlayout:0.4.1"
67 implementation 'com.otaliastudios:transcoder:0.10.4'
68
69 implementation 'org.jxmpp:jxmpp-jid:1.0.1'
70 implementation 'org.osmdroid:osmdroid-android:6.1.10'
71 implementation 'org.hsluv:hsluv:0.2'
72 implementation 'org.conscrypt:conscrypt-android:2.5.2'
73 implementation 'me.drakeet.support:toastcompat:1.1.0'
74 implementation "com.leinardi.android:speed-dial:2.0.1"
75
76 implementation "com.squareup.retrofit2:retrofit:2.9.0"
77 implementation "com.squareup.retrofit2:converter-gson:2.9.0"
78 implementation "com.squareup.okhttp3:okhttp:4.9.1"
79
80 implementation 'com.google.guava:guava:30.1.1-android'
81 quicksyImplementation 'io.michaelrocks:libphonenumber-android:8.12.18'
82 implementation fileTree(include: ['libwebrtc-m92.aar'], dir: 'libs')
83}
84
85ext {
86 travisBuild = System.getenv("TRAVIS") == "true"
87 preDexEnabled = System.getProperty("pre-dex", "true")
88 abiCodes = ['armeabi-v7a': 1, 'x86': 2, 'x86_64': 3, 'arm64-v8a': 4]
89}
90
91android {
92 compileSdkVersion 29
93
94 defaultConfig {
95 minSdkVersion 21
96 targetSdkVersion 29
97 versionCode 42018
98 versionName "2.10.0"
99 archivesBaseName += "-$versionName"
100 applicationId "eu.siacs.conversations"
101 resValue "string", "applicationId", applicationId
102 def appName = "Conversations"
103 resValue "string", "app_name", appName
104 buildConfigField "String", "APP_NAME", "\"$appName\"";
105 }
106
107 splits {
108 abi {
109 universalApk true
110 enable true
111 }
112 }
113
114 configurations {
115 implementation.exclude group: 'org.jetbrains' , module:'annotations'
116 }
117
118 dataBinding {
119 enabled true
120 }
121
122 compileOptions {
123 sourceCompatibility JavaVersion.VERSION_1_8
124 targetCompatibility JavaVersion.VERSION_1_8
125 }
126
127 flavorDimensions("mode", "distribution", "emoji")
128
129 productFlavors {
130
131 quicksy {
132 dimension "mode"
133 applicationId = "im.quicksy.client"
134 resValue "string", "applicationId", applicationId
135
136 def appName = "Quicksy"
137 resValue "string", "app_name", appName
138 buildConfigField "String", "APP_NAME", "\"$appName\"";
139 }
140
141 conversations {
142 dimension "mode"
143 }
144
145 playstore {
146 dimension "distribution"
147 versionNameSuffix "+p"
148 }
149 free {
150 dimension "distribution"
151 versionNameSuffix "+f"
152 }
153 system {
154 dimension "emoji"
155 versionNameSuffix "s"
156 }
157 compat {
158 dimension "emoji"
159 versionNameSuffix "c"
160 }
161 }
162
163 sourceSets {
164 quicksyFreeSystem {
165 java {
166 srcDir 'src/quicksyFree/java'
167 }
168 }
169 quicksyFreeCompat {
170 java {
171 srcDir 'src/freeCompat/java'
172 srcDir 'src/quicksyFree/java'
173 }
174 }
175 quicksyPlaystoreCompat {
176 java {
177 srcDir 'src/playstoreCompat/java'
178 srcDir 'src/quicksyPlaystore/java'
179 }
180 res {
181 srcDir 'src/playstoreCompat/res'
182 srcDir 'src/quicksyPlaystore/res'
183 }
184 }
185 quicksyPlaystoreSystem {
186 java {
187 srcDir 'src/quicksyPlaystore/java'
188 }
189 res {
190 srcDir 'src/quicksyPlaystore/res'
191 }
192 }
193 conversationsFreeCompat {
194 java {
195 srcDir 'src/freeCompat/java'
196 srcDir 'src/conversationsFree/java'
197 }
198 }
199 conversationsFreeSystem {
200 java {
201 srcDir 'src/conversationsFree/java'
202 }
203 }
204 conversationsPlaystoreCompat {
205 java {
206 srcDir 'src/playstoreCompat/java'
207 srcDir 'src/conversationsPlaystore/java'
208 }
209 res {
210 srcDir 'src/playstoreCompat/res'
211 srcDir 'src/conversationsPlaystore/res'
212 }
213 }
214 conversationsPlaystoreSystem {
215 java {
216 srcDir 'src/conversationsPlaystore/java'
217 }
218 res {
219 srcDir 'src/conversationsPlaystore/res'
220 }
221 }
222 }
223
224 buildTypes {
225 release {
226 shrinkResources true
227 minifyEnabled true
228 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
229 versionNameSuffix "r"
230 }
231 debug {
232 shrinkResources true
233 minifyEnabled true
234 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
235 versionNameSuffix "d"
236 }
237 }
238
239
240 if (new File("signing.properties").exists()) {
241 Properties props = new Properties()
242 props.load(new FileInputStream(file("signing.properties")))
243
244 signingConfigs {
245 release {
246 storeFile file(props['keystore'])
247 storePassword props['keystore.password']
248 keyAlias props['keystore.alias']
249 keyPassword props['keystore.password']
250 }
251 }
252 buildTypes.release.signingConfig = signingConfigs.release
253 }
254
255 lintOptions {
256 disable 'MissingTranslation', 'InvalidPackage','AppCompatResource'
257 }
258
259 subprojects {
260
261 afterEvaluate {
262 if (getPlugins().hasPlugin('android') ||
263 getPlugins().hasPlugin('android-library')) {
264
265 configure(android.lintOptions) {
266 disable 'AndroidGradlePluginVersion', 'MissingTranslation'
267 }
268 }
269
270 }
271 }
272
273 packagingOptions {
274 exclude 'META-INF/BCKEY.DSA'
275 exclude 'META-INF/BCKEY.SF'
276 }
277
278 android.applicationVariants.all { variant ->
279 variant.outputs.each { output ->
280 def baseAbiVersionCode = project.ext.abiCodes.get(output.getFilter(OutputFile.ABI))
281 if (baseAbiVersionCode != null) {
282 output.versionCodeOverride = (100 * variant.versionCode) + baseAbiVersionCode
283 }
284 }
285
286 }
287}