Implement official QR login with encrypted sessions, recommendation/movie/bangumi tabs, TV focus navigation and Media3 playback controls. Include Gradle wrapper, preview tooling, privacy protections, tests and documented alpha validation limits.
15 lines
1.6 KiB
Markdown
15 lines
1.6 KiB
Markdown
# Architecture
|
|
|
|
The application has one Android app module and no backend service.
|
|
|
|
- `MainActivity` renders Compose, collects lifecycle-aware state and coordinates overlay focus restoration.
|
|
- `AppViewModel` owns feed pagination/cache, cancellable detail/playback requests, visible-screen QR polling and serialized account transitions.
|
|
- `AuthRepository` uses the official web QR flow with an isolated in-memory attempt. Only a verified active attempt can atomically replace the durable account session.
|
|
- `BiliHttpClient` validates official HTTPS API destinations, scopes cookies per network hop, bounds response sizes and propagates coroutine cancellation to OkHttp calls.
|
|
- `SessionStore` encrypts cookies with an Android Keystore AES-GCM key and writes an atomic file in `noBackupFilesDir`.
|
|
- `ContentRepository` retrieves official catalogue/details/playback responses; `WbiSigner` caches official signing material; pure `ContentJson` parsing separates format and entitlement checks from transport.
|
|
- `BulubuluHome`, dialogs and `TvAction` own TV layout/focus. Home stays composed beneath overlays, with focus/clicks disabled while inactive.
|
|
- `PlayerScreen` creates and releases Media3 with the composable lifecycle, merges separate AVC/AAC tracks and handles D-pad/media keys. CDN requests never receive account cookies.
|
|
|
|
There is no analytics, self-update service, local media scanning or private server. Login credentials and signed playback URLs must never appear in application logs or raw error messages. Account entitlements and region/DRM restrictions remain server-controlled. Tests use fake sessions in isolated storage and do not require a real account.
|