fix: add legacy-compatible Android phone link

This commit is contained in:
zhy200308
2026-08-12 16:40:43 +08:00
parent 2ff0741fff
commit ccaaab7002
12 changed files with 243 additions and 49 deletions
+8 -7
View File
@@ -1,4 +1,4 @@
# Android → Android 真机验收(v0.5.0-dev3)
# Android → Android 真机验收(v0.5.0-dev4)
## 构建约束
@@ -11,7 +11,7 @@ cd android
## 首轮验收
1. 两台 Android 安装同一个 `v0.5.0-dev3` APK。
1. 两台 Android 安装同一个 `v0.5.0-dev4` APK。
2. 发送手机进入“手机 → 手机”,选择至少两个文件并调整一次顺序。
3. 点击“创建发送二维码”,允许附近 Wi-Fi/位置权限。
4. 接收手机进入“扫码直传”,扫描发送手机二维码并确认系统连接提示。
@@ -21,11 +21,12 @@ cd android
## 必测网络组合
- Android 13+ → Android 13+:`NEARBY_WIFI_DEVICES` 权限与临时热点。
- Android 13+ 发送 → Android 7–9 接收:连续停止并重建两次发送热点;旧机每次均应使用二维码中的最新密码连接,不得复用同名热点旧凭据。
- Android 13+ → Android 13+:`NEARBY_WIFI_DEVICES` 权限与 2.4 GHz/WPA2 Wi-Fi Direct 兼容接入点。
- Android 13+ 发送 → Android 7–9 接收:旧机应能看到 `DIRECT-*` 专用网络;连续停止并重建两次,旧机每次均使用二维码中的最新密码连接。
- Android 13+ 发送 → Android 10–12 接收:新会话即使复用了热点名称,只要密码变化就必须创建新的系统配网请求。
- 高版本发送端返回纯 WPA3、旧接收机不支持 SAE:应立即转入原局域网自动探测,不应停留在系统热点搜索。
- Android 7 发送端:两机先连接同一 Wi-Fi,验证自动 LAN 回落。
- Wi-Fi Direct 被 OEM 禁用:发送端自动回落 LocalOnlyHotspot;纯 WPA3 且接收机不支持 SAE 时自动尝试原局域网,不应无限搜索。
- Android 7–9 发送 → Android 13+ 接收:至少传输一个 100 MiB 文件两次,均通过 SHA-256,不得再出现整文件重下后仍校验失败。
- Android 7 发送端:验证系统生成的 `DIRECT-*` WPA2 组可被高版本接收端自动加入;P2P 创建失败时再验证同局域网回落。
- 手动停止发送端热点:接收端应报连接中断,而不是无限等待。
- 传输中返回发送端首页:服务和临时热点应立即关闭。
@@ -39,5 +40,5 @@ cd android
- 仅文件,不包含文件夹。
- 发送与接收页面需保持前台;尚未引入前台服务。
- LocalOnlyHotspot 没有互联网是预期行为,文件只在本地链路传输。
- Wi-Fi Direct/LocalOnlyHotspot 没有互联网是预期行为,文件只在本地链路传输。
- Android ↔ iOS 不在本开发版本范围内。
+10 -7
View File
@@ -99,10 +99,10 @@ 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-dev3)
## 6. Android → Android (`QFTPHONE2`, v0.5.0-dev4)
The sender starts an authenticated local HTTP service and encodes only session,
port, sender identity and optional LocalOnlyHotspot credentials in the QR. The
port, sender identity and optional dedicated-network credentials in the QR. The
file queue is fetched after pairing so QR density is independent of queue size:
```text
@@ -117,8 +117,11 @@ 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 8+ prefers a system LocalOnlyHotspot. Android 7, or a hotspot failure,
falls back to literal private IPv4 endpoints on the current LAN. WPA2/WPA3
credentials are distinguished in `w[2]`. The receiver then reuses the existing
parallel Range ledger, retries and SHA-256-before-publish behavior for every
file, processing items in manifest order.
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
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
avoid concurrent-read corruption in older Android document providers; desktop
senders retain up to eight workers.