Compare commits
28 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
77054d5ca5 | ||
|
|
123e801b82 | ||
|
|
77892c97d8 | ||
|
|
790b2c1454 | ||
|
|
528ca5694b | ||
|
|
b4d11dffc9 | ||
|
|
6781d97343 | ||
|
|
2a248f6b55 | ||
|
|
55b067b11c | ||
|
|
889e4293d1 | ||
|
|
e0a74bddd4 | ||
|
|
804e9e5a6f | ||
|
|
6eafde0cfb | ||
|
|
5da2714fb4 | ||
|
|
42c8c9e8c9 | ||
|
|
c8a6eedf78 | ||
|
|
f5b2feed1c | ||
|
|
c84f6e84e2 | ||
|
|
a0a649e28b | ||
|
|
0516ff2f90 | ||
|
|
9562f0a48e | ||
|
|
66ab1372d8 | ||
|
|
b64a644f04 | ||
|
|
ddd032f71f | ||
|
|
5bb24be26b | ||
|
|
6fc5255676 | ||
|
|
775a246b2b | ||
|
|
1ff099811e |
@@ -344,11 +344,11 @@
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputPaths = (
|
||||
"$(DERIVED_FILE_DIR)/Pods-testing_pods-ObjectiveCExampleTests-checkManifestLockResult.txt",
|
||||
"$(DERIVED_FILE_DIR)/Pods-ObjectiveCExampleTests-checkManifestLockResult.txt",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
486F364061BAD3921A1CA2C8 /* [CP] Embed Pods Frameworks */ = {
|
||||
@@ -357,7 +357,7 @@
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${SRCROOT}/Pods/Target Support Files/Pods-testing_pods-ObjectiveCExampleTests/Pods-testing_pods-ObjectiveCExampleTests-frameworks.sh",
|
||||
"${SRCROOT}/Pods/Target Support Files/Pods-ObjectiveCExampleTests/Pods-ObjectiveCExampleTests-frameworks.sh",
|
||||
"${BUILT_PRODUCTS_DIR}/SSZipArchive/SSZipArchive.framework",
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
@@ -395,11 +395,11 @@
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputPaths = (
|
||||
"$(DERIVED_FILE_DIR)/Pods-testing_pods-ObjectiveCExample-checkManifestLockResult.txt",
|
||||
"$(DERIVED_FILE_DIR)/Pods-ObjectiveCExample-checkManifestLockResult.txt",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
CA0F9A9BDCCC5F900FD55CF3 /* [CP] Embed Pods Frameworks */ = {
|
||||
@@ -408,7 +408,7 @@
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${SRCROOT}/Pods/Target Support Files/Pods-testing_pods-ObjectiveCExample/Pods-testing_pods-ObjectiveCExample-frameworks.sh",
|
||||
"${SRCROOT}/Pods/Target Support Files/Pods-ObjectiveCExample/Pods-ObjectiveCExample-frameworks.sh",
|
||||
"${BUILT_PRODUCTS_DIR}/SSZipArchive/SSZipArchive.framework",
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
PODS:
|
||||
- SSZipArchive (2.0.0)
|
||||
- SSZipArchive (2.0.4)
|
||||
|
||||
DEPENDENCIES:
|
||||
- SSZipArchive (from `..`)
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
SSZipArchive:
|
||||
:path: ".."
|
||||
:path: ..
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
SSZipArchive: 8153333145bf99acaf1918d257fdcef68a9269e1
|
||||
SSZipArchive: c77fc6ec8194f4e6d57876da1348e46cd63b90ba
|
||||
|
||||
PODFILE CHECKSUM: 7f4058a9cbc69b4e63808729577a8bb2098bc527
|
||||
|
||||
COCOAPODS: 1.2.1
|
||||
COCOAPODS: 1.3.1
|
||||
|
||||
14
README.md
14
README.md
@@ -14,13 +14,14 @@ ZipArchive is a simple utility class for zipping and unzipping files on iOS and
|
||||
|
||||
## Installation and Setup
|
||||
|
||||
*The main release branch is configured to support Objective C and Swift 3. There is a 'swift23' branch which is the latest branch but marked to compile for Swift 2.3.*
|
||||
*The main release branch is configured to support Objective C and Swift 3+. There is a 'swift23' branch which is a tied to a older 1.x release and will not be upgraded. Xcode 8.3+ removes support for Swift 2.3*
|
||||
|
||||
### CocoaPods
|
||||
|
||||
`pod install SSZipArchive`
|
||||
In your Podfile:
|
||||
`pod 'SSZipArchive'`
|
||||
|
||||
### Carthage
|
||||
In your Cartfile:
|
||||
`github "ZipArchive/ZipArchive"`
|
||||
|
||||
### Manual
|
||||
@@ -54,8 +55,11 @@ 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](http://www.winimage.com/zLibDll/minizip.html) 1.1 is licensed under the [Zlib license](http://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](https://github.com/nmoinvaz/minizip) 1.1 is licensed under the [Zlib license](http://www.zlib.net/zlib_license.html).
|
||||
|
||||
## Acknowledgments
|
||||
|
||||
Big thanks to [aish](http://code.google.com/p/ziparchive) for creating [ZipArchive](http://code.google.com/p/ziparchive). The project that inspired SSZipArchive. Thank you [@randomsequence](https://github.com/randomsequence) for implementing the creation support tech and to [@johnezang](https://github.com/johnezang) for all his amazing help along the way.
|
||||
* Big thanks to [aish](http://code.google.com/p/ziparchive) for creating [ZipArchive](http://code.google.com/p/ziparchive). The project that inspired SSZipArchive.
|
||||
* Thank you [@soffes](https://github.com/soffes) for the actual name of SSZipArchive.
|
||||
* Thank you [@randomsequence](https://github.com/randomsequence) for implementing the creation support tech.
|
||||
* Thank you [@johnezang](https://github.com/johnezang) for all his amazing help along the way.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'SSZipArchive'
|
||||
s.version = '2.0.0'
|
||||
s.version = '2.0.4'
|
||||
s.summary = 'Utility class for zipping and unzipping files on iOS, tvOS, watchOS, and Mac.'
|
||||
s.description = 'SSZipArchive is a simple utility class for zipping and unzipping files on iOS, tvOS, watchOS, and Mac.'
|
||||
s.homepage = 'https://github.com/ZipArchive/ZipArchive'
|
||||
|
||||
@@ -20,6 +20,8 @@ typedef NS_ENUM(NSInteger, SSZipArchiveErrorCode) {
|
||||
SSZipArchiveErrorCodeFailedOpenFileInZip = -2,
|
||||
SSZipArchiveErrorCodeFileInfoNotLoadable = -3,
|
||||
SSZipArchiveErrorCodeFileContentNotReadable = -4,
|
||||
SSZipArchiveErrorCodeFailedToWriteFile = -5,
|
||||
SSZipArchiveErrorCodeInvalidArguments = -6,
|
||||
};
|
||||
|
||||
@protocol SSZipArchiveDelegate;
|
||||
|
||||
@@ -184,12 +184,28 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
toDestination:(NSString *)destination
|
||||
preserveAttributes:(BOOL)preserveAttributes
|
||||
overwrite:(BOOL)overwrite
|
||||
password:(NSString *)password
|
||||
password:(nullable NSString *)password
|
||||
error:(NSError **)error
|
||||
delegate:(id<SSZipArchiveDelegate>)delegate
|
||||
progressHandler:(void (^)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler
|
||||
completionHandler:(void (^)(NSString *path, BOOL succeeded, NSError * __nullable error))completionHandler
|
||||
{
|
||||
|
||||
// Guard against empty strings
|
||||
if ([path length] == 0 || [destination length] == 0)
|
||||
{
|
||||
NSDictionary *userInfo = @{NSLocalizedDescriptionKey: @"received invalid argument(s)"};
|
||||
NSError *err = [NSError errorWithDomain:SSZipArchiveErrorDomain code:SSZipArchiveErrorCodeInvalidArguments userInfo:userInfo];
|
||||
if (error)
|
||||
{
|
||||
*error = err;
|
||||
}
|
||||
if (completionHandler)
|
||||
{
|
||||
completionHandler(nil, NO, err);
|
||||
}
|
||||
}
|
||||
|
||||
// Begin opening
|
||||
zipFile zip = unzOpen((const char*)[path fileSystemRepresentation]);
|
||||
if (zip == NULL)
|
||||
@@ -383,7 +399,15 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
FILE *fp = fopen((const char*)[fullPath fileSystemRepresentation], "wb");
|
||||
while (fp) {
|
||||
if (readBytes > 0) {
|
||||
fwrite(buffer, readBytes, 1, fp);
|
||||
if (0 == fwrite(buffer, readBytes, 1, fp)) {
|
||||
if (ferror(fp)) {
|
||||
NSString *message = [NSString stringWithFormat:@"Failed to write file (check your free space)"];
|
||||
NSLog(@"[SSZipArchive] %@", message);
|
||||
success = NO;
|
||||
unzippingError = [NSError errorWithDomain:@"SSZipArchiveErrorDomain" code:SSZipArchiveErrorCodeFailedToWriteFile userInfo:@{NSLocalizedDescriptionKey: message}];
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
@@ -432,10 +456,6 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
// Unable to set the permissions attribute
|
||||
NSLog(@"[SSZipArchive] Failed to set attributes - whilst setting permissions");
|
||||
}
|
||||
|
||||
#if !__has_feature(objc_arc)
|
||||
[attrs release];
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -465,13 +485,34 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
[destinationPath appendString:@((const char*)buffer)];
|
||||
}
|
||||
|
||||
// Check if the symlink exists and delete it if we're overwriting
|
||||
if (overwrite)
|
||||
{
|
||||
if ([fileManager fileExistsAtPath:fullPath])
|
||||
{
|
||||
NSError *error = nil;
|
||||
BOOL removeSuccess = [fileManager removeItemAtPath:fullPath error:&error];
|
||||
if (!removeSuccess)
|
||||
{
|
||||
NSString *message = [NSString stringWithFormat:@"Failed to delete existing symbolic link at \"%@\"", error.localizedDescription];
|
||||
NSLog(@"[SSZipArchive] %@", message);
|
||||
success = NO;
|
||||
unzippingError = [NSError errorWithDomain:SSZipArchiveErrorDomain code:error.code userInfo:@{NSLocalizedDescriptionKey: message}];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Create the symbolic link (making sure it stays relative if it was relative before)
|
||||
int symlinkError = symlink([destinationPath cStringUsingEncoding:NSUTF8StringEncoding],
|
||||
[fullPath cStringUsingEncoding:NSUTF8StringEncoding]);
|
||||
|
||||
if (symlinkError != 0)
|
||||
{
|
||||
NSLog(@"Failed to create symbolic link at \"%@\" to \"%@\". symlink() error code: %d", fullPath, destinationPath, errno);
|
||||
// Bubble the error up to the completion handler
|
||||
NSString *message = [NSString stringWithFormat:@"Failed to create symbolic link at \"%@\" to \"%@\" - symlink() error code: %d", fullPath, destinationPath, errno];
|
||||
NSLog(@"[SSZipArchive] %@", message);
|
||||
success = NO;
|
||||
unzippingError = [NSError errorWithDomain:NSPOSIXErrorDomain code:symlinkError userInfo:@{NSLocalizedDescriptionKey: message}];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -498,7 +539,7 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
progressHandler(strPath, fileInfo, currentFileNumber, globalInfo.number_entry);
|
||||
}
|
||||
}
|
||||
} while (ret == UNZ_OK && ret != UNZ_END_OF_LIST_OF_FILE);
|
||||
} while (ret == UNZ_OK && YES == success);
|
||||
|
||||
// Close
|
||||
unzClose(zip);
|
||||
@@ -516,9 +557,6 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
NSLog(@"[SSZipArchive] Error setting directory file modification date attribute: %@",err.localizedDescription);
|
||||
}
|
||||
}
|
||||
#if !__has_feature(objc_arc)
|
||||
[directoriesModificationDates release];
|
||||
#endif
|
||||
}
|
||||
|
||||
// Message delegate
|
||||
@@ -581,11 +619,6 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
}
|
||||
success = [zipArchive close];
|
||||
}
|
||||
|
||||
#if !__has_feature(objc_arc)
|
||||
[zipArchive release];
|
||||
#endif
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
@@ -645,12 +678,6 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
}
|
||||
success = [zipArchive close];
|
||||
}
|
||||
|
||||
#if !__has_feature(objc_arc)
|
||||
[fileManager release];
|
||||
[zipArchive release];
|
||||
#endif
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
@@ -664,15 +691,6 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
}
|
||||
|
||||
|
||||
#if !__has_feature(objc_arc)
|
||||
- (void)dealloc
|
||||
{
|
||||
[_path release];
|
||||
[super dealloc];
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
- (BOOL)open
|
||||
{
|
||||
NSAssert((_zip == NULL), @"Attempting open an archive which is already open");
|
||||
@@ -729,7 +747,9 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
uLong permissionsLong = @(permissionsOctal).unsignedLongValue;
|
||||
|
||||
// Store this into the external file attributes once it has been shifted 16 places left to form part of the second from last byte
|
||||
zipInfo.external_fa = permissionsLong << 16L;
|
||||
|
||||
//Casted back to an unsigned int to match type of external_fa in minizip
|
||||
zipInfo.external_fa = (unsigned int)(permissionsLong << 16L);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -791,7 +811,9 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
uLong permissionsLong = @(permissionsOctal).unsignedLongValue;
|
||||
|
||||
// Store this into the external file attributes once it has been shifted 16 places left to form part of the second from last byte
|
||||
zipInfo.external_fa = permissionsLong << 16L;
|
||||
|
||||
//Casted back to an unsigned int to match type of external_fa in minizip
|
||||
zipInfo.external_fa = (unsigned int)(permissionsLong << 16L);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -900,11 +922,6 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
[components setSecond:(msdosDateTime & kSecondMask) * 2];
|
||||
|
||||
NSDate *date = [NSDate dateWithTimeInterval:0 sinceDate:[gregorian dateFromComponents:components]];
|
||||
|
||||
#if !__has_feature(objc_arc)
|
||||
[components release];
|
||||
#endif
|
||||
|
||||
return date;
|
||||
}
|
||||
|
||||
|
||||
@@ -129,8 +129,8 @@ int cryptrand(unsigned char *buf, unsigned int len)
|
||||
return rlen;
|
||||
}
|
||||
|
||||
int crypthead(const char *passwd, uint8_t *buf, int buf_size,
|
||||
uint32_t *pkeys, const z_crc_t *pcrc_32_tab, uint32_t crc_for_crypting)
|
||||
int crypthead(const char *passwd, uint8_t *buf, int buf_size, uint32_t *pkeys,
|
||||
const z_crc_t *pcrc_32_tab, uint8_t verify1, uint8_t verify2)
|
||||
{
|
||||
uint8_t n = 0; /* index in random header */
|
||||
uint8_t header[RAND_HEAD_LEN-2]; /* random header */
|
||||
@@ -150,8 +150,8 @@ int crypthead(const char *passwd, uint8_t *buf, int buf_size,
|
||||
for (n = 0; n < RAND_HEAD_LEN-2; n++)
|
||||
buf[n] = (uint8_t)zencode(pkeys, pcrc_32_tab, header[n], t);
|
||||
|
||||
buf[n++] = (uint8_t)zencode(pkeys, pcrc_32_tab, (uint8_t)((crc_for_crypting >> 16) & 0xff), t);
|
||||
buf[n++] = (uint8_t)zencode(pkeys, pcrc_32_tab, (uint8_t)((crc_for_crypting >> 24) & 0xff), t);
|
||||
buf[n++] = (uint8_t)zencode(pkeys, pcrc_32_tab, verify1, t);
|
||||
buf[n++] = (uint8_t)zencode(pkeys, pcrc_32_tab, verify2, t);
|
||||
return n;
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ int cryptrand(unsigned char *buf, unsigned int len);
|
||||
|
||||
/* Create encryption header */
|
||||
int crypthead(const char *passwd, uint8_t *buf, int buf_size, uint32_t *pkeys,
|
||||
const z_crc_t *pcrc_32_tab, uint32_t crc_for_crypting);
|
||||
const z_crc_t *pcrc_32_tab, uint8_t verify1, uint8_t verify2);
|
||||
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
@@ -238,42 +238,6 @@ int is_large_file(const char *path)
|
||||
return (pos >= UINT32_MAX);
|
||||
}
|
||||
|
||||
int get_file_crc(const char *path, void *buf, uint32_t size_buf, uint32_t *result_crc)
|
||||
{
|
||||
FILE *handle = NULL;
|
||||
uint32_t calculate_crc = 0;
|
||||
uint32_t size_read = 0;
|
||||
int err = 0;
|
||||
|
||||
handle = fopen64(path, "rb");
|
||||
if (handle == NULL)
|
||||
{
|
||||
err = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
do
|
||||
{
|
||||
size_read = (int)fread(buf, 1, size_buf, handle);
|
||||
|
||||
if ((size_read < size_buf) && (feof(handle) == 0))
|
||||
{
|
||||
printf("error in reading %s\n", path);
|
||||
err = -1;
|
||||
}
|
||||
|
||||
if (size_read > 0)
|
||||
calculate_crc = (uint32_t)crc32(calculate_crc, buf, size_read);
|
||||
}
|
||||
while ((err == Z_OK) && (size_read > 0));
|
||||
fclose(handle);
|
||||
}
|
||||
|
||||
printf("file %s crc %x\n", path, calculate_crc);
|
||||
*result_crc = calculate_crc;
|
||||
return err;
|
||||
}
|
||||
|
||||
void display_zpos64(uint64_t n, int size_char)
|
||||
{
|
||||
/* To avoid compatibility problem we do here the conversion */
|
||||
|
||||
@@ -36,9 +36,6 @@ int check_file_exists(const char *path);
|
||||
/* Check to see if a file is over 4GB and needs ZIP64 extension */
|
||||
int is_large_file(const char *path);
|
||||
|
||||
/* Calculate the CRC32 of a file, because to encrypt a file, we need known the CRC32 of the file before */
|
||||
int get_file_crc(const char *path, void *buf, uint32_t size_buf, uint32_t *result_crc);
|
||||
|
||||
/* Print a 64-bit number for compatibility */
|
||||
void display_zpos64(uint64_t n, int size_char);
|
||||
|
||||
|
||||
@@ -33,8 +33,8 @@
|
||||
# define AES_HEADERSIZE (11)
|
||||
# define AES_KEYSIZE(mode) (64 + (mode * 64))
|
||||
|
||||
# include "aes.h"
|
||||
# include "fileenc.h"
|
||||
# include "aes/aes.h"
|
||||
# include "aes/fileenc.h"
|
||||
#endif
|
||||
#ifdef HAVE_APPLE_COMPRESSION
|
||||
# include <compression.h>
|
||||
|
||||
@@ -1229,11 +1229,22 @@ extern int ZEXPORT zipOpenNewFileInZip4_64(zipFile file, const char *filename, c
|
||||
{
|
||||
unsigned char buf_head[RAND_HEAD_LEN];
|
||||
uint32_t size_head = 0;
|
||||
uint8_t verify1 = 0;
|
||||
uint8_t verify2 = 0;
|
||||
|
||||
zi->ci.pcrc_32_tab = get_crc_table();
|
||||
/*init_keys(password, zi->ci.keys, zi->ci.pcrc_32_tab);*/
|
||||
|
||||
size_head = crypthead(password, buf_head, RAND_HEAD_LEN, zi->ci.keys, zi->ci.pcrc_32_tab, (unsigned int)crc_for_crypting);
|
||||
/*
|
||||
Info-ZIP modification to ZipCrypto format:
|
||||
If bit 3 of the general purpose bit flag is set, it uses high byte of 16-bit File Time.
|
||||
|
||||
verify1 = (uint8_t)((crc_for_crypting >> 16) & 0xff);
|
||||
verify2 = (uint8_t)((crc_for_crypting >> 24) & 0xff); */
|
||||
|
||||
verify1 = (uint8_t)((zi->ci.dos_date >> 16) & 0xff);
|
||||
verify2 = (uint8_t)((zi->ci.dos_date >> 8) & 0xff);
|
||||
|
||||
size_head = crypthead(password, buf_head, RAND_HEAD_LEN, zi->ci.keys, zi->ci.pcrc_32_tab, verify1, verify2);
|
||||
zi->ci.total_compressed += size_head;
|
||||
|
||||
if (ZWRITE64(zi->z_filefunc, zi->filestream, buf_head, size_head) != size_head)
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
PODS:
|
||||
- SSZipArchive (2.0.0)
|
||||
- SSZipArchive (2.0.4)
|
||||
|
||||
DEPENDENCIES:
|
||||
- SSZipArchive (from `..`)
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
SSZipArchive:
|
||||
:path: ".."
|
||||
:path: ..
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
SSZipArchive: 8153333145bf99acaf1918d257fdcef68a9269e1
|
||||
SSZipArchive: c77fc6ec8194f4e6d57876da1348e46cd63b90ba
|
||||
|
||||
PODFILE CHECKSUM: 0dc500eb72745751ccba7677de4da5534fcef36d
|
||||
|
||||
COCOAPODS: 1.2.1
|
||||
COCOAPODS: 1.3.1
|
||||
|
||||
@@ -339,7 +339,7 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
Reference in New Issue
Block a user