fix: keep modern Android phone links on fast bands

This commit is contained in:
zhy200308
2026-08-13 09:15:11 +08:00
parent ccaaab7002
commit b5014aea5b
6 changed files with 267 additions and 114 deletions
+5 -4
View File
@@ -1,4 +1,4 @@
# Android → Android 真机验收(v0.5.0-dev4)
# Android → Android 真机验收(v0.5.0-dev5)
## 构建约束
@@ -11,7 +11,7 @@ cd android
## 首轮验收
1. 两台 Android 安装同一个 `v0.5.0-dev4` APK。
1. 两台 Android 安装同一个 `v0.5.0-dev5` APK。
2. 发送手机进入“手机 → 手机”,选择至少两个文件并调整一次顺序。
3. 点击“创建发送二维码”,允许附近 Wi-Fi/位置权限。
4. 接收手机进入“扫码直传”,扫描发送手机二维码并确认系统连接提示。
@@ -21,11 +21,12 @@ cd android
## 必测网络组合
- Android 13+ → Android 13+:`NEARBY_WIFI_DEVICES` 权限与 2.4 GHz/WPA2 Wi-Fi Direct 兼容接入点。
- Android 13+ 发送 → Android 7–9 接收:旧机应能看到 `DIRECT-*` 专用网络;连续停止并重建两次,旧机每次均使用二维码中的最新密码连接。
- Android 13+ → Android 13+:`NEARBY_WIFI_DEVICES` 权限;专用网络先用自动频段,支持时应协商到 5 GHz,不得固定在 2.4 GHz。
- Android 13+ 发送 → Android 7–9 接收:旧机扫码后持续搜索同一个 `DIRECT-*`;发送端 12 秒未收到认证请求时,以相同 SSID/密码切换到 2.4 GHz,旧机无需重新扫码即可连接。
- Android 13+ 发送 → Android 10–12 接收:新会话即使复用了热点名称,只要密码变化就必须创建新的系统配网请求。
- Wi-Fi Direct 被 OEM 禁用:发送端自动回落 LocalOnlyHotspot;纯 WPA3 且接收机不支持 SAE 时自动尝试原局域网,不应无限搜索。
- Android 7–9 发送 → Android 13+ 接收:至少传输一个 100 MiB 文件两次,均通过 SHA-256,不得再出现整文件重下后仍校验失败。
- Android 10+ 高速链路:接收端在 12 秒内完成认证后,发送端不得切换频段或中断现有 5 GHz 连接。
- Android 7 发送端:验证系统生成的 `DIRECT-*` WPA2 组可被高版本接收端自动加入;P2P 创建失败时再验证同局域网回落。
- 手动停止发送端热点:接收端应报连接中断,而不是无限等待。
- 传输中返回发送端首页:服务和临时热点应立即关闭。
+7 -4
View File
@@ -99,7 +99,7 @@ The sender returns `206 Partial Content`, the matching `Content-Range`, and the
For both direct-transfer directions, the Windows listener may accept connections non-blockingly for shutdown responsiveness, but each accepted file socket is switched to blocking I/O with explicit timeouts before reading or writing request bodies. This prevents `WSAEWOULDBLOCK (10035)` from turning an in-progress parallel transfer into an HTTP 500 failure.
## 6. Android → Android (`QFTPHONE2`, v0.5.0-dev4)
## 6. Android → Android (`QFTPHONE2`, v0.5.0-dev5)
The sender starts an authenticated local HTTP service and encodes only session,
port, sender identity and optional dedicated-network credentials in the QR. The
@@ -117,9 +117,12 @@ The manifest contains a bounded ordered list of `name`, `size`, `sha256` and a
server-generated fixed download path. The receiver does not accept arbitrary
paths from the QR or manifest: entry `N` must use `/qft/phone/download/N`.
Android prefers a 2.4 GHz WPA2 Wi-Fi Direct group-owner AP that accepts legacy
Wi-Fi stations. An OEM P2P failure falls back to LocalOnlyHotspot, then literal
private IPv4 endpoints on the current LAN. WPA2/WPA3
Android 10+ first creates a WPA2 Wi-Fi Direct group-owner AP with automatic band
selection, normally allowing a 5 GHz link. If no authenticated peer arrives in
12 seconds, the sender recreates the group on 2.4 GHz with the exact same SSID
and passphrase, so an older receiver's pending scan continues without a new QR.
An OEM P2P failure falls back to LocalOnlyHotspot, then literal private IPv4
endpoints on the current LAN. WPA2/WPA3
credentials are distinguished in `w[2]`. The receiver reuses the existing Range
ledger, retries and SHA-256-before-publish behavior for every file, processing
items in manifest order. Phone senders use one deterministic Range worker to