amir ee68b11ad0 v1.9: fix Android 16 status loss, bigger widget icons/fonts, security fixes
Android 16 bug: EncryptedSharedPreferences threw on ANY exception (Keystore
busy during screen-lock/BG wakeup) and the code deleted the encrypted prefs
file on any failure, permanently erasing session cookies. Now only
KeyPermanentlyInvalidatedException (biometric/PIN change) triggers delete;
transient failures preserve the file for the next session.

Also prevents saving cookies to plain-text fallback prefs if encrypted prefs
are unavailable.

WorkManager periodic (15 min, requires network) added alongside AlarmManager
as a Doze-mode backup for Android 16, where inexact alarms can be batched up
to 75 min.

UI: sync icon 24→32dp (large widget), 20→28dp (small); reset-time font
9→11sp (large), 8→10sp (small).

Security:
- All Log.d response-body and URL-bearing logs gated behind BuildConfig.DEBUG
- Cookie header value stripped of CRLF to prevent HTTP header injection
- LoginActivity coroutine migrated from bare CoroutineScope to lifecycleScope
- Widget removed from keyguard (lock-screen) category — usage data is sensitive

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-25 03:15:44 +00:00

Claude Usage Widget

Android home screen widget that shows your Claude Pro usage at a glance.

Features

  • SESSION bar — current 5-hour window utilization with reset time
  • WEEKLY bar — 7-day rolling usage with reset time
  • Tap the widget to open the app; tap ⟳ to force-refresh
  • Responsive: works as 4×1 (compact) or 4×2 (full)
  • Auto-refreshes every 5 minutes in the background

Install

  1. Download claude-usage-widget.apk from the latest release
  2. On your Android phone: Settings → Apps → Install unknown apps → allow your browser/file manager
  3. Open the downloaded APK and tap Install
  4. Open the Claude Usage app and sign in with your Claude.ai session cookies
  5. Long-press your home screen → Widgets → Claude Usage → drag to place

Sign-in

The app uses your Claude.ai browser cookies (not a password). In the app, tap Sign In, then paste your cookies from a logged-in Claude.ai browser session.

To get cookies: open claude.ai in Chrome → DevTools (F12) → Application → Cookies → copy the Cookie header value.

Requirements

  • Android 8.0+ (API 26)
  • Active Claude Pro subscription
S
Description
No description provided
Readme 43 MiB
v1.18 Latest
2026-06-04 16:40:00 +00:00
Languages
Kotlin 97.5%
Shell 2.5%