Add an in-app 7-day history chart and opt-in usage alerts, the two
features requested from the macOS Claude-Usage-Tracker that map cleanly
to an Android widget app.
History:
- UsageSnapshot model; PreferencesManager records session/weekly
utilization on every refresh (7-day retention, <=600 points, collapses
readings under 2 min apart to avoid worker+manual double-logging).
- HistoryChartView: dependency-free Canvas line chart (session/weekly,
0/50/100% gridlines), breaks the line across >35-min gaps.
- New HISTORY card with chart + legend.
Notifications:
- Notifier posts when session/weekly crosses a user threshold, at most
once per limit window (keyed on reset-epoch, re-arms on rollover).
- USAGE ALERTS card: enable switch + session/weekly sliders (50-100%,
defaults 90/85). POST_NOTIFICATIONS permission + runtime request.
- Wired into the existing 5-min background worker.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- AndroidManifest: add networkSecurityConfig to explicitly trust only system
CAs, preventing user-installed CA cert MITM attacks on claude.ai sessions
- LoginActivity: set javaScriptCanOpenWindowsAutomatically=false (not needed
for claude.ai login) and databaseEnabled=false (deprecated WebSQL)
- build.gradle.kts: enable buildConfig generation (required for
BuildConfig.DEBUG guards already used in UsageRepository)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Two root causes:
- Alarms don't survive reboot — BootReceiver now restarts alarm + triggers
an immediate fetch on BOOT_COMPLETED
- onUpdate() drew from cached prefs but never fetched fresh data — now
triggers an immediate refresh so the widget is live on every launcher redraw
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove KEY_COOKIES_BACKUP plaintext fallback from PreferencesManager
- getCookies() now fails closed (force re-login) if EncryptedSharedPreferences unavailable
- Set android:allowBackup="false" to prevent adb backup extraction of session data
- Add missing gradle-wrapper.jar to repo
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>