2013-10-10 20:52:24 +00:00
|
|
|
buildscript {
|
2020-09-06 23:43:01 +00:00
|
|
|
ext.kotlin_version = "1.4.0"
|
2019-06-07 05:21:25 +00:00
|
|
|
ext.kovenant_version = "3.3.0"
|
|
|
|
|
2013-10-10 20:52:24 +00:00
|
|
|
repositories {
|
2020-01-29 23:02:16 +00:00
|
|
|
mavenLocal()
|
2019-03-18 19:59:21 +00:00
|
|
|
google()
|
2019-05-31 04:26:14 +00:00
|
|
|
mavenCentral()
|
2020-09-06 23:43:01 +00:00
|
|
|
jcenter()
|
2013-10-10 20:52:24 +00:00
|
|
|
}
|
|
|
|
dependencies {
|
2020-09-06 23:43:01 +00:00
|
|
|
classpath "com.android.tools.build:gradle:4.0.1"
|
2014-06-05 17:16:36 +00:00
|
|
|
classpath files('libs/gradle-witness.jar')
|
2019-05-29 04:25:19 +00:00
|
|
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
2020-08-19 00:18:02 +00:00
|
|
|
classpath "com.google.gms:google-services:4.3.3"
|
2013-10-10 20:52:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-07-23 22:40:45 +00:00
|
|
|
apply plugin: 'com.android.application'
|
2019-05-29 04:25:19 +00:00
|
|
|
apply plugin: 'kotlin-android'
|
2020-09-06 23:43:01 +00:00
|
|
|
apply plugin: 'kotlin-android-extensions'
|
2014-06-05 17:16:36 +00:00
|
|
|
apply plugin: 'witness'
|
2019-12-19 10:15:58 +00:00
|
|
|
apply plugin: 'kotlin-kapt'
|
2020-04-15 00:24:30 +00:00
|
|
|
apply plugin: 'com.google.gms.google-services'
|
2013-10-10 20:52:24 +00:00
|
|
|
|
|
|
|
repositories {
|
2019-07-17 01:40:30 +00:00
|
|
|
mavenLocal()
|
2016-12-15 19:34:46 +00:00
|
|
|
maven {
|
2018-03-08 10:06:21 +00:00
|
|
|
url "https://raw.github.com/signalapp/maven/master/photoview/releases/"
|
2019-01-26 02:23:00 +00:00
|
|
|
content {
|
|
|
|
includeGroupByRegex "com\\.github\\.chrisbanes.*"
|
|
|
|
}
|
2016-12-15 19:34:46 +00:00
|
|
|
}
|
2017-01-23 06:45:58 +00:00
|
|
|
maven {
|
2018-03-08 10:06:21 +00:00
|
|
|
url "https://raw.github.com/signalapp/maven/master/shortcutbadger/releases/"
|
2019-01-26 02:23:00 +00:00
|
|
|
content {
|
|
|
|
includeGroupByRegex "me\\.leolin.*"
|
|
|
|
}
|
2017-01-23 06:45:58 +00:00
|
|
|
}
|
2017-11-06 23:52:18 +00:00
|
|
|
maven {
|
2018-03-08 10:06:21 +00:00
|
|
|
url "https://raw.github.com/signalapp/maven/master/circular-progress-button/releases/"
|
2019-01-26 02:23:00 +00:00
|
|
|
content {
|
|
|
|
includeGroupByRegex "com\\.github\\.dmytrodanylyk\\.circular-progress-button\\.*"
|
|
|
|
}
|
2017-11-06 23:52:18 +00:00
|
|
|
}
|
2018-04-07 01:15:24 +00:00
|
|
|
maven {
|
|
|
|
url "https://raw.github.com/signalapp/maven/master/sqlcipher/release/"
|
2019-01-26 02:23:00 +00:00
|
|
|
content {
|
|
|
|
includeGroupByRegex "org\\.signal.*"
|
|
|
|
}
|
2017-09-21 01:10:44 +00:00
|
|
|
}
|
2015-05-04 18:36:18 +00:00
|
|
|
maven { // textdrawable
|
|
|
|
url 'https://dl.bintray.com/amulyakhare/maven'
|
2019-01-26 02:23:00 +00:00
|
|
|
content {
|
|
|
|
includeGroupByRegex "com\\.amulyakhare.*"
|
|
|
|
}
|
2015-05-04 18:36:18 +00:00
|
|
|
}
|
2020-10-28 23:56:21 +00:00
|
|
|
maven {
|
|
|
|
url "https://dl.bintray.com/terl/lazysodium-maven"
|
|
|
|
content {
|
|
|
|
includeGroupByRegex "com\\.goterl\\.lazycode.*"
|
|
|
|
}
|
|
|
|
}
|
2018-10-24 23:57:19 +00:00
|
|
|
google()
|
2015-01-24 04:38:45 +00:00
|
|
|
jcenter()
|
2019-09-06 04:00:36 +00:00
|
|
|
maven { url "https://jitpack.io" }
|
2013-10-10 20:52:24 +00:00
|
|
|
}
|
|
|
|
|
2019-05-31 03:36:22 +00:00
|
|
|
configurations.all {
|
|
|
|
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
|
2020-01-29 23:02:16 +00:00
|
|
|
exclude group: "org.whispersystems", module: "signal-protocol-java"
|
|
|
|
exclude group: "org.whispersystems", module: "signal-protocol-android"
|
|
|
|
exclude group: "org.signal", module: "signal-metadata-java"
|
|
|
|
exclude group: "org.signal", module: "signal-metadata-android"
|
2020-06-04 11:36:22 +00:00
|
|
|
exclude module: "commons-logging"
|
2019-05-31 03:36:22 +00:00
|
|
|
}
|
|
|
|
|
2013-10-10 20:52:24 +00:00
|
|
|
dependencies {
|
2020-08-19 00:42:46 +00:00
|
|
|
implementation 'androidx.appcompat:appcompat:1.2.0'
|
|
|
|
implementation 'androidx.recyclerview:recyclerview:1.1.0'
|
2020-09-06 23:43:01 +00:00
|
|
|
implementation 'com.google.android.material:material:1.2.1'
|
2020-08-19 00:06:26 +00:00
|
|
|
implementation 'androidx.legacy:legacy-support-v13:1.0.0'
|
|
|
|
implementation 'androidx.cardview:cardview:1.0.0'
|
2020-08-19 00:42:46 +00:00
|
|
|
implementation 'androidx.preference:preference:1.1.1'
|
2020-08-19 00:06:26 +00:00
|
|
|
implementation 'androidx.legacy:legacy-preference-v14:1.0.0'
|
|
|
|
implementation 'androidx.gridlayout:gridlayout:1.0.0'
|
2020-08-19 00:42:46 +00:00
|
|
|
implementation 'androidx.exifinterface:exifinterface:1.2.0'
|
2020-09-06 23:43:01 +00:00
|
|
|
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
|
2020-09-05 21:00:41 +00:00
|
|
|
implementation 'androidx.multidex:multidex:2.0.1'
|
2020-08-19 00:42:46 +00:00
|
|
|
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
|
|
|
|
implementation 'androidx.lifecycle:lifecycle-common-java8:2.2.0'
|
2020-11-12 02:02:38 +00:00
|
|
|
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0'
|
2020-11-20 07:59:13 +00:00
|
|
|
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.2.0'
|
2020-11-12 15:05:26 +00:00
|
|
|
implementation 'androidx.activity:activity-ktx:1.1.0'
|
|
|
|
implementation 'androidx.fragment:fragment-ktx:1.3.0-beta01'
|
2020-11-20 07:59:13 +00:00
|
|
|
implementation "androidx.core:core-ktx:1.3.2"
|
2020-11-24 00:18:47 +00:00
|
|
|
implementation "androidx.work:work-runtime-ktx:2.4.0"
|
2019-06-03 06:25:02 +00:00
|
|
|
|
2020-08-19 00:18:02 +00:00
|
|
|
implementation ("com.google.firebase:firebase-messaging:18.0.0") {
|
2020-06-09 05:24:28 +00:00
|
|
|
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'
|
2020-06-04 04:17:44 +00:00
|
|
|
}
|
2019-06-03 06:25:02 +00:00
|
|
|
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'
|
|
|
|
implementation 'com.github.chrisbanes:PhotoView:2.1.3'
|
2020-08-19 00:06:26 +00:00
|
|
|
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'
|
2019-06-03 06:25:02 +00:00
|
|
|
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'
|
2020-09-06 23:43:01 +00:00
|
|
|
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
|
2019-06-03 06:25:02 +00:00
|
|
|
implementation 'com.melnykov:floatingactionbutton:1.3.0'
|
|
|
|
implementation 'com.google.zxing:android-integration:3.1.0'
|
|
|
|
implementation 'com.squareup.dagger:dagger:1.2.2'
|
2017-11-06 17:20:52 +00:00
|
|
|
annotationProcessor 'com.squareup.dagger:dagger-compiler:1.2.2'
|
2019-06-03 06:25:02 +00:00
|
|
|
implementation 'mobi.upod:time-duration-picker:1.1.3'
|
2019-01-26 02:23:00 +00:00
|
|
|
compileOnly 'com.squareup.dagger:dagger-compiler:1.2.2'
|
2019-06-03 06:25:02 +00:00
|
|
|
implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
|
|
|
|
implementation 'com.google.zxing:core:3.2.1'
|
|
|
|
implementation ('com.davemorrissey.labs:subsampling-scale-image-view:3.6.0') {
|
2016-12-14 18:21:14 +00:00
|
|
|
exclude group: 'com.android.support', module: 'support-annotations'
|
|
|
|
}
|
2019-06-03 06:25:02 +00:00
|
|
|
implementation ('cn.carbswang.android:NumberPickerView:1.0.9') {
|
2016-08-16 03:23:56 +00:00
|
|
|
exclude group: 'com.android.support', module: 'appcompat-v7'
|
|
|
|
}
|
2019-06-03 06:25:02 +00:00
|
|
|
implementation ('com.tomergoldst.android:tooltips:1.0.6') {
|
2017-02-11 19:05:53 +00:00
|
|
|
exclude group: 'com.android.support', module: 'appcompat-v7'
|
|
|
|
}
|
2019-06-03 06:25:02 +00:00
|
|
|
implementation ('com.klinkerapps:android-smsmms:4.0.1') {
|
2017-05-08 22:32:59 +00:00
|
|
|
exclude group: 'com.squareup.okhttp', module: 'okhttp'
|
|
|
|
exclude group: 'com.squareup.okhttp', module: 'okhttp-urlconnection'
|
|
|
|
}
|
2019-06-03 06:25:02 +00:00
|
|
|
implementation 'com.annimon:stream:1.1.8'
|
|
|
|
implementation ('com.takisoft.fix:colorpicker:0.9.1') {
|
2017-09-21 01:10:44 +00:00
|
|
|
exclude group: 'com.android.support', module: 'appcompat-v7'
|
|
|
|
exclude group: 'com.android.support', module: 'recyclerview-v7'
|
|
|
|
}
|
2019-06-03 06:25:02 +00:00
|
|
|
implementation 'com.codewaves.stickyheadergrid:stickyheadergrid:0.9.4'
|
|
|
|
implementation 'com.github.dmytrodanylyk.circular-progress-button:library:1.1.3-S2'
|
|
|
|
implementation 'org.signal:android-database-sqlcipher:3.5.9-S3'
|
|
|
|
implementation ('com.googlecode.ez-vcard:ez-vcard:0.9.11') {
|
2018-05-17 06:40:14 +00:00
|
|
|
exclude group: 'com.fasterxml.jackson.core'
|
|
|
|
exclude group: 'org.freemarker'
|
|
|
|
}
|
2020-09-06 23:43:01 +00:00
|
|
|
// Loki
|
|
|
|
// Local:
|
|
|
|
implementation "org.whispersystems:signal-service-android:2.13.2" // Run ./gradlew install from session-android-service to install
|
|
|
|
implementation "org.whispersystems:curve25519-java:0.5.0"
|
|
|
|
// Remote:
|
2020-10-28 23:56:21 +00:00
|
|
|
implementation "com.goterl.lazycode:lazysodium-android:4.2.0@aar"
|
|
|
|
implementation "net.java.dev.jna:jna:5.5.0@aar"
|
2020-09-06 23:43:01 +00:00
|
|
|
implementation "com.google.protobuf:protobuf-java:2.5.0"
|
|
|
|
implementation "com.fasterxml.jackson.core:jackson-databind:2.9.8"
|
|
|
|
implementation "com.squareup.okhttp3:okhttp:3.12.1"
|
|
|
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
2020-10-08 04:32:47 +00:00
|
|
|
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9'
|
2020-09-06 23:43:01 +00:00
|
|
|
implementation "nl.komponents.kovenant:kovenant:$kovenant_version"
|
|
|
|
implementation "nl.komponents.kovenant:kovenant-android:$kovenant_version"
|
|
|
|
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"
|
2016-08-16 03:23:56 +00:00
|
|
|
|
2019-01-26 02:23:00 +00:00
|
|
|
testImplementation 'junit:junit:4.12'
|
2019-03-11 19:40:26 +00:00
|
|
|
testImplementation 'org.assertj:assertj-core:3.11.1'
|
2019-01-26 02:23:00 +00:00
|
|
|
testImplementation 'org.mockito:mockito-core:1.9.5'
|
|
|
|
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'
|
2020-09-06 23:43:01 +00:00
|
|
|
testImplementation 'androidx.test:core:1.3.0'
|
2020-09-05 21:00:41 +00:00
|
|
|
androidTestImplementation 'androidx.multidex:multidex:2.0.1'
|
|
|
|
androidTestImplementation 'androidx.multidex:multidex-instrumentation:2.0.0'
|
2019-01-26 02:23:00 +00:00
|
|
|
androidTestImplementation 'com.google.dexmaker:dexmaker:1.2'
|
|
|
|
androidTestImplementation 'com.google.dexmaker:dexmaker-mockito:1.2'
|
|
|
|
androidTestImplementation ('org.assertj:assertj-core:1.7.1') {
|
2014-12-31 00:49:57 +00:00
|
|
|
exclude group: 'org.hamcrest', module: 'hamcrest-core'
|
|
|
|
}
|
2019-01-26 02:23:00 +00:00
|
|
|
androidTestImplementation ('com.squareup.assertj:assertj-android:1.1.1') {
|
2015-06-02 04:44:10 +00:00
|
|
|
exclude group: 'org.hamcrest', module: 'hamcrest-core'
|
|
|
|
exclude group: 'com.android.support', module: 'support-annotations'
|
|
|
|
}
|
2019-03-11 19:40:26 +00:00
|
|
|
testImplementation 'org.robolectric:robolectric:4.2'
|
|
|
|
testImplementation 'org.robolectric:shadows-multidex:4.2'
|
2013-10-10 20:52:24 +00:00
|
|
|
}
|
|
|
|
|
2020-11-12 23:55:14 +00:00
|
|
|
def canonicalVersionCode = 121
|
2020-11-04 06:09:21 +00:00
|
|
|
def canonicalVersionName = "1.6.4"
|
2019-05-28 22:57:06 +00:00
|
|
|
|
|
|
|
def postFixSize = 10
|
|
|
|
def abiPostFix = ['armeabi-v7a' : 1,
|
|
|
|
'arm64-v8a' : 2,
|
|
|
|
'x86' : 3,
|
|
|
|
'x86_64' : 4,
|
|
|
|
'universal' : 5]
|
2019-05-01 16:00:26 +00:00
|
|
|
|
2013-10-10 20:52:24 +00:00
|
|
|
android {
|
2017-11-06 17:20:52 +00:00
|
|
|
flavorDimensions "none"
|
2020-08-19 00:06:26 +00:00
|
|
|
compileSdkVersion 29
|
2020-10-22 06:33:30 +00:00
|
|
|
buildToolsVersion '29.0.3'
|
2016-12-11 21:37:22 +00:00
|
|
|
useLibrary 'org.apache.http.legacy'
|
2013-10-10 20:52:24 +00:00
|
|
|
|
2015-02-12 18:30:45 +00:00
|
|
|
dexOptions {
|
|
|
|
javaMaxHeapSize "4g"
|
|
|
|
}
|
|
|
|
|
2013-10-10 20:52:24 +00:00
|
|
|
defaultConfig {
|
2019-05-28 22:57:06 +00:00
|
|
|
versionCode canonicalVersionCode * postFixSize
|
|
|
|
versionName canonicalVersionName
|
2017-02-26 22:36:43 +00:00
|
|
|
|
2019-07-22 02:13:53 +00:00
|
|
|
minSdkVersion 21
|
2020-08-19 00:06:26 +00:00
|
|
|
targetSdkVersion 29
|
2020-09-06 23:43:01 +00:00
|
|
|
multiDexEnabled true // Even though we're running API 21+, this is still needed for release builds
|
2015-01-12 04:27:34 +00:00
|
|
|
|
2016-11-22 02:58:10 +00:00
|
|
|
vectorDrawables.useSupportLibrary = true
|
2020-09-06 23:43:01 +00:00
|
|
|
project.ext.set("archivesBaseName", "session")
|
2016-11-22 02:58:10 +00:00
|
|
|
|
2016-02-17 19:27:35 +00:00
|
|
|
buildConfigField "long", "BUILD_TIMESTAMP", getLastCommitTimestamp() + "L"
|
2020-02-01 01:30:56 +00:00
|
|
|
buildConfigField "String", "SIGNAL_URL", "\"\""
|
|
|
|
buildConfigField "String", "SIGNAL_CDN_URL", "\"\""
|
|
|
|
buildConfigField "String", "SIGNAL_CONTACT_DISCOVERY_URL", "\"\""
|
|
|
|
buildConfigField "String", "SIGNAL_SERVICE_STATUS_URL", "\"\""
|
2019-01-15 08:41:05 +00:00
|
|
|
buildConfigField "String", "CONTENT_PROXY_HOST", "\"contentproxy.signal.org\""
|
|
|
|
buildConfigField "int", "CONTENT_PROXY_PORT", "443"
|
2015-09-09 20:54:29 +00:00
|
|
|
buildConfigField "String", "USER_AGENT", "\"OWA\""
|
2015-05-21 19:30:18 +00:00
|
|
|
buildConfigField "boolean", "DEV_BUILD", "false"
|
2018-07-18 15:27:05 +00:00
|
|
|
buildConfigField "String", "MRENCLAVE", "\"cd6cfc342937b23b1bdd3bbf9721aa5615ac9ff50a75c5527d441cd3276826c9\""
|
2018-10-11 23:45:22 +00:00
|
|
|
buildConfigField "String", "UNIDENTIFIED_SENDER_TRUST_ROOT", "\"BXu6QIKVz5MA8gstzfOgRQGqyLqOwNKHL6INkv3IHWMF\""
|
2019-03-14 16:33:43 +00:00
|
|
|
buildConfigField "String[]", "LANGUAGES", "new String[]{\"" + autoResConfig().collect { s -> s.replace('-r', '_') }.join('", "') + '"}'
|
2019-05-28 22:57:06 +00:00
|
|
|
buildConfigField "int", "CANONICAL_VERSION_CODE", "$canonicalVersionCode"
|
2018-02-03 00:31:49 +00:00
|
|
|
|
|
|
|
ndk {
|
2019-05-28 22:57:06 +00:00
|
|
|
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
2018-02-03 00:31:49 +00:00
|
|
|
}
|
2019-03-14 16:33:43 +00:00
|
|
|
|
|
|
|
resConfigs autoResConfig()
|
2019-03-28 20:21:57 +00:00
|
|
|
|
|
|
|
splits {
|
|
|
|
abi {
|
|
|
|
enable true
|
|
|
|
reset()
|
2019-05-28 22:57:06 +00:00
|
|
|
include 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
2019-03-28 20:21:57 +00:00
|
|
|
universalApk true
|
|
|
|
}
|
|
|
|
}
|
2013-10-10 20:52:24 +00:00
|
|
|
}
|
|
|
|
|
2014-04-22 21:33:29 +00:00
|
|
|
compileOptions {
|
2017-08-07 04:43:11 +00:00
|
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
2014-04-22 21:33:29 +00:00
|
|
|
}
|
|
|
|
|
2020-09-24 04:48:51 +00:00
|
|
|
kotlinOptions {
|
|
|
|
jvmTarget = '1.8'
|
|
|
|
}
|
|
|
|
|
2014-12-31 00:49:57 +00:00
|
|
|
packagingOptions {
|
|
|
|
exclude 'LICENSE.txt'
|
|
|
|
exclude 'LICENSE'
|
|
|
|
exclude 'NOTICE'
|
|
|
|
exclude 'asm-license.txt'
|
2015-05-15 18:57:18 +00:00
|
|
|
exclude 'META-INF/LICENSE'
|
|
|
|
exclude 'META-INF/NOTICE'
|
2018-08-09 14:15:43 +00:00
|
|
|
exclude 'META-INF/proguard/androidx-annotations.pro'
|
2014-12-31 00:49:57 +00:00
|
|
|
}
|
|
|
|
|
2013-10-10 20:52:24 +00:00
|
|
|
buildTypes {
|
2015-01-12 04:27:34 +00:00
|
|
|
debug {
|
2015-01-21 07:26:58 +00:00
|
|
|
minifyEnabled true
|
2015-04-02 01:04:23 +00:00
|
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'),
|
|
|
|
'proguard-dagger.pro',
|
|
|
|
'proguard-jackson.pro',
|
2020-10-28 23:56:21 +00:00
|
|
|
'proguard-jna.pro',
|
2015-04-02 01:04:23 +00:00
|
|
|
'proguard-sqlite.pro',
|
|
|
|
'proguard-appcompat-v7.pro',
|
|
|
|
'proguard-square-okhttp.pro',
|
|
|
|
'proguard-square-okio.pro',
|
|
|
|
'proguard-spongycastle.pro',
|
|
|
|
'proguard-rounded-image-view.pro',
|
2015-03-31 22:44:41 +00:00
|
|
|
'proguard-glide.pro',
|
2015-05-08 00:20:44 +00:00
|
|
|
'proguard-shortcutbadger.pro',
|
2015-09-09 20:54:29 +00:00
|
|
|
'proguard-retrofit.pro',
|
2016-11-09 17:37:40 +00:00
|
|
|
'proguard-webrtc.pro',
|
2017-05-12 22:47:04 +00:00
|
|
|
'proguard-klinker.pro',
|
2017-08-07 04:43:11 +00:00
|
|
|
'proguard-retrolambda.pro',
|
2017-09-04 02:44:33 +00:00
|
|
|
'proguard-okhttp.pro',
|
2018-05-17 06:40:14 +00:00
|
|
|
'proguard-ez-vcard.pro',
|
2015-04-02 01:04:23 +00:00
|
|
|
'proguard.cfg'
|
2016-12-12 14:05:06 +00:00
|
|
|
testProguardFiles 'proguard-automation.pro',
|
2020-09-06 23:43:01 +00:00
|
|
|
'proguard.cfg'
|
2015-01-12 04:27:34 +00:00
|
|
|
}
|
2013-10-10 20:52:24 +00:00
|
|
|
release {
|
2015-01-21 07:26:58 +00:00
|
|
|
minifyEnabled true
|
2015-05-15 18:54:56 +00:00
|
|
|
proguardFiles = buildTypes.debug.proguardFiles
|
2013-10-10 20:52:24 +00:00
|
|
|
}
|
|
|
|
}
|
2014-01-11 02:20:25 +00:00
|
|
|
|
2017-02-26 22:36:43 +00:00
|
|
|
productFlavors {
|
|
|
|
play {
|
2017-11-06 17:20:52 +00:00
|
|
|
dimension "none"
|
2017-02-26 22:36:43 +00:00
|
|
|
ext.websiteUpdateUrl = "null"
|
|
|
|
buildConfigField "boolean", "PLAY_STORE_DISABLED", "false"
|
|
|
|
buildConfigField "String", "NOPLAY_UPDATE_URL", "$ext.websiteUpdateUrl"
|
|
|
|
}
|
|
|
|
|
|
|
|
website {
|
2017-11-06 17:20:52 +00:00
|
|
|
dimension "none"
|
2017-02-26 22:36:43 +00:00
|
|
|
ext.websiteUpdateUrl = "https://updates.signal.org/android"
|
|
|
|
buildConfigField "boolean", "PLAY_STORE_DISABLED", "true"
|
|
|
|
buildConfigField "String", "NOPLAY_UPDATE_URL", "\"$ext.websiteUpdateUrl\""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-06 17:20:52 +00:00
|
|
|
android.applicationVariants.all { variant ->
|
2019-05-28 22:57:06 +00:00
|
|
|
variant.outputs.each { output ->
|
|
|
|
output.outputFileName = output.outputFileName.replace(".apk", "-${variant.versionName}.apk")
|
|
|
|
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
|
2017-02-26 22:36:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-01-12 04:27:34 +00:00
|
|
|
sourceSets {
|
|
|
|
main {
|
|
|
|
manifest.srcFile 'AndroidManifest.xml'
|
|
|
|
java.srcDirs = ['src']
|
|
|
|
resources.srcDirs = ['src']
|
|
|
|
aidl.srcDirs = ['src']
|
|
|
|
renderscript.srcDirs = ['src']
|
|
|
|
res.srcDirs = ['res']
|
|
|
|
assets.srcDirs = ['assets']
|
2015-09-09 20:54:29 +00:00
|
|
|
jniLibs.srcDirs = ['libs']
|
2015-01-12 04:27:34 +00:00
|
|
|
}
|
|
|
|
androidTest {
|
2015-05-25 21:56:15 +00:00
|
|
|
java.srcDirs = ['test/androidTest/java']
|
2015-01-12 04:27:34 +00:00
|
|
|
}
|
2015-09-03 23:31:26 +00:00
|
|
|
test {
|
|
|
|
java.srcDirs = ['test/unitTest/java']
|
2019-03-28 15:56:35 +00:00
|
|
|
resources.srcDirs = ['test/unitTest/resources']
|
2015-09-03 23:31:26 +00:00
|
|
|
}
|
2017-02-26 22:36:43 +00:00
|
|
|
|
|
|
|
website.manifest.srcFile 'website/AndroidManifest.xml'
|
2015-01-12 04:27:34 +00:00
|
|
|
}
|
|
|
|
|
2019-05-24 18:14:07 +00:00
|
|
|
lintOptions {
|
|
|
|
abortOnError true
|
|
|
|
baseline file("lint-baseline.xml")
|
2014-01-11 02:20:25 +00:00
|
|
|
}
|
2019-03-11 19:40:26 +00:00
|
|
|
|
|
|
|
testOptions {
|
|
|
|
unitTests {
|
|
|
|
includeAndroidResources = true
|
|
|
|
}
|
|
|
|
}
|
2020-10-20 04:39:01 +00:00
|
|
|
|
|
|
|
buildFeatures {
|
|
|
|
dataBinding true
|
|
|
|
}
|
|
|
|
|
|
|
|
compileOptions {
|
|
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
|
|
}
|
|
|
|
|
|
|
|
kotlinOptions {
|
|
|
|
jvmTarget = '1.8'
|
|
|
|
}
|
2013-10-10 20:52:24 +00:00
|
|
|
}
|
|
|
|
|
2020-09-06 23:43:01 +00:00
|
|
|
/*
|
2018-10-26 17:54:12 +00:00
|
|
|
def assembleWebsiteDescriptor = { variant, file ->
|
|
|
|
if (file.exists()) {
|
2020-02-27 22:07:01 +00:00
|
|
|
MessageDigest md = MessageDigest.getInstance("SHA-256")
|
2018-10-26 17:54:12 +00:00
|
|
|
file.eachByte 4096, {bytes, size ->
|
2020-02-27 22:07:01 +00:00
|
|
|
md.update(bytes, 0, size)
|
2017-02-26 22:36:43 +00:00
|
|
|
}
|
2018-10-26 17:54:12 +00:00
|
|
|
|
2020-02-27 22:07:01 +00:00
|
|
|
String digest = md.digest().collect {String.format "%02x", it}.join()
|
2018-10-26 17:54:12 +00:00
|
|
|
String url = variant.productFlavors.get(0).ext.websiteUpdateUrl
|
|
|
|
String apkName = file.getName()
|
|
|
|
|
|
|
|
String descriptor = "{" +
|
2019-05-28 22:57:06 +00:00
|
|
|
"\"versionCode\" : $canonicalVersionCode," +
|
|
|
|
"\"versionName\" : \"$canonicalVersionName\"," +
|
2018-10-26 17:54:12 +00:00
|
|
|
"\"sha256sum\" : \"$digest\"," +
|
|
|
|
"\"url\" : \"$url/$apkName\"" +
|
|
|
|
"}"
|
|
|
|
|
|
|
|
File descriptorFile = new File(file.getParent(), apkName.replace(".apk", ".json"))
|
|
|
|
|
|
|
|
descriptorFile.write(descriptor)
|
2017-02-26 22:36:43 +00:00
|
|
|
}
|
|
|
|
}
|
2020-09-06 23:43:01 +00:00
|
|
|
|
2018-10-26 17:54:12 +00:00
|
|
|
def signProductionRelease = { variant ->
|
2019-03-28 20:21:57 +00:00
|
|
|
variant.outputs.collect { output ->
|
|
|
|
String apkName = output.outputFile.name
|
|
|
|
File inputFile = new File(output.outputFile.path)
|
|
|
|
File outputFile = new File(output.outputFile.parent, apkName.replace('-unsigned', ''))
|
|
|
|
|
|
|
|
new ApkSignerUtil('sun.security.pkcs11.SunPKCS11',
|
|
|
|
'pkcs11.config',
|
|
|
|
'PKCS11',
|
|
|
|
'file:pkcs11.password').calculateSignature(inputFile.getAbsolutePath(),
|
|
|
|
outputFile.getAbsolutePath())
|
|
|
|
|
|
|
|
inputFile.delete()
|
|
|
|
outputFile
|
|
|
|
}
|
2018-10-26 17:54:12 +00:00
|
|
|
}
|
|
|
|
|
2019-01-26 02:23:00 +00:00
|
|
|
task signProductionPlayRelease {
|
|
|
|
doLast {
|
2019-03-28 20:21:57 +00:00
|
|
|
signProductionRelease(android.applicationVariants.find { (it.name == 'playRelease') })
|
2019-01-26 02:23:00 +00:00
|
|
|
}
|
2018-10-26 17:54:12 +00:00
|
|
|
}
|
|
|
|
|
2019-01-26 02:23:00 +00:00
|
|
|
task signProductionWebsiteRelease {
|
|
|
|
doLast {
|
2019-03-28 20:21:57 +00:00
|
|
|
def variant = android.applicationVariants.find { (it.name == 'websiteRelease') }
|
|
|
|
File signedRelease = signProductionRelease(variant).find { it.name.contains('universal') }
|
|
|
|
assembleWebsiteDescriptor(variant, signedRelease)
|
2019-01-26 02:23:00 +00:00
|
|
|
}
|
2018-10-26 17:54:12 +00:00
|
|
|
}
|
|
|
|
|
2014-04-21 15:40:19 +00:00
|
|
|
tasks.whenTaskAdded { task ->
|
2018-10-26 17:54:12 +00:00
|
|
|
if (task.name.equals("assemblePlayRelease")) {
|
|
|
|
task.finalizedBy signProductionPlayRelease
|
|
|
|
}
|
|
|
|
|
|
|
|
if (task.name.equals("assembleWebsiteRelease")) {
|
|
|
|
task.finalizedBy signProductionWebsiteRelease
|
2017-02-26 22:36:43 +00:00
|
|
|
}
|
2014-04-21 15:40:19 +00:00
|
|
|
}
|
2019-08-07 05:24:05 +00:00
|
|
|
*/
|
2014-04-21 15:40:19 +00:00
|
|
|
|
2016-02-17 19:27:35 +00:00
|
|
|
def getLastCommitTimestamp() {
|
|
|
|
new ByteArrayOutputStream().withStream { os ->
|
|
|
|
def result = exec {
|
|
|
|
executable = 'git'
|
|
|
|
args = ['log', '-1', '--pretty=format:%ct']
|
|
|
|
standardOutput = os
|
|
|
|
}
|
|
|
|
|
|
|
|
return os.toString() + "000"
|
|
|
|
}
|
|
|
|
}
|
2019-03-14 16:33:43 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Discovers supported languages listed as under the res/values- directory.
|
|
|
|
*/
|
|
|
|
static def autoResConfig() {
|
|
|
|
def files = new ArrayList<String>()
|
|
|
|
def root = new File('res')
|
|
|
|
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()
|
|
|
|
}
|
2019-03-21 12:34:26 +00:00
|
|
|
|
|
|
|
task qa {
|
|
|
|
group 'Verification'
|
|
|
|
description 'Quality Assurance. Run before pushing.'
|
2019-05-24 18:14:07 +00:00
|
|
|
dependsOn ':testPlayReleaseUnitTest', ':lintPlayRelease', ':assemblePlayDebug'
|
2019-03-21 12:34:26 +00:00
|
|
|
}
|