2021-01-21 15:42:43 +11:00
|
|
|
buildscript {
|
|
|
|
repositories {
|
|
|
|
google()
|
|
|
|
mavenCentral()
|
|
|
|
}
|
|
|
|
dependencies {
|
2021-05-13 10:31:06 +10:00
|
|
|
classpath 'com.android.tools.build:gradle:4.1.3'
|
2021-01-21 15:42:43 +11:00
|
|
|
classpath files('libs/gradle-witness.jar')
|
2021-05-18 13:27:51 +10:00
|
|
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
|
|
|
|
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlinVersion"
|
2021-01-21 15:42:43 +11:00
|
|
|
classpath "com.google.gms:google-services:4.3.3"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-24 13:10:39 +11:00
|
|
|
apply plugin: 'com.android.application'
|
|
|
|
apply plugin: 'kotlin-android'
|
|
|
|
apply plugin: 'kotlin-android-extensions'
|
|
|
|
apply plugin: 'witness'
|
|
|
|
apply plugin: 'kotlin-kapt'
|
|
|
|
apply plugin: 'com.google.gms.google-services'
|
2021-01-21 15:42:43 +11:00
|
|
|
apply plugin: 'kotlinx-serialization'
|
2020-11-24 13:10:39 +11:00
|
|
|
|
|
|
|
configurations.all {
|
|
|
|
exclude module: "commons-logging"
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
implementation 'androidx.appcompat:appcompat:1.2.0'
|
|
|
|
implementation 'androidx.recyclerview:recyclerview:1.1.0'
|
|
|
|
implementation 'com.google.android.material:material:1.2.1'
|
|
|
|
implementation 'androidx.legacy:legacy-support-v13:1.0.0'
|
|
|
|
implementation 'androidx.cardview:cardview:1.0.0'
|
|
|
|
implementation 'androidx.preference:preference:1.1.1'
|
|
|
|
implementation 'androidx.legacy:legacy-preference-v14:1.0.0'
|
|
|
|
implementation 'androidx.gridlayout:gridlayout:1.0.0'
|
|
|
|
implementation 'androidx.exifinterface:exifinterface:1.2.0'
|
|
|
|
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
|
|
|
|
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
|
2021-04-20 17:23:02 +10:00
|
|
|
implementation 'androidx.lifecycle:lifecycle-common-java8:2.3.1'
|
|
|
|
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
|
|
|
|
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1'
|
|
|
|
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
|
|
|
|
implementation 'androidx.activity:activity-ktx:1.2.2'
|
|
|
|
implementation 'androidx.fragment:fragment-ktx:1.3.2'
|
2020-11-24 13:10:39 +11:00
|
|
|
implementation "androidx.core:core-ktx:1.3.2"
|
|
|
|
implementation "androidx.work:work-runtime-ktx:2.4.0"
|
|
|
|
implementation ("com.google.firebase:firebase-messaging:18.0.0") {
|
|
|
|
exclude group: 'com.google.firebase', module: 'firebase-core'
|
|
|
|
exclude group: 'com.google.firebase', module: 'firebase-analytics'
|
|
|
|
exclude group: 'com.google.firebase', module: 'firebase-measurement-connector'
|
|
|
|
}
|
|
|
|
implementation 'com.google.android.exoplayer:exoplayer-core:2.9.1'
|
|
|
|
implementation 'com.google.android.exoplayer:exoplayer-ui:2.9.1'
|
|
|
|
implementation 'org.conscrypt:conscrypt-android:2.0.0'
|
|
|
|
implementation 'org.signal:aesgcmprovider:0.0.3'
|
|
|
|
implementation 'org.whispersystems:webrtc-android:M74'
|
|
|
|
implementation "me.leolin:ShortcutBadger:1.1.16"
|
|
|
|
implementation 'se.emilsjolander:stickylistheaders:2.7.0'
|
|
|
|
implementation 'com.jpardogo.materialtabstrip:library:1.0.9'
|
|
|
|
implementation 'org.apache.httpcomponents:httpclient-android:4.3.5'
|
2021-02-01 09:39:14 +11:00
|
|
|
implementation 'commons-net:commons-net:3.7.2'
|
2020-11-24 13:10:39 +11:00
|
|
|
implementation 'com.github.chrisbanes:PhotoView:2.1.3'
|
|
|
|
implementation 'com.github.bumptech.glide:glide:4.11.0'
|
|
|
|
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
|
|
|
|
kapt 'com.github.bumptech.glide:compiler:4.11.0'
|
|
|
|
implementation 'com.makeramen:roundedimageview:2.1.0'
|
|
|
|
implementation 'com.pnikosis:materialish-progress:1.5'
|
|
|
|
implementation 'org.greenrobot:eventbus:3.0.0'
|
|
|
|
implementation 'pl.tajchert:waitingdots:0.1.0'
|
|
|
|
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
|
|
|
|
implementation 'com.melnykov:floatingactionbutton:1.3.0'
|
|
|
|
implementation 'com.google.zxing:android-integration:3.1.0'
|
|
|
|
implementation 'com.squareup.dagger:dagger:1.2.2'
|
|
|
|
annotationProcessor 'com.squareup.dagger:dagger-compiler:1.2.2'
|
2021-01-18 14:58:11 +11:00
|
|
|
kapt 'com.squareup.dagger:dagger-compiler:1.2.2'
|
2020-11-24 13:10:39 +11:00
|
|
|
implementation 'mobi.upod:time-duration-picker:1.1.3'
|
|
|
|
implementation 'com.google.zxing:core:3.2.1'
|
|
|
|
implementation ('com.davemorrissey.labs:subsampling-scale-image-view:3.6.0') {
|
|
|
|
exclude group: 'com.android.support', module: 'support-annotations'
|
|
|
|
}
|
|
|
|
implementation ('cn.carbswang.android:NumberPickerView:1.0.9') {
|
|
|
|
exclude group: 'com.android.support', module: 'appcompat-v7'
|
|
|
|
}
|
|
|
|
implementation ('com.tomergoldst.android:tooltips:1.0.6') {
|
|
|
|
exclude group: 'com.android.support', module: 'appcompat-v7'
|
|
|
|
}
|
|
|
|
implementation ('com.klinkerapps:android-smsmms:4.0.1') {
|
|
|
|
exclude group: 'com.squareup.okhttp', module: 'okhttp'
|
|
|
|
exclude group: 'com.squareup.okhttp', module: 'okhttp-urlconnection'
|
|
|
|
}
|
|
|
|
implementation 'com.annimon:stream:1.1.8'
|
|
|
|
implementation ('com.takisoft.fix:colorpicker:0.9.1') {
|
|
|
|
exclude group: 'com.android.support', module: 'appcompat-v7'
|
|
|
|
exclude group: 'com.android.support', module: 'recyclerview-v7'
|
|
|
|
}
|
|
|
|
implementation 'com.codewaves.stickyheadergrid:stickyheadergrid:0.9.4'
|
|
|
|
implementation 'com.github.dmytrodanylyk.circular-progress-button:library:1.1.3-S2'
|
2021-07-29 17:02:58 +10:00
|
|
|
implementation 'org.signal:android-database-sqlcipher:3.5.9-S3'
|
2020-11-24 13:10:39 +11:00
|
|
|
implementation ('com.googlecode.ez-vcard:ez-vcard:0.9.11') {
|
|
|
|
exclude group: 'com.fasterxml.jackson.core'
|
|
|
|
exclude group: 'org.freemarker'
|
|
|
|
}
|
2020-11-26 10:07:45 +11:00
|
|
|
implementation project(":libsignal")
|
|
|
|
implementation project(":libsession")
|
2021-01-21 15:42:43 +11:00
|
|
|
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.0.1"
|
2020-11-24 15:22:02 +11:00
|
|
|
implementation "org.whispersystems:curve25519-java:$curve25519Version"
|
2021-05-19 15:12:35 +10:00
|
|
|
implementation 'com.goterl:lazysodium-android:5.0.2@aar'
|
|
|
|
implementation "net.java.dev.jna:jna:5.8.0@aar"
|
2020-11-24 15:22:02 +11:00
|
|
|
implementation "com.google.protobuf:protobuf-java:$protobufVersion"
|
|
|
|
implementation "com.fasterxml.jackson.core:jackson-databind:$jacksonDatabindVersion"
|
|
|
|
implementation "com.squareup.okhttp3:okhttp:$okhttpVersion"
|
2021-05-18 14:45:37 +10:00
|
|
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
|
2021-03-01 17:16:15 +11:00
|
|
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.2"
|
2020-11-24 15:22:02 +11:00
|
|
|
implementation "nl.komponents.kovenant:kovenant:$kovenantVersion"
|
|
|
|
implementation "nl.komponents.kovenant:kovenant-android:$kovenantVersion"
|
2020-11-24 13:10:39 +11:00
|
|
|
implementation "com.github.lelloman:android-identicons:v11"
|
|
|
|
implementation "com.prof.rssparser:rssparser:2.0.4"
|
|
|
|
implementation "com.jakewharton.rxbinding3:rxbinding:3.1.0"
|
|
|
|
implementation "com.github.tbruyelle:rxpermissions:0.10.2"
|
|
|
|
implementation "com.github.ybq:Android-SpinKit:1.4.0"
|
|
|
|
implementation "com.opencsv:opencsv:4.6"
|
|
|
|
testImplementation 'junit:junit:4.12'
|
|
|
|
testImplementation 'org.assertj:assertj-core:3.11.1'
|
2020-11-24 18:49:34 +11:00
|
|
|
testImplementation 'org.mockito:mockito-core:1.10.8'
|
2020-11-24 13:10:39 +11:00
|
|
|
testImplementation 'org.powermock:powermock-api-mockito:1.6.1'
|
|
|
|
testImplementation 'org.powermock:powermock-module-junit4:1.6.1'
|
|
|
|
testImplementation 'org.powermock:powermock-module-junit4-rule:1.6.1'
|
|
|
|
testImplementation 'org.powermock:powermock-classloading-xstream:1.6.1'
|
|
|
|
testImplementation 'androidx.test:core:1.3.0'
|
|
|
|
androidTestImplementation 'androidx.multidex:multidex:2.0.1'
|
|
|
|
androidTestImplementation 'androidx.multidex:multidex-instrumentation:2.0.0'
|
|
|
|
androidTestImplementation 'com.google.dexmaker:dexmaker:1.2'
|
|
|
|
androidTestImplementation 'com.google.dexmaker:dexmaker-mockito:1.2'
|
|
|
|
androidTestImplementation ('org.assertj:assertj-core:1.7.1') {
|
|
|
|
exclude group: 'org.hamcrest', module: 'hamcrest-core'
|
|
|
|
}
|
|
|
|
androidTestImplementation ('com.squareup.assertj:assertj-android:1.1.1') {
|
|
|
|
exclude group: 'org.hamcrest', module: 'hamcrest-core'
|
|
|
|
exclude group: 'com.android.support', module: 'support-annotations'
|
|
|
|
}
|
2020-11-24 18:49:34 +11:00
|
|
|
testImplementation 'org.robolectric:robolectric:4.2.1'
|
2020-11-24 13:10:39 +11:00
|
|
|
testImplementation 'org.robolectric:shadows-multidex:4.2'
|
|
|
|
}
|
|
|
|
|
2021-08-02 16:59:55 +10:00
|
|
|
def canonicalVersionCode = 214
|
2021-07-30 13:52:36 +10:00
|
|
|
def canonicalVersionName = "1.11.7"
|
2020-11-24 13:10:39 +11:00
|
|
|
|
2020-12-08 18:17:49 +11:00
|
|
|
def postFixSize = 10
|
|
|
|
def abiPostFix = ['armeabi-v7a' : 1,
|
|
|
|
'arm64-v8a' : 2,
|
|
|
|
'x86' : 3,
|
|
|
|
'x86_64' : 4,
|
|
|
|
'universal' : 5]
|
|
|
|
|
2020-11-24 13:10:39 +11:00
|
|
|
android {
|
2021-05-18 14:08:21 +10:00
|
|
|
compileSdkVersion androidCompileSdkVersion
|
2021-01-18 14:58:11 +11:00
|
|
|
buildToolsVersion '29.0.3'
|
2020-11-24 13:10:39 +11:00
|
|
|
useLibrary 'org.apache.http.legacy'
|
|
|
|
|
|
|
|
dexOptions {
|
|
|
|
javaMaxHeapSize "4g"
|
|
|
|
}
|
|
|
|
|
2020-12-08 18:17:49 +11:00
|
|
|
compileOptions {
|
|
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
|
|
}
|
|
|
|
|
|
|
|
kotlinOptions {
|
|
|
|
jvmTarget = '1.8'
|
|
|
|
}
|
|
|
|
|
|
|
|
packagingOptions {
|
|
|
|
exclude 'LICENSE.txt'
|
|
|
|
exclude 'LICENSE'
|
|
|
|
exclude 'NOTICE'
|
|
|
|
exclude 'asm-license.txt'
|
|
|
|
exclude 'META-INF/LICENSE'
|
|
|
|
exclude 'META-INF/NOTICE'
|
|
|
|
exclude 'META-INF/proguard/androidx-annotations.pro'
|
|
|
|
}
|
|
|
|
|
|
|
|
splits {
|
|
|
|
abi {
|
|
|
|
enable true
|
|
|
|
reset()
|
|
|
|
include 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
|
|
|
universalApk true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-24 13:10:39 +11:00
|
|
|
defaultConfig {
|
2020-12-08 18:17:49 +11:00
|
|
|
versionCode canonicalVersionCode * postFixSize
|
2020-11-24 13:10:39 +11:00
|
|
|
versionName canonicalVersionName
|
|
|
|
|
2021-07-01 17:06:42 +10:00
|
|
|
minSdkVersion androidMinimumSdkVersion
|
|
|
|
targetSdkVersion androidCompileSdkVersion
|
2020-11-24 15:22:02 +11:00
|
|
|
|
2021-05-18 13:34:40 +10:00
|
|
|
multiDexEnabled = true
|
2020-11-24 13:10:39 +11:00
|
|
|
|
|
|
|
vectorDrawables.useSupportLibrary = true
|
|
|
|
project.ext.set("archivesBaseName", "session")
|
|
|
|
|
|
|
|
buildConfigField "long", "BUILD_TIMESTAMP", getLastCommitTimestamp() + "L"
|
|
|
|
buildConfigField "String", "CONTENT_PROXY_HOST", "\"contentproxy.signal.org\""
|
|
|
|
buildConfigField "int", "CONTENT_PROXY_PORT", "443"
|
|
|
|
buildConfigField "String", "USER_AGENT", "\"OWA\""
|
|
|
|
buildConfigField "String[]", "LANGUAGES", "new String[]{\"" + autoResConfig().collect { s -> s.replace('-r', '_') }.join('", "') + '"}'
|
|
|
|
buildConfigField "int", "CANONICAL_VERSION_CODE", "$canonicalVersionCode"
|
|
|
|
|
|
|
|
resConfigs autoResConfig()
|
|
|
|
}
|
|
|
|
|
|
|
|
buildTypes {
|
|
|
|
release {
|
2021-03-16 11:45:02 +11:00
|
|
|
minifyEnabled false
|
2020-12-01 16:38:41 +11:00
|
|
|
}
|
|
|
|
debug {
|
|
|
|
minifyEnabled false
|
2020-11-24 13:10:39 +11:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-08 18:17:49 +11:00
|
|
|
flavorDimensions "distribution"
|
2020-11-24 13:10:39 +11:00
|
|
|
productFlavors {
|
|
|
|
play {
|
|
|
|
ext.websiteUpdateUrl = "null"
|
|
|
|
buildConfigField "boolean", "PLAY_STORE_DISABLED", "false"
|
|
|
|
buildConfigField "String", "NOPLAY_UPDATE_URL", "$ext.websiteUpdateUrl"
|
|
|
|
}
|
|
|
|
|
|
|
|
website {
|
2021-05-18 13:34:40 +10:00
|
|
|
ext.websiteUpdateUrl = "https://github.com/oxen-io/session-android/releases"
|
2020-11-24 13:10:39 +11:00
|
|
|
buildConfigField "boolean", "PLAY_STORE_DISABLED", "true"
|
|
|
|
buildConfigField "String", "NOPLAY_UPDATE_URL", "\"$ext.websiteUpdateUrl\""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-08 18:17:49 +11:00
|
|
|
applicationVariants.all { variant ->
|
2020-11-24 13:10:39 +11:00
|
|
|
variant.outputs.each { output ->
|
|
|
|
output.outputFileName = output.outputFileName.replace(".apk", "-${variant.versionName}.apk")
|
2020-12-08 18:17:49 +11:00
|
|
|
def abiName = output.getFilter("ABI") ?: 'universal'
|
|
|
|
def postFix = abiPostFix.get(abiName, 0)
|
|
|
|
|
|
|
|
if (postFix >= postFixSize) throw new AssertionError("postFix is too large")
|
|
|
|
|
|
|
|
output.versionCodeOverride = canonicalVersionCode * postFixSize + postFix
|
2020-11-24 13:10:39 +11:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
lintOptions {
|
|
|
|
abortOnError true
|
|
|
|
baseline file("lint-baseline.xml")
|
|
|
|
}
|
|
|
|
|
|
|
|
testOptions {
|
|
|
|
unitTests {
|
|
|
|
includeAndroidResources = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
buildFeatures {
|
|
|
|
dataBinding true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-18 13:34:40 +10:00
|
|
|
static def getLastCommitTimestamp() {
|
2020-11-24 13:10:39 +11:00
|
|
|
new ByteArrayOutputStream().withStream { os ->
|
|
|
|
return os.toString() + "000"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Discovers supported languages listed as under the res/values- directory.
|
|
|
|
*/
|
|
|
|
def autoResConfig() {
|
|
|
|
def files = new ArrayList<String>()
|
2020-11-24 18:49:34 +11:00
|
|
|
def root = file("src/main/res")
|
2020-11-24 13:10:39 +11:00
|
|
|
root.eachFile { f -> files.add(f.name) }
|
|
|
|
['en'] + files.collect { f -> f =~ /^values-([a-z]{2}(-r[A-Z]{2})?)$/ }
|
|
|
|
.findAll { matcher -> matcher.find() }
|
|
|
|
.collect { matcher -> matcher.group(1) }
|
|
|
|
.sort()
|
|
|
|
}
|