omnizip 0.4.1 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 06cbc9a2cd22e74a84d82211efa5e000d857da117bae9a995b76520839211362
4
- data.tar.gz: e8ab9ec5638953dda59f4b43aa299cfa55262f77d3c9e9f795bbe8800d443592
3
+ metadata.gz: 48ed1a8b9fa1d9c51d338c611430fbd78f12de0a9d5d9de3ebff23ac3b9b767c
4
+ data.tar.gz: 6b173fab258e290030227c869b703631023c621699e810753259b14ef613ef34
5
5
  SHA512:
6
- metadata.gz: ecd9426b7a3f0a75c68821ec6c2c4c0f0f4f6f5e5ae7a252dc6e1e4fb9f5eb94a01b84f937c797581b44584e8cc4ba244d35e37c2338b1401c46de42299a1627
7
- data.tar.gz: 268f70fb015d2e21b8079cae5ea4e09a83e036e967cf83bed03cc37de45b61f1875547b1443b419eec502a3bcc264e323d19bb8c503f72437cfb47bbd9d31853
6
+ metadata.gz: 07fba2b58cca8f0c0429042e4a2813d5618158cb8231625ad1e6f5c32d1bc532d45a8bb952a3087d6274862647dbab0480aca8c96561f24c5a3debf2a1f7dd63
7
+ data.tar.gz: 8422215bde30fa926b235b20dddbeba195573a82d1678ea98d541be6e37e6e14c7a6ae444e53b1a4505733a6420a4d9d3a53cec3605c751c5bf6eac49678ef86
data/CHANGELOG.md CHANGED
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ### Fixed
11
+ - RAR recovery-record repair fails loudly instead of pretending:
12
+ `recover_with_reed_solomon` returned nil and `recover_with_xor`
13
+ applied a transform the record does not use. Neither unrar (its
14
+ recvol5/rs16 cover only the separate .rev volumes) nor any public
15
+ spec carries the in-archive RAR5 RS parameters, so both paths now
16
+ raise `NotImplementedError` with par2 guidance, surfaced through
17
+ `ArchiveRepairer` results. The `ozip repair` counterpart (Rust)
18
+ ships in omnizip-rs with the same honest contract.
19
+
10
20
  ### Added
11
21
  - `rake rust:build` — one command to build and vendor the Rust
12
22
  backend's cdylib (clones omnizip-rs or reuses a checkout via
@@ -266,10 +266,16 @@ module Omnizip
266
266
  # @param parity_data [String] Parity information
267
267
  # @return [String, nil] Recovered data
268
268
  def recover_with_reed_solomon(_corrupted_data, _parity_data)
269
- # Placeholder for Reed-Solomon recovery
270
- # Real implementation would use reed-solomon gem
271
- # For now, return nil to indicate recovery not available
272
- nil
269
+ # The in-archive RAR5 recovery record's RS parameters exist
270
+ # only in the proprietary rar binary — unrar carries no
271
+ # implementation (its recvol5/rs16 cover only the separate
272
+ # .rev volume feature), and no independent spec is public.
273
+ # Fail loudly with actionable guidance instead of pretending
274
+ # recovery happened.
275
+ raise NotImplementedError,
276
+ "in-archive RAR5 Reed-Solomon recovery is not implemented " \
277
+ "(rar-proprietary format); protect archives with external " \
278
+ "parity (par2) instead"
273
279
  end
274
280
 
275
281
  # Recover data using XOR (RAR4)
@@ -277,14 +283,15 @@ module Omnizip
277
283
  # @param corrupted_data [String] Corrupted block
278
284
  # @param parity_data [String] Parity information
279
285
  # @return [String] Recovered data
280
- def recover_with_xor(corrupted_data, parity_data)
281
- # Simple XOR recovery
282
- result = corrupted_data.bytes.map.with_index do |byte, i|
283
- parity_byte = parity_data.bytes[i % parity_data.size]
284
- byte ^ parity_byte
285
- end
286
-
287
- result.pack("C*")
286
+ def recover_with_xor(_corrupted_data, _parity_data)
287
+ # RAR4's integrated recovery record is likewise rar-proprietary
288
+ # (unrar has no repair path for it either); a cyclic XOR with
289
+ # arbitrary parity bytes is not the record's actual transform
290
+ # and would silently fabricate corrupt bytes. Refuse honestly.
291
+ raise NotImplementedError,
292
+ "in-archive RAR4 recovery-record repair is not implemented " \
293
+ "(rar-proprietary format); protect archives with external " \
294
+ "parity (par2) instead"
288
295
  end
289
296
  end
290
297
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Omnizip
4
- VERSION = "0.4.1"
4
+ VERSION = "0.4.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omnizip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-09-19 00:00:00.000000000 Z
11
+ date: 2026-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64