File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Monica for Android/app/src/main/java/takagi/ru/monica/utils Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -3525,10 +3525,16 @@ class WebDavHelper(
35253525 sardine!! .createDirectory(backupDir)
35263526 }
35273527
3528- // 生成带时间戳的文件名
3528+ // 生成带时间戳的文件名,保留加密标识
35293529 val timestamp = SimpleDateFormat (" yyyyMMdd_HHmmss" , Locale .getDefault()).format(Date ())
35303530 val suffix = if (isPermanent) PERMANENT_SUFFIX else " "
3531- val fileName = " monica_backup_$timestamp$suffix .zip"
3531+ // 根据源文件名判断是否加密,保留 .enc.zip 后缀
3532+ val isEncrypted = file.name.endsWith(" .enc.zip" )
3533+ val fileName = if (isEncrypted) {
3534+ " monica_backup_$timestamp$suffix .enc.zip"
3535+ } else {
3536+ " monica_backup_$timestamp$suffix .zip"
3537+ }
35323538 val remotePath = " $backupDir /$fileName "
35333539
35343540 // 使用流式上传避免内存溢出
You can’t perform that action at this time.
0 commit comments