120 Commits
v1.1 ... v1.7

Author SHA1 Message Date
Joshua Hudson
e3fdfed61a Fix broken test in SSZipArchiveTests.m 2017-01-23 22:38:17 -08:00
Joshua Hudson
83e12647c7 Travis YML file updated works with Travis and Xcode 8.2 2017-01-23 22:31:30 -08:00
Joshua Hudson
bca3071c70 Tweak broken test to make sure caught by travis 2017-01-23 22:30:57 -08:00
Joshua Hudson
841fd2ea2e break test to make sure travis is now building and catching errors 2017-01-23 22:23:15 -08:00
Joshua Hudson
005717dcd9 Update Travis YML 2017-01-23 22:16:07 -08:00
Joshua Hudson
aaaf20c60b Update Travis YML 2017-01-23 22:12:10 -08:00
Joshua Hudson
965e97dab4 trying to match correct destination in Travis YML 2017-01-23 22:07:05 -08:00
Joshua Hudson
2df54985de remove destination spaces (travis YML 2017-01-23 22:00:54 -08:00
Joshua Hudson
244d20f17f Update travis yml 2017-01-23 21:57:26 -08:00
Joshua Hudson
06da04803a Travis YML update 2017-01-23 21:43:47 -08:00
Joshua Hudson
1a9738db0e Travis YML - Remove leading dash 2017-01-23 21:38:13 -08:00
Joshua Hudson
8e7cc4eeaa Travis YML updates 2017-01-23 21:34:48 -08:00
Joshua Hudson
5869cd2f6f Update Travis YML 2017-01-23 21:29:02 -08:00
Joshua Hudson
85e38f376e Update Travis YML 2017-01-23 21:28:09 -08:00
Joshua Hudson
a7a9c28973 Travis YML updated 2017-01-23 21:25:25 -08:00
Joshua Hudson
e4697c5a66 Update Travis YML 2017-01-23 21:16:05 -08:00
Joshua Hudson
eeded9e86d More travis.yml config changes 2017-01-23 21:00:44 -08:00
Joshua Hudson
421c1b4ccc More travis.yml updates
Try Try Again... ;(
2017-01-23 20:48:27 -08:00
Joshua Hudson
f0a9965fa7 Update travis_yml just to get it to build 2017-01-23 20:31:46 -08:00
Joshua Hudson
34101c011b Update .travis.yml 2017-01-23 17:09:40 -08:00
Joshua Hudson
37f21d93d0 fix travis file bug 2017-01-23 17:09:01 -08:00
Joshua Hudson
b99e680aaf first step get travis to simply build project. Tests next. 2017-01-23 17:08:19 -08:00
Joshua Hudson
96b49ffae5 Remove clean as it is no longer supported in xCode 8 2017-01-23 17:01:04 -08:00
Joshua Hudson
f87799f92c Hide file labels in Swift example until unzipped. Remove file names to just be random test files vs "News Headlines" that were added by a contributor. Another shot at fixing warning messages. 2017-01-23 16:06:47 -08:00
Joshua Hudson
2ca4264756 Merge pull request #309 from Davidde94/master
Added ability to get progress of zip file creation.
2017-01-23 15:59:39 -08:00
Joshua Hudson
2e975c2895 rollback travis xml changes 2017-01-23 15:26:18 -08:00
David Evans
84a96fc298 Added ability to retrieve zip creation progress.
Fixed a issue that was caused in the previous PR regarding this feature.
2017-01-23 19:45:35 +00:00
Joshua Hudson
57ea2842ac fix warning message 2017-01-23 11:27:32 -08:00
Joshua Hudson
c8eee45526 Project file tweaks 2017-01-23 11:25:59 -08:00
Joshua Hudson
02248d8d04 Merge pull request #305 from nerdishbynature/swift30
Swift 3.0.2 (Xcode 8.2)
2017-01-23 11:11:45 -08:00
David Evans
a363be72d7 Merge remote-tracking branch 'ZipArchive/master' 2017-01-23 19:09:20 +00:00
Joshua Hudson
5d903ee581 Compile with latest xcode and bump podspec 2017-01-23 11:08:36 -08:00
Joshua Hudson
254172f351 Merge pull request #308 from ZipArchive/revert-307-master
Revert "Added support for getting zip file creation progress."
2017-01-23 11:05:45 -08:00
Joshua Hudson
d7751a54f5 Revert "Added support for getting zip file creation progress." 2017-01-23 11:05:24 -08:00
Joshua Hudson
58cd06b7d8 Merge pull request #307 from Davidde94/master
Added support for getting zip file creation progress.
2017-01-23 11:00:41 -08:00
Joshua Hudson
4fcec5bf76 Merge pull request #299 from polac24/master
Define NSError as nullable argument of completionHandler
2017-01-23 10:57:06 -08:00
Joshua Hudson
4a2bc37c7a Add test for #296. Check for both valid and invalid password checks. 2017-01-23 10:53:39 -08:00
Joshua Hudson
7bac3fb757 Merge pull request #296 from fritzt0/master
Added password validation & prevent stale file entries in case of invalid password
2017-01-23 09:47:27 -08:00
David Evans
97cd6424fd Added changes left out in last commit.
Users can now provide a callback to retrieve real-time statistics on
the progress of zipping files.
2017-01-21 18:29:28 +00:00
David Evans
0c98af7f9e Added support for retrieving zip progress information.
No additional information required.
2017-01-21 01:05:45 +00:00
Piet Brauer
3952b05eb3 Adapt new xctool usage 2017-01-19 16:14:01 +01:00
Piet Brauer
54e447185d Use Xcode 8.2 2017-01-19 11:11:10 +01:00
Piet Brauer
73fb2132a8 Migrate Swift example to Swift 3 2017-01-18 13:12:54 +01:00
Piet Brauer
39ebc12bc8 “Migrate” to Swift 3 2017-01-18 13:11:18 +01:00
Bartosz Polaczyk
a13812407b Define NSError as nullable argument of completionHandler
In order to expose it as Error? in Swift3 rather than Error
2016-11-09 10:55:14 +01:00
Felix Ritter
df48275b02 Added bad password detection for AES from minizip master 2016-11-05 15:19:45 +01:00
Felix Ritter
46ebe69295 Ensure we are not creating stale file entries in unzipFileAtPath 2016-11-05 15:16:16 +01:00
Felix Ritter
c08241ef19 added isPasswordValidForArchiveAtPath method 2016-11-05 15:14:30 +01:00
Joshua Hudson
76ca4b3293 pod version bump 2016-09-28 09:17:16 -07:00
Joshua Hudson
2ad2d02a81 Merge pull request #290 from ZipArchive/revert-281-dev-fileoption
Revert "Extended to allow passing in directory or file to unzip to"
2016-09-27 20:39:50 -07:00
Joshua Hudson
ab77a21ffc Revert "Extended to allow passing in directory or file to unzip to" 2016-09-27 20:38:52 -07:00
Joshua Hudson
96577a06c8 Update Readme
Clarify Swift3 vs Swift 2.3 support
2016-09-21 08:53:11 -07:00
Joshua Hudson
39b3500120 Bump Podspec 2016-09-14 12:11:37 -07:00
Joshua Hudson
f4c0147086 Merge pull request #285 from priya87/master
Bug fix: feof() creates infinite loop.
2016-09-14 10:34:28 -07:00
Joshua Hudson
9dae2eca4a Update README.md 2016-09-14 10:33:38 -07:00
priya TIROUNARAYANANE
650c6fb0ab Bug fix: feof() creates infinite loop. 2016-09-14 10:05:00 +02:00
Joshua Hudson
edc099d6be Update swift test project for swift 3 and xcode 8 2016-09-13 11:02:55 -07:00
Joshua Hudson
81c8672414 Update Readme.md 2016-09-13 10:45:08 -07:00
Joshua Hudson
df34c1b896 Merge pull request #281 from simerjots/dev-fileoption
Extended to allow passing in directory or file to unzip to
2016-09-13 10:43:41 -07:00
Joshua Hudson
79fd869347 Merge pull request #282 from pk/master
Convert Swift code in to Swift 3 and change appropriate project settings
2016-09-13 10:43:03 -07:00
Joshua Hudson
38c24c156a Merge pull request #284 from priya87/master
Added SSZipCommom.h to target ZipArchive-Mac
2016-09-13 10:41:41 -07:00
priya TIROUNARAYANANE
e764d19b9e Added SSZipCommom.h to target ZipArchive-Mac 2016-09-13 12:30:35 +02:00
Pavel Kunc
3c06f00fee Convert Swift code in to Swift 3 and change appropriate project
settings.
2016-09-13 09:17:31 +01:00
Sam Singh
d1e5f47e29 Extended to allow passing in directory or file to unzip to 2016-09-05 20:40:00 -04:00
Joshua Hudson
503373bc53 fix main source build 2016-08-10 13:19:07 -07:00
Joshua Hudson
988b828240 update podspec 2016-08-10 13:07:15 -07:00
Joshua Hudson
a4b4c9711d Merge pull request #273 from shaojiankui/master
if filename contains chinese dir transform Encoding
2016-08-10 10:50:14 -07:00
Jakey
391c6e75bb if filename contains chinese dir transform Encoding 2016-08-10 14:44:44 +08:00
Joshua Hudson
ecdb034302 Merge pull request #271 from dlahyani/feature/add-newline-at-eof
SSZipArchive: Make sure header files ends with a single \n character.
2016-08-08 08:30:00 -07:00
Daniel Lahyani
a0155be07f SSZipArchive: Make sure header files ends with a single \n character.
This is common practice silences a commonly used warning: 'Wnewline-eof'
2016-08-08 14:43:09 +03:00
Joshua Hudson
677b83cd96 update pod file 2016-08-03 16:14:30 -07:00
Joshua Hudson
6d0ac40a80 Rename Common.h to avoid conflicts with other Cocoapod projects 2016-08-03 16:08:42 -07:00
Joshua Hudson
21cae258bf podspec bump 2016-07-13 09:06:50 -07:00
Joshua Hudson
82534a7cba Merge pull request #264 from sibext/PerformanceImprovements
Performance improvements with zip files that have large amounts of files.
2016-07-13 09:02:47 -07:00
Joshua Hudson
93d72503dc Merge pull request #263 from sibext/SymlinkedFilesBug
Fix of symlinked files bug
2016-07-13 08:52:38 -07:00
Artyom Gladkov
0820787fc6 Add additional public unzipping method to allow skipping of operations on files' attributes.
Operations with files' attribute are performance bottleneck and for some tasks and archives it is overkill.
2016-07-13 14:15:13 +06:00
Artyom Gladkov
ae9a5b5fdf Change collection type for 'directoriesModificationDates' from NSMutableSet to NSMutableArray.
The performance of NSMutableSet degradates very rapidly on increasing of archive size (count of files). Especially it becomes when costly to add new files to it.
2016-07-13 12:59:44 +06:00
Artyom Gladkov
41e2c0f61d Tests validate symlinked files using their file type. 2016-07-13 11:21:18 +06:00
Artyom Gladkov
40d2eb9b1a Set YES to symlinked files during unzipping. 2016-07-13 10:56:30 +06:00
Artyom Gladkov
4203301734 'pod install' for ObjectiveCExample 2016-07-13 10:31:13 +06:00
Joshua Hudson
f420e47ea5 bump podspec and fix swift example and add autolayout constraints. 2016-07-06 15:34:42 -07:00
Joshua Hudson
3050c9a340 Merge pull request #260 from bdunayAGL/master
Nullablilty Annotations for better swift support
2016-07-06 15:23:25 -07:00
Bill Dunay
99d98ac5e8 Added nullablilty annotations to the framework. 2016-07-06 17:44:47 -04:00
Joshua Hudson
d1af8a01ea Merge pull request #261 from sibext/RunOutOfSpaceFix
Check for: Run out of space issue
2016-07-06 12:18:12 -07:00
Joshua Hudson
62e640b3c0 Merge pull request #258 from oanhof/master
check if zip file is password protected
2016-07-06 12:16:43 -07:00
Artyom Gladkov
701400d06f Add errors forwarding on 'run out of space issue' 2016-07-06 18:29:55 +06:00
Dominik Arnhof
d93b03eb1a added password check 2016-07-02 18:52:36 +02:00
Joshua Hudson
4fde7a92dc Add build badge 2016-05-31 13:21:33 -07:00
Joshua Hudson
ca31fc1f8f Now that travis.yml changes are working and being read. Bumped xcode version to 7.3.1 2016-05-31 13:11:07 -07:00
Joshua Hudson
ef241ad443 Now that travis.yml changes are working and being read. Bumped xcode version to 7.3.1 2016-05-31 13:04:51 -07:00
Joshua Hudson
8155c13401 another yml tweak 2016-05-31 12:55:40 -07:00
Joshua Hudson
9dba28d156 another yml tweak 2016-05-31 12:53:28 -07:00
Joshua Hudson
ecb6f4de63 trying to see why travis is not picking up travis yml changes 2016-05-31 12:50:21 -07:00
Joshua Hudson
647e9ed859 Fixed tests no longer working after CocoaPods 1.0 2016-05-31 12:42:22 -07:00
Joshua Hudson
7a0e9ff317 more configuration tweaks 2016-05-31 12:13:20 -07:00
Joshua Hudson
02501b4775 trying to get travic-ci tests to run 2016-05-31 12:02:25 -07:00
Joshua Hudson
4d2962a9e5 made ObjectiveCExample shared scheme 2016-05-31 11:58:42 -07:00
Joshua Hudson
e29a44bac4 Add Travis-CI support. Thanks to @ssoper 2016-05-31 11:51:24 -07:00
Joshua Hudson
0746d77e2d spelling fix 2016-05-31 11:25:15 -07:00
Joshua Hudson
545cc041a9 Don't show test labels until Unzip Sample Data hit 2016-05-31 11:03:26 -07:00
Joshua Hudson
65b9bf19b3 Merge pull request #251 from HongliYu/master
add screens to ObjectiveCExample
2016-05-31 10:58:11 -07:00
HongliYu
dd62e638df Add Objective-C Example 2016-05-29 22:41:56 +08:00
Joshua Hudson
1329746e00 Bump podspec to 1.2 2016-05-11 21:59:42 -07:00
Joshua Hudson
41c3e8251f Moved method to private section. 2016-05-11 21:51:06 -07:00
Joshua Hudson
6662e376d3 Merge pull request #250 from bogo/fix-writing-insitu
Create the .DS_Store files in temp directory for read-only contexts
2016-05-11 21:42:30 -07:00
Bogo Giertler
c17e76ceb8 Create the .DS_Store files in temp directory for read-only contexts 2016-05-11 16:39:08 +01:00
Joshua Hudson
7b1b69ac63 Merge pull request #247 from jasdeepsaini/watchos_support_in_podspec
Added support for watchos to the podspec.
2016-04-06 11:45:06 -07:00
Jasdeep Saini
dd704514ed Updated the summary and description for the podspec to include watchOS. 2016-04-05 22:57:26 -05:00
Jasdeep Saini
c1af3293ed Added support for watchos to the podspec. 2016-04-05 22:25:05 -05:00
Joshua Hudson
8c51a6838f Fix #239 2016-03-23 16:54:24 -07:00
Joshua Hudson
4f81669eff Merge pull request #243 from evenlyio/tvos_support
tvOS support - Thanks!
2016-03-23 16:43:37 -07:00
Thomas Heß
767240fa71 Revert "bumped version number"
This reverts commit a595d64d12.
2016-03-23 09:27:06 +01:00
Thomas Heß
a595d64d12 bumped version number 2016-03-23 09:24:46 +01:00
Thomas Heß
bf55f841df added tvOS deployment target 2016-03-23 09:24:32 +01:00
Joshua Hudson
d16ce77f91 Merge pull request #237 from ClementPadovani/master
Fixes broken commit
2016-02-24 06:03:25 -08:00
ClementPadovani
4f526ae0c5 Merge pull request #1 from ClementPadovani/ClementPadovani-patch-1
Removed getters since they broke everything.
2016-02-24 14:55:11 +01:00
ClementPadovani
8ba930ef4b Removed getters since they broke everything.
Reverts this commit 03f70718a2 that broke the opening and closing of zip files as mentioned in https://github.com/ZipArchive/ZipArchive/issues/225
2016-02-24 14:54:39 +01:00
Joshua Hudson
e9313bf5c1 Update Release Instructions 2016-01-27 11:38:19 -08:00
Joshua Hudson
5a936a726a Create Release Instructions
I always forget all the steps. Especially now that we have cocoa pods and Carthage
2016-01-27 11:37:32 -08:00
Joshua Hudson
b89bc45c57 Fix podspec, it would not validate for OSX part of validation. See comment by @krzyzanowskim at https://github.com/CocoaPods/CocoaPods/issues/3638 2016-01-27 09:38:00 -08:00
39 changed files with 1059 additions and 363 deletions

7
.travis.yml Normal file
View File

@@ -0,0 +1,7 @@
language: objective-c
osx_image: xcode8.2
podfile: ObjectiveCExample/Podfile
xcode_workspace: ObjectiveCExample/ObjectiveCExample.xcworkspace
xcode_scheme: ObjectiveCExample
script: xcodebuild -workspace ObjectiveCExample/ObjectiveCExample.xcworkspace -scheme ObjectiveCExample -sdk iphonesimulator -destination "id=E40727B3-41FB-4D6E-B4CB-BFA87109EB12" -configuration Debug ONLY_ACTIVE_ARCH=NO ENABLE_TESTABILITY=YES test

View File

@@ -7,6 +7,8 @@
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 */; };
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 */; };
@@ -31,7 +33,7 @@
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 */; };
BC14D61B16F6F9821E1D2AF8 /* Pods_ObjectiveCExample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 55A83C5BCB33C184EAB6A4E4 /* Pods_ObjectiveCExample.framework */; };
F7D6D86D1CFB2C4900DA6DA6 /* Sample Data in Resources */ = {isa = PBXBuildFile; fileRef = F7D6D86C1CFB2C4900DA6DA6 /* Sample Data */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -45,8 +47,8 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
1D19A4CE2C2507826BBF65B2 /* 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>"; };
55A83C5BCB33C184EAB6A4E4 /* Pods_ObjectiveCExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ObjectiveCExample.framework; sourceTree = BUILT_PRODUCTS_DIR; };
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; };
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>"; };
@@ -78,7 +80,11 @@
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>"; };
D8928CF7ED12679FE72CDF96 /* 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>"; };
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; };
F7D6D86C1CFB2C4900DA6DA6 /* Sample Data */ = {isa = PBXFileReference; lastKnownFileType = folder; path = "Sample Data"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -86,7 +92,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
BC14D61B16F6F9821E1D2AF8 /* Pods_ObjectiveCExample.framework in Frameworks */,
60F2CD131F797840FEEF41BF /* Pods_ObjectiveCExample.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -94,20 +100,32 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
09C572016004B12D6A6F9BFD /* Pods_ObjectiveCExampleTests.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
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 */,
);
name = Pods;
sourceTree = "<group>";
};
8DFE19E11BDA9FF300709011 = {
isa = PBXGroup;
children = (
8DFE19EC1BDA9FF300709011 /* ObjectiveCExample */,
8DFE1A061BDA9FF300709011 /* ObjectiveCExampleTests */,
8DFE19EB1BDA9FF300709011 /* Products */,
BCB342A5EC26DB692D25F7D4 /* Pods */,
9DAA2CA8E954AC9481CC795C /* Frameworks */,
133E0B9323A7D3A1E738A45C /* Pods */,
C0E3885084B2150B8F297B76 /* Frameworks */,
);
sourceTree = "<group>";
};
@@ -131,6 +149,7 @@
8DFE19F91BDA9FF300709011 /* Assets.xcassets */,
8DFE19FB1BDA9FF300709011 /* LaunchScreen.storyboard */,
8DFE19FE1BDA9FF300709011 /* Info.plist */,
F7D6D86C1CFB2C4900DA6DA6 /* Sample Data */,
8DFE19ED1BDA9FF300709011 /* Supporting Files */,
);
path = ObjectiveCExample;
@@ -187,23 +206,15 @@
path = Multi_Zip_Test;
sourceTree = "<group>";
};
9DAA2CA8E954AC9481CC795C /* Frameworks */ = {
C0E3885084B2150B8F297B76 /* Frameworks */ = {
isa = PBXGroup;
children = (
55A83C5BCB33C184EAB6A4E4 /* Pods_ObjectiveCExample.framework */,
E647562E4F5D61128404422A /* Pods_ObjectiveCExample.framework */,
7BC9C4E518D9F4FF7C026523 /* Pods_ObjectiveCExampleTests.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
BCB342A5EC26DB692D25F7D4 /* Pods */ = {
isa = PBXGroup;
children = (
1D19A4CE2C2507826BBF65B2 /* Pods-ObjectiveCExample.debug.xcconfig */,
D8928CF7ED12679FE72CDF96 /* Pods-ObjectiveCExample.release.xcconfig */,
);
name = Pods;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -211,12 +222,12 @@
isa = PBXNativeTarget;
buildConfigurationList = 8DFE1A0C1BDA9FF300709011 /* Build configuration list for PBXNativeTarget "ObjectiveCExample" */;
buildPhases = (
9DD791BB0AF1B25DAC39CA6E /* Check Pods Manifest.lock */,
B17DD0CEF4553EDB98836D32 /* [CP] Check Pods Manifest.lock */,
8DFE19E61BDA9FF300709011 /* Sources */,
8DFE19E71BDA9FF300709011 /* Frameworks */,
8DFE19E81BDA9FF300709011 /* Resources */,
46297D8971768D8719ECE6DF /* Embed Pods Frameworks */,
2CFF892408F7E8BF9EC5C1C5 /* Copy Pods Resources */,
CA0F9A9BDCCC5F900FD55CF3 /* [CP] Embed Pods Frameworks */,
8328CABE589F0AEC0D43D7CC /* [CP] Copy Pods Resources */,
);
buildRules = (
);
@@ -231,9 +242,12 @@
isa = PBXNativeTarget;
buildConfigurationList = 8DFE1A0F1BDA9FF300709011 /* Build configuration list for PBXNativeTarget "ObjectiveCExampleTests" */;
buildPhases = (
3849EE691EA1B366503B4C96 /* [CP] Check Pods Manifest.lock */,
8DFE19FF1BDA9FF300709011 /* Sources */,
8DFE1A001BDA9FF300709011 /* Frameworks */,
8DFE1A011BDA9FF300709011 /* Resources */,
486F364061BAD3921A1CA2C8 /* [CP] Embed Pods Frameworks */,
ED17275C640D443076C514CE /* [CP] Copy Pods Resources */,
);
buildRules = (
);
@@ -251,7 +265,7 @@
8DFE19E21BDA9FF300709011 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0710;
LastUpgradeCheck = 0820;
TargetAttributes = {
8DFE19E91BDA9FF300709011 = {
CreatedOnToolsVersion = 7.1;
@@ -289,6 +303,7 @@
8DFE19FD1BDA9FF300709011 /* LaunchScreen.storyboard in Resources */,
8DFE19FA1BDA9FF300709011 /* Assets.xcassets in Resources */,
8DFE19F81BDA9FF300709011 /* Main.storyboard in Resources */,
F7D6D86D1CFB2C4900DA6DA6 /* Sample Data in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -318,14 +333,44 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
2CFF892408F7E8BF9EC5C1C5 /* Copy Pods Resources */ = {
3849EE691EA1B366503B4C96 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Copy Pods Resources";
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../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";
showEnvVarsInLog = 0;
};
486F364061BAD3921A1CA2C8 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ObjectiveCExampleTests/Pods-ObjectiveCExampleTests-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
8328CABE589F0AEC0D43D7CC /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
@@ -333,14 +378,29 @@
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ObjectiveCExample/Pods-ObjectiveCExample-resources.sh\"\n";
showEnvVarsInLog = 0;
};
46297D8971768D8719ECE6DF /* Embed Pods Frameworks */ = {
B17DD0CEF4553EDB98836D32 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Embed Pods Frameworks";
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../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";
showEnvVarsInLog = 0;
};
CA0F9A9BDCCC5F900FD55CF3 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
@@ -348,19 +408,19 @@
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ObjectiveCExample/Pods-ObjectiveCExample-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
9DD791BB0AF1B25DAC39CA6E /* Check Pods Manifest.lock */ = {
ED17275C640D443076C514CE /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Check Pods Manifest.lock";
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ObjectiveCExampleTests/Pods-ObjectiveCExampleTests-resources.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
@@ -428,8 +488,10 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -472,8 +534,10 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -499,7 +563,7 @@
};
8DFE1A0D1BDA9FF300709011 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 1D19A4CE2C2507826BBF65B2 /* Pods-ObjectiveCExample.debug.xcconfig */;
baseConfigurationReference = 78F9C8623D65380774875E92 /* Pods-ObjectiveCExample.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = ObjectiveCExample/Info.plist;
@@ -511,7 +575,7 @@
};
8DFE1A0E1BDA9FF300709011 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = D8928CF7ED12679FE72CDF96 /* Pods-ObjectiveCExample.release.xcconfig */;
baseConfigurationReference = BF4E88C3450A127B14A949C2 /* Pods-ObjectiveCExample.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = ObjectiveCExample/Info.plist;
@@ -523,6 +587,7 @@
};
8DFE1A101BDA9FF300709011 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = C12D647350722C151A02D17C /* Pods-ObjectiveCExampleTests.debug.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
INFOPLIST_FILE = ObjectiveCExampleTests/Info.plist;
@@ -535,6 +600,7 @@
};
8DFE1A111BDA9FF300709011 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = B263C1FEBD2BEC1D1C4133CC /* Pods-ObjectiveCExampleTests.release.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
INFOPLIST_FILE = ObjectiveCExampleTests/Info.plist;

View File

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

View File

@@ -59,6 +59,11 @@
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
}
],
"info" : {

View File

@@ -1,13 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6211" systemVersion="14A298i" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<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">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6204"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="" sceneMemberID="viewController">
<viewController id="BYZ-38-t0r" customClass="ViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
@@ -15,8 +16,95 @@
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<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"/>
<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"/>
<connections>
<action selector="zipPressed:" destination="BYZ-38-t0r" eventType="touchUpInside" id="ebf-WE-3Xz"/>
</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"/>
<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>
<action selector="unzipPressed:" destination="BYZ-38-t0r" eventType="touchUpInside" id="6XQ-4q-0UI"/>
</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"/>
<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"/>
<connections>
<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"/>
<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"/>
<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"/>
<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"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<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 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="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 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="84L-OB-eyZ" firstAttribute="top" secondItem="b0V-gX-SgI" secondAttribute="bottom" constant="8" id="xAV-Uy-dqy"/>
</constraints>
</view>
<connections>
<outlet property="file1" destination="3gB-ZC-0ON" id="GUd-wx-xEa"/>
<outlet property="file2" destination="ZxR-a0-kva" id="AZi-Dj-dI8"/>
<outlet property="file3" destination="b0V-gX-SgI" id="zwq-l2-xZK"/>
<outlet property="resetButton" destination="84L-OB-eyZ" id="9VY-KX-sKi"/>
<outlet property="unzipButton" destination="2Ts-JV-yCW" id="2LN-kr-Sei"/>
<outlet property="zipButton" destination="uTp-oA-6Sj" id="Tl8-0B-gHY"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>

View File

@@ -0,0 +1,9 @@
# 1
** This is a test **
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non ex turpis. Quisque quis porttitor nunc, sed sollicitudin urna. Aliquam ullamcorper ante fringilla ipsum feugiat egestas. Praesent a dapibus nisi. Proin dignissim non elit sit amet vestibulum. Proin et velit sit amet eros pretium maximus. Suspendisse potenti. Integer dolor felis, vehicula a ipsum vel, faucibus sodales nunc. Nam luctus nunc at malesuada pretium. Suspendisse nec leo in massa ultricies euismod at sed tortor. Nullam eleifend massa eget ultrices sollicitudin. Praesent id dolor vestibulum, mattis nisi ac, semper mi. Aenean justo dui, sollicitudin ut cursus eu, bibendum quis purus. Duis nec nisl augue.
In et leo in lacus ultricies congue. Sed quis erat ex. Proin tristique leo tincidunt justo hendrerit luctus. Nam mattis fringilla sapien a tincidunt. Nulla ultricies ut ex ac imperdiet. Proin tristique sit amet est nec facilisis. Donec rutrum mauris a pellentesque mollis. Cras blandit arcu at sem vulputate commodo. Mauris ipsum massa, hendrerit vitae cursus sed, malesuada at augue. Aenean nec nisi purus. In lacus mi, luctus id mattis vitae, lacinia sit amet mi. Mauris mollis convallis velit vel vestibulum. Praesent scelerisque eros tellus, sit amet varius massa eleifend et. Duis quis vehicula nisi, vel ultrices mi. Duis eu ipsum ac lorem dignissim semper vel sed nulla.
Aenean tempus placerat aliquam. Nam accumsan sapien eu ex pretium ullamcorper. Fusce ac risus tortor. Praesent gravida ultricies magna eu aliquam. Nam facilisis lobortis ante vitae imperdiet. Pellentesque metus quam, fermentum sed posuere sed, iaculis in tellus. Donec consequat dui vel nibh mollis porta. Proin sit amet consectetur nisl. Integer tellus justo, imperdiet commodo est at, condimentum viverra est. Maecenas nec erat pharetra, laoreet odio non, rhoncus felis. Curabitur id ex aliquam, mattis massa quis, facilisis ex.

View File

@@ -0,0 +1,7 @@
# Test # 2
** This is a second test file **
Morbi vel metus quis lorem tincidunt tempus sit amet quis magna. Nullam dolor dolor, eleifend in vestibulum nec, auctor at ipsum. Nullam viverra neque eros, a vehicula lacus tempus vitae. In sapien sapien, gravida mollis lectus sed, luctus egestas massa. Donec mollis tortor sit amet erat gravida ornare at sed felis. In ornare posuere velit, quis ultrices velit porta eget. Proin eu ultrices felis, eu finibus dolor. Quisque ultrices id libero at euismod. Sed mollis lacus id leo dignissim condimentum eget ac nunc. Vestibulum sed congue velit. Curabitur semper non lorem vel cursus. Ut sed augue purus. Sed sit amet faucibus ante, vel blandit justo. Duis id lacinia ex. Nullam pulvinar eget lacus in tristique. Nam et odio consequat, vehicula mauris ut, vulputate mi.
Pellentesque feugiat, nulla in dictum lacinia, risus sapien aliquam magna, vitae efficitur neque mauris sagittis neque. Etiam eu hendrerit erat. Vestibulum aliquet sapien sed fermentum ultricies. Maecenas eu risus nec turpis semper consequat. Cras nisl diam, consequat ut orci nec, rutrum cursus est. Quisque dictum nunc leo, lobortis lacinia nisl ultrices eget. Ut imperdiet eu libero quis blandit. Nunc blandit, leo quis rutrum auctor, ex tortor vehicula sem, eu ultrices ipsum mi vel arcu. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 MiB

View File

@@ -7,21 +7,124 @@
//
#import "ViewController.h"
#import "SSZipArchive.h"
@interface ViewController ()
@property (weak, nonatomic) IBOutlet UIButton *zipButton;
@property (weak, nonatomic) IBOutlet UIButton *unzipButton;
@property (weak, nonatomic) IBOutlet UIButton *resetButton;
@property (weak, nonatomic) IBOutlet UILabel *file1;
@property (weak, nonatomic) IBOutlet UILabel *file2;
@property (weak, nonatomic) IBOutlet UILabel *file3;
@property (copy, nonatomic) NSString *zipPath;
@end
@implementation ViewController
#pragma mark - Life Cycle
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
[super viewDidLoad];
_file1.text = @"";
_file2.text = @"";
_file3.text = @"";
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
[super didReceiveMemoryWarning];
}
#pragma mark - IBAction
- (IBAction)zipPressed:(id)sender {
NSString *sampleDataPath = [[NSBundle mainBundle].bundleURL
URLByAppendingPathComponent:@"Sample Data"
isDirectory:YES].path;
_zipPath = [self tempZipPath];
BOOL success = [SSZipArchive createZipFileAtPath:_zipPath
withContentsOfDirectory:sampleDataPath];
if (success) {
_unzipButton.enabled = YES;
_zipButton.enabled = NO;
}
}
- (IBAction)unzipPressed:(id)sender {
if (!_zipPath) {
return;
}
NSString *unzipPath = [self tempUnzipPath];
if (!unzipPath) {
return;
}
BOOL success = [SSZipArchive unzipFileAtPath:_zipPath
toDestination:unzipPath];
if (!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;
}
}
}];
_unzipButton.enabled = NO;
_resetButton.enabled = YES;
}
- (IBAction)resetPressed:(id)sender {
_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 *)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;
}
@end

View File

@@ -1,5 +1,5 @@
#import <Foundation/Foundation.h>
#import <SSZipArchive/SSZipArchive.h>
#import "SSZipArchive.h"
/**
* Test delegate by collecting its calls

View File

@@ -23,7 +23,7 @@
@implementation CancelDelegate
- (void)zipArchiveDidUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath fileInfo:(unz_file_info)fileInfo
{
_numFilesUnzipped = fileIndex + 1;
_numFilesUnzipped = (int)fileIndex + 1;
}
- (BOOL)zipArchiveShouldUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath fileInfo:(unz_file_info)fileInfo
{
@@ -173,6 +173,34 @@
XCTAssertTrue([fileManager fileExistsAtPath:testPath], @"LICENSE unzipped");
}
- (void)testValidatePassword {
NSString *zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"TestPasswordArchive" ofType:@"zip"];
NSError *error = nil;
BOOL fileHasValidPassword = [SSZipArchive isPasswordValidForArchiveAtPath:zipPath password:@"passw0rd" error:&error];
XCTAssertTrue(fileHasValidPassword,@"Valid password reports false.");
BOOL fileHasInvalidValidPassword = [SSZipArchive isPasswordValidForArchiveAtPath:zipPath password:@"passw0rd123" error:&error];
XCTAssertFalse(fileHasInvalidValidPassword,@"Invalid password reports true.");
}
- (void)testFilePasswordCheck {
NSString *zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"TestArchive" ofType:@"zip"];
BOOL protected = [SSZipArchive isFilePasswordProtectedAtPath:zipPath];
XCTAssertFalse(protected, @"has no password");
NSString *zipWithPasswordPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"TestPasswordArchive" ofType:@"zip"];
protected = [SSZipArchive isFilePasswordProtectedAtPath:zipWithPasswordPath];
XCTAssertTrue(protected, @"has password");
}
//Temp Disabled test, fix is not yet in the AES version of the unzip lib
//- (void)testUnzippingTruncatedFileFix {
@@ -202,8 +230,8 @@
NSError *error = nil;
NSDictionary *info = [[NSFileManager defaultManager] attributesOfItemAtPath: testSymlink error: &error];
XCTAssertTrue(info, @"Symbolic links should persist from the original archive to the outputted files.");
BOOL fileIsSymbolicLink = info[NSFileType] == NSFileTypeSymbolicLink;
XCTAssertTrue(fileIsSymbolicLink, @"Symbolic links should persist from the original archive to the outputted files.");
}
- (void)testUnzippingWithRelativeSymlink {
@@ -220,13 +248,13 @@
NSString *testSymlinkFolder = [NSString pathWithComponents:@[testBasePath, subfolderName, @"folderSymlink"]];
NSString *testSymlinkFile = [NSString pathWithComponents:@[testBasePath, subfolderName, @"fileSymlink"]];
BOOL found = [[NSFileManager defaultManager] attributesOfItemAtPath: testSymlinkFile error: nil];
NSDictionary *fileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:testSymlinkFile error: nil];
BOOL fileIsSymbolicLink = fileAttributes[NSFileType] == NSFileTypeSymbolicLink;
XCTAssertTrue(fileIsSymbolicLink, @"Relative symbolic links should persist from the original archive to the outputted files.");
XCTAssertTrue(found, @"Relative symbolic links should persist from the original archive to the outputted files (and also remain relative).");
found = [[NSFileManager defaultManager] attributesOfItemAtPath: testSymlinkFolder error: nil];
XCTAssertTrue(found, @"Relative symbolic links should persist from the original archive to the outputted files (and also remain relative).");
NSDictionary *folderAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:testSymlinkFolder error: nil];
BOOL folderIsSymbolicLink = folderAttributes[NSFileType] == NSFileTypeSymbolicLink;
XCTAssertTrue(folderIsSymbolicLink, @"Relative symbolic links should persist from the original archive to the outputted files.");
}
- (void)testUnzippingWithUnicodeFilenameInside {

View File

@@ -3,6 +3,14 @@ source 'https://github.com/CocoaPods/Specs.git'
# inhibit_all_warnings!
use_frameworks!
target 'ObjectiveCExample' do
pod 'SSZipArchive', :path => '..'
def testing_pods
pod 'SSZipArchive', :path => '..'
end
target 'ObjectiveCExample' do
testing_pods
end
target 'ObjectiveCExampleTests' do
testing_pods
end

View File

@@ -1,14 +1,16 @@
PODS:
- SSZipArchive (1.0.1)
- SSZipArchive (1.7)
DEPENDENCIES:
- SSZipArchive (from `..`)
EXTERNAL SOURCES:
SSZipArchive:
:path: ..
:path: ".."
SPEC CHECKSUMS:
SSZipArchive: 7bfebbf578e47e1c4239a06f0c202101d4d933ab
SSZipArchive: 63f8e11cfcc33e03e4cd666b4359ea8bd6facd0c
COCOAPODS: 0.39.0
PODFILE CHECKSUM: ae5fb993e5dc339b15e10067d1e60549fa585f32
COCOAPODS: 1.1.1

View File

@@ -1,4 +1,6 @@
[![Build Status](https://travis-ci.org/ZipArchive/ZipArchive.svg?branch=master)](https://travis-ci.org/ZipArchive/ZipArchive)
# SSZipArchive
ZipArchive is a simple utility class for zipping and unzipping files on iOS and Mac.
@@ -12,6 +14,8 @@ ZipArchive is a simple utility class for zipping and unzipping files on iOS and
## Installation and Setup
*The main release branch is configured to support Objective C and Swift 3. There is a 'swift23' branch which is the latest branch but marked to compile for Swift 2.3.*
### CocoaPods
`pod install SSZipArchive`

20
Release-Instructions.md Normal file
View File

@@ -0,0 +1,20 @@
The following steps should be taking by project maintainers if they create a new release.
1. Create a new release and tag for the release.
- Tags should be in the form of vMajor.Minor.Revision
- Release names should be more human readable: Version Major.Minor.Revision
2. Update the podspec
3. Push the pod to the trunk
- *pod trunk push SSZipArchive.podspec*
4. Create a Carthage framework archive
- *carthage build --no-skip-current*
- *carthage archive ZipArchive*
5. Attach archive to the release created in step 1.

View File

@@ -1,15 +1,17 @@
Pod::Spec.new do |s|
s.name = 'SSZipArchive'
s.version = '1.1'
s.summary = 'Utility class for zipping and unzipping files on iOS and Mac.'
s.description = 'SSZipArchive is a simple utility class for zipping and unzipping files on iOS and Mac.'
s.version = '1.7'
s.summary = 'Utility class for zipping and unzipping files on iOS, tvOS, watchOS, and Mac.'
s.description = 'SSZipArchive is a simple utility class for zipping and unzipping files on iOS, tvOS, watchOS, and Mac.'
s.homepage = 'https://github.com/ZipArchive/ZipArchive'
s.license = { :type => 'MIT', :file => 'LICENSE.txt' }
s.author = { 'Sam Soffes' => 'sam@soff.es' }
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.source_files = 'SSZipArchive/*', 'SSZipArchive/minizip/*', 'SSZipArchive/aes/*'
s.watchos.deployment_target = '2.0'
s.source_files = 'SSZipArchive/*.m', 'SSZipArchive/*.h', 'SSZipArchive/minizip/*', 'SSZipArchive/aes/*'
s.public_header_files = 'SSZipArchive/*.h'
s.library = 'z'
s.requires_arc = true

View File

@@ -0,0 +1,25 @@
//
// 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

@@ -10,50 +10,66 @@
#define _SSZIPARCHIVE_H
#import <Foundation/Foundation.h>
#include "Common.h"
#include "SSZipCommon.h"
NS_ASSUME_NONNULL_BEGIN
@protocol SSZipArchiveDelegate;
@interface SSZipArchive : NSObject
// Password check
+ (BOOL)isFilePasswordProtectedAtPath:(NSString *)path;
+ (BOOL)isPasswordValidForArchiveAtPath:(NSString *)path password:(NSString *)pw error:(NSError * __nullable * __nullable)error NS_SWIFT_NOTHROW;
// Unzip
+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination;
+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination delegate:(id<SSZipArchiveDelegate>)delegate;
+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination delegate:(nullable id<SSZipArchiveDelegate>)delegate;
+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination overwrite:(BOOL)overwrite password:(NSString *)password error:(NSError * *)error;
+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination overwrite:(BOOL)overwrite password:(NSString *)password error:(NSError * *)error delegate:(id<SSZipArchiveDelegate>)delegate;
+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination overwrite:(BOOL)overwrite password:(nullable NSString *)password error:(NSError * *)error;
+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination overwrite:(BOOL)overwrite password:(nullable NSString *)password error:(NSError * *)error delegate:(nullable id<SSZipArchiveDelegate>)delegate NS_REFINED_FOR_SWIFT;
+ (BOOL)unzipFileAtPath:(NSString *)path
toDestination:(NSString *)destination
preserveAttributes:(BOOL)preserveAttributes
overwrite:(BOOL)overwrite
password:(nullable NSString *)password
error:(NSError * *)error
delegate:(nullable id<SSZipArchiveDelegate>)delegate;
+ (BOOL)unzipFileAtPath:(NSString *)path
toDestination:(NSString *)destination
progressHandler:(void (^)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler
completionHandler:(void (^)(NSString *path, BOOL succeeded, NSError *error))completionHandler;
completionHandler:(void (^)(NSString *path, BOOL succeeded, NSError * __nullable error))completionHandler;
+ (BOOL)unzipFileAtPath:(NSString *)path
toDestination:(NSString *)destination
overwrite:(BOOL)overwrite
password:(NSString *)password
password:(nullable NSString *)password
progressHandler:(void (^)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler
completionHandler:(void (^)(NSString *path, BOOL succeeded, NSError *error))completionHandler;
completionHandler:(void (^)(NSString *path, BOOL succeeded, NSError * __nullable error))completionHandler;
// Zip
// without password
+ (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray *)paths;
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath;
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirector;
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirectory;
// with password, password could be nil
+ (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray *)paths withPassword:(NSString *)password;
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath withPassword:(NSString *)password;
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirectory withPassword:(NSString *)password;
+ (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray *)paths withPassword:(nullable NSString *)password;
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath withPassword:(nullable NSString *)password;
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirectory withPassword:(nullable NSString *)password;
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirectory withPassword:(nullable NSString *)password andProgressHandler:(void(^ _Nullable)(NSUInteger entryNumber, NSUInteger total))progressHandler;
- (instancetype)initWithPath:(NSString *)path;
@property (NS_NONATOMIC_IOSONLY, readonly, getter = isOpen) BOOL open;
- (BOOL)writeFile:(NSString *)path withPassword:(NSString *)password;
- (BOOL)writeFolderAtPath:(NSString *)path withFolderName:(NSString *)folderName withPassword:(NSString *)password;
- (BOOL)writeFileAtPath:(NSString *)path withFileName:(NSString *)fileName withPassword:(NSString *)password;
- (BOOL)writeData:(NSData *)data filename:(NSString *)filename withPassword:(NSString *)password;
@property (NS_NONATOMIC_IOSONLY, readonly, getter = isClosed) BOOL close;
@property (NS_NONATOMIC_IOSONLY, readonly) BOOL open;
- (BOOL)writeFile:(NSString *)path withPassword:(nullable NSString *)password;
- (BOOL)writeFolderAtPath:(NSString *)path withFolderName:(NSString *)folderName withPassword:(nullable NSString *)password;
- (BOOL)writeFileAtPath:(NSString *)path withFileName:(nullable NSString *)fileName withPassword:(nullable NSString *)password;
- (BOOL)writeData:(NSData *)data filename:(nullable NSString *)filename withPassword:(nullable NSString *)password;
@property (NS_NONATOMIC_IOSONLY, readonly) BOOL close;
@end
@@ -74,4 +90,6 @@
@end
NS_ASSUME_NONNULL_END
#endif /* _SSZIPARCHIVE_H */

View File

@@ -26,6 +26,108 @@
zipFile _zip;
}
#pragma mark - Password check
+ (BOOL)isFilePasswordProtectedAtPath:(NSString *)path {
// Begin opening
zipFile zip = unzOpen((const char*)[path UTF8String]);
if (zip == NULL) {
return NO;
}
int ret = unzGoToFirstFile(zip);
if (ret == UNZ_OK) {
do {
ret = unzOpenCurrentFile(zip);
if( ret!=UNZ_OK ) {
return NO;
}
unz_file_info fileInfo ={0};
ret = unzGetCurrentFileInfo(zip, &fileInfo, NULL, 0, NULL, 0, NULL, 0);
if (ret!= UNZ_OK) {
return NO;
} else if((fileInfo.flag & 1) == 1) {
return YES;
}
unzCloseCurrentFile(zip);
ret = unzGoToNextFile(zip);
} while( ret==UNZ_OK && UNZ_OK!=UNZ_END_OF_LIST_OF_FILE );
}
return NO;
}
+ (BOOL)isPasswordValidForArchiveAtPath:(NSString *)path password:(NSString *)pw error:(NSError **)error {
if (error) {
*error = nil;
}
zipFile zip = unzOpen((const char*)[path UTF8String]);
if (zip == NULL) {
if (error) {
*error = [NSError errorWithDomain:@"SSZipArchiveErrorDomain"
code:-1
userInfo:@{NSLocalizedDescriptionKey: @"failed to open zip file"}];
}
return NO;
}
int ret = unzGoToFirstFile(zip);
if (ret == UNZ_OK) {
do {
if ([pw length] == 0) {
ret = unzOpenCurrentFile(zip);
} else {
ret = unzOpenCurrentFilePassword(zip, [pw cStringUsingEncoding:NSASCIIStringEncoding]);
}
if (ret != UNZ_OK) {
if (ret != UNZ_BADPASSWORD) {
if (error) {
*error = [NSError errorWithDomain:@"SSZipArchiveErrorDomain"
code:-2
userInfo:@{NSLocalizedDescriptionKey: @"failed to open first file in zip file"}];
}
}
return NO;
}
unz_file_info fileInfo = {0};
ret = unzGetCurrentFileInfo(zip, &fileInfo, NULL, 0, NULL, 0, NULL, 0);
if (ret != UNZ_OK) {
if (error) {
*error = [NSError errorWithDomain:@"SSZipArchiveErrorDomain"
code:-3
userInfo:@{NSLocalizedDescriptionKey: @"failed to retrieve info for file"}];
}
return NO;
} else if((fileInfo.flag & 1) == 1) {
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
if (readBytes != Z_DATA_ERROR) {
if (error) {
*error = [NSError errorWithDomain:@"SSZipArchiveErrorDomain"
code:-4
userInfo:@{NSLocalizedDescriptionKey: @"failed to read contents of file entry"}];
}
}
return NO;
}
return YES;
}
unzCloseCurrentFile(zip);
ret = unzGoToNextFile(zip);
} while (ret==UNZ_OK && UNZ_OK!=UNZ_END_OF_LIST_OF_FILE);
}
// No password required
return YES;
}
#pragma mark - Unzipping
+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination
@@ -33,19 +135,19 @@
return [self unzipFileAtPath:path toDestination:destination delegate:nil];
}
+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination overwrite:(BOOL)overwrite password:(NSString *)password error:(NSError **)error
+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination overwrite:(BOOL)overwrite password:(nullable NSString *)password error:(NSError **)error
{
return [self unzipFileAtPath:path toDestination:destination overwrite:overwrite password:password error:error delegate:nil progressHandler:nil completionHandler:nil];
return [self unzipFileAtPath:path toDestination:destination preserveAttributes:YES overwrite:overwrite password:password error:error delegate:nil progressHandler:nil completionHandler:nil];
}
+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination delegate:(id<SSZipArchiveDelegate>)delegate
+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination delegate:(nullable id<SSZipArchiveDelegate>)delegate
{
return [self unzipFileAtPath:path toDestination:destination overwrite:YES password:nil error:nil delegate:delegate progressHandler:nil completionHandler:nil];
return [self unzipFileAtPath:path toDestination:destination preserveAttributes:YES overwrite:YES password:nil error:nil delegate:delegate progressHandler:nil completionHandler:nil];
}
+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination overwrite:(BOOL)overwrite password:(NSString *)password error:(NSError **)error delegate:(id<SSZipArchiveDelegate>)delegate
+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination overwrite:(BOOL)overwrite password:(nullable NSString *)password error:(NSError **)error delegate:(nullable id<SSZipArchiveDelegate>)delegate
{
return [self unzipFileAtPath:path toDestination:destination overwrite:overwrite password:password error:error delegate:delegate progressHandler:nil completionHandler:nil];
return [self unzipFileAtPath:path toDestination:destination preserveAttributes:YES overwrite:overwrite password:password error:error delegate:delegate progressHandler:nil completionHandler:nil];
}
+ (BOOL)unzipFileAtPath:(NSString *)path
@@ -53,27 +155,39 @@
overwrite:(BOOL)overwrite
password:(NSString *)password
progressHandler:(void (^)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler
completionHandler:(void (^)(NSString *path, BOOL succeeded, NSError *error))completionHandler
completionHandler:(void (^)(NSString *path, BOOL succeeded, NSError *__nullable error))completionHandler
{
return [self unzipFileAtPath:path toDestination:destination overwrite:overwrite password:password error:nil delegate:nil progressHandler:progressHandler completionHandler:completionHandler];
return [self unzipFileAtPath:path toDestination:destination preserveAttributes:YES overwrite:overwrite password:password error:nil delegate:nil progressHandler:progressHandler completionHandler:completionHandler];
}
+ (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 *error))completionHandler
completionHandler:(void (^)(NSString *path, BOOL succeeded, NSError * __nullable error))completionHandler
{
return [self unzipFileAtPath:path toDestination:destination overwrite:YES password:nil error:nil delegate:nil progressHandler:progressHandler completionHandler:completionHandler];
return [self unzipFileAtPath:path toDestination:destination preserveAttributes:YES overwrite:YES password:nil error:nil delegate:nil progressHandler:progressHandler completionHandler:completionHandler];
}
+ (BOOL)unzipFileAtPath:(NSString *)path
toDestination:(NSString *)destination
preserveAttributes:(BOOL)preserveAttributes
overwrite:(BOOL)overwrite
password:(nullable NSString *)password
error:(NSError * *)error
delegate:(nullable id<SSZipArchiveDelegate>)delegate
{
return [self unzipFileAtPath:path toDestination:destination preserveAttributes:preserveAttributes overwrite:overwrite password:password error:error delegate:delegate progressHandler:nil completionHandler:nil];
}
+ (BOOL)unzipFileAtPath:(NSString *)path
toDestination:(NSString *)destination
preserveAttributes:(BOOL)preserveAttributes
overwrite:(BOOL)overwrite
password:(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 *error))completionHandler
completionHandler:(void (^)(NSString *path, BOOL succeeded, NSError * __nullable error))completionHandler
{
// Begin opening
zipFile zip = unzOpen((const char*)[path UTF8String]);
@@ -121,7 +235,7 @@
int crc_ret =0;
unsigned char buffer[4096] = {0};
NSFileManager *fileManager = [NSFileManager defaultManager];
NSMutableSet *directoriesModificationDates = [[NSMutableSet alloc] init];
NSMutableArray *directoriesModificationDates = [[NSMutableArray alloc] init];
// Message delegate
if ([delegate respondsToSelector:@selector(zipArchiveWillUnzipArchiveAtPath:zipInfo:)]) {
@@ -132,6 +246,7 @@
}
NSInteger currentFileNumber = 0;
NSError *unzippingError;
do {
@autoreleasepool {
if ([password length] == 0) {
@@ -202,11 +317,19 @@
BOOL fileIsSymbolicLink = NO;
if (((fileInfo.version >> 8) == ZipUNIXVersion) && BSD_IFLNK == (BSD_SFMT & (fileInfo.external_fa >> 16))) {
fileIsSymbolicLink = NO;
fileIsSymbolicLink = YES;
}
// Check if it contains directory
NSString *strPath = @(filename);
// NSString * strPath = @(filename);
NSString * strPath = [NSString stringWithCString:filename encoding:NSUTF8StringEncoding];
//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;
@@ -220,21 +343,28 @@
NSString *fullPath = [destination stringByAppendingPathComponent:strPath];
NSError *err = nil;
NSDate *modDate = [[self class] _dateWithMSDOSFormat:(UInt32)fileInfo.dosDate];
NSDictionary *directoryAttr = @{NSFileCreationDate: modDate, NSFileModificationDate: modDate};
NSDictionary *directoryAttr;
if (preserveAttributes) {
NSDate *modDate = [[self class] _dateWithMSDOSFormat:(UInt32)fileInfo.dosDate];
directoryAttr = @{NSFileCreationDate: modDate, NSFileModificationDate: modDate};
[directoriesModificationDates addObject: @{@"path": fullPath, @"modDate": modDate}];
}
if (isDirectory) {
[fileManager createDirectoryAtPath:fullPath withIntermediateDirectories:YES attributes:directoryAttr error:&err];
} else {
[fileManager createDirectoryAtPath:[fullPath stringByDeletingLastPathComponent] withIntermediateDirectories:YES attributes:directoryAttr error:&err];
}
if (nil != err) {
if ([err.domain isEqualToString:NSCocoaErrorDomain] &&
err.code == 640) {
unzippingError = err;
unzCloseCurrentFile(zip);
success = NO;
break;
}
NSLog(@"[SSZipArchive] Error: %@", err.localizedDescription);
}
if(!fileIsSymbolicLink)
[directoriesModificationDates addObject: @{@"path": fullPath, @"modDate": modDate}];
if ([fileManager fileExistsAtPath:fullPath] && !isDirectory && !overwrite) {
//FIXME: couldBe CRC Check?
unzCloseCurrentFile(zip);
@@ -243,61 +373,80 @@
}
if (!fileIsSymbolicLink) {
FILE *fp = fopen((const char*)[fullPath UTF8String], "wb");
while (fp) {
int readBytes = unzReadCurrentFile(zip, buffer, 4096);
if (readBytes > 0) {
fwrite(buffer, readBytes, 1, fp );
} else {
break;
}
}
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];
// ensure we are not creating stale file entries
int readBytes = unzReadCurrentFile(zip, buffer, 4096);
if (readBytes >= 0) {
FILE *fp = fopen((const char*)[fullPath UTF8String], "wb");
while (fp) {
if (readBytes > 0) {
fwrite(buffer, readBytes, 1, fp );
} else {
break;
}
readBytes = unzReadCurrentFile(zip, buffer, 4096);
}
fclose(fp);
// Set the original datetime property
if (fileInfo.dosDate != 0) {
NSDate *orgDate = [[self class] _dateWithMSDOSFormat:(UInt32)fileInfo.dosDate];
NSDictionary *attr = @{NSFileModificationDate: orgDate};
if (attr) {
if ([fileManager setAttributes:attr ofItemAtPath:fullPath error:nil] == NO) {
// Can't set attributes
NSLog(@"[SSZipArchive] Failed to set attributes - whilst setting modification date");
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];
}
}
fclose(fp);
if (preserveAttributes) {
// Set the original datetime property
if (fileInfo.dosDate != 0) {
NSDate *orgDate = [[self class] _dateWithMSDOSFormat:(UInt32)fileInfo.dosDate];
NSDictionary *attr = @{NSFileModificationDate: orgDate};
if (attr) {
if ([fileManager setAttributes:attr ofItemAtPath:fullPath error:nil] == NO) {
// Can't set attributes
NSLog(@"[SSZipArchive] Failed to set attributes - whilst setting modification date");
}
}
}
// Set the original permissions on the file
uLong permissions = fileInfo.external_fa >> 16;
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] == NO) {
// Unable to set the permissions attribute
NSLog(@"[SSZipArchive] Failed to set attributes - whilst setting permissions");
}
#if !__has_feature(objc_arc)
[attrs release];
#endif
}
}
}
// Set the original permissions on the file
uLong permissions = fileInfo.external_fa >> 16;
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] == NO) {
// Unable to set the permissions attribute
NSLog(@"[SSZipArchive] Failed to set attributes - whilst setting permissions");
else
{
// if we couldn't open file descriptor we can validate global errno to see the reason
if (errno == ENOSPC) {
NSError *enospcError = [NSError errorWithDomain:NSPOSIXErrorDomain
code:ENOSPC
userInfo:nil];
unzippingError = enospcError;
unzCloseCurrentFile(zip);
success = NO;
break;
}
#if !__has_feature(objc_arc)
[attrs release];
#endif
}
}
}
@@ -353,19 +502,20 @@
// The process of decompressing the .zip archive causes the modification times on the folders
// to be set to the present time. So, when we are done, they need to be explicitly set.
// set the modification date on all of the directories.
NSError * err = nil;
for (NSDictionary * d in directoriesModificationDates) {
if (![[NSFileManager defaultManager] setAttributes:@{NSFileModificationDate: d[@"modDate"]} ofItemAtPath:d[@"path"] error:&err]) {
NSLog(@"[SSZipArchive] Set attributes failed for directory: %@.", d[@"path"]);
if (success && preserveAttributes) {
NSError * err = nil;
for (NSDictionary * d in directoriesModificationDates) {
if (![[NSFileManager defaultManager] setAttributes:@{NSFileModificationDate: d[@"modDate"]} ofItemAtPath:d[@"path"] error:&err]) {
NSLog(@"[SSZipArchive] Set attributes failed for directory: %@.", d[@"path"]);
}
if (err) {
NSLog(@"[SSZipArchive] Error setting directory file modification date attribute: %@",err.localizedDescription);
}
}
if (err) {
NSLog(@"[SSZipArchive] Error setting directory file modification date attribute: %@",err.localizedDescription);
}
}
#if !__has_feature(objc_arc)
[directoriesModificationDates release];
[directoriesModificationDates release];
#endif
}
// Message delegate
if (success && [delegate respondsToSelector:@selector(zipArchiveDidUnzipArchiveAtPath:zipInfo:unzippedPath:)]) {
@@ -382,13 +532,24 @@
NSDictionary *userInfo = @{NSLocalizedDescriptionKey: @"crc check failed for file"};
retErr = [NSError errorWithDomain:@"SSZipArchiveErrorDomain" code:-3 userInfo:userInfo];
}
if (error)
{
*error = retErr;
if (error) {
if (unzippingError) {
*error = unzippingError;
}
else {
*error = retErr;
}
}
if (completionHandler)
{
completionHandler(path, success, retErr);
if (unzippingError) {
completionHandler(path, success, unzippingError);
}
else
{
completionHandler(path, success, retErr);
}
}
return success;
}
@@ -402,8 +563,8 @@
return [SSZipArchive createZipFileAtPath:path withContentsOfDirectory:directoryPath withPassword:nil];
}
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirector{
return [SSZipArchive createZipFileAtPath:path withContentsOfDirectory:directoryPath keepParentDirectory:keepParentDirector withPassword:nil];
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirectory{
return [SSZipArchive createZipFileAtPath:path withContentsOfDirectory:directoryPath keepParentDirectory:keepParentDirectory withPassword:nil];
}
+ (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray *)paths withPassword:(NSString *)password
@@ -424,12 +585,21 @@
return success;
}
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath withPassword:(NSString *)password{
return [self createZipFileAtPath:path withContentsOfDirectory:directoryPath keepParentDirectory:NO withPassword:password];
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath withPassword:(nullable NSString *)password{
return [SSZipArchive createZipFileAtPath:path withContentsOfDirectory:directoryPath keepParentDirectory:NO withPassword:password];
}
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirectory withPassword:(NSString *)password{
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirectory withPassword:(nullable NSString *)password{
return [SSZipArchive createZipFileAtPath:path
withContentsOfDirectory:directoryPath
keepParentDirectory:keepParentDirectory
withPassword:password
andProgressHandler:nil
];
}
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirectory withPassword:(nullable NSString *)password andProgressHandler:(void(^ _Nullable)(NSUInteger entryNumber, NSUInteger total))progressHandler {
BOOL success = NO;
NSFileManager *fileManager = nil;
@@ -439,28 +609,35 @@
// use a local filemanager (queue/thread compatibility)
fileManager = [[NSFileManager alloc] init];
NSDirectoryEnumerator *dirEnumerator = [fileManager enumeratorAtPath:directoryPath];
NSArray *allObjects = dirEnumerator.allObjects;
NSUInteger total = allObjects.count, complete = 0;
NSString *fileName;
while ((fileName = [dirEnumerator nextObject])) {
for (fileName in allObjects) {
BOOL isDir;
NSString *fullFilePath = [directoryPath stringByAppendingPathComponent:fileName];
[fileManager fileExistsAtPath:fullFilePath isDirectory:&isDir];
if (keepParentDirectory)
{
fileName = [[directoryPath lastPathComponent] stringByAppendingPathComponent:fileName];
}
if (!isDir) {
if (keepParentDirectory)
{
fileName = [[directoryPath lastPathComponent] stringByAppendingPathComponent:fileName];
}
[zipArchive writeFileAtPath:fullFilePath withFileName:fileName withPassword:password];
}
else
{
if([[NSFileManager defaultManager] subpathsOfDirectoryAtPath:fullFilePath error:nil].count == 0)
{
NSString *tempName = [fullFilePath stringByAppendingPathComponent:@".DS_Store"];
[@"" writeToFile:tempName atomically:YES encoding:NSUTF8StringEncoding error:nil];
[zipArchive writeFileAtPath:tempName withFileName:[fileName stringByAppendingPathComponent:@".DS_Store"] withPassword:password];
[[NSFileManager defaultManager] removeItemAtPath:tempName error:nil];
NSString *tempFilePath = [self _temporaryPathForDiscardableFile];
NSString *tempFileFilename = [fileName stringByAppendingPathComponent:tempFilePath.lastPathComponent];
[zipArchive writeFileAtPath:tempFilePath withFileName:tempFileFilename withPassword:password];
}
}
complete++;
if (progressHandler) {
progressHandler(complete, total);
}
}
success = [zipArchive close];
}
@@ -517,7 +694,7 @@
zipInfo->tmz_date.tm_year = (unsigned int)components.year;
}
- (BOOL)writeFolderAtPath:(NSString *)path withFolderName:(NSString *)folderName withPassword:(NSString *)password
- (BOOL)writeFolderAtPath:(NSString *)path withFolderName:(NSString *)folderName withPassword:(nullable NSString *)password
{
NSAssert((_zip != NULL), @"Attempting to write to an archive which was never opened");
@@ -558,7 +735,7 @@
return YES;
}
- (BOOL)writeFile:(NSString *)path withPassword:(NSString *)password;
- (BOOL)writeFile:(NSString *)path withPassword:(nullable NSString *)password;
{
return [self writeFileAtPath:path withFileName:nil withPassword:password];
}
@@ -566,7 +743,7 @@
// 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:(NSString *)fileName withPassword:(NSString *)password
- (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");
@@ -621,7 +798,7 @@
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))
while(!feof(input) && !ferror(input))
{
len = (unsigned int) fread(buffer, 1, CHUNK, input);
zipWriteInFileInZip(_zip, buffer, len);
@@ -633,7 +810,7 @@
return YES;
}
- (BOOL)writeData:(NSData *)data filename:(NSString *)filename withPassword:(NSString *)password;
- (BOOL)writeData:(NSData *)data filename:(nullable NSString *)filename withPassword:(nullable NSString *)password;
{
if (!_zip) {
return NO;
@@ -662,6 +839,21 @@
#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];
discardableFilePath = directoryCreated ? [temporaryDirectory stringByAppendingPathComponent:discardableFileName] : nil;
[@"" writeToFile:discardableFilePath atomically:YES encoding:NSUTF8StringEncoding error:nil];
});
return discardableFilePath;
}
// Format from http://newsgroups.derkeiler.com/Archive/Comp/comp.os.msdos.programmer/2009-04/msg00060.html
// Two consecutive words, or a longword, YYYYYYYMMMMDDDDD hhhhhmmmmmmsssss
// YYYYYYY is years from 1980 = 0
@@ -708,4 +900,4 @@
return date;
}
@end
@end

View File

@@ -78,4 +78,4 @@ typedef struct unz_global_info64
unsigned long size_comment; /* size of the global comment of the zipfile */
} unz_global_info64;
#endif
#endif

View File

@@ -17,4 +17,3 @@ FOUNDATION_EXPORT const unsigned char ZipArchiveVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <ZipArchive/PublicHeader.h>
#import "SSZipArchive.h"

View File

@@ -28,7 +28,7 @@
#include "zlib.h"
#include "unzip.h"
#include "Common.h"
#include "SSZipCommon.h"
#ifdef STDC
# include <stddef.h>
@@ -1190,7 +1190,8 @@ extern int ZEXPORT unzOpenCurrentFile3(unzFile file, int *method, int *level, in
return UNZ_INTERNALERROR;
#ifdef HAVE_AES
if (s->cur_file_info.compression_method == AES_METHOD) {
unsigned char passverify[AES_PWVERIFYSIZE];
unsigned char passverify_archive[AES_PWVERIFYSIZE];
unsigned char passverify_password[AES_PWVERIFYSIZE];
unsigned char saltvalue[AES_MAXSALTLENGTH];
uInt saltlength;
@@ -1202,11 +1203,14 @@ extern int ZEXPORT unzOpenCurrentFile3(unzFile file, int *method, int *level, in
if (ZREAD64(s->z_filefunc, s->filestream, saltvalue, saltlength) != saltlength)
return UNZ_INTERNALERROR;
if (ZREAD64(s->z_filefunc, s->filestream, passverify, AES_PWVERIFYSIZE) != AES_PWVERIFYSIZE)
if (ZREAD64(s->z_filefunc, s->filestream, passverify_archive, AES_PWVERIFYSIZE) != AES_PWVERIFYSIZE)
return UNZ_INTERNALERROR;
fcrypt_init((int)s->cur_file_info_internal.aes_encryption_mode, (unsigned char *)password, (unsigned int)strlen(password), saltvalue,
passverify, &s->pfile_in_zip_read->aes_ctx);
fcrypt_init(s->cur_file_info_internal.aes_encryption_mode, password, strlen(password), saltvalue,
passverify_password, &s->pfile_in_zip_read->aes_ctx);
if (memcmp(passverify_archive, passverify_password, AES_PWVERIFYSIZE) != 0)
return UNZ_BADPASSWORD;
pfile_in_zip_read_info->rest_read_compressed -= saltlength + AES_PWVERIFYSIZE;
pfile_in_zip_read_info->rest_read_compressed -= AES_AUTHCODESIZE;

View File

@@ -14,7 +14,7 @@
See the accompanying LICENSE file for the full text of the license.
*/
#include "Common.h"
#include "SSZipCommon.h"
#ifndef _UNZ_H
#define _UNZ_H
@@ -57,6 +57,7 @@ typedef voidp unzFile;
#define UNZ_BADZIPFILE (-103)
#define UNZ_INTERNALERROR (-104)
#define UNZ_CRCERROR (-105)
#define UNZ_BADPASSWORD (-106)
/***************************************************************************/

View File

@@ -1,14 +1,16 @@
PODS:
- SSZipArchive (1.0.1)
- SSZipArchive (1.7)
DEPENDENCIES:
- SSZipArchive (from `..`)
EXTERNAL SOURCES:
SSZipArchive:
:path: ..
:path: ".."
SPEC CHECKSUMS:
SSZipArchive: 7bfebbf578e47e1c4239a06f0c202101d4d933ab
SSZipArchive: 63f8e11cfcc33e03e4cd666b4359ea8bd6facd0c
COCOAPODS: 0.39.0
PODFILE CHECKSUM: 8d38f966bef0580b1feb382672c12ef6a674ea58
COCOAPODS: 1.1.1

View File

@@ -7,7 +7,6 @@
objects = {
/* Begin PBXBuildFile section */
2B4B24671C21500E00CC99E5 /* mztools.c in Sources */ = {isa = PBXBuildFile; fileRef = 8DFE19391BDA7D8C00709011 /* mztools.c */; };
2B4B24681C21500E00CC99E5 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DFE190E1BDA74F800709011 /* ViewController.swift */; };
2B4B24691C21500E00CC99E5 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DFE190C1BDA74F800709011 /* AppDelegate.swift */; };
2B4B246D1C21500E00CC99E5 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE19151BDA74F800709011 /* LaunchScreen.storyboard */; };
@@ -15,15 +14,14 @@
2B4B246F1C21500E00CC99E5 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE19101BDA74F800709011 /* Main.storyboard */; };
2B4B24701C21500E00CC99E5 /* Sample Data in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE19461BDA82EA00709011 /* Sample Data */; };
57AA942E1C28397000858D82 /* ZipArchive.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 57AA942D1C28397000858D82 /* ZipArchive.framework */; };
5914648EC4509E192D31CA42 /* Pods_SwiftExample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9E81180168B01E0210FE1E3F /* Pods_SwiftExample.framework */; };
8DFE190D1BDA74F800709011 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DFE190C1BDA74F800709011 /* AppDelegate.swift */; };
8DFE190F1BDA74F800709011 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DFE190E1BDA74F800709011 /* ViewController.swift */; };
8DFE19121BDA74F800709011 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE19101BDA74F800709011 /* Main.storyboard */; };
8DFE19141BDA74F800709011 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE19131BDA74F800709011 /* Assets.xcassets */; };
8DFE19171BDA74F800709011 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE19151BDA74F800709011 /* LaunchScreen.storyboard */; };
8DFE19221BDA74F800709011 /* SwiftExampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DFE19211BDA74F800709011 /* SwiftExampleTests.swift */; };
8DFE19421BDA7D8D00709011 /* mztools.c in Sources */ = {isa = PBXBuildFile; fileRef = 8DFE19391BDA7D8C00709011 /* mztools.c */; };
8DFE19471BDA82EA00709011 /* Sample Data in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE19461BDA82EA00709011 /* Sample Data */; };
9C98C3B4F9B653B83DA9D5F1 /* Pods_SwiftExample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B957B9DCEA770A395AA9EF69 /* Pods_SwiftExample.framework */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -37,6 +35,7 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
0212314D326774BDFEDFFEB1 /* Pods-SwiftExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftExample.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwiftExample/Pods-SwiftExample.release.xcconfig"; sourceTree = "<group>"; };
2B4B24761C21500E00CC99E5 /* SwiftExampleCarthage.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwiftExampleCarthage.app; sourceTree = BUILT_PRODUCTS_DIR; };
2B4B247A1C21508900CC99E5 /* ZipArchive.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ZipArchive.framework; path = ../Carthage/Build/iOS/ZipArchive.framework; sourceTree = "<group>"; };
57AA942D1C28397000858D82 /* ZipArchive.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ZipArchive.framework; path = Carthage/Build/iOS/ZipArchive.framework; sourceTree = "<group>"; };
@@ -50,22 +49,9 @@
8DFE191D1BDA74F800709011 /* SwiftExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwiftExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
8DFE19211BDA74F800709011 /* SwiftExampleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftExampleTests.swift; sourceTree = "<group>"; };
8DFE19231BDA74F800709011 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
8DFE19341BDA7D8C00709011 /* Common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Common.h; sourceTree = "<group>"; };
8DFE19361BDA7D8C00709011 /* crypt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypt.h; sourceTree = "<group>"; };
8DFE19371BDA7D8C00709011 /* ioapi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ioapi.c; sourceTree = "<group>"; };
8DFE19381BDA7D8C00709011 /* ioapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ioapi.h; sourceTree = "<group>"; };
8DFE19391BDA7D8C00709011 /* mztools.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mztools.c; sourceTree = "<group>"; };
8DFE193A1BDA7D8C00709011 /* mztools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mztools.h; sourceTree = "<group>"; };
8DFE193B1BDA7D8C00709011 /* unzip.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = unzip.c; sourceTree = "<group>"; };
8DFE193C1BDA7D8C00709011 /* unzip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = unzip.h; sourceTree = "<group>"; };
8DFE193D1BDA7D8C00709011 /* zip.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip.c; sourceTree = "<group>"; };
8DFE193E1BDA7D8C00709011 /* zip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = zip.h; sourceTree = "<group>"; };
8DFE193F1BDA7D8C00709011 /* SSZipArchive.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSZipArchive.h; sourceTree = "<group>"; };
8DFE19401BDA7D8D00709011 /* SSZipArchive.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSZipArchive.m; sourceTree = "<group>"; };
8DFE19461BDA82EA00709011 /* Sample Data */ = {isa = PBXFileReference; lastKnownFileType = folder; path = "Sample Data"; sourceTree = "<group>"; };
9E81180168B01E0210FE1E3F /* Pods_SwiftExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwiftExample.framework; sourceTree = BUILT_PRODUCTS_DIR; };
EDFB736C117CB42411E221E3 /* Pods-SwiftExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftExample.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwiftExample/Pods-SwiftExample.release.xcconfig"; sourceTree = "<group>"; };
FA88DF2AF701AB45DE8B7EB5 /* Pods-SwiftExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftExample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwiftExample/Pods-SwiftExample.debug.xcconfig"; sourceTree = "<group>"; };
9F41DD1EB899AECA3DE54836 /* Pods-SwiftExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftExample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwiftExample/Pods-SwiftExample.debug.xcconfig"; sourceTree = "<group>"; };
B957B9DCEA770A395AA9EF69 /* Pods_SwiftExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwiftExample.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -81,7 +67,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
5914648EC4509E192D31CA42 /* Pods_SwiftExample.framework in Frameworks */,
9C98C3B4F9B653B83DA9D5F1 /* Pods_SwiftExample.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -100,20 +86,28 @@
children = (
57AA942D1C28397000858D82 /* ZipArchive.framework */,
2B4B247A1C21508900CC99E5 /* ZipArchive.framework */,
9E81180168B01E0210FE1E3F /* Pods_SwiftExample.framework */,
B957B9DCEA770A395AA9EF69 /* Pods_SwiftExample.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
54361C0DE261FF7F98753E58 /* Pods */ = {
isa = PBXGroup;
children = (
9F41DD1EB899AECA3DE54836 /* Pods-SwiftExample.debug.xcconfig */,
0212314D326774BDFEDFFEB1 /* Pods-SwiftExample.release.xcconfig */,
);
name = Pods;
sourceTree = "<group>";
};
8DFE19001BDA74F800709011 = {
isa = PBXGroup;
children = (
8DFE19331BDA7D8C00709011 /* SSZipArchive */,
8DFE190B1BDA74F800709011 /* SwiftExample */,
8DFE19201BDA74F800709011 /* SwiftExampleTests */,
8DFE190A1BDA74F800709011 /* Products */,
F5943061786EAFF4CAE16D45 /* Pods */,
1B67DA700507825BD99DCEA7 /* Frameworks */,
54361C0DE261FF7F98753E58 /* Pods */,
);
sourceTree = "<group>";
};
@@ -150,43 +144,6 @@
path = SwiftExampleTests;
sourceTree = "<group>";
};
8DFE19331BDA7D8C00709011 /* SSZipArchive */ = {
isa = PBXGroup;
children = (
8DFE19341BDA7D8C00709011 /* Common.h */,
8DFE193F1BDA7D8C00709011 /* SSZipArchive.h */,
8DFE19401BDA7D8D00709011 /* SSZipArchive.m */,
8DFE19351BDA7D8C00709011 /* minizip */,
);
name = SSZipArchive;
path = ../SSZipArchive;
sourceTree = "<group>";
};
8DFE19351BDA7D8C00709011 /* minizip */ = {
isa = PBXGroup;
children = (
8DFE19361BDA7D8C00709011 /* crypt.h */,
8DFE19371BDA7D8C00709011 /* ioapi.c */,
8DFE19381BDA7D8C00709011 /* ioapi.h */,
8DFE19391BDA7D8C00709011 /* mztools.c */,
8DFE193A1BDA7D8C00709011 /* mztools.h */,
8DFE193B1BDA7D8C00709011 /* unzip.c */,
8DFE193C1BDA7D8C00709011 /* unzip.h */,
8DFE193D1BDA7D8C00709011 /* zip.c */,
8DFE193E1BDA7D8C00709011 /* zip.h */,
);
path = minizip;
sourceTree = "<group>";
};
F5943061786EAFF4CAE16D45 /* Pods */ = {
isa = PBXGroup;
children = (
FA88DF2AF701AB45DE8B7EB5 /* Pods-SwiftExample.debug.xcconfig */,
EDFB736C117CB42411E221E3 /* Pods-SwiftExample.release.xcconfig */,
);
name = Pods;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -212,12 +169,12 @@
isa = PBXNativeTarget;
buildConfigurationList = 8DFE19261BDA74F800709011 /* Build configuration list for PBXNativeTarget "SwiftExample" */;
buildPhases = (
E78B00A33CAF266DB67D6E49 /* Check Pods Manifest.lock */,
ECE84F3FFB46950DAF6EE569 /* [CP] Check Pods Manifest.lock */,
8DFE19051BDA74F800709011 /* Sources */,
8DFE19061BDA74F800709011 /* Frameworks */,
8DFE19071BDA74F800709011 /* Resources */,
AEFD7A965DD623210F3FCEAA /* Embed Pods Frameworks */,
D85ACD9C6E611B2AC2024437 /* Copy Pods Resources */,
DCD3E35CEAE544A09342C9A1 /* [CP] Embed Pods Frameworks */,
7D37585779E4135FA4161527 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
@@ -253,13 +210,15 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0710;
LastUpgradeCheck = 0710;
LastUpgradeCheck = 0800;
TargetAttributes = {
8DFE19081BDA74F800709011 = {
CreatedOnToolsVersion = 7.1;
LastSwiftMigration = 0820;
};
8DFE191C1BDA74F800709011 = {
CreatedOnToolsVersion = 7.1;
LastSwiftMigration = 0820;
TestTargetID = 8DFE19081BDA74F800709011;
};
};
@@ -332,29 +291,14 @@
shellScript = "/usr/local/bin/carthage copy-frameworks";
showEnvVarsInLog = 0;
};
AEFD7A965DD623210F3FCEAA /* Embed Pods Frameworks */ = {
7D37585779E4135FA4161527 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Embed Pods Frameworks";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwiftExample/Pods-SwiftExample-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
D85ACD9C6E611B2AC2024437 /* Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Copy Pods Resources";
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
@@ -362,19 +306,34 @@
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwiftExample/Pods-SwiftExample-resources.sh\"\n";
showEnvVarsInLog = 0;
};
E78B00A33CAF266DB67D6E49 /* Check Pods Manifest.lock */ = {
DCD3E35CEAE544A09342C9A1 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Check Pods Manifest.lock";
name = "[CP] Embed Pods Frameworks";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwiftExample/Pods-SwiftExample-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
ECE84F3FFB46950DAF6EE569 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../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";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
@@ -384,7 +343,6 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
2B4B24671C21500E00CC99E5 /* mztools.c in Sources */,
2B4B24681C21500E00CC99E5 /* ViewController.swift in Sources */,
2B4B24691C21500E00CC99E5 /* AppDelegate.swift in Sources */,
);
@@ -394,7 +352,6 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8DFE19421BDA7D8D00709011 /* mztools.c in Sources */,
8DFE190F1BDA74F800709011 /* ViewController.swift in Sources */,
8DFE190D1BDA74F800709011 /* AppDelegate.swift in Sources */,
);
@@ -451,6 +408,7 @@
OTHER_SWIFT_FLAGS = "-DUseCarthage";
PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.SwiftExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Debug;
};
@@ -467,6 +425,7 @@
OTHER_SWIFT_FLAGS = "-DUseCarthage";
PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.SwiftExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Release;
};
@@ -483,8 +442,10 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -528,8 +489,10 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -548,6 +511,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 9.1;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
@@ -555,25 +519,27 @@
};
8DFE19271BDA74F800709011 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = FA88DF2AF701AB45DE8B7EB5 /* Pods-SwiftExample.debug.xcconfig */;
baseConfigurationReference = 9F41DD1EB899AECA3DE54836 /* Pods-SwiftExample.debug.xcconfig */;
buildSettings = {
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_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Debug;
};
8DFE19281BDA74F800709011 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = EDFB736C117CB42411E221E3 /* Pods-SwiftExample.release.xcconfig */;
baseConfigurationReference = 0212314D326774BDFEDFFEB1 /* Pods-SwiftExample.release.xcconfig */;
buildSettings = {
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_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Release;
};
@@ -585,6 +551,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.SwiftExampleTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwiftExample.app/SwiftExample";
};
name = Debug;
@@ -597,6 +564,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.SwiftExampleTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwiftExample.app/SwiftExample";
};
name = Release;

View File

@@ -14,30 +14,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
func applicationWillResignActive(application: UIApplication) {
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}
func applicationDidEnterBackground(application: UIApplication) {
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(application: UIApplication) {
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(application: UIApplication) {
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(application: UIApplication) {
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

View File

@@ -1,7 +1,12 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8150" systemVersion="15A204g" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<?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" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina5_5" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8122"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
@@ -13,10 +18,9 @@
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<rect key="frame" x="0.0" y="0.0" width="414" height="736"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<animations/>
<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"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>

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="9059" systemVersion="15B42" 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="11762" systemVersion="16D32" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina5_5" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9049"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
<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,57 +19,67 @@
<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="414" height="736"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Uwd-kM-cdh">
<rect key="frame" x="244" y="51" width="113" height="30"/>
<animations/>
<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"/>
<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" fixedFrame="YES" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="XUJ-IR-RIS">
<rect key="frame" x="235" y="89" width="131" height="30"/>
<animations/>
<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"/>
<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" fixedFrame="YES" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Lbq-oS-Rlj">
<rect key="frame" x="281" y="214" width="39" height="30"/>
<animations/>
<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"/>
<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" fixedFrame="YES" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="09F-6Q-slx" userLabel="File1">
<rect key="frame" x="67" y="127" width="480" height="21"/>
<animations/>
<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"/>
<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" fixedFrame="YES" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="PSK-Jd-Mwc" userLabel="File2">
<rect key="frame" x="67" y="156" width="480" height="21"/>
<animations/>
<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"/>
<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" fixedFrame="YES" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="pW5-rw-iqM" userLabel="File3">
<rect key="frame" x="67" y="185" width="480" height="21"/>
<animations/>
<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"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<animations/>
<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 firstAttribute="trailingMargin" secondItem="09F-6Q-slx" secondAttribute="trailing" constant="33" 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="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="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="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="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>
<connections>
<outlet property="file1" destination="09F-6Q-slx" id="Rmp-Xl-xfc"/>

View File

@@ -0,0 +1,9 @@
# 1
** This is a test **
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non ex turpis. Quisque quis porttitor nunc, sed sollicitudin urna. Aliquam ullamcorper ante fringilla ipsum feugiat egestas. Praesent a dapibus nisi. Proin dignissim non elit sit amet vestibulum. Proin et velit sit amet eros pretium maximus. Suspendisse potenti. Integer dolor felis, vehicula a ipsum vel, faucibus sodales nunc. Nam luctus nunc at malesuada pretium. Suspendisse nec leo in massa ultricies euismod at sed tortor. Nullam eleifend massa eget ultrices sollicitudin. Praesent id dolor vestibulum, mattis nisi ac, semper mi. Aenean justo dui, sollicitudin ut cursus eu, bibendum quis purus. Duis nec nisl augue.
In et leo in lacus ultricies congue. Sed quis erat ex. Proin tristique leo tincidunt justo hendrerit luctus. Nam mattis fringilla sapien a tincidunt. Nulla ultricies ut ex ac imperdiet. Proin tristique sit amet est nec facilisis. Donec rutrum mauris a pellentesque mollis. Cras blandit arcu at sem vulputate commodo. Mauris ipsum massa, hendrerit vitae cursus sed, malesuada at augue. Aenean nec nisi purus. In lacus mi, luctus id mattis vitae, lacinia sit amet mi. Mauris mollis convallis velit vel vestibulum. Praesent scelerisque eros tellus, sit amet varius massa eleifend et. Duis quis vehicula nisi, vel ultrices mi. Duis eu ipsum ac lorem dignissim semper vel sed nulla.
Aenean tempus placerat aliquam. Nam accumsan sapien eu ex pretium ullamcorper. Fusce ac risus tortor. Praesent gravida ultricies magna eu aliquam. Nam facilisis lobortis ante vitae imperdiet. Pellentesque metus quam, fermentum sed posuere sed, iaculis in tellus. Donec consequat dui vel nibh mollis porta. Proin sit amet consectetur nisl. Integer tellus justo, imperdiet commodo est at, condimentum viverra est. Maecenas nec erat pharetra, laoreet odio non, rhoncus felis. Curabitur id ex aliquam, mattis massa quis, facilisis ex.

View File

@@ -0,0 +1,7 @@
# Test # 2
** This is a second test file **
Morbi vel metus quis lorem tincidunt tempus sit amet quis magna. Nullam dolor dolor, eleifend in vestibulum nec, auctor at ipsum. Nullam viverra neque eros, a vehicula lacus tempus vitae. In sapien sapien, gravida mollis lectus sed, luctus egestas massa. Donec mollis tortor sit amet erat gravida ornare at sed felis. In ornare posuere velit, quis ultrices velit porta eget. Proin eu ultrices felis, eu finibus dolor. Quisque ultrices id libero at euismod. Sed mollis lacus id leo dignissim condimentum eget ac nunc. Vestibulum sed congue velit. Curabitur semper non lorem vel cursus. Ut sed augue purus. Sed sit amet faucibus ante, vel blandit justo. Duis id lacinia ex. Nullam pulvinar eget lacus in tristique. Nam et odio consequat, vehicula mauris ut, vulputate mi.
Pellentesque feugiat, nulla in dictum lacinia, risus sapien aliquam magna, vitae efficitur neque mauris sagittis neque. Etiam eu hendrerit erat. Vestibulum aliquet sapien sed fermentum ultricies. Maecenas eu risus nec turpis semper consequat. Cras nisl diam, consequat ut orci nec, rutrum cursus est. Quisque dictum nunc leo, lobortis lacinia nisl ultrices eget. Ut imperdiet eu libero quis blandit. Nunc blandit, leo quis rutrum auctor, ex tortor vehicula sem, eu ultrices ipsum mi vel arcu. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;

View File

@@ -1,9 +0,0 @@
# China to ban ivory trade
**HONG KONG** — It could be the beginning of the end for the illicit trade in ivory.
Last month, on a state visit to Washington, Chinese President Xi Jinping promised to stop the commercial trade in ivory in his country but gave few details about the timing and extent of such a move.
Now, a senior U.S. government official says that the Chinese ban could be in place within a year or so, with very narrow exceptions, describing it as a “huge” deal.
Such a move, conservationists say, would be a major step toward ending the poaching crisis that is decimating Africas elephant herds.

View File

@@ -1,9 +0,0 @@
# Kerry in Syria
**VIENNA** — The war raging in Syria took center stage for Secretary of State John F. Kerry on Friday as he kicked off a series of meetings with diplomats seeking common ground on a strategy to resolve the grinding conflict.
But the foreign ministers of the three countries meeting with Kerry — Russia, Saudi Arabia and NATO-member Turkey — carry sharply competing views on how to proceed.
Saudi Arabia and Turkey, the neighboring country that has been overwhelmed with Syrian refugees, agree with Washington that Syrian President Bashar Al-Assad should eventually leave power.
Moscow is one of Assads biggest backers, and in recent weeks has positioned its military in Syria and conducted heavy airstrikes that have allowed Assads forces to resume ground offensives. The Russian military intervention also has alarmed the Pentagon, which is leading a separate air campaign against the Islamic State.

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

View File

@@ -29,6 +29,10 @@ class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
file1.text = ""
file2.text = ""
file3.text = ""
}
override func didReceiveMemoryWarning() {
@@ -39,13 +43,13 @@ class ViewController: UIViewController {
// MARK: IBAction
@IBAction func zipPressed(_: UIButton) {
let sampleDataPath = NSBundle.mainBundle().bundleURL.URLByAppendingPathComponent("Sample Data").path
let sampleDataPath = Bundle.main.bundleURL.appendingPathComponent("Sample Data").path
zipPath = tempZipPath()
let success = SSZipArchive.createZipFileAtPath(zipPath, withContentsOfDirectory: sampleDataPath)
let success = SSZipArchive.createZipFile(atPath: zipPath!, withContentsOfDirectory: sampleDataPath)
if success {
unzipButton.enabled = true
zipButton.enabled = false
unzipButton.isEnabled = true
zipButton.isEnabled = false
}
}
@@ -58,19 +62,19 @@ class ViewController: UIViewController {
return
}
let success = SSZipArchive.unzipFileAtPath(zipPath, toDestination: unzipPath)
let success = SSZipArchive.unzipFile(atPath: zipPath, toDestination: unzipPath)
if !success {
return
}
var items: [String]
do {
items = try NSFileManager.defaultManager().contentsOfDirectoryAtPath(unzipPath)
items = try FileManager.default.contentsOfDirectory(atPath: unzipPath)
} catch {
return
}
for (index, item) in items.enumerate() {
for (index, item) in items.enumerated() {
switch index {
case 0:
file1.text = item
@@ -83,43 +87,40 @@ class ViewController: UIViewController {
}
}
unzipButton.enabled = false
resetButton.enabled = true
unzipButton.isEnabled = false
resetButton.isEnabled = true
}
@IBAction func resetPressed(_: UIButton) {
file1.text = ""
file2.text = ""
file3.text = ""
zipButton.enabled = true
unzipButton.enabled = false
resetButton.enabled = false
zipButton.isEnabled = true
unzipButton.isEnabled = false
resetButton.isEnabled = false
}
// MARK: Private
func tempZipPath() -> String {
var path = NSSearchPathForDirectoriesInDomains(.CachesDirectory, .UserDomainMask, true)[0]
path += "/\(NSUUID().UUIDString).zip"
var path = NSSearchPathForDirectoriesInDomains(.cachesDirectory, .userDomainMask, true)[0]
path += "/\(UUID().uuidString).zip"
return path
}
func tempUnzipPath() -> String? {
var path = NSSearchPathForDirectoriesInDomains(.CachesDirectory, .UserDomainMask, true)[0]
path += "/\(NSUUID().UUIDString)"
let url = NSURL(fileURLWithPath: path)
var path = NSSearchPathForDirectoriesInDomains(.cachesDirectory, .userDomainMask, true)[0]
path += "/\(UUID().uuidString)"
let url = URL(fileURLWithPath: path)
do {
try NSFileManager.defaultManager().createDirectoryAtURL(url, withIntermediateDirectories: true, attributes: nil)
try FileManager.default.createDirectory(at: url, withIntermediateDirectories: true, attributes: nil)
} catch {
return nil
}
if let path = url.path {
return path
}
return nil
return url.path
}
}

View File

@@ -28,7 +28,7 @@ class SwiftExampleTests: XCTestCase {
func testPerformanceExample() {
// This is an example of a performance test case.
self.measureBlock {
self.measure {
// Put the code you want to measure the time of here.
}
}

View File

@@ -7,10 +7,12 @@
objects = {
/* Begin PBXBuildFile section */
01DB08731D88095600D335B9 /* 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 */; };
AFF75A301C37280900F450AC /* Common.h in Headers */ = {isa = PBXBuildFile; fileRef = B423AE3C1C0DF7950004A2F1 /* Common.h */; settings = {ATTRIBUTES = (Public, ); }; };
AFF75A311C37281700F450AC /* aes.h in Headers */ = {isa = PBXBuildFile; fileRef = B423AE271C0DF7950004A2F1 /* aes.h */; };
AFF75A321C37281700F450AC /* aes_via_ace.h in Headers */ = {isa = PBXBuildFile; fileRef = B423AE281C0DF7950004A2F1 /* aes_via_ace.h */; };
AFF75A331C37281700F450AC /* aescrypt.c in Sources */ = {isa = PBXBuildFile; fileRef = B423AE291C0DF7950004A2F1 /* aescrypt.c */; };
@@ -63,7 +65,6 @@
B423AE5D1C0DF7950004A2F1 /* pwd2key.h in Headers */ = {isa = PBXBuildFile; fileRef = B423AE391C0DF7950004A2F1 /* pwd2key.h */; };
B423AE5E1C0DF7950004A2F1 /* sha1.c in Sources */ = {isa = PBXBuildFile; fileRef = B423AE3A1C0DF7950004A2F1 /* sha1.c */; };
B423AE5F1C0DF7950004A2F1 /* sha1.h in Headers */ = {isa = PBXBuildFile; fileRef = B423AE3B1C0DF7950004A2F1 /* sha1.h */; };
B423AE601C0DF7950004A2F1 /* Common.h in Headers */ = {isa = PBXBuildFile; fileRef = B423AE3C1C0DF7950004A2F1 /* Common.h */; settings = {ATTRIBUTES = (Public, ); }; };
B423AE621C0DF7950004A2F1 /* crypt.h in Headers */ = {isa = PBXBuildFile; fileRef = B423AE3F1C0DF7950004A2F1 /* crypt.h */; };
B423AE631C0DF7950004A2F1 /* ioapi.c in Sources */ = {isa = PBXBuildFile; fileRef = B423AE401C0DF7950004A2F1 /* ioapi.c */; };
B423AE641C0DF7950004A2F1 /* ioapi.h in Headers */ = {isa = PBXBuildFile; fileRef = B423AE411C0DF7950004A2F1 /* ioapi.h */; };
@@ -80,6 +81,8 @@
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
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; };
B423AE271C0DF7950004A2F1 /* aes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aes.h; sourceTree = "<group>"; };
@@ -103,7 +106,6 @@
B423AE391C0DF7950004A2F1 /* pwd2key.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pwd2key.h; sourceTree = "<group>"; };
B423AE3A1C0DF7950004A2F1 /* sha1.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sha1.c; sourceTree = "<group>"; };
B423AE3B1C0DF7950004A2F1 /* sha1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sha1.h; sourceTree = "<group>"; };
B423AE3C1C0DF7950004A2F1 /* Common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Common.h; sourceTree = "<group>"; };
B423AE3D1C0DF7950004A2F1 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
B423AE3F1C0DF7950004A2F1 /* crypt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypt.h; sourceTree = "<group>"; };
B423AE401C0DF7950004A2F1 /* ioapi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ioapi.c; sourceTree = "<group>"; };
@@ -161,12 +163,13 @@
B423AE251C0DF7950004A2F1 /* SSZipArchive */ = {
isa = PBXGroup;
children = (
389869341D5BC30100F18782 /* SSZipCommon.h */,
B423AE261C0DF7950004A2F1 /* aes */,
B423AE3C1C0DF7950004A2F1 /* Common.h */,
B423AE3D1C0DF7950004A2F1 /* Info.plist */,
B423AE3E1C0DF7950004A2F1 /* minizip */,
B423AE481C0DF7950004A2F1 /* SSZipArchive.h */,
B423AE491C0DF7950004A2F1 /* SSZipArchive.m */,
87ACF3E91D2DAFAD00ED2F7E /* SSZipArchive+Swift.swift */,
B423AE4A1C0DF7950004A2F1 /* ZipArchive.h */,
);
path = SSZipArchive;
@@ -228,6 +231,7 @@
AFF75A311C37281700F450AC /* aes.h in Headers */,
AFF75A3F1C37281700F450AC /* hmac.h in Headers */,
AFF75A3D1C37281700F450AC /* fileenc.h in Headers */,
01DB08731D88095600D335B9 /* SSZipCommon.h in Headers */,
AFF75A2D1C3727F000F450AC /* ZipArchive.h in Headers */,
AFF75A351C37281700F450AC /* aesopt.h in Headers */,
AFF75A381C37281700F450AC /* brg_endian.h in Headers */,
@@ -236,7 +240,6 @@
AFF75A451C37281700F450AC /* sha1.h in Headers */,
AFF75A4C1C37282700F450AC /* unzip.h in Headers */,
AFF75A4A1C37282700F450AC /* mztools.h in Headers */,
AFF75A301C37280900F450AC /* Common.h in Headers */,
AFF75A371C37281700F450AC /* aestab.h in Headers */,
AFF75A3B1C37281700F450AC /* entropy.h in Headers */,
AFF75A481C37282700F450AC /* ioapi.h in Headers */,
@@ -251,8 +254,8 @@
buildActionMask = 2147483647;
files = (
B423AE6D1C0DF7950004A2F1 /* ZipArchive.h in Headers */,
B423AE601C0DF7950004A2F1 /* Common.h in Headers */,
B423AE6B1C0DF7950004A2F1 /* SSZipArchive.h in Headers */,
389869351D5BC30100F18782 /* SSZipCommon.h in Headers */,
B423AE6A1C0DF7950004A2F1 /* zip.h in Headers */,
B423AE5F1C0DF7950004A2F1 /* sha1.h in Headers */,
B423AE551C0DF7950004A2F1 /* entropy.h in Headers */,
@@ -318,7 +321,8 @@
B423AE111C0DF76A0004A2F1 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0710;
LastSwiftUpdateCheck = 0730;
LastUpgradeCheck = 0820;
ORGANIZATIONNAME = smumryak;
TargetAttributes = {
AFF75A231C37279600F450AC = {
@@ -326,6 +330,7 @@
};
B423AE191C0DF76A0004A2F1 = {
CreatedOnToolsVersion = 7.1.1;
LastSwiftMigration = 0820;
};
};
};
@@ -392,6 +397,7 @@
files = (
B423AE5C1C0DF7950004A2F1 /* pwd2key.c in Sources */,
B423AE581C0DF7950004A2F1 /* hmac.c in Sources */,
87ACF3EA1D2DAFAD00ED2F7E /* SSZipArchive+Swift.swift in Sources */,
B423AE4D1C0DF7950004A2F1 /* aescrypt.c in Sources */,
B423AE5E1C0DF7950004A2F1 /* sha1.c in Sources */,
B423AE631C0DF7950004A2F1 /* ioapi.c in Sources */,
@@ -466,8 +472,10 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
@@ -512,8 +520,10 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = YES;
@@ -532,6 +542,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 9.1;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
@@ -544,7 +555,9 @@
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = YES;
BITCODE_GENERATION_MODE = marker;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
@@ -556,6 +569,8 @@
PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.ZipArchive;
PRODUCT_NAME = "$(PROJECT_NAME)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
};
name = Debug;
};
@@ -564,7 +579,9 @@
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = YES;
BITCODE_GENERATION_MODE = bitcode;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
@@ -576,6 +593,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.ZipArchive;
PRODUCT_NAME = "$(PROJECT_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
};
name = Release;
};
@@ -589,6 +607,7 @@
AFF75A2B1C37279600F450AC /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
B423AE141C0DF76A0004A2F1 /* Build configuration list for PBXProject "ZipArchive" */ = {
isa = XCConfigurationList;

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0720"
LastUpgradeVersion = "0820"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0720"
LastUpgradeVersion = "0820"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"