From e6097e6360725ecd7e2b83d44b51fc385a307040 Mon Sep 17 00:00:00 2001 From: Ricardo Ezequiel <106978749+ricaezejo@users.noreply.github.com> Date: Sun, 8 Nov 2026 22:24:49 +0100 Subject: [PATCH 1/2] fix: raise Guava past GHSA-xxph-c9ww-hj94 Health Connect pulls Guava 32.0.0 into the release APK through kotlinx-coroutines-guava. A constraint lifts it to 33.7.2-android, the fixed release. Co-Authored-By: Claude Opus 5.5 --- app/build.gradle.kts | 1 + gradle/libs.versions.toml | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 6a0ef746..a85ed3e9 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -205,6 +205,7 @@ dependencies { implementation(libs.datastore.preferences) implementation(libs.health.connect) + constraints { implementation(libs.guava) } implementation(libs.coroutines.android) implementation(libs.core.ktx) implementation(libs.window) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index a44bb3fd..4a25552c 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -23,6 +23,9 @@ glance = "1.2.0" # Newer than the 2.7.1 Glance 1.2.0 asks for (built on a 2021 Room); named so the app can set WorkManager up itself (widget/WidgetWork.kt). work = "2.12.0" documentfile = "1.1.0" +# Not used directly: Health Connect pulls Guava 32.0.0 in through kotlinx-coroutines-guava, which OSV-Scanner flags +# (GHSA-xxph-c9ww-hj94). app/build.gradle.kts raises it to this fixed release. +guava = "33.7.2-android" # The baseline profile (app/src/main/baseline-prof.txt): profileinstaller writes it for ART on phones that install the APK # outside the Play Store, and the :baselineprofile module records it. profileinstaller = "1.4.1" @@ -65,6 +68,7 @@ coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines- window = { group = "androidx.window", name = "window", version.ref = "window" } core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" } bouncycastle = { group = "org.bouncycastle", name = "bcprov-jdk18on", version.ref = "bouncycastle" } +guava = { group = "com.google.guava", name = "guava", version.ref = "guava" } junit = { group = "junit", name = "junit", version.ref = "junit" } org-json = { group = "org.json", name = "json", version.ref = "orgJson" } robolectric = { group = "org.robolectric", name = "robolectric", version.ref = "robolectric" } From 35859c906913525ca404734c8e840cdbaf1659a6 Mon Sep 17 00:00:00 2001 From: Ricardo Ezequiel <106978749+ricaezejo@users.noreply.github.com> Date: Sun, 8 Nov 2026 22:41:15 +0100 Subject: [PATCH 2/2] ci: scan the release APK's libraries with OSV-Scanner On push, pull request and weekly, since new advisories arrive without any code change. Gradle keeps no lockfile, so CI writes one for releaseRuntimeClasspath through an init script; nothing is committed, so dependency bumps need no relock. Co-Authored-By: Claude Opus 5.5 --- .github/scripts/lock-all.gradle.kts | 5 ++++ .github/workflows/osv-scanner.yml | 45 +++++++++++++++++++++++++++++ .gitignore | 2 ++ 3 files changed, 52 insertions(+) create mode 100644 .github/scripts/lock-all.gradle.kts create mode 100644 .github/workflows/osv-scanner.yml diff --git a/.github/scripts/lock-all.gradle.kts b/.github/scripts/lock-all.gradle.kts new file mode 100644 index 00000000..fd4903fc --- /dev/null +++ b/.github/scripts/lock-all.gradle.kts @@ -0,0 +1,5 @@ +// CI only (.github/workflows/osv-scanner.yml): locks every configuration so `dependencies --write-locks` writes +// gradle.lockfile files for the scanner to read. Nothing is committed, so updating a dependency never needs a relock. +allprojects { + dependencyLocking { lockAllConfigurations() } +} diff --git a/.github/workflows/osv-scanner.yml b/.github/workflows/osv-scanner.yml new file mode 100644 index 00000000..a2d0cec9 --- /dev/null +++ b/.github/workflows/osv-scanner.yml @@ -0,0 +1,45 @@ +# OSV-Scanner over the libraries the release APK ships. Weekly too, since a new advisory against a library fails it +# without any change here. +name: Dependency scan + +on: + push: + branches: [main, develop] + pull_request: + schedule: + - cron: "0 6 * * 1" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + osv-scanner: + runs-on: ubuntu-26.04 + steps: + - uses: actions/checkout@v5 + + - uses: actions/setup-java@v5 + with: + distribution: temurin + java-version: 21 + + - uses: gradle/actions/setup-gradle@v5 + + - name: Install Android SDK packages + run: yes | "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" "platforms;android-37.2" "build-tools;36.0.0" > /dev/null + + # Gradle keeps no lockfile, so one is written here for the scanner: only the release APK's runtime libraries, since + # build tools (lint, KSP) and test libraries never reach a phone. + - name: Write the release lockfile + run: ./gradlew --init-script .github/scripts/lock-all.gradle.kts :app:dependencies --configuration releaseRuntimeClasspath --write-locks -q > /dev/null + + - name: OSV-Scanner + run: | + curl -sSfL -o osv-scanner https://github.com/google/osv-scanner/releases/download/v2.7.0/osv-scanner_linux_amd64 + echo "160c6253e2922e9e0a6a9771c5c4c40a4b3c6090b34a3cdd5e80c96cc2e4218b osv-scanner" | sha256sum -c - + chmod +x osv-scanner + ./osv-scanner scan source --lockfile app/gradle.lockfile diff --git a/.gitignore b/.gitignore index f7122567..498684f0 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,5 @@ captures/ *.keystore *.jks signing.env +# Written in CI for OSV-Scanner (.github/workflows/osv-scanner.yml), never committed. +*gradle.lockfile