Ability to check/test/repair corrupted header files
It will be very helpful feature!
I completely agree - I've recently come across several archives from customers with valid contents and corrupt headers. Do you know of any other libraries that do this, or what methods in the unrar API meant to do this?
WinRar for windows has that ability. I think the unrar API use the same libraries from RARLab, doesn't it? Also the 7zip library supports it, not sure if you can use them in ObjC/Swift, but for the same C# project I use the 7zip DLL's via 3d party product like UnrarKit called SevenZipSharp.
One interesting thing I came over while investigating the headers problem is that, the same RAR archive extracts successfully on most machines, but fails on some hardware setups with message "Corrupted headers". For a long time I was thinking that it's a download problem, but it turns out that in some cases additional .rar.crc files are needed. CRC files contains some header information about error resolving during the extraction process and are needed for some machines(guess it's matter of CPU). Here is some discussion about it
This issue with the CRC files happens mostly on multi-part archives as on my observation.
I tried opening a corrupted file in 7-Zip in Windows and didn't see any header repair options. It also failed to extract the images in the archive (they came out 0 bytes in size), whereas when I use other tools, that same archive is able to be extracted and kept mostly intact. Can you point me to some specific app actions (menu, button, etc.) or API calls that validate or fix the header?
Sure. Right click on the file in Windows -> 7-Zip -> Test Archive. Screenshot attached.

Also check the second menu bellow "7-Zip" where it says "CRC SHA".
Hmmm... I think all the "Test archive" option does is comparing the contents of each archived file against the CRC stored in the header. -[URKArchive checkDataIntegrity] already does that. The "CRC SHA" options generate hashes of the whole archive, so you can verify it matches the posted checksum given at the time of download. Do you know of any tools that repair the header, or can tell you if the header is corrupt rather than the archived data?
@skito have you seen the changes I've made in the v2.10 branch? I think it might possibly address what you're looking for.