Skip to content

Commit

Permalink
Merge pull request #647 from ZipArchive/mz_compat_to_3_0_6_updates
Browse files Browse the repository at this point in the history
mz_compat updated to minizip 3.0.6
  • Loading branch information
jhudsonWA committed Jun 20, 2022
2 parents b3f90f9 + 33e0d0e commit b145c6f
Show file tree
Hide file tree
Showing 6 changed files with 789 additions and 373 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -54,7 +54,7 @@ We do not release a Carthage pre-built package. Developers are encouraged to bui
1. Add the `SSZipArchive` and `minizip` folders to your project.
2. Add the `libz` and `libiconv` libraries to your target.
3. Add the `Security` framework to your target.
4. Add the following GCC_PREPROCESSOR_DEFINITIONS: `HAVE_INTTYPES_H HAVE_PKCRYPT HAVE_STDINT_H HAVE_WZAES HAVE_ZLIB $(inherited)`.
4. Add the following GCC_PREPROCESSOR_DEFINITIONS: `HAVE_INTTYPES_H HAVE_PKCRYPT HAVE_STDINT_H HAVE_WZAES HAVE_ZLIB ZLIB_COMPAT $(inherited)`.

SSZipArchive requires ARC.

Expand Down Expand Up @@ -87,7 +87,7 @@ SSZipArchive.unzipFileAtPath(zipPath, toDestination: unzipPath)

## License

SSZipArchive is protected under the [MIT license](https://github.com/samsoffes/ssziparchive/raw/master/LICENSE) and our slightly modified version of [minizip-ng (formally minizip)](https://github.com/zlib-ng/minizip-ng) 3.0.4 is licensed under the [Zlib license](https://www.zlib.net/zlib_license.html).
SSZipArchive is protected under the [MIT license](https://github.com/samsoffes/ssziparchive/raw/master/LICENSE) and our slightly modified version of [minizip-ng (formally minizip)](https://github.com/zlib-ng/minizip-ng) 3.0.6 is licensed under the [Zlib license](https://www.zlib.net/zlib_license.html).

## Acknowledgments

Expand Down
2 changes: 1 addition & 1 deletion SSZipArchive.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'SSZipArchive'
s.version = '2.5.1'
s.version = '2.5.2'
s.summary = 'Utility class for zipping and unzipping files on iOS, tvOS, watchOS, and macOS.'
s.description = 'SSZipArchive is a simple utility class for zipping and unzipping files on iOS, tvOS, watchOS, and macOS. It supports AES and PKWARE encryption.'
s.homepage = 'https://github.com/ZipArchive/ZipArchive'
Expand Down
4 changes: 2 additions & 2 deletions SSZipArchive/SSZipArchive.m
Expand Up @@ -980,7 +980,7 @@ - (BOOL)writeSymlinkFileAtPath:(NSString *)path withFileName:(nullable NSString
}

uint16_t version_madeby = 3 << 8;//UNIX
int error = zipOpenNewFileInZip5(_zip, fileName.fileSystemRepresentation, &zipInfo, NULL, 0, NULL, 0, NULL, Z_DEFLATED, compressionLevel, 0, -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, password.UTF8String, aes, version_madeby, 0, 0);
int error = zipOpenNewFileInZip5(_zip, fileName.fileSystemRepresentation, &zipInfo, NULL, 0, NULL, 0, NULL, Z_DEFLATED, compressionLevel, 0, -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, password.UTF8String, 0, aes, version_madeby, 0, 0);
zipWriteInFileInZip(_zip, link_path, (uint32_t)strlen(link_path));
zipCloseFileInZip(_zip);
return error == ZIP_OK;
Expand Down Expand Up @@ -1285,7 +1285,7 @@ int _zipOpenEntry(zipFile entry, NSString *name, const zip_fileinfo *zipfi, int
uint16_t made_on_darwin = 19 << 8;
//MZ_ZIP_FLAG_UTF8
uint16_t flag_base = 1 << 11;
return zipOpenNewFileInZip5(entry, name.fileSystemRepresentation, zipfi, NULL, 0, NULL, 0, NULL, Z_DEFLATED, level, 0, -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, password.UTF8String, aes, made_on_darwin, flag_base, 1);
return zipOpenNewFileInZip5(entry, name.fileSystemRepresentation, zipfi, NULL, 0, NULL, 0, NULL, Z_DEFLATED, level, 0, -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, password.UTF8String, 0, aes, made_on_darwin, flag_base, 1);
}

#pragma mark - Private tools for file info
Expand Down
13 changes: 8 additions & 5 deletions SSZipArchive/SSZipCommon.h
Expand Up @@ -12,6 +12,7 @@ typedef struct unz_global_info64_s
uint16_t size_comment; /* size of the global comment of the zipfile */
} unz_global_info64;


typedef struct unz_global_info_s
{
uint32_t number_entry; /* total number of entries in the central dir on this disk */
Expand All @@ -28,19 +29,20 @@ typedef struct unz_file_info64_s
uint16_t flag; /* general purpose bit flag 2 bytes */
uint16_t compression_method; /* compression method 2 bytes */
uint32_t dos_date; /* last mod file date in Dos fmt 4 bytes */
struct tm tmu_date;
uint32_t crc; /* crc-32 4 bytes */
uint64_t compressed_size; /* compressed size 8 bytes */
uint64_t uncompressed_size; /* uncompressed size 8 bytes */
uint16_t size_filename; /* filename length 2 bytes */
uint16_t size_file_extra; /* extra field length 2 bytes */
uint16_t size_file_comment; /* file comment length 2 bytes */

uint32_t disk_num_start; /* disk number start 4 bytes */
uint16_t internal_fa; /* internal file attributes 2 bytes */
uint32_t external_fa; /* external file attributes 4 bytes */

uint64_t disk_offset;

uint16_t size_file_extra_internal;
} unz_file_info64;

Expand All @@ -51,17 +53,18 @@ typedef struct unz_file_info_s
uint16_t flag; /* general purpose bit flag 2 bytes */
uint16_t compression_method; /* compression method 2 bytes */
uint32_t dos_date; /* last mod file date in Dos fmt 4 bytes */
struct tm tmu_date;
uint32_t crc; /* crc-32 4 bytes */
uint32_t compressed_size; /* compressed size 4 bytes */
uint32_t uncompressed_size; /* uncompressed size 4 bytes */
uint16_t size_filename; /* filename length 2 bytes */
uint16_t size_file_extra; /* extra field length 2 bytes */
uint16_t size_file_comment; /* file comment length 2 bytes */

uint16_t disk_num_start; /* disk number start 2 bytes */
uint16_t internal_fa; /* internal file attributes 2 bytes */
uint32_t external_fa; /* external file attributes 4 bytes */

uint64_t disk_offset;
} unz_file_info;

Expand Down

0 comments on commit b145c6f

Please sign in to comment.