@appzung/react-native-code-push 8.3.2 → 9.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/CodePush.podspec +3 -3
  2. package/README.md +3 -1
  3. package/android/app/build.gradle +2 -0
  4. package/android/app/src/main/AndroidManifest.xml +1 -2
  5. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUpdateUtils.java +15 -8
  6. package/android/build.gradle +3 -0
  7. package/ios/CodePush/CodePush.m +2 -1
  8. package/ios/CodePush/SSZipArchive/Info.plist +26 -0
  9. package/ios/CodePush/SSZipArchive/README.md +1 -1
  10. package/ios/CodePush/SSZipArchive/SSZipArchive.h +129 -27
  11. package/ios/CodePush/SSZipArchive/SSZipArchive.m +1119 -314
  12. package/ios/CodePush/SSZipArchive/SSZipCommon.h +71 -0
  13. package/ios/CodePush/SSZipArchive/Supporting Files/PrivacyInfo.xcprivacy +23 -0
  14. package/ios/CodePush/SSZipArchive/include/ZipArchive.h +25 -0
  15. package/ios/CodePush/SSZipArchive/minizip/LICENSE +17 -0
  16. package/ios/CodePush/SSZipArchive/minizip/mz.h +273 -0
  17. package/ios/CodePush/SSZipArchive/minizip/mz_compat.c +1306 -0
  18. package/ios/CodePush/SSZipArchive/minizip/mz_compat.h +346 -0
  19. package/ios/CodePush/SSZipArchive/minizip/mz_crypt.c +187 -0
  20. package/ios/CodePush/SSZipArchive/minizip/mz_crypt.h +65 -0
  21. package/ios/CodePush/SSZipArchive/minizip/mz_crypt_apple.c +526 -0
  22. package/ios/CodePush/SSZipArchive/minizip/mz_os.c +348 -0
  23. package/ios/CodePush/SSZipArchive/minizip/mz_os.h +176 -0
  24. package/ios/CodePush/SSZipArchive/minizip/mz_os_posix.c +350 -0
  25. package/ios/CodePush/SSZipArchive/minizip/mz_strm.c +556 -0
  26. package/ios/CodePush/SSZipArchive/minizip/mz_strm.h +132 -0
  27. package/ios/CodePush/SSZipArchive/minizip/mz_strm_buf.c +383 -0
  28. package/ios/CodePush/SSZipArchive/minizip/mz_strm_buf.h +42 -0
  29. package/ios/CodePush/SSZipArchive/minizip/mz_strm_mem.c +269 -0
  30. package/ios/CodePush/SSZipArchive/minizip/mz_strm_mem.h +48 -0
  31. package/ios/CodePush/SSZipArchive/minizip/mz_strm_os.h +40 -0
  32. package/ios/CodePush/SSZipArchive/minizip/mz_strm_os_posix.c +203 -0
  33. package/ios/CodePush/SSZipArchive/minizip/mz_strm_pkcrypt.c +334 -0
  34. package/ios/CodePush/SSZipArchive/minizip/mz_strm_pkcrypt.h +46 -0
  35. package/ios/CodePush/SSZipArchive/minizip/mz_strm_split.c +429 -0
  36. package/ios/CodePush/SSZipArchive/minizip/mz_strm_split.h +43 -0
  37. package/ios/CodePush/SSZipArchive/minizip/mz_strm_wzaes.c +360 -0
  38. package/ios/CodePush/SSZipArchive/minizip/mz_strm_wzaes.h +46 -0
  39. package/ios/CodePush/SSZipArchive/minizip/mz_strm_zlib.c +389 -0
  40. package/ios/CodePush/SSZipArchive/minizip/mz_strm_zlib.h +43 -0
  41. package/ios/CodePush/SSZipArchive/minizip/mz_zip.c +2782 -0
  42. package/ios/CodePush/SSZipArchive/minizip/mz_zip.h +262 -0
  43. package/ios/CodePush/SSZipArchive/minizip/mz_zip_rw.c +1942 -0
  44. package/ios/CodePush/SSZipArchive/minizip/mz_zip_rw.h +285 -0
  45. package/ios/CodePush.xcodeproj/project.pbxproj +245 -130
  46. package/ios/PrivacyInfo.xcprivacy +31 -0
  47. package/package.json +2 -2
  48. package/ios/CodePush/SSZipArchive/Common.h +0 -81
  49. package/ios/CodePush/SSZipArchive/aes/aes.h +0 -198
  50. package/ios/CodePush/SSZipArchive/aes/aes_via_ace.h +0 -541
  51. package/ios/CodePush/SSZipArchive/aes/aescrypt.c +0 -294
  52. package/ios/CodePush/SSZipArchive/aes/aeskey.c +0 -548
  53. package/ios/CodePush/SSZipArchive/aes/aesopt.h +0 -739
  54. package/ios/CodePush/SSZipArchive/aes/aestab.c +0 -391
  55. package/ios/CodePush/SSZipArchive/aes/aestab.h +0 -173
  56. package/ios/CodePush/SSZipArchive/aes/brg_endian.h +0 -126
  57. package/ios/CodePush/SSZipArchive/aes/brg_types.h +0 -219
  58. package/ios/CodePush/SSZipArchive/aes/entropy.c +0 -54
  59. package/ios/CodePush/SSZipArchive/aes/entropy.h +0 -16
  60. package/ios/CodePush/SSZipArchive/aes/fileenc.c +0 -144
  61. package/ios/CodePush/SSZipArchive/aes/fileenc.h +0 -121
  62. package/ios/CodePush/SSZipArchive/aes/hmac.c +0 -145
  63. package/ios/CodePush/SSZipArchive/aes/hmac.h +0 -103
  64. package/ios/CodePush/SSZipArchive/aes/prng.c +0 -155
  65. package/ios/CodePush/SSZipArchive/aes/prng.h +0 -82
  66. package/ios/CodePush/SSZipArchive/aes/pwd2key.c +0 -103
  67. package/ios/CodePush/SSZipArchive/aes/pwd2key.h +0 -57
  68. package/ios/CodePush/SSZipArchive/aes/sha1.c +0 -258
  69. package/ios/CodePush/SSZipArchive/aes/sha1.h +0 -73
  70. package/ios/CodePush/SSZipArchive/minizip/crypt.h +0 -130
  71. package/ios/CodePush/SSZipArchive/minizip/ioapi.c +0 -369
  72. package/ios/CodePush/SSZipArchive/minizip/ioapi.h +0 -175
  73. package/ios/CodePush/SSZipArchive/minizip/mztools.c +0 -284
  74. package/ios/CodePush/SSZipArchive/minizip/mztools.h +0 -31
  75. package/ios/CodePush/SSZipArchive/minizip/unzip.c +0 -1839
  76. package/ios/CodePush/SSZipArchive/minizip/unzip.h +0 -248
  77. package/ios/CodePush/SSZipArchive/minizip/zip.c +0 -1910
  78. package/ios/CodePush/SSZipArchive/minizip/zip.h +0 -202
package/CodePush.podspec CHANGED
@@ -10,8 +10,8 @@ Pod::Spec.new do |s|
10
10
  s.license = package['license']
11
11
  s.homepage = package['homepage']
12
12
  s.source = { :git => 'https://github.com/appzung/react-native-code-push.git', :tag => "v#{s.version}"}
13
- s.ios.deployment_target = '9.0'
14
- s.tvos.deployment_target = '9.0'
13
+ s.ios.deployment_target = '15.5'
14
+ s.tvos.deployment_target = '15.5'
15
15
  s.preserve_paths = '*.js'
16
16
  s.library = 'z'
17
17
  s.source_files = 'ios/CodePush/*.{h,m}'
@@ -21,7 +21,7 @@ Pod::Spec.new do |s|
21
21
  # we explicitly let CocoaPods pull in the versions below so all dependencies are resolved and
22
22
  # linked properly at a parent workspace level.
23
23
  s.dependency 'React-Core'
24
- s.dependency 'SSZipArchive', '~> 2.2.2'
24
+ s.dependency 'SSZipArchive', '~> 2.5.5'
25
25
  s.dependency 'JWT', '~> 3.0.0-beta.12'
26
26
  s.dependency 'Base64', '~> 1.1'
27
27
  end
package/README.md CHANGED
@@ -3,7 +3,9 @@
3
3
  #### [Sign up With App Center](https://appcenter.ms/signup?utm_source=CodePush&utm_medium=Azure) to use CodePush
4
4
 
5
5
  # React Native Module for CodePush
6
-
6
+ > [!WARNING]
7
+ > React Native CodePush won't support new Architecture. In order to use this plugin on React Native versions starting from 0.76 you will need to [opt out](https://reactnative.dev/blog/2024/10/23/the-new-architecture-is-here#opt-out) from new architecture.
8
+ >
7
9
  *Note: This README is only relevant to the latest version of our plugin. If you are using an older version, please switch to the relevant tag on [our GitHub repo](https://github.com/microsoft/react-native-code-push) to view the docs for that particular version.*
8
10
 
9
11
  ![Switching tags](https://user-images.githubusercontent.com/42337914/57237511-0835de80-7030-11e9-88fa-64eb200478d0.png)
@@ -6,6 +6,8 @@ def DEFAULT_TARGET_SDK_VERSION = 26
6
6
  def DEFAULT_MIN_SDK_VERSION = 16
7
7
 
8
8
  android {
9
+ namespace "com.microsoft.codepush.react"
10
+
9
11
  compileSdkVersion rootProject.hasProperty('compileSdkVersion') ? rootProject.compileSdkVersion : DEFAULT_COMPILE_SDK_VERSION
10
12
  buildToolsVersion rootProject.hasProperty('buildToolsVersion') ? rootProject.buildToolsVersion : DEFAULT_BUILD_TOOLS_VERSION
11
13
 
@@ -1,5 +1,4 @@
1
- <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
- package="com.microsoft.codepush.react">
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
3
2
 
4
3
  <uses-permission android:name="android.permission.INTERNET" />
5
4
 
@@ -9,7 +9,6 @@ import com.nimbusds.jwt.SignedJWT;
9
9
 
10
10
  import java.security.interfaces.*;
11
11
 
12
-
13
12
  import org.json.JSONArray;
14
13
  import org.json.JSONException;
15
14
  import org.json.JSONObject;
@@ -86,8 +85,12 @@ public class CodePushUpdateUtils {
86
85
  throw new CodePushUnknownException("Unable to compute hash of update contents.", e);
87
86
  } finally {
88
87
  try {
89
- if (digestInputStream != null) digestInputStream.close();
90
- if (dataStream != null) dataStream.close();
88
+ if (digestInputStream != null) {
89
+ digestInputStream.close();
90
+ }
91
+ if (dataStream != null) {
92
+ dataStream.close();
93
+ }
91
94
  } catch (IOException e) {
92
95
  e.printStackTrace();
93
96
  }
@@ -98,7 +101,11 @@ public class CodePushUpdateUtils {
98
101
  }
99
102
 
100
103
  public static void copyNecessaryFilesFromCurrentPackage(String diffManifestFilePath, String currentPackageFolderPath, String newPackageFolderPath) throws IOException {
101
- FileUtils.copyDirectoryContents(currentPackageFolderPath, newPackageFolderPath);
104
+ if (currentPackageFolderPath == null || !new File(currentPackageFolderPath).exists()) {
105
+ CodePushUtils.log("Unable to copy files from current package during diff update, because currentPackageFolderPath is invalid.");
106
+ return;
107
+ }
108
+ FileUtils.copyDirectoryContents(currentPackageFolderPath, newPackageFolderPath);
102
109
  JSONObject diffManifest = CodePushUtils.getJsonObjectFromFile(diffManifestFilePath);
103
110
  try {
104
111
  JSONArray deletedFiles = diffManifest.getJSONArray("deletedFiles");
@@ -184,7 +191,7 @@ public class CodePushUpdateUtils {
184
191
  public static Map<String, Object> verifyAndDecodeJWT(String jwt, PublicKey publicKey) {
185
192
  try {
186
193
  SignedJWT signedJWT = SignedJWT.parse(jwt);
187
- JWSVerifier verifier = new RSASSAVerifier((RSAPublicKey)publicKey);
194
+ JWSVerifier verifier = new RSASSAVerifier((RSAPublicKey) publicKey);
188
195
  if (signedJWT.verify(verifier)) {
189
196
  Map<String, Object> claims = signedJWT.getJWTClaimsSet().getClaims();
190
197
  CodePushUtils.log("JWT verification succeeded, payload content: " + claims.toString());
@@ -217,7 +224,7 @@ public class CodePushUpdateUtils {
217
224
  }
218
225
  }
219
226
 
220
- public static String getSignatureFilePath(String updateFolderPath){
227
+ public static String getSignatureFilePath(String updateFolderPath) {
221
228
  return CodePushUtils.appendPathComponent(
222
229
  CodePushUtils.appendPathComponent(updateFolderPath, CodePushConstants.CODE_PUSH_FOLDER_PREFIX),
223
230
  CodePushConstants.BUNDLE_JWT_FILE
@@ -254,7 +261,7 @@ public class CodePushUpdateUtils {
254
261
  throw new CodePushInvalidUpdateException("The update could not be verified because it was not signed by a trusted party.");
255
262
  }
256
263
 
257
- final String contentHash = (String)claims.get("contentHash");
264
+ final String contentHash = (String) claims.get("contentHash");
258
265
  if (contentHash == null) {
259
266
  throw new CodePushInvalidUpdateException("The update could not be verified because the signature did not specify a content hash.");
260
267
  }
@@ -265,4 +272,4 @@ public class CodePushUpdateUtils {
265
272
 
266
273
  CodePushUtils.log("The update contents succeeded the code signing check.");
267
274
  }
268
- }
275
+ }
@@ -14,6 +14,9 @@ buildscript {
14
14
  }
15
15
 
16
16
  allprojects {
17
+ android {
18
+ namespace "com.microsoft.codepush.react"
19
+ }
17
20
  repositories {
18
21
  mavenLocal()
19
22
  mavenCentral()
@@ -5,6 +5,7 @@
5
5
  #import <React/RCTEventDispatcher.h>
6
6
  #import <React/RCTRootView.h>
7
7
  #import <React/RCTUtils.h>
8
+ #import <React/RCTReloadCommand.h>
8
9
  #else // back compatibility for RN version < 0.40
9
10
  #import "RCTAssert.h"
10
11
  #import "RCTBridgeModule.h"
@@ -540,7 +541,7 @@ static NSString *const LatestRollbackCountKey = @"count";
540
541
  [super.bridge setValue:[CodePush bundleURL] forKey:@"bundleURL"];
541
542
  }
542
543
 
543
- [super.bridge reload];
544
+ RCTTriggerReloadCommandListeners(@"react-native-code-push: Restart");
544
545
  });
545
546
  }
546
547
 
@@ -0,0 +1,26 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>CFBundleDevelopmentRegion</key>
6
+ <string>en</string>
7
+ <key>CFBundleExecutable</key>
8
+ <string>$(EXECUTABLE_NAME)</string>
9
+ <key>CFBundleIdentifier</key>
10
+ <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11
+ <key>CFBundleInfoDictionaryVersion</key>
12
+ <string>6.0</string>
13
+ <key>CFBundleName</key>
14
+ <string>$(PRODUCT_NAME)</string>
15
+ <key>CFBundlePackageType</key>
16
+ <string>FMWK</string>
17
+ <key>CFBundleShortVersionString</key>
18
+ <string>1.0</string>
19
+ <key>CFBundleSignature</key>
20
+ <string>????</string>
21
+ <key>CFBundleVersion</key>
22
+ <string>$(CURRENT_PROJECT_VERSION)</string>
23
+ <key>NSPrincipalClass</key>
24
+ <string></string>
25
+ </dict>
26
+ </plist>
@@ -1 +1 @@
1
- The source code in this folder is taken from [https://github.com/ZipArchive/ZipArchive/tree/35fe9b6af48527cde0b5db52287474ed3a32d75f/SSZipArchive](https://github.com/ZipArchive/ZipArchive/tree/35fe9b6af48527cde0b5db52287474ed3a32d75f/SSZipArchive) which is [MIT licensed](https://github.com/ZipArchive/ZipArchive/blob/35fe9b6af48527cde0b5db52287474ed3a32d75f/LICENSE.txt).
1
+ The source code in this folder is taken from [https://github.com/ZipArchive/ZipArchive/tree/2.5.5/SSZipArchive](https://github.com/ZipArchive/ZipArchive/tree/2.5.5/SSZipArchive) which is [MIT licensed](https://github.com/ZipArchive/ZipArchive/blob/2.5.5/LICENSE.txt).
@@ -3,56 +3,157 @@
3
3
  // SSZipArchive
4
4
  //
5
5
  // Created by Sam Soffes on 7/21/10.
6
- // Copyright (c) Sam Soffes 2010-2015. All rights reserved.
7
6
  //
8
7
 
9
8
  #ifndef _SSZIPARCHIVE_H
10
9
  #define _SSZIPARCHIVE_H
11
10
 
12
11
  #import <Foundation/Foundation.h>
13
- #include "Common.h"
12
+
13
+ #import "SSZipCommon.h"
14
+
15
+ NS_ASSUME_NONNULL_BEGIN
16
+
17
+ extern NSString *const SSZipArchiveErrorDomain;
18
+ typedef NS_ENUM(NSInteger, SSZipArchiveErrorCode) {
19
+ SSZipArchiveErrorCodeFailedOpenZipFile = -1,
20
+ SSZipArchiveErrorCodeFailedOpenFileInZip = -2,
21
+ SSZipArchiveErrorCodeFileInfoNotLoadable = -3,
22
+ SSZipArchiveErrorCodeFileContentNotReadable = -4,
23
+ SSZipArchiveErrorCodeFailedToWriteFile = -5,
24
+ SSZipArchiveErrorCodeInvalidArguments = -6,
25
+ SSZipArchiveErrorCodeSymlinkEscapesTargetDirectory = -7,
26
+ };
14
27
 
15
28
  @protocol SSZipArchiveDelegate;
16
29
 
17
30
  @interface SSZipArchive : NSObject
18
31
 
32
+ // Password check
33
+ + (BOOL)isFilePasswordProtectedAtPath:(NSString *)path;
34
+ + (BOOL)isPasswordValidForArchiveAtPath:(NSString *)path password:(NSString *)pw error:(NSError * _Nullable * _Nullable)error NS_SWIFT_NOTHROW;
35
+
36
+ // Total payload size
37
+ + (NSNumber *)payloadSizeForArchiveAtPath:(NSString *)path error:(NSError **)error;
38
+
19
39
  // Unzip
20
40
  + (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination;
21
- + (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination delegate:(id<SSZipArchiveDelegate>)delegate;
41
+ + (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination delegate:(nullable id<SSZipArchiveDelegate>)delegate;
42
+
43
+ + (BOOL)unzipFileAtPath:(NSString *)path
44
+ toDestination:(NSString *)destination
45
+ overwrite:(BOOL)overwrite
46
+ password:(nullable NSString *)password
47
+ error:(NSError * *)error;
48
+
49
+ + (BOOL)unzipFileAtPath:(NSString *)path
50
+ toDestination:(NSString *)destination
51
+ overwrite:(BOOL)overwrite
52
+ password:(nullable NSString *)password
53
+ error:(NSError * *)error
54
+ delegate:(nullable id<SSZipArchiveDelegate>)delegate NS_REFINED_FOR_SWIFT;
55
+
56
+ + (BOOL)unzipFileAtPath:(NSString *)path
57
+ toDestination:(NSString *)destination
58
+ preserveAttributes:(BOOL)preserveAttributes
59
+ overwrite:(BOOL)overwrite
60
+ password:(nullable NSString *)password
61
+ error:(NSError * *)error
62
+ delegate:(nullable id<SSZipArchiveDelegate>)delegate;
63
+
64
+ + (BOOL)unzipFileAtPath:(NSString *)path
65
+ toDestination:(NSString *)destination
66
+ progressHandler:(void (^_Nullable)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler
67
+ completionHandler:(void (^_Nullable)(NSString *path, BOOL succeeded, NSError * _Nullable error))completionHandler;
22
68
 
23
- + (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination overwrite:(BOOL)overwrite password:(NSString *)password error:(NSError * *)error;
24
- + (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination overwrite:(BOOL)overwrite password:(NSString *)password error:(NSError * *)error delegate:(id<SSZipArchiveDelegate>)delegate;
69
+ + (BOOL)unzipFileAtPath:(NSString *)path
70
+ toDestination:(NSString *)destination
71
+ overwrite:(BOOL)overwrite
72
+ password:(nullable NSString *)password
73
+ progressHandler:(void (^_Nullable)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler
74
+ completionHandler:(void (^_Nullable)(NSString *path, BOOL succeeded, NSError * _Nullable error))completionHandler;
25
75
 
26
76
  + (BOOL)unzipFileAtPath:(NSString *)path
27
- toDestination:(NSString *)destination
28
- progressHandler:(void (^)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler
29
- completionHandler:(void (^)(NSString *path, BOOL succeeded, NSError *error))completionHandler;
77
+ toDestination:(NSString *)destination
78
+ preserveAttributes:(BOOL)preserveAttributes
79
+ overwrite:(BOOL)overwrite
80
+ nestedZipLevel:(NSInteger)nestedZipLevel
81
+ password:(nullable NSString *)password
82
+ error:(NSError **)error
83
+ delegate:(nullable id<SSZipArchiveDelegate>)delegate
84
+ progressHandler:(void (^_Nullable)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler
85
+ completionHandler:(void (^_Nullable)(NSString *path, BOOL succeeded, NSError * _Nullable error))completionHandler;
30
86
 
31
87
  + (BOOL)unzipFileAtPath:(NSString *)path
32
- toDestination:(NSString *)destination
33
- overwrite:(BOOL)overwrite
34
- password:(NSString *)password
35
- progressHandler:(void (^)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler
36
- completionHandler:(void (^)(NSString *path, BOOL succeeded, NSError *error))completionHandler;
88
+ toDestination:(NSString *)destination
89
+ preserveAttributes:(BOOL)preserveAttributes
90
+ overwrite:(BOOL)overwrite
91
+ symlinksValidWithin:(nullable NSString *)symlinksValidWithin
92
+ nestedZipLevel:(NSInteger)nestedZipLevel
93
+ password:(nullable NSString *)password
94
+ error:(NSError **)error
95
+ delegate:(nullable id<SSZipArchiveDelegate>)delegate
96
+ progressHandler:(void (^_Nullable)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler
97
+ completionHandler:(void (^_Nullable)(NSString *path, BOOL succeeded, NSError * _Nullable error))completionHandler;
37
98
 
38
99
  // Zip
100
+ // default compression level is Z_DEFAULT_COMPRESSION (from "zlib.h")
101
+ // keepParentDirectory: if YES, then unzipping will give `directoryName/fileName`. If NO, then unzipping will just give `fileName`. Default is NO.
39
102
 
40
103
  // without password
41
- + (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray *)paths;
104
+ + (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray<NSString *> *)paths;
42
105
  + (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath;
43
- + (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirector;
44
106
 
45
- // with password, password could be nil
46
- + (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray *)paths withPassword:(NSString *)password;
47
- + (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath withPassword:(NSString *)password;
48
- + (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirectory withPassword:(NSString *)password;
49
-
50
- - (instancetype)initWithPath:(NSString *)path;
51
- @property (NS_NONATOMIC_IOSONLY, readonly, getter = isOpen) BOOL open;
52
- - (BOOL)writeFile:(NSString *)path withPassword:(NSString *)password;
53
- - (BOOL)writeFileAtPath:(NSString *)path withFileName:(NSString *)fileName withPassword:(NSString *)password;
54
- - (BOOL)writeData:(NSData *)data filename:(NSString *)filename withPassword:(NSString *)password;
55
- @property (NS_NONATOMIC_IOSONLY, readonly, getter = isClosed) BOOL close;
107
+ + (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirectory;
108
+
109
+ // with optional password, default encryption is AES
110
+ // don't use AES if you need compatibility with native macOS unzip and Archive Utility
111
+ + (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray<NSString *> *)paths withPassword:(nullable NSString *)password;
112
+ + (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray<NSString *> *)paths withPassword:(nullable NSString *)password progressHandler:(void(^ _Nullable)(NSUInteger entryNumber, NSUInteger total))progressHandler;
113
+ + (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath withPassword:(nullable NSString *)password;
114
+ + (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirectory withPassword:(nullable NSString *)password;
115
+ + (BOOL)createZipFileAtPath:(NSString *)path
116
+ withContentsOfDirectory:(NSString *)directoryPath
117
+ keepParentDirectory:(BOOL)keepParentDirectory
118
+ withPassword:(nullable NSString *)password
119
+ andProgressHandler:(void(^ _Nullable)(NSUInteger entryNumber, NSUInteger total))progressHandler;
120
+ + (BOOL)createZipFileAtPath:(NSString *)path
121
+ withContentsOfDirectory:(NSString *)directoryPath
122
+ keepParentDirectory:(BOOL)keepParentDirectory
123
+ compressionLevel:(int)compressionLevel
124
+ password:(nullable NSString *)password
125
+ AES:(BOOL)aes
126
+ progressHandler:(void(^ _Nullable)(NSUInteger entryNumber, NSUInteger total))progressHandler;
127
+ //suport symlink compress --file
128
+ + (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray<NSString *> *)paths withPassword:(nullable NSString *)password keepSymlinks:(BOOL)keeplinks;
129
+ //suport symlink compress --directory
130
+ + (BOOL)createZipFileAtPath:(NSString *)path
131
+ withContentsOfDirectory:(NSString *)directoryPath
132
+ keepParentDirectory:(BOOL)keepParentDirectory
133
+ compressionLevel:(int)compressionLevel
134
+ password:(nullable NSString *)password
135
+ AES:(BOOL)aes
136
+ progressHandler:(void(^ _Nullable)(NSUInteger entryNumber, NSUInteger total))progressHandler
137
+ keepSymlinks:(BOOL)keeplinks;
138
+
139
+ - (instancetype)init NS_UNAVAILABLE;
140
+ - (instancetype)initWithPath:(NSString *)path NS_DESIGNATED_INITIALIZER;
141
+ - (BOOL)open;
142
+ - (BOOL)openForAppending;
143
+
144
+ /// write empty folder
145
+ - (BOOL)writeFolderAtPath:(NSString *)path withFolderName:(NSString *)folderName withPassword:(nullable NSString *)password;
146
+ /// write file
147
+ - (BOOL)writeFile:(NSString *)path withPassword:(nullable NSString *)password;
148
+ - (BOOL)writeFileAtPath:(NSString *)path withFileName:(nullable NSString *)fileName withPassword:(nullable NSString *)password;
149
+ - (BOOL)writeFileAtPath:(NSString *)path withFileName:(nullable NSString *)fileName compressionLevel:(int)compressionLevel password:(nullable NSString *)password AES:(BOOL)aes;
150
+ ///write symlink files
151
+ - (BOOL)writeSymlinkFileAtPath:(NSString *)path withFileName:(nullable NSString *)fileName compressionLevel:(int)compressionLevel password:(nullable NSString *)password AES:(BOOL)aes;
152
+ /// write data
153
+ - (BOOL)writeData:(NSData *)data filename:(nullable NSString *)filename withPassword:(nullable NSString *)password;
154
+ - (BOOL)writeData:(NSData *)data filename:(nullable NSString *)filename compressionLevel:(int)compressionLevel password:(nullable NSString *)password AES:(BOOL)aes;
155
+
156
+ - (BOOL)close;
56
157
 
57
158
  @end
58
159
 
@@ -69,8 +170,9 @@
69
170
  - (void)zipArchiveDidUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath unzippedFilePath:(NSString *)unzippedFilePath;
70
171
 
71
172
  - (void)zipArchiveProgressEvent:(unsigned long long)loaded total:(unsigned long long)total;
72
- - (void)zipArchiveDidUnzipArchiveFile:(NSString *)zipFile entryPath:(NSString *)entryPath destPath:(NSString *)destPath;
73
173
 
74
174
  @end
75
175
 
176
+ NS_ASSUME_NONNULL_END
177
+
76
178
  #endif /* _SSZIPARCHIVE_H */