Skip to content

Releases: hitmux/hitpag

v2.1.0

05 Apr 01:14

Choose a tag to compare

Changes

  • Add AGPL license header to target_conflict.h
  • Change default compression level to 0 (format-dependent)
  • Refactor path validation logic in args.cpp
  • Remove inaccurate magic number detection for gzip/bzip2
  • Simplify operation type detection in file_type.cpp
  • Keep unreplaced i18n placeholders for developer debugging
  • Add archive verification support for RAR, LZ4, ZSTD, XAR
  • Fix error_code scope bug in calculate_directory_size

v2.0.5

04 Apr 13:44

Choose a tag to compare

What's Changed

  • Refactor: Modularize codebase by splitting monolithic main.cpp
  • feat: add support for .tar.zst compression and decompression

Full Changelog: v2.0.4...v2.0.5

v2.0.4

19 Dec 14:15

Choose a tag to compare

What's Changed

Bug Fixes

  • Fixed split ZIP archive extraction (Issue #1) - Now automatically uses 7z for split ZIP files (.z01, .z02, ...)

Improvements

  • Refactored split ZIP detection code to eliminate duplication
  • Removed accidentally committed build artifacts from repository
  • Simplified README documentation with focus on quick start

Full Changelog

v2.0.3...v2.0.4

hitpag 2.0.3

01 Nov 07:08

Choose a tag to compare

Highlights

  • Added interactive overwrite/cancel/rename prompts with sequential default suggestions.
  • CLI now supports multiple source inputs for compression (wildcards welcome).
  • Strengthened target path validation and rename flow to prevent mistakes.

hitpag v2.0.2 revision

25 Aug 07:30
f639094

Choose a tag to compare

v2.0.2 Release Notes:

  • Intelligent file type detection system
  • Manual format override (--format option)
  • Enhanced file header detection and bounds checking
  • Improved memory safety and error handling
  • Better terminal settings recovery
  • Stronger parameter validation
  • Fixed edge cases in file type recognition

hitpag v2.0.1 - Advanced Compression Tool

22 Aug 15:42
2b13763

Choose a tag to compare

hitpag v2.0.1 - Add README_zh.md


🚀 hitpag v2.0.0 - Major Feature Update

This is a major release that transforms hitpag into an enterprise-grade compression tool while maintaining its signature ease of use.

✨ New Features

🎛️ Advanced Compression Control

  • Compression Levels (-l1 to -l9): Fine-tune compression vs speed balance
  • Multi-threading (-t4 or -t for auto-detect): Utilize all CPU cores for faster processing
  • File Filtering: Use --include='*.cpp' and --exclude='*.tmp' for selective compression

📊 Performance & Monitoring

  • Benchmarking (--benchmark): Detailed compression statistics and timing
  • Archive Verification (--verify): Integrity checking after compression
  • Verbose Mode (--verbose): Real-time progress and detailed operation info

🗜️ Modern Compression Formats

  • LZ4: Ultra-fast compression/decompression
  • Zstandard (zstd): Facebook's modern algorithm with excellent compression/speed balance
  • XAR: macOS archive format support

🔧 Technical Improvements

  • Modular C++17 Architecture: Organized codebase with logical namespaces
  • Enhanced Error Handling: Specific error codes and detailed diagnostics
  • International Messages: Easy localization support
  • Cross-platform Compatibility: Improved Windows and Unix support

📖 Usage Examples

# High-performance compression with optimal settings
hitpag -l9 -t4 --benchmark dataset.tar.gz ./data/

# Filtered compression excluding temporary files
hitpag --exclude='*.tmp' --exclude='build/*' backup.7z ./project/

# Modern compression with verification
hitpag --verify --verbose archive.zstd ./documents/

# Interactive mode with new format options
hitpag -i

🔄 Migration & Compatibility

Full backward compatibility - All existing v1.x commands work unchanged:

# v1.x syntax still works
hitpag archive.tar.gz ./extracted_dir

# v2.0 adds powerful new options
hitpag --benchmark --verbose -l9 -t4 archive.tar.gz ./extracted_dir

📦 Installation

# Download and compile
wget https://github.com/Hitmux/hitpag/archive/v2.0.0.tar.gz
tar -xzf v2.0.0.tar.gz
cd hitpag-2.0.0
mkdir build && cd build
cmake .. && make
sudo make install

# Install dependencies for all formats
sudo apt install -y tar gzip bzip2 xz-utils zip unzip rar unrar p7zip-full lz4 zstd xar

🏆 Performance Highlights

  • Up to 4x faster compression with multi-threading
  • 20-30% better compression ratios with level 9 settings
  • Real-time filtering saves processing time on large datasets
  • Instant verification ensures data integrity

💡 What's Next?

This release establishes hitpag as a professional-grade compression solution. Future updates will focus on:

  • Additional compression algorithms
  • Cloud storage integration
  • Advanced scheduling features
  • Enhanced scripting capabilities

Thank you to all contributors and users who made this release possible! 🙏

For support and documentation, visit: https://hitmux.top

hitpag v1.1.0

07 Jun 08:39

Choose a tag to compare

hitpag v1.1.0 vs v1.0.1: In-Depth Improvement Analysis

hitpag v1.1.0 represents a comprehensive evolution from a functional prototype to a robust, secure, and professional command-line utility. The upgrade introduces critical new features and fundamentally re-architects core components for enhanced reliability and maintainability.


1. Core Feature Expansion: Encryption & Password Management

This is the most significant functional upgrade, dramatically expanding the tool's utility and security.

  • v1.0.1 (Old): Completely lacked any password or encryption capabilities.

  • v1.1.0 (New) Improvements:

    1. Command-Line Interface (-p):
      • Introduces the -p flag with two modes of operation:
        • Attached Password: -pmysecret for use in scripts or automated environments.
        • Password Prompt: A standalone -p triggers a secure, interactive prompt for the password.
    2. Secure Password Input (get_password_interactively):
      • A new, cross-platform function provides secure password entry by disabling terminal echo.
      • Windows: Uses _getch() from <conio.h> to read characters one by one without displaying them.
      • POSIX (Linux/macOS): Uses <termios.h> to temporarily disable the ECHO flag.
      • Provides user feedback by printing an asterisk (*) for each character typed, enhancing usability.
    3. Intelligent Workflow Integration:
      • Compression: When an encryption-capable format (zip, 7z) is chosen in interactive mode, the user is prompted: "Set a password for the archive? (y/n):".
      • Decompression: The user is asked: "Does the archive require a password? (y/n):".
      • Password Confirmation: To prevent typos, password creation requires a confirmation entry.
      • Backend Command Adaptation: The gathered password is correctly passed to the underlying tools (zip -P, 7z -p, unrar -p).
      • Format Compatibility Warning: For formats like tar that do not support encryption, a clear warning (warning_tar_password) is issued, informing the user that the password will be ignored.

2. Core Engine Refactoring: Process Execution & Argument Handling

This is the most critical architectural improvement, addressing fundamental flaws in how external commands were executed.

  • v1.0.1 (Old):

    • Execution Method: Relied on popen() and system() to execute a single, concatenated command string (e.g., cd "some path" && tool ...).
    • Fundamental Flaws:
      1. Quoting Nightmare: Extremely vulnerable to errors when paths contained spaces or special shell characters (&, |, ").
      2. Security Risk: Prone to Shell Injection vulnerabilities if a path was maliciously crafted.
      3. Inaccurate Progress Bar: A fake progress bar was simulated by reading stdout line-by-line, providing no real indication of progress.
  • v1.1.0 (New) Improvements:

    • Execution Method: A new operation::execute_command function uses native platform APIs for process creation.
    • Windows Implementation (CreateProcessA):
      • Bypasses the command shell (cmd.exe) entirely. The command and its arguments are passed as a structured entity, eliminating all quoting and injection issues. The working directory is set safely via the STARTUPINFOA structure.
    • POSIX Implementation (fork + execvp):
      • Uses the Unix gold standard for process creation. Arguments are passed as an array of strings (char* argv[]), where each argument is treated as a literal, again preventing any shell interpretation, quoting issues, or injection attacks. The working directory is safely changed in the child process using chdir().
    • Result:
      • High Robustness: Flawlessly handles any file path, regardless of special characters.
      • Enhanced Security: Eliminates the risk of command injection.
      • Clearer Output: The inaccurate progress bar is removed. The subprocess's standard output and error are directly inherited, providing the user with authentic, real-time feedback from the underlying tool.

3. Architecture & Code Quality

The new version implements superior software engineering practices, resulting in a cleaner and more maintainable codebase.

  • v1.0.1 (Old):

    • Hard-coded Metadata: Application info like the version number was scattered within i18n message strings.
    • Complex Path Logic: Relied on convoluted string manipulation functions (get_archivable_item_name) that were tightly coupled to the flawed cd ... && tool execution model.
  • v1.1.0 (New) Improvements:

    • Application Constants (constexpr): Centralizes metadata like APP_VERSION, APP_WEBSITE, and APP_GITHUB at the top of the file for easy updates and a single source of truth.
    • Data-Driven Design (MenuItem): The interactive format selection menu is driven by a std::vector<MenuItem>. Each MenuItem struct holds the message key, file type, and a boolean for password support. This makes adding or modifying supported formats trivial without changing the core logic.
    • Smarter Compression Path Logic:
      • Intent Recognition: Intelligently determines whether to compress a directory's contents versus the directory itself by checking for a trailing slash (/ or \) on the source path.
      • Native Tool Features: Prefers using native tool arguments like tar -C <dir> over the cd command, which is a more robust and standard practice.

4. User Experience & Robustness

Enhancements were made to create a more professional and fault-tolerant user experience.

  • v1.0.1 (Old):

    • Help text was basic and lacked detailed examples.
    • Interactive input could not handle an EOF signal (Ctrl+D), causing the program to enter an infinite loop.
  • v1.1.0 (New) Improvements:

    • Enriched Help Text: The help screen is more informative, displaying application metadata and providing more practical examples, including the new password and trailing-slash features.
    • Robust Input Handling: The interactive::get_input function now checks the return of std::getline. On EOF, it throws a std::runtime_error, which is caught by the main function to allow for a graceful exit with a clear message: "Input stream closed. Operation canceled."
    • -- Separator Support: The argument parser now correctly handles the -- delimiter, allowing users to process filenames that begin with a hyphen (-), a standard feature of professional CLI tools.

hitpag v1.0.1

26 May 08:17

Choose a tag to compare

Fix some bugs.

hitpag v1.0.0

25 May 13:44

Choose a tag to compare

Introducing hitpag: Your Smart Companion for Linux File Compression and Decompression!

We're thrilled to announce the release of Hitmux hitpag, a powerful and user-friendly command-line tool designed to revolutionize how you handle compressed files on Linux. Gone are the days of juggling tar, gzip, unzip, and 7z commands! hitpag simplifies everything with its intelligent automation and intuitive interactive mode.

What's New in hitpag?

  • Intelligent Auto-Recognition: hitpag automatically identifies the file type based on its extension, seamlessly calling the correct underlying system tool for compression or decompression. No more guessing which command to use!
  • User-Friendly Interactive Mode (-i): Unsure about command-line parameters? No problem! hitpag guides you through the process with simple questions, making file operations accessible to everyone.
  • Unified Command: A single command hitpag handles all your compression and decompression needs, significantly reducing the learning curve.
  • Wide Format Support: Works flawlessly with common formats like tar, tar.gz, tar.bz2, tar.xz, zip, rar, and 7z.
  • Automatic Directory Creation: hitpag will automatically create the target directory if it doesn't exist during decompression, saving you an extra step.
  • Clear Error Handling: Get precise, easy-to-understand error messages in Chinese, helping you quickly diagnose and resolve any issues.

Key Features at a Glance:

  • Simplify: Consolidates multiple compression/decompression tools into one unified command.
  • Automate: Recognizes file types and executes the appropriate underlying commands.
  • Interact: Offers an intuitive interactive mode for guided operations.
  • Broad Compatibility: Supports all major Linux distributions (tested on Ubuntu 22.04 and Debian 12).
  • C++17 Powered: Built with modern C++ for efficiency and reliability.

How to Get Started:

  1. Dependencies: Ensure you have g++, cmake, make, tar, gzip, bzip2, xz-utils, zip, unzip, rar, unrar, and p7zip-full installed.
    sudo apt-get update
    sudo apt-get install -y g++ cmake make tar gzip bzip2 xz-utils zip unzip rar unrar p7zip-full
  2. Compile:
    cd hitpag_source_directory
    mkdir -p build
    cd build
    cmake ..
    make
    sudo make install # (Optional) Install to system path
  3. Use:
    • Decompress: hitpag archive.tar.gz ./extracted_dir
    • Compress: hitpag ./my_folder my_archive.zip
    • Interactive Mode: hitpag -i big_file.rar

Visit [Hitmux Official Website](https://hitmux.top) for more information and updates!