Skip to content

fix(android): disable Auto Backup of on-device health data (allowBackup=false)#253

Merged
RyRy79261 merged 1 commit into
mainfrom
fix/android-disable-backup
Jun 20, 2026
Merged

fix(android): disable Auto Backup of on-device health data (allowBackup=false)#253
RyRy79261 merged 1 commit into
mainfrom
fix/android-disable-backup

Conversation

@RyRy79261

Copy link
Copy Markdown
Owner

Why (from the secure-storage investigation)

I investigated moving the Bearer token to Android Keystore (as you asked). The research reframed the problem: that move is medium-cost (a 7-file async refactor) for marginal protection on the cheapest secret (a re-obtainable ~7-day opaque token) — and it misses the real exposure.

The actual currently-open hole: android:allowBackup="true" means a device-access adversary can adb backup the app sandbox, which holds the entire plaintext Dexie health-PII database (intake, weight, blood pressure, eating, meds, dose logs, …) plus the session token. Encrypting only the token would leave the crown jewels exposed.

This one-line fix (allowBackup="false") closes that vector for both the DB and the token, on all Android versions, zero dependencies — a strictly larger security win than the whole Keystore project.

Trade-off (your call to merge)

  • Android cloud / adb backup of app data is disabled. For a health-PII app this is the privacy-correct default (you don't want health data in Google cloud backup).
  • No data loss: the data syncs to Neon Postgres (the device isn't the system of record), so a reinstall/new device restores via sign-in + sync.
  • ⚠️ Flagging because it's a data-handling change — confirm you're comfortable that Neon sync is the recovery path before merging.

Deferred (deliberately)

  • Keystore secure-storage plugin: not worth it for a bundled local-assets app (the only real token threat is in-bundle XSS, which Keystore doesn't stop — it decrypts into JS memory). If on-device encryption is ever wanted, target the Dexie DB, not the token. Recommended plugin if you override: @aparajita/capacitor-secure-storage.
  • Token-logging audit: already clean (error-log-service logs path-only; captureFailure never includes headers/token).

Validation

…up=false)

Per the secure-storage investigation: the highest-value, cheapest on-device
hardening is not moving the token to Keystore — it's closing the `adb backup`
extraction path. With allowBackup="true" a device-access adversary could pull the
app sandbox, which holds the ENTIRE plaintext Dexie health PII DB (intake, vitals,
meds, dose logs, …) plus the session token. Setting allowBackup="false" removes
that vector for both, on all Android versions, with zero dependencies.

No user data is lost: the data syncs to Neon Postgres (the device is not the
system of record), so a reinstall/new device restores via sign-in + sync. The
trade-off is that Android cloud/`adb` backup of app data is disabled — which for
a health PII app is the privacy-correct default.

The Keystore-plugin move is deliberately deferred (medium-cost async refactor
across 7 files for marginal at-rest gain on a re-obtainable token); if on-device
encryption is later wanted, the target is the Dexie health DB, not the token.
@vercel

vercel Bot commented Jun 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
intake-tracker Ready Ready Preview, Comment Jun 20, 2026 2:31am

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@RyRy79261, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 28 minutes and 32 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4894536f-e1d3-4f93-abc8-25294d4a4383

📥 Commits

Reviewing files that changed from the base of the PR and between 130b380 and 81f1dec.

📒 Files selected for processing (1)
  • apps/native/android/app/src/main/AndroidManifest.xml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/android-disable-backup

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@RyRy79261 RyRy79261 merged commit fbd77aa into main Jun 20, 2026
23 checks passed
@RyRy79261 RyRy79261 deleted the fix/android-disable-backup branch June 20, 2026 10:27
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