Skip to content

build(android): fix instrumented tests, shrink the native library, update rusqlite to 0.41 - #438

Open
kennyfs wants to merge 3 commits into
Oppzippy:masterfrom
kennyfs:build-fixes-and-rusqlite
Open

kennyfs wants to merge 3 commits into
Oppzippy:masterfrom
kennyfs:build-fixes-and-rusqlite

Conversation

@kennyfs

@kennyfs kennyfs commented Nov 10, 2026 •

Copy link
Copy Markdown

Summary

Three small build and dependency changes. They came out of a larger Android UI change (#439) but don't depend on it, so they're split out here for easier review. Each commit stands on its own, so feel free to drop any of them.

  • build(android): run the Hilt annotation processor for instrumented tests. android/app/build.gradle.kts listed kspTest(libs.dagger.hilt.android.compiler) twice (once under "For instrumentation tests") and never kspAndroidTest. Hilt therefore never generated the test components for androidTest, and every instrumented test failed with a missing TestComponentDataSupplier. The first entry is now kspAndroidTest.
  • deps: update rusqlite to 0.41. rusqlite 0.40 → 0.41 and libsqlite3-sys 0.38 → 0.39, which bundles SQLite 3.54.1 and fixes RUSTSEC-2026-0459 (CVE-2026-119375). Exploiting it requires opening a database and WAL file written by someone else, which can't happen with the app's private database, so this isn't urgent, but the update is cheap.
  • build(android): optimize the native library for size. Sets opt-level = "z" and codegen-units = 1 for the release-android profile only, so desktop builds are unaffected. The native library is about 70% of the APK, and nothing in it is performance sensitive (it mostly parses and builds small Bluetooth packets). The stripped arm64-v8a library shrinks from 8.3 MB to 4.8 MB, and the arm64-v8a APK from 11.8 MB to 8.3 MB.

Testing

Tested together with #439:

  • cargo test -p openscq30-lib --lib --features bundled-dependencies: 228/228 passed
  • Android JVM unit tests: 13/13 passed
  • Android instrumented tests on an Android 17 emulator (en-US locale): 20/20 passed. Without the first commit, all of them fail during Hilt setup.
  • Built and installed the arm64-v8a release-android APK

AI disclosure

These changes were developed with the help of Claude (AI, via Claude Code), and the commits carry Co-Authored-By trailers.

🤖 Generated with Claude Code

kennyfs and others added 3 commits November 10, 2026 18:15
The instrumented tests are Hilt tests, but the compiler was only added with kspTest, so every one of them
failed with a missing TestComponentDataSupplier.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015ExfGKqc1qgteZLvhaNzew
Bundles SQLite 3.54.1, which fixes RUSTSEC-2026-0459 (CVE-2026-119375). Exploiting it requires opening a
database and WAL file written by someone else, which can't happen with the app's private database, but the
update is free.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015ExfGKqc1qgteZLvhaNzew
The native library is about 70% of the APK, and nothing it does is performance sensitive. With opt-level z
and a single codegen unit the stripped arm64 library shrinks from 8.3 MB to 4.8 MB, and the arm64 APK from
11.8 MB to 8.3 MB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015ExfGKqc1qgteZLvhaNzew
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant