1 Commits
v1.5 ... v1.6

Author SHA1 Message Date
sakuradairong
bb7dc9a700 release: v1.6
fix: 彻底禁用桥接器 socket 超时(start(0)),restic 密钥生成在慢设备上可超过 5 分钟
fix: ConfigViewModel.initResticRepo 添加 15 分钟超时兜底
fix: SMB blob 上传校验大小一致性(重读远端文件验证)
fix: MissingAlgoProvider 合并 MD4 + AESCMAC 算法注入
fix: NanoHTTPD socket timeout = 0(无限超时)避免 blob 体读取中断
feat: ConfigViewModel initGuard 防重复初始化
feat: SMB 传输缓存复用避免跨桥接器认证重建
2026-06-05 23:53:28 +08:00
3 changed files with 19 additions and 9 deletions

View File

@@ -26,8 +26,8 @@ android {
applicationId "com.example.androidbackupgui"
minSdk 24
targetSdk 34
versionCode 6
versionName "1.5"
versionCode 7
versionName "1.6"
}
buildFeatures {
viewBinding true

View File

@@ -68,7 +68,7 @@ class RestBridgeRunner {
val bridge = ResticRestBridge(transport, remoteBase, cacheDir)
try {
bridge.start(300_000)
bridge.start(0)
val port = bridge.listeningPort
if (port < 0) {
throw IllegalStateException("REST bridge failed to bind a port")

View File

@@ -18,6 +18,7 @@ import kotlinx.coroutines.flow.asSharedFlow
import kotlinx.coroutines.flow.update
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import kotlinx.coroutines.withTimeoutOrNull
import java.io.File
import java.util.concurrent.atomic.AtomicBoolean
@@ -189,12 +190,21 @@ class ConfigViewModel(application: Application) : AndroidViewModel(application)
viewModelScope.launch {
try {
_operationEvents.emit(OperationEvent.InitStarted)
val result = ResticWrapper.init(form.repo, form.password,
backend = form.backend, backendUrl = form.backendUrl,
backendUser = form.backendUser, backendPass = form.backendPass,
backendShare = form.backendShare,
)
if (result.isSuccess) {
val result = withTimeoutOrNull(15 * 60 * 1000L) {
ResticWrapper.init(form.repo, form.password,
backend = form.backend, backendUrl = form.backendUrl,
backendUser = form.backendUser, backendPass = form.backendPass,
backendShare = form.backendShare,
)
}
if (result == null) {
_operationEvents.emit(OperationEvent.InitFailed)
Log.w(TAG, "initResticRepo timed out after 15 minutes")
_uiState.update { it.copy(resticStatus = it.resticStatus.copy(
message = "初始化超时15分钟请检查网络/SMB 服务器是否正常"
))}
refreshResticStatus(form)
} else if (result.isSuccess) {
_operationEvents.emit(OperationEvent.InitCompleted)
_uiState.update { it.copy(resticStatus = it.resticStatus.copy(
message = "仓库初始化成功: ${form.repo}"