build.gradle

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