Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/scripts/lock-all.gradle.kts
Original file line number Diff line number Diff line change
@@ -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() }
}
45 changes: 45 additions & 0 deletions .github/workflows/osv-scanner.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ captures/
*.keystore
*.jks
signing.env
# Written in CI for OSV-Scanner (.github/workflows/osv-scanner.yml), never committed.
*gradle.lockfile
1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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" }
Expand Down