-
v1.7.102 Stable
released this
2026-03-10 23:53:21 +01:00 | 194 commits to main since this releaseExtractor System
- Complete extractor reorganization: Restructured the entire extraction engine (~3,550 lines) from an unorganized monolith into 18 clearly labeled sections with
// == Sektion ==separators, making the codebase dramatically easier to navigate and maintain - Section 1 - Imports & Constants: All imports and numeric/string constants consolidated at the top (archive passwords, timeouts, limits, buffer sizes)
- Section 2 - Types & Interfaces: All exported and internal type definitions grouped together (
ExtractOptions,ExtractProgressUpdate,ExtractArchiveFailureInfo,ArchiveSignature,ExtractErrorCategory,JvmExtractResult,DaemonRequest, etc.) - Section 3 - Subst Drive Mapping: Windows long-path workaround functions (
findFreeSubstDrive,createSubstMapping,removeSubstMapping,cleanupStaleSubstDrives) - Section 4 - Archive Detection & Candidates: Signature detection via magic bytes, candidate discovery with deduplication and natural sort order
- Section 5 - Cleanup & Filesystem: Archive cleanup target collection (multipart RAR, split ZIP, 7z splits, .rev files), empty directory removal
- Section 6 - Password Management: LRU password cache (256 entries, package-scoped), filename-derived password extraction, password prioritization logic
- Section 7 - Error Classification: Extraction error text cleaning, category classification (CRC, wrong password, missing parts, disk full, timeout, etc.), serial retry and JVM fallback decision logic
- Section 8 - Backend Mode:
resolveExtractorBackendMode()and per-archive backend resolution (auto/jvm/legacy) - Section 9 - Native Extractor Resolution: 7-Zip and WinRAR discovery, extractor probing with timeout, candidate ordering per archive type
- Section 10 - CPU/Thread/Priority: JVM heap calculation, thread budget based on CPU cores, Windows process priority management
- Section 11 - Process Execution:
killProcessTree(),runExtractCommand()with progress parsing, output buffering, and monotonic percent tracking - Section 12 - JVM Backend & Daemon: JVM extractor layout resolution, persistent daemon lifecycle management (
startDaemon,waitForDaemonReady,shutdownDaemon), daemon request/response protocol - Section 13 - Legacy Extraction: External extractor argument building (7-Zip and WinRAR CLI flags), password retry loop with delay, JVM-to-legacy and legacy-to-JVM fallback chains
- Section 14 - ZIP Extraction (AdmZip): Built-in ZIP extraction with path-traversal protection, memory limit guards, external ZIP fallback for large entries
- Section 15 - Disk Space, Timeout & Memory Limits: Pre-extraction disk space validation, dynamic timeout calculation based on archive size, configurable ZIP entry memory limits via
RD_ZIP_ENTRY_MEMORY_LIMIT_MB - Section 16 - Resume State: Atomic progress file persistence (write-tmp-then-rename), case-insensitive archive name matching on Windows, state read/write/clear
- Section 17 - Progress & Conflict Helpers: Log emission, conflict mode normalization, external ZIP preference logic
- Section 18 - extractPackageArchives(): Main orchestration function - archive scanning, disk space check, resume state loading, parallel/serial extraction with concurrency control, nested archive extraction (1 level deep), cleanup, and result aggregation
- All 82 tests passing - zero behavior changes, all exports preserved 1:1
Auto-Update System
- Robust digest parsing: New
parseExpectedDigest()function supports SHA-256 and SHA-512 in both hex and base64 encodings, with and without algorithm prefix (sha256:abc...,sha512:abc..., or plain values). Handles URL-safe base64 (-_to+/) and padding normalization - Streaming file hash verification: New
hashFile()function computes SHA-256/SHA-512 digests via streaming (1 MB chunks) instead of loading entire files into memory - Binary shape validation: New
verifyBinaryShape()checks downloaded installers for minimum file size (128 KB) and valid PE/MZ header before attempting installation - Integrity error detection: New
isIntegrityError()classifier distinguishes hash mismatches from network errors, enabling smarter retry logic - Multi-pass download capability: New
MAX_DOWNLOAD_PASSESconstant (3) for re-downloading on integrity failures - Abort-aware sleep: New
sleep()helper respects the global update abort controller, preventing stale timers after shutdown - latest.yml SHA-512 extraction: Improved
extractSha512Value()handles both quoted and unquoted YAML values, validates base64 (86-88 chars) and hex (128 chars) formats - Code organization: Update module restructured with section headers (Constants, Types, Update Sources, Module State, Version Utilities, Repository Normalization, Network Utilities, Digest Parsing, latest.yml Parsing, Installer Verification, Release API, Download Candidates, Error Classification, Download Engine)
- Simplified function names:
readJsonWithTimeouttoreadJsonBody,readTextWithTimeouttoreadTextBody,safeEmitProgresstoemitProgress,fetchReleasePayloadtofetchRelease,buildDownloadCandidatestobuildCandidates,deriveUpdateFileNametoderiveFileName - Extracted helper functions:
isValidRepoPart()andextractOwnerRepo()extracted from inline closures innormalizeUpdateRepo()for better testability
Housekeeping
- Normalized line endings (CRLF to LF) across all source files for consistent cross-platform editing
- Added
docs/UNPACK-PAUSE-ANALYSIS.mddesign document for extraction pause/resume architecture
- Complete extractor reorganization: Restructured the entire extraction engine (~3,550 lines) from an unorganized monolith into 18 clearly labeled sections with