Harden WebView nav + add test suite + fix lint for production
Build APK / build (push) Successful in 1m29s

Security:
- LoginActivity WebView now enforces a host allow-list in
  shouldOverrideUrlLoading: only claude.ai + required SSO/CDN hosts
  (Google, Apple, Cloudflare, gstatic, recaptcha) can navigate; everything
  else is blocked. market://intent:// still blocked; about:/data: allowed.
  Device-verified: claude.ai login + Cloudflare challenge still load.

Tests (33, pure-JVM JUnit4, no device needed):
- Extracted shouldRecordHistory() pure throttle decision (regression guard
  for the empty-history-chart bug) + HistoryThrottleTest.
- UsageDataTest (mergedWith last-good/partial-union, computed props),
  PaceCalcTest, PeakHoursTest.
- Added junit:junit:4.13.2 as testImplementation only.

Build quality:
- widget_layout.xml: suppress false-positive UseAppTint lint on the widget
  refresh button (app:tint doesn't work in RemoteViews; android:tint is
  correct here) so lintDebug is clean.

Verified locally: 33 unit tests pass, lintDebug 0 errors, signed
assembleRelease OK (apksigner verified, signer identity unchanged),
emulator smoke test launches + renders without crash.
This commit is contained in:
2026-06-10 11:12:02 +00:00
parent a6d930415c
commit 31e18ed5e9
8 changed files with 392 additions and 4 deletions
+3
View File
@@ -101,4 +101,7 @@ dependencies {
// Lifecycle
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.7.0")
// Unit tests (pure JVM — no Robolectric, no Android framework)
testImplementation("junit:junit:4.13.2")
}