49 Commits

Author SHA1 Message Date
Antoine Cœur
4ae03a2145 proper fix for compatibility with incorrect headers 2017-10-11 23:41:35 +08:00
Antoine Cœur
fab301b90f Merge pull request #400 from ZipArchive/__MACOSX
ignoring __MACOSX/
2017-10-10 20:09:20 -05:00
Antoine Cœur
e5962afc05 Merge pull request #398 from ZipArchive/nestedZip
support nested zip by calling fclose first
2017-10-10 20:09:08 -05:00
Antoine Cœur
236f31d25a Merge pull request #396 from ZipArchive/carthage
removing inconsistent swift dependency for carthage frameworks
2017-10-10 20:08:51 -05:00
Antoine Cœur
01d1d9e770 ignoring __MACOSX/
currentFileNumber needs to be incremented even if we `continue`
2017-10-10 19:14:41 +08:00
Antoine Cœur
1fd7fa9c29 support nested zip by calling fclose first 2017-10-10 16:43:46 +08:00
Antoine Cœur
2886108b12 more flexible sample apps 2017-10-10 16:42:00 +08:00
Antoine Cœur
45d2faf540 removing inconsistent swift dependency for carthage frameworks 2017-10-10 15:07:35 +08:00
Antoine Cœur
308b7c9849 no more swift2.3 2017-10-10 11:29:22 +08:00
Antoine Cœur
96d988d3f8 support AES, compression level, tvOS, ... 2017-10-09 02:28:16 -05:00
Antoine Cœur
6746665b71 Merge pull request #394 from ZipArchive/nestedZipLevel
Nested zip level
2017-10-09 02:18:51 -05:00
Antoine Cœur
a9bb0f948c Merge pull request #393 from ZipArchive/optional_aes
Optional aes and custom compression level
2017-10-09 02:18:40 -05:00
Antoine Cœur
e38ad24bd8 Merge pull request #392 from ZipArchive/zip_empty_folder
avoiding creating an extra file to zip an empty folder
2017-10-09 02:18:04 -05:00
Antoine Cœur
a9eb253d90 optional nestedZipLevel 2017-10-08 13:30:55 +08:00
Antoine Cœur
181bdc693e optional AES and custom compressionLevel 2017-10-08 13:28:00 +08:00
Antoine Cœur
df25a4a43e avoiding creating an extra file to zip an empty folder 2017-10-08 02:39:39 +08:00
Antoine Cœur
252fb76ff4 print success in the example projects 2017-10-08 01:32:33 +08:00
Antoine Cœur
b8a68d1a08 Merge pull request #391 from ZipArchive/incorrect_headers
compatibility with incorrect headers
2017-10-07 11:51:57 -05:00
Antoine Cœur
ed887bd062 Merge pull request #390 from ZipArchive/empty_zip
compatibility with empty zip files
2017-10-07 11:51:46 -05:00
Antoine Cœur
7ce0c7cc66 factoring zipInfo:setAttributesOfItemAtPath: 2017-10-07 21:39:52 +08:00
Antoine Cœur
7143ecdc66 compatibility with incorrect headers 2017-10-07 13:53:48 +08:00
Antoine Cœur
708a2c76d8 travis for tvOS 2017-10-07 13:05:16 +08:00
Antoine Cœur
2ab252766d compatibility with empty zip files 2017-10-07 13:01:07 +08:00
Antoine Cœur
27cf1ec538 fix tvOS deployment target for tests 2017-10-07 01:06:01 +08:00
Antoine Cœur
5a7f52bf50 updated minizip 2017-10-06 01:37:58 +08:00
Antoine Cœur
f59a2d6670 moving test delegates to their own files 2017-10-04 23:46:51 +08:00
Antoine Cœur
0634a08c75 moving filenameStringWithCString to its own method 2017-10-04 22:53:37 +08:00
Antoine Cœur
1011c5ec05 moving fileIsSymbolicLink to its own function 2017-10-04 22:10:52 +08:00
Antoine Cœur
1b253ad445 removing dependency on storyboard for tests on Xcode 7 2017-10-04 22:10:13 +08:00
Antoine Cœur
b7097ae6bb report error for negative readBytes (invalid password) 2017-10-04 20:21:07 +08:00
Antoine Cœur
6bf9406cff fix Xcode 9.1 constraints warnings 2017-10-04 15:46:29 +08:00
Antoine Cœur
2e8fd082ca changing com.samsoffes to com.ziparchive 2017-10-04 15:05:05 +08:00
Antoine Cœur
917cdd6d73 travis tests for macOS 2017-10-04 14:36:52 +08:00
Antoine Cœur
b660cccd24 removing zipArchiveDidUnzipArchiveFile:entryPath:destPath: from SSZipArchiveDelegate as never implemented 2017-10-03 23:42:15 +08:00
Antoine Cœur
2821ab5d3e handling potential errors in zipOpenNewFileInZip 2017-10-02 02:59:21 +08:00
Antoine Cœur
f6fd858c20 Xcode 7 compatibility 2017-09-30 13:43:23 +08:00
Antoine Cœur
6ec780b26a macOS 10.8+ is needed 2017-09-30 13:22:44 +08:00
Antoine Cœur
f827cff917 2.0.8 2017-09-30 10:32:35 +08:00
Antoine Cœur
67f1711fe0 Merge pull request #385 from ZipArchive/encoding_autodetection
supporting encoding detection
2017-09-29 12:43:52 -05:00
Antoine Cœur
6f0bb4e9b4 fix #315 by removing the size_filename test.
latest minizip.
2017-09-30 01:42:17 +08:00
Antoine Cœur
5c10b9bed2 hexa is more readable than base64 for debugging unknown encodings 2017-09-29 19:06:16 +08:00
Antoine Cœur
eed7d2368d removing iOS 7 compatibility 2017-09-29 02:43:27 +08:00
Antoine Cœur
b75031acd0 supporting encoding detection 2017-09-29 02:29:04 +08:00
Antoine Cœur
d6eea31fea Xcode 9 friendly solution for logs 2017-09-28 03:32:49 +08:00
Antoine Cœur
b65da3ff20 hiding system messages on simulator 2017-09-28 01:32:31 +08:00
Antoine Cœur
76c8d2aeee parameters on separate lines 2017-09-21 15:59:34 +08:00
Antoine Cœur
a29b765b4b new devices 2017-09-21 15:57:56 +08:00
Antoine Cœur
5db5451166 fix regression from previous commit 2017-09-19 11:40:25 +08:00
Antoine Cœur
b9ce3814d4 latest minizip 2017-09-18 20:33:11 +08:00
40 changed files with 4010 additions and 2903 deletions

View File

@@ -1,41 +1,87 @@
language: objective-c
podfile: ObjectiveCExample/Podfile
xcode_workspace: ObjectiveCExample/ObjectiveCExample.xcworkspace
xcode_scheme: ObjectiveCExample
matrix:
include:
- osx_image: xcode9 # OS X 10.12
env: SDK="macosx"
DEVICE="OS X 10.12"
- osx_image: xcode8.3 # OS X 10.12
env: SDK="macosx"
DEVICE="OS X 10.12"
- osx_image: xcode7.3 # OS X 10.11
env: SDK="macosx"
DEVICE="OS X 10.11"
- osx_image: xcode9
env: DESTINATION="iPhone 7 Plus (11.0)" # oldest/newest for iOS 11.x
env: SDK="appletvsimulator"
DEVICE="Apple TV 4K (11.0)" # oldest/newest for tvOS 11.x
- osx_image: xcode8.3
env: SDK="appletvsimulator"
DEVICE="Apple TV 1080p (10.2)" # latest for tvOS 10.x
- osx_image: xcode8.3
env: SDK="appletvsimulator"
DEVICE="Apple TV 1080p (9.2)" # latest for tvOS 9.x
- osx_image: xcode7.3
env: SDK="appletvsimulator"
DEVICE="Apple TV 1080p (9.0)" # oldest for tvOS 9.x
- osx_image: xcode9
env: DESTINATION="iPhone 7 Plus (10.3.1)" # latest for iOS 10.x
env: SDK="iphonesimulator"
DEVICE="iPhone X (11.0)" # oldest/newest for iOS 11.x
- osx_image: xcode9
env: SDK="iphonesimulator"
DEVICE="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
env: SDK="iphonesimulator"
DEVICE="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
env: SDK="iphonesimulator"
DEVICE="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
env: SDK="iphonesimulator"
DEVICE="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
env: SDK="iphonesimulator"
DEVICE="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
env: SDK="iphonesimulator"
DEVICE="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
- if [ ${SDK} = "macosx" ]; then
SCHEME="ObjectiveCExample_macOS";
elif [ ${SDK} = "appletvsimulator" ]; then
SCHEME="ObjectiveCExample_tvOS";
else
SCHEME="ObjectiveCExample_iOS";
fi
- if [ ${SDK} = "macosx" ]; then
DESTINATION="platform=macosx";
else
DESTINATION_UDID=$(instruments -s devices | grep "$DEVICE \[" | 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;
DESTINATION="id=$DESTINATION_UDID";
fi
script:
# Testing
- xcodebuild
`` -workspace ObjectiveCExample/ObjectiveCExample.xcworkspace
`` -scheme ObjectiveCExample -sdk iphonesimulator
`` -destination "id=$DESTINATION_UDID"
`` -scheme $SCHEME
`` -sdk $SDK
`` -destination "$DESTINATION"
`` -configuration Debug ONLY_ACTIVE_ARCH=NO ENABLE_TESTABILITY=YES
`` test

View File

@@ -3,12 +3,56 @@
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objectVersion = 47;
objects = {
/* Begin PBXBuildFile section */
09C572016004B12D6A6F9BFD /* Pods_ObjectiveCExampleTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7BC9C4E518D9F4FF7C026523 /* Pods_ObjectiveCExampleTests.framework */; };
60F2CD131F797840FEEF41BF /* Pods_ObjectiveCExample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E647562E4F5D61128404422A /* Pods_ObjectiveCExample.framework */; };
3754B1331F88961C00A58AA0 /* Empty.zip in Resources */ = {isa = PBXBuildFile; fileRef = 3754B1311F88961800A58AA0 /* Empty.zip */; };
3754B1341F88961D00A58AA0 /* Empty.zip in Resources */ = {isa = PBXBuildFile; fileRef = 3754B1311F88961800A58AA0 /* Empty.zip */; };
3754B1351F88961E00A58AA0 /* Empty.zip in Resources */ = {isa = PBXBuildFile; fileRef = 3754B1311F88961800A58AA0 /* Empty.zip */; };
3773ADB61F7F453E009A4B2D /* CollectingDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DFE1A131BDAA0A800709011 /* CollectingDelegate.m */; };
3773ADB71F7F4541009A4B2D /* SSZipArchiveTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DFE1A071BDA9FF300709011 /* SSZipArchiveTests.m */; };
3773ADB81F7F4D13009A4B2D /* hello.zip in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE1A161BDAA10100709011 /* hello.zip */; };
3773ADB91F7F4D13009A4B2D /* IncorrectHeaders.zip in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE1A171BDAA10100709011 /* IncorrectHeaders.zip */; };
3773ADBA1F7F4D13009A4B2D /* RelativeSymbolicLink.zip in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE1A191BDAA10100709011 /* RelativeSymbolicLink.zip */; };
3773ADBB1F7F4D13009A4B2D /* SymbolicLink.zip in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE1A1A1BDAA10100709011 /* SymbolicLink.zip */; };
3773ADBC1F7F4D13009A4B2D /* TestArchive.zip in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE1A1B1BDAA10100709011 /* TestArchive.zip */; };
3773ADBD1F7F4D13009A4B2D /* TestPasswordArchive.zip in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE1A1C1BDAA10100709011 /* TestPasswordArchive.zip */; };
3773ADBE1F7F4D13009A4B2D /* Unicode.zip in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE1A1D1BDAA10100709011 /* Unicode.zip */; };
3773ADBF1F7F4D16009A4B2D /* PermissionsTestApp.app in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE1A181BDAA10100709011 /* PermissionsTestApp.app */; };
3773ADC01F7F4D1C009A4B2D /* 0.m4a in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE1A1F1BDAA10100709011 /* 0.m4a */; };
3773ADC11F7F4D1C009A4B2D /* 1.m4a in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE1A201BDAA10100709011 /* 1.m4a */; };
3773ADC21F7F4D1C009A4B2D /* 2.m4a in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE1A211BDAA10100709011 /* 2.m4a */; };
3773ADC31F7F4D1C009A4B2D /* 3.m4a in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE1A221BDAA10100709011 /* 3.m4a */; };
3773ADC41F7F4D1C009A4B2D /* 4.m4a in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE1A231BDAA10100709011 /* 4.m4a */; };
3773ADC51F7F4D1C009A4B2D /* 5.m4a in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE1A241BDAA10100709011 /* 5.m4a */; };
3773ADC61F7F4D1C009A4B2D /* 6.m4a in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE1A251BDAA10100709011 /* 6.m4a */; };
3773ADC71F7F4D1C009A4B2D /* 7.m4a in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE1A261BDAA10100709011 /* 7.m4a */; };
3793E6DF1F7F6048000B1A19 /* CollectingDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DFE1A131BDAA0A800709011 /* CollectingDelegate.m */; };
3793E6E01F7F604B000B1A19 /* SSZipArchiveTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DFE1A071BDA9FF300709011 /* SSZipArchiveTests.m */; };
3793E6E11F7F6052000B1A19 /* 0.m4a in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE1A1F1BDAA10100709011 /* 0.m4a */; };
3793E6E21F7F6052000B1A19 /* 1.m4a in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE1A201BDAA10100709011 /* 1.m4a */; };
3793E6E31F7F6052000B1A19 /* 2.m4a in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE1A211BDAA10100709011 /* 2.m4a */; };
3793E6E41F7F6052000B1A19 /* 3.m4a in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE1A221BDAA10100709011 /* 3.m4a */; };
3793E6E51F7F6052000B1A19 /* 4.m4a in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE1A231BDAA10100709011 /* 4.m4a */; };
3793E6E61F7F6052000B1A19 /* 5.m4a in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE1A241BDAA10100709011 /* 5.m4a */; };
3793E6E71F7F6052000B1A19 /* 6.m4a in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE1A251BDAA10100709011 /* 6.m4a */; };
3793E6E81F7F6052000B1A19 /* 7.m4a in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE1A261BDAA10100709011 /* 7.m4a */; };
3793E6E91F7F6059000B1A19 /* hello.zip in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE1A161BDAA10100709011 /* hello.zip */; };
3793E6EA1F7F6059000B1A19 /* IncorrectHeaders.zip in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE1A171BDAA10100709011 /* IncorrectHeaders.zip */; };
3793E6EB1F7F6059000B1A19 /* RelativeSymbolicLink.zip in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE1A191BDAA10100709011 /* RelativeSymbolicLink.zip */; };
3793E6EC1F7F6059000B1A19 /* SymbolicLink.zip in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE1A1A1BDAA10100709011 /* SymbolicLink.zip */; };
3793E6ED1F7F6059000B1A19 /* TestArchive.zip in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE1A1B1BDAA10100709011 /* TestArchive.zip */; };
3793E6EE1F7F6059000B1A19 /* TestPasswordArchive.zip in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE1A1C1BDAA10100709011 /* TestPasswordArchive.zip */; };
3793E6EF1F7F6059000B1A19 /* Unicode.zip in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE1A1D1BDAA10100709011 /* Unicode.zip */; };
3793E6F01F7F605C000B1A19 /* PermissionsTestApp.app in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE1A181BDAA10100709011 /* PermissionsTestApp.app */; };
37FF0CB31F8533E0006E4361 /* CancelDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 37FF0CB21F8533E0006E4361 /* CancelDelegate.m */; };
37FF0CB41F8533E0006E4361 /* CancelDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 37FF0CB21F8533E0006E4361 /* CancelDelegate.m */; };
37FF0CB51F8533E0006E4361 /* CancelDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 37FF0CB21F8533E0006E4361 /* CancelDelegate.m */; };
37FF0CB81F853459006E4361 /* ProgressDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 37FF0CB71F853459006E4361 /* ProgressDelegate.m */; };
37FF0CB91F853459006E4361 /* ProgressDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 37FF0CB71F853459006E4361 /* ProgressDelegate.m */; };
37FF0CBA1F853459006E4361 /* ProgressDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 37FF0CB71F853459006E4361 /* ProgressDelegate.m */; };
6BFA1E5841DFEC4E21BA7543 /* Pods_core_ObjectiveCExampleTests_macOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 38A85B006A1C84E475375AE1 /* Pods_core_ObjectiveCExampleTests_macOS.framework */; };
8DFE19EF1BDA9FF300709011 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DFE19EE1BDA9FF300709011 /* main.m */; };
8DFE19F21BDA9FF300709011 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DFE19F11BDA9FF300709011 /* AppDelegate.m */; };
8DFE19F51BDA9FF300709011 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DFE19F41BDA9FF300709011 /* ViewController.m */; };
@@ -33,22 +77,26 @@
8DFE1A341BDAA10100709011 /* 5.m4a in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE1A241BDAA10100709011 /* 5.m4a */; };
8DFE1A351BDAA10100709011 /* 6.m4a in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE1A251BDAA10100709011 /* 6.m4a */; };
8DFE1A361BDAA10100709011 /* 7.m4a in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE1A261BDAA10100709011 /* 7.m4a */; };
C77CFC8C1852DCA7782A7CCB /* Pods_core_ObjectiveCExampleTests_iOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A5FBFA6A604DC4631E2B97F9 /* Pods_core_ObjectiveCExampleTests_iOS.framework */; };
E31E9B694ECEB2E3932D8597 /* Pods_core_ObjectiveCExample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 49974600DB985CD98FC3AD39 /* Pods_core_ObjectiveCExample.framework */; };
F70E9D3A6F1E9FF335385D4A /* Pods_core_ObjectiveCExampleTests_tvOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D314711A618CA3AC838E95C1 /* Pods_core_ObjectiveCExampleTests_tvOS.framework */; };
F7D6D86D1CFB2C4900DA6DA6 /* Sample Data in Resources */ = {isa = PBXBuildFile; fileRef = F7D6D86C1CFB2C4900DA6DA6 /* Sample Data */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
8DFE1A041BDA9FF300709011 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 8DFE19E21BDA9FF300709011 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 8DFE19E91BDA9FF300709011;
remoteInfo = ObjectiveCExample;
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
78F9C8623D65380774875E92 /* Pods-ObjectiveCExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ObjectiveCExample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-ObjectiveCExample/Pods-ObjectiveCExample.debug.xcconfig"; sourceTree = "<group>"; };
7BC9C4E518D9F4FF7C026523 /* Pods_ObjectiveCExampleTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ObjectiveCExampleTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
04CB37570807602F7E5C66D9 /* Pods-core-ObjectiveCExampleTests_macOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-core-ObjectiveCExampleTests_macOS.release.xcconfig"; path = "Pods/Target Support Files/Pods-core-ObjectiveCExampleTests_macOS/Pods-core-ObjectiveCExampleTests_macOS.release.xcconfig"; sourceTree = "<group>"; };
254DE0B206EE66F57BBE7EEE /* Pods-core-ObjectiveCExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-core-ObjectiveCExample.release.xcconfig"; path = "Pods/Target Support Files/Pods-core-ObjectiveCExample/Pods-core-ObjectiveCExample.release.xcconfig"; sourceTree = "<group>"; };
3754B1311F88961800A58AA0 /* Empty.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; path = Empty.zip; sourceTree = "<group>"; };
3773ADAE1F7F44D8009A4B2D /* ObjectiveCExampleTests_macOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ObjectiveCExampleTests_macOS.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
3793E6D71F7F5F93000B1A19 /* ObjectiveCExampleTests_tvOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ObjectiveCExampleTests_tvOS.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
37FF0CB11F8533E0006E4361 /* CancelDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CancelDelegate.h; sourceTree = "<group>"; };
37FF0CB21F8533E0006E4361 /* CancelDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CancelDelegate.m; sourceTree = "<group>"; };
37FF0CB61F853459006E4361 /* ProgressDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ProgressDelegate.h; sourceTree = "<group>"; };
37FF0CB71F853459006E4361 /* ProgressDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ProgressDelegate.m; sourceTree = "<group>"; };
38A85B006A1C84E475375AE1 /* Pods_core_ObjectiveCExampleTests_macOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_core_ObjectiveCExampleTests_macOS.framework; sourceTree = BUILT_PRODUCTS_DIR; };
48AB7DF053F85FCC6AFB0C26 /* Pods-core-ObjectiveCExampleTests_macOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-core-ObjectiveCExampleTests_macOS.debug.xcconfig"; path = "Pods/Target Support Files/Pods-core-ObjectiveCExampleTests_macOS/Pods-core-ObjectiveCExampleTests_macOS.debug.xcconfig"; sourceTree = "<group>"; };
49974600DB985CD98FC3AD39 /* Pods_core_ObjectiveCExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_core_ObjectiveCExample.framework; sourceTree = BUILT_PRODUCTS_DIR; };
51F30FF220ECFD8DC810E21A /* Pods-core-ObjectiveCExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-core-ObjectiveCExample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-core-ObjectiveCExample/Pods-core-ObjectiveCExample.debug.xcconfig"; sourceTree = "<group>"; };
8DFE19EA1BDA9FF300709011 /* ObjectiveCExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ObjectiveCExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
8DFE19EE1BDA9FF300709011 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
8DFE19F01BDA9FF300709011 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
@@ -59,8 +107,8 @@
8DFE19F91BDA9FF300709011 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
8DFE19FC1BDA9FF300709011 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
8DFE19FE1BDA9FF300709011 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
8DFE1A031BDA9FF300709011 /* ObjectiveCExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ObjectiveCExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
8DFE1A071BDA9FF300709011 /* SSZipArchiveTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SSZipArchiveTests.m; sourceTree = "<group>"; };
8DFE1A031BDA9FF300709011 /* ObjectiveCExampleTests_iOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ObjectiveCExampleTests_iOS.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
8DFE1A071BDA9FF300709011 /* SSZipArchiveTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSZipArchiveTests.m; sourceTree = "<group>"; };
8DFE1A091BDA9FF300709011 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
8DFE1A121BDAA0A800709011 /* CollectingDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CollectingDelegate.h; sourceTree = "<group>"; };
8DFE1A131BDAA0A800709011 /* CollectingDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CollectingDelegate.m; sourceTree = "<group>"; };
@@ -80,19 +128,37 @@
8DFE1A241BDAA10100709011 /* 5.m4a */ = {isa = PBXFileReference; lastKnownFileType = file; path = 5.m4a; sourceTree = "<group>"; };
8DFE1A251BDAA10100709011 /* 6.m4a */ = {isa = PBXFileReference; lastKnownFileType = file; path = 6.m4a; sourceTree = "<group>"; };
8DFE1A261BDAA10100709011 /* 7.m4a */ = {isa = PBXFileReference; lastKnownFileType = file; path = 7.m4a; sourceTree = "<group>"; };
B263C1FEBD2BEC1D1C4133CC /* Pods-ObjectiveCExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ObjectiveCExampleTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-ObjectiveCExampleTests/Pods-ObjectiveCExampleTests.release.xcconfig"; sourceTree = "<group>"; };
BF4E88C3450A127B14A949C2 /* Pods-ObjectiveCExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ObjectiveCExample.release.xcconfig"; path = "Pods/Target Support Files/Pods-ObjectiveCExample/Pods-ObjectiveCExample.release.xcconfig"; sourceTree = "<group>"; };
C12D647350722C151A02D17C /* Pods-ObjectiveCExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ObjectiveCExampleTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-ObjectiveCExampleTests/Pods-ObjectiveCExampleTests.debug.xcconfig"; sourceTree = "<group>"; };
E647562E4F5D61128404422A /* Pods_ObjectiveCExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ObjectiveCExample.framework; sourceTree = BUILT_PRODUCTS_DIR; };
A2E5B3BB819D409D02E989BC /* Pods-core-ObjectiveCExampleTests_iOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-core-ObjectiveCExampleTests_iOS.debug.xcconfig"; path = "Pods/Target Support Files/Pods-core-ObjectiveCExampleTests_iOS/Pods-core-ObjectiveCExampleTests_iOS.debug.xcconfig"; sourceTree = "<group>"; };
A5FBFA6A604DC4631E2B97F9 /* Pods_core_ObjectiveCExampleTests_iOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_core_ObjectiveCExampleTests_iOS.framework; sourceTree = BUILT_PRODUCTS_DIR; };
CD7C1D2CFA646F90A02312F4 /* Pods-core-ObjectiveCExampleTests_iOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-core-ObjectiveCExampleTests_iOS.release.xcconfig"; path = "Pods/Target Support Files/Pods-core-ObjectiveCExampleTests_iOS/Pods-core-ObjectiveCExampleTests_iOS.release.xcconfig"; sourceTree = "<group>"; };
D314711A618CA3AC838E95C1 /* Pods_core_ObjectiveCExampleTests_tvOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_core_ObjectiveCExampleTests_tvOS.framework; sourceTree = BUILT_PRODUCTS_DIR; };
DC1DEADE9E9CE0AF5B487DCF /* Pods-core-ObjectiveCExampleTests_tvOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-core-ObjectiveCExampleTests_tvOS.release.xcconfig"; path = "Pods/Target Support Files/Pods-core-ObjectiveCExampleTests_tvOS/Pods-core-ObjectiveCExampleTests_tvOS.release.xcconfig"; sourceTree = "<group>"; };
F7D6D86C1CFB2C4900DA6DA6 /* Sample Data */ = {isa = PBXFileReference; lastKnownFileType = folder; path = "Sample Data"; sourceTree = "<group>"; };
FB7EEC7952E1561D1E668B3B /* Pods-core-ObjectiveCExampleTests_tvOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-core-ObjectiveCExampleTests_tvOS.debug.xcconfig"; path = "Pods/Target Support Files/Pods-core-ObjectiveCExampleTests_tvOS/Pods-core-ObjectiveCExampleTests_tvOS.debug.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
3773ADAB1F7F44D8009A4B2D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
6BFA1E5841DFEC4E21BA7543 /* Pods_core_ObjectiveCExampleTests_macOS.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
3793E6D41F7F5F93000B1A19 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
F70E9D3A6F1E9FF335385D4A /* Pods_core_ObjectiveCExampleTests_tvOS.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
8DFE19E71BDA9FF300709011 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
60F2CD131F797840FEEF41BF /* Pods_ObjectiveCExample.framework in Frameworks */,
E31E9B694ECEB2E3932D8597 /* Pods_core_ObjectiveCExample.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -100,7 +166,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
09C572016004B12D6A6F9BFD /* Pods_ObjectiveCExampleTests.framework in Frameworks */,
C77CFC8C1852DCA7782A7CCB /* Pods_core_ObjectiveCExampleTests_iOS.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -110,10 +176,14 @@
133E0B9323A7D3A1E738A45C /* Pods */ = {
isa = PBXGroup;
children = (
78F9C8623D65380774875E92 /* Pods-ObjectiveCExample.debug.xcconfig */,
BF4E88C3450A127B14A949C2 /* Pods-ObjectiveCExample.release.xcconfig */,
C12D647350722C151A02D17C /* Pods-ObjectiveCExampleTests.debug.xcconfig */,
B263C1FEBD2BEC1D1C4133CC /* Pods-ObjectiveCExampleTests.release.xcconfig */,
51F30FF220ECFD8DC810E21A /* Pods-core-ObjectiveCExample.debug.xcconfig */,
254DE0B206EE66F57BBE7EEE /* Pods-core-ObjectiveCExample.release.xcconfig */,
48AB7DF053F85FCC6AFB0C26 /* Pods-core-ObjectiveCExampleTests_macOS.debug.xcconfig */,
04CB37570807602F7E5C66D9 /* Pods-core-ObjectiveCExampleTests_macOS.release.xcconfig */,
A2E5B3BB819D409D02E989BC /* Pods-core-ObjectiveCExampleTests_iOS.debug.xcconfig */,
CD7C1D2CFA646F90A02312F4 /* Pods-core-ObjectiveCExampleTests_iOS.release.xcconfig */,
FB7EEC7952E1561D1E668B3B /* Pods-core-ObjectiveCExampleTests_tvOS.debug.xcconfig */,
DC1DEADE9E9CE0AF5B487DCF /* Pods-core-ObjectiveCExampleTests_tvOS.release.xcconfig */,
);
name = Pods;
sourceTree = "<group>";
@@ -133,7 +203,9 @@
isa = PBXGroup;
children = (
8DFE19EA1BDA9FF300709011 /* ObjectiveCExample.app */,
8DFE1A031BDA9FF300709011 /* ObjectiveCExampleTests.xctest */,
8DFE1A031BDA9FF300709011 /* ObjectiveCExampleTests_iOS.xctest */,
3773ADAE1F7F44D8009A4B2D /* ObjectiveCExampleTests_macOS.xctest */,
3793E6D71F7F5F93000B1A19 /* ObjectiveCExampleTests_tvOS.xctest */,
);
name = Products;
sourceTree = "<group>";
@@ -170,6 +242,10 @@
8DFE1A1E1BDAA10100709011 /* Multi_Zip_Test */,
8DFE1A121BDAA0A800709011 /* CollectingDelegate.h */,
8DFE1A131BDAA0A800709011 /* CollectingDelegate.m */,
37FF0CB11F8533E0006E4361 /* CancelDelegate.h */,
37FF0CB21F8533E0006E4361 /* CancelDelegate.m */,
37FF0CB61F853459006E4361 /* ProgressDelegate.h */,
37FF0CB71F853459006E4361 /* ProgressDelegate.m */,
8DFE1A071BDA9FF300709011 /* SSZipArchiveTests.m */,
8DFE1A091BDA9FF300709011 /* Info.plist */,
);
@@ -179,6 +255,7 @@
8DFE1A151BDAA10100709011 /* Fixtures */ = {
isa = PBXGroup;
children = (
3754B1311F88961800A58AA0 /* Empty.zip */,
8DFE1A161BDAA10100709011 /* hello.zip */,
8DFE1A171BDAA10100709011 /* IncorrectHeaders.zip */,
8DFE1A181BDAA10100709011 /* PermissionsTestApp.app */,
@@ -209,8 +286,10 @@
C0E3885084B2150B8F297B76 /* Frameworks */ = {
isa = PBXGroup;
children = (
E647562E4F5D61128404422A /* Pods_ObjectiveCExample.framework */,
7BC9C4E518D9F4FF7C026523 /* Pods_ObjectiveCExampleTests.framework */,
49974600DB985CD98FC3AD39 /* Pods_core_ObjectiveCExample.framework */,
A5FBFA6A604DC4631E2B97F9 /* Pods_core_ObjectiveCExampleTests_iOS.framework */,
38A85B006A1C84E475375AE1 /* Pods_core_ObjectiveCExampleTests_macOS.framework */,
D314711A618CA3AC838E95C1 /* Pods_core_ObjectiveCExampleTests_tvOS.framework */,
);
name = Frameworks;
sourceTree = "<group>";
@@ -218,6 +297,46 @@
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
3773ADAD1F7F44D8009A4B2D /* ObjectiveCExampleTests_macOS */ = {
isa = PBXNativeTarget;
buildConfigurationList = 3773ADB51F7F44D9009A4B2D /* Build configuration list for PBXNativeTarget "ObjectiveCExampleTests_macOS" */;
buildPhases = (
9118978BA07845D66F76FA15 /* [CP] Check Pods Manifest.lock */,
3773ADAA1F7F44D8009A4B2D /* Sources */,
3773ADAB1F7F44D8009A4B2D /* Frameworks */,
3773ADAC1F7F44D8009A4B2D /* Resources */,
CAB5CA5258A34C1F6C699857 /* [CP] Embed Pods Frameworks */,
E2575624354B48B09E5AC0D8 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
dependencies = (
);
name = ObjectiveCExampleTests_macOS;
productName = ObjectiveCExample_macOS_test;
productReference = 3773ADAE1F7F44D8009A4B2D /* ObjectiveCExampleTests_macOS.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
3793E6D61F7F5F93000B1A19 /* ObjectiveCExampleTests_tvOS */ = {
isa = PBXNativeTarget;
buildConfigurationList = 3793E6DC1F7F5F93000B1A19 /* Build configuration list for PBXNativeTarget "ObjectiveCExampleTests_tvOS" */;
buildPhases = (
5F7F9AC51A6CCCF0FB33CC1E /* [CP] Check Pods Manifest.lock */,
3793E6D31F7F5F93000B1A19 /* Sources */,
3793E6D41F7F5F93000B1A19 /* Frameworks */,
3793E6D51F7F5F93000B1A19 /* Resources */,
E494A9BD8D1B57040775206F /* [CP] Embed Pods Frameworks */,
44EE5B4B0C619E2040D8D890 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
dependencies = (
);
name = ObjectiveCExampleTests_tvOS;
productName = ObjectiveCExampleTests_tvOS;
productReference = 3793E6D71F7F5F93000B1A19 /* ObjectiveCExampleTests_tvOS.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
8DFE19E91BDA9FF300709011 /* ObjectiveCExample */ = {
isa = PBXNativeTarget;
buildConfigurationList = 8DFE1A0C1BDA9FF300709011 /* Build configuration list for PBXNativeTarget "ObjectiveCExample" */;
@@ -238,9 +357,9 @@
productReference = 8DFE19EA1BDA9FF300709011 /* ObjectiveCExample.app */;
productType = "com.apple.product-type.application";
};
8DFE1A021BDA9FF300709011 /* ObjectiveCExampleTests */ = {
8DFE1A021BDA9FF300709011 /* ObjectiveCExampleTests_iOS */ = {
isa = PBXNativeTarget;
buildConfigurationList = 8DFE1A0F1BDA9FF300709011 /* Build configuration list for PBXNativeTarget "ObjectiveCExampleTests" */;
buildConfigurationList = 8DFE1A0F1BDA9FF300709011 /* Build configuration list for PBXNativeTarget "ObjectiveCExampleTests_iOS" */;
buildPhases = (
3849EE691EA1B366503B4C96 /* [CP] Check Pods Manifest.lock */,
8DFE19FF1BDA9FF300709011 /* Sources */,
@@ -252,11 +371,10 @@
buildRules = (
);
dependencies = (
8DFE1A051BDA9FF300709011 /* PBXTargetDependency */,
);
name = ObjectiveCExampleTests;
name = ObjectiveCExampleTests_iOS;
productName = ObjectiveCExampleTests;
productReference = 8DFE1A031BDA9FF300709011 /* ObjectiveCExampleTests.xctest */;
productReference = 8DFE1A031BDA9FF300709011 /* ObjectiveCExampleTests_iOS.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */
@@ -267,17 +385,24 @@
attributes = {
LastUpgradeCheck = 0900;
TargetAttributes = {
3773ADAD1F7F44D8009A4B2D = {
CreatedOnToolsVersion = 9.1;
ProvisioningStyle = Automatic;
};
3793E6D61F7F5F93000B1A19 = {
CreatedOnToolsVersion = 9.1;
ProvisioningStyle = Automatic;
};
8DFE19E91BDA9FF300709011 = {
CreatedOnToolsVersion = 7.1;
};
8DFE1A021BDA9FF300709011 = {
CreatedOnToolsVersion = 7.1;
TestTargetID = 8DFE19E91BDA9FF300709011;
};
};
};
buildConfigurationList = 8DFE19E51BDA9FF300709011 /* Build configuration list for PBXProject "ObjectiveCExample" */;
compatibilityVersion = "Xcode 3.2";
compatibilityVersion = "Xcode 6.3";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
@@ -290,12 +415,62 @@
projectRoot = "";
targets = (
8DFE19E91BDA9FF300709011 /* ObjectiveCExample */,
8DFE1A021BDA9FF300709011 /* ObjectiveCExampleTests */,
8DFE1A021BDA9FF300709011 /* ObjectiveCExampleTests_iOS */,
3773ADAD1F7F44D8009A4B2D /* ObjectiveCExampleTests_macOS */,
3793E6D61F7F5F93000B1A19 /* ObjectiveCExampleTests_tvOS */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
3773ADAC1F7F44D8009A4B2D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
3773ADC31F7F4D1C009A4B2D /* 3.m4a in Resources */,
3773ADC21F7F4D1C009A4B2D /* 2.m4a in Resources */,
3773ADC41F7F4D1C009A4B2D /* 4.m4a in Resources */,
3754B1341F88961D00A58AA0 /* Empty.zip in Resources */,
3773ADC01F7F4D1C009A4B2D /* 0.m4a in Resources */,
3773ADC51F7F4D1C009A4B2D /* 5.m4a in Resources */,
3773ADB91F7F4D13009A4B2D /* IncorrectHeaders.zip in Resources */,
3773ADC11F7F4D1C009A4B2D /* 1.m4a in Resources */,
3773ADBE1F7F4D13009A4B2D /* Unicode.zip in Resources */,
3773ADBF1F7F4D16009A4B2D /* PermissionsTestApp.app in Resources */,
3773ADBB1F7F4D13009A4B2D /* SymbolicLink.zip in Resources */,
3773ADBA1F7F4D13009A4B2D /* RelativeSymbolicLink.zip in Resources */,
3773ADB81F7F4D13009A4B2D /* hello.zip in Resources */,
3773ADC71F7F4D1C009A4B2D /* 7.m4a in Resources */,
3773ADC61F7F4D1C009A4B2D /* 6.m4a in Resources */,
3773ADBC1F7F4D13009A4B2D /* TestArchive.zip in Resources */,
3773ADBD1F7F4D13009A4B2D /* TestPasswordArchive.zip in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
3793E6D51F7F5F93000B1A19 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
3793E6E71F7F6052000B1A19 /* 6.m4a in Resources */,
3793E6E91F7F6059000B1A19 /* hello.zip in Resources */,
3793E6F01F7F605C000B1A19 /* PermissionsTestApp.app in Resources */,
3754B1351F88961E00A58AA0 /* Empty.zip in Resources */,
3793E6ED1F7F6059000B1A19 /* TestArchive.zip in Resources */,
3793E6E61F7F6052000B1A19 /* 5.m4a in Resources */,
3793E6E41F7F6052000B1A19 /* 3.m4a in Resources */,
3793E6EB1F7F6059000B1A19 /* RelativeSymbolicLink.zip in Resources */,
3793E6EF1F7F6059000B1A19 /* Unicode.zip in Resources */,
3793E6EA1F7F6059000B1A19 /* IncorrectHeaders.zip in Resources */,
3793E6EE1F7F6059000B1A19 /* TestPasswordArchive.zip in Resources */,
3793E6E51F7F6052000B1A19 /* 4.m4a in Resources */,
3793E6E81F7F6052000B1A19 /* 7.m4a in Resources */,
3793E6E31F7F6052000B1A19 /* 2.m4a in Resources */,
3793E6EC1F7F6059000B1A19 /* SymbolicLink.zip in Resources */,
3793E6E21F7F6052000B1A19 /* 1.m4a in Resources */,
3793E6E11F7F6052000B1A19 /* 0.m4a in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
8DFE19E81BDA9FF300709011 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
@@ -314,6 +489,7 @@
8DFE1A321BDAA10100709011 /* 3.m4a in Resources */,
8DFE1A311BDAA10100709011 /* 2.m4a in Resources */,
8DFE1A331BDAA10100709011 /* 4.m4a in Resources */,
3754B1331F88961C00A58AA0 /* Empty.zip in Resources */,
8DFE1A2F1BDAA10100709011 /* 0.m4a in Resources */,
8DFE1A341BDAA10100709011 /* 5.m4a in Resources */,
8DFE1A2D1BDAA10100709011 /* TestPasswordArchive.zip in Resources */,
@@ -344,21 +520,36 @@
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-ObjectiveCExampleTests-checkManifestLockResult.txt",
"$(DERIVED_FILE_DIR)/Pods-core-ObjectiveCExampleTests_iOS-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# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
44EE5B4B0C619E2040D8D890 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-core-ObjectiveCExampleTests_tvOS/Pods-core-ObjectiveCExampleTests_tvOS-resources.sh\"\n";
showEnvVarsInLog = 0;
};
486F364061BAD3921A1CA2C8 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-ObjectiveCExampleTests/Pods-ObjectiveCExampleTests-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/SSZipArchive/SSZipArchive.framework",
"${SRCROOT}/Pods/Target Support Files/Pods-core-ObjectiveCExampleTests_iOS/Pods-core-ObjectiveCExampleTests_iOS-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/SSZipArchive-iOS/SSZipArchive.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
@@ -366,7 +557,25 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ObjectiveCExampleTests/Pods-ObjectiveCExampleTests-frameworks.sh\"\n";
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-core-ObjectiveCExampleTests_iOS/Pods-core-ObjectiveCExampleTests_iOS-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
5F7F9AC51A6CCCF0FB33CC1E /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-core-ObjectiveCExampleTests_tvOS-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# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
8328CABE589F0AEC0D43D7CC /* [CP] Copy Pods Resources */ = {
@@ -381,7 +590,25 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ObjectiveCExample/Pods-ObjectiveCExample-resources.sh\"\n";
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-core-ObjectiveCExample/Pods-core-ObjectiveCExample-resources.sh\"\n";
showEnvVarsInLog = 0;
};
9118978BA07845D66F76FA15 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-core-ObjectiveCExampleTests_macOS-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# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
B17DD0CEF4553EDB98836D32 /* [CP] Check Pods Manifest.lock */ = {
@@ -395,7 +622,7 @@
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-ObjectiveCExample-checkManifestLockResult.txt",
"$(DERIVED_FILE_DIR)/Pods-core-ObjectiveCExample-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
@@ -408,8 +635,8 @@
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-ObjectiveCExample/Pods-ObjectiveCExample-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/SSZipArchive/SSZipArchive.framework",
"${SRCROOT}/Pods/Target Support Files/Pods-core-ObjectiveCExample/Pods-core-ObjectiveCExample-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/SSZipArchive-iOS/SSZipArchive.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
@@ -417,7 +644,58 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ObjectiveCExample/Pods-ObjectiveCExample-frameworks.sh\"\n";
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-core-ObjectiveCExample/Pods-core-ObjectiveCExample-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
CAB5CA5258A34C1F6C699857 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-core-ObjectiveCExampleTests_macOS/Pods-core-ObjectiveCExampleTests_macOS-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/SSZipArchive-macOS/SSZipArchive.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SSZipArchive.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-core-ObjectiveCExampleTests_macOS/Pods-core-ObjectiveCExampleTests_macOS-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
E2575624354B48B09E5AC0D8 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-core-ObjectiveCExampleTests_macOS/Pods-core-ObjectiveCExampleTests_macOS-resources.sh\"\n";
showEnvVarsInLog = 0;
};
E494A9BD8D1B57040775206F /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-core-ObjectiveCExampleTests_tvOS/Pods-core-ObjectiveCExampleTests_tvOS-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/SSZipArchive-tvOS/SSZipArchive.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SSZipArchive.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-core-ObjectiveCExampleTests_tvOS/Pods-core-ObjectiveCExampleTests_tvOS-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
ED17275C640D443076C514CE /* [CP] Copy Pods Resources */ = {
@@ -432,12 +710,34 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ObjectiveCExampleTests/Pods-ObjectiveCExampleTests-resources.sh\"\n";
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-core-ObjectiveCExampleTests_iOS/Pods-core-ObjectiveCExampleTests_iOS-resources.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
3773ADAA1F7F44D8009A4B2D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
3773ADB71F7F4541009A4B2D /* SSZipArchiveTests.m in Sources */,
37FF0CB91F853459006E4361 /* ProgressDelegate.m in Sources */,
3773ADB61F7F453E009A4B2D /* CollectingDelegate.m in Sources */,
37FF0CB41F8533E0006E4361 /* CancelDelegate.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
3793E6D31F7F5F93000B1A19 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
3793E6E01F7F604B000B1A19 /* SSZipArchiveTests.m in Sources */,
37FF0CBA1F853459006E4361 /* ProgressDelegate.m in Sources */,
3793E6DF1F7F6048000B1A19 /* CollectingDelegate.m in Sources */,
37FF0CB51F8533E0006E4361 /* CancelDelegate.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
8DFE19E61BDA9FF300709011 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
@@ -453,20 +753,14 @@
buildActionMask = 2147483647;
files = (
8DFE1A141BDAA0A800709011 /* CollectingDelegate.m in Sources */,
37FF0CB81F853459006E4361 /* ProgressDelegate.m in Sources */,
8DFE1A081BDA9FF300709011 /* SSZipArchiveTests.m in Sources */,
37FF0CB31F8533E0006E4361 /* CancelDelegate.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
8DFE1A051BDA9FF300709011 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 8DFE19E91BDA9FF300709011 /* ObjectiveCExample */;
targetProxy = 8DFE1A041BDA9FF300709011 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
8DFE19F61BDA9FF300709011 /* Main.storyboard */ = {
isa = PBXVariantGroup;
@@ -487,6 +781,92 @@
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
3773ADB31F7F44D9009A4B2D /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 48AB7DF053F85FCC6AFB0C26 /* Pods-core-ObjectiveCExampleTests_macOS.debug.xcconfig */;
buildSettings = {
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = ObjectiveCExampleTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.ziparchive.ObjectiveCExampleTests-macOS";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
};
name = Debug;
};
3773ADB41F7F44D9009A4B2D /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 04CB37570807602F7E5C66D9 /* Pods-core-ObjectiveCExampleTests_macOS.release.xcconfig */;
buildSettings = {
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = ObjectiveCExampleTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.ziparchive.ObjectiveCExampleTests-macOS";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
};
name = Release;
};
3793E6DD1F7F5F93000B1A19 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = FB7EEC7952E1561D1E668B3B /* Pods-core-ObjectiveCExampleTests_tvOS.debug.xcconfig */;
buildSettings = {
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CODE_SIGN_STYLE = Automatic;
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = ObjectiveCExampleTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.ziparchive.ObjectiveCExampleTests-tvOS";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
TARGETED_DEVICE_FAMILY = 3;
};
name = Debug;
};
3793E6DE1F7F5F93000B1A19 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = DC1DEADE9E9CE0AF5B487DCF /* Pods-core-ObjectiveCExampleTests_tvOS.release.xcconfig */;
buildSettings = {
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CODE_SIGN_STYLE = Automatic;
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = ObjectiveCExampleTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.ziparchive.ObjectiveCExampleTests-tvOS";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
TARGETED_DEVICE_FAMILY = 3;
};
name = Release;
};
8DFE1A0A1BDA9FF300709011 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@@ -515,6 +895,8 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_ACTIVITY_MODE = "";
"DEBUG_ACTIVITY_MODE[sdk=iphonesimulator*]" = default;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
@@ -533,10 +915,12 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.1;
MACOSX_DEPLOYMENT_TARGET = 10.8;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
TVOS_DEPLOYMENT_TARGET = 9.0;
};
name = Debug;
};
@@ -568,6 +952,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_ACTIVITY_MODE = "";
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
@@ -580,66 +965,82 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.1;
MACOSX_DEPLOYMENT_TARGET = 10.8;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
TVOS_DEPLOYMENT_TARGET = 9.0;
VALIDATE_PRODUCT = YES;
};
name = Release;
};
8DFE1A0D1BDA9FF300709011 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 78F9C8623D65380774875E92 /* Pods-ObjectiveCExample.debug.xcconfig */;
baseConfigurationReference = 51F30FF220ECFD8DC810E21A /* Pods-core-ObjectiveCExample.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = ObjectiveCExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.ObjectiveCExample;
PRODUCT_BUNDLE_IDENTIFIER = com.ziparchive.ObjectiveCExample;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
8DFE1A0E1BDA9FF300709011 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = BF4E88C3450A127B14A949C2 /* Pods-ObjectiveCExample.release.xcconfig */;
baseConfigurationReference = 254DE0B206EE66F57BBE7EEE /* Pods-core-ObjectiveCExample.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = ObjectiveCExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.ObjectiveCExample;
PRODUCT_BUNDLE_IDENTIFIER = com.ziparchive.ObjectiveCExample;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
8DFE1A101BDA9FF300709011 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = C12D647350722C151A02D17C /* Pods-ObjectiveCExampleTests.debug.xcconfig */;
baseConfigurationReference = A2E5B3BB819D409D02E989BC /* Pods-core-ObjectiveCExampleTests_iOS.debug.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
INFOPLIST_FILE = ObjectiveCExampleTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.ObjectiveCExampleTests;
PRODUCT_BUNDLE_IDENTIFIER = "com.ziparchive.ObjectiveCExampleTests-iOS";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ObjectiveCExample.app/ObjectiveCExample";
};
name = Debug;
};
8DFE1A111BDA9FF300709011 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = B263C1FEBD2BEC1D1C4133CC /* Pods-ObjectiveCExampleTests.release.xcconfig */;
baseConfigurationReference = CD7C1D2CFA646F90A02312F4 /* Pods-core-ObjectiveCExampleTests_iOS.release.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
INFOPLIST_FILE = ObjectiveCExampleTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.ObjectiveCExampleTests;
PRODUCT_BUNDLE_IDENTIFIER = "com.ziparchive.ObjectiveCExampleTests-iOS";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ObjectiveCExample.app/ObjectiveCExample";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
3773ADB51F7F44D9009A4B2D /* Build configuration list for PBXNativeTarget "ObjectiveCExampleTests_macOS" */ = {
isa = XCConfigurationList;
buildConfigurations = (
3773ADB31F7F44D9009A4B2D /* Debug */,
3773ADB41F7F44D9009A4B2D /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
3793E6DC1F7F5F93000B1A19 /* Build configuration list for PBXNativeTarget "ObjectiveCExampleTests_tvOS" */ = {
isa = XCConfigurationList;
buildConfigurations = (
3793E6DD1F7F5F93000B1A19 /* Debug */,
3793E6DE1F7F5F93000B1A19 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
8DFE19E51BDA9FF300709011 /* Build configuration list for PBXProject "ObjectiveCExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
@@ -658,7 +1059,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
8DFE1A0F1BDA9FF300709011 /* Build configuration list for PBXNativeTarget "ObjectiveCExampleTests" */ = {
8DFE1A0F1BDA9FF300709011 /* Build configuration list for PBXNativeTarget "ObjectiveCExampleTests_iOS" */ = {
isa = XCConfigurationList;
buildConfigurations = (
8DFE1A101BDA9FF300709011 /* Debug */,

View File

@@ -7,7 +7,7 @@
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForTesting = "NO"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
@@ -20,12 +20,27 @@
ReferencedContainer = "container:ObjectiveCExample.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "NO"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8DFE1A021BDA9FF300709011"
BuildableName = "ObjectiveCExampleTests_iOS.xctest"
BlueprintName = "ObjectiveCExampleTests_iOS"
ReferencedContainer = "container:ObjectiveCExample.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
@@ -33,8 +48,8 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8DFE1A021BDA9FF300709011"
BuildableName = "ObjectiveCExampleTests.xctest"
BlueprintName = "ObjectiveCExampleTests"
BuildableName = "ObjectiveCExampleTests_iOS.xctest"
BlueprintName = "ObjectiveCExampleTests_iOS"
ReferencedContainer = "container:ObjectiveCExample.xcodeproj">
</BuildableReference>
</TestableReference>
@@ -55,6 +70,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
@@ -71,6 +87,13 @@
ReferencedContainer = "container:ObjectiveCExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<EnvironmentVariables>
<EnvironmentVariable
key = "OS_ACTIVITY_MODE"
value = "${DEBUG_ACTIVITY_MODE}"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>

View File

@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0910"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "NO"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3773ADAD1F7F44D8009A4B2D"
BuildableName = "ObjectiveCExampleTests_macOS.xctest"
BlueprintName = "ObjectiveCExampleTests_macOS"
ReferencedContainer = "container:ObjectiveCExample.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3773ADAD1F7F44D8009A4B2D"
BuildableName = "ObjectiveCExampleTests_macOS.xctest"
BlueprintName = "ObjectiveCExampleTests_macOS"
ReferencedContainer = "container:ObjectiveCExample.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0910"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "NO"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3793E6D61F7F5F93000B1A19"
BuildableName = "ObjectiveCExampleTests_tvOS.xctest"
BlueprintName = "ObjectiveCExampleTests_tvOS"
ReferencedContainer = "container:ObjectiveCExample.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3793E6D61F7F5F93000B1A19"
BuildableName = "ObjectiveCExampleTests_tvOS.xctest"
BlueprintName = "ObjectiveCExampleTests_tvOS"
ReferencedContainer = "container:ObjectiveCExample.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@@ -1,8 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13196" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina3_5" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13173"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
@@ -14,19 +19,18 @@
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<rect key="frame" x="0.0" y="0.0" width="320" height="480"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="password" textAlignment="natural" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="KJF-p6-1px">
<rect key="frame" x="258.5" y="46" width="83" height="30"/>
<rect key="frame" x="118.5" y="46" width="83" height="30"/>
<nil key="textColor"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="uTp-oA-6Sj">
<rect key="frame" x="244" y="84" width="113" height="30"/>
<rect key="frame" x="103.5" y="84" width="113" height="30"/>
<constraints>
<constraint firstAttribute="width" constant="113" id="4gB-hu-j54"/>
<constraint firstAttribute="height" constant="30" id="ZCc-Jb-Nvy"/>
</constraints>
<state key="normal" title="Zip Sample Data"/>
@@ -35,10 +39,9 @@
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="2Ts-JV-yCW">
<rect key="frame" x="235" y="122" width="131" height="30"/>
<rect key="frame" x="94.5" y="122" width="131" height="30"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="slo-YK-c1X"/>
<constraint firstAttribute="width" constant="131" id="tp1-M2-kBk"/>
</constraints>
<state key="normal" title="Unzip Sample Data"/>
<connections>
@@ -46,9 +49,8 @@
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="84L-OB-eyZ">
<rect key="frame" x="281" y="247" width="39" height="30"/>
<rect key="frame" x="140.5" y="247" width="39" height="30"/>
<constraints>
<constraint firstAttribute="width" constant="39" id="ZIK-Ed-EMM"/>
<constraint firstAttribute="height" constant="30" id="kpA-B8-VhI"/>
</constraints>
<state key="normal" title="Reset"/>
@@ -56,50 +58,50 @@
<action selector="resetPressed:" destination="BYZ-38-t0r" eventType="touchUpInside" id="8v0-hm-kIr"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="b0V-gX-SgI" userLabel="File3">
<rect key="frame" x="60" y="218" width="480" height="21"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="File1" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3gB-ZC-0ON" userLabel="File1">
<rect key="frame" x="16" y="160" width="288" height="21"/>
<constraints>
<constraint firstAttribute="height" constant="21" id="OSM-wR-5Cr"/>
<constraint firstAttribute="width" constant="480" id="Sm6-aF-Af6"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3gB-ZC-0ON" userLabel="File1">
<rect key="frame" x="60" y="160" width="480" height="21"/>
<constraints>
<constraint firstAttribute="width" constant="480" id="Ng7-H8-Pfv"/>
<constraint firstAttribute="height" constant="21" id="yRA-t9-obB"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ZxR-a0-kva" userLabel="File2">
<rect key="frame" x="60" y="189" width="480" height="21"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="File2" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ZxR-a0-kva" userLabel="File2">
<rect key="frame" x="16" y="189" width="288" height="21"/>
<constraints>
<constraint firstAttribute="height" constant="21" id="NgQ-SV-D07"/>
<constraint firstAttribute="width" constant="480" id="yJ1-K6-arr"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="File3" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="b0V-gX-SgI" userLabel="File3">
<rect key="frame" x="16" y="218" width="288" height="21"/>
<constraints>
<constraint firstAttribute="height" constant="21" id="OSM-wR-5Cr"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="ZxR-a0-kva" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leadingMargin" id="0Aj-Zl-ubb"/>
<constraint firstItem="uTp-oA-6Sj" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="33K-W3-McX"/>
<constraint firstItem="3gB-ZC-0ON" firstAttribute="top" secondItem="2Ts-JV-yCW" secondAttribute="bottom" constant="8" id="3iw-LW-JkX"/>
<constraint firstItem="b0V-gX-SgI" firstAttribute="top" secondItem="ZxR-a0-kva" secondAttribute="bottom" constant="8" id="8Av-3o-ggw"/>
<constraint firstAttribute="trailingMargin" secondItem="ZxR-a0-kva" secondAttribute="trailing" id="ABK-aX-afX"/>
<constraint firstItem="84L-OB-eyZ" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="B64-sj-Ihu"/>
<constraint firstItem="b0V-gX-SgI" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="EEE-ae-qrN"/>
<constraint firstItem="3gB-ZC-0ON" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="RQc-UF-4I6"/>
<constraint firstItem="KJF-p6-1px" firstAttribute="top" secondItem="y3c-jy-aDJ" secondAttribute="bottom" constant="26" id="CrE-OB-0QR"/>
<constraint firstItem="b0V-gX-SgI" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leadingMargin" id="N3d-Wl-5jq"/>
<constraint firstAttribute="trailingMargin" secondItem="3gB-ZC-0ON" secondAttribute="trailing" id="Scb-te-5GB"/>
<constraint firstItem="ZxR-a0-kva" firstAttribute="top" secondItem="3gB-ZC-0ON" secondAttribute="bottom" constant="8" id="bUv-Zd-r4D"/>
<constraint firstItem="uTp-oA-6Sj" firstAttribute="top" secondItem="y3c-jy-aDJ" secondAttribute="bottom" constant="64" id="hwP-xO-UvR"/>
<constraint firstItem="ZxR-a0-kva" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="jRJ-c6-8LV"/>
<constraint firstAttribute="trailingMargin" secondItem="b0V-gX-SgI" secondAttribute="trailing" id="epM-dg-mgw"/>
<constraint firstItem="2Ts-JV-yCW" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="lEj-O2-aka"/>
<constraint firstItem="2Ts-JV-yCW" firstAttribute="top" secondItem="uTp-oA-6Sj" secondAttribute="bottom" constant="8" id="mnz-Ae-5eG"/>
<constraint firstItem="3gB-ZC-0ON" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leadingMargin" id="twp-26-8CL"/>
<constraint firstItem="uTp-oA-6Sj" firstAttribute="top" secondItem="KJF-p6-1px" secondAttribute="bottom" constant="8" symbolic="YES" id="uLh-xJ-Xc6"/>
<constraint firstItem="KJF-p6-1px" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="wVb-JQ-3pN"/>
<constraint firstItem="84L-OB-eyZ" firstAttribute="top" secondItem="b0V-gX-SgI" secondAttribute="bottom" constant="8" id="xAV-Uy-dqy"/>

View File

@@ -26,115 +26,123 @@
#pragma mark - Life Cycle
- (void)viewDidLoad {
[super viewDidLoad];
[super viewDidLoad];
_file1.text = @"";
_file2.text = @"";
_file3.text = @"";
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
#pragma mark - IBAction
- (IBAction)zipPressed:(id)sender {
NSString *sampleDataPath = [[NSBundle mainBundle].bundleURL
URLByAppendingPathComponent:@"Sample Data"
isDirectory:YES].path;
_zipPath = [self tempZipPath];
NSString *password = _passwordField.text;
BOOL success = [SSZipArchive createZipFileAtPath:_zipPath
withContentsOfDirectory:sampleDataPath
withPassword:password.length > 0 ? password : nil];
if (success) {
_unzipButton.enabled = YES;
_zipButton.enabled = NO;
} else {
NSLog(@"No success");
}
_resetButton.enabled = YES;
NSString *sampleDataPath = [[NSBundle mainBundle].bundleURL
URLByAppendingPathComponent:@"Sample Data"
isDirectory:YES].path;
_zipPath = [self tempZipPath];
NSString *password = _passwordField.text;
BOOL success = [SSZipArchive createZipFileAtPath:_zipPath
withContentsOfDirectory:sampleDataPath
keepParentDirectory:NO
compressionLevel:-1
password:password.length > 0 ? password : nil
AES:YES
progressHandler:nil];
if (success) {
NSLog(@"Success zip");
_unzipButton.enabled = YES;
_zipButton.enabled = NO;
} else {
NSLog(@"No success zip");
}
_resetButton.enabled = YES;
}
- (IBAction)unzipPressed:(id)sender {
if (!_zipPath) {
return;
}
NSString *unzipPath = [self tempUnzipPath];
if (!unzipPath) {
return;
}
NSString *password = _passwordField.text;
BOOL success = [SSZipArchive unzipFileAtPath:_zipPath
toDestination:unzipPath
overwrite:YES
password:password.length > 0 ? password : nil
error:nil];
if (!success) {
NSLog(@"No success");
return;
}
NSError *error = nil;
NSMutableArray<NSString *> *items = [[[NSFileManager defaultManager]
contentsOfDirectoryAtPath:unzipPath
error:&error] mutableCopy];
if (error) {
return;
}
[items enumerateObjectsUsingBlock:^(NSString * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
switch (idx) {
case 0: {
self.file1.text = obj;
break;
}
case 1: {
self.file2.text = obj;
break;
}
case 2: {
self.file3.text = obj;
break;
}
default: {
NSLog(@"Went beyond index of assumed files");
break;
}
if (!_zipPath) {
return;
}
}];
_unzipButton.enabled = NO;
NSString *unzipPath = [self tempUnzipPath];
if (!unzipPath) {
return;
}
NSString *password = _passwordField.text;
BOOL success = [SSZipArchive unzipFileAtPath:_zipPath
toDestination:unzipPath
preserveAttributes:YES
overwrite:YES
nestedZipLevel:0
password:password.length > 0 ? password : nil
error:nil
delegate:nil
progressHandler:nil
completionHandler:nil];
if (success) {
NSLog(@"Success unzip");
} else {
NSLog(@"No success unzip");
return;
}
NSError *error = nil;
NSMutableArray<NSString *> *items = [[[NSFileManager defaultManager]
contentsOfDirectoryAtPath:unzipPath
error:&error] mutableCopy];
if (error) {
return;
}
[items enumerateObjectsUsingBlock:^(NSString * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
switch (idx) {
case 0: {
self.file1.text = obj;
break;
}
case 1: {
self.file2.text = obj;
break;
}
case 2: {
self.file3.text = obj;
break;
}
default: {
NSLog(@"Went beyond index of assumed files");
break;
}
}
}];
_unzipButton.enabled = NO;
}
- (IBAction)resetPressed:(id)sender {
_file1.text = @"";
_file2.text = @"";
_file3.text = @"";
_zipButton.enabled = YES;
_unzipButton.enabled = NO;
_resetButton.enabled = NO;
_file1.text = @"";
_file2.text = @"";
_file3.text = @"";
_zipButton.enabled = YES;
_unzipButton.enabled = NO;
_resetButton.enabled = NO;
}
#pragma mark - Private
- (NSString *)tempZipPath {
NSString *path = [NSString stringWithFormat:@"%@/\%@.zip",
NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES)[0],
[NSUUID UUID].UUIDString];
return path;
NSString *path = [NSString stringWithFormat:@"%@/\%@.zip",
NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES)[0],
[NSUUID UUID].UUIDString];
return path;
}
- (NSString *)tempUnzipPath {
NSString *path = [NSString stringWithFormat:@"%@/\%@",
NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES)[0],
[NSUUID UUID].UUIDString];
NSURL *url = [NSURL fileURLWithPath:path];
NSError *error = nil;
[[NSFileManager defaultManager] createDirectoryAtURL:url
withIntermediateDirectories:YES
attributes:nil
error:&error];
if (error) {
return nil;
}
return url.path;
NSString *path = [NSString stringWithFormat:@"%@/\%@",
NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES)[0],
[NSUUID UUID].UUIDString];
NSURL *url = [NSURL fileURLWithPath:path];
NSError *error = nil;
[[NSFileManager defaultManager] createDirectoryAtURL:url
withIntermediateDirectories:YES
attributes:nil
error:&error];
if (error) {
return nil;
}
return url.path;
}
@end

View File

@@ -0,0 +1,17 @@
//
// CancelDelegate.h
// ObjectiveCExample
//
// Created by Antoine Cœur on 04/10/2017.
//
#import <Foundation/Foundation.h>
#import "SSZipArchive.h"
@interface CancelDelegate : NSObject <SSZipArchiveDelegate>
@property (nonatomic, assign) int numFilesUnzipped;
@property (nonatomic, assign) int numFilesToUnzip;
@property (nonatomic, assign) BOOL didUnzipArchive;
@property (nonatomic, assign) int loaded;
@property (nonatomic, assign) int total;
@end

View File

@@ -0,0 +1,29 @@
//
// CancelDelegate.m
// ObjectiveCExample
//
// Created by Antoine Cœur on 04/10/2017.
//
#import "CancelDelegate.h"
@implementation CancelDelegate
- (void)zipArchiveDidUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath fileInfo:(unz_file_info)fileInfo
{
_numFilesUnzipped = (int)fileIndex + 1;
}
- (BOOL)zipArchiveShouldUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath fileInfo:(unz_file_info)fileInfo
{
//return YES;
return _numFilesUnzipped < _numFilesToUnzip;
}
- (void)zipArchiveDidUnzipArchiveAtPath:(NSString *)path zipInfo:(unz_global_info)zipInfo unzippedPath:(NSString *)unzippedPath
{
_didUnzipArchive = YES;
}
- (void)zipArchiveProgressEvent:(unsigned long long)loaded total:(unsigned long long)total
{
_loaded = (int)loaded;
_total = (int)total;
}
@end

View File

@@ -7,11 +7,9 @@
#import "CollectingDelegate.h"
@implementation CollectingDelegate {
}
@synthesize files = _files;
@implementation CollectingDelegate
@synthesize files = _files;
- (instancetype)init {
self = [super init];
@@ -21,11 +19,8 @@
return self;
}
- (void)zipArchiveDidUnzipArchiveFile:(NSString *)zipFile entryPath:(NSString *)entryPath destPath:(NSString *)destPath {
[self.files addObject:entryPath];
- (void)zipArchiveDidUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath unzippedFilePath:(NSString *)unzippedFilePath {
[self.files addObject:unzippedFilePath];
}
@end
@end

View File

@@ -0,0 +1,17 @@
//
// ProgressDelegate.h
// ObjectiveCExample
//
// Created by Antoine Cœur on 04/10/2017.
//
#import <Foundation/Foundation.h>
#import "SSZipArchive.h"
@interface ProgressDelegate : NSObject <SSZipArchiveDelegate>
{
@public
NSMutableArray *progressEvents;
}
@end

View File

@@ -0,0 +1,46 @@
//
// ProgressDelegate.m
// ObjectiveCExample
//
// Created by Antoine Cœur on 04/10/2017.
//
#import "ProgressDelegate.h"
@implementation ProgressDelegate
- (instancetype)init
{
self = super.init;
progressEvents = [NSMutableArray array];
return self;
}
- (void)zipArchiveWillUnzipArchiveAtPath:(NSString *)path zipInfo:(unz_global_info)zipInfo {
NSLog(@"*** zipArchiveWillUnzipArchiveAtPath: `%@` zipInfo:", path);
}
- (void)zipArchiveDidUnzipArchiveAtPath:(NSString *)path zipInfo:(unz_global_info)zipInfo unzippedPath:(NSString *)unzippedPath {
NSLog(@"*** zipArchiveDidUnzipArchiveAtPath: `%@` zipInfo: unzippedPath: `%@`", path, unzippedPath);
}
- (BOOL)zipArchiveShouldUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath fileInfo:(unz_file_info)fileInfo
{
NSLog(@"*** zipArchiveShouldUnzipFileAtIndex: `%d` totalFiles: `%d` archivePath: `%@` fileInfo:", (int)fileIndex, (int)totalFiles, archivePath);
return YES;
}
- (void)zipArchiveWillUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath fileInfo:(unz_file_info)fileInfo {
NSLog(@"*** zipArchiveWillUnzipFileAtIndex: `%d` totalFiles: `%d` archivePath: `%@` fileInfo:", (int)fileIndex, (int)totalFiles, archivePath);
}
- (void)zipArchiveDidUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath fileInfo:(unz_file_info)fileInfo {
NSLog(@"*** zipArchiveDidUnzipFileAtIndex: `%d` totalFiles: `%d` archivePath: `%@` fileInfo:", (int)fileIndex, (int)totalFiles, archivePath);
}
- (void)zipArchiveProgressEvent:(unsigned long long)loaded total:(unsigned long long)total {
NSLog(@"*** zipArchiveProgressEvent: loaded: `%llu` total: `%llu`", loaded, total);
[progressEvents addObject:@(loaded)];
}
@end

View File

@@ -11,46 +11,16 @@
#import <CommonCrypto/CommonDigest.h>
#import "CollectingDelegate.h"
#import "CancelDelegate.h"
#import "ProgressDelegate.h"
@interface CancelDelegate : NSObject <SSZipArchiveDelegate>
@property (nonatomic, assign) int numFilesUnzipped;
@property (nonatomic, assign) int numFilesToUnzip;
@property (nonatomic, assign) BOOL didUnzipArchive;
@property (nonatomic, assign) int loaded;
@property (nonatomic, assign) int total;
@interface SSZipArchiveTests : XCTestCase
@end
@implementation CancelDelegate
- (void)zipArchiveDidUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath fileInfo:(unz_file_info)fileInfo
{
_numFilesUnzipped = (int)fileIndex + 1;
}
- (BOOL)zipArchiveShouldUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath fileInfo:(unz_file_info)fileInfo
{
//return YES;
return _numFilesUnzipped < _numFilesToUnzip;
}
- (void)zipArchiveDidUnzipArchiveAtPath:(NSString *)path zipInfo:(unz_global_info)zipInfo unzippedPath:(NSString *)unzippedPath
{
_didUnzipArchive = YES;
}
- (void)zipArchiveProgressEvent:(unsigned long long)loaded total:(unsigned long long)total
{
_loaded = (int)loaded;
_total = (int)total;
}
@end
@interface SSZipArchiveTests : XCTestCase <SSZipArchiveDelegate>
@end
@implementation SSZipArchiveTests {
NSMutableArray *progressEvents;
}
@implementation SSZipArchiveTests
- (void)setUp {
[super setUp];
progressEvents = [NSMutableArray array];
}
- (void)tearDown {
@@ -107,23 +77,23 @@
for (int test = 0; test < 20; test++)
{
// Zipping
NSString *archivePath = [outputPath stringByAppendingPathComponent:[NSString stringWithFormat:@"queue_test_%d.zip",test]];
NSString *archivePath = [outputPath stringByAppendingPathComponent:[NSString stringWithFormat:@"queue_test_%d.zip", test]];
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);
XCTAssertTrue(fileSize > threshold, @"zipping failed at %@!", archivePath);
}
}
- (void)testUnzipping {
NSString *zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"TestArchive" ofType:@"zip"];
NSString *outputPath = [self _cachesPath:@"Regular"];
BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:self];
id<SSZipArchiveDelegate> delegate = [ProgressDelegate new];
BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:delegate];
XCTAssertTrue(success);
NSFileManager *fileManager = [NSFileManager defaultManager];
@@ -133,11 +103,13 @@
testPath = [outputPath stringByAppendingPathComponent:@"LICENSE"];
XCTAssertTrue([fileManager fileExistsAtPath:testPath], @"LICENSE unzipped");
}
- (void)testSmallFileUnzipping {
NSString *zipPath = [[NSBundle bundleForClass: [self class]] pathForResource:@"TestArchive" ofType:@"zip"];
NSString *outputPath = [self _cachesPath:@"Regular"];
BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:self];
id<SSZipArchiveDelegate> delegate = [ProgressDelegate new];
BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:delegate];
XCTAssertTrue(success);
NSFileManager *fileManager = [NSFileManager defaultManager];
@@ -147,21 +119,21 @@
testPath = [outputPath stringByAppendingPathComponent:@"LICENSE"];
XCTAssertTrue([fileManager fileExistsAtPath:testPath], @"LICENSE unzipped");
}
- (void)testUnzippingProgress {
NSString *zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"TestArchive" ofType:@"zip"];
NSString *outputPath = [self _cachesPath:@"Progress"];
[progressEvents removeAllObjects];
BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:self];
ProgressDelegate *delegate = [ProgressDelegate new];
BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:delegate];
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]);
XCTAssertTrue(619 == [progressEvents[1] intValue]);
XCTAssertTrue(1114 == [progressEvents[2] intValue]);
XCTAssertTrue(1436 == [progressEvents[3] intValue]);
XCTAssertTrue(4 == [delegate->progressEvents count], @"Expected 4 progress events");
XCTAssertTrue(0 == [delegate->progressEvents[0] intValue]);
XCTAssertTrue(619 == [delegate->progressEvents[1] intValue]);
XCTAssertTrue(1114 == [delegate->progressEvents[2] intValue]);
XCTAssertTrue(1436 == [delegate->progressEvents[3] intValue]);
}
@@ -170,7 +142,8 @@
NSString *outputPath = [self _cachesPath:@"Password"];
NSError *error = nil;
BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath overwrite:YES password:@"passw0rd" error:&error delegate:self];
id<SSZipArchiveDelegate> delegate = [ProgressDelegate new];
BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath overwrite:YES password:@"passw0rd" error:&error delegate:delegate];
XCTAssertTrue(success);
NSFileManager *fileManager = [NSFileManager defaultManager];
@@ -186,8 +159,9 @@
NSString *outputPath = [self _cachesPath:@"Password"];
NSError *error = nil;
BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath overwrite:YES password:@"passw0rd123" error:&error delegate:self];
XCTAssertTrue(success);
id<SSZipArchiveDelegate> delegate = [ProgressDelegate new];
BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath overwrite:YES password:@"passw0rd123" error:&error delegate:delegate];
XCTAssertFalse(success);
NSFileManager *fileManager = [NSFileManager defaultManager];
NSString *testPath = [outputPath stringByAppendingPathComponent:@"Readme.markdown"];
@@ -205,12 +179,11 @@
BOOL fileHasValidPassword = [SSZipArchive isPasswordValidForArchiveAtPath:zipPath password:@"passw0rd" error:&error];
XCTAssertTrue(fileHasValidPassword,@"Valid password reports false.");
XCTAssertTrue(fileHasValidPassword, @"Valid password reports false.");
BOOL fileHasInvalidValidPassword = [SSZipArchive isPasswordValidForArchiveAtPath:zipPath password:@"passw0rd123" error:&error];
XCTAssertFalse(fileHasInvalidValidPassword,@"Invalid password reports true.");
XCTAssertFalse(fileHasInvalidValidPassword, @"Invalid password reports true.");
}
- (void)testIsFilePasswordProtectedAtPath {
@@ -249,7 +222,8 @@
outputPath = [self _cachesPath:@"UnicodePassword"];
NSError *error = nil;
success = [SSZipArchive unzipFileAtPath:archivePath toDestination:outputPath overwrite:YES password:@"ꊐ⌒Ⅳ🤐" error:&error delegate:self];
id<SSZipArchiveDelegate> delegate = [ProgressDelegate new];
success = [SSZipArchive unzipFileAtPath:archivePath toDestination:outputPath overwrite:YES password:@"ꊐ⌒Ⅳ🤐" error:&error delegate:delegate];
XCTAssertTrue(success);
NSFileManager *fileManager = [NSFileManager defaultManager];
@@ -258,34 +232,34 @@
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"];
//
// BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:self];
// XCTAssertTrue(success);
//
// NSString* intendedReadmeTxtMD5 = @"31ac96301302eb388070c827447290b5";
//
// NSString* filePath = [outputPath stringByAppendingPathComponent:@"IncorrectHeaders/Readme.txt"];
// NSData* data = [NSData dataWithContentsOfFile:filePath];
//
// NSString* actualReadmeTxtMD5 = [self _calculateMD5Digest:data];
// XCTAssertTrue([actualReadmeTxtMD5 isEqualToString:intendedReadmeTxtMD5], @"Readme.txt MD5 digest should match original.");
//}
- (void)testUnzippingTruncatedFileFix {
NSString *zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"IncorrectHeaders" ofType:@"zip"];
NSString *outputPath = [self _cachesPath:@"IncorrectHeaders"];
id<SSZipArchiveDelegate> delegate = [ProgressDelegate new];
BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:delegate];
XCTAssertTrue(success);
NSString *intendedReadmeTxtMD5 = @"31ac96301302eb388070c827447290b5";
NSString *filePath = [outputPath stringByAppendingPathComponent:@"IncorrectHeaders/Readme.txt"];
NSData *data = [NSData dataWithContentsOfFile:filePath];
NSString *actualReadmeTxtMD5 = [self _calculateMD5Digest:data];
XCTAssertTrue([actualReadmeTxtMD5 isEqualToString:intendedReadmeTxtMD5], @"Readme.txt MD5 digest should match original.");
}
- (void)testUnzippingWithSymlinkedFileInside {
NSString* zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"SymbolicLink" ofType:@"zip"];
NSString* outputPath = [self _cachesPath:@"SymbolicLink"];
NSString *zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"SymbolicLink" ofType:@"zip"];
NSString *outputPath = [self _cachesPath:@"SymbolicLink"];
BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:self];
id<SSZipArchiveDelegate> delegate = [ProgressDelegate new];
BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:delegate];
XCTAssertTrue(success);
NSString *testSymlink = [outputPath stringByAppendingPathComponent:@"SymbolicLink/Xcode.app"];
@@ -299,10 +273,11 @@
- (void)testUnzippingWithRelativeSymlink {
NSString *resourceName = @"RelativeSymbolicLink";
NSString* zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:resourceName ofType:@"zip"];
NSString* outputPath = [self _cachesPath:resourceName];
NSString *zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:resourceName ofType:@"zip"];
NSString *outputPath = [self _cachesPath:resourceName];
BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:self];
id<SSZipArchiveDelegate> delegate = [ProgressDelegate new];
BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:delegate];
XCTAssertTrue(success);
// Determine where the symlinks are
@@ -322,10 +297,11 @@
- (void)testUnzippingWithUnicodeFilenameInside {
NSString* zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"Unicode" ofType:@"zip"];
NSString* outputPath = [self _cachesPath:@"Unicode"];
NSString *zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"Unicode" ofType:@"zip"];
NSString *outputPath = [self _cachesPath:@"Unicode"];
BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:self];
id<SSZipArchiveDelegate> delegate = [ProgressDelegate new];
BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:delegate];
XCTAssertTrue(success);
bool unicodeFilenameWasExtracted = [[NSFileManager defaultManager] fileExistsAtPath:[outputPath stringByAppendingPathComponent:@"Accént.txt"]];
@@ -336,6 +312,14 @@
XCTAssertTrue(unicodeFolderWasExtracted, @"Folders with names in unicode should be extracted propertly.");
}
- (void)testUnzippingEmptyArchive {
NSString *zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"Empty" ofType:@"zip"];
NSString *outputPath = [self _cachesPath:@"Empty"];
BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:nil];
XCTAssertTrue(success);
}
- (void)testZippingAndUnzippingForDate {
@@ -351,12 +335,13 @@
BOOL success = [SSZipArchive createZipFileAtPath:archivePath withFilesAtPaths:inputPaths];
XCTAssertTrue(success);
success = [SSZipArchive unzipFileAtPath:archivePath toDestination:outputPath delegate:self];
id<SSZipArchiveDelegate> delegate = [ProgressDelegate new];
success = [SSZipArchive unzipFileAtPath:archivePath toDestination:outputPath delegate:delegate];
XCTAssertTrue(success);
NSDictionary *createdFileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:[outputPath stringByAppendingPathComponent:@"Readme.markdown"] error:nil];
XCTAssertEqualObjects(originalFileAttributes[NSFileCreationDate], createdFileAttributes[@"NSFileCreationDate"], @"Orginal file creationDate should match created one");
XCTAssertEqualObjects(originalFileAttributes[NSFileCreationDate], createdFileAttributes[@"NSFileCreationDate"], @"Original file creationDate should match created one");
}
@@ -428,7 +413,6 @@
XCTAssertEqual(delegate.numFilesUnzipped, 2);
XCTAssertTrue(delegate.didUnzipArchive);
XCTAssertEqual(delegate.loaded, delegate.total);
}
// Commented out to avoid checking in several gig file into the repository. Simply add a file named
@@ -450,42 +434,10 @@
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);
XCTAssertEqualObjects(collector.files[0], [outputPath stringByAppendingString:@"/LICENSE"]);
XCTAssertEqualObjects(collector.files[1], [outputPath stringByAppendingString:@"/Readme.markdown"]);
}
#pragma mark - SSZipArchiveDelegate
- (void)zipArchiveWillUnzipArchiveAtPath:(NSString *)path zipInfo:(unz_global_info)zipInfo {
NSLog(@"*** zipArchiveWillUnzipArchiveAtPath: `%@` zipInfo:", path);
}
- (void)zipArchiveDidUnzipArchiveAtPath:(NSString *)path zipInfo:(unz_global_info)zipInfo unzippedPath:(NSString *)unzippedPath {
NSLog(@"*** zipArchiveDidUnzipArchiveAtPath: `%@` zipInfo: unzippedPath: `%@`", path, unzippedPath);
}
- (BOOL)zipArchiveShouldUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath fileInfo:(unz_file_info)fileInfo
{
NSLog(@"*** zipArchiveShouldUnzipFileAtIndex: `%d` totalFiles: `%d` archivePath: `%@` fileInfo:", (int)fileIndex, (int)totalFiles, archivePath);
return YES;
}
- (void)zipArchiveWillUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath fileInfo:(unz_file_info)fileInfo {
NSLog(@"*** zipArchiveWillUnzipFileAtIndex: `%d` totalFiles: `%d` archivePath: `%@` fileInfo:", (int)fileIndex, (int)totalFiles, archivePath);
}
- (void)zipArchiveDidUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath fileInfo:(unz_file_info)fileInfo {
NSLog(@"*** zipArchiveDidUnzipFileAtIndex: `%d` totalFiles: `%d` archivePath: `%@` fileInfo:", (int)fileIndex, (int)totalFiles, archivePath);
}
- (void)zipArchiveProgressEvent:(unsigned long long)loaded total:(unsigned long long)total {
NSLog(@"*** zipArchiveProgressEvent: loaded: `%llu` total: `%llu`", loaded, total);
[progressEvents addObject:@(loaded)];
}
#pragma mark - Private
- (NSString *)_cachesPath:(NSString *)directory {
@@ -495,10 +447,7 @@
path = [path stringByAppendingPathComponent:directory];
}
NSFileManager *fileManager = [NSFileManager defaultManager];
if (![fileManager fileExistsAtPath:path]) {
[fileManager createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:nil];
}
[[NSFileManager defaultManager] createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:nil];
return path;
}

View File

@@ -3,16 +3,24 @@ source 'https://github.com/CocoaPods/Specs.git'
# inhibit_all_warnings!
use_frameworks!
def testing_pods
pod 'SSZipArchive', :path => '..'
end
abstract_target 'core' do
target 'ObjectiveCExample' do
testing_pods
platform :ios
end
pod 'SSZipArchive', :path => '..'
target 'ObjectiveCExample' do
platform :ios
end
target 'ObjectiveCExampleTests_iOS' do
platform :ios
end
target 'ObjectiveCExampleTests_macOS' do
platform :osx, '10.8'
end
target 'ObjectiveCExampleTests_tvOS' do
platform :tvos, '9.0'
end
target 'ObjectiveCExampleTests' do
testing_pods
platform :ios
end

View File

@@ -1,5 +1,5 @@
PODS:
- SSZipArchive (2.0.7)
- SSZipArchive (2.1.0)
DEPENDENCIES:
- SSZipArchive (from `..`)
@@ -9,8 +9,8 @@ EXTERNAL SOURCES:
:path: ..
SPEC CHECKSUMS:
SSZipArchive: 8c197761d66bd33e7f8b5b51ee57dff303971150
SSZipArchive: 1e8e53dcb11bca3ded4738958dc49fc467320a14
PODFILE CHECKSUM: 7f4058a9cbc69b4e63808729577a8bb2098bc527
PODFILE CHECKSUM: 5e250843c66c607960128ebfe02ab7d6569102be
COCOAPODS: 1.3.1

View File

@@ -3,18 +3,21 @@
# SSZipArchive
ZipArchive is a simple utility class for zipping and unzipping files on iOS and Mac.
ZipArchive is a simple utility class for zipping and unzipping files on iOS, macOS and tvOS.
- Unzip zip files;
- Unzip password protected zip files;
- Create new zip files;
- Unzip AES encrypted zip files;
- Create zip files;
- Create password protected zip files;
- Create AES encrypted zip files;
- Choose compression level;
- Append to existing zip files;
- Zip files;
- Zip-up NSData instances. (with a filename)
## 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+.*
SSZipArchive works on Xcode 7-9 and above, iOS 8-11 and above.
@@ -39,10 +42,10 @@ SSZipArchive requires ARC.
```objective-c
// Create
[SSZipArchive createZipFileAtPath: zipPath withContentsOfDirectory: sampleDataPath];
[SSZipArchive createZipFileAtPath:zipPath withContentsOfDirectory:sampleDataPath];
// Unzip
[SSZipArchive unzipFileAtPath:zipPath toDestination: unzipPath];
[SSZipArchive unzipFileAtPath:zipPath toDestination:unzipPath];
```
### Swift
@@ -57,7 +60,7 @@ SSZipArchive.unzipFileAtPath(zipPath, toDestination: unzipPath)
## License
SSZipArchive is protected under the [MIT license](https://github.com/samsoffes/ssziparchive/raw/master/LICENSE) and our slightly modified version of [Minizip](https://github.com/nmoinvaz/minizip) 1.1 is licensed under the [Zlib license](http://www.zlib.net/zlib_license.html).
SSZipArchive is protected under the [MIT license](https://github.com/samsoffes/ssziparchive/raw/master/LICENSE) and our slightly modified version of [Minizip](https://github.com/nmoinvaz/minizip) 1.2 is licensed under the [Zlib license](http://www.zlib.net/zlib_license.html).
## Acknowledgments

View File

@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'SSZipArchive'
s.version = '2.0.7'
s.version = '2.1.0'
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'
@@ -9,7 +9,7 @@ Pod::Spec.new do |s|
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'
s.osx.deployment_target = '10.6'
s.osx.deployment_target = '10.8'
s.watchos.deployment_target = '2.0'
s.source_files = 'SSZipArchive/*.{m,h}', 'SSZipArchive/minizip/*.{c,h}', 'SSZipArchive/minizip/aes/*.{c,h}'
s.public_header_files = 'SSZipArchive/*.h'

View File

@@ -1,25 +0,0 @@
//
// SSZipArchive+Swift.swift
// ZipArchive
//
// Created by William Dunay on 7/6/16.
// Copyright © 2016 smumryak. All rights reserved.
//
import Foundation
extension SSZipArchive {
static func unzipFileAtPath(_ path: String, toDestination destination: String, overwrite: Bool, password: String?, delegate: SSZipArchiveDelegate?) throws -> Bool {
var success = false
var error: NSError?
success = __unzipFile(atPath: path, toDestination: destination, overwrite: overwrite, password: password, error: &error, delegate: delegate)
if let throwableError = error {
throw throwableError
}
return success
}
}

View File

@@ -59,17 +59,29 @@ typedef NS_ENUM(NSInteger, SSZipArchiveErrorCode) {
+ (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;
progressHandler:(void (^_Nullable)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler
completionHandler:(void (^_Nullable)(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;
progressHandler:(void (^_Nullable)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler
completionHandler:(void (^_Nullable)(NSString *path, BOOL succeeded, NSError * _Nullable error))completionHandler;
+ (BOOL)unzipFileAtPath:(NSString *)path
toDestination:(NSString *)destination
preserveAttributes:(BOOL)preserveAttributes
overwrite:(BOOL)overwrite
nestedZipLevel:(NSInteger)nestedZipLevel
password:(nullable NSString *)password
error:(NSError **)error
delegate:(nullable id<SSZipArchiveDelegate>)delegate
progressHandler:(void (^_Nullable)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler
completionHandler:(void (^_Nullable)(NSString *path, BOOL succeeded, NSError * _Nullable error))completionHandler;
// Zip
// default compression level is Z_DEFAULT_COMPRESSION (from "zlib.h")
// without password
+ (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray<NSString *> *)paths;
@@ -77,7 +89,8 @@ typedef NS_ENUM(NSInteger, SSZipArchiveErrorCode) {
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirectory;
// with password, password could be nil
// with optional password, default encryption is AES
// don't use AES if you need compatibility with native macOS unzip and Archive Utility
+ (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;
@@ -86,14 +99,28 @@ typedef NS_ENUM(NSInteger, SSZipArchiveErrorCode) {
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
compressionLevel:(int)compressionLevel
password:(nullable NSString *)password
AES:(BOOL)aes
progressHandler:(void(^ _Nullable)(NSUInteger entryNumber, NSUInteger total))progressHandler;
- (instancetype)init NS_UNAVAILABLE;
- (instancetype)initWithPath:(NSString *)path NS_DESIGNATED_INITIALIZER;
- (BOOL)open;
- (BOOL)writeFile:(NSString *)path withPassword:(nullable NSString *)password;
/// write empty folder
- (BOOL)writeFolderAtPath:(NSString *)path withFolderName:(NSString *)folderName withPassword:(nullable NSString *)password;
/// write file
- (BOOL)writeFile:(NSString *)path withPassword:(nullable NSString *)password;
- (BOOL)writeFileAtPath:(NSString *)path withFileName:(nullable NSString *)fileName withPassword:(nullable NSString *)password;
- (BOOL)writeFileAtPath:(NSString *)path withFileName:(nullable NSString *)fileName compressionLevel:(int)compressionLevel password:(nullable NSString *)password AES:(BOOL)aes;
/// write data
- (BOOL)writeData:(NSData *)data filename:(nullable NSString *)filename withPassword:(nullable NSString *)password;
- (BOOL)writeData:(NSData *)data filename:(nullable NSString *)filename compressionLevel:(int)compressionLevel password:(nullable NSString *)password AES:(BOOL)aes;
- (BOOL)close;
@end
@@ -111,7 +138,6 @@ typedef NS_ENUM(NSInteger, SSZipArchiveErrorCode) {
- (void)zipArchiveDidUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath unzippedFilePath:(NSString *)unzippedFilePath;
- (void)zipArchiveProgressEvent:(unsigned long long)loaded total:(unsigned long long)total;
- (void)zipArchiveDidUnzipArchiveFile:(NSString *)zipFile entryPath:(NSString *)entryPath destPath:(NSString *)destPath;
@end

View File

@@ -17,6 +17,19 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
#define CHUNK 16384
int _zipOpenEntry(zipFile entry, NSString *name, const zip_fileinfo *zipfi, int level, NSString *password, BOOL aes);
BOOL _fileIsSymbolicLink(const unz_file_info *fileInfo);
#ifndef API_AVAILABLE
// Xcode 7- compatibility
#define API_AVAILABLE(...)
#endif
@interface NSData(SSZipArchive)
- (NSString *)_base64RFC4648 API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0));
- (NSString *)_hexString;
@end
@interface SSZipArchive ()
- (instancetype)init NS_DESIGNATED_INITIALIZER;
@end
@@ -44,7 +57,7 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
if (ret != UNZ_OK) {
return NO;
}
unz_file_info fileInfo = {0};
unz_file_info fileInfo = {};
ret = unzGetCurrentFileInfo(zip, &fileInfo, NULL, 0, NULL, 0, NULL, 0);
if (ret != UNZ_OK) {
return NO;
@@ -54,7 +67,7 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
unzCloseCurrentFile(zip);
ret = unzGoToNextFile(zip);
} while (ret == UNZ_OK && UNZ_OK != UNZ_END_OF_LIST_OF_FILE);
} while (ret == UNZ_OK);
}
return NO;
@@ -93,7 +106,7 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
}
return NO;
}
unz_file_info fileInfo = {0};
unz_file_info fileInfo = {};
ret = unzGetCurrentFileInfo(zip, &fileInfo, NULL, 0, NULL, 0, NULL, 0);
if (ret != UNZ_OK) {
if (error) {
@@ -106,7 +119,8 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
unsigned char buffer[10] = {0};
int readBytes = unzReadCurrentFile(zip, buffer, (unsigned)MIN(10UL,fileInfo.uncompressed_size));
if (readBytes < 0) {
// Let's assume the invalid password caused this error
// Let's assume error Z_DATA_ERROR is caused by an invalid password
// Let's assume other errors are caused by Content Not Readable
if (readBytes != Z_DATA_ERROR) {
if (error) {
*error = [NSError errorWithDomain:SSZipArchiveErrorDomain
@@ -121,9 +135,9 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
unzCloseCurrentFile(zip);
ret = unzGoToNextFile(zip);
} while (ret == UNZ_OK && UNZ_OK != UNZ_END_OF_LIST_OF_FILE);
} while (ret == UNZ_OK);
}
// No password required
return YES;
}
@@ -167,8 +181,8 @@ 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
progressHandler:(void (^_Nullable)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler
completionHandler:(void (^_Nullable)(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];
}
@@ -190,9 +204,23 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
overwrite:(BOOL)overwrite
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
delegate:(nullable id<SSZipArchiveDelegate>)delegate
progressHandler:(void (^_Nullable)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler
completionHandler:(void (^_Nullable)(NSString *path, BOOL succeeded, NSError * _Nullable error))completionHandler
{
return [self unzipFileAtPath:path toDestination:destination preserveAttributes:preserveAttributes overwrite:overwrite nestedZipLevel:0 password:password error:error delegate:delegate progressHandler:progressHandler completionHandler:completionHandler];
}
+ (BOOL)unzipFileAtPath:(NSString *)path
toDestination:(NSString *)destination
preserveAttributes:(BOOL)preserveAttributes
overwrite:(BOOL)overwrite
nestedZipLevel:(NSInteger)nestedZipLevel
password:(nullable NSString *)password
error:(NSError **)error
delegate:(nullable id<SSZipArchiveDelegate>)delegate
progressHandler:(void (^_Nullable)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler
completionHandler:(void (^_Nullable)(NSString *path, BOOL succeeded, NSError * _Nullable error))completionHandler
{
// Guard against empty strings
if (path.length == 0 || destination.length == 0)
@@ -231,11 +259,13 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
unsigned long long fileSize = [fileAttributes[NSFileSize] unsignedLongLongValue];
unsigned long long currentPosition = 0;
unz_global_info globalInfo = {0ul, 0ul};
unz_global_info globalInfo = {};
unzGetGlobalInfo(zip, &globalInfo);
// Begin unzipping
if (unzGoToFirstFile(zip) != UNZ_OK)
int ret = 0;
ret = unzGoToFirstFile(zip);
if (ret != UNZ_OK && ret != UNZ_END_OF_LIST_OF_FILE)
{
NSDictionary *userInfo = @{NSLocalizedDescriptionKey: @"failed to open first file in zip file"};
NSError *err = [NSError errorWithDomain:SSZipArchiveErrorDomain code:SSZipArchiveErrorCodeFailedOpenFileInZip userInfo:userInfo];
@@ -252,7 +282,6 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
BOOL success = YES;
BOOL canceled = NO;
int ret = 0;
int crc_ret = 0;
unsigned char buffer[4096] = {0};
NSFileManager *fileManager = [NSFileManager defaultManager];
@@ -266,9 +295,12 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
[delegate zipArchiveProgressEvent:currentPosition total:fileSize];
}
NSInteger currentFileNumber = 0;
NSInteger currentFileNumber = -1;
NSError *unzippingError;
do {
currentFileNumber++;
if (ret == UNZ_END_OF_LIST_OF_FILE)
break;
@autoreleasepool {
if (password.length == 0) {
ret = unzOpenCurrentFile(zip);
@@ -300,7 +332,8 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
if ([delegate respondsToSelector:@selector(zipArchiveShouldUnzipFileAtIndex:totalFiles:archivePath:fileInfo:)]) {
if (![delegate zipArchiveShouldUnzipFileAtIndex:currentFileNumber
totalFiles:(NSInteger)globalInfo.number_entry
archivePath:path fileInfo:fileInfo]) {
archivePath:path
fileInfo:fileInfo]) {
success = NO;
canceled = YES;
break;
@@ -324,36 +357,21 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
unzGetCurrentFileInfo(zip, &fileInfo, filename, fileInfo.size_filename + 1, NULL, 0, NULL, 0);
filename[fileInfo.size_filename] = '\0';
//
// Determine whether this is a symbolic link:
// - File is stored with 'version made by' value of UNIX (3),
// as per http://www.pkware.com/documents/casestudies/APPNOTE.TXT
// in the upper byte of the version field.
// - BSD4.4 st_mode constants are stored in the high 16 bits of the
// external file attributes (defacto standard, verified against libarchive)
//
// The original constants can be found here:
// http://minnie.tuhs.org/cgi-bin/utree.pl?file=4.4BSD/usr/include/sys/stat.h
//
const uLong ZipUNIXVersion = 3;
const uLong BSD_SFMT = 0170000;
const uLong BSD_IFLNK = 0120000;
BOOL fileIsSymbolicLink = _fileIsSymbolicLink(&fileInfo);
BOOL fileIsSymbolicLink = NO;
if (((fileInfo.version >> 8) == ZipUNIXVersion) && BSD_IFLNK == (BSD_SFMT & (fileInfo.external_fa >> 16))) {
fileIsSymbolicLink = YES;
NSString * strPath = [SSZipArchive _filenameStringWithCString:filename size:fileInfo.size_filename];
if ([strPath hasPrefix:@"__MACOSX/"]) {
// ignoring resource forks: https://superuser.com/questions/104500/what-is-macosx-folder
unzCloseCurrentFile(zip);
ret = unzGoToNextFile(zip);
continue;
}
if (!strPath.length) {
// if filename data is unsalvageable, we default to currentFileNumber
strPath = @(currentFileNumber).stringValue;
}
// Check if it contains directory
// NSString * strPath = @(filename);
NSString * strPath = @(filename);
//if filename contains chinese dir transform Encoding
if (!strPath) {
NSStringEncoding enc = CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingGB_18030_2000);
strPath = [NSString stringWithCString:filename encoding:enc];
}
//end by skyfox
BOOL isDirectory = NO;
if (filename[fileInfo.size_filename-1] == '/' || filename[fileInfo.size_filename-1] == '\\') {
isDirectory = YES;
@@ -374,7 +392,7 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
[directoriesModificationDates addObject: @{@"path": fullPath, @"modDate": modDate}];
}
if (isDirectory) {
[fileManager createDirectoryAtPath:fullPath withIntermediateDirectories:YES attributes:directoryAttr error:&err];
[fileManager createDirectoryAtPath:fullPath withIntermediateDirectories:YES attributes:directoryAttr error:&err];
} else {
[fileManager createDirectoryAtPath:fullPath.stringByDeletingLastPathComponent withIntermediateDirectories:YES attributes:directoryAttr error:&err];
}
@@ -416,25 +434,37 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
break;
}
readBytes = unzReadCurrentFile(zip, buffer, 4096);
}
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]) {
[[NSFileManager defaultManager] removeItemAtPath:fullPath error:nil];
}
if (readBytes < 0) {
// Let's assume error Z_DATA_ERROR is caused by an invalid password
// Let's assume other errors are caused by Content Not Readable
success = NO;
}
}
if (fp) {
fclose(fp);
if (preserveAttributes) {
if (nestedZipLevel
&& [fullPath.pathExtension.lowercaseString isEqualToString:@"zip"]
&& [self unzipFileAtPath:fullPath
toDestination:fullPath.stringByDeletingLastPathComponent
preserveAttributes:preserveAttributes
overwrite:overwrite
nestedZipLevel:nestedZipLevel - 1
password:password
error:nil
delegate:nil
progressHandler:nil
completionHandler:nil]) {
[directoriesModificationDates removeLastObject];
[[NSFileManager defaultManager] removeItemAtPath:fullPath error:nil];
} else if (preserveAttributes) {
// Set the original datetime property
if (fileInfo.dos_date != 0) {
NSDate *orgDate = [[self class] _dateWithMSDOSFormat:(UInt32)fileInfo.dos_date];
NSDictionary *attr = @{NSFileModificationDate: orgDate};
if (attr) {
if (![fileManager setAttributes:attr ofItemAtPath:fullPath error:nil]) {
// Can't set attributes
@@ -442,19 +472,19 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
}
}
}
// Set the original permissions on the file (+read/write to solve #293)
uLong permissions = fileInfo.external_fa >> 16 | 0b110000000;
if (permissions != 0) {
// Store it into a NSNumber
NSNumber *permissionsValue = @(permissions);
// Retrieve any existing attributes
NSMutableDictionary *attrs = [[NSMutableDictionary alloc] initWithDictionary:[fileManager attributesOfItemAtPath:fullPath error:nil]];
// Set the value in the attributes dict
attrs[NSFilePosixPermissions] = permissionsValue;
// Update attributes
if (![fileManager setAttributes:attrs ofItemAtPath:fullPath error:nil]) {
// Unable to set the permissions attribute
@@ -476,6 +506,11 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
break;
}
}
} else {
// Let's assume error Z_DATA_ERROR is caused by an invalid password
// Let's assume other errors are caused by Content Not Readable
success = NO;
break;
}
}
else
@@ -485,9 +520,15 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
int bytesRead = 0;
while ((bytesRead = unzReadCurrentFile(zip, buffer, 4096)) > 0)
{
buffer[bytesRead] = (int)0;
buffer[bytesRead] = 0;
[destinationPath appendString:@((const char *)buffer)];
}
if (bytesRead < 0) {
// Let's assume error Z_DATA_ERROR is caused by an invalid password
// Let's assume other errors are caused by Content Not Readable
success = NO;
break;
}
// Check if the symlink exists and delete it if we're overwriting
if (overwrite)
@@ -522,7 +563,7 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
crc_ret = unzCloseCurrentFile(zip);
if (crc_ret == UNZ_CRCERROR) {
//CRC ERROR
// CRC ERROR
success = NO;
break;
}
@@ -537,7 +578,6 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
archivePath:path unzippedFilePath: fullPath];
}
currentFileNumber++;
if (progressHandler)
{
progressHandler(strPath, fileInfo, currentFileNumber, globalInfo.number_entry);
@@ -558,7 +598,7 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
NSLog(@"[SSZipArchive] Set attributes failed for directory: %@.", d[@"path"]);
}
if (err) {
NSLog(@"[SSZipArchive] Error setting directory file modification date attribute: %@",err.localizedDescription);
NSLog(@"[SSZipArchive] Error setting directory file modification date attribute: %@", err.localizedDescription);
}
}
}
@@ -645,6 +685,16 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
keepParentDirectory:(BOOL)keepParentDirectory
withPassword:(nullable NSString *)password
andProgressHandler:(void(^ _Nullable)(NSUInteger entryNumber, NSUInteger total))progressHandler {
return [self createZipFileAtPath:path withContentsOfDirectory:directoryPath keepParentDirectory:keepParentDirectory compressionLevel:Z_DEFAULT_COMPRESSION password:password AES:YES progressHandler:progressHandler];
}
+ (BOOL)createZipFileAtPath:(NSString *)path
withContentsOfDirectory:(NSString *)directoryPath
keepParentDirectory:(BOOL)keepParentDirectory
compressionLevel:(int)compressionLevel
password:(nullable NSString *)password
AES:(BOOL)aes
progressHandler:(void(^ _Nullable)(NSUInteger entryNumber, NSUInteger total))progressHandler {
SSZipArchive *zipArchive = [[SSZipArchive alloc] initWithPath:path];
BOOL success = [zipArchive open];
@@ -666,15 +716,13 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
}
if (!isDir) {
success &= [zipArchive writeFileAtPath:fullFilePath withFileName:fileName withPassword:password];
success &= [zipArchive writeFileAtPath:fullFilePath withFileName:fileName compressionLevel:compressionLevel password:password AES:aes];
}
else
{
if ([[NSFileManager defaultManager] subpathsOfDirectoryAtPath:fullFilePath error:nil].count == 0)
{
NSString *tempFilePath = [self _temporaryPathForDiscardableFile];
NSString *tempFileFilename = [fileName stringByAppendingPathComponent:tempFilePath.lastPathComponent];
success &= [zipArchive writeFileAtPath:tempFilePath withFileName:tempFileFilename withPassword:password];
success &= [zipArchive writeFolderAtPath:fullFilePath withFolderName:fileName withPassword:password];
}
}
complete++;
@@ -707,8 +755,178 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
return (NULL != _zip);
}
- (BOOL)writeFolderAtPath:(NSString *)path withFolderName:(NSString *)folderName withPassword:(nullable NSString *)password
{
NSAssert((_zip != NULL), @"Attempting to write to an archive which was never opened");
zip_fileinfo zipInfo = {};
[SSZipArchive zipInfo:&zipInfo setAttributesOfItemAtPath:path];
int error = _zipOpenEntry(_zip, [folderName stringByAppendingString:@"/"], &zipInfo, Z_NO_COMPRESSION, password, 0);
const void *buffer = NULL;
zipWriteInFileInZip(_zip, buffer, 0);
zipCloseFileInZip(_zip);
return error == ZIP_OK;
}
- (void)zipInfo:(zip_fileinfo *)zipInfo setDate:(NSDate *)date
- (BOOL)writeFile:(NSString *)path withPassword:(nullable NSString *)password
{
return [self writeFileAtPath:path withFileName:nil withPassword:password];
}
- (BOOL)writeFileAtPath:(NSString *)path withFileName:(nullable NSString *)fileName withPassword:(nullable NSString *)password
{
return [self writeFileAtPath:path withFileName:fileName compressionLevel:Z_DEFAULT_COMPRESSION password:password AES:YES];
}
// supports writing files with logical folder/directory structure
// *path* is the absolute path of the file that will be compressed
// *fileName* is the relative name of the file how it is stored within the zip e.g. /folder/subfolder/text1.txt
- (BOOL)writeFileAtPath:(NSString *)path withFileName:(nullable NSString *)fileName compressionLevel:(int)compressionLevel password:(nullable NSString *)password AES:(BOOL)aes
{
NSAssert((_zip != NULL), @"Attempting to write to an archive which was never opened");
FILE *input = fopen(path.fileSystemRepresentation, "r");
if (NULL == input) {
return NO;
}
if (!fileName) {
fileName = path.lastPathComponent;
}
zip_fileinfo zipInfo = {};
[SSZipArchive zipInfo:&zipInfo setAttributesOfItemAtPath:path];
void *buffer = malloc(CHUNK);
if (buffer == NULL)
{
fclose(input);
return NO;
}
int error = _zipOpenEntry(_zip, fileName, &zipInfo, compressionLevel, password, aes);
while (!feof(input) && !ferror(input))
{
unsigned int len = (unsigned int) fread(buffer, 1, CHUNK, input);
zipWriteInFileInZip(_zip, buffer, len);
}
zipCloseFileInZip(_zip);
free(buffer);
fclose(input);
return error == ZIP_OK;
}
- (BOOL)writeData:(NSData *)data filename:(nullable NSString *)filename withPassword:(nullable NSString *)password
{
return [self writeData:data filename:filename compressionLevel:Z_DEFAULT_COMPRESSION password:password AES:YES];
}
- (BOOL)writeData:(NSData *)data filename:(nullable NSString *)filename compressionLevel:(int)compressionLevel password:(nullable NSString *)password AES:(BOOL)aes
{
if (!_zip) {
return NO;
}
if (!data) {
return NO;
}
zip_fileinfo zipInfo = {};
[SSZipArchive zipInfo:&zipInfo setDate:[NSDate date]];
int error = _zipOpenEntry(_zip, filename, &zipInfo, compressionLevel, password, aes);
zipWriteInFileInZip(_zip, data.bytes, (unsigned int)data.length);
zipCloseFileInZip(_zip);
return error == ZIP_OK;
}
- (BOOL)close
{
NSAssert((_zip != NULL), @"[SSZipArchive] Attempting to close an archive which was never opened");
int error = zipClose(_zip, NULL);
_zip = nil;
return error == UNZ_OK;
}
#pragma mark - Private
+ (NSString *)_filenameStringWithCString:(const char *)filename size:(uint16_t)size_filename
{
NSString * strPath = @(filename);
if (strPath) {
return strPath;
}
// if filename is non-unicode, detect and transform Encoding
NSData *data = [NSData dataWithBytes:(const void *)filename length:sizeof(unsigned char) * size_filename];
#ifdef __MAC_10_13
// Xcode 9+
if (@available(macOS 10.10, iOS 8.0, watchOS 2.0, tvOS 9.0, *)) {
// supported encodings are in [NSString availableStringEncodings]
[NSString stringEncodingForData:data encodingOptions:nil convertedString:&strPath usedLossyConversion:nil];
}
#else
// Xcode 8-
if (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber10_9_2) {
// supported encodings are in [NSString availableStringEncodings]
[NSString stringEncodingForData:data encodingOptions:nil convertedString:&strPath usedLossyConversion:nil];
}
#endif
else {
// fallback to a simple manual detect for macOS 10.9 or older
NSArray<NSNumber *> *encodings = @[@(kCFStringEncodingGB_18030_2000), @(kCFStringEncodingShiftJIS)];
for (NSNumber *encoding in encodings) {
strPath = [NSString stringWithCString:filename encoding:(NSStringEncoding)CFStringConvertEncodingToNSStringEncoding(encoding.unsignedIntValue)];
if (strPath) {
break;
}
}
}
if (!strPath) {
// if filename encoding is non-detected, we default to something based on data
// _hexString is more readable than _base64RFC4648 for debugging unknown encodings
strPath = [data _hexString];
}
return strPath;
}
+ (void)zipInfo:(zip_fileinfo *)zipInfo setAttributesOfItemAtPath:(NSString *)path
{
NSDictionary *attr = [[NSFileManager defaultManager] attributesOfItemAtPath:path error: nil];
if (attr)
{
NSDate *fileDate = (NSDate *)attr[NSFileModificationDate];
if (fileDate)
{
[self zipInfo:zipInfo setDate:fileDate];
}
// 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 != nil) {
// Get the short value for the permissions
short permissionsShort = permissionsValue.shortValue;
// Convert this into an octal by adding 010000, 010000 being the flag for a regular file
NSInteger permissionsOctal = 0100000 + permissionsShort;
// Convert this into a long value
uLong permissionsLong = @(permissionsOctal).unsignedLongValue;
// Store this into the external file attributes once it has been shifted 16 places left to form part of the second from last byte
// Casted back to an unsigned int to match type of external_fa in minizip
zipInfo->external_fa = (unsigned int)(permissionsLong << 16L);
}
}
}
+ (void)zipInfo:(zip_fileinfo *)zipInfo setDate:(NSDate *)date
{
NSCalendar *currentCalendar = SSZipArchive._gregorian;
NSCalendarUnit flags = NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay | NSCalendarUnitHour | NSCalendarUnitMinute | NSCalendarUnitSecond;
@@ -725,173 +943,6 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
zipInfo->dos_date = tm_to_dosdate(&tmz_date);
}
- (BOOL)writeFolderAtPath:(NSString *)path withFolderName:(NSString *)folderName withPassword:(nullable NSString *)password
{
NSAssert((_zip != NULL), @"Attempting to write to an archive which was never opened");
zip_fileinfo zipInfo = {0,0,0};
NSDictionary *attr = [[NSFileManager defaultManager] attributesOfItemAtPath:path error: nil];
if (attr)
{
NSDate *fileDate = (NSDate *)attr[NSFileModificationDate];
if (fileDate)
{
[self zipInfo:&zipInfo setDate: fileDate];
}
// 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 != nil) {
// Get the short value for the permissions
short permissionsShort = permissionsValue.shortValue;
// Convert this into an octal by adding 010000, 010000 being the flag for a regular file
NSInteger permissionsOctal = 0100000 + permissionsShort;
// Convert this into a long value
uLong permissionsLong = @(permissionsOctal).unsignedLongValue;
// Store this into the external file attributes once it has been shifted 16 places left to form part of the second from last byte
// 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);
zipWriteInFileInZip(_zip, &len, 0);
zipCloseFileInZip(_zip);
return YES;
}
- (BOOL)writeFile:(NSString *)path withPassword:(nullable NSString *)password;
{
return [self writeFileAtPath:path withFileName:nil withPassword:password];
}
// supports writing files with logical folder/directory structure
// *path* is the absolute path of the file that will be compressed
// *fileName* is the relative name of the file how it is stored within the zip e.g. /folder/subfolder/text1.txt
- (BOOL)writeFileAtPath:(NSString *)path withFileName:(nullable NSString *)fileName withPassword:(nullable NSString *)password
{
NSAssert((_zip != NULL), @"Attempting to write to an archive which was never opened");
FILE *input = fopen(path.fileSystemRepresentation, "r");
if (NULL == input) {
return NO;
}
const char *aFileName;
if (!fileName) {
aFileName = path.lastPathComponent.fileSystemRepresentation;
}
else {
aFileName = fileName.fileSystemRepresentation;
}
zip_fileinfo zipInfo = {0,0,0};
NSDictionary *attr = [[NSFileManager defaultManager] attributesOfItemAtPath:path error: nil];
if (attr)
{
NSDate *fileDate = (NSDate *)attr[NSFileModificationDate];
if (fileDate)
{
[self zipInfo:&zipInfo setDate: fileDate];
}
// 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 != nil) {
// Get the short value for the permissions
short permissionsShort = permissionsValue.shortValue;
// Convert this into an octal by adding 010000, 010000 being the flag for a regular file
NSInteger permissionsOctal = 0100000 + permissionsShort;
// Convert this into a long value
uLong permissionsLong = @(permissionsOctal).unsignedLongValue;
// Store this into the external file attributes once it has been shifted 16 places left to form part of the second from last byte
// Casted back to an unsigned int to match type of external_fa in minizip
zipInfo.external_fa = (unsigned int)(permissionsLong << 16L);
}
}
void *buffer = malloc(CHUNK);
if (buffer == NULL)
{
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);
unsigned int len = 0;
while (!feof(input) && !ferror(input))
{
len = (unsigned int) fread(buffer, 1, CHUNK, input);
zipWriteInFileInZip(_zip, buffer, len);
}
zipCloseFileInZip(_zip);
free(buffer);
fclose(input);
return YES;
}
- (BOOL)writeData:(NSData *)data filename:(nullable NSString *)filename withPassword:(nullable NSString *)password;
{
if (!_zip) {
return NO;
}
if (!data) {
return NO;
}
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);
zipWriteInFileInZip(_zip, data.bytes, (unsigned int)data.length);
zipCloseFileInZip(_zip);
return YES;
}
- (BOOL)close
{
NSAssert((_zip != NULL), @"[SSZipArchive] Attempting to close an archive which was never opened");
int error = zipClose(_zip, NULL);
_zip = nil;
return error == UNZ_OK;
}
#pragma mark - Private
+ (NSString *)_temporaryPathForDiscardableFile
{
static NSString *discardableFileName = @".DS_Store";
static NSString *discardableFilePath = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
NSString *temporaryDirectoryName = [NSUUID UUID].UUIDString;
NSString *temporaryDirectory = [NSTemporaryDirectory() stringByAppendingPathComponent:temporaryDirectoryName];
BOOL directoryCreated = [[NSFileManager defaultManager] createDirectoryAtPath:temporaryDirectory withIntermediateDirectories:YES attributes:nil error:nil];
if (directoryCreated) {
discardableFilePath = [temporaryDirectory stringByAppendingPathComponent:discardableFileName];
[@"" writeToFile:discardableFilePath atomically:YES encoding:NSUTF8StringEncoding error:nil];
}
});
return discardableFilePath;
}
+ (NSCalendar *)_gregorian
{
static NSCalendar *gregorian;
@@ -912,11 +963,9 @@ 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)];
*/
// 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;
@@ -927,7 +976,6 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
NSAssert(0xFFFFFFFF == (kYearMask | kMonthMask | kDayMask | kHourMask | kMinuteMask | kSecondMask), @"[SSZipArchive] MSDOS date masks don't add up");
NSDateComponents *components = [[NSDateComponents alloc] init];
components.year = 1980 + ((msdosDateTime & kYearMask) >> 25);
components.month = (msdosDateTime & kMonthMask) >> 21;
components.day = (msdosDateTime & kDayMask) >> 16;
@@ -940,3 +988,72 @@ NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";
}
@end
int _zipOpenEntry(zipFile entry, NSString *name, const zip_fileinfo *zipfi, int level, NSString *password, BOOL aes)
{
return zipOpenNewFileInZip5(entry, name.fileSystemRepresentation, zipfi, NULL, 0, NULL, 0, NULL, 0, 0, Z_DEFLATED, level, 0, -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, password.UTF8String, aes);
}
#pragma mark - Private tools for file info
BOOL _fileIsSymbolicLink(const unz_file_info *fileInfo)
{
//
// Determine whether this is a symbolic link:
// - File is stored with 'version made by' value of UNIX (3),
// as per http://www.pkware.com/documents/casestudies/APPNOTE.TXT
// in the upper byte of the version field.
// - BSD4.4 st_mode constants are stored in the high 16 bits of the
// external file attributes (defacto standard, verified against libarchive)
//
// The original constants can be found here:
// http://minnie.tuhs.org/cgi-bin/utree.pl?file=4.4BSD/usr/include/sys/stat.h
//
const uLong ZipUNIXVersion = 3;
const uLong BSD_SFMT = 0170000;
const uLong BSD_IFLNK = 0120000;
BOOL fileIsSymbolicLink = ((fileInfo->version >> 8) == ZipUNIXVersion) && BSD_IFLNK == (BSD_SFMT & (fileInfo->external_fa >> 16));
return fileIsSymbolicLink;
}
#pragma mark - Private tools for unreadable encodings
@implementation NSData (SSZipArchive)
// `base64EncodedStringWithOptions` uses a base64 alphabet with '+' and '/'.
// we got those alternatives to make it compatible with filenames: https://en.wikipedia.org/wiki/Base64
// * modified Base64 encoding for IMAP mailbox names (RFC 3501): uses '+' and ','
// * modified Base64 for URL and filenames (RFC 4648): uses '-' and '_'
- (NSString *)_base64RFC4648
{
NSString *strName = [self base64EncodedStringWithOptions:0];
strName = [strName stringByReplacingOccurrencesOfString:@"+" withString:@"-"];
strName = [strName stringByReplacingOccurrencesOfString:@"/" withString:@"_"];
return strName;
}
// initWithBytesNoCopy from NSProgrammer, Jan 25 '12: https://stackoverflow.com/a/9009321/1033581
// hexChars from Peter, Aug 19 '14: https://stackoverflow.com/a/25378464/1033581
// not implemented as too lengthy: a potential mapping improvement from Moose, Nov 3 '15: https://stackoverflow.com/a/33501154/1033581
- (NSString *)_hexString
{
const char *hexChars = "0123456789ABCDEF";
NSUInteger length = self.length;
const unsigned char *bytes = self.bytes;
char *chars = malloc(length * 2);
char *s = chars;
NSUInteger i = length;
while (i--) {
*s++ = hexChars[*bytes >> 4];
*s++ = hexChars[*bytes & 0xF];
bytes++;
}
NSString *str = [[NSString alloc] initWithBytesNoCopy:chars
length:length * 2
encoding:NSASCIIStringEncoding
freeWhenDone:YES];
return str;
}
@end

View File

@@ -42,9 +42,13 @@ INLINE int has_aes_ni(void)
#elif defined( __GNUC__ )
#include <cpuid.h>
#if !defined(__clang__)
#pragma GCC target ("ssse3")
#pragma GCC target ("sse4.1")
#pragma GCC target ("aes")
#endif
#include <x86intrin.h>
#define INLINE static __inline

View File

@@ -81,7 +81,7 @@ void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def *p_filef
p_filefunc64_32->ztell32_file = p_filefunc32->ztell_file;
}
static voidpf ZCALLBACK fopen_file_func(voidpf opaque, const char *filename, int mode);
static voidpf ZCALLBACK fopen_file_func(ZIP_UNUSED voidpf opaque, const char *filename, int mode);
static uint32_t ZCALLBACK fread_file_func(voidpf opaque, voidpf stream, void* buf, uint32_t size);
static uint32_t ZCALLBACK fwrite_file_func(voidpf opaque, voidpf stream, const void *buf, uint32_t size);
static uint64_t ZCALLBACK ftell64_file_func(voidpf opaque, voidpf stream);
@@ -109,7 +109,7 @@ static voidpf file_build_ioposix(FILE *file, const char *filename)
return (voidpf)ioposix;
}
static voidpf ZCALLBACK fopen_file_func(voidpf opaque, const char *filename, int mode)
static voidpf ZCALLBACK fopen_file_func(ZIP_UNUSED voidpf opaque, const char *filename, int mode)
{
FILE* file = NULL;
const char *mode_fopen = NULL;
@@ -128,7 +128,7 @@ static voidpf ZCALLBACK fopen_file_func(voidpf opaque, const char *filename, int
return file;
}
static voidpf ZCALLBACK fopen64_file_func(voidpf opaque, const void *filename, int mode)
static voidpf ZCALLBACK fopen64_file_func(ZIP_UNUSED voidpf opaque, const void *filename, int mode)
{
FILE* file = NULL;
const char *mode_fopen = NULL;
@@ -197,7 +197,7 @@ static voidpf ZCALLBACK fopendisk_file_func(voidpf opaque, voidpf stream, uint32
return ret;
}
static uint32_t ZCALLBACK fread_file_func(voidpf opaque, voidpf stream, void* buf, uint32_t size)
static uint32_t ZCALLBACK fread_file_func(ZIP_UNUSED voidpf opaque, voidpf stream, void* buf, uint32_t size)
{
FILE_IOPOSIX *ioposix = NULL;
uint32_t read = (uint32_t)-1;
@@ -208,7 +208,7 @@ static uint32_t ZCALLBACK fread_file_func(voidpf opaque, voidpf stream, void* bu
return read;
}
static uint32_t ZCALLBACK fwrite_file_func(voidpf opaque, voidpf stream, const void *buf, uint32_t size)
static uint32_t ZCALLBACK fwrite_file_func(ZIP_UNUSED voidpf opaque, voidpf stream, const void *buf, uint32_t size)
{
FILE_IOPOSIX *ioposix = NULL;
uint32_t written = (uint32_t)-1;
@@ -219,7 +219,7 @@ static uint32_t ZCALLBACK fwrite_file_func(voidpf opaque, voidpf stream, const v
return written;
}
static long ZCALLBACK ftell_file_func(voidpf opaque, voidpf stream)
static long ZCALLBACK ftell_file_func(ZIP_UNUSED voidpf opaque, voidpf stream)
{
FILE_IOPOSIX *ioposix = NULL;
long ret = -1;
@@ -230,7 +230,7 @@ static long ZCALLBACK ftell_file_func(voidpf opaque, voidpf stream)
return ret;
}
static uint64_t ZCALLBACK ftell64_file_func(voidpf opaque, voidpf stream)
static uint64_t ZCALLBACK ftell64_file_func(ZIP_UNUSED voidpf opaque, voidpf stream)
{
FILE_IOPOSIX *ioposix = NULL;
uint64_t ret = (uint64_t)-1;
@@ -241,7 +241,7 @@ static uint64_t ZCALLBACK ftell64_file_func(voidpf opaque, voidpf stream)
return ret;
}
static long ZCALLBACK fseek_file_func(voidpf opaque, voidpf stream, uint32_t offset, int origin)
static long ZCALLBACK fseek_file_func(ZIP_UNUSED voidpf opaque, voidpf stream, uint32_t offset, int origin)
{
FILE_IOPOSIX *ioposix = NULL;
int fseek_origin = 0;
@@ -270,7 +270,7 @@ static long ZCALLBACK fseek_file_func(voidpf opaque, voidpf stream, uint32_t off
return ret;
}
static long ZCALLBACK fseek64_file_func(voidpf opaque, voidpf stream, uint64_t offset, int origin)
static long ZCALLBACK fseek64_file_func(ZIP_UNUSED voidpf opaque, voidpf stream, uint64_t offset, int origin)
{
FILE_IOPOSIX *ioposix = NULL;
int fseek_origin = 0;
@@ -301,7 +301,7 @@ static long ZCALLBACK fseek64_file_func(voidpf opaque, voidpf stream, uint64_t o
return ret;
}
static int ZCALLBACK fclose_file_func(voidpf opaque, voidpf stream)
static int ZCALLBACK fclose_file_func(ZIP_UNUSED voidpf opaque, voidpf stream)
{
FILE_IOPOSIX *ioposix = NULL;
int ret = -1;
@@ -315,7 +315,7 @@ static int ZCALLBACK fclose_file_func(voidpf opaque, voidpf stream)
return ret;
}
static int ZCALLBACK ferror_file_func(voidpf opaque, voidpf stream)
static int ZCALLBACK ferror_file_func(ZIP_UNUSED voidpf opaque, voidpf stream)
{
FILE_IOPOSIX *ioposix = NULL;
int ret = -1;

View File

@@ -22,6 +22,12 @@
#include "zlib.h"
#ifdef __GNUC__
# define ZIP_UNUSED __attribute__((__unused__))
#else
# define ZIP_UNUSED
#endif
#if defined(USE_FILE32API)
# define fopen64 fopen
# define ftello64 ftell

View File

@@ -3,8 +3,8 @@
This version of ioapi is designed to buffer IO.
Copyright (C) 1998-2003 Gilles Vollant
(C) 2012-2014 Nathan Moinvaziri
Copyright (C) 2012-2017 Nathan Moinvaziri
https://github.com/nmoinvaz/minizip
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.
@@ -39,16 +39,16 @@
#ifdef __GNUC__
#ifndef max
#define max(x,y) ({ \
const typeof(x) _x = (x); \
const typeof(y) _y = (y); \
const __typeof__(x) _x = (x); \
const __typeof__(y) _y = (y); \
(void) (&_x == &_y); \
_x > _y ? _x : _y; })
#endif /* __GNUC__ */
#ifndef min
#define min(x,y) ({ \
const typeof(x) _x = (x); \
const typeof(y) _y = (y); \
const __typeof__(x) _x = (x); \
const __typeof__(y) _y = (y); \
(void) (&_x == &_y); \
_x < _y ? _x : _y; })
#endif
@@ -75,7 +75,7 @@ typedef struct ourstream_s {
# define print_buf(o,s,f,...)
#endif
void print_buf_internal(voidpf opaque, voidpf stream, char *format, ...)
void print_buf_internal(ZIP_UNUSED voidpf opaque, voidpf stream, char *format, ...)
{
ourstream_t *streamio = (ourstream_t *)stream;
va_list arglist;
@@ -85,7 +85,7 @@ void print_buf_internal(voidpf opaque, voidpf stream, char *format, ...)
va_end(arglist);
}
voidpf fopen_buf_internal_func(voidpf opaque, voidpf stream, uint32_t number_disk, int mode)
voidpf fopen_buf_internal_func(ZIP_UNUSED voidpf opaque, voidpf stream, ZIP_UNUSED uint32_t number_disk, ZIP_UNUSED int mode)
{
ourstream_t *streamio = NULL;
if (stream == NULL)
@@ -280,7 +280,7 @@ uint32_t ZCALLBACK fwrite_buf_func(voidpf opaque, voidpf stream, const void *buf
return size - bytes_left_to_write;
}
uint64_t ftell_buf_internal_func(voidpf opaque, voidpf stream, uint64_t position)
uint64_t ftell_buf_internal_func(ZIP_UNUSED voidpf opaque, voidpf stream, uint64_t position)
{
ourstream_t *streamio = (ourstream_t *)stream;
streamio->position = position;

View File

@@ -3,8 +3,8 @@
This version of ioapi is designed to buffer IO.
Copyright (C) 1998-2003 Gilles Vollant
(C) 2012-2014 Nathan Moinvaziri
Copyright (C) 2012-2017 Nathan Moinvaziri
https://github.com/nmoinvaz/minizip
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.

View File

@@ -35,7 +35,7 @@
# define IOMEM_BUFFERSIZE (UINT16_MAX)
#endif
voidpf ZCALLBACK fopen_mem_func(voidpf opaque, const char *filename, int mode)
voidpf ZCALLBACK fopen_mem_func(voidpf opaque, ZIP_UNUSED const char *filename, int mode)
{
ourmemory_t *mem = (ourmemory_t *)opaque;
if (mem == NULL)
@@ -59,13 +59,13 @@ voidpf ZCALLBACK fopen_mem_func(voidpf opaque, const char *filename, int mode)
return mem;
}
voidpf ZCALLBACK fopendisk_mem_func(voidpf opaque, voidpf stream, uint32_t number_disk, int mode)
voidpf ZCALLBACK fopendisk_mem_func(ZIP_UNUSED voidpf opaque, ZIP_UNUSED voidpf stream, ZIP_UNUSED uint32_t number_disk, ZIP_UNUSED int mode)
{
/* Not used */
return NULL;
}
uint32_t ZCALLBACK fread_mem_func(voidpf opaque, voidpf stream, void *buf, uint32_t size)
uint32_t ZCALLBACK fread_mem_func(ZIP_UNUSED voidpf opaque, voidpf stream, void *buf, uint32_t size)
{
ourmemory_t *mem = (ourmemory_t *)stream;
@@ -78,7 +78,7 @@ uint32_t ZCALLBACK fread_mem_func(voidpf opaque, voidpf stream, void *buf, uint3
return size;
}
uint32_t ZCALLBACK fwrite_mem_func(voidpf opaque, voidpf stream, const void *buf, uint32_t size)
uint32_t ZCALLBACK fwrite_mem_func(ZIP_UNUSED voidpf opaque, voidpf stream, const void *buf, uint32_t size)
{
ourmemory_t *mem = (ourmemory_t *)stream;
uint32_t newmemsize = 0;
@@ -110,13 +110,13 @@ uint32_t ZCALLBACK fwrite_mem_func(voidpf opaque, voidpf stream, const void *buf
return size;
}
long ZCALLBACK ftell_mem_func(voidpf opaque, voidpf stream)
long ZCALLBACK ftell_mem_func(ZIP_UNUSED voidpf opaque, voidpf stream)
{
ourmemory_t *mem = (ourmemory_t *)stream;
return mem->cur_offset;
}
long ZCALLBACK fseek_mem_func(voidpf opaque, voidpf stream, uint32_t offset, int origin)
long ZCALLBACK fseek_mem_func(ZIP_UNUSED voidpf opaque, voidpf stream, uint32_t offset, int origin)
{
ourmemory_t *mem = (ourmemory_t *)stream;
uint32_t new_pos = 0;
@@ -141,13 +141,13 @@ long ZCALLBACK fseek_mem_func(voidpf opaque, voidpf stream, uint32_t offset, int
return 0;
}
int ZCALLBACK fclose_mem_func(voidpf opaque, voidpf stream)
int ZCALLBACK fclose_mem_func(ZIP_UNUSED voidpf opaque, ZIP_UNUSED voidpf stream)
{
/* Even with grow = 1, caller must always free() memory */
return 0;
}
int ZCALLBACK ferror_mem_func(voidpf opaque, voidpf stream)
int ZCALLBACK ferror_mem_func(ZIP_UNUSED voidpf opaque, ZIP_UNUSED voidpf stream)
{
/* We never return errors */
return 0;

View File

@@ -58,7 +58,7 @@ uint32_t get_file_date(const char *path, uint32_t *dos_date)
if (name[len - 1] == '/')
name[len - 1] = 0;
/* not all systems allow stat'ing a file with / appended */
/* Not all systems allow stat'ing a file with / appended */
if (stat(name, &s) == 0)
{
tm_t = s.st_mtime;
@@ -95,24 +95,11 @@ void change_file_date(const char *path, uint32_t dos_date)
#endif
}
// convertion without validation
void dosdate_to_raw_tm(uint64_t dos_date, struct tm *ptm)
{
uint64_t date = (uint64_t)(dos_date >> 16);
ptm->tm_mday = (uint16_t)(date & 0x1f);
ptm->tm_mon = (uint16_t)(((date & 0x1E0) / 0x20) - 1);
ptm->tm_year = (uint16_t)(((date & 0x0FE00) / 0x0200) + 1980);
ptm->tm_hour = (uint16_t)((dos_date & 0xF800) / 0x800);
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))
return (!datevalue_in_range(0, 11, ptm->tm_mon) ||
return (!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) ||
@@ -120,11 +107,26 @@ int invalid_date(const struct tm *ptm)
#undef datevalue_in_range
}
// Conversion without validation
void dosdate_to_raw_tm(uint64_t dos_date, struct tm *ptm)
{
uint64_t date = (uint64_t)(dos_date >> 16);
ptm->tm_mday = (uint16_t)(date & 0x1f);
ptm->tm_mon = (uint16_t)(((date & 0x1E0) / 0x20) - 1);
ptm->tm_year = (uint16_t)(((date & 0x0FE00) / 0x0200) + 80);
ptm->tm_hour = (uint16_t)((dos_date & 0xF800) / 0x800);
ptm->tm_min = (uint16_t)((dos_date & 0x7E0) / 0x20);
ptm->tm_sec = (uint16_t)(2 * (dos_date & 0x1f));
ptm->tm_isdst = -1;
}
int dosdate_to_tm(uint64_t dos_date, struct tm *ptm)
{
dosdate_to_raw_tm(dos_date, ptm);
if (invalid_date(ptm)) {
if (invalid_date(ptm))
{
// Invalid date stored, so don't return it.
memset(ptm, 0, sizeof(struct tm));
return -1;
@@ -132,46 +134,39 @@ int dosdate_to_tm(uint64_t dos_date, struct tm *ptm)
return 0;
}
uint32_t tm_to_dosdate(const struct tm *ptm)
{
uint32_t year = 0;
#define datevalue_in_range(min, max, value) ((min) <= (value) && (value) <= (max))
/* Years supported:
* [00, 79] (assumed to be between 2000 and 2079)
* [80, 207] (assumed to be between 1980 and 2107, typical output of old
software that does 'year-1900' to get a double digit year)
* [1980, 2107]
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)) ||
invalid_date(ptm))
{
return 0;
}
#undef datevalue_in_range
year = (uint32_t)ptm->tm_year;
if (year >= 1980) /* range [1980, 2107] */
year -= 1980;
else if (year >= 80) /* range [80, 99] */
year -= 80;
else /* range [00, 79] */
year += 20;
return (uint32_t)(((ptm->tm_mday) + (32 * (ptm->tm_mon + 1)) + (512 * year)) << 16) |
((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);
}
uint32_t tm_to_dosdate(const struct tm *ptm)
{
struct tm fixed_tm;
/* Years supported:
* [00, 79] (assumed to be between 2000 and 2079)
* [80, 207] (assumed to be between 1980 and 2107, typical output of old
software that does 'year-1900' to get a double digit year)
* [1980, 2107] (due to the date format limitations, only years between 1980 and 2107 can be stored.)
*/
memcpy(&fixed_tm, ptm, sizeof(struct tm));
if (fixed_tm.tm_year >= 1980) /* range [1980, 2107] */
fixed_tm.tm_year -= 1980;
else if (fixed_tm.tm_year >= 80) /* range [80, 99] */
fixed_tm.tm_year -= 80;
else /* range [00, 79] */
fixed_tm.tm_year += 20;
if (invalid_date(ptm))
return 0;
return (uint32_t)(((fixed_tm.tm_mday) + (32 * (fixed_tm.tm_mon + 1)) + (512 * fixed_tm.tm_year)) << 16) |
((fixed_tm.tm_sec / 2) + (32 * fixed_tm.tm_min) + (2048 * (uint32_t)fixed_tm.tm_hour));
}
int makedir(const char *newdir)
{
char *buffer = NULL;
@@ -225,9 +220,28 @@ int makedir(const char *newdir)
return 1;
}
FILE *get_file_handle(const char *path)
{
FILE *handle = NULL;
#if defined(WIN32)
wchar_t *pathWide = NULL;
int pathLength = 0;
pathLength = MultiByteToWideChar(CP_UTF8, 0, path, -1, NULL, 0) + 1;
pathWide = (wchar_t*)calloc(pathLength, sizeof(wchar_t));
MultiByteToWideChar(CP_UTF8, 0, path, -1, pathWide, pathLength);
handle = _wfopen((const wchar_t*)pathWide, L"rb");
free(pathWide);
#else
handle = fopen64(path, "rb");
#endif
return handle;
}
int check_file_exists(const char *path)
{
FILE* handle = fopen64(path, "rb");
FILE *handle = get_file_handle(path);
if (handle == NULL)
return 0;
fclose(handle);
@@ -236,9 +250,10 @@ int check_file_exists(const char *path)
int is_large_file(const char *path)
{
FILE* handle = NULL;
uint64_t pos = 0;
FILE* handle = fopen64(path, "rb");
handle = get_file_handle(path);
if (handle == NULL)
return 0;

View File

@@ -24,12 +24,12 @@ void change_file_date(const char *path, uint32_t dos_date);
/* Convert dos date/time format to struct tm */
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);
/* Convert struct tm to dos date/time format */
uint32_t tm_to_dosdate(const struct tm *ptm);
/* Create a directory and all subdirectories */
int makedir(const char *newdir);

View File

@@ -111,7 +111,7 @@ typedef struct
uint64_t total_out_64;
uint32_t crc32; /* crc32 of all data uncompressed */
uint32_t crc32_wait; /* crc32 we must obtain after decompress all */
uint32_t crc32_expected; /* crc32 we must obtain after decompress all */
uint64_t rest_read_compressed; /* number of byte to be decompressed */
uint64_t rest_read_uncompressed; /* number of byte to be obtained after decomp */
@@ -153,7 +153,7 @@ typedef struct
uint32_t keys[3]; /* keys defining the pseudo-random sequence */
const z_crc_t *pcrc_32_tab;
#endif
} unz64_s;
} unz64_internal;
/* Read a byte from a gz_stream; Return EOF for end of file. */
static int unzReadUInt8(const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, uint8_t *value)
@@ -252,19 +252,19 @@ static int unzReadUInt64(const zlib_filefunc64_32_def *pzlib_filefunc_def, voidp
}
/* Locate the Central directory of a zip file (at the end, just before the global comment) */
static uint64_t unzSearchCentralDir(const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream)
static int unzSearchCentralDir(const zlib_filefunc64_32_def *pzlib_filefunc_def, uint64_t *pos_found, voidpf filestream)
{
uint8_t buf[BUFREADCOMMENT + 4];
uint64_t file_size = 0;
uint64_t back_read = 4;
uint64_t max_back = UINT16_MAX; /* maximum size of global comment */
uint64_t pos_found = 0;
uint32_t read_size = 0;
uint64_t read_pos = 0;
uint32_t i = 0;
*pos_found = 0;
if (ZSEEK64(*pzlib_filefunc_def, filestream, 0, ZLIB_FILEFUNC_SEEK_END) != 0)
return 0;
return UNZ_ERRNO;
file_size = ZTELL64(*pzlib_filefunc_def, filestream);
@@ -293,58 +293,55 @@ static uint64_t unzSearchCentralDir(const zlib_filefunc64_32_def *pzlib_filefunc
((*(buf+i+2)) == (ENDHEADERMAGIC >> 16 & 0xff)) &&
((*(buf+i+3)) == (ENDHEADERMAGIC >> 24 & 0xff)))
{
pos_found = read_pos+i;
break;
*pos_found = read_pos+i;
return UNZ_OK;
}
if (pos_found != 0)
break;
}
return pos_found;
return UNZ_ERRNO;
}
/* Locate the Central directory 64 of a zipfile (at the end, just before the global comment) */
static uint64_t unzSearchCentralDir64(const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream,
static int unzSearchCentralDir64(const zlib_filefunc64_32_def *pzlib_filefunc_def, uint64_t *offset, voidpf filestream,
const uint64_t endcentraloffset)
{
uint64_t offset = 0;
uint32_t value32 = 0;
*offset = 0;
/* Zip64 end of central directory locator */
if (ZSEEK64(*pzlib_filefunc_def, filestream, endcentraloffset - SIZECENTRALHEADERLOCATOR, ZLIB_FILEFUNC_SEEK_SET) != 0)
return 0;
return UNZ_ERRNO;
/* Read locator signature */
if (unzReadUInt32(pzlib_filefunc_def, filestream, &value32) != UNZ_OK)
return 0;
return UNZ_ERRNO;
if (value32 != ZIP64ENDLOCHEADERMAGIC)
return 0;
return UNZ_ERRNO;
/* Number of the disk with the start of the zip64 end of central directory */
if (unzReadUInt32(pzlib_filefunc_def, filestream, &value32) != UNZ_OK)
return 0;
return UNZ_ERRNO;
/* Relative offset of the zip64 end of central directory record */
if (unzReadUInt64(pzlib_filefunc_def, filestream, &offset) != UNZ_OK)
return 0;
if (unzReadUInt64(pzlib_filefunc_def, filestream, offset) != UNZ_OK)
return UNZ_ERRNO;
/* Total number of disks */
if (unzReadUInt32(pzlib_filefunc_def, filestream, &value32) != UNZ_OK)
return 0;
return UNZ_ERRNO;
/* Goto end of central directory record */
if (ZSEEK64(*pzlib_filefunc_def, filestream, offset, ZLIB_FILEFUNC_SEEK_SET) != 0)
return 0;
if (ZSEEK64(*pzlib_filefunc_def, filestream, *offset, ZLIB_FILEFUNC_SEEK_SET) != 0)
return UNZ_ERRNO;
/* The signature */
if (unzReadUInt32(pzlib_filefunc_def, filestream, &value32) != UNZ_OK)
return 0;
return UNZ_ERRNO;
if (value32 != ZIP64ENDHEADERMAGIC)
return 0;
return UNZ_ERRNO;
return offset;
return UNZ_OK;
}
static unzFile unzOpenInternal(const void *path, zlib_filefunc64_32_def *pzlib_filefunc64_32_def)
{
unz64_s us;
unz64_s *s = NULL;
unz64_internal us;
unz64_internal *s = NULL;
uint64_t central_pos = 0;
uint64_t central_pos64 = 0;
uint64_t number_entry_CD = 0;
@@ -373,8 +370,8 @@ static unzFile unzOpenInternal(const void *path, zlib_filefunc64_32_def *pzlib_f
us.is_zip64 = 0;
/* Search for end of central directory header */
central_pos = unzSearchCentralDir(&us.z_filefunc, us.filestream);
if (central_pos)
err = unzSearchCentralDir(&us.z_filefunc, &central_pos, us.filestream);
if (err == UNZ_OK)
{
if (ZSEEK64(us.z_filefunc, us.filestream, central_pos, ZLIB_FILEFUNC_SEEK_SET) != 0)
err = UNZ_ERRNO;
@@ -415,8 +412,8 @@ static unzFile unzOpenInternal(const void *path, zlib_filefunc64_32_def *pzlib_f
if (err == UNZ_OK)
{
/* Search for Zip64 end of central directory header */
central_pos64 = unzSearchCentralDir64(&us.z_filefunc, us.filestream, central_pos);
if (central_pos64)
int err64 = unzSearchCentralDir64(&us.z_filefunc, &central_pos64, us.filestream, central_pos);
if (err64 == UNZ_OK)
{
central_pos = central_pos64;
us.is_zip64 = 1;
@@ -490,7 +487,7 @@ static unzFile unzOpenInternal(const void *path, zlib_filefunc64_32_def *pzlib_f
us.central_pos = central_pos;
us.pfile_in_zip_read = NULL;
s = (unz64_s*)ALLOC(sizeof(unz64_s));
s = (unz64_internal*)ALLOC(sizeof(unz64_internal));
if (s != NULL)
{
*s = us;
@@ -535,10 +532,10 @@ extern unzFile ZEXPORT unzOpen64(const void *path)
extern int ZEXPORT unzClose(unzFile file)
{
unz64_s *s;
unz64_internal *s;
if (file == NULL)
return UNZ_PARAMERROR;
s = (unz64_s*)file;
s = (unz64_internal*)file;
if (s->pfile_in_zip_read != NULL)
unzCloseCurrentFile(file);
@@ -557,10 +554,10 @@ extern int ZEXPORT unzClose(unzFile file)
/* Goto to the next available disk for spanned archives */
static int unzGoToNextDisk(unzFile file)
{
unz64_s *s;
unz64_internal *s;
uint32_t number_disk_next = 0;
s = (unz64_s*)file;
s = (unz64_internal*)file;
if (s == NULL)
return UNZ_PARAMERROR;
number_disk_next = s->number_disk;
@@ -599,10 +596,10 @@ static int unzGoToNextDisk(unzFile file)
extern int ZEXPORT unzGetGlobalInfo(unzFile file, unz_global_info* pglobal_info32)
{
unz64_s *s = NULL;
unz64_internal *s = NULL;
if (file == NULL)
return UNZ_PARAMERROR;
s = (unz64_s*)file;
s = (unz64_internal*)file;
pglobal_info32->number_entry = (uint32_t)s->gi.number_entry;
pglobal_info32->size_comment = s->gi.size_comment;
@@ -612,21 +609,21 @@ extern int ZEXPORT unzGetGlobalInfo(unzFile file, unz_global_info* pglobal_info3
extern int ZEXPORT unzGetGlobalInfo64(unzFile file, unz_global_info64 *pglobal_info)
{
unz64_s *s = NULL;
unz64_internal *s = NULL;
if (file == NULL)
return UNZ_PARAMERROR;
s = (unz64_s*)file;
s = (unz64_internal*)file;
*pglobal_info = s->gi;
return UNZ_OK;
}
extern int ZEXPORT unzGetGlobalComment(unzFile file, char *comment, uint16_t comment_size)
{
unz64_s *s = NULL;
unz64_internal *s = NULL;
uint16_t bytes_to_read = comment_size;
if (file == NULL)
return (int)UNZ_PARAMERROR;
s = (unz64_s*)file;
s = (unz64_internal*)file;
if (bytes_to_read > s->gi.size_comment)
bytes_to_read = s->gi.size_comment;
@@ -649,13 +646,13 @@ extern int ZEXPORT unzGetGlobalComment(unzFile file, char *comment, uint16_t com
static int unzGetCurrentFileInfoField(unzFile file, uint32_t *seek, void *field, uint16_t field_size, uint16_t size_file_field, int null_terminated_field)
{
unz64_s *s = NULL;
unz64_internal *s = NULL;
uint32_t bytes_to_read = 0;
int err = UNZ_OK;
if (file == NULL)
return (int)UNZ_PARAMERROR;
s = (unz64_s*)file;
s = (unz64_internal*)file;
/* Read field */
if (field != NULL)
@@ -698,7 +695,7 @@ static int unzGetCurrentFileInfoInternal(unzFile file, unz_file_info64 *pfile_in
unz_file_info64_internal *pfile_info_internal, char *filename, uint16_t filename_size, void *extrafield,
uint16_t extrafield_size, char *comment, uint16_t comment_size)
{
unz64_s *s = NULL;
unz64_internal *s = NULL;
unz_file_info64 file_info;
unz_file_info64_internal file_info_internal;
uint32_t magic = 0;
@@ -714,7 +711,7 @@ static int unzGetCurrentFileInfoInternal(unzFile file, unz_file_info64 *pfile_in
if (file == NULL)
return UNZ_PARAMERROR;
s = (unz64_s*)file;
s = (unz64_internal*)file;
if (ZSEEK64(s->z_filefunc, s->filestream_with_CD,
s->pos_in_central_dir + s->byte_before_the_zipfile, ZLIB_FILEFUNC_SEEK_SET) != 0)
@@ -938,7 +935,7 @@ extern int ZEXPORT unzGetCurrentFileInfo64(unzFile file, unz_file_info64 * pfile
/* Read the local header of the current zipfile. Check the coherency of the local header and info in the
end of central directory about this file store in *piSizeVar the size of extra info in local header
(filename and size of extra field data) */
static int unzCheckCurrentFileCoherencyHeader(unz64_s *s, uint32_t *psize_variable, uint64_t *poffset_local_extrafield,
static int unzCheckCurrentFileCoherencyHeader(unz64_internal *s, uint32_t *psize_variable, uint64_t *poffset_local_extrafield,
uint16_t *psize_local_extrafield)
{
uint32_t magic = 0;
@@ -1016,8 +1013,6 @@ static int unzCheckCurrentFileCoherencyHeader(unz64_s *s, uint32_t *psize_variab
err = UNZ_BADZIPFILE;
if (unzReadUInt16(&s->z_filefunc, s->filestream, &size_filename) != UNZ_OK)
err = UNZ_ERRNO;
else if ((err == UNZ_OK) && (size_filename != s->cur_file_info.size_filename))
err = UNZ_BADZIPFILE;
*psize_variable += size_filename;
@@ -1037,7 +1032,7 @@ static int unzCheckCurrentFileCoherencyHeader(unz64_s *s, uint32_t *psize_variab
*/
extern int ZEXPORT unzOpenCurrentFile3(unzFile file, int *method, int *level, int raw, const char *password)
{
unz64_s *s = NULL;
unz64_internal *s = NULL;
file_in_zip64_read_info_s *pfile_in_zip_read_info = NULL;
uint16_t compression_method = 0;
uint64_t offset_local_extrafield = 0;
@@ -1052,7 +1047,7 @@ extern int ZEXPORT unzOpenCurrentFile3(unzFile file, int *method, int *level, in
#endif
if (file == NULL)
return UNZ_PARAMERROR;
s = (unz64_s*)file;
s = (unz64_internal*)file;
if (!s->current_file_ok)
return UNZ_PARAMERROR;
@@ -1061,25 +1056,7 @@ extern int ZEXPORT unzOpenCurrentFile3(unzFile file, int *method, int *level, in
if (unzCheckCurrentFileCoherencyHeader(s, &size_variable, &offset_local_extrafield, &size_local_extrafield) != UNZ_OK)
return UNZ_BADZIPFILE;
pfile_in_zip_read_info = (file_in_zip64_read_info_s*)ALLOC(sizeof(file_in_zip64_read_info_s));
if (pfile_in_zip_read_info == NULL)
return UNZ_INTERNALERROR;
pfile_in_zip_read_info->read_buffer = (uint8_t*)ALLOC(UNZ_BUFSIZE);
pfile_in_zip_read_info->offset_local_extrafield = offset_local_extrafield;
pfile_in_zip_read_info->size_local_extrafield = size_local_extrafield;
pfile_in_zip_read_info->pos_local_extrafield = 0;
pfile_in_zip_read_info->raw = raw;
if (pfile_in_zip_read_info->read_buffer == NULL)
{
TRYFREE(pfile_in_zip_read_info);
return UNZ_INTERNALERROR;
}
pfile_in_zip_read_info->stream_initialised = 0;
compression_method = s->cur_file_info.compression_method;
#ifdef HAVE_AES
if (compression_method == AES_METHOD)
@@ -1087,7 +1064,6 @@ extern int ZEXPORT unzOpenCurrentFile3(unzFile file, int *method, int *level, in
compression_method = s->cur_file_info_internal.aes_compression_method;
if (password == NULL)
{
TRYFREE(pfile_in_zip_read_info);
return UNZ_PARAMERROR;
}
}
@@ -1113,24 +1089,52 @@ extern int ZEXPORT unzOpenCurrentFile3(unzFile file, int *method, int *level, in
if (compression_method != Z_BZIP2ED)
#endif
{
TRYFREE(pfile_in_zip_read_info);
return UNZ_BADZIPFILE;
}
}
pfile_in_zip_read_info = (file_in_zip64_read_info_s*)ALLOC(sizeof(file_in_zip64_read_info_s));
if (pfile_in_zip_read_info == NULL)
return UNZ_INTERNALERROR;
pfile_in_zip_read_info->read_buffer = (uint8_t*)ALLOC(UNZ_BUFSIZE);
if (pfile_in_zip_read_info->read_buffer == NULL)
{
TRYFREE(pfile_in_zip_read_info);
return UNZ_INTERNALERROR;
}
pfile_in_zip_read_info->stream_initialised = 0;
pfile_in_zip_read_info->crc32_wait = s->cur_file_info.crc;
pfile_in_zip_read_info->crc32 = 0;
pfile_in_zip_read_info->total_out_64 = 0;
pfile_in_zip_read_info->compression_method = compression_method;
pfile_in_zip_read_info->filestream = s->filestream;
pfile_in_zip_read_info->z_filefunc = s->z_filefunc;
pfile_in_zip_read_info->raw = raw;
pfile_in_zip_read_info->crc32 = 0;
pfile_in_zip_read_info->crc32_expected = s->cur_file_info.crc;
pfile_in_zip_read_info->total_out_64 = 0;
pfile_in_zip_read_info->compression_method = compression_method;
pfile_in_zip_read_info->offset_local_extrafield = offset_local_extrafield;
pfile_in_zip_read_info->size_local_extrafield = size_local_extrafield;
pfile_in_zip_read_info->pos_local_extrafield = 0;
pfile_in_zip_read_info->rest_read_compressed = s->cur_file_info.compressed_size;
pfile_in_zip_read_info->rest_read_uncompressed = s->cur_file_info.uncompressed_size;
pfile_in_zip_read_info->byte_before_the_zipfile = 0;
if (s->number_disk == s->gi.number_disk_with_CD)
pfile_in_zip_read_info->byte_before_the_zipfile = s->byte_before_the_zipfile;
else
pfile_in_zip_read_info->byte_before_the_zipfile = 0;
pfile_in_zip_read_info->pos_in_zipfile = s->cur_file_info_internal.offset_curfile + SIZEZIPLOCALHEADER + size_variable;
pfile_in_zip_read_info->stream.zalloc = (alloc_func)0;
pfile_in_zip_read_info->stream.zfree = (free_func)0;
pfile_in_zip_read_info->stream.opaque = (voidpf)s;
pfile_in_zip_read_info->stream.total_out = 0;
pfile_in_zip_read_info->stream.total_in = 0;
pfile_in_zip_read_info->stream.next_in = NULL;
pfile_in_zip_read_info->stream.avail_in = 0;
if (!raw)
{
@@ -1142,12 +1146,6 @@ extern int ZEXPORT unzOpenCurrentFile3(unzFile file, int *method, int *level, in
pfile_in_zip_read_info->bstream.opaque = (voidpf)0;
pfile_in_zip_read_info->bstream.state = (voidpf)0;
pfile_in_zip_read_info->stream.zalloc = (alloc_func)0;
pfile_in_zip_read_info->stream.zfree = (free_func)0;
pfile_in_zip_read_info->stream.opaque = (voidpf)0;
pfile_in_zip_read_info->stream.next_in = (voidpf)0;
pfile_in_zip_read_info->stream.avail_in = 0;
err = BZ2_bzDecompressInit(&pfile_in_zip_read_info->bstream, 0, 0);
if (err == Z_OK)
{
@@ -1164,12 +1162,6 @@ extern int ZEXPORT unzOpenCurrentFile3(unzFile file, int *method, int *level, in
}
else if (compression_method == Z_DEFLATED)
{
pfile_in_zip_read_info->stream.zalloc = (alloc_func)0;
pfile_in_zip_read_info->stream.zfree = (free_func)0;
pfile_in_zip_read_info->stream.opaque = (voidpf)s;
pfile_in_zip_read_info->stream.next_in = 0;
pfile_in_zip_read_info->stream.avail_in = 0;
#ifdef HAVE_APPLE_COMPRESSION
err = compression_stream_init(&pfile_in_zip_read_info->astream, COMPRESSION_STREAM_DECODE, COMPRESSION_ZLIB);
if (err == COMPRESSION_STATUS_ERROR)
@@ -1198,11 +1190,6 @@ extern int ZEXPORT unzOpenCurrentFile3(unzFile file, int *method, int *level, in
}
}
pfile_in_zip_read_info->rest_read_compressed = s->cur_file_info.compressed_size;
pfile_in_zip_read_info->rest_read_uncompressed = s->cur_file_info.uncompressed_size;
pfile_in_zip_read_info->pos_in_zipfile = s->cur_file_info_internal.offset_curfile + SIZEZIPLOCALHEADER + size_variable;
pfile_in_zip_read_info->stream.avail_in = 0;
s->pfile_in_zip_read = pfile_in_zip_read_info;
#ifndef NOUNCRYPT
@@ -1290,13 +1277,13 @@ extern int ZEXPORT unzOpenCurrentFile2(unzFile file, int *method, int *level, in
return <0 with error code if there is an error (UNZ_ERRNO for IO error, or zLib error for uncompress error) */
extern int ZEXPORT unzReadCurrentFile(unzFile file, voidp buf, uint32_t len)
{
unz64_s *s = NULL;
unz64_internal *s = NULL;
uint32_t read = 0;
int err = UNZ_OK;
if (file == NULL)
return UNZ_PARAMERROR;
s = (unz64_s*)file;
s = (unz64_internal*)file;
if (s->pfile_in_zip_read == NULL)
return UNZ_PARAMERROR;
@@ -1310,16 +1297,11 @@ extern int ZEXPORT unzReadCurrentFile(unzFile file, voidp buf, uint32_t len)
s->pfile_in_zip_read->stream.next_out = (uint8_t*)buf;
s->pfile_in_zip_read->stream.avail_out = (uint16_t)len;
if (s->pfile_in_zip_read->raw)
if ((s->pfile_in_zip_read->compression_method == 0) || (s->pfile_in_zip_read->raw))
{
if (len > s->pfile_in_zip_read->rest_read_compressed + s->pfile_in_zip_read->stream.avail_in)
s->pfile_in_zip_read->stream.avail_out = (uint16_t)s->pfile_in_zip_read->rest_read_compressed +
s->pfile_in_zip_read->stream.avail_in;
}
else
{
if (len > s->pfile_in_zip_read->rest_read_uncompressed)
s->pfile_in_zip_read->stream.avail_out = (uint16_t)s->pfile_in_zip_read->rest_read_uncompressed;
s->pfile_in_zip_read->stream.avail_in;
}
do
@@ -1569,13 +1551,13 @@ extern int ZEXPORT unzReadCurrentFile(unzFile file, voidp buf, uint32_t len)
extern int ZEXPORT unzGetLocalExtrafield(unzFile file, voidp buf, uint32_t len)
{
unz64_s *s = NULL;
unz64_internal *s = NULL;
uint64_t size_to_read = 0;
uint32_t read_now = 0;
if (file == NULL)
return UNZ_PARAMERROR;
s = (unz64_s*)file;
s = (unz64_internal*)file;
if (s->pfile_in_zip_read == NULL)
return UNZ_PARAMERROR;
@@ -1605,13 +1587,13 @@ extern int ZEXPORT unzGetLocalExtrafield(unzFile file, voidp buf, uint32_t len)
extern int ZEXPORT unzCloseCurrentFile(unzFile file)
{
unz64_s *s = NULL;
unz64_internal *s = NULL;
file_in_zip64_read_info_s *pfile_in_zip_read_info = NULL;
int err = UNZ_OK;
if (file == NULL)
return UNZ_PARAMERROR;
s = (unz64_s*)file;
s = (unz64_internal*)file;
pfile_in_zip_read_info = s->pfile_in_zip_read;
if (pfile_in_zip_read_info == NULL)
return UNZ_PARAMERROR;
@@ -1638,7 +1620,7 @@ extern int ZEXPORT unzCloseCurrentFile(unzFile file)
if ((pfile_in_zip_read_info->rest_read_uncompressed == 0) &&
(!pfile_in_zip_read_info->raw))
{
if (pfile_in_zip_read_info->crc32 != pfile_in_zip_read_info->crc32_wait)
if (pfile_in_zip_read_info->crc32 != pfile_in_zip_read_info->crc32_expected)
err = UNZ_CRCERROR;
}
}
@@ -1671,12 +1653,15 @@ extern int ZEXPORT unzCloseCurrentFile(unzFile file)
extern int ZEXPORT unzGoToFirstFile2(unzFile file, unz_file_info64 *pfile_info, char *filename,
uint16_t filename_size, void *extrafield, uint16_t extrafield_size, char *comment, uint16_t comment_size)
{
unz64_s *s = NULL;
unz64_internal *s = NULL;
int err = UNZ_OK;
if (file == NULL)
return UNZ_PARAMERROR;
s = (unz64_s*)file;
s = (unz64_internal*)file;
if (s->gi.number_entry == 0)
return UNZ_END_OF_LIST_OF_FILE;
s->pos_in_central_dir = s->offset_central_dir;
s->num_file = 0;
@@ -1699,12 +1684,12 @@ extern int ZEXPORT unzGoToFirstFile(unzFile file)
extern int ZEXPORT unzGoToNextFile2(unzFile file, unz_file_info64 *pfile_info, char *filename,
uint16_t filename_size, void *extrafield, uint16_t extrafield_size, char *comment, uint16_t comment_size)
{
unz64_s *s = NULL;
unz64_internal *s = NULL;
int err = UNZ_OK;
if (file == NULL)
return UNZ_PARAMERROR;
s = (unz64_s*)file;
s = (unz64_internal*)file;
if (!s->current_file_ok)
return UNZ_END_OF_LIST_OF_FILE;
@@ -1735,7 +1720,7 @@ extern int ZEXPORT unzGoToNextFile(unzFile file)
extern int ZEXPORT unzLocateFile(unzFile file, const char *filename, unzFileNameComparer filename_compare_func)
{
unz64_s *s = NULL;
unz64_internal *s = NULL;
unz_file_info64 cur_file_info_saved;
unz_file_info64_internal cur_file_info_internal_saved;
uint64_t num_file_saved = 0;
@@ -1747,7 +1732,7 @@ extern int ZEXPORT unzLocateFile(unzFile file, const char *filename, unzFileName
return UNZ_PARAMERROR;
if (strlen(filename) >= UNZ_MAXFILENAMEINZIP)
return UNZ_PARAMERROR;
s = (unz64_s*)file;
s = (unz64_internal*)file;
if (!s->current_file_ok)
return UNZ_END_OF_LIST_OF_FILE;
@@ -1802,11 +1787,11 @@ extern int ZEXPORT unzGoToFilePos(unzFile file, unz_file_pos *file_pos)
extern int ZEXPORT unzGetFilePos64(unzFile file, unz64_file_pos *file_pos)
{
unz64_s *s = NULL;
unz64_internal *s = NULL;
if (file == NULL || file_pos == NULL)
return UNZ_PARAMERROR;
s = (unz64_s*)file;
s = (unz64_internal*)file;
if (!s->current_file_ok)
return UNZ_END_OF_LIST_OF_FILE;
@@ -1817,12 +1802,12 @@ extern int ZEXPORT unzGetFilePos64(unzFile file, unz64_file_pos *file_pos)
extern int ZEXPORT unzGoToFilePos64(unzFile file, const unz64_file_pos *file_pos)
{
unz64_s *s = NULL;
unz64_internal *s = NULL;
int err = UNZ_OK;
if (file == NULL || file_pos == NULL)
return UNZ_PARAMERROR;
s = (unz64_s*)file;
s = (unz64_internal*)file;
/* Jump to the right spot */
s->pos_in_central_dir = file_pos->pos_in_zip_directory;
@@ -1847,11 +1832,11 @@ extern int32_t ZEXPORT unzGetOffset(unzFile file)
extern int64_t ZEXPORT unzGetOffset64(unzFile file)
{
unz64_s *s = NULL;
unz64_internal *s = NULL;
if (file == NULL)
return UNZ_PARAMERROR;
s = (unz64_s*)file;
s = (unz64_internal*)file;
if (!s->current_file_ok)
return 0;
if (s->gi.number_entry != 0 && s->gi.number_entry != UINT16_MAX)
@@ -1869,12 +1854,12 @@ extern int ZEXPORT unzSetOffset(unzFile file, uint32_t pos)
extern int ZEXPORT unzSetOffset64(unzFile file, uint64_t pos)
{
unz64_s *s = NULL;
unz64_internal *s = NULL;
int err = UNZ_OK;
if (file == NULL)
return UNZ_PARAMERROR;
s = (unz64_s*)file;
s = (unz64_internal*)file;
s->pos_in_central_dir = pos;
s->num_file = s->gi.number_entry; /* hack */
@@ -1886,10 +1871,10 @@ extern int ZEXPORT unzSetOffset64(unzFile file, uint64_t pos)
extern int32_t ZEXPORT unzTell(unzFile file)
{
unz64_s *s = NULL;
unz64_internal *s = NULL;
if (file == NULL)
return UNZ_PARAMERROR;
s = (unz64_s*)file;
s = (unz64_internal*)file;
if (s->pfile_in_zip_read == NULL)
return UNZ_PARAMERROR;
return (int32_t)s->pfile_in_zip_read->stream.total_out;
@@ -1897,10 +1882,10 @@ extern int32_t ZEXPORT unzTell(unzFile file)
extern int64_t ZEXPORT unzTell64(unzFile file)
{
unz64_s *s = NULL;
unz64_internal *s = NULL;
if (file == NULL)
return UNZ_PARAMERROR;
s = (unz64_s*)file;
s = (unz64_internal*)file;
if (s->pfile_in_zip_read == NULL)
return UNZ_PARAMERROR;
return s->pfile_in_zip_read->total_out_64;
@@ -1913,7 +1898,7 @@ extern int ZEXPORT unzSeek(unzFile file, uint32_t offset, int origin)
extern int ZEXPORT unzSeek64(unzFile file, uint64_t offset, int origin)
{
unz64_s *s = NULL;
unz64_internal *s = NULL;
uint64_t stream_pos_begin = 0;
uint64_t stream_pos_end = 0;
uint64_t position = 0;
@@ -1921,7 +1906,7 @@ extern int ZEXPORT unzSeek64(unzFile file, uint64_t offset, int origin)
if (file == NULL)
return UNZ_PARAMERROR;
s = (unz64_s*)file;
s = (unz64_internal*)file;
if (s->pfile_in_zip_read == NULL)
return UNZ_ERRNO;
@@ -1976,10 +1961,10 @@ extern int ZEXPORT unzSeek64(unzFile file, uint64_t offset, int origin)
extern int ZEXPORT unzEndOfFile(unzFile file)
{
unz64_s *s = NULL;
unz64_internal *s = NULL;
if (file == NULL)
return UNZ_PARAMERROR;
s = (unz64_s*)file;
s = (unz64_internal*)file;
if (s->pfile_in_zip_read == NULL)
return UNZ_PARAMERROR;
if (s->pfile_in_zip_read->rest_read_uncompressed == 0)

File diff suppressed because it is too large Load Diff

View File

@@ -53,12 +53,6 @@ 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
@@ -172,6 +166,26 @@ extern int ZEXPORT zipOpenNewFileInZip4_64(zipFile file, const char *filename, c
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 zipOpenNewFileInZip5(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 flag_base,
int zip64,
uint16_t method,
int level,
int raw,
int windowBits,
int memLevel,
int strategy,
const char *password,
int aes);
/* Allowing optional aes */
extern int ZEXPORT zipWriteInFileInZip(zipFile file, const void *buf, uint32_t len);
/* Write data in the zipfile */

View File

@@ -1,5 +1,5 @@
PODS:
- SSZipArchive (2.0.7)
- SSZipArchive (2.1.0)
DEPENDENCIES:
- SSZipArchive (from `..`)
@@ -9,7 +9,7 @@ EXTERNAL SOURCES:
:path: ..
SPEC CHECKSUMS:
SSZipArchive: 8c197761d66bd33e7f8b5b51ee57dff303971150
SSZipArchive: 1e8e53dcb11bca3ded4738958dc49fc467320a14
PODFILE CHECKSUM: 0dc500eb72745751ccba7677de4da5534fcef36d

View File

@@ -412,7 +412,7 @@
INFOPLIST_FILE = SwiftExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_SWIFT_FLAGS = "-DUseCarthage";
PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.SwiftExample;
PRODUCT_BUNDLE_IDENTIFIER = com.ziparchive.SwiftExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
@@ -429,7 +429,7 @@
INFOPLIST_FILE = SwiftExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_SWIFT_FLAGS = "-DUseCarthage";
PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.SwiftExample;
PRODUCT_BUNDLE_IDENTIFIER = com.ziparchive.SwiftExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
@@ -462,6 +462,8 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_ACTIVITY_MODE = "";
"DEBUG_ACTIVITY_MODE[sdk=iphonesimulator*]" = default;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
@@ -479,7 +481,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;
@@ -515,6 +517,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_ACTIVITY_MODE = "";
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
@@ -526,7 +529,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;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
@@ -542,7 +545,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = SwiftExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.SwiftExample;
PRODUCT_BUNDLE_IDENTIFIER = com.ziparchive.SwiftExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
@@ -555,7 +558,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = SwiftExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.SwiftExample;
PRODUCT_BUNDLE_IDENTIFIER = com.ziparchive.SwiftExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
@@ -567,7 +570,7 @@
BUNDLE_LOADER = "$(TEST_HOST)";
INFOPLIST_FILE = SwiftExampleTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.SwiftExampleTests;
PRODUCT_BUNDLE_IDENTIFIER = com.ziparchive.SwiftExampleTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwiftExample.app/SwiftExample";
@@ -580,7 +583,7 @@
BUNDLE_LOADER = "$(TEST_HOST)";
INFOPLIST_FILE = SwiftExampleTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.SwiftExampleTests;
PRODUCT_BUNDLE_IDENTIFIER = com.ziparchive.SwiftExampleTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwiftExample.app/SwiftExample";

View File

@@ -0,0 +1,110 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8DFE19081BDA74F800709011"
BuildableName = "SwiftExample.app"
BlueprintName = "SwiftExample"
ReferencedContainer = "container:SwiftExample.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8DFE191C1BDA74F800709011"
BuildableName = "SwiftExampleTests.xctest"
BlueprintName = "SwiftExampleTests"
ReferencedContainer = "container:SwiftExample.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8DFE19081BDA74F800709011"
BuildableName = "SwiftExample.app"
BlueprintName = "SwiftExample"
ReferencedContainer = "container:SwiftExample.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8DFE19081BDA74F800709011"
BuildableName = "SwiftExample.app"
BlueprintName = "SwiftExample"
ReferencedContainer = "container:SwiftExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<EnvironmentVariables>
<EnvironmentVariable
key = "OS_ACTIVITY_MODE"
value = "${DEBUG_ACTIVITY_MODE}"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8DFE19081BDA74F800709011"
BuildableName = "SwiftExample.app"
BlueprintName = "SwiftExample"
ReferencedContainer = "container:SwiftExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2B4B24641C21500E00CC99E5"
BuildableName = "SwiftExampleCarthage.app"
BlueprintName = "SwiftExampleCarthage"
ReferencedContainer = "container:SwiftExample.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2B4B24641C21500E00CC99E5"
BuildableName = "SwiftExampleCarthage.app"
BlueprintName = "SwiftExampleCarthage"
ReferencedContainer = "container:SwiftExample.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2B4B24641C21500E00CC99E5"
BuildableName = "SwiftExampleCarthage.app"
BlueprintName = "SwiftExampleCarthage"
ReferencedContainer = "container:SwiftExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2B4B24641C21500E00CC99E5"
BuildableName = "SwiftExampleCarthage.app"
BlueprintName = "SwiftExampleCarthage"
ReferencedContainer = "container:SwiftExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@@ -1,5 +1,15 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "29x29",
@@ -30,6 +40,16 @@
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "29x29",
@@ -59,6 +79,11 @@
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
}
],
"info" : {

View File

@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="16D32" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina5_5" orientation="portrait">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13196" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina3_5" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13173"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
@@ -19,50 +19,50 @@
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="414" height="736"/>
<rect key="frame" x="0.0" y="0.0" width="320" height="480"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="password" textAlignment="natural" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="Tal-c0-sro">
<rect key="frame" x="166" y="13" width="83" height="30"/>
<rect key="frame" x="118.5" y="46" width="83" height="30"/>
<nil key="textColor"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Uwd-kM-cdh">
<rect key="frame" x="150.66666666666669" y="51" width="113.00000000000006" height="30"/>
<rect key="frame" x="103.5" y="84" width="113" height="30"/>
<state key="normal" title="Zip Sample Data"/>
<connections>
<action selector="zipPressed:" destination="BYZ-38-t0r" eventType="touchUpInside" id="dQS-RP-2Yl"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="XUJ-IR-RIS">
<rect key="frame" x="141.66666666666669" y="89" width="131.00000000000006" height="30"/>
<rect key="frame" x="94.5" y="122" width="131" height="30"/>
<state key="normal" title="Unzip Sample Data"/>
<connections>
<action selector="unzipPressed:" destination="BYZ-38-t0r" eventType="touchUpInside" id="gGR-nU-aS3"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Lbq-oS-Rlj">
<rect key="frame" x="187.66666666666666" y="212.66666666666666" width="39" height="30"/>
<rect key="frame" x="140.5" y="245" width="39" height="30"/>
<state key="normal" title="Reset"/>
<connections>
<action selector="resetPressed:" destination="BYZ-38-t0r" eventType="touchUpInside" id="n8G-qy-egF"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="09F-6Q-slx" userLabel="File1">
<rect key="frame" x="67" y="126.99999999999999" width="294" height="20.666666666666643"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="File1" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="09F-6Q-slx" userLabel="File1">
<rect key="frame" x="16" y="160" width="288" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="PSK-Jd-Mwc" userLabel="File2">
<rect key="frame" x="67" y="155.66666666666663" width="294" height="20.333333333333343"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="File2" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="PSK-Jd-Mwc" userLabel="File2">
<rect key="frame" x="16" y="188" width="288" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="pW5-rw-iqM" userLabel="File3">
<rect key="frame" x="67" y="184" width="294" height="20.666666666666657"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="File3" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="pW5-rw-iqM" userLabel="File3">
<rect key="frame" x="16" y="217" width="288" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
@@ -70,21 +70,21 @@
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="trailingMargin" secondItem="09F-6Q-slx" secondAttribute="trailing" constant="33" id="3S4-8t-aQA"/>
<constraint firstAttribute="trailingMargin" secondItem="09F-6Q-slx" secondAttribute="trailing" id="3S4-8t-aQA"/>
<constraint firstItem="XUJ-IR-RIS" firstAttribute="centerX" secondItem="Lbq-oS-Rlj" secondAttribute="centerX" id="AYF-iB-SJU"/>
<constraint firstItem="Uwd-kM-cdh" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="CTF-Hv-dt4"/>
<constraint firstItem="Tal-c0-sro" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="Czk-W6-E7s"/>
<constraint firstItem="XUJ-IR-RIS" firstAttribute="top" secondItem="Uwd-kM-cdh" secondAttribute="bottom" constant="8" symbolic="YES" id="OIr-Yf-tdY"/>
<constraint firstItem="09F-6Q-slx" firstAttribute="trailing" secondItem="PSK-Jd-Mwc" secondAttribute="trailing" id="TGC-ob-dm0"/>
<constraint firstItem="Uwd-kM-cdh" firstAttribute="top" secondItem="Tal-c0-sro" secondAttribute="bottom" constant="8" symbolic="YES" id="Udb-33-mrs"/>
<constraint firstItem="Uwd-kM-cdh" firstAttribute="top" secondItem="y3c-jy-aDJ" secondAttribute="bottom" constant="31" id="Uh0-R8-WFe"/>
<constraint firstItem="pW5-rw-iqM" firstAttribute="top" secondItem="PSK-Jd-Mwc" secondAttribute="bottom" constant="8" symbolic="YES" id="VfM-Vg-Yai"/>
<constraint firstItem="09F-6Q-slx" firstAttribute="top" secondItem="XUJ-IR-RIS" secondAttribute="bottom" constant="8" symbolic="YES" id="Wpv-VU-gb1"/>
<constraint firstItem="Uwd-kM-cdh" firstAttribute="centerX" secondItem="XUJ-IR-RIS" secondAttribute="centerX" id="dW9-nF-tLe"/>
<constraint firstItem="PSK-Jd-Mwc" firstAttribute="leading" secondItem="pW5-rw-iqM" secondAttribute="leading" id="eJr-2x-5k4"/>
<constraint firstItem="Tal-c0-sro" firstAttribute="top" secondItem="y3c-jy-aDJ" secondAttribute="bottom" constant="26" id="nXL-ng-YDN"/>
<constraint firstItem="09F-6Q-slx" firstAttribute="leading" secondItem="PSK-Jd-Mwc" secondAttribute="leading" id="ndV-Ni-q25"/>
<constraint firstItem="Lbq-oS-Rlj" firstAttribute="top" secondItem="pW5-rw-iqM" secondAttribute="bottom" constant="8" symbolic="YES" id="qRj-kV-fEA"/>
<constraint firstItem="09F-6Q-slx" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leadingMargin" constant="47" id="rLi-aF-EpY"/>
<constraint firstItem="09F-6Q-slx" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leadingMargin" id="rLi-aF-EpY"/>
<constraint firstItem="PSK-Jd-Mwc" firstAttribute="top" secondItem="09F-6Q-slx" secondAttribute="bottom" constant="8" symbolic="YES" id="waq-c1-rAn"/>
<constraint firstItem="PSK-Jd-Mwc" firstAttribute="trailing" secondItem="pW5-rw-iqM" secondAttribute="trailing" id="wix-Cp-XH9"/>
</constraints>

View File

@@ -36,11 +36,6 @@ class ViewController: UIViewController {
file3.text = ""
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
// MARK: IBAction
@IBAction func zipPressed(_: UIButton) {
@@ -48,12 +43,19 @@ class ViewController: UIViewController {
zipPath = tempZipPath()
let password = passwordField.text
let success = SSZipArchive.createZipFile(atPath: zipPath!, withContentsOfDirectory: sampleDataPath, withPassword: password?.isEmpty == false ? password : nil)
let success = SSZipArchive.createZipFile(atPath: zipPath!,
withContentsOfDirectory: sampleDataPath,
keepParentDirectory: false,
compressionLevel: -1,
password: password?.isEmpty == false ? password : nil,
aes: true,
progressHandler: nil)
if success {
print("Success zip")
unzipButton.isEnabled = true
zipButton.isEnabled = false
} else {
print("No success")
print("No success zip")
}
resetButton.isEnabled = true
}
@@ -68,12 +70,20 @@ 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)
if success == nil {
print("No success")
let success: Bool = SSZipArchive.unzipFile(atPath: zipPath,
toDestination: unzipPath,
preserveAttributes: true,
overwrite: true,
nestedZipLevel: 1,
password: password?.isEmpty == false ? password : nil,
error: nil,
delegate: nil,
progressHandler: nil,
completionHandler: nil)
if success != false {
print("Success unzip")
} else {
print("No success unzip")
return
}
@@ -127,7 +137,6 @@ class ViewController: UIViewController {
} catch {
return nil
}
return url.path
}

View File

@@ -101,7 +101,6 @@
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 */; };
@@ -138,12 +137,10 @@
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, ); }; };
AFF75A2E1C37280200F450AC /* SSZipArchive.h in Headers */ = {isa = PBXBuildFile; fileRef = B423AE481C0DF7950004A2F1 /* SSZipArchive.h */; settings = {ATTRIBUTES = (Public, ); }; };
AFF75A2F1C37280200F450AC /* SSZipArchive.m in Sources */ = {isa = PBXBuildFile; fileRef = B423AE491C0DF7950004A2F1 /* SSZipArchive.m */; };
@@ -199,7 +196,6 @@
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; };
B423AE1A1C0DF76A0004A2F1 /* ZipArchive.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ZipArchive.framework; sourceTree = BUILT_PRODUCTS_DIR; };
B423AE3D1C0DF7950004A2F1 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
@@ -307,7 +303,6 @@
B423AE3E1C0DF7950004A2F1 /* minizip */,
B423AE481C0DF7950004A2F1 /* SSZipArchive.h */,
B423AE491C0DF7950004A2F1 /* SSZipArchive.m */,
87ACF3E91D2DAFAD00ED2F7E /* SSZipArchive+Swift.swift */,
B423AE4A1C0DF7950004A2F1 /* ZipArchive.h */,
);
path = SSZipArchive;
@@ -608,7 +603,6 @@
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 */,
@@ -633,7 +627,6 @@
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 */,
@@ -682,7 +675,6 @@
files = (
3739141D1F0009FF0094DB3B /* hmac.c in Sources */,
3739140E1F0009E50094DB3B /* aes_ni.c in Sources */,
87ACF3EA1D2DAFAD00ED2F7E /* SSZipArchive+Swift.swift in Sources */,
373914211F0009FF0094DB3B /* pwd2key.c in Sources */,
373914171F0009FF0094DB3B /* aestab.c in Sources */,
373914021F0009C80094DB3B /* minishared.c in Sources */,
@@ -719,7 +711,7 @@
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_BUNDLE_IDENTIFIER = com.ziparchive.ZipArchive;
PRODUCT_NAME = "$(PROJECT_NAME)";
SDKROOT = appletvos;
SKIP_INSTALL = YES;
@@ -745,7 +737,7 @@
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_BUNDLE_IDENTIFIER = com.ziparchive.ZipArchive;
PRODUCT_NAME = "$(PROJECT_NAME)";
SDKROOT = appletvos;
SKIP_INSTALL = YES;
@@ -771,7 +763,7 @@
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_BUNDLE_IDENTIFIER = com.ziparchive.ZipArchive;
PRODUCT_NAME = "$(PROJECT_NAME)";
SDKROOT = watchos;
SKIP_INSTALL = YES;
@@ -800,7 +792,7 @@
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_BUNDLE_IDENTIFIER = com.ziparchive.ZipArchive;
PRODUCT_NAME = "$(PROJECT_NAME)";
SDKROOT = watchos;
SKIP_INSTALL = YES;
@@ -824,7 +816,7 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.9;
PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.ZipArchive;
PRODUCT_BUNDLE_IDENTIFIER = com.ziparchive.ZipArchive;
PRODUCT_NAME = "$(PROJECT_NAME)";
SDKROOT = macosx;
SKIP_INSTALL = YES;
@@ -846,7 +838,7 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.9;
PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.ZipArchive;
PRODUCT_BUNDLE_IDENTIFIER = com.ziparchive.ZipArchive;
PRODUCT_NAME = "$(PROJECT_NAME)";
SDKROOT = macosx;
SKIP_INSTALL = YES;
@@ -975,7 +967,7 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.ZipArchive;
PRODUCT_BUNDLE_IDENTIFIER = com.ziparchive.ZipArchive;
PRODUCT_NAME = "$(PROJECT_NAME)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@@ -1000,7 +992,7 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.ZipArchive;
PRODUCT_BUNDLE_IDENTIFIER = com.ziparchive.ZipArchive;
PRODUCT_NAME = "$(PROJECT_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
@@ -1026,6 +1018,7 @@
37952C641F63BB7100DD6677 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
AFF75A291C37279600F450AC /* Build configuration list for PBXNativeTarget "ZipArchive-Mac" */ = {
isa = XCConfigurationList;