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