Compare commits
36 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
30eff54054 | ||
|
|
d94e717193 | ||
|
|
5666c74d61 | ||
|
|
25fb5cdf58 | ||
|
|
961d471d39 | ||
|
|
ec2cc3f474 | ||
|
|
8f7d1bb6db | ||
|
|
c8a93311b5 | ||
|
|
f9df6800d6 | ||
|
|
bad8ca91e2 | ||
|
|
dd86a28b22 | ||
|
|
465f6210c4 | ||
|
|
a004f928cd | ||
|
|
e7116f283f | ||
|
|
fa3fe1dfd8 | ||
|
|
1c5bf00ec3 | ||
|
|
f3030e34ab | ||
|
|
44329ab1a1 | ||
|
|
bdbe304da3 | ||
|
|
5bb31f8d67 | ||
|
|
7a2b2fe9d4 | ||
|
|
94da75db53 | ||
|
|
75dad5ea8d | ||
|
|
a48f5d140a | ||
|
|
dc8bf3558c | ||
|
|
77054d5ca5 | ||
|
|
123e801b82 | ||
|
|
77892c97d8 | ||
|
|
790b2c1454 | ||
|
|
528ca5694b | ||
|
|
b4d11dffc9 | ||
|
|
6781d97343 | ||
|
|
2a248f6b55 | ||
|
|
55b067b11c | ||
|
|
889e4293d1 | ||
|
|
e0a74bddd4 |
20
.gitignore
vendored
20
.gitignore
vendored
@@ -1,21 +1,13 @@
|
||||
# Xcode
|
||||
#
|
||||
build/
|
||||
*.pbxuser
|
||||
!default.pbxuser
|
||||
*.mode1v3
|
||||
!default.mode1v3
|
||||
*.mode2v3
|
||||
!default.mode2v3
|
||||
*.perspectivev3
|
||||
!default.perspectivev3
|
||||
xcuserdata
|
||||
xcuserdata/
|
||||
*.xccheckout
|
||||
*.moved-aside
|
||||
DerivedData
|
||||
*.hmap
|
||||
*.ipa
|
||||
*.xcuserstate
|
||||
|
||||
# AppCode
|
||||
.idea
|
||||
|
||||
# macOS
|
||||
.DS_Store
|
||||
|
||||
# CocoaPods
|
||||
|
||||
38
.travis.yml
38
.travis.yml
@@ -1,7 +1,41 @@
|
||||
language: objective-c
|
||||
osx_image: xcode8.3
|
||||
podfile: ObjectiveCExample/Podfile
|
||||
xcode_workspace: ObjectiveCExample/ObjectiveCExample.xcworkspace
|
||||
xcode_scheme: ObjectiveCExample
|
||||
script: xcodebuild -workspace ObjectiveCExample/ObjectiveCExample.xcworkspace -scheme ObjectiveCExample -sdk iphonesimulator -destination "id=F60B87EC-8969-41A7-90ED-D0826ECC32DB" -configuration Debug ONLY_ACTIVE_ARCH=NO ENABLE_TESTABILITY=YES test
|
||||
matrix:
|
||||
include:
|
||||
- osx_image: xcode9
|
||||
env: DESTINATION="iPhone 7 Plus (11.0)" # oldest/newest for iOS 11.x
|
||||
|
||||
- osx_image: xcode9
|
||||
env: DESTINATION="iPhone 7 Plus (10.3.1)" # latest for iOS 10.x
|
||||
|
||||
- osx_image: xcode8.3
|
||||
env: DESTINATION="iPhone 5 (10.0)" # oldest for iOS 10.x
|
||||
|
||||
- osx_image: xcode8.3
|
||||
env: DESTINATION="iPhone 6s Plus (9.3)" # latest for iOS 9.x
|
||||
|
||||
- osx_image: xcode7.3
|
||||
env: DESTINATION="iPhone 4s (9.0)" # oldest for iOS 9.x
|
||||
|
||||
- osx_image: xcode7.3
|
||||
env: DESTINATION="iPhone 6 Plus (8.4)" # latest for iOS 8.x
|
||||
|
||||
- osx_image: xcode7.3
|
||||
env: DESTINATION="iPhone 4s (8.1)" # oldest for iOS 8.x
|
||||
|
||||
before_install:
|
||||
# Grepping destination device udid
|
||||
- DESTINATION_UDID=$(instruments -s devices | grep "$DESTINATION \[" | sed -E 's/.*\[([0-9A-F-]+)\].*/\1/g')
|
||||
# Prelaunching simulator to avoid timeout https://github.com/travis-ci/travis-ci/issues/6422
|
||||
- open -a "simulator" --args -CurrentDeviceUDID $DESTINATION_UDID
|
||||
|
||||
script:
|
||||
# Testing
|
||||
- xcodebuild
|
||||
`` -workspace ObjectiveCExample/ObjectiveCExample.xcworkspace
|
||||
`` -scheme ObjectiveCExample -sdk iphonesimulator
|
||||
`` -destination "id=$DESTINATION_UDID"
|
||||
`` -configuration Debug ONLY_ACTIVE_ARCH=NO ENABLE_TESTABILITY=YES
|
||||
`` test
|
||||
|
||||
@@ -265,7 +265,7 @@
|
||||
8DFE19E21BDA9FF300709011 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0820;
|
||||
LastUpgradeCheck = 0900;
|
||||
TargetAttributes = {
|
||||
8DFE19E91BDA9FF300709011 = {
|
||||
CreatedOnToolsVersion = 7.1;
|
||||
@@ -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";
|
||||
@@ -506,11 +506,12 @@
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES_AGGRESSIVE;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES_AGGRESSIVE;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
@@ -531,7 +532,7 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.1;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.1;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
@@ -558,11 +559,12 @@
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES_AGGRESSIVE;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES_AGGRESSIVE;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
@@ -577,7 +579,7 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.1;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.1;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
|
||||
@@ -50,6 +50,8 @@
|
||||
if (success) {
|
||||
_unzipButton.enabled = YES;
|
||||
_zipButton.enabled = NO;
|
||||
} else {
|
||||
NSLog(@"No success");
|
||||
}
|
||||
_resetButton.enabled = YES;
|
||||
}
|
||||
|
||||
@@ -5,5 +5,5 @@
|
||||
* Test delegate by collecting its calls
|
||||
*/
|
||||
@interface CollectingDelegate : NSObject <SSZipArchiveDelegate>
|
||||
@property(nonatomic, retain) NSMutableArray *files;
|
||||
@end
|
||||
@property(nonatomic, retain) NSMutableArray<NSString *> *files;
|
||||
@end
|
||||
|
||||
@@ -61,6 +61,8 @@
|
||||
|
||||
- (void)testZipping {
|
||||
// use extracted files from [-testUnzipping]
|
||||
[self testUnzipping];
|
||||
|
||||
NSString *inputPath = [self _cachesPath:@"Regular"];
|
||||
NSArray *inputPaths = @[[inputPath stringByAppendingPathComponent:@"Readme.markdown"],
|
||||
[inputPath stringByAppendingPathComponent:@"LICENSE"]];
|
||||
@@ -68,8 +70,9 @@
|
||||
NSString *outputPath = [self _cachesPath:@"Zipped"];
|
||||
|
||||
NSString *archivePath = [outputPath stringByAppendingPathComponent:@"CreatedArchive.zip"];
|
||||
[SSZipArchive createZipFileAtPath:archivePath withFilesAtPaths:inputPaths];
|
||||
|
||||
BOOL success = [SSZipArchive createZipFileAtPath:archivePath withFilesAtPaths:inputPaths];
|
||||
|
||||
XCTAssertTrue(success);
|
||||
// TODO: Make sure the files are actually unzipped. They are, but the test should be better.
|
||||
XCTAssertTrue([[NSFileManager defaultManager] fileExistsAtPath:archivePath], @"Archive created");
|
||||
}
|
||||
@@ -82,13 +85,13 @@
|
||||
NSString *outputPath = [self _cachesPath:@"FolderZipped"];
|
||||
NSString *archivePath = [outputPath stringByAppendingPathComponent:@"ArchiveWithFolders.zip"];
|
||||
|
||||
[SSZipArchive createZipFileAtPath:archivePath withContentsOfDirectory:inputPath];
|
||||
BOOL success = [SSZipArchive createZipFileAtPath:archivePath withContentsOfDirectory:inputPath];
|
||||
XCTAssertTrue(success);
|
||||
XCTAssertTrue([[NSFileManager defaultManager] fileExistsAtPath:archivePath], @"Folder Archive created");
|
||||
}
|
||||
|
||||
- (void)testMultipleZippping{
|
||||
NSArray *inputPaths = @[[[NSBundle bundleForClass: [self class]]pathForResource:@"0" ofType:@"m4a"],
|
||||
|
||||
[[NSBundle bundleForClass: [self class]]pathForResource:@"1" ofType:@"m4a"],
|
||||
[[NSBundle bundleForClass: [self class]]pathForResource:@"2" ofType:@"m4a"],
|
||||
[[NSBundle bundleForClass: [self class]]pathForResource:@"3" ofType:@"m4a"],
|
||||
@@ -106,8 +109,9 @@
|
||||
// Zipping
|
||||
NSString *archivePath = [outputPath stringByAppendingPathComponent:[NSString stringWithFormat:@"queue_test_%d.zip",test]];
|
||||
|
||||
[SSZipArchive createZipFileAtPath:archivePath withFilesAtPaths:inputPaths];
|
||||
|
||||
BOOL success = [SSZipArchive createZipFileAtPath:archivePath withFilesAtPaths:inputPaths];
|
||||
XCTAssertTrue(success);
|
||||
|
||||
long long threshold = 510000; // 510kB:size slightly smaller than a successful zip, but much larger than a failed one
|
||||
long long fileSize = [[[NSFileManager defaultManager] attributesOfItemAtPath:archivePath error:nil][NSFileSize] longLongValue];
|
||||
XCTAssertTrue(fileSize > threshold, @"zipping failed at %@!",archivePath);
|
||||
@@ -119,8 +123,9 @@
|
||||
NSString *zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"TestArchive" ofType:@"zip"];
|
||||
NSString *outputPath = [self _cachesPath:@"Regular"];
|
||||
|
||||
[SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:self];
|
||||
|
||||
BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:self];
|
||||
XCTAssertTrue(success);
|
||||
|
||||
NSFileManager *fileManager = [NSFileManager defaultManager];
|
||||
NSString *testPath = [outputPath stringByAppendingPathComponent:@"Readme.markdown"];
|
||||
XCTAssertTrue([fileManager fileExistsAtPath:testPath], @"Readme unzipped");
|
||||
@@ -132,8 +137,9 @@
|
||||
NSString *zipPath = [[NSBundle bundleForClass: [self class]] pathForResource:@"TestArchive" ofType:@"zip"];
|
||||
NSString *outputPath = [self _cachesPath:@"Regular"];
|
||||
|
||||
[SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:self];
|
||||
|
||||
BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:self];
|
||||
XCTAssertTrue(success);
|
||||
|
||||
NSFileManager *fileManager = [NSFileManager defaultManager];
|
||||
NSString *testPath = [outputPath stringByAppendingPathComponent:@"Readme.markdown"];
|
||||
XCTAssertTrue([fileManager fileExistsAtPath:testPath], @"Readme unzipped");
|
||||
@@ -147,8 +153,9 @@
|
||||
|
||||
[progressEvents removeAllObjects];
|
||||
|
||||
[SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:self];
|
||||
|
||||
BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:self];
|
||||
XCTAssertTrue(success);
|
||||
|
||||
// 4 events: the first, then for each of the two files one, then the final event
|
||||
XCTAssertTrue(4 == [progressEvents count], @"Expected 4 progress events");
|
||||
XCTAssertTrue(0 == [progressEvents[0] intValue]);
|
||||
@@ -163,8 +170,9 @@
|
||||
NSString *outputPath = [self _cachesPath:@"Password"];
|
||||
|
||||
NSError *error = nil;
|
||||
[SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath overwrite:YES password:@"passw0rd" error:&error delegate:self];
|
||||
|
||||
BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath overwrite:YES password:@"passw0rd" error:&error delegate:self];
|
||||
XCTAssertTrue(success);
|
||||
|
||||
NSFileManager *fileManager = [NSFileManager defaultManager];
|
||||
NSString *testPath = [outputPath stringByAppendingPathComponent:@"Readme.markdown"];
|
||||
XCTAssertTrue([fileManager fileExistsAtPath:testPath], @"Readme unzipped");
|
||||
@@ -178,7 +186,8 @@
|
||||
NSString *outputPath = [self _cachesPath:@"Password"];
|
||||
|
||||
NSError *error = nil;
|
||||
[SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath overwrite:YES password:@"passw0rd123" error:&error delegate:self];
|
||||
BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath overwrite:YES password:@"passw0rd123" error:&error delegate:self];
|
||||
XCTAssertTrue(success);
|
||||
|
||||
NSFileManager *fileManager = [NSFileManager defaultManager];
|
||||
NSString *testPath = [outputPath stringByAppendingPathComponent:@"Readme.markdown"];
|
||||
@@ -217,13 +226,49 @@
|
||||
XCTAssertTrue(protected, @"has password");
|
||||
}
|
||||
|
||||
- (void)testZippingAndUnzippingWithUnicodePassword {
|
||||
|
||||
/********** Zipping ********/
|
||||
|
||||
// use extracted files from [-testUnzipping]
|
||||
[self testUnzipping];
|
||||
NSString *inputPath = [self _cachesPath:@"Regular"];
|
||||
NSArray *inputPaths = @[[inputPath stringByAppendingPathComponent:@"Readme.markdown"],
|
||||
[inputPath stringByAppendingPathComponent:@"LICENSE"]];
|
||||
|
||||
NSString *outputPath = [self _cachesPath:@"Zipped"];
|
||||
|
||||
NSString *archivePath = [outputPath stringByAppendingPathComponent:@"CreatedUnicodePasswordArchive.zip"];
|
||||
BOOL success = [SSZipArchive createZipFileAtPath:archivePath withFilesAtPaths:inputPaths withPassword:@"ꊐ⌒Ⅳ🤐"];
|
||||
|
||||
XCTAssertTrue(success);
|
||||
XCTAssertTrue([[NSFileManager defaultManager] fileExistsAtPath:archivePath], @"Archive created");
|
||||
|
||||
/********** Unzipping ********/
|
||||
|
||||
outputPath = [self _cachesPath:@"UnicodePassword"];
|
||||
|
||||
NSError *error = nil;
|
||||
success = [SSZipArchive unzipFileAtPath:archivePath toDestination:outputPath overwrite:YES password:@"ꊐ⌒Ⅳ🤐" error:&error delegate:self];
|
||||
XCTAssertTrue(success);
|
||||
|
||||
NSFileManager *fileManager = [NSFileManager defaultManager];
|
||||
NSString *testPath = [outputPath stringByAppendingPathComponent:@"Readme.markdown"];
|
||||
XCTAssertTrue([fileManager fileExistsAtPath:testPath], @"Readme unzipped");
|
||||
|
||||
testPath = [outputPath stringByAppendingPathComponent:@"LICENSE"];
|
||||
XCTAssertTrue([fileManager fileExistsAtPath:testPath], @"LICENSE unzipped");
|
||||
|
||||
}
|
||||
|
||||
//Temp Disabled test, fix is not yet in the AES version of the unzip lib
|
||||
|
||||
//- (void)testUnzippingTruncatedFileFix {
|
||||
// NSString* zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"IncorrectHeaders" ofType:@"zip"];
|
||||
// NSString* outputPath = [self _cachesPath:@"IncorrectHeaders"];
|
||||
//
|
||||
// [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:self];
|
||||
// BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:self];
|
||||
// XCTAssertTrue(success);
|
||||
//
|
||||
// NSString* intendedReadmeTxtMD5 = @"31ac96301302eb388070c827447290b5";
|
||||
//
|
||||
@@ -240,8 +285,9 @@
|
||||
NSString* zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"SymbolicLink" ofType:@"zip"];
|
||||
NSString* outputPath = [self _cachesPath:@"SymbolicLink"];
|
||||
|
||||
[SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:self];
|
||||
|
||||
BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:self];
|
||||
XCTAssertTrue(success);
|
||||
|
||||
NSString *testSymlink = [outputPath stringByAppendingPathComponent:@"SymbolicLink/Xcode.app"];
|
||||
|
||||
NSError *error = nil;
|
||||
@@ -256,8 +302,9 @@
|
||||
NSString* zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:resourceName ofType:@"zip"];
|
||||
NSString* outputPath = [self _cachesPath:resourceName];
|
||||
|
||||
[SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:self];
|
||||
|
||||
BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:self];
|
||||
XCTAssertTrue(success);
|
||||
|
||||
// Determine where the symlinks are
|
||||
NSString *subfolderName = @"symlinks";
|
||||
NSString *testBasePath = [NSString pathWithComponents:@[outputPath]];
|
||||
@@ -278,8 +325,9 @@
|
||||
NSString* zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"Unicode" ofType:@"zip"];
|
||||
NSString* outputPath = [self _cachesPath:@"Unicode"];
|
||||
|
||||
[SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:self];
|
||||
|
||||
BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:self];
|
||||
XCTAssertTrue(success);
|
||||
|
||||
bool unicodeFilenameWasExtracted = [[NSFileManager defaultManager] fileExistsAtPath:[outputPath stringByAppendingPathComponent:@"Accént.txt"]];
|
||||
|
||||
bool unicodeFolderWasExtracted = [[NSFileManager defaultManager] fileExistsAtPath:[outputPath stringByAppendingPathComponent:@"Fólder/Nothing.txt"]];
|
||||
@@ -291,6 +339,8 @@
|
||||
|
||||
- (void)testZippingAndUnzippingForDate {
|
||||
|
||||
// use extracted files from [-testUnzipping]
|
||||
[self testUnzipping];
|
||||
NSString *inputPath = [self _cachesPath:@"Regular"];
|
||||
NSArray *inputPaths = @[[inputPath stringByAppendingPathComponent:@"Readme.markdown"]];
|
||||
|
||||
@@ -299,8 +349,10 @@
|
||||
NSString *outputPath = [self _cachesPath:@"ZippedDate"];
|
||||
NSString *archivePath = [outputPath stringByAppendingPathComponent:@"CreatedArchive.zip"];
|
||||
|
||||
[SSZipArchive createZipFileAtPath:archivePath withFilesAtPaths:inputPaths];
|
||||
[SSZipArchive unzipFileAtPath:archivePath toDestination:outputPath delegate:self];
|
||||
BOOL success = [SSZipArchive createZipFileAtPath:archivePath withFilesAtPaths:inputPaths];
|
||||
XCTAssertTrue(success);
|
||||
success = [SSZipArchive unzipFileAtPath:archivePath toDestination:outputPath delegate:self];
|
||||
XCTAssertTrue(success);
|
||||
|
||||
NSDictionary *createdFileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:[outputPath stringByAppendingPathComponent:@"Readme.markdown"] error:nil];
|
||||
|
||||
@@ -330,14 +382,15 @@
|
||||
NSString *archivePath = [outputDir stringByAppendingPathComponent:@"TestAppArchive.zip"];
|
||||
|
||||
// Create the zip file using the contents of the .app file as the input
|
||||
[SSZipArchive createZipFileAtPath:archivePath withContentsOfDirectory:inputFile];
|
||||
|
||||
BOOL success = [SSZipArchive createZipFileAtPath:archivePath withContentsOfDirectory:inputFile];
|
||||
XCTAssertTrue(success);
|
||||
|
||||
/********** Un-zipping *******/
|
||||
|
||||
// Using this newly created zip file, unzip it
|
||||
[SSZipArchive unzipFileAtPath:archivePath toDestination:outputDir];
|
||||
|
||||
success = [SSZipArchive unzipFileAtPath:archivePath toDestination:outputDir];
|
||||
XCTAssertTrue(success);
|
||||
|
||||
// Get the path to the target file after unzipping
|
||||
NSString *targetFilePath = [outputDir stringByAppendingPathComponent:@"/Contents/MacOS/TestProject"];
|
||||
|
||||
@@ -359,8 +412,8 @@
|
||||
CancelDelegate *delegate = [[CancelDelegate alloc] init];
|
||||
delegate.numFilesToUnzip = 1;
|
||||
|
||||
[SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:delegate];
|
||||
|
||||
BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:delegate];
|
||||
XCTAssertFalse(success);
|
||||
XCTAssertEqual(delegate.numFilesUnzipped, 1);
|
||||
XCTAssertFalse(delegate.didUnzipArchive);
|
||||
XCTAssertNotEqual(delegate.loaded, delegate.total);
|
||||
@@ -370,8 +423,8 @@
|
||||
delegate = [[CancelDelegate alloc] init];
|
||||
delegate.numFilesToUnzip = 1000;
|
||||
|
||||
[SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:delegate];
|
||||
|
||||
success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:delegate];
|
||||
XCTAssertTrue(success);
|
||||
XCTAssertEqual(delegate.numFilesUnzipped, 2);
|
||||
XCTAssertTrue(delegate.didUnzipArchive);
|
||||
XCTAssertEqual(delegate.loaded, delegate.total);
|
||||
@@ -385,16 +438,18 @@
|
||||
// NSString *zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"LargeArchive" ofType:@"zip"];
|
||||
// NSString *outputPath = [self _cachesPath:@"Large"];
|
||||
//
|
||||
// [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath];
|
||||
// BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath];
|
||||
// XCTAssertTrue(success);
|
||||
//}
|
||||
|
||||
-(void)testShouldProvidePathOfUnzippedFileInDelegateCallback {
|
||||
CollectingDelegate *collector = [CollectingDelegate new];
|
||||
NSString *zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"TestArchive" ofType:@"zip"];
|
||||
NSString *outputPath = [self _cachesPath:@"Regular"];
|
||||
|
||||
[SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:collector];
|
||||
|
||||
NSString *outputPath = [self _cachesPath:@"Regular"];
|
||||
|
||||
BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:collector];
|
||||
XCTAssertTrue(success);
|
||||
|
||||
// STAssertEqualObjects([collector.files objectAtIndex:0], @"LICENSE.txt", nil);
|
||||
// STAssertEqualObjects([collector.files objectAtIndex:1], @"README.md", nil);
|
||||
}
|
||||
@@ -434,7 +489,7 @@
|
||||
#pragma mark - Private
|
||||
|
||||
- (NSString *)_cachesPath:(NSString *)directory {
|
||||
NSString *path = [[NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) lastObject]
|
||||
NSString *path = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES).lastObject
|
||||
stringByAppendingPathComponent:@"com.samsoffes.ssziparchive.tests"];
|
||||
if (directory) {
|
||||
path = [path stringByAppendingPathComponent:directory];
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
PODS:
|
||||
- SSZipArchive (2.0.2)
|
||||
- SSZipArchive (2.0.7)
|
||||
|
||||
DEPENDENCIES:
|
||||
- SSZipArchive (from `..`)
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
SSZipArchive:
|
||||
:path: ".."
|
||||
:path: ..
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
SSZipArchive: 5fdf578dbbb60000b23439f80fa04e81d00740ee
|
||||
SSZipArchive: 8c197761d66bd33e7f8b5b51ee57dff303971150
|
||||
|
||||
PODFILE CHECKSUM: 7f4058a9cbc69b4e63808729577a8bb2098bc527
|
||||
|
||||
COCOAPODS: 1.2.1
|
||||
COCOAPODS: 1.3.1
|
||||
|
||||
@@ -14,7 +14,9 @@ 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 a tied to a older 1.x release and will not be upgraded. Xcode 8.3+ removes support 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*
|
||||
|
||||
SSZipArchive works on Xcode 7-9 and above, iOS 8-11 and above.
|
||||
|
||||
### CocoaPods
|
||||
In your Podfile:
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'SSZipArchive'
|
||||
s.version = '2.0.2'
|
||||
s.version = '2.0.7'
|
||||
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'
|
||||
s.license = { :type => 'MIT', :file => 'LICENSE.txt' }
|
||||
s.authors = { 'Sam Soffes' => 'sam@soff.es', 'Joshua Hudson' => nil }
|
||||
s.authors = { 'Sam Soffes' => 'sam@soff.es', 'Joshua Hudson' => nil, 'Antoine Cœur' => nil }
|
||||
s.source = { :git => 'https://github.com/ZipArchive/ZipArchive.git', :tag => "v#{s.version}" }
|
||||
s.ios.deployment_target = '4.0'
|
||||
s.tvos.deployment_target = '9.0'
|
||||
|
||||
@@ -21,6 +21,7 @@ typedef NS_ENUM(NSInteger, SSZipArchiveErrorCode) {
|
||||
SSZipArchiveErrorCodeFileInfoNotLoadable = -3,
|
||||
SSZipArchiveErrorCodeFileContentNotReadable = -4,
|
||||
SSZipArchiveErrorCodeFailedToWriteFile = -5,
|
||||
SSZipArchiveErrorCodeInvalidArguments = -6,
|
||||
};
|
||||
|
||||
@protocol SSZipArchiveDelegate;
|
||||
@@ -29,14 +30,24 @@ typedef NS_ENUM(NSInteger, SSZipArchiveErrorCode) {
|
||||
|
||||
// Password check
|
||||
+ (BOOL)isFilePasswordProtectedAtPath:(NSString *)path;
|
||||
+ (BOOL)isPasswordValidForArchiveAtPath:(NSString *)path password:(NSString *)pw error:(NSError * __nullable * __nullable)error NS_SWIFT_NOTHROW;
|
||||
+ (BOOL)isPasswordValidForArchiveAtPath:(NSString *)path password:(NSString *)pw error:(NSError * _Nullable * _Nullable)error NS_SWIFT_NOTHROW;
|
||||
|
||||
// Unzip
|
||||
+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination;
|
||||
+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination delegate:(nullable id<SSZipArchiveDelegate>)delegate;
|
||||
|
||||
+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination overwrite:(BOOL)overwrite password:(nullable NSString *)password error:(NSError * *)error;
|
||||
+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination overwrite:(BOOL)overwrite password:(nullable NSString *)password error:(NSError * *)error delegate:(nullable id<SSZipArchiveDelegate>)delegate NS_REFINED_FOR_SWIFT;
|
||||
+ (BOOL)unzipFileAtPath:(NSString *)path
|
||||
toDestination:(NSString *)destination
|
||||
overwrite:(BOOL)overwrite
|
||||
password:(nullable NSString *)password
|
||||
error:(NSError * *)error;
|
||||
|
||||
+ (BOOL)unzipFileAtPath:(NSString *)path
|
||||
toDestination:(NSString *)destination
|
||||
overwrite:(BOOL)overwrite
|
||||
password:(nullable NSString *)password
|
||||
error:(NSError * *)error
|
||||
delegate:(nullable id<SSZipArchiveDelegate>)delegate NS_REFINED_FOR_SWIFT;
|
||||
|
||||
+ (BOOL)unzipFileAtPath:(NSString *)path
|
||||
toDestination:(NSString *)destination
|
||||
@@ -47,38 +58,43 @@ typedef NS_ENUM(NSInteger, SSZipArchiveErrorCode) {
|
||||
delegate:(nullable id<SSZipArchiveDelegate>)delegate;
|
||||
|
||||
+ (BOOL)unzipFileAtPath:(NSString *)path
|
||||
toDestination:(NSString *)destination
|
||||
progressHandler:(void (^)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler
|
||||
completionHandler:(void (^)(NSString *path, BOOL succeeded, NSError * __nullable error))completionHandler;
|
||||
toDestination:(NSString *)destination
|
||||
progressHandler:(void (^)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler
|
||||
completionHandler:(void (^)(NSString *path, BOOL succeeded, NSError * _Nullable error))completionHandler;
|
||||
|
||||
+ (BOOL)unzipFileAtPath:(NSString *)path
|
||||
toDestination:(NSString *)destination
|
||||
overwrite:(BOOL)overwrite
|
||||
password:(nullable NSString *)password
|
||||
progressHandler:(void (^)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler
|
||||
completionHandler:(void (^)(NSString *path, BOOL succeeded, NSError * __nullable error))completionHandler;
|
||||
toDestination:(NSString *)destination
|
||||
overwrite:(BOOL)overwrite
|
||||
password:(nullable NSString *)password
|
||||
progressHandler:(void (^)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler
|
||||
completionHandler:(void (^)(NSString *path, BOOL succeeded, NSError * _Nullable error))completionHandler;
|
||||
|
||||
// Zip
|
||||
|
||||
// without password
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray *)paths;
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray<NSString *> *)paths;
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath;
|
||||
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirectory;
|
||||
|
||||
// with password, password could be nil
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray *)paths withPassword:(nullable NSString *)password;
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray<NSString *> *)paths withPassword:(nullable NSString *)password;
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath withPassword:(nullable NSString *)password;
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirectory withPassword:(nullable NSString *)password;
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirectory withPassword:(nullable NSString *)password andProgressHandler:(void(^ _Nullable)(NSUInteger entryNumber, NSUInteger total))progressHandler;
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path
|
||||
withContentsOfDirectory:(NSString *)directoryPath
|
||||
keepParentDirectory:(BOOL)keepParentDirectory
|
||||
withPassword:(nullable NSString *)password
|
||||
andProgressHandler:(void(^ _Nullable)(NSUInteger entryNumber, NSUInteger total))progressHandler;
|
||||
|
||||
- (instancetype)initWithPath:(NSString *)path;
|
||||
@property (NS_NONATOMIC_IOSONLY, readonly) BOOL open;
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
- (instancetype)initWithPath:(NSString *)path NS_DESIGNATED_INITIALIZER;
|
||||
- (BOOL)open;
|
||||
- (BOOL)writeFile:(NSString *)path withPassword:(nullable NSString *)password;
|
||||
- (BOOL)writeFolderAtPath:(NSString *)path withFolderName:(NSString *)folderName withPassword:(nullable NSString *)password;
|
||||
- (BOOL)writeFileAtPath:(NSString *)path withFileName:(nullable NSString *)fileName withPassword:(nullable NSString *)password;
|
||||
- (BOOL)writeData:(NSData *)data filename:(nullable NSString *)filename withPassword:(nullable NSString *)password;
|
||||
@property (NS_NONATOMIC_IOSONLY, readonly) BOOL close;
|
||||
- (BOOL)close;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -5,12 +5,11 @@
|
||||
// Created by Sam Soffes on 7/21/10.
|
||||
// Copyright (c) Sam Soffes 2010-2015. All rights reserved.
|
||||
//
|
||||
|
||||
#import "SSZipArchive.h"
|
||||
#include "unzip.h"
|
||||
#include "zip.h"
|
||||
#include "minishared.h"
|
||||
#import "zlib.h"
|
||||
#import "zconf.h"
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
@@ -19,13 +18,13 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
#define CHUNK 16384
|
||||
|
||||
@interface SSZipArchive ()
|
||||
+ (NSDate *)_dateWithMSDOSFormat:(UInt32)msdosDateTime;
|
||||
- (instancetype)init NS_DESIGNATED_INITIALIZER;
|
||||
@end
|
||||
|
||||
@implementation SSZipArchive
|
||||
{
|
||||
/// path for zip file
|
||||
NSString *_path;
|
||||
NSString *_filename;
|
||||
zipFile _zip;
|
||||
}
|
||||
|
||||
@@ -33,7 +32,7 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
|
||||
+ (BOOL)isFilePasswordProtectedAtPath:(NSString *)path {
|
||||
// Begin opening
|
||||
zipFile zip = unzOpen((const char*)[path fileSystemRepresentation]);
|
||||
zipFile zip = unzOpen(path.fileSystemRepresentation);
|
||||
if (zip == NULL) {
|
||||
return NO;
|
||||
}
|
||||
@@ -66,7 +65,7 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
*error = nil;
|
||||
}
|
||||
|
||||
zipFile zip = unzOpen((const char*)[path fileSystemRepresentation]);
|
||||
zipFile zip = unzOpen(path.fileSystemRepresentation);
|
||||
if (zip == NULL) {
|
||||
if (error) {
|
||||
*error = [NSError errorWithDomain:SSZipArchiveErrorDomain
|
||||
@@ -79,10 +78,10 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
int ret = unzGoToFirstFile(zip);
|
||||
if (ret == UNZ_OK) {
|
||||
do {
|
||||
if ([pw length] == 0) {
|
||||
if (pw.length == 0) {
|
||||
ret = unzOpenCurrentFile(zip);
|
||||
} else {
|
||||
ret = unzOpenCurrentFilePassword(zip, [pw cStringUsingEncoding:NSASCIIStringEncoding]);
|
||||
ret = unzOpenCurrentFilePassword(zip, [pw cStringUsingEncoding:NSUTF8StringEncoding]);
|
||||
}
|
||||
if (ret != UNZ_OK) {
|
||||
if (ret != UNZ_BADPASSWORD) {
|
||||
@@ -146,7 +145,12 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
return [self unzipFileAtPath:path toDestination:destination preserveAttributes:YES overwrite:YES password:nil error:nil delegate:delegate progressHandler:nil completionHandler:nil];
|
||||
}
|
||||
|
||||
+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination overwrite:(BOOL)overwrite password:(nullable NSString *)password error:(NSError **)error delegate:(nullable id<SSZipArchiveDelegate>)delegate
|
||||
+ (BOOL)unzipFileAtPath:(NSString *)path
|
||||
toDestination:(NSString *)destination
|
||||
overwrite:(BOOL)overwrite
|
||||
password:(nullable NSString *)password
|
||||
error:(NSError **)error
|
||||
delegate:(nullable id<SSZipArchiveDelegate>)delegate
|
||||
{
|
||||
return [self unzipFileAtPath:path toDestination:destination preserveAttributes:YES overwrite:overwrite password:password error:error delegate:delegate progressHandler:nil completionHandler:nil];
|
||||
}
|
||||
@@ -156,7 +160,7 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
overwrite:(BOOL)overwrite
|
||||
password:(NSString *)password
|
||||
progressHandler:(void (^)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler
|
||||
completionHandler:(void (^)(NSString *path, BOOL succeeded, NSError *__nullable error))completionHandler
|
||||
completionHandler:(void (^)(NSString *path, BOOL succeeded, NSError * _Nullable error))completionHandler
|
||||
{
|
||||
return [self unzipFileAtPath:path toDestination:destination preserveAttributes:YES overwrite:overwrite password:password error:nil delegate:nil progressHandler:progressHandler completionHandler:completionHandler];
|
||||
}
|
||||
@@ -164,7 +168,7 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
+ (BOOL)unzipFileAtPath:(NSString *)path
|
||||
toDestination:(NSString *)destination
|
||||
progressHandler:(void (^)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler
|
||||
completionHandler:(void (^)(NSString *path, BOOL succeeded, NSError * __nullable error))completionHandler
|
||||
completionHandler:(void (^)(NSString *path, BOOL succeeded, NSError * _Nullable error))completionHandler
|
||||
{
|
||||
return [self unzipFileAtPath:path toDestination:destination preserveAttributes:YES overwrite:YES password:nil error:nil delegate:nil progressHandler:progressHandler completionHandler:completionHandler];
|
||||
}
|
||||
@@ -184,14 +188,30 @@ 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
|
||||
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);
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
|
||||
// Begin opening
|
||||
zipFile zip = unzOpen((const char*)[path fileSystemRepresentation]);
|
||||
zipFile zip = unzOpen(path.fileSystemRepresentation);
|
||||
if (zip == NULL)
|
||||
{
|
||||
NSDictionary *userInfo = @{NSLocalizedDescriptionKey: @"failed to open zip file"};
|
||||
@@ -236,7 +256,7 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
int crc_ret = 0;
|
||||
unsigned char buffer[4096] = {0};
|
||||
NSFileManager *fileManager = [NSFileManager defaultManager];
|
||||
NSMutableArray *directoriesModificationDates = [[NSMutableArray alloc] init];
|
||||
NSMutableArray<NSDictionary *> *directoriesModificationDates = [[NSMutableArray alloc] init];
|
||||
|
||||
// Message delegate
|
||||
if ([delegate respondsToSelector:@selector(zipArchiveWillUnzipArchiveAtPath:zipInfo:)]) {
|
||||
@@ -250,10 +270,10 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
NSError *unzippingError;
|
||||
do {
|
||||
@autoreleasepool {
|
||||
if ([password length] == 0) {
|
||||
if (password.length == 0) {
|
||||
ret = unzOpenCurrentFile(zip);
|
||||
} else {
|
||||
ret = unzOpenCurrentFilePassword(zip, [password cStringUsingEncoding:NSASCIIStringEncoding]);
|
||||
ret = unzOpenCurrentFilePassword(zip, [password cStringUsingEncoding:NSUTF8StringEncoding]);
|
||||
}
|
||||
|
||||
if (ret != UNZ_OK) {
|
||||
@@ -326,7 +346,7 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
|
||||
// Check if it contains directory
|
||||
// NSString * strPath = @(filename);
|
||||
NSString * strPath = [NSString stringWithCString:filename encoding:NSUTF8StringEncoding];
|
||||
NSString * strPath = @(filename);
|
||||
//if filename contains chinese dir transform Encoding
|
||||
if (!strPath) {
|
||||
NSStringEncoding enc = CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingGB_18030_2000);
|
||||
@@ -356,7 +376,7 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
if (isDirectory) {
|
||||
[fileManager createDirectoryAtPath:fullPath withIntermediateDirectories:YES attributes:directoryAttr error:&err];
|
||||
} else {
|
||||
[fileManager createDirectoryAtPath:[fullPath stringByDeletingLastPathComponent] withIntermediateDirectories:YES attributes:directoryAttr error:&err];
|
||||
[fileManager createDirectoryAtPath:fullPath.stringByDeletingLastPathComponent withIntermediateDirectories:YES attributes:directoryAttr error:&err];
|
||||
}
|
||||
if (nil != err) {
|
||||
if ([err.domain isEqualToString:NSCocoaErrorDomain] &&
|
||||
@@ -380,7 +400,7 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
// ensure we are not creating stale file entries
|
||||
int readBytes = unzReadCurrentFile(zip, buffer, 4096);
|
||||
if (readBytes >= 0) {
|
||||
FILE *fp = fopen((const char*)[fullPath fileSystemRepresentation], "wb");
|
||||
FILE *fp = fopen(fullPath.fileSystemRepresentation, "wb");
|
||||
while (fp) {
|
||||
if (readBytes > 0) {
|
||||
if (0 == fwrite(buffer, readBytes, 1, fp)) {
|
||||
@@ -388,7 +408,7 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
NSString *message = [NSString stringWithFormat:@"Failed to write file (check your free space)"];
|
||||
NSLog(@"[SSZipArchive] %@", message);
|
||||
success = NO;
|
||||
*error = [NSError errorWithDomain:@"SSZipArchiveErrorDomain" code:SSZipArchiveErrorCodeFailedToWriteFile userInfo:@{NSLocalizedDescriptionKey: message}];
|
||||
unzippingError = [NSError errorWithDomain:@"SSZipArchiveErrorDomain" code:SSZipArchiveErrorCodeFailedToWriteFile userInfo:@{NSLocalizedDescriptionKey: message}];
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -399,9 +419,9 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
}
|
||||
|
||||
if (fp) {
|
||||
if ([[[fullPath pathExtension] lowercaseString] isEqualToString:@"zip"]) {
|
||||
NSLog(@"Unzipping nested .zip file: %@", [fullPath lastPathComponent]);
|
||||
if ([self unzipFileAtPath:fullPath toDestination:[fullPath stringByDeletingLastPathComponent] overwrite:overwrite password:password error:nil delegate:nil]) {
|
||||
if ([fullPath.pathExtension.lowercaseString isEqualToString:@"zip"]) {
|
||||
NSLog(@"Unzipping nested .zip file: %@", fullPath.lastPathComponent);
|
||||
if ([self unzipFileAtPath:fullPath toDestination:fullPath.stringByDeletingLastPathComponent overwrite:overwrite password:password error:nil delegate:nil]) {
|
||||
[[NSFileManager defaultManager] removeItemAtPath:fullPath error:nil];
|
||||
}
|
||||
}
|
||||
@@ -416,7 +436,7 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
NSDictionary *attr = @{NSFileModificationDate: orgDate};
|
||||
|
||||
if (attr) {
|
||||
if ([fileManager setAttributes:attr ofItemAtPath:fullPath error:nil] == NO) {
|
||||
if (![fileManager setAttributes:attr ofItemAtPath:fullPath error:nil]) {
|
||||
// Can't set attributes
|
||||
NSLog(@"[SSZipArchive] Failed to set attributes - whilst setting modification date");
|
||||
}
|
||||
@@ -436,7 +456,7 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
attrs[NSFilePosixPermissions] = permissionsValue;
|
||||
|
||||
// Update attributes
|
||||
if ([fileManager setAttributes:attrs ofItemAtPath:fullPath error:nil] == NO) {
|
||||
if (![fileManager setAttributes:attrs ofItemAtPath:fullPath error:nil]) {
|
||||
// Unable to set the permissions attribute
|
||||
NSLog(@"[SSZipArchive] Failed to set attributes - whilst setting permissions");
|
||||
}
|
||||
@@ -461,12 +481,12 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
else
|
||||
{
|
||||
// Assemble the path for the symbolic link
|
||||
NSMutableString* destinationPath = [NSMutableString string];
|
||||
NSMutableString *destinationPath = [NSMutableString string];
|
||||
int bytesRead = 0;
|
||||
while ((bytesRead = unzReadCurrentFile(zip, buffer, 4096)) > 0)
|
||||
{
|
||||
buffer[bytesRead] = (int)0;
|
||||
[destinationPath appendString:@((const char*)buffer)];
|
||||
[destinationPath appendString:@((const char *)buffer)];
|
||||
}
|
||||
|
||||
// Check if the symlink exists and delete it if we're overwriting
|
||||
@@ -475,8 +495,8 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
if ([fileManager fileExistsAtPath:fullPath])
|
||||
{
|
||||
NSError *error = nil;
|
||||
BOOL success = [fileManager removeItemAtPath:fullPath error:&error];
|
||||
if (!success)
|
||||
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);
|
||||
@@ -523,7 +543,7 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
progressHandler(strPath, fileInfo, currentFileNumber, globalInfo.number_entry);
|
||||
}
|
||||
}
|
||||
} while (ret == UNZ_OK && YES == success);
|
||||
} while (ret == UNZ_OK && success);
|
||||
|
||||
// Close
|
||||
unzClose(zip);
|
||||
@@ -581,37 +601,37 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
}
|
||||
|
||||
#pragma mark - Zipping
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray *)paths
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray<NSString *> *)paths
|
||||
{
|
||||
return [SSZipArchive createZipFileAtPath:path withFilesAtPaths:paths withPassword:nil];
|
||||
}
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath{
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath {
|
||||
return [SSZipArchive createZipFileAtPath:path withContentsOfDirectory:directoryPath withPassword:nil];
|
||||
}
|
||||
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirectory{
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirectory {
|
||||
return [SSZipArchive createZipFileAtPath:path withContentsOfDirectory:directoryPath keepParentDirectory:keepParentDirectory withPassword:nil];
|
||||
}
|
||||
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray *)paths withPassword:(NSString *)password
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray<NSString *> *)paths withPassword:(NSString *)password
|
||||
{
|
||||
BOOL success = NO;
|
||||
SSZipArchive *zipArchive = [[SSZipArchive alloc] initWithPath:path];
|
||||
if ([zipArchive open]) {
|
||||
BOOL success = [zipArchive open];
|
||||
if (success) {
|
||||
for (NSString *filePath in paths) {
|
||||
[zipArchive writeFile:filePath withPassword:password];
|
||||
success &= [zipArchive writeFile:filePath withPassword:password];
|
||||
}
|
||||
success = [zipArchive close];
|
||||
success &= [zipArchive close];
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath withPassword:(nullable NSString *)password{
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath withPassword:(nullable NSString *)password {
|
||||
return [SSZipArchive createZipFileAtPath:path withContentsOfDirectory:directoryPath keepParentDirectory:NO withPassword:password];
|
||||
}
|
||||
|
||||
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirectory withPassword:(nullable NSString *)password{
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirectory withPassword:(nullable NSString *)password {
|
||||
return [SSZipArchive createZipFileAtPath:path
|
||||
withContentsOfDirectory:directoryPath
|
||||
keepParentDirectory:keepParentDirectory
|
||||
@@ -620,17 +640,19 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
];
|
||||
}
|
||||
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirectory withPassword:(nullable NSString *)password andProgressHandler:(void(^ _Nullable)(NSUInteger entryNumber, NSUInteger total))progressHandler {
|
||||
BOOL success = NO;
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path
|
||||
withContentsOfDirectory:(NSString *)directoryPath
|
||||
keepParentDirectory:(BOOL)keepParentDirectory
|
||||
withPassword:(nullable NSString *)password
|
||||
andProgressHandler:(void(^ _Nullable)(NSUInteger entryNumber, NSUInteger total))progressHandler {
|
||||
|
||||
NSFileManager *fileManager = nil;
|
||||
SSZipArchive *zipArchive = [[SSZipArchive alloc] initWithPath:path];
|
||||
|
||||
if ([zipArchive open]) {
|
||||
// use a local filemanager (queue/thread compatibility)
|
||||
fileManager = [[NSFileManager alloc] init];
|
||||
BOOL success = [zipArchive open];
|
||||
if (success) {
|
||||
// use a local fileManager (queue/thread compatibility)
|
||||
NSFileManager *fileManager = [[NSFileManager alloc] init];
|
||||
NSDirectoryEnumerator *dirEnumerator = [fileManager enumeratorAtPath:directoryPath];
|
||||
NSArray *allObjects = dirEnumerator.allObjects;
|
||||
NSArray<NSString *> *allObjects = dirEnumerator.allObjects;
|
||||
NSUInteger total = allObjects.count, complete = 0;
|
||||
NSString *fileName;
|
||||
for (fileName in allObjects) {
|
||||
@@ -640,11 +662,11 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
|
||||
if (keepParentDirectory)
|
||||
{
|
||||
fileName = [[directoryPath lastPathComponent] stringByAppendingPathComponent:fileName];
|
||||
fileName = [directoryPath.lastPathComponent stringByAppendingPathComponent:fileName];
|
||||
}
|
||||
|
||||
if (!isDir) {
|
||||
[zipArchive writeFileAtPath:fullFilePath withFileName:fileName withPassword:password];
|
||||
success &= [zipArchive writeFileAtPath:fullFilePath withFileName:fileName withPassword:password];
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -652,7 +674,7 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
{
|
||||
NSString *tempFilePath = [self _temporaryPathForDiscardableFile];
|
||||
NSString *tempFileFilename = [fileName stringByAppendingPathComponent:tempFilePath.lastPathComponent];
|
||||
[zipArchive writeFileAtPath:tempFilePath withFileName:tempFileFilename withPassword:password];
|
||||
success &= [zipArchive writeFileAtPath:tempFilePath withFileName:tempFileFilename withPassword:password];
|
||||
}
|
||||
}
|
||||
complete++;
|
||||
@@ -660,12 +682,15 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
progressHandler(complete, total);
|
||||
}
|
||||
}
|
||||
success = [zipArchive close];
|
||||
success &= [zipArchive close];
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
// disabling `init` because designated initializer is `initWithPath:`
|
||||
- (instancetype)init { @throw nil; }
|
||||
|
||||
// designated initializer
|
||||
- (instancetype)initWithPath:(NSString *)path
|
||||
{
|
||||
if ((self = [super init])) {
|
||||
@@ -677,28 +702,26 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
|
||||
- (BOOL)open
|
||||
{
|
||||
NSAssert((_zip == NULL), @"Attempting open an archive which is already open");
|
||||
_zip = zipOpen([_path fileSystemRepresentation], APPEND_STATUS_CREATE);
|
||||
NSAssert((_zip == NULL), @"Attempting to open an archive which is already open");
|
||||
_zip = zipOpen(_path.fileSystemRepresentation, APPEND_STATUS_CREATE);
|
||||
return (NULL != _zip);
|
||||
}
|
||||
|
||||
|
||||
- (void)zipInfo:(zip_fileinfo*)zipInfo setDate:(NSDate*)date
|
||||
- (void)zipInfo:(zip_fileinfo *)zipInfo setDate:(NSDate *)date
|
||||
{
|
||||
NSCalendar *currentCalendar = [NSCalendar currentCalendar];
|
||||
#if defined(__IPHONE_8_0) || defined(__MAC_10_10)
|
||||
uint flags = NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay | NSCalendarUnitHour | NSCalendarUnitMinute | NSCalendarUnitSecond;
|
||||
#else
|
||||
uint flags = NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit;
|
||||
#endif
|
||||
NSCalendar *currentCalendar = SSZipArchive._gregorian;
|
||||
NSCalendarUnit flags = NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay | NSCalendarUnitHour | NSCalendarUnitMinute | NSCalendarUnitSecond;
|
||||
NSDateComponents *components = [currentCalendar components:flags fromDate:date];
|
||||
struct tm tmz_date;
|
||||
tmz_date.tm_sec = (unsigned int)components.second;
|
||||
tmz_date.tm_min = (unsigned int)components.minute;
|
||||
tmz_date.tm_hour = (unsigned int)components.hour;
|
||||
tmz_date.tm_mday = (unsigned int)components.day;
|
||||
// ISO/IEC 9899 struct tm is 0-indexed for January but NSDateComponents for gregorianCalendar is 1-indexed for January
|
||||
tmz_date.tm_mon = (unsigned int)components.month - 1;
|
||||
tmz_date.tm_year = (unsigned int)components.year;
|
||||
// ISO/IEC 9899 struct tm is 0-indexed for AD 1900 but NSDateComponents for gregorianCalendar is 1-indexed for AD 1
|
||||
tmz_date.tm_year = (unsigned int)components.year - 1900;
|
||||
zipInfo->dos_date = tm_to_dosdate(&tmz_date);
|
||||
}
|
||||
|
||||
@@ -720,7 +743,7 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
// Write permissions into the external attributes, for details on this see here: http://unix.stackexchange.com/a/14727
|
||||
// Get the permissions value from the files attributes
|
||||
NSNumber *permissionsValue = (NSNumber *)attr[NSFilePosixPermissions];
|
||||
if (permissionsValue) {
|
||||
if (permissionsValue != nil) {
|
||||
// Get the short value for the permissions
|
||||
short permissionsShort = permissionsValue.shortValue;
|
||||
|
||||
@@ -732,14 +755,14 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
|
||||
// Store this into the external file attributes once it has been shifted 16 places left to form part of the second from last byte
|
||||
|
||||
//Casted back to an unsigned int to match type of external_fa in minizip
|
||||
// Casted back to an unsigned int to match type of external_fa in minizip
|
||||
zipInfo.external_fa = (unsigned int)(permissionsLong << 16L);
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int len = 0;
|
||||
zipOpenNewFileInZip3(_zip, [[folderName stringByAppendingString:@"/"] fileSystemRepresentation], &zipInfo, NULL, 0, NULL, 0, NULL, Z_DEFLATED, Z_NO_COMPRESSION, 0, -MAX_WBITS, DEF_MEM_LEVEL,
|
||||
Z_DEFAULT_STRATEGY, [password UTF8String], 0);
|
||||
zipOpenNewFileInZip3(_zip, [folderName stringByAppendingString:@"/"].fileSystemRepresentation, &zipInfo, NULL, 0, NULL, 0, NULL, Z_DEFLATED, Z_NO_COMPRESSION, 0, -MAX_WBITS, DEF_MEM_LEVEL,
|
||||
Z_DEFAULT_STRATEGY, password.UTF8String, 0);
|
||||
zipWriteInFileInZip(_zip, &len, 0);
|
||||
zipCloseFileInZip(_zip);
|
||||
return YES;
|
||||
@@ -757,17 +780,17 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
{
|
||||
NSAssert((_zip != NULL), @"Attempting to write to an archive which was never opened");
|
||||
|
||||
FILE *input = fopen([path fileSystemRepresentation], "r");
|
||||
FILE *input = fopen(path.fileSystemRepresentation, "r");
|
||||
if (NULL == input) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
const char *afileName;
|
||||
const char *aFileName;
|
||||
if (!fileName) {
|
||||
afileName = [path.lastPathComponent fileSystemRepresentation];
|
||||
aFileName = path.lastPathComponent.fileSystemRepresentation;
|
||||
}
|
||||
else {
|
||||
afileName = [fileName fileSystemRepresentation];
|
||||
aFileName = fileName.fileSystemRepresentation;
|
||||
}
|
||||
|
||||
zip_fileinfo zipInfo = {0,0,0};
|
||||
@@ -784,7 +807,7 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
// Write permissions into the external attributes, for details on this see here: http://unix.stackexchange.com/a/14727
|
||||
// Get the permissions value from the files attributes
|
||||
NSNumber *permissionsValue = (NSNumber *)attr[NSFilePosixPermissions];
|
||||
if (permissionsValue) {
|
||||
if (permissionsValue != nil) {
|
||||
// Get the short value for the permissions
|
||||
short permissionsShort = permissionsValue.shortValue;
|
||||
|
||||
@@ -796,7 +819,7 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
|
||||
// Store this into the external file attributes once it has been shifted 16 places left to form part of the second from last byte
|
||||
|
||||
//Casted back to an unsigned int to match type of external_fa in minizip
|
||||
// Casted back to an unsigned int to match type of external_fa in minizip
|
||||
zipInfo.external_fa = (unsigned int)(permissionsLong << 16L);
|
||||
}
|
||||
}
|
||||
@@ -806,8 +829,8 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
zipOpenNewFileInZip3(_zip, afileName, &zipInfo, NULL, 0, NULL, 0, NULL, Z_DEFLATED, Z_DEFAULT_COMPRESSION, 0, -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, [password UTF8String], 0);
|
||||
|
||||
zipOpenNewFileInZip3(_zip, aFileName, &zipInfo, NULL, 0, NULL, 0, NULL, Z_DEFLATED, Z_DEFAULT_COMPRESSION, 0, -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, password.UTF8String, 0);
|
||||
unsigned int len = 0;
|
||||
|
||||
while (!feof(input) && !ferror(input))
|
||||
@@ -833,7 +856,7 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
zip_fileinfo zipInfo = {0,0,0};
|
||||
[self zipInfo:&zipInfo setDate:[NSDate date]];
|
||||
|
||||
zipOpenNewFileInZip3(_zip, [filename fileSystemRepresentation], &zipInfo, NULL, 0, NULL, 0, NULL, Z_DEFLATED, Z_DEFAULT_COMPRESSION, 0, -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, [password UTF8String], 0);
|
||||
zipOpenNewFileInZip3(_zip, filename.fileSystemRepresentation, &zipInfo, NULL, 0, NULL, 0, NULL, Z_DEFLATED, Z_DEFAULT_COMPRESSION, 0, -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, password.UTF8String, 0);
|
||||
|
||||
zipWriteInFileInZip(_zip, data.bytes, (unsigned int)data.length);
|
||||
|
||||
@@ -845,8 +868,9 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
- (BOOL)close
|
||||
{
|
||||
NSAssert((_zip != NULL), @"[SSZipArchive] Attempting to close an archive which was never opened");
|
||||
zipClose(_zip, NULL);
|
||||
return YES;
|
||||
int error = zipClose(_zip, NULL);
|
||||
_zip = nil;
|
||||
return error == UNZ_OK;
|
||||
}
|
||||
|
||||
#pragma mark - Private
|
||||
@@ -857,7 +881,7 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
static NSString *discardableFilePath = nil;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
NSString *temporaryDirectoryName = [[NSUUID UUID] UUIDString];
|
||||
NSString *temporaryDirectoryName = [NSUUID UUID].UUIDString;
|
||||
NSString *temporaryDirectory = [NSTemporaryDirectory() stringByAppendingPathComponent:temporaryDirectoryName];
|
||||
BOOL directoryCreated = [[NSFileManager defaultManager] createDirectoryAtPath:temporaryDirectory withIntermediateDirectories:YES attributes:nil error:nil];
|
||||
if (directoryCreated) {
|
||||
@@ -868,6 +892,17 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
return discardableFilePath;
|
||||
}
|
||||
|
||||
+ (NSCalendar *)_gregorian
|
||||
{
|
||||
static NSCalendar *gregorian;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian];
|
||||
});
|
||||
|
||||
return gregorian;
|
||||
}
|
||||
|
||||
// Format from http://newsgroups.derkeiler.com/Archive/Comp/comp.os.msdos.programmer/2009-04/msg00060.html
|
||||
// Two consecutive words, or a longword, YYYYYYYMMMMDDDDD hhhhhmmmmmmsssss
|
||||
// YYYYYYY is years from 1980 = 0
|
||||
@@ -877,6 +912,11 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
// 7423 = 0111 0100 0010 0011 - 01110 100001 00011 = 14 33 3 = 14:33:06
|
||||
+ (NSDate *)_dateWithMSDOSFormat:(UInt32)msdosDateTime
|
||||
{
|
||||
/*
|
||||
// the whole `_dateWithMSDOSFormat:` method is equivalent but faster than this one line,
|
||||
// essentially because `mktime` is slow:
|
||||
NSDate *date = [NSDate dateWithTimeIntervalSince1970:dosdate_to_time_t(msdosDateTime)];
|
||||
*/
|
||||
static const UInt32 kYearMask = 0xFE000000;
|
||||
static const UInt32 kMonthMask = 0x1E00000;
|
||||
static const UInt32 kDayMask = 0x1F0000;
|
||||
@@ -884,28 +924,18 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
|
||||
static const UInt32 kMinuteMask = 0x7E0;
|
||||
static const UInt32 kSecondMask = 0x1F;
|
||||
|
||||
static NSCalendar *gregorian;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
#if defined(__IPHONE_8_0) || defined(__MAC_10_10)
|
||||
gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian];
|
||||
#else
|
||||
gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
|
||||
#endif
|
||||
});
|
||||
NSAssert(0xFFFFFFFF == (kYearMask | kMonthMask | kDayMask | kHourMask | kMinuteMask | kSecondMask), @"[SSZipArchive] MSDOS date masks don't add up");
|
||||
|
||||
NSDateComponents *components = [[NSDateComponents alloc] init];
|
||||
|
||||
NSAssert(0xFFFFFFFF == (kYearMask | kMonthMask | kDayMask | kHourMask | kMinuteMask | kSecondMask), @"[SSZipArchive] MSDOS date masks don't add up");
|
||||
components.year = 1980 + ((msdosDateTime & kYearMask) >> 25);
|
||||
components.month = (msdosDateTime & kMonthMask) >> 21;
|
||||
components.day = (msdosDateTime & kDayMask) >> 16;
|
||||
components.hour = (msdosDateTime & kHourMask) >> 11;
|
||||
components.minute = (msdosDateTime & kMinuteMask) >> 5;
|
||||
components.second = (msdosDateTime & kSecondMask) * 2;
|
||||
|
||||
[components setYear:1980 + ((msdosDateTime & kYearMask) >> 25)];
|
||||
[components setMonth:(msdosDateTime & kMonthMask) >> 21];
|
||||
[components setDay:(msdosDateTime & kDayMask) >> 16];
|
||||
[components setHour:(msdosDateTime & kHourMask) >> 11];
|
||||
[components setMinute:(msdosDateTime & kMinuteMask) >> 5];
|
||||
[components setSecond:(msdosDateTime & kSecondMask) * 2];
|
||||
|
||||
NSDate *date = [NSDate dateWithTimeInterval:0 sinceDate:[gregorian dateFromComponents:components]];
|
||||
NSDate *date = [self._gregorian dateFromComponents:components];
|
||||
return date;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,6 @@ FOUNDATION_EXPORT double ZipArchiveVersionNumber;
|
||||
//! Project version string for ZipArchive.
|
||||
FOUNDATION_EXPORT const unsigned char ZipArchiveVersionString[];
|
||||
|
||||
// In this header, you should import all the public headers of your framework using statements like #import <ZipArchive/PublicHeader.h>
|
||||
// In this header, you should import all the public headers of your framework using statements like #import <ZipArchive/SSZipArchive.h>
|
||||
|
||||
#import "SSZipArchive.h"
|
||||
|
||||
@@ -30,7 +30,8 @@ Issue Date: 20/12/2007
|
||||
#elif defined( __FreeBSD__ ) || defined( __OpenBSD__ ) || defined( __NetBSD__ )
|
||||
# include <sys/endian.h>
|
||||
#elif defined( BSD ) && ( BSD >= 199103 ) || defined( __APPLE__ ) || \
|
||||
defined( __CYGWIN32__ ) || defined( __DJGPP__ ) || defined( __osf__ )
|
||||
defined( __CYGWIN32__ ) || defined( __DJGPP__ ) || defined( __osf__ ) || \
|
||||
defined(__pnacl__)
|
||||
# include <machine/endian.h>
|
||||
#elif defined( __linux__ ) || defined( __GNUC__ ) || defined( __GNU_LIBRARY__ )
|
||||
# if !defined( __MINGW32__ ) && !defined( _AIX )
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
*/
|
||||
|
||||
#include <memory.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "fileenc.h"
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ This is an implementation of HMAC, the FIPS standard keyed hash function
|
||||
#define _HMAC2_H
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <memory.h>
|
||||
#include <string.h>
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
its location in memory.
|
||||
*/
|
||||
|
||||
#include <memory.h>
|
||||
#include <string.h>
|
||||
#include "prng.h"
|
||||
|
||||
#if defined(__cplusplus)
|
||||
|
||||
@@ -21,7 +21,7 @@ This is an implementation of RFC2898, which specifies key derivation from
|
||||
a password and a salt value.
|
||||
*/
|
||||
|
||||
#include <memory.h>
|
||||
#include <string.h>
|
||||
#include "hmac.h"
|
||||
|
||||
#if defined(__cplusplus)
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
/* crypt.c -- base code for traditional PKWARE encryption
|
||||
Version 1.01e, February 12th, 2005
|
||||
Version 1.2.0, September 16th, 2017
|
||||
|
||||
Copyright (C) 2012-2017 Nathan Moinvaziri
|
||||
https://github.com/nmoinvaz/minizip
|
||||
Copyright (C) 1998-2005 Gilles Vollant
|
||||
Modifications for Info-ZIP crypting
|
||||
Copyright (C) 2003 Terry Thorsen
|
||||
Modifications for Info-ZIP crypting
|
||||
http://www.winimage.com/zLibDll/minizip.html
|
||||
Copyright (C) 2003 Terry Thorsen
|
||||
|
||||
This code is a modified version of crypting code in Info-ZIP distribution
|
||||
|
||||
@@ -129,7 +132,7 @@ int cryptrand(unsigned char *buf, unsigned int len)
|
||||
return rlen;
|
||||
}
|
||||
|
||||
int crypthead(const char *passwd, uint8_t *buf, int buf_size, uint32_t *pkeys,
|
||||
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 */
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
/* crypt.h -- base code for traditional PKWARE encryption
|
||||
Version 1.01e, February 12th, 2005
|
||||
Version 1.2.0, September 16th, 2017
|
||||
|
||||
Copyright (C) 2012-2017 Nathan Moinvaziri
|
||||
https://github.com/nmoinvaz/minizip
|
||||
Copyright (C) 1998-2005 Gilles Vollant
|
||||
Modifications for Info-ZIP crypting
|
||||
Copyright (C) 2003 Terry Thorsen
|
||||
Modifications for Info-ZIP crypting
|
||||
http://www.winimage.com/zLibDll/minizip.html
|
||||
Copyright (C) 2003 Terry Thorsen
|
||||
|
||||
This code is a modified version of crypting code in Info-ZIP distribution
|
||||
|
||||
@@ -16,6 +19,10 @@
|
||||
#ifndef _MINICRYPT_H
|
||||
#define _MINICRYPT_H
|
||||
|
||||
#if ZLIB_VERNUM < 0x1270
|
||||
typedef unsigned long z_crc_t;
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -45,7 +52,7 @@ void init_keys(const char *passwd, uint32_t *pkeys, const z_crc_t *pcrc_32_tab);
|
||||
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,
|
||||
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);
|
||||
|
||||
/***************************************************************************/
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
/* ioapi.c -- IO base function header for compress/uncompress .zip
|
||||
part of the MiniZip project
|
||||
|
||||
Copyright (C) 1998-2010 Gilles Vollant
|
||||
http://www.winimage.com/zLibDll/minizip.html
|
||||
Copyright (C) 2012-2017 Nathan Moinvaziri
|
||||
https://github.com/nmoinvaz/minizip
|
||||
Modifications for Zip64 support
|
||||
Copyright (C) 2009-2010 Mathias Svensson
|
||||
http://result42.com
|
||||
Copyright (C) 1998-2010 Gilles Vollant
|
||||
http://www.winimage.com/zLibDll/minizip.html
|
||||
|
||||
This program is distributed under the terms of the same license as zlib.
|
||||
See the accompanying LICENSE file for the full text of the license.
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
/* ioapi.h -- IO base function header for compress/uncompress .zip
|
||||
part of the MiniZip project
|
||||
|
||||
Copyright (C) 2012-2017 Nathan Moinvaziri
|
||||
https://github.com/nmoinvaz/minizip
|
||||
Copyright (C) 2009-2010 Mathias Svensson
|
||||
Modifications for Zip64 support
|
||||
http://result42.com
|
||||
Copyright (C) 1998-2010 Gilles Vollant
|
||||
http://www.winimage.com/zLibDll/minizip.html
|
||||
Modifications for Zip64 support
|
||||
Copyright (C) 2009-2010 Mathias Svensson
|
||||
http://result42.com
|
||||
|
||||
This program is distributed under the terms of the same license as zlib.
|
||||
See the accompanying LICENSE file for the full text of the license.
|
||||
@@ -25,7 +27,7 @@
|
||||
# define ftello64 ftell
|
||||
# define fseeko64 fseek
|
||||
#else
|
||||
# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__OpenBSD__) || defined(__APPLE__)
|
||||
# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__OpenBSD__) || defined(__APPLE__) || defined(__ANDROID__)
|
||||
# define fopen64 fopen
|
||||
# define ftello64 ftello
|
||||
# define fseeko64 fseeko
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
#ifndef IOBUF_BUFFERSIZE
|
||||
# define IOBUF_BUFFERSIZE (UINT16_MAX)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32)
|
||||
# include <conio.h>
|
||||
@@ -73,7 +73,7 @@ typedef struct ourstream_s {
|
||||
# define print_buf(o,s,f,...) print_buf_internal(o,s,f,__VA_ARGS__);
|
||||
#else
|
||||
# define print_buf(o,s,f,...)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
void print_buf_internal(voidpf opaque, voidpf stream, char *format, ...)
|
||||
{
|
||||
@@ -137,7 +137,7 @@ long fflush_buf(voidpf opaque, voidpf stream)
|
||||
uint32_t bytes_to_write = streamio->writebuf_len;
|
||||
uint32_t bytes_left_to_write = streamio->writebuf_len;
|
||||
long bytes_written = 0;
|
||||
|
||||
|
||||
while (bytes_left_to_write > 0)
|
||||
{
|
||||
if (bufio->filefunc64.zwrite_file != NULL)
|
||||
@@ -264,7 +264,7 @@ uint32_t ZCALLBACK fwrite_buf_func(voidpf opaque, voidpf stream, const void *buf
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
memcpy(streamio->writebuf + streamio->writebuf_pos, (char *)buf + (bytes_to_write - bytes_left_to_write), bytes_to_copy);
|
||||
|
||||
print_buf(opaque, stream, "write copy [remaining %d write %d:%d len %d]\n", bytes_to_copy, bytes_to_write, bytes_left_to_write, streamio->writebuf_len);
|
||||
@@ -344,7 +344,7 @@ int fseek_buf_internal_func(voidpf opaque, voidpf stream, uint64_t offset, int o
|
||||
{
|
||||
streamio->readbuf_pos += (uint32_t)offset;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
offset -= (streamio->readbuf_len - streamio->readbuf_pos);
|
||||
streamio->position += offset;
|
||||
}
|
||||
@@ -419,7 +419,7 @@ int ZCALLBACK fclose_buf_func(voidpf opaque, voidpf stream)
|
||||
print_buf(opaque, stream, "write efficency %.02f%%\n", (streamio->writebuf_hits / ((float)streamio->writebuf_hits + streamio->writebuf_misses)) * 100);
|
||||
if (bufio->filefunc64.zclose_file != NULL)
|
||||
ret = bufio->filefunc64.zclose_file(bufio->filefunc64.opaque, streamio->stream);
|
||||
else
|
||||
else
|
||||
ret = bufio->filefunc.zclose_file(bufio->filefunc.opaque, streamio->stream);
|
||||
free(streamio);
|
||||
return ret;
|
||||
|
||||
@@ -11,8 +11,11 @@
|
||||
|
||||
Based on Unzip ioapi.c version 0.22, May 19th, 2003
|
||||
|
||||
Copyright (C) 2012-2017 Nathan Moinvaziri
|
||||
https://github.com/nmoinvaz/minizip
|
||||
Copyright (C) 2003 Justin Fletcher
|
||||
Copyright (C) 1998-2003 Gilles Vollant
|
||||
(C) 2003 Justin Fletcher
|
||||
http://www.winimage.com/zLibDll/minizip.html
|
||||
|
||||
This file is under the same license as the Unzip tool it is distributed
|
||||
with.
|
||||
@@ -30,14 +33,14 @@
|
||||
|
||||
#ifndef IOMEM_BUFFERSIZE
|
||||
# define IOMEM_BUFFERSIZE (UINT16_MAX)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
voidpf ZCALLBACK fopen_mem_func(voidpf opaque, const char *filename, int mode)
|
||||
{
|
||||
ourmemory_t *mem = (ourmemory_t *)opaque;
|
||||
if (mem == NULL)
|
||||
return NULL; /* Mem structure passed in was null */
|
||||
|
||||
|
||||
if (mode & ZLIB_FILEFUNC_MODE_CREATE)
|
||||
{
|
||||
if (mem->grow)
|
||||
@@ -128,7 +131,7 @@ long ZCALLBACK fseek_mem_func(voidpf opaque, voidpf stream, uint32_t offset, int
|
||||
case ZLIB_FILEFUNC_SEEK_SET:
|
||||
new_pos = offset;
|
||||
break;
|
||||
default:
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
This version of ioapi is designed to access memory rather than files.
|
||||
We do use a region of memory to put data in to and take it out of.
|
||||
|
||||
Copyright (C) 1998-2003 Gilles Vollant
|
||||
Copyright (C) 2012-2017 Nathan Moinvaziri (https://github.com/nmoinvaz/minizip)
|
||||
(C) 2003 Justin Fletcher
|
||||
(C) 1998-2003 Gilles Vollant
|
||||
|
||||
This program is distributed under the terms of the same license as zlib.
|
||||
See the accompanying LICENSE file for the full text of the license.
|
||||
|
||||
@@ -43,10 +43,12 @@ uint32_t get_file_date(const char *path, uint32_t *dos_date)
|
||||
ret = 1;
|
||||
}
|
||||
#else
|
||||
struct stat s = { 0 };
|
||||
struct stat s;
|
||||
struct tm *filedate = NULL;
|
||||
time_t tm_t = 0;
|
||||
|
||||
memset(&s, 0, sizeof(s));
|
||||
|
||||
if (strcmp(path, "-") != 0)
|
||||
{
|
||||
size_t len = strlen(path);
|
||||
@@ -88,16 +90,13 @@ void change_file_date(const char *path, uint32_t dos_date)
|
||||
}
|
||||
#else
|
||||
struct utimbuf ut;
|
||||
struct tm newdate;
|
||||
|
||||
dosdate_to_tm(dos_date, &newdate);
|
||||
|
||||
ut.actime = ut.modtime = mktime(&newdate);
|
||||
ut.actime = ut.modtime = dosdate_to_time_t(dos_date);
|
||||
utime(path, &ut);
|
||||
#endif
|
||||
}
|
||||
|
||||
int dosdate_to_tm(uint64_t dos_date, struct tm *ptm)
|
||||
// convertion without validation
|
||||
void dosdate_to_raw_tm(uint64_t dos_date, struct tm *ptm)
|
||||
{
|
||||
uint64_t date = (uint64_t)(dos_date >> 16);
|
||||
|
||||
@@ -108,19 +107,28 @@ int dosdate_to_tm(uint64_t dos_date, struct tm *ptm)
|
||||
ptm->tm_min = (uint16_t)((dos_date & 0x7E0) / 0x20);
|
||||
ptm->tm_sec = (uint16_t)(2 * (dos_date & 0x1f));
|
||||
ptm->tm_isdst = -1;
|
||||
|
||||
}
|
||||
|
||||
int invalid_date(const struct tm *ptm)
|
||||
{
|
||||
#define datevalue_in_range(min, max, value) ((min) <= (value) && (value) <= (max))
|
||||
if (!datevalue_in_range(0, 11, ptm->tm_mon) ||
|
||||
!datevalue_in_range(1, 31, ptm->tm_mday) ||
|
||||
!datevalue_in_range(0, 23, ptm->tm_hour) ||
|
||||
!datevalue_in_range(0, 59, ptm->tm_min) ||
|
||||
!datevalue_in_range(0, 59, ptm->tm_sec))
|
||||
{
|
||||
/* Invalid date stored, so don't return it. */
|
||||
return (!datevalue_in_range(0, 11, ptm->tm_mon) ||
|
||||
!datevalue_in_range(1, 31, ptm->tm_mday) ||
|
||||
!datevalue_in_range(0, 23, ptm->tm_hour) ||
|
||||
!datevalue_in_range(0, 59, ptm->tm_min) ||
|
||||
!datevalue_in_range(0, 59, ptm->tm_sec));
|
||||
#undef datevalue_in_range
|
||||
}
|
||||
|
||||
int dosdate_to_tm(uint64_t dos_date, struct tm *ptm)
|
||||
{
|
||||
dosdate_to_raw_tm(dos_date, ptm);
|
||||
|
||||
if (invalid_date(ptm)) {
|
||||
// Invalid date stored, so don't return it.
|
||||
memset(ptm, 0, sizeof(struct tm));
|
||||
return -1;
|
||||
}
|
||||
#undef datevalue_in_range
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -137,11 +145,7 @@ uint32_t tm_to_dosdate(const struct tm *ptm)
|
||||
Due to the date format limitations, only years between 1980 and 2107 can be stored.
|
||||
*/
|
||||
if (!(datevalue_in_range(1980, 2107, ptm->tm_year) || datevalue_in_range(0, 207, ptm->tm_year)) ||
|
||||
!datevalue_in_range(0, 11, ptm->tm_mon) ||
|
||||
!datevalue_in_range(1, 31, ptm->tm_mday) ||
|
||||
!datevalue_in_range(0, 23, ptm->tm_hour) ||
|
||||
!datevalue_in_range(0, 59, ptm->tm_min) ||
|
||||
!datevalue_in_range(0, 59, ptm->tm_sec))
|
||||
invalid_date(ptm))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -159,6 +163,15 @@ uint32_t tm_to_dosdate(const struct tm *ptm)
|
||||
((ptm->tm_sec / 2) + (32 * ptm->tm_min) + (2048 * (uint32_t)ptm->tm_hour));
|
||||
}
|
||||
|
||||
time_t dosdate_to_time_t(uint64_t dos_date)
|
||||
{
|
||||
struct tm ptm;
|
||||
dosdate_to_raw_tm(dos_date, &ptm);
|
||||
// standard is year 1900 indexed struct tm, but dosdate_to_raw_tm returns a year 0 indexed struct tm
|
||||
ptm.tm_year %= 1900;
|
||||
return mktime(&ptm);
|
||||
}
|
||||
|
||||
int makedir(const char *newdir)
|
||||
{
|
||||
char *buffer = NULL;
|
||||
|
||||
@@ -27,6 +27,9 @@ int dosdate_to_tm(uint64_t dos_date, struct tm *ptm);
|
||||
/* Convert struct tm to dos date/time format */
|
||||
uint32_t tm_to_dosdate(const struct tm *ptm);
|
||||
|
||||
/* Convert dos date/time format to time_t */
|
||||
time_t dosdate_to_time_t(uint64_t dos_date);
|
||||
|
||||
/* Create a directory and all subdirectories */
|
||||
int makedir(const char *newdir);
|
||||
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
/* unzip.c -- IO for uncompress .zip files using zlib
|
||||
Version 1.1, February 14h, 2010
|
||||
Version 1.2.0, September 16th, 2017
|
||||
part of the MiniZip project
|
||||
|
||||
Copyright (C) 2010-2017 Nathan Moinvaziri
|
||||
Modifications for AES, PKWARE disk spanning
|
||||
https://github.com/nmoinvaz/minizip
|
||||
Copyright (C) 2009-2010 Mathias Svensson
|
||||
Modifications for Zip64 support on both zip and unzip
|
||||
http://result42.com
|
||||
Copyright (C) 2007-2008 Even Rouault
|
||||
Modifications of Unzip for Zip64
|
||||
Copyright (C) 1998-2010 Gilles Vollant
|
||||
http://www.winimage.com/zLibDll/minizip.html
|
||||
Modifications of Unzip for Zip64
|
||||
Copyright (C) 2007-2008 Even Rouault
|
||||
Modifications for Zip64 support on both zip and unzip
|
||||
Copyright (C) 2009-2010 Mathias Svensson
|
||||
http://result42.com
|
||||
Modifications for AES, PKWARE disk spanning
|
||||
Copyright (C) 2010-2014 Nathan Moinvaziri
|
||||
|
||||
This program is distributed under the terms of the same license as zlib.
|
||||
See the accompanying LICENSE file for the full text of the license.
|
||||
@@ -73,8 +74,7 @@
|
||||
# define TRYFREE(p) {if (p) free(p);}
|
||||
#endif
|
||||
|
||||
const char unz_copyright[] =
|
||||
" unzip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll";
|
||||
const char unz_copyright[] = " unzip 1.2.0 Copyright 1998-2017 - https://github.com/nmoinvaz/minizip";
|
||||
|
||||
/* unz_file_info_internal contain internal info about a file in zipfile*/
|
||||
typedef struct unz_file_info64_internal_s
|
||||
@@ -354,9 +354,6 @@ static unzFile unzOpenInternal(const void *path, zlib_filefunc64_32_def *pzlib_f
|
||||
voidpf filestream = NULL;
|
||||
int err = UNZ_OK;
|
||||
|
||||
if (unz_copyright[0] != ' ')
|
||||
return NULL;
|
||||
|
||||
us.filestream = NULL;
|
||||
us.filestream_with_CD = NULL;
|
||||
us.z_filefunc.zseek32_file = NULL;
|
||||
@@ -947,7 +944,7 @@ static int unzCheckCurrentFileCoherencyHeader(unz64_s *s, uint32_t *psize_variab
|
||||
uint32_t magic = 0;
|
||||
uint16_t value16 = 0;
|
||||
uint32_t value32 = 0;
|
||||
uint32_t flags = 0;;
|
||||
uint32_t flags = 0;
|
||||
uint16_t size_filename = 0;
|
||||
uint16_t size_extra_field = 0;
|
||||
uint16_t compression_method = 0;
|
||||
@@ -1325,7 +1322,7 @@ extern int ZEXPORT unzReadCurrentFile(unzFile file, voidp buf, uint32_t len)
|
||||
s->pfile_in_zip_read->stream.avail_out = (uint16_t)s->pfile_in_zip_read->rest_read_uncompressed;
|
||||
}
|
||||
|
||||
while (s->pfile_in_zip_read->stream.avail_out > 0)
|
||||
do
|
||||
{
|
||||
if (s->pfile_in_zip_read->stream.avail_in == 0)
|
||||
{
|
||||
@@ -1333,7 +1330,6 @@ extern int ZEXPORT unzReadCurrentFile(unzFile file, voidp buf, uint32_t len)
|
||||
uint32_t bytes_not_read = 0;
|
||||
uint32_t bytes_read = 0;
|
||||
uint32_t total_bytes_read = 0;
|
||||
uint32_t i = 0;
|
||||
|
||||
if (s->pfile_in_zip_read->stream.next_in != NULL)
|
||||
bytes_not_read = (uint32_t)(s->pfile_in_zip_read->read_buffer + UNZ_BUFSIZE -
|
||||
@@ -1384,6 +1380,8 @@ extern int ZEXPORT unzReadCurrentFile(unzFile file, voidp buf, uint32_t len)
|
||||
#endif
|
||||
if (s->pcrc_32_tab != NULL)
|
||||
{
|
||||
uint32_t i = 0;
|
||||
|
||||
for (i = 0; i < total_bytes_read; i++)
|
||||
s->pfile_in_zip_read->read_buffer[i] =
|
||||
zdecode(s->keys, s->pcrc_32_tab, s->pfile_in_zip_read->read_buffer[i]);
|
||||
@@ -1525,7 +1523,6 @@ extern int ZEXPORT unzReadCurrentFile(unzFile file, voidp buf, uint32_t len)
|
||||
#else
|
||||
else
|
||||
{
|
||||
|
||||
uint64_t total_out_before = 0;
|
||||
uint64_t total_out_after = 0;
|
||||
uint64_t out_bytes = 0;
|
||||
@@ -1563,6 +1560,7 @@ extern int ZEXPORT unzReadCurrentFile(unzFile file, voidp buf, uint32_t len)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
while (s->pfile_in_zip_read->stream.avail_out > 0);
|
||||
|
||||
if (err == Z_OK)
|
||||
return read;
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
/* unzip.h -- IO for uncompress .zip files using zlib
|
||||
Version 1.1, February 14h, 2010
|
||||
Version 1.2.0, September 16th, 2017
|
||||
part of the MiniZip project
|
||||
|
||||
Copyright (C) 2012-2017 Nathan Moinvaziri
|
||||
https://github.com/nmoinvaz/minizip
|
||||
Copyright (C) 2009-2010 Mathias Svensson
|
||||
Modifications for Zip64 support on both zip and unzip
|
||||
http://result42.com
|
||||
Copyright (C) 2007-2008 Even Rouault
|
||||
Modifications of Unzip for Zip64
|
||||
Copyright (C) 1998-2010 Gilles Vollant
|
||||
http://www.winimage.com/zLibDll/minizip.html
|
||||
Modifications of Unzip for Zip64
|
||||
Copyright (C) 2007-2008 Even Rouault
|
||||
Modifications for Zip64 support on both zip and unzip
|
||||
Copyright (C) 2009-2010 Mathias Svensson
|
||||
http://result42.com
|
||||
|
||||
This program is distributed under the terms of the same license as zlib.
|
||||
See the accompanying LICENSE file for the full text of the license.
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
/* zip.c -- IO on .zip files using zlib
|
||||
Version 1.1, February 14h, 2010
|
||||
Version 1.2.0, September 16th, 2017
|
||||
part of the MiniZip project
|
||||
|
||||
Copyright (C) 2010-2017 Nathan Moinvaziri
|
||||
Modifications for AES, PKWARE disk spanning
|
||||
https://github.com/nmoinvaz/minizip
|
||||
Copyright (C) 2009-2010 Mathias Svensson
|
||||
Modifications for Zip64 support
|
||||
http://result42.com
|
||||
Copyright (C) 1998-2010 Gilles Vollant
|
||||
http://www.winimage.com/zLibDll/minizip.html
|
||||
Modifications for Zip64 support
|
||||
Copyright (C) 2009-2010 Mathias Svensson
|
||||
http://result42.com
|
||||
Modifications for AES, PKWARE disk spanning
|
||||
Copyright (C) 2010-2014 Nathan Moinvaziri
|
||||
|
||||
This program is distributed under the terms of the same license as zlib.
|
||||
See the accompanying LICENSE file for the full text of the license.
|
||||
@@ -912,7 +913,7 @@ extern zipFile ZEXPORT zipOpen64(const void *path, int append)
|
||||
extern int ZEXPORT zipOpenNewFileInZip4_64(zipFile file, const char *filename, const zip_fileinfo *zipfi,
|
||||
const void *extrafield_local, uint16_t size_extrafield_local, const void *extrafield_global,
|
||||
uint16_t size_extrafield_global, const char *comment, uint16_t method, int level, int raw, int windowBits, int memLevel,
|
||||
int strategy, const char *password, uint32_t crc_for_crypting, uint16_t version_madeby, uint16_t flag_base, int zip64)
|
||||
int strategy, const char *password, ZIP_UNUSED uint32_t crc_for_crypting, uint16_t version_madeby, uint16_t flag_base, int zip64)
|
||||
{
|
||||
zip64_internal *zi = NULL;
|
||||
uint64_t size_available = 0;
|
||||
@@ -924,7 +925,6 @@ extern int ZEXPORT zipOpenNewFileInZip4_64(zipFile file, const char *filename, c
|
||||
int err = ZIP_OK;
|
||||
|
||||
#ifdef NOCRYPT
|
||||
(crc_for_crypting);
|
||||
if (password != NULL)
|
||||
return ZIP_PARAMERROR;
|
||||
#endif
|
||||
@@ -1237,10 +1237,7 @@ extern int ZEXPORT zipOpenNewFileInZip4_64(zipFile file, const char *filename, c
|
||||
/*
|
||||
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);
|
||||
|
||||
@@ -1261,7 +1258,7 @@ extern int ZEXPORT zipOpenNewFileInZip4_64(zipFile file, const char *filename, c
|
||||
extern int ZEXPORT zipOpenNewFileInZip4(zipFile file, const char *filename, const zip_fileinfo *zipfi,
|
||||
const void *extrafield_local, uint16_t size_extrafield_local, const void *extrafield_global,
|
||||
uint16_t size_extrafield_global, const char *comment, uint16_t method, int level, int raw, int windowBits,
|
||||
int memLevel, int strategy, const char *password, uint32_t crc_for_crypting, uint16_t version_madeby, uint16_t flag_base)
|
||||
int memLevel, int strategy, const char *password, ZIP_UNUSED uint32_t crc_for_crypting, uint16_t version_madeby, uint16_t flag_base)
|
||||
{
|
||||
return zipOpenNewFileInZip4_64(file, filename, zipfi, extrafield_local, size_extrafield_local,
|
||||
extrafield_global, size_extrafield_global, comment, method, level, raw, windowBits, memLevel,
|
||||
@@ -1271,7 +1268,7 @@ extern int ZEXPORT zipOpenNewFileInZip4(zipFile file, const char *filename, cons
|
||||
extern int ZEXPORT zipOpenNewFileInZip3(zipFile file, const char *filename, const zip_fileinfo *zipfi,
|
||||
const void *extrafield_local, uint16_t size_extrafield_local, const void *extrafield_global,
|
||||
uint16_t size_extrafield_global, const char *comment, uint16_t method, int level, int raw, int windowBits,
|
||||
int memLevel, int strategy, const char *password, uint32_t crc_for_crypting)
|
||||
int memLevel, int strategy, const char *password, ZIP_UNUSED uint32_t crc_for_crypting)
|
||||
{
|
||||
return zipOpenNewFileInZip4_64(file, filename, zipfi, extrafield_local, size_extrafield_local,
|
||||
extrafield_global, size_extrafield_global, comment, method, level, raw, windowBits, memLevel,
|
||||
@@ -1281,7 +1278,7 @@ extern int ZEXPORT zipOpenNewFileInZip3(zipFile file, const char *filename, cons
|
||||
extern int ZEXPORT zipOpenNewFileInZip3_64(zipFile file, const char *filename, const zip_fileinfo *zipfi,
|
||||
const void *extrafield_local, uint16_t size_extrafield_local, const void *extrafield_global,
|
||||
uint16_t size_extrafield_global, const char *comment, uint16_t method, int level, int raw, int windowBits,
|
||||
int memLevel, int strategy, const char *password, uint32_t crc_for_crypting, int zip64)
|
||||
int memLevel, int strategy, const char *password, ZIP_UNUSED uint32_t crc_for_crypting, int zip64)
|
||||
{
|
||||
return zipOpenNewFileInZip4_64(file, filename, zipfi, extrafield_local, size_extrafield_local,
|
||||
extrafield_global, size_extrafield_global, comment, method, level, raw, windowBits, memLevel, strategy,
|
||||
@@ -1332,8 +1329,6 @@ static int zipFlushWriteBuffer(zip64_internal *zi)
|
||||
uint32_t total_written = 0;
|
||||
uint32_t write = 0;
|
||||
uint32_t max_write = 0;
|
||||
uint32_t i = 0;
|
||||
uint8_t t = 0;
|
||||
int err = ZIP_OK;
|
||||
|
||||
if ((zi->ci.flag & 1) != 0)
|
||||
@@ -1347,6 +1342,9 @@ static int zipFlushWriteBuffer(zip64_internal *zi)
|
||||
else
|
||||
#endif
|
||||
{
|
||||
uint32_t i = 0;
|
||||
uint8_t t = 0;
|
||||
|
||||
for (i = 0; i < zi->ci.pos_in_buffered_data; i++)
|
||||
zi->ci.buffered_data[i] = (uint8_t)zencode(zi->ci.keys, zi->ci.pcrc_32_tab, zi->ci.buffered_data[i], t);
|
||||
}
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
/* zip.h -- IO on .zip files using zlib
|
||||
Version 1.1, February 14h, 2010
|
||||
Version 1.2.0, September 16th, 2017
|
||||
part of the MiniZip project
|
||||
|
||||
Copyright (C) 2012-2017 Nathan Moinvaziri
|
||||
https://github.com/nmoinvaz/minizip
|
||||
Copyright (C) 2009-2010 Mathias Svensson
|
||||
Modifications for Zip64 support
|
||||
http://result42.com
|
||||
Copyright (C) 1998-2010 Gilles Vollant
|
||||
http://www.winimage.com/zLibDll/minizip.html
|
||||
Modifications for Zip64 support
|
||||
Copyright (C) 2009-2010 Mathias Svensson
|
||||
http://result42.com
|
||||
|
||||
This program is distributed under the terms of the same license as zlib.
|
||||
See the accompanying LICENSE file for the full text of the license.
|
||||
@@ -51,6 +53,12 @@ typedef voidp zipFile;
|
||||
#define ZIP_BADZIPFILE (-103)
|
||||
#define ZIP_INTERNALERROR (-104)
|
||||
|
||||
#ifdef __GNUC__
|
||||
# define ZIP_UNUSED __attribute__((__unused__))
|
||||
#else
|
||||
# define ZIP_UNUSED
|
||||
#endif
|
||||
|
||||
#ifndef DEF_MEM_LEVEL
|
||||
# if MAX_MEM_LEVEL >= 8
|
||||
# define DEF_MEM_LEVEL 8
|
||||
@@ -140,28 +148,28 @@ extern int ZEXPORT zipOpenNewFileInZip2_64(zipFile file, const char *filename, c
|
||||
extern int ZEXPORT zipOpenNewFileInZip3(zipFile file, const char *filename, const zip_fileinfo *zipfi,
|
||||
const void *extrafield_local, uint16_t size_extrafield_local, const void *extrafield_global,
|
||||
uint16_t size_extrafield_global, const char *comment, uint16_t method, int level, int raw, int windowBits, int memLevel,
|
||||
int strategy, const char *password, uint32_t crcForCrypting);
|
||||
int strategy, const char *password, ZIP_UNUSED uint32_t crc_for_crypting);
|
||||
/* Same as zipOpenNewFileInZip2, except
|
||||
windowBits, memLevel, strategy : see parameter strategy in deflateInit2
|
||||
password : crypting password (NULL for no crypting)
|
||||
crcForCrypting : crc of file to compress (needed for crypting) */
|
||||
crc_for_crypting : crc of file to compress (needed for crypting) */
|
||||
|
||||
extern int ZEXPORT zipOpenNewFileInZip3_64(zipFile file, const char *filename, const zip_fileinfo *zipfi,
|
||||
const void *extrafield_local, uint16_t size_extrafield_local, const void *extrafield_global,
|
||||
uint16_t size_extrafield_global, const char *comment, uint16_t method, int level, int raw, int windowBits, int memLevel,
|
||||
int strategy, const char *password, uint32_t crc_for_crypting, int zip64);
|
||||
int strategy, const char *password, ZIP_UNUSED uint32_t crc_for_crypting, int zip64);
|
||||
/* Same as zipOpenNewFileInZip3 with zip64 support */
|
||||
|
||||
extern int ZEXPORT zipOpenNewFileInZip4(zipFile file, const char *filename, const zip_fileinfo *zipfi,
|
||||
const void *extrafield_local, uint16_t size_extrafield_local, const void *extrafield_global,
|
||||
uint16_t size_extrafield_global, const char *comment, uint16_t method, int level, int raw, int windowBits, int memLevel,
|
||||
int strategy, const char *password, uint32_t crc_for_crypting, uint16_t version_madeby, uint16_t flag_base);
|
||||
int strategy, const char *password, ZIP_UNUSED uint32_t crc_for_crypting, uint16_t version_madeby, uint16_t flag_base);
|
||||
/* Same as zipOpenNewFileInZip3 except versionMadeBy & flag fields */
|
||||
|
||||
extern int ZEXPORT zipOpenNewFileInZip4_64(zipFile file, const char *filename, const zip_fileinfo *zipfi,
|
||||
const void *extrafield_local, uint16_t size_extrafield_local, const void *extrafield_global,
|
||||
uint16_t size_extrafield_global, const char *comment, uint16_t method, int level, int raw, int windowBits, int memLevel,
|
||||
int strategy, const char *password, uint32_t crc_for_crypting, uint16_t version_madeby, uint16_t flag_base, int zip64);
|
||||
int strategy, const char *password, ZIP_UNUSED uint32_t crc_for_crypting, uint16_t version_madeby, uint16_t flag_base, int zip64);
|
||||
/* Same as zipOpenNewFileInZip4 with zip64 support */
|
||||
|
||||
extern int ZEXPORT zipWriteInFileInZip(zipFile file, const void *buf, uint32_t len);
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
PODS:
|
||||
- SSZipArchive (2.0.2)
|
||||
- SSZipArchive (2.0.7)
|
||||
|
||||
DEPENDENCIES:
|
||||
- SSZipArchive (from `..`)
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
SSZipArchive:
|
||||
:path: ".."
|
||||
:path: ..
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
SSZipArchive: 5fdf578dbbb60000b23439f80fa04e81d00740ee
|
||||
SSZipArchive: 8c197761d66bd33e7f8b5b51ee57dff303971150
|
||||
|
||||
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 */
|
||||
|
||||
@@ -52,6 +52,8 @@ class ViewController: UIViewController {
|
||||
if success {
|
||||
unzipButton.isEnabled = true
|
||||
zipButton.isEnabled = false
|
||||
} else {
|
||||
print("No success")
|
||||
}
|
||||
resetButton.isEnabled = true
|
||||
}
|
||||
@@ -66,7 +68,10 @@ class ViewController: UIViewController {
|
||||
}
|
||||
|
||||
let password = passwordField.text
|
||||
let success: Void? = try? SSZipArchive.unzipFile(atPath: zipPath, toDestination: unzipPath, overwrite: true, password: password?.isEmpty == false ? password : nil)
|
||||
let success: Void? = try? SSZipArchive.unzipFile(atPath: zipPath,
|
||||
toDestination: unzipPath,
|
||||
overwrite: true,
|
||||
password: password?.isEmpty == false ? password : nil)
|
||||
if success == nil {
|
||||
print("No success")
|
||||
return
|
||||
@@ -123,7 +128,6 @@ class ViewController: UIViewController {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
return url.path
|
||||
}
|
||||
|
||||
|
||||
@@ -62,6 +62,86 @@
|
||||
373914331F000A000094DB3B /* pwd2key.h in Headers */ = {isa = PBXBuildFile; fileRef = 373913F81F0009310094DB3B /* pwd2key.h */; };
|
||||
373914341F000A000094DB3B /* sha1.c in Sources */ = {isa = PBXBuildFile; fileRef = 373913F91F0009310094DB3B /* sha1.c */; };
|
||||
373914351F000A000094DB3B /* sha1.h in Headers */ = {isa = PBXBuildFile; fileRef = 373913FA1F0009310094DB3B /* sha1.h */; };
|
||||
37952C311F63B6EF00DD6677 /* SSZipCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 389869341D5BC30100F18782 /* SSZipCommon.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
37952C321F63B6FB00DD6677 /* SSZipArchive.h in Headers */ = {isa = PBXBuildFile; fileRef = B423AE481C0DF7950004A2F1 /* SSZipArchive.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
37952C331F63B70000DD6677 /* SSZipArchive.m in Sources */ = {isa = PBXBuildFile; fileRef = B423AE491C0DF7950004A2F1 /* SSZipArchive.m */; };
|
||||
37952C341F63B71400DD6677 /* ZipArchive.h in Headers */ = {isa = PBXBuildFile; fileRef = B423AE4A1C0DF7950004A2F1 /* ZipArchive.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
37952C351F63B75B00DD6677 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = B423AE6E1C0DF83F0004A2F1 /* libz.tbd */; };
|
||||
37952C361F63B76C00DD6677 /* zip.h in Headers */ = {isa = PBXBuildFile; fileRef = B423AE471C0DF7950004A2F1 /* zip.h */; };
|
||||
37952C371F63B76F00DD6677 /* zip.c in Sources */ = {isa = PBXBuildFile; fileRef = B423AE461C0DF7950004A2F1 /* zip.c */; };
|
||||
37952C381F63B77200DD6677 /* unzip.h in Headers */ = {isa = PBXBuildFile; fileRef = B423AE451C0DF7950004A2F1 /* unzip.h */; };
|
||||
37952C391F63B77500DD6677 /* unzip.c in Sources */ = {isa = PBXBuildFile; fileRef = B423AE441C0DF7950004A2F1 /* unzip.c */; };
|
||||
37952C3A1F63B77800DD6677 /* ioapi.h in Headers */ = {isa = PBXBuildFile; fileRef = B423AE411C0DF7950004A2F1 /* ioapi.h */; };
|
||||
37952C3B1F63B77C00DD6677 /* ioapi.c in Sources */ = {isa = PBXBuildFile; fileRef = B423AE401C0DF7950004A2F1 /* ioapi.c */; };
|
||||
37952C3C1F63B77F00DD6677 /* crypt.h in Headers */ = {isa = PBXBuildFile; fileRef = B423AE3F1C0DF7950004A2F1 /* crypt.h */; };
|
||||
37952C3D1F63B78100DD6677 /* minishared.h in Headers */ = {isa = PBXBuildFile; fileRef = 373913FE1F0009320094DB3B /* minishared.h */; };
|
||||
37952C3E1F63B78400DD6677 /* minishared.c in Sources */ = {isa = PBXBuildFile; fileRef = 373913FB1F0009320094DB3B /* minishared.c */; };
|
||||
37952C3F1F63B78700DD6677 /* ioapi_mem.h in Headers */ = {isa = PBXBuildFile; fileRef = 373913FF1F0009320094DB3B /* ioapi_mem.h */; };
|
||||
37952C401F63B78A00DD6677 /* ioapi_mem.c in Sources */ = {isa = PBXBuildFile; fileRef = 373913FD1F0009320094DB3B /* ioapi_mem.c */; };
|
||||
37952C411F63B78D00DD6677 /* ioapi_buf.h in Headers */ = {isa = PBXBuildFile; fileRef = 373913E51F0009310094DB3B /* ioapi_buf.h */; };
|
||||
37952C421F63B78F00DD6677 /* ioapi_buf.c in Sources */ = {isa = PBXBuildFile; fileRef = 373913E41F0009310094DB3B /* ioapi_buf.c */; };
|
||||
37952C431F63B79300DD6677 /* crypt.c in Sources */ = {isa = PBXBuildFile; fileRef = 373913FC1F0009320094DB3B /* crypt.c */; };
|
||||
37952C441F63B79900DD6677 /* aes.h in Headers */ = {isa = PBXBuildFile; fileRef = 373913E71F0009310094DB3B /* aes.h */; };
|
||||
37952C451F63B7A000DD6677 /* aes_ni.c in Sources */ = {isa = PBXBuildFile; fileRef = 373913E81F0009310094DB3B /* aes_ni.c */; };
|
||||
37952C461F63B7A000DD6677 /* aes_ni.h in Headers */ = {isa = PBXBuildFile; fileRef = 373913E91F0009310094DB3B /* aes_ni.h */; };
|
||||
37952C471F63B7A000DD6677 /* aescrypt.c in Sources */ = {isa = PBXBuildFile; fileRef = 373913EA1F0009310094DB3B /* aescrypt.c */; };
|
||||
37952C481F63B7A000DD6677 /* aeskey.c in Sources */ = {isa = PBXBuildFile; fileRef = 373913EB1F0009310094DB3B /* aeskey.c */; };
|
||||
37952C491F63B7A000DD6677 /* aesopt.h in Headers */ = {isa = PBXBuildFile; fileRef = 373913EC1F0009310094DB3B /* aesopt.h */; };
|
||||
37952C4A1F63B7A000DD6677 /* aestab.c in Sources */ = {isa = PBXBuildFile; fileRef = 373913ED1F0009310094DB3B /* aestab.c */; };
|
||||
37952C4B1F63B7A000DD6677 /* aestab.h in Headers */ = {isa = PBXBuildFile; fileRef = 373913EE1F0009310094DB3B /* aestab.h */; };
|
||||
37952C4C1F63B7A000DD6677 /* brg_endian.h in Headers */ = {isa = PBXBuildFile; fileRef = 373913EF1F0009310094DB3B /* brg_endian.h */; };
|
||||
37952C4D1F63B7A000DD6677 /* brg_types.h in Headers */ = {isa = PBXBuildFile; fileRef = 373913F01F0009310094DB3B /* brg_types.h */; };
|
||||
37952C4E1F63B7A000DD6677 /* fileenc.c in Sources */ = {isa = PBXBuildFile; fileRef = 373913F11F0009310094DB3B /* fileenc.c */; };
|
||||
37952C4F1F63B7A000DD6677 /* fileenc.h in Headers */ = {isa = PBXBuildFile; fileRef = 373913F21F0009310094DB3B /* fileenc.h */; };
|
||||
37952C501F63B7A000DD6677 /* hmac.c in Sources */ = {isa = PBXBuildFile; fileRef = 373913F31F0009310094DB3B /* hmac.c */; };
|
||||
37952C511F63B7A000DD6677 /* hmac.h in Headers */ = {isa = PBXBuildFile; fileRef = 373913F41F0009310094DB3B /* hmac.h */; };
|
||||
37952C521F63B7A000DD6677 /* prng.c in Sources */ = {isa = PBXBuildFile; fileRef = 373913F51F0009310094DB3B /* prng.c */; };
|
||||
37952C531F63B7A000DD6677 /* prng.h in Headers */ = {isa = PBXBuildFile; fileRef = 373913F61F0009310094DB3B /* prng.h */; };
|
||||
37952C541F63B7A000DD6677 /* pwd2key.c in Sources */ = {isa = PBXBuildFile; fileRef = 373913F71F0009310094DB3B /* pwd2key.c */; };
|
||||
37952C551F63B7A000DD6677 /* pwd2key.h in Headers */ = {isa = PBXBuildFile; fileRef = 373913F81F0009310094DB3B /* pwd2key.h */; };
|
||||
37952C561F63B7A000DD6677 /* sha1.c in Sources */ = {isa = PBXBuildFile; fileRef = 373913F91F0009310094DB3B /* sha1.c */; };
|
||||
37952C571F63B7A000DD6677 /* sha1.h in Headers */ = {isa = PBXBuildFile; fileRef = 373913FA1F0009310094DB3B /* sha1.h */; };
|
||||
37952C581F63B8C400DD6677 /* SSZipArchive+Swift.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87ACF3E91D2DAFAD00ED2F7E /* SSZipArchive+Swift.swift */; };
|
||||
37952C661F63BBBB00DD6677 /* crypt.c in Sources */ = {isa = PBXBuildFile; fileRef = 373913FC1F0009320094DB3B /* crypt.c */; };
|
||||
37952C671F63BBBB00DD6677 /* ioapi_buf.c in Sources */ = {isa = PBXBuildFile; fileRef = 373913E41F0009310094DB3B /* ioapi_buf.c */; };
|
||||
37952C681F63BBBB00DD6677 /* ioapi_buf.h in Headers */ = {isa = PBXBuildFile; fileRef = 373913E51F0009310094DB3B /* ioapi_buf.h */; };
|
||||
37952C691F63BBBB00DD6677 /* ioapi_mem.c in Sources */ = {isa = PBXBuildFile; fileRef = 373913FD1F0009320094DB3B /* ioapi_mem.c */; };
|
||||
37952C6A1F63BBBB00DD6677 /* ioapi_mem.h in Headers */ = {isa = PBXBuildFile; fileRef = 373913FF1F0009320094DB3B /* ioapi_mem.h */; };
|
||||
37952C6B1F63BBBB00DD6677 /* minishared.c in Sources */ = {isa = PBXBuildFile; fileRef = 373913FB1F0009320094DB3B /* minishared.c */; };
|
||||
37952C6C1F63BBBB00DD6677 /* minishared.h in Headers */ = {isa = PBXBuildFile; fileRef = 373913FE1F0009320094DB3B /* minishared.h */; };
|
||||
37952C6D1F63BBBB00DD6677 /* crypt.h in Headers */ = {isa = PBXBuildFile; fileRef = B423AE3F1C0DF7950004A2F1 /* crypt.h */; };
|
||||
37952C6E1F63BBBB00DD6677 /* ioapi.c in Sources */ = {isa = PBXBuildFile; fileRef = B423AE401C0DF7950004A2F1 /* ioapi.c */; };
|
||||
37952C6F1F63BBBB00DD6677 /* ioapi.h in Headers */ = {isa = PBXBuildFile; fileRef = B423AE411C0DF7950004A2F1 /* ioapi.h */; };
|
||||
37952C701F63BBBB00DD6677 /* unzip.c in Sources */ = {isa = PBXBuildFile; fileRef = B423AE441C0DF7950004A2F1 /* unzip.c */; };
|
||||
37952C711F63BBBB00DD6677 /* unzip.h in Headers */ = {isa = PBXBuildFile; fileRef = B423AE451C0DF7950004A2F1 /* unzip.h */; };
|
||||
37952C721F63BBBB00DD6677 /* zip.c in Sources */ = {isa = PBXBuildFile; fileRef = B423AE461C0DF7950004A2F1 /* zip.c */; };
|
||||
37952C731F63BBBB00DD6677 /* zip.h in Headers */ = {isa = PBXBuildFile; fileRef = B423AE471C0DF7950004A2F1 /* zip.h */; };
|
||||
37952C741F63BBC000DD6677 /* aes.h in Headers */ = {isa = PBXBuildFile; fileRef = 373913E71F0009310094DB3B /* aes.h */; };
|
||||
37952C751F63BBC000DD6677 /* aes_ni.c in Sources */ = {isa = PBXBuildFile; fileRef = 373913E81F0009310094DB3B /* aes_ni.c */; };
|
||||
37952C761F63BBC000DD6677 /* aes_ni.h in Headers */ = {isa = PBXBuildFile; fileRef = 373913E91F0009310094DB3B /* aes_ni.h */; };
|
||||
37952C771F63BBC000DD6677 /* aescrypt.c in Sources */ = {isa = PBXBuildFile; fileRef = 373913EA1F0009310094DB3B /* aescrypt.c */; };
|
||||
37952C781F63BBC000DD6677 /* aeskey.c in Sources */ = {isa = PBXBuildFile; fileRef = 373913EB1F0009310094DB3B /* aeskey.c */; };
|
||||
37952C791F63BBC000DD6677 /* aesopt.h in Headers */ = {isa = PBXBuildFile; fileRef = 373913EC1F0009310094DB3B /* aesopt.h */; };
|
||||
37952C7A1F63BBC000DD6677 /* aestab.c in Sources */ = {isa = PBXBuildFile; fileRef = 373913ED1F0009310094DB3B /* aestab.c */; };
|
||||
37952C7B1F63BBC000DD6677 /* aestab.h in Headers */ = {isa = PBXBuildFile; fileRef = 373913EE1F0009310094DB3B /* aestab.h */; };
|
||||
37952C7C1F63BBC000DD6677 /* brg_endian.h in Headers */ = {isa = PBXBuildFile; fileRef = 373913EF1F0009310094DB3B /* brg_endian.h */; };
|
||||
37952C7D1F63BBC000DD6677 /* brg_types.h in Headers */ = {isa = PBXBuildFile; fileRef = 373913F01F0009310094DB3B /* brg_types.h */; };
|
||||
37952C7E1F63BBC000DD6677 /* fileenc.c in Sources */ = {isa = PBXBuildFile; fileRef = 373913F11F0009310094DB3B /* fileenc.c */; };
|
||||
37952C7F1F63BBC000DD6677 /* fileenc.h in Headers */ = {isa = PBXBuildFile; fileRef = 373913F21F0009310094DB3B /* fileenc.h */; };
|
||||
37952C801F63BBC000DD6677 /* hmac.c in Sources */ = {isa = PBXBuildFile; fileRef = 373913F31F0009310094DB3B /* hmac.c */; };
|
||||
37952C811F63BBC000DD6677 /* hmac.h in Headers */ = {isa = PBXBuildFile; fileRef = 373913F41F0009310094DB3B /* hmac.h */; };
|
||||
37952C821F63BBC000DD6677 /* prng.c in Sources */ = {isa = PBXBuildFile; fileRef = 373913F51F0009310094DB3B /* prng.c */; };
|
||||
37952C831F63BBC000DD6677 /* prng.h in Headers */ = {isa = PBXBuildFile; fileRef = 373913F61F0009310094DB3B /* prng.h */; };
|
||||
37952C841F63BBC000DD6677 /* pwd2key.c in Sources */ = {isa = PBXBuildFile; fileRef = 373913F71F0009310094DB3B /* pwd2key.c */; };
|
||||
37952C851F63BBC000DD6677 /* pwd2key.h in Headers */ = {isa = PBXBuildFile; fileRef = 373913F81F0009310094DB3B /* pwd2key.h */; };
|
||||
37952C861F63BBC000DD6677 /* sha1.c in Sources */ = {isa = PBXBuildFile; fileRef = 373913F91F0009310094DB3B /* sha1.c */; };
|
||||
37952C871F63BBC000DD6677 /* sha1.h in Headers */ = {isa = PBXBuildFile; fileRef = 373913FA1F0009310094DB3B /* sha1.h */; };
|
||||
37952C881F63BBD500DD6677 /* SSZipArchive.h in Headers */ = {isa = PBXBuildFile; fileRef = B423AE481C0DF7950004A2F1 /* SSZipArchive.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
37952C891F63BBDA00DD6677 /* SSZipArchive.m in Sources */ = {isa = PBXBuildFile; fileRef = B423AE491C0DF7950004A2F1 /* SSZipArchive.m */; };
|
||||
37952C8A1F63BBE100DD6677 /* SSZipArchive+Swift.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87ACF3E91D2DAFAD00ED2F7E /* SSZipArchive+Swift.swift */; };
|
||||
37952C8B1F63BBE400DD6677 /* ZipArchive.h in Headers */ = {isa = PBXBuildFile; fileRef = B423AE4A1C0DF7950004A2F1 /* ZipArchive.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
37952C8C1F63BBED00DD6677 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = B423AE6E1C0DF83F0004A2F1 /* libz.tbd */; };
|
||||
37952C8D1F63BBF300DD6677 /* SSZipCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 389869341D5BC30100F18782 /* SSZipCommon.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
389869351D5BC30100F18782 /* SSZipCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 389869341D5BC30100F18782 /* SSZipCommon.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
87ACF3EA1D2DAFAD00ED2F7E /* SSZipArchive+Swift.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87ACF3E91D2DAFAD00ED2F7E /* SSZipArchive+Swift.swift */; };
|
||||
AFF75A2D1C3727F000F450AC /* ZipArchive.h in Headers */ = {isa = PBXBuildFile; fileRef = B423AE4A1C0DF7950004A2F1 /* ZipArchive.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
@@ -116,6 +196,8 @@
|
||||
373913FD1F0009320094DB3B /* ioapi_mem.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = ioapi_mem.c; sourceTree = "<group>"; };
|
||||
373913FE1F0009320094DB3B /* minishared.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = minishared.h; sourceTree = "<group>"; };
|
||||
373913FF1F0009320094DB3B /* ioapi_mem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ioapi_mem.h; sourceTree = "<group>"; };
|
||||
37952C261F63B50D00DD6677 /* ZipArchive.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ZipArchive.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
37952C5E1F63BB7100DD6677 /* ZipArchive.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ZipArchive.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
389869341D5BC30100F18782 /* SSZipCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSZipCommon.h; sourceTree = "<group>"; };
|
||||
87ACF3E91D2DAFAD00ED2F7E /* SSZipArchive+Swift.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "SSZipArchive+Swift.swift"; sourceTree = "<group>"; };
|
||||
AFF75A241C37279600F450AC /* ZipArchive.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ZipArchive.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
@@ -135,6 +217,22 @@
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
37952C221F63B50D00DD6677 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
37952C351F63B75B00DD6677 /* libz.tbd in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
37952C5A1F63BB7100DD6677 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
37952C8C1F63BBED00DD6677 /* libz.tbd in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
AFF75A201C37279600F450AC /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -195,6 +293,8 @@
|
||||
children = (
|
||||
B423AE1A1C0DF76A0004A2F1 /* ZipArchive.framework */,
|
||||
AFF75A241C37279600F450AC /* ZipArchive.framework */,
|
||||
37952C261F63B50D00DD6677 /* ZipArchive.framework */,
|
||||
37952C5E1F63BB7100DD6677 /* ZipArchive.framework */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@@ -218,15 +318,15 @@
|
||||
children = (
|
||||
373913E61F0009310094DB3B /* aes */,
|
||||
373913FC1F0009320094DB3B /* crypt.c */,
|
||||
B423AE3F1C0DF7950004A2F1 /* crypt.h */,
|
||||
373913E41F0009310094DB3B /* ioapi_buf.c */,
|
||||
373913E51F0009310094DB3B /* ioapi_buf.h */,
|
||||
373913FD1F0009320094DB3B /* ioapi_mem.c */,
|
||||
373913FF1F0009320094DB3B /* ioapi_mem.h */,
|
||||
373913FB1F0009320094DB3B /* minishared.c */,
|
||||
373913FE1F0009320094DB3B /* minishared.h */,
|
||||
B423AE3F1C0DF7950004A2F1 /* crypt.h */,
|
||||
B423AE401C0DF7950004A2F1 /* ioapi.c */,
|
||||
B423AE411C0DF7950004A2F1 /* ioapi.h */,
|
||||
373913FB1F0009320094DB3B /* minishared.c */,
|
||||
373913FE1F0009320094DB3B /* minishared.h */,
|
||||
B423AE441C0DF7950004A2F1 /* unzip.c */,
|
||||
B423AE451C0DF7950004A2F1 /* unzip.h */,
|
||||
B423AE461C0DF7950004A2F1 /* zip.c */,
|
||||
@@ -238,6 +338,62 @@
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXHeadersBuildPhase section */
|
||||
37952C231F63B50D00DD6677 /* Headers */ = {
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
37952C4D1F63B7A000DD6677 /* brg_types.h in Headers */,
|
||||
37952C551F63B7A000DD6677 /* pwd2key.h in Headers */,
|
||||
37952C441F63B79900DD6677 /* aes.h in Headers */,
|
||||
37952C321F63B6FB00DD6677 /* SSZipArchive.h in Headers */,
|
||||
37952C4C1F63B7A000DD6677 /* brg_endian.h in Headers */,
|
||||
37952C491F63B7A000DD6677 /* aesopt.h in Headers */,
|
||||
37952C381F63B77200DD6677 /* unzip.h in Headers */,
|
||||
37952C571F63B7A000DD6677 /* sha1.h in Headers */,
|
||||
37952C311F63B6EF00DD6677 /* SSZipCommon.h in Headers */,
|
||||
37952C511F63B7A000DD6677 /* hmac.h in Headers */,
|
||||
37952C3F1F63B78700DD6677 /* ioapi_mem.h in Headers */,
|
||||
37952C4B1F63B7A000DD6677 /* aestab.h in Headers */,
|
||||
37952C461F63B7A000DD6677 /* aes_ni.h in Headers */,
|
||||
37952C531F63B7A000DD6677 /* prng.h in Headers */,
|
||||
37952C3A1F63B77800DD6677 /* ioapi.h in Headers */,
|
||||
37952C411F63B78D00DD6677 /* ioapi_buf.h in Headers */,
|
||||
37952C361F63B76C00DD6677 /* zip.h in Headers */,
|
||||
37952C3C1F63B77F00DD6677 /* crypt.h in Headers */,
|
||||
37952C3D1F63B78100DD6677 /* minishared.h in Headers */,
|
||||
37952C4F1F63B7A000DD6677 /* fileenc.h in Headers */,
|
||||
37952C341F63B71400DD6677 /* ZipArchive.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
37952C5B1F63BB7100DD6677 /* Headers */ = {
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
37952C791F63BBC000DD6677 /* aesopt.h in Headers */,
|
||||
37952C851F63BBC000DD6677 /* pwd2key.h in Headers */,
|
||||
37952C7F1F63BBC000DD6677 /* fileenc.h in Headers */,
|
||||
37952C681F63BBBB00DD6677 /* ioapi_buf.h in Headers */,
|
||||
37952C831F63BBC000DD6677 /* prng.h in Headers */,
|
||||
37952C731F63BBBB00DD6677 /* zip.h in Headers */,
|
||||
37952C7D1F63BBC000DD6677 /* brg_types.h in Headers */,
|
||||
37952C881F63BBD500DD6677 /* SSZipArchive.h in Headers */,
|
||||
37952C8D1F63BBF300DD6677 /* SSZipCommon.h in Headers */,
|
||||
37952C761F63BBC000DD6677 /* aes_ni.h in Headers */,
|
||||
37952C6A1F63BBBB00DD6677 /* ioapi_mem.h in Headers */,
|
||||
37952C6C1F63BBBB00DD6677 /* minishared.h in Headers */,
|
||||
37952C8B1F63BBE400DD6677 /* ZipArchive.h in Headers */,
|
||||
37952C741F63BBC000DD6677 /* aes.h in Headers */,
|
||||
37952C711F63BBBB00DD6677 /* unzip.h in Headers */,
|
||||
37952C811F63BBC000DD6677 /* hmac.h in Headers */,
|
||||
37952C871F63BBC000DD6677 /* sha1.h in Headers */,
|
||||
37952C6D1F63BBBB00DD6677 /* crypt.h in Headers */,
|
||||
37952C7B1F63BBC000DD6677 /* aestab.h in Headers */,
|
||||
37952C6F1F63BBBB00DD6677 /* ioapi.h in Headers */,
|
||||
37952C7C1F63BBC000DD6677 /* brg_endian.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
AFF75A211C37279600F450AC /* Headers */ = {
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -297,6 +453,42 @@
|
||||
/* End PBXHeadersBuildPhase section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
37952C251F63B50D00DD6677 /* ZipArchive-tvos */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 37952C2D1F63B50D00DD6677 /* Build configuration list for PBXNativeTarget "ZipArchive-tvos" */;
|
||||
buildPhases = (
|
||||
37952C211F63B50D00DD6677 /* Sources */,
|
||||
37952C221F63B50D00DD6677 /* Frameworks */,
|
||||
37952C231F63B50D00DD6677 /* Headers */,
|
||||
37952C241F63B50D00DD6677 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "ZipArchive-tvos";
|
||||
productName = ZipArchive;
|
||||
productReference = 37952C261F63B50D00DD6677 /* ZipArchive.framework */;
|
||||
productType = "com.apple.product-type.framework";
|
||||
};
|
||||
37952C5D1F63BB7100DD6677 /* ZipArchive-watchos */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 37952C651F63BB7100DD6677 /* Build configuration list for PBXNativeTarget "ZipArchive-watchos" */;
|
||||
buildPhases = (
|
||||
37952C591F63BB7100DD6677 /* Sources */,
|
||||
37952C5A1F63BB7100DD6677 /* Frameworks */,
|
||||
37952C5B1F63BB7100DD6677 /* Headers */,
|
||||
37952C5C1F63BB7100DD6677 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "ZipArchive-watchos";
|
||||
productName = ZipArchive;
|
||||
productReference = 37952C5E1F63BB7100DD6677 /* ZipArchive.framework */;
|
||||
productType = "com.apple.product-type.framework";
|
||||
};
|
||||
AFF75A231C37279600F450AC /* ZipArchive-Mac */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = AFF75A291C37279600F450AC /* Build configuration list for PBXNativeTarget "ZipArchive-Mac" */;
|
||||
@@ -343,6 +535,12 @@
|
||||
LastUpgradeCheck = 0820;
|
||||
ORGANIZATIONNAME = smumryak;
|
||||
TargetAttributes = {
|
||||
37952C251F63B50D00DD6677 = {
|
||||
CreatedOnToolsVersion = 8.3.3;
|
||||
};
|
||||
37952C5D1F63BB7100DD6677 = {
|
||||
CreatedOnToolsVersion = 8.3.3;
|
||||
};
|
||||
AFF75A231C37279600F450AC = {
|
||||
CreatedOnToolsVersion = 7.2;
|
||||
};
|
||||
@@ -366,11 +564,27 @@
|
||||
targets = (
|
||||
B423AE191C0DF76A0004A2F1 /* ZipArchive-iOS */,
|
||||
AFF75A231C37279600F450AC /* ZipArchive-Mac */,
|
||||
37952C251F63B50D00DD6677 /* ZipArchive-tvos */,
|
||||
37952C5D1F63BB7100DD6677 /* ZipArchive-watchos */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
37952C241F63B50D00DD6677 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
37952C5C1F63BB7100DD6677 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
AFF75A221C37279600F450AC /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -388,6 +602,56 @@
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
37952C211F63B50D00DD6677 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
37952C541F63B7A000DD6677 /* pwd2key.c in Sources */,
|
||||
37952C521F63B7A000DD6677 /* prng.c in Sources */,
|
||||
37952C581F63B8C400DD6677 /* SSZipArchive+Swift.swift in Sources */,
|
||||
37952C401F63B78A00DD6677 /* ioapi_mem.c in Sources */,
|
||||
37952C561F63B7A000DD6677 /* sha1.c in Sources */,
|
||||
37952C4A1F63B7A000DD6677 /* aestab.c in Sources */,
|
||||
37952C391F63B77500DD6677 /* unzip.c in Sources */,
|
||||
37952C481F63B7A000DD6677 /* aeskey.c in Sources */,
|
||||
37952C431F63B79300DD6677 /* crypt.c in Sources */,
|
||||
37952C421F63B78F00DD6677 /* ioapi_buf.c in Sources */,
|
||||
37952C4E1F63B7A000DD6677 /* fileenc.c in Sources */,
|
||||
37952C451F63B7A000DD6677 /* aes_ni.c in Sources */,
|
||||
37952C501F63B7A000DD6677 /* hmac.c in Sources */,
|
||||
37952C331F63B70000DD6677 /* SSZipArchive.m in Sources */,
|
||||
37952C3B1F63B77C00DD6677 /* ioapi.c in Sources */,
|
||||
37952C371F63B76F00DD6677 /* zip.c in Sources */,
|
||||
37952C471F63B7A000DD6677 /* aescrypt.c in Sources */,
|
||||
37952C3E1F63B78400DD6677 /* minishared.c in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
37952C591F63BB7100DD6677 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
37952C801F63BBC000DD6677 /* hmac.c in Sources */,
|
||||
37952C841F63BBC000DD6677 /* pwd2key.c in Sources */,
|
||||
37952C8A1F63BBE100DD6677 /* SSZipArchive+Swift.swift in Sources */,
|
||||
37952C7E1F63BBC000DD6677 /* fileenc.c in Sources */,
|
||||
37952C891F63BBDA00DD6677 /* SSZipArchive.m in Sources */,
|
||||
37952C7A1F63BBC000DD6677 /* aestab.c in Sources */,
|
||||
37952C861F63BBC000DD6677 /* sha1.c in Sources */,
|
||||
37952C751F63BBC000DD6677 /* aes_ni.c in Sources */,
|
||||
37952C701F63BBBB00DD6677 /* unzip.c in Sources */,
|
||||
37952C691F63BBBB00DD6677 /* ioapi_mem.c in Sources */,
|
||||
37952C6B1F63BBBB00DD6677 /* minishared.c in Sources */,
|
||||
37952C671F63BBBB00DD6677 /* ioapi_buf.c in Sources */,
|
||||
37952C721F63BBBB00DD6677 /* zip.c in Sources */,
|
||||
37952C661F63BBBB00DD6677 /* crypt.c in Sources */,
|
||||
37952C771F63BBC000DD6677 /* aescrypt.c in Sources */,
|
||||
37952C6E1F63BBBB00DD6677 /* ioapi.c in Sources */,
|
||||
37952C821F63BBC000DD6677 /* prng.c in Sources */,
|
||||
37952C781F63BBC000DD6677 /* aeskey.c in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
AFF75A1F1C37279600F450AC /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -440,6 +704,112 @@
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
37952C2B1F63B50D00DD6677 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES_AGGRESSIVE;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
INFOPLIST_FILE = SSZipArchive/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.ZipArchive;
|
||||
PRODUCT_NAME = "$(PROJECT_NAME)";
|
||||
SDKROOT = appletvos;
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_VERSION = 3.0;
|
||||
TARGETED_DEVICE_FAMILY = 3;
|
||||
TVOS_DEPLOYMENT_TARGET = 9.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
37952C2C1F63B50D00DD6677 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES_AGGRESSIVE;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
INFOPLIST_FILE = SSZipArchive/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.ZipArchive;
|
||||
PRODUCT_NAME = "$(PROJECT_NAME)";
|
||||
SDKROOT = appletvos;
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_VERSION = 3.0;
|
||||
TARGETED_DEVICE_FAMILY = 3;
|
||||
TVOS_DEPLOYMENT_TARGET = 9.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
37952C631F63BB7100DD6677 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
APPLICATION_EXTENSION_API_ONLY = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES_AGGRESSIVE;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
INFOPLIST_FILE = SSZipArchive/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.ZipArchive;
|
||||
PRODUCT_NAME = "$(PROJECT_NAME)";
|
||||
SDKROOT = watchos;
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 3.0;
|
||||
TARGETED_DEVICE_FAMILY = 4;
|
||||
WATCHOS_DEPLOYMENT_TARGET = 2.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
37952C641F63BB7100DD6677 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
APPLICATION_EXTENSION_API_ONLY = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES_AGGRESSIVE;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
INFOPLIST_FILE = SSZipArchive/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.ZipArchive;
|
||||
PRODUCT_NAME = "$(PROJECT_NAME)";
|
||||
SDKROOT = watchos;
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_VERSION = 3.0;
|
||||
TARGETED_DEVICE_FAMILY = 4;
|
||||
WATCHOS_DEPLOYMENT_TARGET = 2.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
AFF75A2A1C37279600F450AC /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
@@ -453,7 +823,7 @@
|
||||
INFOPLIST_FILE = "$(SRCROOT)/SSZipArchive/Info.plist";
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.11;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.9;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.ZipArchive;
|
||||
PRODUCT_NAME = "$(PROJECT_NAME)";
|
||||
SDKROOT = macosx;
|
||||
@@ -475,7 +845,7 @@
|
||||
INFOPLIST_FILE = "$(SRCROOT)/SSZipArchive/Info.plist";
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.11;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.9;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.ZipArchive;
|
||||
PRODUCT_NAME = "$(PROJECT_NAME)";
|
||||
SDKROOT = macosx;
|
||||
@@ -593,6 +963,7 @@
|
||||
buildSettings = {
|
||||
APPLICATION_EXTENSION_API_ONLY = YES;
|
||||
BITCODE_GENERATION_MODE = marker;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
|
||||
@@ -617,6 +988,7 @@
|
||||
buildSettings = {
|
||||
APPLICATION_EXTENSION_API_ONLY = YES;
|
||||
BITCODE_GENERATION_MODE = bitcode;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
|
||||
@@ -638,6 +1010,23 @@
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
37952C2D1F63B50D00DD6677 /* Build configuration list for PBXNativeTarget "ZipArchive-tvos" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
37952C2B1F63B50D00DD6677 /* Debug */,
|
||||
37952C2C1F63B50D00DD6677 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
37952C651F63BB7100DD6677 /* Build configuration list for PBXNativeTarget "ZipArchive-watchos" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
37952C631F63BB7100DD6677 /* Debug */,
|
||||
37952C641F63BB7100DD6677 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
};
|
||||
AFF75A291C37279600F450AC /* Build configuration list for PBXNativeTarget "ZipArchive-Mac" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0830"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "37952C251F63B50D00DD6677"
|
||||
BuildableName = "ZipArchive.framework"
|
||||
BlueprintName = "ZipArchive-tvos"
|
||||
ReferencedContainer = "container:ZipArchive.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "37952C251F63B50D00DD6677"
|
||||
BuildableName = "ZipArchive.framework"
|
||||
BlueprintName = "ZipArchive-tvos"
|
||||
ReferencedContainer = "container:ZipArchive.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "37952C251F63B50D00DD6677"
|
||||
BuildableName = "ZipArchive.framework"
|
||||
BlueprintName = "ZipArchive-tvos"
|
||||
ReferencedContainer = "container:ZipArchive.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
@@ -0,0 +1,80 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0830"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "37952C5D1F63BB7100DD6677"
|
||||
BuildableName = "ZipArchive.framework"
|
||||
BlueprintName = "ZipArchive-watchos"
|
||||
ReferencedContainer = "container:ZipArchive.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "37952C5D1F63BB7100DD6677"
|
||||
BuildableName = "ZipArchive.framework"
|
||||
BlueprintName = "ZipArchive-watchos"
|
||||
ReferencedContainer = "container:ZipArchive.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "37952C5D1F63BB7100DD6677"
|
||||
BuildableName = "ZipArchive.framework"
|
||||
BlueprintName = "ZipArchive-watchos"
|
||||
ReferencedContainer = "container:ZipArchive.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
Reference in New Issue
Block a user