mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-15 15:37:29 +00:00
Compare commits
410 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9b9734f82a | ||
|
|
fe437b5234 | ||
|
|
59bb505a3e | ||
|
|
28d8d62cbd | ||
|
|
cb05608422 | ||
|
|
e384a37fab | ||
|
|
9a04cd9e3b | ||
|
|
dd396eb75a | ||
|
|
611b52780e | ||
|
|
20a05220ea | ||
|
|
38e8f24c20 | ||
|
|
58d2c92102 | ||
|
|
f90ba45940 | ||
|
|
1ecf42bfd3 | ||
|
|
ed56c21e5b | ||
|
|
a0c55baf39 | ||
|
|
3b3ef0d545 | ||
|
|
78e7f99344 | ||
|
|
d709d67f54 | ||
|
|
6d30fd11a7 | ||
|
|
4a39c7950f | ||
|
|
3dd5ad2a8a | ||
|
|
d7b7727aa6 | ||
|
|
0199cd24ef | ||
|
|
8513e8c4f9 | ||
|
|
5d2d9017f1 | ||
|
|
879e8f98bd | ||
|
|
2c6524f6c0 | ||
|
|
c9bd81d332 | ||
|
|
2d29b02cea | ||
|
|
c0a279fcc5 | ||
|
|
1a612fab0b | ||
|
|
63e821634a | ||
|
|
62d951b438 | ||
|
|
8d749c404f | ||
|
|
d5b2f4fdd3 | ||
|
|
fae4ca91bd | ||
|
|
6e92ff5096 | ||
|
|
61522cd682 | ||
|
|
74dbd0814a | ||
|
|
05751a5b79 | ||
|
|
7741844055 | ||
|
|
09c07f0707 | ||
|
|
c565db812e | ||
|
|
00b72c9263 | ||
|
|
5c415139fd | ||
|
|
6d944c0f8c | ||
|
|
6744a79325 | ||
|
|
472d86acc0 | ||
|
|
c1ee7a53b5 | ||
|
|
8d44640377 | ||
|
|
cbcbe3f564 | ||
|
|
698923423f | ||
|
|
bc6114f6e0 | ||
|
|
21d91bb2cf | ||
|
|
bda9664cb9 | ||
|
|
9c055a35a9 | ||
|
|
bf794c41da | ||
|
|
de698c8a1a | ||
|
|
f972382f5e | ||
|
|
73b0331884 | ||
|
|
2248abb749 | ||
|
|
13435c0b54 | ||
|
|
5575f75118 | ||
|
|
4ce3c2309c | ||
|
|
cd7ee1a042 | ||
|
|
cd087113e3 | ||
|
|
36b6122b0f | ||
|
|
a74651d915 | ||
|
|
c274805eb0 | ||
|
|
d86d88f313 | ||
|
|
265e875a78 | ||
|
|
8353ad4962 | ||
|
|
9369cafd38 | ||
|
|
989cda6662 | ||
|
|
0570aaeb6e | ||
|
|
5a19117850 | ||
|
|
ff726ec4d2 | ||
|
|
0cd93986bd | ||
|
|
bc7ba5f2c6 | ||
|
|
1ddde6ab92 | ||
|
|
e9f2580bb8 | ||
|
|
b9dc2d3969 | ||
|
|
7e27203bd8 | ||
|
|
5a582c12d8 | ||
|
|
cd925d5f53 | ||
|
|
853a37920c | ||
|
|
2aa0b3700f | ||
|
|
35190ebb63 | ||
|
|
d74350b708 | ||
|
|
bd3e4f9f87 | ||
|
|
7370756344 | ||
|
|
7894377d1d | ||
|
|
6416df241f | ||
|
|
85408f2b12 | ||
|
|
b698daa4cf | ||
|
|
3a035a1b33 | ||
|
|
a11888ff71 | ||
|
|
423b8c942c | ||
|
|
26739491a5 | ||
|
|
6bf39c5102 | ||
|
|
daac3bd143 | ||
|
|
028242826e | ||
|
|
99d9c670b6 | ||
|
|
bc592cc4e2 | ||
|
|
04707b00e7 | ||
|
|
d44abfaeac | ||
|
|
6c30f3d573 | ||
|
|
2e70ed14dd | ||
|
|
7823d4f49f | ||
|
|
7bd3482367 | ||
|
|
709adf05aa | ||
|
|
524736c5b2 | ||
|
|
f53ae66fc9 | ||
|
|
0c102b061c | ||
|
|
ee198e47c8 | ||
|
|
75c2931c8d | ||
|
|
2bb4edecd7 | ||
|
|
b79d9af7ae | ||
|
|
5c50372021 | ||
|
|
d0d32c8f33 | ||
|
|
2aaaa1791e | ||
|
|
6ed63a67cd | ||
|
|
b858955243 | ||
|
|
63a676b0ef | ||
|
|
155b59d71f | ||
|
|
d9dba89781 | ||
|
|
0a572153f0 | ||
|
|
ce46c44b5d | ||
|
|
e6918b592e | ||
|
|
ddbbb4c21a | ||
|
|
d23290107b | ||
|
|
69f4c89f84 | ||
|
|
279f9578cc | ||
|
|
af7989839f | ||
|
|
01fb0c0eb6 | ||
|
|
dab47828c6 | ||
|
|
c070743723 | ||
|
|
9bbd9b56e7 | ||
|
|
311793ac33 | ||
|
|
986923ea6c | ||
|
|
2f6baf8743 | ||
|
|
4c43bf2228 | ||
|
|
585bd5f24c | ||
|
|
d420c0332b | ||
|
|
e32df5d247 | ||
|
|
19a8ec02cb | ||
|
|
798d4b90c3 | ||
|
|
206f1f3775 | ||
|
|
96273bb724 | ||
|
|
c0d9efc930 | ||
|
|
6722d9d15d | ||
|
|
52c2c58988 | ||
|
|
e3efc53b64 | ||
|
|
9a18f5ef6b | ||
|
|
ce8d545d6f | ||
|
|
f875a0c882 | ||
|
|
4bbddf736c | ||
|
|
c1da17df48 | ||
|
|
f6fa8166d2 | ||
|
|
20016adef1 | ||
|
|
265bb29626 | ||
|
|
d16be8c4d7 | ||
|
|
791a38a181 | ||
|
|
d1010eb886 | ||
|
|
471b214b4a | ||
|
|
f505d48d80 | ||
|
|
6d9a2d4787 | ||
|
|
a36e2408f7 | ||
|
|
9012a2afc0 | ||
|
|
4921198cd8 | ||
|
|
530b57644f | ||
|
|
921415632b | ||
|
|
c723b2c6bf | ||
|
|
17d338f7af | ||
|
|
3d9e12e4c1 | ||
|
|
4ca849c151 | ||
|
|
3e6145aed0 | ||
|
|
c960f29e38 | ||
|
|
c230eb179b | ||
|
|
05e77b1d33 | ||
|
|
a2bdea5df2 | ||
|
|
b2b2860a48 | ||
|
|
f71c1d0c5d | ||
|
|
43607edc1c | ||
|
|
08beb7ff43 | ||
|
|
b24c4e3302 | ||
|
|
06a6f0ea0b | ||
|
|
bd38c4f5d2 | ||
|
|
2e4665e5c4 | ||
|
|
1b250300c7 | ||
|
|
7f3966ff07 | ||
|
|
1f7e9df7ff | ||
|
|
fd32ec9598 | ||
|
|
ed12a7691d | ||
|
|
5759609a11 | ||
|
|
6a423cb18b | ||
|
|
c727f93534 | ||
|
|
623d2f2659 | ||
|
|
4dede65e32 | ||
|
|
1c5f4da20f | ||
|
|
33d9840a78 | ||
|
|
3e89e07ad3 | ||
|
|
99c3e043e7 | ||
|
|
3858024116 | ||
|
|
b06f0bba61 | ||
|
|
73ea50d162 | ||
|
|
98580e6a6b | ||
|
|
2f0a63774f | ||
|
|
3d8f364d59 | ||
|
|
2d93b31469 | ||
|
|
e27abcb047 | ||
|
|
29b4b32692 | ||
|
|
bdd6bcb932 | ||
|
|
062fb1fe0b | ||
|
|
4a0631a10c | ||
|
|
a0fdc735e7 | ||
|
|
fa842ac281 | ||
|
|
f8d17b04cb | ||
|
|
0ac9f5d7c0 | ||
|
|
1ad7aa901a | ||
|
|
b0aa440b9d | ||
|
|
dc6deee231 | ||
|
|
1cf52cae71 | ||
|
|
c730a09123 | ||
|
|
01fc7fa179 | ||
|
|
d2c6698824 | ||
|
|
e014779b32 | ||
|
|
fe400894b1 | ||
|
|
051e98898d | ||
|
|
9cf77d320c | ||
|
|
7c11239875 | ||
|
|
3e5af23f43 | ||
|
|
a349fdd79e | ||
|
|
af32996728 | ||
|
|
5fa5a98b87 | ||
|
|
a7f239576f | ||
|
|
c2ec9e579e | ||
|
|
b56e2222f5 | ||
|
|
fc94a9d748 | ||
|
|
4b41989b30 | ||
|
|
e3b569ca5b | ||
|
|
6459ef5b66 | ||
|
|
b085989b22 | ||
|
|
888e7f8ed5 | ||
|
|
d50a9c61b0 | ||
|
|
4fdc2bd76b | ||
|
|
3f990327d8 | ||
|
|
8ccd2864fe | ||
|
|
e7bfefa027 | ||
|
|
1da75018eb | ||
|
|
88be84297e | ||
|
|
e1467480e9 | ||
|
|
92c71b3630 | ||
|
|
24c994d5b2 | ||
|
|
f7d87f3436 | ||
|
|
fd635542c0 | ||
|
|
eb826b2786 | ||
|
|
8cd0381df5 | ||
|
|
305c32cfc5 | ||
|
|
bb21363ca8 | ||
|
|
6968edbeec | ||
|
|
a6acbacaef | ||
|
|
870ae8a46f | ||
|
|
a3c9f04719 | ||
|
|
fdcd24feb1 | ||
|
|
c31b2edeab | ||
|
|
ffecdb3747 | ||
|
|
3031d68863 | ||
|
|
fe1755f250 | ||
|
|
e162eb27c7 | ||
|
|
f4863efb2e | ||
|
|
5b3c51013b | ||
|
|
06bdc36136 | ||
|
|
6e4edbd12d | ||
|
|
c38fafe9fd | ||
|
|
6f213158ed | ||
|
|
3db8f5a2af | ||
|
|
0b5fa18504 | ||
|
|
7ea1080801 | ||
|
|
4c47f337ea | ||
|
|
952990c8af | ||
|
|
f2582cae54 | ||
|
|
e089be310b | ||
|
|
ed5c51d954 | ||
|
|
08915befa5 | ||
|
|
062e958db5 | ||
|
|
9be82a2739 | ||
|
|
0ea3d524da | ||
|
|
437979373c | ||
|
|
22ed8872e6 | ||
|
|
39fe5b1eb5 | ||
|
|
717794a12e | ||
|
|
4ce51c77a8 | ||
|
|
d9ecab5240 | ||
|
|
71b15d269e | ||
|
|
a1009da324 | ||
|
|
26b8de2282 | ||
|
|
9db33c3fec | ||
|
|
2538e48d0f | ||
|
|
68bf41b36a | ||
|
|
3a91bb8947 | ||
|
|
ee930f59db | ||
|
|
6b5feadf6c | ||
|
|
bd084e606c | ||
|
|
bb674a1539 | ||
|
|
951d073ad6 | ||
|
|
b7d671dcbd | ||
|
|
eb4540600e | ||
|
|
22fc874b99 | ||
|
|
282a707bf9 | ||
|
|
942c155723 | ||
|
|
286ae25ac5 | ||
|
|
38ad0903ff | ||
|
|
d76eb9a9e4 | ||
|
|
a3e8ca8d33 | ||
|
|
e1454cfc6a | ||
|
|
df6d446e83 | ||
|
|
2d17082a76 | ||
|
|
9aa4797792 | ||
|
|
3508269c17 | ||
|
|
c18e6e5e67 | ||
|
|
ce86b511f0 | ||
|
|
b65079ec20 | ||
|
|
b99fec4274 | ||
|
|
15677c663b | ||
|
|
1bd5b03636 | ||
|
|
3542c363d9 | ||
|
|
ec44b9aae7 | ||
|
|
e4ec538f13 | ||
|
|
3e54cc5c77 | ||
|
|
b1feb76535 | ||
|
|
a4b7804c9b | ||
|
|
18b2587936 | ||
|
|
1238151d73 | ||
|
|
c25f6d0bc4 | ||
|
|
2ca4748e00 | ||
|
|
1c30a8f38e | ||
|
|
cd29a1715e | ||
|
|
c9d0a11e85 | ||
|
|
4d8ed34d94 | ||
|
|
d98f51395f | ||
|
|
657a7d2a6b | ||
|
|
d6ade56233 | ||
|
|
d88a862e09 | ||
|
|
9c06b07262 | ||
|
|
c5aedc7d85 | ||
|
|
b9c91d195d | ||
|
|
d4d32c2d36 | ||
|
|
b6538101df | ||
|
|
7e4602863f | ||
|
|
0cc35fe881 | ||
|
|
0620410072 | ||
|
|
ea758edb5e | ||
|
|
1ded375f6f | ||
|
|
c67267b589 | ||
|
|
b1eba86445 | ||
|
|
53accdb446 | ||
|
|
3b40ae3ad3 | ||
|
|
298271fc2b | ||
|
|
7b965bac71 | ||
|
|
e930a0f8ac | ||
|
|
10133b16b3 | ||
|
|
f610c1a8b1 | ||
|
|
e7aed3bab3 | ||
|
|
081ffe2c11 | ||
|
|
3e7b101dbf | ||
|
|
0e50e9b26a | ||
|
|
b7c9c53176 | ||
|
|
d75e9b7a4b | ||
|
|
a967cd8541 | ||
|
|
ea42653ae8 | ||
|
|
0ce5a2eb2b | ||
|
|
e75d28cfca | ||
|
|
224503f6bb | ||
|
|
86aa866626 | ||
|
|
067a22ff90 | ||
|
|
673cff8eed | ||
|
|
413bdb7b38 | ||
|
|
5e81f9c720 | ||
|
|
22078bd774 | ||
|
|
c33716c7b5 | ||
|
|
587c9cb46f | ||
|
|
dda020b2bf | ||
|
|
6fba1b0153 | ||
|
|
cf04bf8018 | ||
|
|
c1caff8005 | ||
|
|
04ccefbcf8 | ||
|
|
6d32e534dc | ||
|
|
293dcb93d6 | ||
|
|
6cb716516d | ||
|
|
aa3079673f | ||
|
|
37e77a53f9 | ||
|
|
7969df4e4c | ||
|
|
4b06e14df6 | ||
|
|
da9c5edcc6 | ||
|
|
109fc7f1fa | ||
|
|
cc381513ef | ||
|
|
1ad19a7d45 | ||
|
|
3185bb6031 | ||
|
|
630c21b07a | ||
|
|
6594b8532e | ||
|
|
c6de4c7650 | ||
|
|
7297f7a894 | ||
|
|
0f5b790461 | ||
|
|
783af42b1a | ||
|
|
ab5426e6bb | ||
|
|
464345ee5f | ||
|
|
bafa9a26c6 | ||
|
|
5d08906afd |
19
.github/workflows/docker.yml
vendored
19
.github/workflows/docker.yml
vendored
@@ -1,21 +1,20 @@
|
||||
name: Reproducible Build Check
|
||||
name: Check reproducible-build Dockerfile
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 5 * * *'
|
||||
- cron: "0 5 * * *"
|
||||
|
||||
permissions:
|
||||
contents: read # to fetch code (actions/checkout)
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build image
|
||||
run: cd reproducible-builds && docker build -t signal-android . && cd ..
|
||||
|
||||
- name: Test build
|
||||
run: docker run --rm -v $(pwd):/project -w /project signal-android ./gradlew clean assemblePlayProdRelease
|
||||
- uses: actions/checkout@v6
|
||||
- name: Build image
|
||||
run: |
|
||||
cd reproducible-builds
|
||||
docker build -t signal-android .
|
||||
- name: Test build
|
||||
run: docker run --memory=12g --rm -v "$(pwd)":/project -w /project signal-android ./gradlew --no-daemon --max-workers=1 -Dorg.gradle.jvmargs="-Xmx4g -XX:MaxMetaspaceSize=512m" -Dkotlin.compiler.execution.strategy=in-process bundlePlayProdRelease
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -32,3 +32,4 @@ maps.key
|
||||
/local/
|
||||
kls_database.db
|
||||
.kotlin
|
||||
lefthook-local.yml
|
||||
|
||||
@@ -62,7 +62,7 @@ You will need to [sign our CLA](https://signal.org/cla/) before your pull reques
|
||||
### Follow the Code Style Guidelines
|
||||
Ensure that your code adheres to the [Code Style Guidelines](https://github.com/signalapp/Signal-Android/wiki/Code-Style-Guidelines) before submitting a pull request.
|
||||
|
||||
You can run `./gradlew format` to automatically check conformance with some of these guidelines.
|
||||
You can run `./gradlew format` to automatically format your code. See `lefthook.yml` for instructions on how to run this as a git hook.
|
||||
|
||||
### Submit finished and well-tested pull requests
|
||||
Please do not submit pull requests that are still a work in progress. Pull requests should be thoroughly tested and ready to merge before they are submitted.
|
||||
|
||||
@@ -1,10 +1,17 @@
|
||||
@file:Suppress("UnstableApiUsage")
|
||||
|
||||
import com.android.build.api.dsl.ManagedVirtualDevice
|
||||
import org.gradle.api.file.DirectoryProperty
|
||||
import org.gradle.api.file.RegularFileProperty
|
||||
import org.gradle.api.provider.ValueSource
|
||||
import org.gradle.api.provider.ValueSourceParameters
|
||||
import org.gradle.api.tasks.InputDirectory
|
||||
import org.gradle.api.tasks.InputFile
|
||||
import org.gradle.api.tasks.Optional
|
||||
import org.gradle.api.tasks.PathSensitive
|
||||
import org.gradle.api.tasks.PathSensitivity
|
||||
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
|
||||
import java.io.FileInputStream
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Date
|
||||
import java.io.File
|
||||
import java.util.Properties
|
||||
|
||||
plugins {
|
||||
@@ -13,6 +20,7 @@ plugins {
|
||||
alias(libs.plugins.ktlint)
|
||||
alias(libs.plugins.compose.compiler)
|
||||
alias(libs.plugins.kotlinx.serialization)
|
||||
alias(benchmarkLibs.plugins.baselineprofile)
|
||||
id("androidx.navigation.safeargs")
|
||||
id("kotlin-parcelize")
|
||||
id("com.squareup.wire")
|
||||
@@ -22,12 +30,25 @@ plugins {
|
||||
|
||||
apply(from = "static-ips.gradle.kts")
|
||||
|
||||
val canonicalVersionCode = 1627
|
||||
val canonicalVersionName = "7.67.1"
|
||||
val canonicalVersionCode = 1648
|
||||
val canonicalVersionName = "7.74.0"
|
||||
val currentHotfixVersion = 0
|
||||
val maxHotfixVersions = 100
|
||||
|
||||
val keystores: Map<String, Properties?> = mapOf("debug" to loadKeystoreProperties("keystore.debug.properties"))
|
||||
// We don't want versions to ever end in 0 so that they don't conflict with nightly versions
|
||||
val possibleHotfixVersions = (0 until maxHotfixVersions).toList().filter { it % 10 != 0 }
|
||||
|
||||
val debugKeystorePropertiesProvider = providers.of(PropertiesFileValueSource::class.java) {
|
||||
parameters.file.set(rootProject.layout.projectDirectory.file("keystore.debug.properties"))
|
||||
}
|
||||
|
||||
val languagesProvider = providers.of(LanguageListValueSource::class.java) {
|
||||
parameters.resDir.set(layout.projectDirectory.dir("src/main/res"))
|
||||
}
|
||||
|
||||
val languagesForBuildConfigProvider = languagesProvider.map { languages ->
|
||||
languages.joinToString(separator = ", ") { language -> "\"$language\"" }
|
||||
}
|
||||
|
||||
val selectableVariants = listOf(
|
||||
"nightlyBackupRelease",
|
||||
@@ -40,6 +61,8 @@ val selectableVariants = listOf(
|
||||
"playProdSpinner",
|
||||
"playProdCanary",
|
||||
"playProdPerf",
|
||||
"playProdMocked",
|
||||
"playProdNonMinifiedMocked",
|
||||
"playProdBenchmark",
|
||||
"playProdInstrumentation",
|
||||
"playProdRelease",
|
||||
@@ -50,17 +73,11 @@ val selectableVariants = listOf(
|
||||
"playStagingInstrumentation",
|
||||
"playStagingRelease",
|
||||
"websiteProdSpinner",
|
||||
"websiteProdRelease"
|
||||
"websiteProdRelease",
|
||||
"githubProdSpinner",
|
||||
"githubProdRelease"
|
||||
)
|
||||
|
||||
val signalBuildToolsVersion: String by rootProject.extra
|
||||
val signalCompileSdkVersion: String by rootProject.extra
|
||||
val signalTargetSdkVersion: Int by rootProject.extra
|
||||
val signalMinSdkVersion: Int by rootProject.extra
|
||||
val signalNdkVersion: String by rootProject.extra
|
||||
val signalJavaVersion: JavaVersion by rootProject.extra
|
||||
val signalKotlinJvmTarget: String by rootProject.extra
|
||||
|
||||
wire {
|
||||
kotlin {
|
||||
javaInterop = true
|
||||
@@ -71,22 +88,22 @@ wire {
|
||||
}
|
||||
|
||||
protoPath {
|
||||
srcDir("${project.rootDir}/libsignal-service/src/main/protowire")
|
||||
srcDir("${project.rootDir}/lib/libsignal-service/src/main/protowire")
|
||||
}
|
||||
// Handled by libsignal
|
||||
prune("signalservice.DecryptionErrorMessage")
|
||||
}
|
||||
|
||||
ktlint {
|
||||
version.set("1.2.1")
|
||||
version.set("1.5.0")
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "org.thoughtcrime.securesms"
|
||||
|
||||
buildToolsVersion = signalBuildToolsVersion
|
||||
compileSdkVersion = signalCompileSdkVersion
|
||||
ndkVersion = signalNdkVersion
|
||||
buildToolsVersion = libs.versions.buildTools.get()
|
||||
compileSdkVersion = libs.versions.compileSdk.get()
|
||||
ndkVersion = libs.versions.ndk.get()
|
||||
|
||||
flavorDimensions += listOf("distribution", "environment")
|
||||
testBuildType = "instrumentation"
|
||||
@@ -94,12 +111,12 @@ android {
|
||||
android.bundle.language.enableSplit = false
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = signalKotlinJvmTarget
|
||||
jvmTarget = libs.versions.kotlinJvmTarget.get()
|
||||
freeCompilerArgs = listOf("-Xjvm-default=all")
|
||||
suppressWarnings = true
|
||||
}
|
||||
|
||||
keystores["debug"]?.let { properties ->
|
||||
debugKeystorePropertiesProvider.orNull?.let { properties ->
|
||||
signingConfigs.getByName("debug").apply {
|
||||
storeFile = file("${project.rootDir}/${properties.getProperty("storeFile")}")
|
||||
storePassword = properties.getProperty("storePassword")
|
||||
@@ -139,8 +156,8 @@ android {
|
||||
|
||||
compileOptions {
|
||||
isCoreLibraryDesugaringEnabled = true
|
||||
sourceCompatibility = signalJavaVersion
|
||||
targetCompatibility = signalJavaVersion
|
||||
sourceCompatibility = JavaVersion.toVersion(libs.versions.javaVersion.get())
|
||||
targetCompatibility = JavaVersion.toVersion(libs.versions.javaVersion.get())
|
||||
}
|
||||
|
||||
packaging {
|
||||
@@ -162,7 +179,8 @@ android {
|
||||
"META-INF/LICENSE-notice.md",
|
||||
"META-INF/proguard/androidx-annotations.pro",
|
||||
"**/*.dylib",
|
||||
"**/*.dll"
|
||||
"**/*.dll",
|
||||
"**/*.proto"
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -178,11 +196,14 @@ android {
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
versionCode = (canonicalVersionCode * maxHotfixVersions) + currentHotfixVersion
|
||||
if (currentHotfixVersion >= maxHotfixVersions) {
|
||||
throw AssertionError("Hotfix version offset is too large!")
|
||||
}
|
||||
versionCode = (canonicalVersionCode * maxHotfixVersions) + possibleHotfixVersions[currentHotfixVersion]
|
||||
versionName = canonicalVersionName
|
||||
|
||||
minSdk = signalMinSdkVersion
|
||||
targetSdk = signalTargetSdkVersion
|
||||
minSdk = libs.versions.minSdk.get().toInt()
|
||||
targetSdk = libs.versions.targetSdk.get().toInt()
|
||||
|
||||
vectorDrawables.useSupportLibrary = true
|
||||
project.ext.set("archivesBaseName", "Signal")
|
||||
@@ -215,13 +236,13 @@ android {
|
||||
buildConfigField("String[]", "SIGNAL_CDSI_IPS", rootProject.extra["cdsi_ips"] as String)
|
||||
buildConfigField("String[]", "SIGNAL_SVR2_IPS", rootProject.extra["svr2_ips"] as String)
|
||||
buildConfigField("String", "SIGNAL_AGENT", "\"OWA\"")
|
||||
buildConfigField("String", "SVR2_MRENCLAVE_LEGACY", "\"093be9ea32405e85ae28dbb48eb668aebeb7dbe29517b9b86ad4bec4dfe0e6a6\"")
|
||||
buildConfigField("String", "SVR2_MRENCLAVE", "\"29cd63c87bea751e3bfd0fbd401279192e2e5c99948b4ee9437eafc4968355fb\"")
|
||||
buildConfigField("String", "SVR2_MRENCLAVE_LEGACY", "\"29cd63c87bea751e3bfd0fbd401279192e2e5c99948b4ee9437eafc4968355fb\"")
|
||||
buildConfigField("String", "SVR2_MRENCLAVE", "\"1240acbd4aa26974184844c8a46b1022d3957ac8a76c1fd8f5b1a15141ee0708\"")
|
||||
buildConfigField("String[]", "UNIDENTIFIED_SENDER_TRUST_ROOTS", "new String[]{ \"BXu6QIKVz5MA8gstzfOgRQGqyLqOwNKHL6INkv3IHWMF\", \"BUkY0I+9+oPgDCn4+Ac6Iu813yvqkDr/ga8DzLxFxuk6\"}")
|
||||
buildConfigField("String", "ZKGROUP_SERVER_PUBLIC_PARAMS", "\"AMhf5ywVwITZMsff/eCyudZx9JDmkkkbV6PInzG4p8x3VqVJSFiMvnvlEKWuRob/1eaIetR31IYeAbm0NdOuHH8Qi+Rexi1wLlpzIo1gstHWBfZzy1+qHRV5A4TqPp15YzBPm0WSggW6PbSn+F4lf57VCnHF7p8SvzAA2ZZJPYJURt8X7bbg+H3i+PEjH9DXItNEqs2sNcug37xZQDLm7X36nOoGPs54XsEGzPdEV+itQNGUFEjY6X9Uv+Acuks7NpyGvCoKxGwgKgE5XyJ+nNKlyHHOLb6N1NuHyBrZrgtY/JYJHRooo5CEqYKBqdFnmbTVGEkCvJKxLnjwKWf+fEPoWeQFj5ObDjcKMZf2Jm2Ae69x+ikU5gBXsRmoF94GXTLfN0/vLt98KDPnxwAQL9j5V1jGOY8jQl6MLxEs56cwXN0dqCnImzVH3TZT1cJ8SW1BRX6qIVxEzjsSGx3yxF3suAilPMqGRp4ffyopjMD1JXiKR2RwLKzizUe5e8XyGOy9fplzhw3jVzTRyUZTRSZKkMLWcQ/gv0E4aONNqs4P+NameAZYOD12qRkxosQQP5uux6B2nRyZ7sAV54DgFyLiRcq1FvwKw2EPQdk4HDoePrO/RNUbyNddnM/mMgj4FW65xCoT1LmjrIjsv/Ggdlx46ueczhMgtBunx1/w8k8V+l8LVZ8gAT6wkU5J+DPQalQguMg12Jzug3q4TbdHiGCmD9EunCwOmsLuLJkz6EcSYXtrlDEnAM+hicw7iergYLLlMXpfTdGxJCWJmP4zqUFeTTmsmhsjGBt7NiEB/9pFFEB3pSbf4iiUukw63Eo8Aqnf4iwob6X1QviCWuc8t0LUlT9vALgh/f2DPVOOmR0RW6bgRvc7DSF20V/omg+YBw==\"")
|
||||
buildConfigField("String", "GENERIC_SERVER_PUBLIC_PARAMS", "\"AByD873dTilmOSG0TjKrvpeaKEsUmIO8Vx9BeMmftwUs9v7ikPwM8P3OHyT0+X3EUMZrSe9VUp26Wai51Q9I8mdk0hX/yo7CeFGJyzoOqn8e/i4Ygbn5HoAyXJx5eXfIbqpc0bIxzju4H/HOQeOpt6h742qii5u/cbwOhFZCsMIbElZTaeU+BWMBQiZHIGHT5IE0qCordQKZ5iPZom0HeFa8Yq0ShuEyAl0WINBiY6xE3H/9WnvzXBbMuuk//eRxXgzO8ieCeK8FwQNxbfXqZm6Ro1cMhCOF3u7xoX83QhpN\"")
|
||||
buildConfigField("String", "BACKUP_SERVER_PUBLIC_PARAMS", "\"AJwNSU55fsFCbgaxGRD11wO1juAs8Yr5GF8FPlGzzvdJJIKH5/4CC7ZJSOe3yL2vturVaRU2Cx0n751Vt8wkj1bozK3CBV1UokxV09GWf+hdVImLGjXGYLLhnI1J2TWEe7iWHyb553EEnRb5oxr9n3lUbNAJuRmFM7hrr0Al0F0wrDD4S8lo2mGaXe0MJCOM166F8oYRQqpFeEHfiLnxA1O8ZLh7vMdv4g9jI5phpRBTsJ5IjiJrWeP0zdIGHEssUeprDZ9OUJ14m0v61eYJMKsf59Bn+mAT2a7YfB+Don9O\"")
|
||||
buildConfigField("String[]", "LANGUAGES", "new String[]{ ${languageList().map { "\"$it\"" }.joinToString(separator = ", ")} }")
|
||||
buildConfigField("String[]", "LANGUAGES", "new String[]{ ${languagesForBuildConfigProvider.get()} }")
|
||||
buildConfigField("int", "CANONICAL_VERSION_CODE", "$canonicalVersionCode")
|
||||
buildConfigField("String", "DEFAULT_CURRENCIES", "\"EUR,AUD,GBP,CAD,CNY\"")
|
||||
buildConfigField("String", "GIPHY_API_KEY", "\"3o6ZsYH6U6Eri53TXy\"")
|
||||
@@ -260,7 +281,7 @@ android {
|
||||
|
||||
buildTypes {
|
||||
getByName("debug") {
|
||||
if (keystores["debug"] != null) {
|
||||
if (debugKeystorePropertiesProvider.orNull != null) {
|
||||
signingConfig = signingConfigs["debug"]
|
||||
}
|
||||
isDefault = true
|
||||
@@ -341,6 +362,16 @@ android {
|
||||
buildConfigField("boolean", "TRACING_ENABLED", "true")
|
||||
}
|
||||
|
||||
create("mocked") {
|
||||
initWith(getByName("debug"))
|
||||
isDefault = false
|
||||
isDebuggable = false
|
||||
isMinifyEnabled = true
|
||||
matchingFallbacks += "debug"
|
||||
buildConfigField("String", "BUILD_VARIANT_TYPE", "\"Benchmark\"")
|
||||
buildConfigField("boolean", "TRACING_ENABLED", "true")
|
||||
}
|
||||
|
||||
create("canary") {
|
||||
initWith(getByName("debug"))
|
||||
isDefault = false
|
||||
@@ -366,17 +397,18 @@ android {
|
||||
buildConfigField("String", "BUILD_DISTRIBUTION_TYPE", "\"website\"")
|
||||
}
|
||||
|
||||
create("nightly") {
|
||||
val apkUpdateManifestUrl = if (file("${project.rootDir}/nightly-url.txt").exists()) {
|
||||
file("${project.rootDir}/nightly-url.txt").readText().trim()
|
||||
} else {
|
||||
"<unset>"
|
||||
}
|
||||
|
||||
create("github") {
|
||||
dimension = "distribution"
|
||||
versionNameSuffix = "-nightly-untagged-${getDateSuffix()}"
|
||||
buildConfigField("boolean", "MANAGES_APP_UPDATES", "true")
|
||||
buildConfigField("String", "APK_UPDATE_MANIFEST_URL", "\"${apkUpdateManifestUrl}\"")
|
||||
buildConfigField("boolean", "MANAGES_APP_UPDATES", "false")
|
||||
buildConfigField("String", "APK_UPDATE_MANIFEST_URL", "null")
|
||||
buildConfigField("String", "BUILD_DISTRIBUTION_TYPE", "\"github\"")
|
||||
}
|
||||
|
||||
create("nightly") {
|
||||
dimension = "distribution"
|
||||
versionNameSuffix = "-nightly-untagged-${getGitHash()}"
|
||||
buildConfigField("boolean", "MANAGES_APP_UPDATES", "false")
|
||||
buildConfigField("String", "APK_UPDATE_MANIFEST_URL", "null")
|
||||
buildConfigField("String", "BUILD_DISTRIBUTION_TYPE", "\"nightly\"")
|
||||
buildConfigField("boolean", "LINK_DEVICE_UX_ENABLED", "true")
|
||||
}
|
||||
@@ -402,8 +434,8 @@ android {
|
||||
buildConfigField("String", "SIGNAL_CDN3_URL", "\"https://cdn3-staging.signal.org\"")
|
||||
buildConfigField("String", "SIGNAL_CDSI_URL", "\"https://cdsi.staging.signal.org\"")
|
||||
buildConfigField("String", "SIGNAL_SVR2_URL", "\"https://svr2.staging.signal.org\"")
|
||||
buildConfigField("String", "SVR2_MRENCLAVE_LEGACY", "\"2e8cefe6e3f389d8426adb24e9b7fb7adf10902c96f06f7bbcee36277711ed91\"")
|
||||
buildConfigField("String", "SVR2_MRENCLAVE", "\"a75542d82da9f6914a1e31f8a7407053b99cc99a0e7291d8fbd394253e19b036\"")
|
||||
buildConfigField("String", "SVR2_MRENCLAVE_LEGACY", "\"a75542d82da9f6914a1e31f8a7407053b99cc99a0e7291d8fbd394253e19b036\"")
|
||||
buildConfigField("String", "SVR2_MRENCLAVE", "\"97f151f6ed078edbbfd72fa9cae694dcc08353f1f5e8d9ccd79a971b10ffc535\"")
|
||||
buildConfigField("String[]", "UNIDENTIFIED_SENDER_TRUST_ROOTS", "new String[]{\"BbqY1DzohE4NUZoVF+L18oUPrK3kILllLEJh2UnPSsEx\", \"BYhU6tPjqP46KGZEzRs1OL4U39V5dlPJ/X09ha4rErkm\"}")
|
||||
buildConfigField("String", "ZKGROUP_SERVER_PUBLIC_PARAMS", "\"ABSY21VckQcbSXVNCGRYJcfWHiAMZmpTtTELcDmxgdFbtp/bWsSxZdMKzfCp8rvIs8ocCU3B37fT3r4Mi5qAemeGeR2X+/YmOGR5ofui7tD5mDQfstAI9i+4WpMtIe8KC3wU5w3Inq3uNWVmoGtpKndsNfwJrCg0Hd9zmObhypUnSkfYn2ooMOOnBpfdanRtrvetZUayDMSC5iSRcXKpdlukrpzzsCIvEwjwQlJYVPOQPj4V0F4UXXBdHSLK05uoPBCQG8G9rYIGedYsClJXnbrgGYG3eMTG5hnx4X4ntARBgELuMWWUEEfSK0mjXg+/2lPmWcTZWR9nkqgQQP0tbzuiPm74H2wMO4u1Wafe+UwyIlIT9L7KLS19Aw8r4sPrXZSSsOZ6s7M1+rTJN0bI5CKY2PX29y5Ok3jSWufIKcgKOnWoP67d5b2du2ZVJjpjfibNIHbT/cegy/sBLoFwtHogVYUewANUAXIaMPyCLRArsKhfJ5wBtTminG/PAvuBdJ70Z/bXVPf8TVsR292zQ65xwvWTejROW6AZX6aqucUjlENAErBme1YHmOSpU6tr6doJ66dPzVAWIanmO/5mgjNEDeK7DDqQdB1xd03HT2Qs2TxY3kCK8aAb/0iM0HQiXjxZ9HIgYhbtvGEnDKW5ILSUydqH/KBhW4Pb0jZWnqN/YgbWDKeJxnDbYcUob5ZY5Lt5ZCMKuaGUvCJRrCtuugSMaqjowCGRempsDdJEt+cMaalhZ6gczklJB/IbdwENW9KeVFPoFNFzhxWUIS5ML9riVYhAtE6JE5jX0xiHNVIIPthb458cfA8daR0nYfYAUKogQArm0iBezOO+mPk5vCNWI+wwkyFCqNDXz/qxl1gAntuCJtSfq9OC3NkdhQlgYQ==\"")
|
||||
buildConfigField("String", "GENERIC_SERVER_PUBLIC_PARAMS", "\"AHILOIrFPXX9laLbalbA9+L1CXpSbM/bTJXZGZiuyK1JaI6dK5FHHWL6tWxmHKYAZTSYmElmJ5z2A5YcirjO/yfoemE03FItyaf8W1fE4p14hzb5qnrmfXUSiAIVrhaXVwIwSzH6RL/+EO8jFIjJ/YfExfJ8aBl48CKHgu1+A6kWynhttonvWWx6h7924mIzW0Czj2ROuh4LwQyZypex4GuOPW8sgIT21KNZaafgg+KbV7XM1x1tF3XA17B4uGUaDbDw2O+nR1+U5p6qHPzmJ7ggFjSN6Utu+35dS1sS0P9N\"")
|
||||
@@ -438,42 +470,43 @@ android {
|
||||
ignoreWarnings = true
|
||||
quiet = true
|
||||
disable += "LintError"
|
||||
}
|
||||
|
||||
applicationVariants.all {
|
||||
outputs
|
||||
.map { it as com.android.build.gradle.internal.api.ApkVariantOutputImpl }
|
||||
.forEach { output ->
|
||||
if (output.baseName.contains("nightly")) {
|
||||
var tag = getCurrentGitTag()
|
||||
if (!tag.isNullOrEmpty()) {
|
||||
if (tag.startsWith("v")) {
|
||||
tag = tag.substring(1)
|
||||
}
|
||||
output.versionNameOverride = tag
|
||||
output.outputFileName = output.outputFileName.replace(".apk", "-${output.versionNameOverride}.apk")
|
||||
} else {
|
||||
output.outputFileName = output.outputFileName.replace(".apk", "-$versionName.apk")
|
||||
}
|
||||
} else {
|
||||
output.outputFileName = output.outputFileName.replace(".apk", "-$versionName.apk")
|
||||
|
||||
if (currentHotfixVersion >= maxHotfixVersions) {
|
||||
throw AssertionError("Hotfix version is too large!")
|
||||
}
|
||||
}
|
||||
}
|
||||
lintConfig = rootProject.file("lint.xml")
|
||||
}
|
||||
|
||||
androidComponents {
|
||||
beforeVariants { variant ->
|
||||
variant.enable = variant.name in selectableVariants
|
||||
}
|
||||
onVariants { variant ->
|
||||
onVariants(selector().all()) { variant: com.android.build.api.variant.ApplicationVariant ->
|
||||
// Include the test-only library on debug builds.
|
||||
if (variant.buildType != "instrumentation") {
|
||||
variant.packaging.jniLibs.excludes.add("**/libsignal_jni_testing.so")
|
||||
}
|
||||
|
||||
// Starting with minSdk 23, Android leaves native libraries uncompressed, which is fine for the Play Store, but not for our self-distributed APKs.
|
||||
// This reverts it to the legacy behavior, compressing the native libraries, and drastically reducing the APK file size.
|
||||
if (variant.name.contains("website", ignoreCase = true) || variant.name.contains("github", ignoreCase = true)) {
|
||||
variant.packaging.jniLibs.useLegacyPackaging.set(true)
|
||||
}
|
||||
|
||||
// Version overrides
|
||||
if (variant.name.contains("nightly", ignoreCase = true)) {
|
||||
var tag = getNightlyTagForCurrentCommit()
|
||||
if (!tag.isNullOrEmpty()) {
|
||||
if (tag.startsWith("v")) {
|
||||
tag = tag.substring(1)
|
||||
}
|
||||
|
||||
// We add a multiple of maxHotfixVersions to nightlies to ensure we're always at least that many versions ahead
|
||||
val nightlyBuffer = (5 * maxHotfixVersions)
|
||||
val nightlyVersionCode = (canonicalVersionCode * maxHotfixVersions) + (getNightlyBuildNumber(tag) * 10) + nightlyBuffer
|
||||
|
||||
variant.outputs.forEach { output ->
|
||||
output.versionName.set(tag)
|
||||
output.versionCode.set(nightlyVersionCode)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -486,6 +519,40 @@ android {
|
||||
java.srcDir(path)
|
||||
}
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
getByName("mocked") {
|
||||
java.srcDir("$projectDir/src/benchmarkShared/java")
|
||||
manifest.srcFile("$projectDir/src/benchmarkShared/AndroidManifest.xml")
|
||||
}
|
||||
|
||||
getByName("benchmark") {
|
||||
java.srcDir("$projectDir/src/benchmarkShared/java")
|
||||
manifest.srcFile("$projectDir/src/benchmarkShared/AndroidManifest.xml")
|
||||
}
|
||||
}
|
||||
|
||||
applicationVariants.configureEach {
|
||||
outputs.configureEach {
|
||||
if (this is com.android.build.gradle.internal.api.BaseVariantOutputImpl) {
|
||||
outputFileName = outputFileName.replace(".apk", "-$versionName.apk")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
baselineProfile {
|
||||
warnings {
|
||||
disabledVariants = false
|
||||
}
|
||||
|
||||
mergeIntoMain = true
|
||||
|
||||
variants.create("mocked") {
|
||||
from(project(":baseline-profile"))
|
||||
}
|
||||
|
||||
dexLayoutOptimization = false
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@@ -493,21 +560,24 @@ dependencies {
|
||||
ktlintRuleset(libs.ktlint.twitter.compose)
|
||||
coreLibraryDesugaring(libs.android.tools.desugar)
|
||||
|
||||
implementation(project(":libsignal-service"))
|
||||
implementation(project(":paging"))
|
||||
implementation(project(":core-util"))
|
||||
implementation(project(":glide-config"))
|
||||
implementation(project(":video"))
|
||||
implementation(project(":device-transfer"))
|
||||
implementation(project(":image-editor"))
|
||||
implementation(project(":donations"))
|
||||
implementation(project(":debuglogs-viewer"))
|
||||
implementation(project(":contacts"))
|
||||
implementation(project(":qr"))
|
||||
implementation(project(":sticky-header-grid"))
|
||||
implementation(project(":photoview"))
|
||||
implementation(project(":core-ui"))
|
||||
implementation(project(":core-models"))
|
||||
implementation(project(":lib:libsignal-service"))
|
||||
implementation(project(":lib:paging"))
|
||||
implementation(project(":core:util"))
|
||||
implementation(project(":lib:glide"))
|
||||
implementation(project(":lib:video"))
|
||||
implementation(project(":lib:device-transfer"))
|
||||
implementation(project(":lib:image-editor"))
|
||||
implementation(project(":lib:donations"))
|
||||
implementation(project(":lib:debuglogs-viewer"))
|
||||
implementation(project(":lib:contacts"))
|
||||
implementation(project(":lib:qr"))
|
||||
implementation(project(":lib:sticky-header-grid"))
|
||||
implementation(project(":lib:photoview"))
|
||||
implementation(project(":lib:blurhash"))
|
||||
implementation(project(":core:ui"))
|
||||
implementation(project(":core:models"))
|
||||
implementation(project(":core:models-jvm"))
|
||||
implementation(project(":feature:camera"))
|
||||
|
||||
implementation(libs.androidx.fragment.ktx)
|
||||
implementation(libs.androidx.appcompat) {
|
||||
@@ -531,6 +601,8 @@ dependencies {
|
||||
implementation(libs.androidx.navigation.fragment.ktx)
|
||||
implementation(libs.androidx.navigation.ui.ktx)
|
||||
implementation(libs.androidx.navigation.compose)
|
||||
implementation(libs.androidx.navigation3.runtime)
|
||||
implementation(libs.androidx.navigation3.ui)
|
||||
implementation(libs.androidx.lifecycle.viewmodel.ktx)
|
||||
implementation(libs.androidx.lifecycle.livedata.ktx)
|
||||
implementation(libs.androidx.lifecycle.process)
|
||||
@@ -607,9 +679,10 @@ dependencies {
|
||||
implementation(libs.androidx.credentials.compat)
|
||||
implementation(libs.kotlinx.serialization.json)
|
||||
|
||||
implementation(project(":billing"))
|
||||
implementation(project(":lib:billing"))
|
||||
implementation(project(":feature:media-send"))
|
||||
|
||||
"spinnerImplementation"(project(":spinner"))
|
||||
"spinnerImplementation"(project(":lib:spinner"))
|
||||
|
||||
"canaryImplementation"(libs.square.leakcanary)
|
||||
|
||||
@@ -635,7 +708,7 @@ dependencies {
|
||||
}
|
||||
testImplementation(testLibs.conscrypt.openjdk.uber)
|
||||
testImplementation(testLibs.mockk)
|
||||
testImplementation(testFixtures(project(":libsignal-service")))
|
||||
testImplementation(testFixtures(project(":lib:libsignal-service")))
|
||||
testImplementation(testLibs.espresso.core)
|
||||
testImplementation(testLibs.kotlinx.coroutines.test)
|
||||
testImplementation(libs.androidx.compose.ui.test.junit4)
|
||||
@@ -656,31 +729,29 @@ dependencies {
|
||||
androidTestUtil(testLibs.androidx.test.orchestrator)
|
||||
}
|
||||
|
||||
fun assertIsGitRepo() {
|
||||
if (!file("${project.rootDir}/.git").exists()) {
|
||||
throw IllegalStateException("Must be a git repository to guarantee reproducible builds! (git hash is part of APK)")
|
||||
tasks.withType<Test>().configureEach {
|
||||
testLogging {
|
||||
events("failed")
|
||||
exceptionFormat = TestExceptionFormat.FULL
|
||||
showCauses = true
|
||||
showExceptions = true
|
||||
showStackTraces = true
|
||||
}
|
||||
}
|
||||
|
||||
fun getLastCommitTimestamp(): String {
|
||||
assertIsGitRepo()
|
||||
|
||||
return providers.exec {
|
||||
commandLine("git", "log", "-1", "--pretty=format:%ct")
|
||||
}.standardOutput.asText.get() + "000"
|
||||
}
|
||||
|
||||
fun getGitHash(): String {
|
||||
assertIsGitRepo()
|
||||
|
||||
return providers.exec {
|
||||
commandLine("git", "rev-parse", "HEAD")
|
||||
}.standardOutput.asText.get().trim().substring(0, 12)
|
||||
}
|
||||
|
||||
fun getCurrentGitTag(): String? {
|
||||
assertIsGitRepo()
|
||||
|
||||
fun getNightlyTagForCurrentCommit(): String? {
|
||||
val output = providers.exec {
|
||||
commandLine("git", "tag", "--points-at", "HEAD")
|
||||
}.standardOutput.asText.get().trim()
|
||||
@@ -693,63 +764,69 @@ fun getCurrentGitTag(): String? {
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<Test>().configureEach {
|
||||
testLogging {
|
||||
events("failed")
|
||||
exceptionFormat = TestExceptionFormat.FULL
|
||||
showCauses = true
|
||||
showExceptions = true
|
||||
showStackTraces = true
|
||||
fun getNightlyBuildNumber(tag: String?): Int {
|
||||
if (tag == null) {
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
||||
gradle.taskGraph.whenReady {
|
||||
if (gradle.startParameter.taskNames.any { it.contains("nightly", ignoreCase = true) }) {
|
||||
if (!file("${project.rootDir}/nightly-url.txt").exists()) {
|
||||
throw GradleException("Missing required file: nightly-url.txt")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun loadKeystoreProperties(filename: String): Properties? {
|
||||
val keystorePropertiesFile = file("${project.rootDir}/$filename")
|
||||
|
||||
return if (keystorePropertiesFile.exists()) {
|
||||
val keystoreProperties = Properties()
|
||||
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
|
||||
keystoreProperties
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
fun getDateSuffix(): String {
|
||||
return SimpleDateFormat("yyyy-MM-dd-HH:mm").format(Date())
|
||||
val match = Regex("-(\\d{3})$").find(tag)
|
||||
return match?.groupValues?.get(1)?.toIntOrNull() ?: 0
|
||||
}
|
||||
|
||||
fun getMapsKey(): String {
|
||||
val mapKey = file("${project.rootDir}/maps.key")
|
||||
return providers
|
||||
.gradleProperty("mapsKey")
|
||||
.orElse(providers.environmentVariable("MAPS_KEY"))
|
||||
.orElse("AIzaSyCSx9xea86GwDKGznCAULE9Y5a8b-TfN9U")
|
||||
.get()
|
||||
}
|
||||
|
||||
return if (mapKey.exists()) {
|
||||
mapKey.readLines()[0]
|
||||
} else {
|
||||
"AIzaSyCSx9xea86GwDKGznCAULE9Y5a8b-TfN9U"
|
||||
abstract class LanguageListValueSource : ValueSource<List<String>, LanguageListValueSource.Params> {
|
||||
interface Params : ValueSourceParameters {
|
||||
@get:InputDirectory
|
||||
@get:PathSensitive(PathSensitivity.RELATIVE)
|
||||
val resDir: DirectoryProperty
|
||||
}
|
||||
|
||||
override fun obtain(): List<String> {
|
||||
// In API 35, language codes for Hebrew and Indonesian now use the ISO 639-1 code ("he" and "id").
|
||||
// However, the value resources still only support the outdated code ("iw" and "in") so we have
|
||||
// to manually indicate that we support these languages.
|
||||
val updatedLanguageCodes = listOf("he", "id")
|
||||
|
||||
val resRoot = parameters.resDir.asFile.get()
|
||||
|
||||
val languages = resRoot
|
||||
.walkTopDown()
|
||||
.filter { it.isFile && it.name == "strings.xml" }
|
||||
.mapNotNull { stringFile -> stringFile.parentFile?.name }
|
||||
.map { valuesFolderName -> valuesFolderName.removePrefix("values-") }
|
||||
.filter { valuesFolderName -> valuesFolderName != "values" }
|
||||
.map { languageCode -> languageCode.replace("-r", "_") }
|
||||
.toList()
|
||||
.distinct()
|
||||
.sorted()
|
||||
|
||||
return languages + updatedLanguageCodes + "en"
|
||||
}
|
||||
}
|
||||
|
||||
fun Project.languageList(): List<String> {
|
||||
// In API 35, language codes for Hebrew and Indonesian now use the ISO 639-1 code ("he" and "id").
|
||||
// However, the value resources still only support the outdated code ("iw" and "in") so we have
|
||||
// to manually indicate that we support these languages.
|
||||
val updatedLanguageCodes = listOf("he", "id")
|
||||
abstract class PropertiesFileValueSource : ValueSource<Properties?, PropertiesFileValueSource.Params> {
|
||||
interface Params : ValueSourceParameters {
|
||||
@get:InputFile
|
||||
@get:Optional
|
||||
@get:PathSensitive(PathSensitivity.RELATIVE)
|
||||
val file: RegularFileProperty
|
||||
}
|
||||
|
||||
return fileTree("src/main/res") { include("**/strings.xml") }
|
||||
.map { stringFile -> stringFile.parentFile.name }
|
||||
.map { valuesFolderName -> valuesFolderName.replace("values-", "") }
|
||||
.filter { valuesFolderName -> valuesFolderName != "values" }
|
||||
.map { languageCode -> languageCode.replace("-r", "_") }
|
||||
.distinct()
|
||||
.sorted() + updatedLanguageCodes + "en"
|
||||
override fun obtain(): Properties? {
|
||||
val f: File = parameters.file.asFile.get()
|
||||
if (!f.exists()) return null
|
||||
|
||||
return Properties().apply {
|
||||
f.inputStream().use { load(it) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun String.capitalize(): String {
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user