2018-10-26 19:54:12 +02:00
|
|
|
import org.signal.signing.ApkSignerUtil
|
|
|
|
|
2017-02-26 23:36:43 +01:00
|
|
|
import java.security.MessageDigest
|
|
|
|
|
2013-10-10 22:52:24 +02:00
|
|
|
buildscript {
|
2019-05-29 06:25:19 +02:00
|
|
|
ext.kotlin_version = '1.3.31'
|
2013-10-10 22:52:24 +02:00
|
|
|
repositories {
|
2019-03-18 20:59:21 +01:00
|
|
|
google()
|
2018-10-25 01:57:19 +02:00
|
|
|
maven {
|
|
|
|
url "https://repo1.maven.org/maven2"
|
|
|
|
}
|
2019-05-29 06:25:19 +02:00
|
|
|
mavenCentral()
|
2013-10-10 22:52:24 +02:00
|
|
|
}
|
|
|
|
dependencies {
|
2019-05-29 06:25:19 +02:00
|
|
|
classpath 'com.android.tools.build:gradle:3.4.1'
|
2014-06-05 19:16:36 +02:00
|
|
|
classpath files('libs/gradle-witness.jar')
|
2019-05-29 06:25:19 +02:00
|
|
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
2013-10-10 22:52:24 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-07-24 00:40:45 +02:00
|
|
|
apply plugin: 'com.android.application'
|
2019-05-29 06:25:19 +02:00
|
|
|
apply plugin: 'kotlin-android-extensions'
|
|
|
|
apply plugin: 'kotlin-android'
|
2014-06-05 19:16:36 +02:00
|
|
|
apply plugin: 'witness'
|
2013-10-10 22:52:24 +02:00
|
|
|
|
|
|
|
repositories {
|
2016-12-15 20:34:46 +01:00
|
|
|
maven {
|
2018-03-08 11:06:21 +01:00
|
|
|
url "https://raw.github.com/signalapp/maven/master/photoview/releases/"
|
2019-01-26 03:23:00 +01:00
|
|
|
content {
|
|
|
|
includeGroupByRegex "com\\.github\\.chrisbanes.*"
|
|
|
|
}
|
2016-12-15 20:34:46 +01:00
|
|
|
}
|
2017-01-23 07:45:58 +01:00
|
|
|
maven {
|
2018-03-08 11:06:21 +01:00
|
|
|
url "https://raw.github.com/signalapp/maven/master/shortcutbadger/releases/"
|
2019-01-26 03:23:00 +01:00
|
|
|
content {
|
|
|
|
includeGroupByRegex "me\\.leolin.*"
|
|
|
|
}
|
2017-01-23 07:45:58 +01:00
|
|
|
}
|
2017-11-07 00:52:18 +01:00
|
|
|
maven {
|
2018-03-08 11:06:21 +01:00
|
|
|
url "https://raw.github.com/signalapp/maven/master/circular-progress-button/releases/"
|
2019-01-26 03:23:00 +01:00
|
|
|
content {
|
|
|
|
includeGroupByRegex "com\\.github\\.dmytrodanylyk\\.circular-progress-button\\.*"
|
|
|
|
}
|
2017-11-07 00:52:18 +01:00
|
|
|
}
|
2018-04-07 03:15:24 +02:00
|
|
|
maven {
|
|
|
|
url "https://raw.github.com/signalapp/maven/master/sqlcipher/release/"
|
2019-01-26 03:23:00 +01:00
|
|
|
content {
|
|
|
|
includeGroupByRegex "org\\.signal.*"
|
|
|
|
}
|
2017-09-21 03:10:44 +02:00
|
|
|
}
|
2015-05-04 20:36:18 +02:00
|
|
|
maven { // textdrawable
|
|
|
|
url 'https://dl.bintray.com/amulyakhare/maven'
|
2019-01-26 03:23:00 +01:00
|
|
|
content {
|
|
|
|
includeGroupByRegex "com\\.amulyakhare.*"
|
|
|
|
}
|
2015-05-04 20:36:18 +02:00
|
|
|
}
|
2018-10-25 01:57:19 +02:00
|
|
|
google()
|
2015-01-24 05:38:45 +01:00
|
|
|
jcenter()
|
2015-03-02 17:25:19 +01:00
|
|
|
mavenLocal()
|
2019-05-31 05:28:08 +02:00
|
|
|
maven {
|
|
|
|
url "https://jitpack.io"
|
|
|
|
}
|
2013-10-10 22:52:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2018-08-09 16:15:43 +02:00
|
|
|
def supportVersion = '28.0.0'
|
|
|
|
|
|
|
|
compile "com.android.support:appcompat-v7:$supportVersion"
|
|
|
|
compile "com.android.support:recyclerview-v7:$supportVersion"
|
|
|
|
compile "com.android.support:design:$supportVersion"
|
|
|
|
compile "com.android.support:support-v13:$supportVersion"
|
|
|
|
compile "com.android.support:cardview-v7:$supportVersion"
|
|
|
|
compile "com.android.support:preference-v7:$supportVersion"
|
|
|
|
compile "com.android.support:preference-v14:$supportVersion"
|
|
|
|
compile "com.android.support:gridlayout-v7:$supportVersion"
|
|
|
|
compile "com.android.support:exifinterface:$supportVersion"
|
2019-01-15 09:41:05 +01:00
|
|
|
compile 'com.android.support.constraint:constraint-layout:1.1.3'
|
2018-08-09 16:15:43 +02:00
|
|
|
compile 'com.android.support:multidex:1.0.3'
|
2018-07-07 02:28:58 +02:00
|
|
|
compile 'android.arch.lifecycle:extensions:1.1.1'
|
|
|
|
compile 'android.arch.lifecycle:common-java8:1.1.1'
|
2017-01-08 18:43:43 +01:00
|
|
|
|
2019-02-15 20:40:03 +01:00
|
|
|
compile('com.google.firebase:firebase-messaging:17.3.4') {
|
|
|
|
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'
|
|
|
|
}
|
|
|
|
|
2018-12-12 22:12:44 +01:00
|
|
|
compile 'com.google.android.gms:play-services-maps:16.0.0'
|
|
|
|
compile 'com.google.android.gms:play-services-places:16.0.0'
|
|
|
|
compile 'com.google.android.gms:play-services-auth:16.0.1'
|
2017-01-08 18:43:43 +01:00
|
|
|
|
2018-07-24 22:11:23 +02:00
|
|
|
compile 'com.google.android.exoplayer:exoplayer-core:2.9.1'
|
|
|
|
compile 'com.google.android.exoplayer:exoplayer-ui:2.9.1'
|
2017-04-13 23:15:06 +02:00
|
|
|
|
2019-05-01 18:00:26 +02:00
|
|
|
compile 'org.conscrypt:conscrypt-android:2.0.0'
|
|
|
|
compile 'org.signal:aesgcmprovider:0.0.3'
|
|
|
|
|
2019-05-31 05:28:08 +02:00
|
|
|
implementation "com.github.loki-project:loki-messenger-android-core:master-SNAPSHOT"
|
2019-05-01 18:00:26 +02:00
|
|
|
|
2019-05-10 17:03:16 +02:00
|
|
|
compile 'org.whispersystems:webrtc-android:M74'
|
2017-01-08 18:43:43 +01:00
|
|
|
|
2017-04-21 01:29:51 +02:00
|
|
|
compile "me.leolin:ShortcutBadger:1.1.16"
|
2017-01-08 18:43:43 +01:00
|
|
|
compile 'se.emilsjolander:stickylistheaders:2.7.0'
|
2015-05-06 22:53:55 +02:00
|
|
|
compile 'com.jpardogo.materialtabstrip:library:1.0.9'
|
2014-09-17 01:21:41 +02:00
|
|
|
compile 'org.apache.httpcomponents:httpclient-android:4.3.5'
|
2017-10-12 02:12:46 +02:00
|
|
|
compile 'com.github.chrisbanes:PhotoView:2.1.3'
|
2018-01-09 02:04:39 +01:00
|
|
|
compile 'com.github.bumptech.glide:glide:4.5.0'
|
|
|
|
annotationProcessor 'com.github.bumptech.glide:compiler:4.5.0'
|
2015-06-13 00:31:12 +02:00
|
|
|
compile 'com.makeramen:roundedimageview:2.1.0'
|
2015-06-27 05:14:51 +02:00
|
|
|
compile 'com.pnikosis:materialish-progress:1.5'
|
2017-02-18 05:27:11 +01:00
|
|
|
compile 'org.greenrobot:eventbus:3.0.0'
|
2015-06-29 17:49:32 +02:00
|
|
|
compile 'pl.tajchert:waitingdots:0.1.0'
|
2019-03-18 20:09:57 +01:00
|
|
|
compile 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
|
2015-09-29 22:14:22 +02:00
|
|
|
compile 'com.melnykov:floatingactionbutton:1.3.0'
|
2014-11-22 18:47:02 +01:00
|
|
|
compile 'com.google.zxing:android-integration:3.1.0'
|
2014-11-12 04:57:53 +01:00
|
|
|
compile 'com.squareup.dagger:dagger:1.2.2'
|
2017-11-06 18:20:52 +01:00
|
|
|
annotationProcessor 'com.squareup.dagger:dagger-compiler:1.2.2'
|
2018-03-10 00:27:20 +01:00
|
|
|
compile 'mobi.upod:time-duration-picker:1.1.3'
|
2019-01-26 03:23:00 +01:00
|
|
|
compileOnly 'com.squareup.dagger:dagger-compiler:1.2.2'
|
2015-05-04 20:36:18 +02:00
|
|
|
compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
|
2015-11-19 19:21:19 +01:00
|
|
|
compile 'com.google.zxing:core:3.2.1'
|
2016-12-14 19:21:14 +01:00
|
|
|
compile ('com.davemorrissey.labs:subsampling-scale-image-view:3.6.0') {
|
|
|
|
exclude group: 'com.android.support', module: 'support-annotations'
|
|
|
|
}
|
2016-08-16 05:23:56 +02:00
|
|
|
compile ('cn.carbswang.android:NumberPickerView:1.0.9') {
|
|
|
|
exclude group: 'com.android.support', module: 'appcompat-v7'
|
|
|
|
}
|
2017-02-11 20:05:53 +01:00
|
|
|
compile ('com.tomergoldst.android:tooltips:1.0.6') {
|
|
|
|
exclude group: 'com.android.support', module: 'appcompat-v7'
|
|
|
|
}
|
2017-05-09 00:32:59 +02:00
|
|
|
compile ('com.klinkerapps:android-smsmms:4.0.1') {
|
|
|
|
exclude group: 'com.squareup.okhttp', module: 'okhttp'
|
|
|
|
exclude group: 'com.squareup.okhttp', module: 'okhttp-urlconnection'
|
|
|
|
}
|
2017-08-07 06:43:11 +02:00
|
|
|
compile 'com.annimon:stream:1.1.8'
|
2017-09-21 03:10:44 +02:00
|
|
|
compile ('com.takisoft.fix:colorpicker:0.9.1') {
|
|
|
|
exclude group: 'com.android.support', module: 'appcompat-v7'
|
|
|
|
exclude group: 'com.android.support', module: 'recyclerview-v7'
|
|
|
|
}
|
2017-09-24 06:30:00 +02:00
|
|
|
compile 'com.codewaves.stickyheadergrid:stickyheadergrid:0.9.4'
|
2017-11-07 00:52:18 +01:00
|
|
|
compile 'com.github.dmytrodanylyk.circular-progress-button:library:1.1.3-S2'
|
2018-07-03 01:57:06 +02:00
|
|
|
compile 'org.signal:android-database-sqlcipher:3.5.9-S3'
|
2018-05-17 08:40:14 +02:00
|
|
|
compile ('com.googlecode.ez-vcard:ez-vcard:0.9.11') {
|
|
|
|
exclude group: 'com.fasterxml.jackson.core'
|
|
|
|
exclude group: 'org.freemarker'
|
|
|
|
}
|
2016-08-16 05:23:56 +02:00
|
|
|
|
2019-01-26 03:23:00 +01:00
|
|
|
testImplementation 'junit:junit:4.12'
|
2019-03-11 20:40:26 +01:00
|
|
|
testImplementation 'org.assertj:assertj-core:3.11.1'
|
2019-01-26 03:23:00 +01: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'
|
2015-09-04 01:31:26 +02:00
|
|
|
|
2019-03-14 17:33:43 +01:00
|
|
|
testImplementation 'androidx.test:core:1.1.1-alpha02'
|
2019-01-26 03:23:00 +01:00
|
|
|
androidTestImplementation 'com.android.support:multidex:1.0.3'
|
|
|
|
androidTestImplementation 'com.android.support:multidex-instrumentation:1.0.3'
|
|
|
|
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 01:49:57 +01:00
|
|
|
exclude group: 'org.hamcrest', module: 'hamcrest-core'
|
|
|
|
}
|
2019-01-26 03:23:00 +01:00
|
|
|
androidTestImplementation ('com.squareup.assertj:assertj-android:1.1.1') {
|
2015-06-02 06:44:10 +02:00
|
|
|
exclude group: 'org.hamcrest', module: 'hamcrest-core'
|
|
|
|
exclude group: 'com.android.support', module: 'support-annotations'
|
|
|
|
}
|
2019-03-11 20:40:26 +01:00
|
|
|
testImplementation 'org.robolectric:robolectric:4.2'
|
|
|
|
testImplementation 'org.robolectric:shadows-multidex:4.2'
|
2019-05-29 06:25:19 +02:00
|
|
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
2013-10-10 22:52:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
android {
|
2017-11-06 18:20:52 +01:00
|
|
|
flavorDimensions "none"
|
2018-08-09 16:15:43 +02:00
|
|
|
compileSdkVersion 28
|
2019-01-26 03:23:00 +01:00
|
|
|
buildToolsVersion '28.0.3'
|
2016-12-11 22:37:22 +01:00
|
|
|
useLibrary 'org.apache.http.legacy'
|
2013-10-10 22:52:24 +02:00
|
|
|
|
2015-02-12 19:30:45 +01:00
|
|
|
dexOptions {
|
|
|
|
javaMaxHeapSize "4g"
|
|
|
|
}
|
|
|
|
|
2013-10-10 22:52:24 +02:00
|
|
|
defaultConfig {
|
2019-05-20 17:31:47 +02:00
|
|
|
versionCode 487
|
|
|
|
versionName "4.40.4"
|
2017-02-26 23:36:43 +01:00
|
|
|
|
2019-03-19 22:29:58 +01:00
|
|
|
minSdkVersion 19
|
2018-10-03 19:37:43 +02:00
|
|
|
targetSdkVersion 26
|
2017-01-08 18:43:43 +01:00
|
|
|
multiDexEnabled true
|
2015-01-12 05:27:34 +01:00
|
|
|
|
2016-11-22 03:58:10 +01:00
|
|
|
vectorDrawables.useSupportLibrary = true
|
2017-02-26 23:36:43 +01:00
|
|
|
project.ext.set("archivesBaseName", "Signal");
|
2016-11-22 03:58:10 +01:00
|
|
|
|
2016-02-17 20:27:35 +01:00
|
|
|
buildConfigField "long", "BUILD_TIMESTAMP", getLastCommitTimestamp() + "L"
|
2018-10-12 01:45:22 +02:00
|
|
|
buildConfigField "String", "SIGNAL_URL", "\"https://textsecure-service.whispersystems.org\""
|
2017-08-09 01:37:15 +02:00
|
|
|
buildConfigField "String", "SIGNAL_CDN_URL", "\"https://cdn.signal.org\""
|
2018-07-18 17:27:05 +02:00
|
|
|
buildConfigField "String", "SIGNAL_CONTACT_DISCOVERY_URL", "\"https://api.directory.signal.org\""
|
2018-06-11 18:37:01 +02:00
|
|
|
buildConfigField "String", "SIGNAL_SERVICE_STATUS_URL", "\"uptime.signal.org\""
|
2019-01-15 09:41:05 +01:00
|
|
|
buildConfigField "String", "CONTENT_PROXY_HOST", "\"contentproxy.signal.org\""
|
|
|
|
buildConfigField "int", "CONTENT_PROXY_PORT", "443"
|
2015-09-09 22:54:29 +02:00
|
|
|
buildConfigField "String", "USER_AGENT", "\"OWA\""
|
2015-05-21 21:30:18 +02:00
|
|
|
buildConfigField "boolean", "DEV_BUILD", "false"
|
2018-07-18 17:27:05 +02:00
|
|
|
buildConfigField "String", "MRENCLAVE", "\"cd6cfc342937b23b1bdd3bbf9721aa5615ac9ff50a75c5527d441cd3276826c9\""
|
2018-10-12 01:45:22 +02:00
|
|
|
buildConfigField "String", "UNIDENTIFIED_SENDER_TRUST_ROOT", "\"BXu6QIKVz5MA8gstzfOgRQGqyLqOwNKHL6INkv3IHWMF\""
|
2019-03-14 17:33:43 +01:00
|
|
|
buildConfigField "String[]", "LANGUAGES", "new String[]{\"" + autoResConfig().collect { s -> s.replace('-r', '_') }.join('", "') + '"}'
|
2018-02-03 01:31:49 +01:00
|
|
|
|
|
|
|
ndk {
|
2019-05-10 22:01:34 +02:00
|
|
|
abiFilters 'armeabi-v7a', 'x86'
|
2018-02-03 01:31:49 +01:00
|
|
|
}
|
2019-03-14 17:33:43 +01:00
|
|
|
|
|
|
|
resConfigs autoResConfig()
|
2019-03-28 21:21:57 +01:00
|
|
|
|
|
|
|
splits {
|
|
|
|
abi {
|
|
|
|
enable true
|
|
|
|
reset()
|
2019-05-10 22:01:34 +02:00
|
|
|
include 'armeabi-v7a', 'x86'
|
2019-03-28 21:21:57 +01:00
|
|
|
universalApk true
|
|
|
|
}
|
|
|
|
}
|
2013-10-10 22:52:24 +02:00
|
|
|
}
|
|
|
|
|
2014-04-22 23:33:29 +02:00
|
|
|
compileOptions {
|
2017-08-07 06:43:11 +02:00
|
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
2014-04-22 23:33:29 +02:00
|
|
|
}
|
|
|
|
|
2014-12-31 01:49:57 +01:00
|
|
|
packagingOptions {
|
|
|
|
exclude 'LICENSE.txt'
|
|
|
|
exclude 'LICENSE'
|
|
|
|
exclude 'NOTICE'
|
|
|
|
exclude 'asm-license.txt'
|
2015-05-15 20:57:18 +02:00
|
|
|
exclude 'META-INF/LICENSE'
|
|
|
|
exclude 'META-INF/NOTICE'
|
2018-08-09 16:15:43 +02:00
|
|
|
exclude 'META-INF/proguard/androidx-annotations.pro'
|
2014-12-31 01:49:57 +01:00
|
|
|
}
|
|
|
|
|
2013-10-10 22:52:24 +02:00
|
|
|
buildTypes {
|
2015-01-12 05:27:34 +01:00
|
|
|
debug {
|
2015-01-21 08:26:58 +01:00
|
|
|
minifyEnabled true
|
2015-04-02 03:04:23 +02:00
|
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'),
|
2019-02-15 20:40:03 +01:00
|
|
|
'proguard-firebase-messaging.pro',
|
2015-04-02 03:04:23 +02:00
|
|
|
'proguard-google-play-services.pro',
|
|
|
|
'proguard-dagger.pro',
|
|
|
|
'proguard-jackson.pro',
|
|
|
|
'proguard-sqlite.pro',
|
|
|
|
'proguard-appcompat-v7.pro',
|
|
|
|
'proguard-square-okhttp.pro',
|
|
|
|
'proguard-square-okio.pro',
|
|
|
|
'proguard-spongycastle.pro',
|
|
|
|
'proguard-rounded-image-view.pro',
|
2015-04-01 00:44:41 +02:00
|
|
|
'proguard-glide.pro',
|
2015-05-08 02:20:44 +02:00
|
|
|
'proguard-shortcutbadger.pro',
|
2015-09-09 22:54:29 +02:00
|
|
|
'proguard-retrofit.pro',
|
2016-11-09 18:37:40 +01:00
|
|
|
'proguard-webrtc.pro',
|
2017-05-13 00:47:04 +02:00
|
|
|
'proguard-klinker.pro',
|
2017-08-07 06:43:11 +02:00
|
|
|
'proguard-retrolambda.pro',
|
2017-09-04 04:44:33 +02:00
|
|
|
'proguard-okhttp.pro',
|
2018-05-17 08:40:14 +02:00
|
|
|
'proguard-ez-vcard.pro',
|
2015-04-02 03:04:23 +02:00
|
|
|
'proguard.cfg'
|
2016-12-12 15:05:06 +01:00
|
|
|
testProguardFiles 'proguard-automation.pro',
|
|
|
|
'proguard.cfg'
|
2015-01-12 05:27:34 +01:00
|
|
|
}
|
2013-10-10 22:52:24 +02:00
|
|
|
release {
|
2015-01-21 08:26:58 +01:00
|
|
|
minifyEnabled true
|
2015-05-15 20:54:56 +02:00
|
|
|
proguardFiles = buildTypes.debug.proguardFiles
|
2013-10-10 22:52:24 +02:00
|
|
|
}
|
|
|
|
}
|
2014-01-11 03:20:25 +01:00
|
|
|
|
2017-02-26 23:36:43 +01:00
|
|
|
productFlavors {
|
|
|
|
play {
|
2017-11-06 18:20:52 +01:00
|
|
|
dimension "none"
|
2017-02-26 23:36:43 +01:00
|
|
|
ext.websiteUpdateUrl = "null"
|
|
|
|
buildConfigField "boolean", "PLAY_STORE_DISABLED", "false"
|
|
|
|
buildConfigField "String", "NOPLAY_UPDATE_URL", "$ext.websiteUpdateUrl"
|
|
|
|
}
|
|
|
|
|
|
|
|
website {
|
2017-11-06 18:20:52 +01:00
|
|
|
dimension "none"
|
2017-02-26 23:36:43 +01:00
|
|
|
ext.websiteUpdateUrl = "https://updates.signal.org/android"
|
|
|
|
buildConfigField "boolean", "PLAY_STORE_DISABLED", "true"
|
|
|
|
buildConfigField "String", "NOPLAY_UPDATE_URL", "\"$ext.websiteUpdateUrl\""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-06 18:20:52 +01:00
|
|
|
android.applicationVariants.all { variant ->
|
|
|
|
variant.outputs.all {
|
|
|
|
outputFileName = outputFileName.replace(".apk", "-${variant.versionName}.apk")
|
2017-02-26 23:36:43 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-01-12 05:27:34 +01: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 22:54:29 +02:00
|
|
|
jniLibs.srcDirs = ['libs']
|
2015-01-12 05:27:34 +01:00
|
|
|
}
|
|
|
|
androidTest {
|
2015-05-25 23:56:15 +02:00
|
|
|
java.srcDirs = ['test/androidTest/java']
|
2015-01-12 05:27:34 +01:00
|
|
|
}
|
2015-09-04 01:31:26 +02:00
|
|
|
test {
|
|
|
|
java.srcDirs = ['test/unitTest/java']
|
2019-03-28 16:56:35 +01:00
|
|
|
resources.srcDirs = ['test/unitTest/resources']
|
2015-09-04 01:31:26 +02:00
|
|
|
}
|
2017-02-26 23:36:43 +01:00
|
|
|
|
|
|
|
website.manifest.srcFile 'website/AndroidManifest.xml'
|
2015-01-12 05:27:34 +01:00
|
|
|
}
|
|
|
|
|
2014-01-11 03:20:25 +01:00
|
|
|
lintOptions {
|
|
|
|
abortOnError false
|
|
|
|
}
|
2019-03-11 20:40:26 +01:00
|
|
|
|
|
|
|
testOptions {
|
|
|
|
unitTests {
|
|
|
|
includeAndroidResources = true
|
|
|
|
}
|
|
|
|
}
|
2013-10-10 22:52:24 +02:00
|
|
|
}
|
|
|
|
|
2018-10-26 19:54:12 +02:00
|
|
|
def assembleWebsiteDescriptor = { variant, file ->
|
|
|
|
if (file.exists()) {
|
|
|
|
MessageDigest md = MessageDigest.getInstance("SHA-256");
|
|
|
|
file.eachByte 4096, {bytes, size ->
|
|
|
|
md.update(bytes, 0, size);
|
2017-02-26 23:36:43 +01:00
|
|
|
}
|
2018-10-26 19:54:12 +02:00
|
|
|
|
|
|
|
String digest = md.digest().collect {String.format "%02x", it}.join();
|
|
|
|
String url = variant.productFlavors.get(0).ext.websiteUpdateUrl
|
|
|
|
String apkName = file.getName()
|
|
|
|
|
|
|
|
String descriptor = "{" +
|
|
|
|
"\"versionCode\" : $project.android.defaultConfig.versionCode," +
|
|
|
|
"\"versionName\" : \"$project.android.defaultConfig.versionName\"," +
|
|
|
|
"\"sha256sum\" : \"$digest\"," +
|
|
|
|
"\"url\" : \"$url/$apkName\"" +
|
|
|
|
"}"
|
|
|
|
|
|
|
|
File descriptorFile = new File(file.getParent(), apkName.replace(".apk", ".json"))
|
|
|
|
|
|
|
|
descriptorFile.write(descriptor)
|
2017-02-26 23:36:43 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-10-26 19:54:12 +02:00
|
|
|
def signProductionRelease = { variant ->
|
2019-03-28 21:21:57 +01: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 19:54:12 +02:00
|
|
|
}
|
|
|
|
|
2019-01-26 03:23:00 +01:00
|
|
|
task signProductionPlayRelease {
|
|
|
|
doLast {
|
2019-03-28 21:21:57 +01:00
|
|
|
signProductionRelease(android.applicationVariants.find { (it.name == 'playRelease') })
|
2019-01-26 03:23:00 +01:00
|
|
|
}
|
2018-10-26 19:54:12 +02:00
|
|
|
}
|
|
|
|
|
2019-01-26 03:23:00 +01:00
|
|
|
task signProductionWebsiteRelease {
|
|
|
|
doLast {
|
2019-03-28 21:21:57 +01:00
|
|
|
def variant = android.applicationVariants.find { (it.name == 'websiteRelease') }
|
|
|
|
File signedRelease = signProductionRelease(variant).find { it.name.contains('universal') }
|
|
|
|
assembleWebsiteDescriptor(variant, signedRelease)
|
2019-01-26 03:23:00 +01:00
|
|
|
}
|
2018-10-26 19:54:12 +02:00
|
|
|
}
|
|
|
|
|
2014-04-21 17:40:19 +02:00
|
|
|
tasks.whenTaskAdded { task ->
|
2018-10-26 19:54:12 +02:00
|
|
|
if (task.name.equals("assemblePlayRelease")) {
|
|
|
|
task.finalizedBy signProductionPlayRelease
|
|
|
|
}
|
|
|
|
|
|
|
|
if (task.name.equals("assembleWebsiteRelease")) {
|
|
|
|
task.finalizedBy signProductionWebsiteRelease
|
2017-02-26 23:36:43 +01:00
|
|
|
}
|
2014-04-21 17:40:19 +02:00
|
|
|
}
|
|
|
|
|
2016-02-17 20:27:35 +01: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 17:33:43 +01: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 13:34:26 +01:00
|
|
|
|
|
|
|
task qa {
|
|
|
|
group 'Verification'
|
|
|
|
description 'Quality Assurance. Run before pushing.'
|
|
|
|
dependsOn ':testPlayReleaseUnitTest', ':assemblePlayDebug'
|
|
|
|
}
|