feat: release v0.1.1 with search and playback fix
This commit is contained in:
1 parent
52c840661b
commit
93f1221e6a
27 files changed
+1576
-23
No files matched your search
@@ -8,7 +8,9 @@ The application has one Android app module and no backend service.
|
||||
- `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.
|
||||
- `SearchRepository` uses official category search and the shared first-party session; pure `SearchJson` parses highlights, content identifiers, rights badges and bounded pagination. `SearchController` owns draft/submitted queries, category, deduplicated pages and cancellable requests. A generation guard also rejects non-cooperative late responses after a new query, category, clear, close or logout. It keeps no durable history.
|
||||
- `BulubuluHome`, dialogs and `TvAction` own TV layout/focus. Home stays composed beneath overlays, with focus/clicks disabled while inactive.
|
||||
- `SearchScreen` uses the device IME and the existing card components. It stays composed beneath details/player and restores result focus independently of Home.
|
||||
- `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.
|
||||
@@ -13,6 +13,10 @@
|
||||
|
||||
播放请求按普通 Web 客户端获取服务端允许的视频流,优先选择不高于常规 1080P 的 H.264 与 AAC,适合已知的 32 位 ARM Android 11 电视。清晰度由实际返回的轨道决定,登录和会员权益仍以 B 站接口结果为准。HTTP 图片/CDN链接升级到 HTTPS。
|
||||
|
||||
获取播放地址和下载音视频必须共用 `BiliHttpClient.USER_AGENT`。播放器的独立 HTTP 数据源由 `mediaHttpDataSourceFactory` 创建,携带内容 Referer,保留 Range 请求,不携带账号 Cookie。2026-11-04 目标电视对照验证:旧 Android 播放器标识使多个 CDN 返回 HTTP 403;同一批地址改用接口的浏览器标识后,三个视频地址及三个音频地址均可读取 MP4 数据。
|
||||
|
||||
`PlaybackNetworkDiagnosticTest` 提供显式启用的真实网络诊断,默认测试不访问外部服务。它使用独立匿名内存会话,比较旧标识和生产数据源,仅报告 CDN 主机、状态码和媒体文件头,不读取用户登录状态,不输出 Cookie 或带签名的完整地址。
|
||||
|
||||
## 明确处理的限制
|
||||
|
||||
- 不绕过登录、会员、购买、区域、付费或 DRM 检查。
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
# 搜索接口与范围
|
||||
|
||||
搜索直接使用 B 站官方 HTTPS 接口 `/x/web-interface/search/type`。三个分类分别传入 `video`、`media_ft` 和 `media_bangumi`,不使用第三方搜索、解析服务或作者自建接口。
|
||||
|
||||
## 搜索会话
|
||||
|
||||
官方搜索可能要求普通网站会话,即使用户没有登录。客户端首次搜索时,若没有对 `api.bilibili.com` 有效且未过期的 `buvid3` Cookie,就以现有浏览器 User-Agent 访问一次固定官方首页 `https://www.bilibili.com/`,只接收 Cookie 响应头并关闭响应,不读取、解析或执行首页内容。
|
||||
|
||||
该流程使用已有的 Cookie 域名、HTTPS、过期时间和登录 epoch 检查,Cookie 仍由 Android Keystore 加密保存,不输出值,不发送给图片或媒体 CDN。不伪造 `buvid3`,不额外提交设备指纹,不引入统计 SDK。有效会话存在时直接复用,Mutex 避免并发重复初始化。用户退出登录会清除这些 Cookie。
|
||||
|
||||
## 接口验证
|
||||
|
||||
2026-11-03 电脑侧匿名只读探测:
|
||||
|
||||
- 无有效网站 Cookie 时,服务端可能返回 `code=0`、`data={v_voucher: ...}`。这是一种风控挑战,不是“没有搜索结果”。客户端明确显示风控失败,不静默变成空列表。
|
||||
- 从官方首页获得真实 `buvid3` 后,普通 type 接口对“三体”的视频、番剧查询返回真实结果,对“流浪地球”的电影查询返回真实结果。
|
||||
- 对“三体”的电影查询确实无结果;响应有 `numResults=0`,但缺少 `result` 字段。只有明确的零数量元数据才允许把缺失结果当作空列表。
|
||||
- 同一真实会话、有效 WBI 签名下的 `/x/web-interface/wbi/search/type` 仍返回风控凭据。因此当前采用经过验证的普通官方 type 路径,不因接口名包含 WBI 就假定可用,也不反复重试风控挑战。
|
||||
|
||||
## 解析与分页
|
||||
|
||||
视频卡片保留 64 位 AV 标识及 BV 号,移除服务端标题的高亮标签,安全解码常见/numeric HTML 实体。时长如 `220:7` 规范为 `3:40:07`。
|
||||
|
||||
电影和番剧使用 `season_id` / `pgc_season_id` 及有效集数 ID,绝不把 `media_id` 当作季 ID。必要时只从 B 站官方播放 URL 识别 `ss` 或 `ep` 引用。卡片保留会员标签并复用现有详情、选集和权益检查。
|
||||
|
||||
分页以服务端实际页码、总页数或总数量为准,最多 50 页;未知分页停止追加,倒退页码不会导致循环加载。单页按内容标识去重,跨页去重由搜索状态控制器负责。
|
||||
|
||||
纯解析测试覆盖真实响应结构、标题/实体、长 ID、PGC 标识、会员标签、安全 URL、真正空结果、风控挑战、格式异常、分页边界及去重。上述接口探测不涉及用户账号或电视,应用验证另见 [VALIDATION.md](VALIDATION.md)。
|
||||
@@ -7,13 +7,18 @@ At a typical 960 × 540 dp TV viewport, the home screen has 38 dp horizontal and
|
||||
## Remote
|
||||
|
||||
- Home: direction keys move among tabs, cards, refresh, account and load more. Confirm selects a tab or opens video details. Back from the grid returns focus to the selected tab. Android's normal back handling applies from the header.
|
||||
- Search: the header entry opens a separate screen while preserving Home. Confirm on the text field opens the system IME; its Search action, Enter, or the explicit search button submits. Typing alone never requests results. Down moves to the selected video/movie/bangumi filter, then into the four/five-column result grid. Results use the existing details/episode/player flow. Back first hides the keyboard, then returns from the grid to the selected filter, then closes search. Clear returns to the input. Closing clears the transient query and results; there is no search history.
|
||||
- Details: first episode receives focus after loading. Confirm starts playback. Multi-part videos and series have an episode grid. Back closes the dialog.
|
||||
- Login: QR code is generated locally with ZXing, not uploaded to a QR service. Refresh and close are D-pad targets. Closing cancels the parent-owned poll task. No password input is present.
|
||||
- Player: confirm or play/pause toggles playback; left/right seek ten seconds, with long press throttled to one step per 250 ms. Up/down display controls. Back exits playback directly. Both key-down and key-up are consumed so Android PlayerView cannot apply the same event twice. Controls remain visible when paused/end/error and hide after four seconds during playback.
|
||||
- App backgrounding pauses the player; foregrounding resumes only if it was previously playing. Leaving the player releases Media3 and screen-on state.
|
||||
|
||||
Search remains composed beneath details and playback, with focus/clicks disabled while inactive. Returning restores the selected result and scroll position. Load more retains its focus during the request, then moves focus to the first appended result. If the final page adds no items, focus returns to the last result. Empty, error, risk-control and loading states do not use placeholder search results.
|
||||
|
||||
The player requests signed CDN URLs with a Bilibili Referer and browser User-Agent, without account cookies. It merges separate AVC/AAC fMP4 tracks through Media3, can use official backup CDN URLs after connection failure, and hides raw decoder/network exceptions that might include signed URLs. Actual decoder/remote behavior still needs testing on the target TV.
|
||||
|
||||
## Visual review
|
||||
|
||||
Prefer an emulator screenshot of the real Compose UI. If an HTML preview is used before an emulator is available, label it as a layout preview, use the dimensions/palette above and real fetched API data, and do not treat it as runtime verification. Community screenshots from unrelated clients are not assets for this app.
|
||||
|
||||
Current search runtime screenshots: [video results](screenshots/search.png) and [bangumi results](screenshots/search-bangumi.png).
|
||||
+30
-4
@@ -1,8 +1,8 @@
|
||||
# v0.1.0-alpha 验证记录
|
||||
# 验证记录
|
||||
|
||||
日期:2026-11-03。
|
||||
记录范围:2026-11-03 至 2026-11-04。
|
||||
|
||||
## 已验证
|
||||
## v0.1.0-alpha 已验证
|
||||
|
||||
- 使用 Gradle 8.9、JDK 17、Android SDK 35 构建开发版 APK。
|
||||
- JVM 单元测试:30 项通过,0 失败。覆盖 Cookie 域名/路径/HTTPS/有效期隔离、账号切换与退出后的迟到响应、WBI 签名、内容解析、播放格式与权限判断、遥控器跳转边界、错误提示不泄露原始网络地址。
|
||||
@@ -20,7 +20,33 @@
|
||||
- ARM32 雷鸟/TCL 电视的真实解码器、遥控器、焦点和分辨率适配。
|
||||
- 网络变化、官方接口或风控策略变化下的长期稳定性。
|
||||
|
||||
本次没有连接或安装到用户电视;设备测试固定使用 `emulator-5580`。
|
||||
首个 alpha 验证时没有连接或安装到用户电视;该阶段设备测试固定使用 `emulator-5580`。后续实机记录见下文。
|
||||
|
||||
## v0.1.1 搜索功能
|
||||
|
||||
- 开发版构建和 Android Lint 通过。
|
||||
- JVM 测试共 55 项通过,0 失败;新增 18 项搜索解析测试和 7 项搜索状态测试。覆盖官方响应格式、长 ID、会员标签、空结果和风控区别、分页边界、重复提交、取消后的迟到响应、清空/关闭、分类切换、跨页去重、草稿与已提交关键词隔离、失败重试及 Unicode 输入边界。
|
||||
- Android 11 ARM64 模拟器共 11 项设备测试通过,0 失败;新增 6 项搜索测试,验证从首页用方向键打开、中文输入和 IME 搜索提交、方向键切换分类、覆盖层焦点隔离和返回恢复、分页中焦点保持、追加结果后进入第一张新卡片及末页恢复。
|
||||
- 电脑侧匿名官方接口探测验证“三体”视频/番剧、“流浪地球”电影及真正零结果;Android 应用在模拟器中实际搜索“Switch”视频(1000 个结果)、“Fate”番剧(14 个结果)和“2”电影(56 个结果),显示远程封面、标题、附加信息和结果数量。`screenshots/search.png` 和 `screenshots/search-bangumi.png` 是真实运行截图。
|
||||
- 真实电影搜索追加第二页后,已在模拟器确认滚动并聚焦到第一张新增卡片。
|
||||
- 搜索复用既有详情和播放功能。完整真实账号与播放验证、目标电视输入法和遥控器仍待实测。
|
||||
- 搜索功能最初在电脑模拟器验证,之后随播放修复部署到目标电视,见后续记录。原 `v0.1.0-alpha` Git 标签保留。
|
||||
|
||||
## 目标电视安装 — 2026-11-04
|
||||
|
||||
- 已通过 ADB 在雷鸟/TCL 电视 `192.168.1.20:5555` 安装包含搜索功能的开发版,安装返回 `Success`。
|
||||
- 电视型号标识 `t982_ar31a8`,支持 `armeabi-v7a,armeabi`。
|
||||
- 启动返回 `Status: ok`,前台 Activity 确认为 `dev.bulubulu.tv/.MainActivity`。
|
||||
- 安装和启动通过;真实遥控器、输入法、登录和播放效果等待用户实测。
|
||||
|
||||
## 电视播放 HTTP 403 修复 — 2026-11-04
|
||||
|
||||
- 用户实测多段视频均提示“视频地址暂不可用”。通过独立匿名内存会话在目标电视对同一批地址进行对照:旧播放器 Android User-Agent 在四个备选 CDN 请求上得到 HTTP 403,而接口所用的浏览器 User-Agent 能读取全部三个视频和三个音频地址。
|
||||
- 播放器改用 `mediaHttpDataSourceFactory`,与接口共用 `BiliHttpClient.USER_AGENT`;内容 Referer、Range 和 CDN Cookie 隔离保持原有策略。
|
||||
- 修复版已覆盖安装;生产数据源的显式实机网络诊断通过,六个音视频候选地址均读取到 MP4 文件头。诊断不访问用户 Cookie,也不记录完整签名地址;临时安装的测试包已移除。
|
||||
- 电视实际播放投稿视频,界面显示 1080P,画面和播放进度正常推进至 `00:37 / 07:25`。`screenshots/playback-tv.png` 是实机运行截图。未据此宣称完整片长、听感、音画同步和所有会员内容均已验证。
|
||||
- 此次构建、55 项 JVM 测试和 Android Lint 通过。新增的真实网络诊断默认跳过,须传入 `livePlayback=true` 显式启用。
|
||||
- 用户实测后确认播放恢复正常,并同意提交为 `v0.1.1`;应用版本号为 `0.1.1`,Android `versionCode` 递增为 `2`。
|
||||
|
||||
## 复现
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 526 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.4 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 835 KiB |
Reference in new issue
Block a user