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>
This commit is contained in:
2026-05-25 03:15:44 +00:00
parent 695c54f03c
commit ee68b11ad0
7 changed files with 90 additions and 53 deletions
+4 -4
View File
@@ -25,8 +25,8 @@
<ImageButton
android:id="@+id/btn_refresh"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_width="32dp"
android:layout_height="32dp"
android:src="@android:drawable/ic_menu_rotate"
android:background="@android:color/transparent"
android:tint="#999999"
@@ -87,7 +87,7 @@
android:layout_marginTop="3dp"
android:text=""
android:textColor="#666666"
android:textSize="9sp" />
android:textSize="11sp" />
<!-- 7-day window bar -->
<LinearLayout
@@ -135,7 +135,7 @@
android:layout_marginTop="3dp"
android:text=""
android:textColor="#666666"
android:textSize="9sp" />
android:textSize="11sp" />
<!-- Footer -->
<LinearLayout
@@ -25,8 +25,8 @@
<ImageButton
android:id="@+id/btn_refresh"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_width="28dp"
android:layout_height="28dp"
android:src="@android:drawable/ic_menu_rotate"
android:background="@android:color/transparent"
android:contentDescription="Refresh" />
@@ -66,7 +66,7 @@
android:layout_marginStart="6dp"
android:text=""
android:textColor="#555555"
android:textSize="8sp" />
android:textSize="10sp" />
</LinearLayout>
@@ -114,7 +114,7 @@
android:layout_marginStart="6dp"
android:text=""
android:textColor="#555555"
android:textSize="8sp" />
android:textSize="10sp" />
</LinearLayout>