From 2ce508d6c3ea64eb8d94ea303843a798e5567310 Mon Sep 17 00:00:00 2001 From: Seimizu Joukan Date: Mon, 1 Dec 2025 23:36:17 +0900 Subject: [PATCH 1/2] Fix: Apply encryption to collection archives when encryption flags are specified - Added encryption step in collect_and_compress operation - Encryption now properly applied after compression but before moving to destination - Fixes issue where --encrypt-key and -e flags were ignored for collection operations - Output files now correctly have .jcze extension when encryption is enabled --- src/operations/collection.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/operations/collection.rs b/src/operations/collection.rs index 9f0d165..ce3c1c2 100644 --- a/src/operations/collection.rs +++ b/src/operations/collection.rs @@ -6,6 +6,7 @@ use crate::core::compressor::{Compressor, MultiFileCompressor}; use crate::core::config::{CollectionConfig, CollectionMode, CompressionConfig, TimestampOption}; use crate::core::error::{JcError, JcResult}; use crate::core::types::CompoundFormat; +use crate::operations::encrypt::encrypt_file; use crate::utils::{copy_recursive, create_temp_dir, debug, info, move_file, remove_file_silent}; /// Collect multiple files into a compressed archive @@ -131,6 +132,13 @@ pub fn collect_and_compress( tar_filename }; + // Apply encryption if specified + let final_output = if let Some(ref encryption_method) = collection_config.base.encryption { + encrypt_file(&final_output, encryption_method)? + } else { + final_output + }; + // Move to destination or current directory let destination = collection_config .base From 46889a43ab06e9404dd08a660bbc15eb166d930a Mon Sep 17 00:00:00 2001 From: Seimizu Joukan Date: Mon, 1 Dec 2025 23:38:42 +0900 Subject: [PATCH 2/2] Bump version to v0.2.4 --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 444b853..c479f3f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -481,7 +481,7 @@ checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" [[package]] name = "jcz" -version = "0.2.3" +version = "0.2.4" dependencies = [ "argon2", "assert_cmd", diff --git a/Cargo.toml b/Cargo.toml index db141f2..f657f55 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "jcz" -version = "0.2.3" +version = "0.2.4" edition = "2021" authors = ["JCZ Contributors"] description = "Just Compress Zip - A unified compression utility"