ZipArchive is a simple utility class for zipping and unzipping files on iOS, macOS and tvOS.
MIT License
ZipArchive is a simple utility class for zipping and unzipping files on iOS, macOS, tvOS, watchOS and visionOS.
A key dependency of this project is the zlib library. zlib before version 1.2.12 allows memory corruption when deflating (i.e., when compressing) if the input has many distant matches according to CVE-2018-25032.
zlib 1.2.12 is included in macOS 10.15+ (with latest security patches), iOS 15.5+, tvOS 15.4+, watchOS 8.4+. As such, these OS versions will be the new minimums as of version 2.5.0 of ZipArchive.
If you need support for previous versions of ZipArchive for earlier OS support you can target an earlier version but know you will be using an unmaintained version of this library.
We will not support versions of ZipArchive that use dependencies with known vulnerabilities.
The main release branch is configured to support Objective-C and Swift 4+.
SSZipArchive works on:
In your Podfile:
pod 'SSZipArchive'
You should define your minimum deployment target explicitly, like:
platform :ios, '15.5'
Recommended CocoaPods version should be at least CocoaPods 1.7.5.
Add a Swift Package reference to https://github.com/ZipArchive/ZipArchive.git (SSZipArchive 2.5.0 and higher or master)
In your Cartfile:
github "ZipArchive/ZipArchive"
We do not release a Carthage pre-built package. Developers are encouraged to build one themselves.
SSZipArchive
and minizip
folders to your project.libz
and libiconv
libraries to your target.Security
framework to your target.HAVE_ARC4RANDOM_BUF HAVE_INTTYPES_H HAVE_PKCRYPT HAVE_STDINT_H HAVE_WZAES HAVE_ZLIB ZLIB_COMPAT $(inherited)
.SSZipArchive requires ARC.
//Import "#import <ZipArchive.h>" for SPM/Carthage, and "#import <SSZipArchive.h>" for CocoaPods.
// Create
[SSZipArchive createZipFileAtPath:zipPath withContentsOfDirectory:sampleDataPath];
// Unzip
[SSZipArchive unzipFileAtPath:zipPath toDestination:unzipPath];
//Import "import ZipArchive" for SPM/Carthage, and "import SSZipArchive" for CocoaPods.
// Create
SSZipArchive.createZipFileAtPath(zipPath, withContentsOfDirectory: sampleDataPath)
// Unzip
SSZipArchive.unzipFileAtPath(zipPath, toDestination: unzipPath)
SSZipArchive is protected under the MIT license and our slightly modified version of minizip-ng (formally minizip) 3.0.10 is licensed under the Zlib license.