Repository navigation
新增双轨快传(USB ADB + Wi-Fi 聚合)云端后端与零落盘极速流式备份管道 - #501
Open
Paramecium-max wants to merge 3 commits into
Open
Paramecium-max wants to merge 3 commits into
Paramecium-max wants to merge 3 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景与痛点
在手机存储空间接近满盘(例如仅剩 1GB 左右),但需要备份微信、大型游戏等数十 GB 数据时,传统云端备份需要先在手机本地生成完整 .tar.zst 归档后再上传,容易触发存储不足报错,且单通道网络传输速度受限。
主要改动
内嵌双轨/多轨传输引擎 (:core:hfx & :native)
借鉴并整合了 weixiansen574/HybridFileXfer 的多通道聚合传输核心,支持 USB ADB(可配 1
24 路并行通道)与 Wi-Fi 网卡并发聚合传输;1GB)、逐块内联 CRC32 校验以及最大磁盘缓冲硬上限。修复了原引擎中的非循环写短写、缓冲区双重回收、断线线程收敛等问题,并在 :native 中新增堆外大内存缓冲支持。
新增 CloudType.HYBRID_XFER 云端后端与自定义调优界面
完整实现 CloudClient 及流式扩展接口 StreamingCloudClient(零 Room 数据库版本迁移),支持双轨高速备份与反向恢复;
新增配置页面 HybridXferSetup,支持用户自由调节:极速连续流开关、USB 并行通道数(124)、TCP Socket 缓冲区(18MB)、手机内存传输缓冲池(32MB
Root 流式打包管道与低空间保护
在 IRemoteRootService 扩展无锁流式命令通道,通过 nsenter + busybox sh + set -o pipefail 直接将 tar | zstd 压缩流经管道推向多通道,极速连续流模式下手机闪存占用为 0 MB;
关闭连续流时自动切入有界磁盘分片缓冲池(BoundedBufferPool),严格限制本地分片占用不超过设定上限且支持断线 STREAM_RESUME 续传;
兼容 GNU tar 打包期间后台进程改文件产生的非致命退出码 1,且保留原有 ZSTD/LZ4/TAR 压缩选项不变;
顺带修复了 RestoreServiceCloudImpl(应用/媒体)恢复结束未断开云端连接的问题。
配套电脑端接收程序 (tools/pc-receiver)
零外部依赖的纯 Java 8+ 常驻守护接收端,支持虚拟根路径沙箱(防路径穿越、跨平台路径兼容)、多核并行内联 CRC32 校验与 .hfxtmp 原子落盘,产出 100% 兼容原版 DataBackup 的标准归档目录结构。