90 Commits

Author SHA1 Message Date
nekonya 735795a7e1 [7-Zip] Fix LZMA dictionary size parsing
The LZMA dictionary size was being read from only 3 bytes (indices 1-3)
instead of the full 4 bytes (indices 1-4) specified in the LZMA format.

This caused decompression to fail with LZMAError.notEnoughToRepeat for
archives using dictionary sizes >= 16MB (e.g., LZMA:24 = 2^24 = 16MB),
because the high byte was not read and the dictionary size defaulted
to the minimum 4096 bytes.

Change: `for i in 1..<4` → `for i in 1..<5`
2026-05-14 21:31:30 +08:00
Timofey Solomko 273b6ed9e9 Remove redundant imports 2026-02-18 12:21:57 +08:00
Timofey Solomko 1566b49ce3 [7-Zip][ZIP] Remove support for CocoaPods optional dependencies 2026-02-03 01:15:33 +08:00
Timofey Solomko ea9aaccfb9 Update copyright year to 2026 2026-01-31 15:30:24 +08:00
Timofey Solomko ed66991cbd Update copyright year to 2024 2024-01-11 16:57:04 +03:00
Timofey Solomko 43132fc39d Update copyright year to 2023 2023-02-07 15:31:45 +02:00
Timofey Solomko 79295db930 Update copyright year to 2022 2022-01-08 15:02:59 +03:00
Timofey Solomko 6cdfc14f54 [7-Zip] Add support for LZ4 2021-10-16 21:57:46 +03:00
Timofey Solomko aefacf3e16 [7-Zip] Change SevenZipProperty from class to struct 2021-09-19 17:17:57 +03:00
Timofey Solomko e83f23effa Update copyright year to 2021 2021-01-11 11:20:57 +02:00
Timofey Solomko deab72a831 Merge branch 'hotfix-4.5.7' into develop 2020-10-16 15:57:08 +03:00
Timofey Solomko 3670bba2d1 [7-Zip] Fix a crash when opening a very small file
Such files (smaller than 32 bytes) definitely don't have a SignatureHeader and in this case SevenZipError.wrongSignature should be properly thrown.
2020-10-15 23:35:25 +03:00
Timofey Solomko a844b34436 Update copyright year to 2020 2020-03-20 09:43:42 +03:00
Timofey Solomko f6949a8f66 Replace the usage of the deprecated Data(bytes:) initializer 2020-03-20 09:40:48 +03:00
Timofey Solomko 31ec1f1553 Update copyright year to 2020 2020-01-01 19:06:33 +03:00
Timofey Solomko 75b21ae107 Replace usage of ByteReader with LittleEndianByteReader 2019-05-01 19:34:30 +03:00
Timofey Solomko db82490ed8 Replace the usage of the deprecated Data(bytes:) initializer 2019-05-01 19:30:48 +03:00
Timofey Solomko c93a783d21 [docs] Fix grammar issues with regards to a/the/null articles, while/during, and extra commas 2019-03-13 12:27:08 +03:00
Timofey Solomko ce47019097 Update copyright year to 2019 2019-01-02 23:15:43 +03:00
Timofey Solomko b9984ac349 [7-Zip] Enable support for delta filter 2018-08-29 10:55:18 +03:00
Timofey Solomko d685b4f531 [LZMA2] Internal decompress function now returns Data instead of byte array 2018-08-28 11:41:38 +03:00
Timofey Solomko 4e6d3beea9 [LZMA] Replace LZMAProperties.updateProperties with init from lzma byte and dict size 2018-08-28 11:34:04 +03:00
Timofey Solomko e36e0bf4d8 [7-Zip] Use new LZMA decompress function instead of LZMADecoder directly 2018-08-28 11:34:04 +03:00
Timofey Solomko 4713ad5ed8 [LZMA2] Use LZMA2.decompress with dict size byte argument function instead of using LZMA2Decoder directly in "clients" 2018-08-22 10:40:16 +03:00
Timofey Solomko e11f4d4896 [LZMA2] Merge LZMA2Decoder initializer and its setDictionarySize function 2018-08-22 10:40:16 +03:00
Timofey Solomko b52a55d54d [LZMA] Replace references to properties of LZMADecoder with references to LZMAProperties property of decoder 2018-08-22 10:38:53 +03:00
Timofey Solomko 062109d947 [LZMA] Reset decoder state inside LZMADecoder.setProperties
This removes additional requirement to call resetStateAndDecoders after calling setProperties.
2018-08-13 20:30:24 +03:00
Timofey Solomko 1c5ca3bbe5 Swiflinted before 4.4.0 2018-08-07 21:18:39 +03:00
Timofey Solomko 46f88e1d60 [docs] Simplify documentation for SevenZipError cases 2018-07-22 18:11:26 +03:00
Timofey Solomko 6cfdc0ab29 [LZMA] Rename LZMADecoder.dictionarySize to dictSize 2018-05-20 12:55:46 +03:00
Timofey Solomko 58c854d72b [7-Zip] Improve style of guard statements 2018-05-20 12:04:44 +03:00
Timofey Solomko a0ef7a3cfe Swiftlinted 2018-04-10 23:22:31 +03:00
Timofey Solomko d5c8600137 Use more new BBD functions 2018-04-10 22:37:20 +03:00
Timofey Solomko 05852b179b Use new int(fromBytes:) function 2018-04-10 22:37:16 +03:00
Timofey Solomko 019bbf0629 [7-Zip] Move conversion from UInt64 to Date from entry to file info 2018-03-25 23:33:57 +03:00
Timofey Solomko 311fe5ae80 [7-Zip] Add property to SevenZipFolder orderedCompressionMethods
It lazily returns compression methods in the order used by folder.
2018-03-18 15:47:43 +03:00
Timofey Solomko b123fff428 [7-Zip] Replace struct-ends ifs with guards 2018-03-18 00:58:40 +03:00
Timofey Solomko 895643b69e [7-Zip] Reduce code nesting in container 2018-03-18 00:57:27 +03:00
Timofey Solomko 309a07ed15 [docs] Slightly simplify notes about entries order of container functions 2018-03-17 15:37:41 +03:00
Timofey Solomko 2e3867afde [7-Zip] Some code and comments improvements to open and info functions 2018-03-17 15:34:12 +03:00
Timofey Solomko 42fdac0a79 [7-Zip] info(container:) no longer crash when SubstreamInfo doesn't have enough sizes or digests
In this cases it now sets them to nil, which is consistent with behavior of open(container:) function.
2018-03-17 15:32:07 +03:00
Timofey Solomko b301045d4a [7-Zip] Fix skipping entries in open(container:) when there is no SubstreamInfo
It was always intended to set data of entry to nil in this case, but for some reason it was never properly implemented.
2018-03-17 15:30:19 +03:00
Timofey Solomko abcc985da8 Accept 7z minor version from 1 to 4 2018-03-08 12:35:16 +03:00
Timofey Solomko 44f33bf02a Make bit reader and writer functions' parameters concrete classes
Previously, it was almost always protocols, which in some cases didn't make sense.
2018-01-07 22:27:36 +03:00
Timofey Solomko e714dc308b Updated copyright year to 2018 2018-01-03 19:44:18 +03:00
Timofey Solomko e986561487 Replace Int() conversions with toInt() functions 2018-01-03 19:22:15 +03:00
Timofey Solomko c8d92e56d3 Replace BitReader and ByteReader with BitByteData's implementations 2018-01-03 19:22:15 +03:00
Timofey Solomko 20ab480737 Complete renaming of DataWithPointer to ByteReader
This includes renaming pointerData variables to byteReader as well as renaming of files with extensions to ByteReader.
2018-01-03 19:22:14 +03:00
Timofey Solomko dcf18c73d6 Rename ByteReader.isAtTheEnd to isFinished 2018-01-03 19:22:13 +03:00
Timofey Solomko b9eeb1bc7c Rename ByteReader.index to offset 2018-01-03 19:22:13 +03:00