diff --git a/CHANGELOG.md b/CHANGELOG.md index 296c2f058..a8d86cf93 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -69,6 +69,9 @@ Versioning](https://semver.org/spec/v2.0.0.html). #### Fixed +- Packs generated with the `zip_spec_conformance_level` option set to + `disregard` now reliably work on Minecraft clients running Java 22 or newer. + (Thanks _@mrkinau_ and _@mihannnik_ for reporting the issue!) - Shaders that depend on `#moj_import`ed or parent-defined preprocessor variables to be syntactically correct or expand to the intended source code will no longer cause PackSquash to fail or change their semantics. diff --git a/packages/packsquash/src/squash_zip/obfuscation_engine.rs b/packages/packsquash/src/squash_zip/obfuscation_engine.rs index 601823e03..16650d102 100644 --- a/packages/packsquash/src/squash_zip/obfuscation_engine.rs +++ b/packages/packsquash/src/squash_zip/obfuscation_engine.rs @@ -206,12 +206,12 @@ impl ObfuscationEngine { 4096 + central_directory_header.compressed_size % 4096; } central_directory_header.local_header_disk_number = - (random_u32(seed) % 32768) as u16 + 32768; + (random_u32(seed) % 32768) as u16 + 32767; } else { if obfuscate_uncompressed_size { central_directory_header.uncompressed_size = 0xFFFFFF7F; } - central_directory_header.local_header_disk_number = u16::MAX; + central_directory_header.local_header_disk_number = u16::MAX - 1; } if let SizeIncreasingObfuscation::Enabled {