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