Commit Graph

12 Commits

Author SHA1 Message Date
amir 6801a60183 bump versionCode to 10 / versionName to 1.9, enable BuildConfig generation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-25 03:30:59 +00:00
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
amir 695c54f03c v1.8: fix black screen on resume and crash on sync
- onResume() no longer triggers a refresh every time — only fetches when
  data is >5 min stale, so returning to app shows cached data instantly
  without a loading spinner
- Fix CancellationException being swallowed by catch(Exception) in
  refreshUsage(), which caused updates to run on a destroyed activity
- EncryptedSharedPreferences key invalidation (caused by enabling/changing
  biometrics or screen lock) now deletes the stale encrypted file and
  recreates it cleanly, rather than silently using empty fallback prefs
- Wrap all securePrefs read/write ops in try-catch so a mid-session
  Keystore failure degrades gracefully instead of crashing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 20:59:10 +00:00
amir 3dc0448942 v1.7: fix widget losing data after screen lock/reboot
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>
2026-05-22 18:39:56 +00:00
amir 8d1cf21966 v1.6: fix HIGH security vuln — remove plaintext cookie backup
- 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>
2026-05-22 18:28:26 +00:00
amir b3b69dd2b2 v1.5: time-based rotation angle — constant speed regardless of IPC load 2026-05-22 16:10:09 +00:00
amir 8965477cc7 v1.4: faster rotation (12deg/frame = ~1 full spin per second) 2026-05-22 16:02:33 +00:00
amir f6f7accfa5 v1.3: smooth 30fps rotation (6° steps), guaranteed minimum one full spin per tap 2026-05-22 16:00:17 +00:00
amir d86ffabb98 v1.2: fix rotation — use full updateWidget calls with currentRotation state instead of unreliable partiallyUpdateAppWidget 2026-05-22 15:55:47 +00:00
amir fafa5a3bb7 v1.2: refresh icon rotates while fetching (12fps via partial RemoteViews updates) 2026-05-22 15:49:13 +00:00
amir adb389984e v1.1: refresh icon turns orange when refreshing, reset times show day/time, weekly reset time added, release signing configured 2026-05-22 15:39:33 +00:00
amir 33ac02ead4 Initial release: Claude Pro usage widget for Android 2026-05-22 15:11:56 +00:00