Skip to content

Commit

Permalink
Merge branch 'molly-7.13'
Browse files Browse the repository at this point in the history
  • Loading branch information
valldrac committed Aug 16, 2024
2 parents 99833b9 + 37635c5 commit e4cdbbb
Show file tree
Hide file tree
Showing 263 changed files with 19,748 additions and 9,152 deletions.
25 changes: 25 additions & 0 deletions .github/actions/disk-cleanup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Disk cleanup
description: "Free up disk space by removing unused pre-installed software."
runs:
using: composite
steps:
- name: Free up disk space
shell: bash
run: |
echo "Disk space before cleanup:"
df -h /
echo "Removing unused software..."
sudo rm -rf \
/opt/google/chrome \
/opt/microsoft/msedge \
/opt/microsoft/powershell \
/usr/lib/mono \
/usr/local/.ghcup \
/usr/local/share/chromium \
/usr/local/share/powershell \
/usr/share/dotnet \
/usr/share/swift \
echo "Disk space after cleanup:"
df -h /
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Free up disk space in runner
uses: ./.github/actions/disk-cleanup

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
Expand Down
51 changes: 28 additions & 23 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ apply {
from("fix-profm.gradle")
}

val canonicalVersionCode = 1439
val canonicalVersionName = "7.12.3"
val mollyRevision = 3
val canonicalVersionCode = 1443
val canonicalVersionName = "7.13.4"
val currentHotfixVersion = 1
val maxHotfixVersions = 100
val mollyRevision = 1

val sourceVersionNameWithRevision = "${canonicalVersionName}-${mollyRevision}"

Expand Down Expand Up @@ -169,9 +169,10 @@ android {

vectorDrawables.useSupportLibrary = true

// MOLLY: Ensure to add any new URLs to SignalServiceNetworkAccess.HOSTNAMES list
buildConfigField("long", "BUILD_TIMESTAMP", getLastCommitTimestamp() + "L")
// MOLLY: BUILD_TIMESTAMP may be zero in debug builds.
buildConfigField("long", "BUILD_OR_ZERO_TIMESTAMP", getLastCommitTimestamp() + "L")
buildConfigField("String", "GIT_HASH", "\"${getGitHash()}\"")
// MOLLY: Ensure to add any new URLs to SignalServiceNetworkAccess.HOSTNAMES list
buildConfigField("String", "SIGNAL_URL", "\"https://chat.signal.org\"")
buildConfigField("String", "STORAGE_URL", "\"https://storage.signal.org\"")
buildConfigField("String", "SIGNAL_CDN_URL", "\"https://cdn.signal.org\"")
Expand Down Expand Up @@ -246,6 +247,9 @@ android {
"proguard/proguard-automation.pro",
"proguard/proguard.cfg"
)

buildConfigField("long", "BUILD_OR_ZERO_TIMESTAMP", "0L")
buildConfigField("String", "GIT_HASH", "\"abc123def456\"")
}

getByName("release") {
Expand Down Expand Up @@ -373,7 +377,7 @@ android {
}
onVariants { variant ->
// Include the test-only library on debug builds.
if (variant.buildType != "debug") {
if (variant.buildType != "instrumentation") {
variant.packaging.jniLibs.excludes.add("**/libsignal_jni_testing.so")
}
}
Expand Down Expand Up @@ -549,6 +553,7 @@ dependencies {
androidTestImplementation(testLibs.mockito.kotlin)
androidTestImplementation(testLibs.mockk.android)
androidTestImplementation(testLibs.square.okhttp.mockserver)
androidTestImplementation(testLibs.diff.utils)

androidTestUtil(testLibs.androidx.test.orchestrator)
}
Expand All @@ -560,42 +565,42 @@ fun assertIsGitRepo() {
}

fun getLastCommitTimestamp(): String {
assertIsGitRepo()

ByteArrayOutputStream().use { stdout ->
val stdout = ByteArrayOutputStream()
return try {
exec {
commandLine = listOf("git", "log", "-1", "--pretty=format:%ct000")
standardOutput = stdout
}

return stdout.toString().trim()
stdout.toString().trim()
} catch (e: Throwable) {
logger.warn("Failed to get Git commit timestamp: ${e.message}. Using mtime of current build script.")
buildFile.lastModified().toString()
}
}

fun getGitHash(): String {
assertIsGitRepo()

ByteArrayOutputStream().use { stdout ->
val stdout = ByteArrayOutputStream()
return try {
exec {
commandLine = listOf("git", "rev-parse", "--short=12", "HEAD")
standardOutput = stdout
}

return stdout.toString().trim()
stdout.toString().trim()
} catch (e: Throwable) {
logger.warn("Failed to get Git commit hash: ${e.message}. Using default value.")
"abc123def456"
}
}

fun getCommitTag(): String {
assertIsGitRepo()

ByteArrayOutputStream().use { stdout ->
exec {
commandLine = listOf("git", "describe", "--tags", "--exact-match")
standardOutput = stdout
}

return stdout.toString().trim().takeIf { it.isNotEmpty() } ?: "untagged"
val stdout = ByteArrayOutputStream()
exec {
commandLine = listOf("git", "describe", "--tags", "--exact-match")
standardOutput = stdout
}
return stdout.toString().trim().takeIf { it.isNotEmpty() } ?: "untagged"
}

tasks.withType<Test>().configureEach {
Expand Down
Binary file modified app/src/androidTest/assets/backupTests/account-data.binproto
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.
Loading

0 comments on commit e4cdbbb

Please sign in to comment.