@algocare/react-native-code-push 12.6.4 → 13.0.0-rc.0
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.
- package/CodePush.podspec +6 -8
- package/README.md +343 -586
- package/android/app/build.gradle +2 -1
- package/android/app/proguard-rules.pro +14 -0
- package/android/app/src/debug/AndroidManifest.xml +9 -0
- package/android/app/src/main/AndroidManifest.xml +1 -2
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePush.java +14 -139
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushConstants.java +0 -3
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushNativeModule.java +108 -63
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUpdateManager.java +2 -33
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUpdateUtils.java +13 -109
- package/android/build.gradle +3 -0
- package/app.plugin.js +1 -0
- package/bin/code-push.js +6 -0
- package/cli/commands/bundleCommand/bundleCodePush.ts +118 -0
- package/cli/commands/bundleCommand/index.ts +34 -0
- package/cli/commands/createHistoryCommand/createReleaseHistory.ts +37 -0
- package/cli/commands/createHistoryCommand/createReleaseHistoryList.ts +40 -0
- package/cli/commands/createHistoryCommand/index.ts +44 -0
- package/cli/commands/createPullRequestHistoryCommand/createPullRequestHistory.ts +33 -0
- package/cli/commands/createPullRequestHistoryCommand/index.ts +31 -0
- package/cli/commands/createPullRequestReleaseCommand/addToPullRequestRelease.ts +71 -0
- package/cli/commands/createPullRequestReleaseCommand/createPullRequestRelease.ts +75 -0
- package/cli/commands/createPullRequestReleaseCommand/index.ts +74 -0
- package/cli/commands/getPackageHashCommand/index.ts +45 -0
- package/cli/commands/initCommand/index.ts +14 -0
- package/cli/commands/initCommand/initAndroid.ts +91 -0
- package/cli/commands/initCommand/initIos.ts +123 -0
- package/cli/commands/initCommand/test/initAndroid.test.ts +128 -0
- package/cli/commands/initCommand/test/initIos.test.ts +99 -0
- package/cli/commands/releaseCommand/addToReleaseHistory.ts +57 -0
- package/cli/commands/releaseCommand/index.ts +90 -0
- package/cli/commands/releaseCommand/release.ts +105 -0
- package/cli/commands/removePullRequestHistoryCommand/index.ts +37 -0
- package/cli/commands/removePullRequestHistoryCommand/removePullRequestHistory.ts +28 -0
- package/cli/commands/showHistoryCommand/index.ts +31 -0
- package/cli/commands/updateHistoryCommand/index.ts +55 -0
- package/cli/commands/updateHistoryCommand/updateReleaseHistory.ts +42 -0
- package/cli/constant.ts +4 -0
- package/cli/dist/commands/bundleCommand/bundleCodePush.js +65 -0
- package/cli/dist/commands/bundleCommand/index.js +15 -0
- package/cli/dist/commands/createHistoryCommand/createReleaseHistory.js +25 -0
- package/cli/dist/commands/createHistoryCommand/createReleaseHistoryList.js +27 -0
- package/cli/dist/commands/createHistoryCommand/index.js +20 -0
- package/cli/dist/commands/createPullRequestHistoryCommand/createPullRequestHistory.js +23 -0
- package/cli/dist/commands/createPullRequestHistoryCommand/index.js +15 -0
- package/cli/dist/commands/createPullRequestReleaseCommand/addToPullRequestRelease.js +51 -0
- package/cli/dist/commands/createPullRequestReleaseCommand/createPullRequestRelease.js +39 -0
- package/cli/dist/commands/createPullRequestReleaseCommand/index.js +35 -0
- package/cli/dist/commands/getPackageHashCommand/index.js +26 -0
- package/cli/dist/commands/initCommand/index.js +12 -0
- package/cli/dist/commands/initCommand/initAndroid.js +73 -0
- package/cli/dist/commands/initCommand/initIos.js +108 -0
- package/cli/dist/commands/initCommand/test/initAndroid.test.js +113 -0
- package/cli/dist/commands/initCommand/test/initIos.test.js +95 -0
- package/cli/dist/commands/releaseCommand/addToReleaseHistory.js +35 -0
- package/cli/dist/commands/releaseCommand/index.js +45 -0
- package/cli/dist/commands/releaseCommand/release.js +62 -0
- package/cli/dist/commands/removePullRequestHistoryCommand/index.js +19 -0
- package/cli/dist/commands/removePullRequestHistoryCommand/removePullRequestHistory.js +18 -0
- package/cli/dist/commands/showHistoryCommand/index.js +15 -0
- package/cli/dist/commands/updateHistoryCommand/index.js +31 -0
- package/cli/dist/commands/updateHistoryCommand/updateReleaseHistory.js +28 -0
- package/cli/dist/constant.js +4 -0
- package/cli/dist/functions/getReactTempDir.js +10 -0
- package/cli/{functions → dist/functions}/makeCodePushBundle.js +5 -11
- package/cli/{functions → dist/functions}/prepareToBundleJS.js +2 -5
- package/cli/dist/functions/runExpoBundleCommand.js +35 -0
- package/cli/{functions → dist/functions}/runHermesEmitBinaryCommand.js +36 -71
- package/cli/{functions → dist/functions}/runReactNativeBundleCommand.js +19 -24
- package/cli/dist/index.js +54 -0
- package/cli/dist/utils/datetime.js +17 -0
- package/cli/dist/utils/file-utils.js +19 -0
- package/cli/dist/utils/fsUtils.js +44 -0
- package/cli/{utils → dist/utils}/hash-utils.js +19 -130
- package/cli/{utils → dist/utils}/promisfied-fs.js +5 -16
- package/cli/dist/utils/showLogo.js +21 -0
- package/cli/dist/utils/unzip.js +41 -0
- package/cli/{utils → dist/utils}/zip.js +15 -51
- package/cli/functions/{getReactTempDir.js → getReactTempDir.ts} +2 -6
- package/cli/functions/makeCodePushBundle.ts +26 -0
- package/cli/functions/prepareToBundleJS.ts +10 -0
- package/cli/functions/runExpoBundleCommand.ts +45 -0
- package/cli/functions/runHermesEmitBinaryCommand.ts +203 -0
- package/cli/functions/runReactNativeBundleCommand.ts +67 -0
- package/cli/index.ts +68 -0
- package/cli/package.json +35 -0
- package/cli/utils/datetime.ts +19 -0
- package/cli/utils/{file-utils.js → file-utils.ts} +4 -21
- package/cli/utils/fsUtils.ts +50 -0
- package/cli/utils/hash-utils.ts +143 -0
- package/cli/utils/promisfied-fs.ts +19 -0
- package/cli/utils/{showLogo.js → showLogo.ts} +4 -6
- package/cli/utils/unzip.ts +46 -0
- package/cli/utils/zip.ts +65 -0
- package/expo/plugin/withCodePush.js +14 -0
- package/expo/plugin/withCodePushAndroid.js +92 -0
- package/expo/plugin/withCodePushIos.js +143 -0
- package/ios/CodePush/CodePush.h +0 -16
- package/ios/CodePush/CodePush.m +30 -20
- package/ios/CodePush/CodePushConfig.m +1 -11
- package/ios/CodePush/CodePushPackage.m +12 -69
- package/ios/CodePush/CodePushUpdateUtils.m +1 -91
- package/ios/CodePush/SSZipArchive/Info.plist +26 -0
- package/ios/CodePush/SSZipArchive/README.md +1 -1
- package/ios/CodePush/SSZipArchive/SSZipArchive.h +129 -27
- package/ios/CodePush/SSZipArchive/SSZipArchive.m +1119 -314
- package/ios/CodePush/SSZipArchive/SSZipCommon.h +71 -0
- package/ios/CodePush/SSZipArchive/Supporting Files/PrivacyInfo.xcprivacy +23 -0
- package/ios/CodePush/SSZipArchive/include/ZipArchive.h +25 -0
- package/ios/CodePush/SSZipArchive/minizip/LICENSE +17 -0
- package/ios/CodePush/SSZipArchive/minizip/mz.h +273 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_compat.c +1306 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_compat.h +346 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_crypt.c +187 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_crypt.h +65 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_crypt_apple.c +526 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_os.c +348 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_os.h +176 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_os_posix.c +350 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm.c +556 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm.h +132 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_buf.c +383 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_buf.h +42 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_mem.c +269 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_mem.h +48 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_os.h +40 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_os_posix.c +203 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_pkcrypt.c +334 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_pkcrypt.h +46 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_split.c +429 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_split.h +43 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_wzaes.c +360 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_wzaes.h +46 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_zlib.c +389 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_zlib.h +43 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_zip.c +2782 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_zip.h +262 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_zip_rw.c +1942 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_zip_rw.h +285 -0
- package/ios/CodePush.xcodeproj/project.pbxproj +244 -453
- package/ios/PrivacyInfo.xcprivacy +31 -0
- package/package.json +68 -42
- package/react-native.config.js +1 -1
- package/{AlertAdapter.js → src/AlertAdapter.js} +5 -5
- package/src/CodePush.js +947 -0
- package/{package-mixins.js → src/package-mixins.js} +1 -1
- package/{versioning → src/versioning}/BaseVersioning.js +12 -1
- package/{versioning → src/versioning}/SemverVersioning.test.js +78 -0
- package/typings/react-native-code-push.d.ts +559 -495
- package/.claude/commands/release.md +0 -78
- package/.claude/skills/npm-release/SKILL.md +0 -89
- package/CLAUDE.md +0 -83
- package/CONTRIBUTING.md +0 -134
- package/CodePush.js +0 -972
- package/SECURITY.md +0 -41
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushBuilder.java +0 -37
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushInvalidPublicKeyException.java +0 -12
- package/android/app/src/main/java/com/microsoft/codepush/react/ReactInstanceHolder.java +0 -17
- package/android/codepush.gradle +0 -162
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +0 -5
- package/android/gradlew +0 -164
- package/android/gradlew.bat +0 -90
- package/babel.config.js +0 -3
- package/cli/commands/bundleCommand/bundleCodePush.js +0 -57
- package/cli/commands/bundleCommand/index.js +0 -55
- package/cli/commands/common.js +0 -245
- package/cli/commands/createHistoryCommand/createReleaseHistory.js +0 -42
- package/cli/commands/createHistoryCommand/createReleaseHistoryList.js +0 -52
- package/cli/commands/createHistoryCommand/index.js +0 -95
- package/cli/commands/createPullRequestHistoryCommand/createPullRequestHistory.js +0 -34
- package/cli/commands/createPullRequestHistoryCommand/index.js +0 -29
- package/cli/commands/createPullRequestReleaseCommand/addToPullRequestRelease.js +0 -74
- package/cli/commands/createPullRequestReleaseCommand/createPullRequestRelease.js +0 -91
- package/cli/commands/createPullRequestReleaseCommand/index.js +0 -68
- package/cli/commands/getPackageHashCommand/index.js +0 -42
- package/cli/commands/releaseCommand/addToReleaseHistory.js +0 -85
- package/cli/commands/releaseCommand/index.js +0 -151
- package/cli/commands/releaseCommand/release.js +0 -121
- package/cli/commands/removePullRequestHistoryCommand/index.js +0 -28
- package/cli/commands/removePullRequestHistoryCommand/removePullRequestHistory.js +0 -23
- package/cli/commands/showHistoryCommand/index.js +0 -88
- package/cli/commands/updateHistoryCommand/index.js +0 -123
- package/cli/commands/updateHistoryCommand/updateReleaseHistory.js +0 -69
- package/cli/constant.js +0 -8
- package/cli/index.js +0 -63
- package/cli/utils/datetime.js +0 -22
- package/cli/utils/fsUtils.js +0 -64
- package/cli/utils/version.js +0 -26
- package/code-push.config.example.supabase.ts +0 -114
- package/code-push.config.js +0 -229
- package/code-push.config.ts +0 -175
- package/docs/api-android.md +0 -83
- package/docs/api-ios.md +0 -31
- package/docs/api-js.md +0 -592
- package/docs/multi-deployment-testing-android.md +0 -148
- package/docs/multi-deployment-testing-ios.md +0 -59
- package/docs/setup-android.md +0 -482
- package/docs/setup-ios.md +0 -280
- package/eslint.config.mjs +0 -32
- package/ios/CodePush/Base64/Base64/MF_Base64Additions.h +0 -34
- package/ios/CodePush/Base64/Base64/MF_Base64Additions.m +0 -252
- package/ios/CodePush/Base64/README.md +0 -47
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithm.h +0 -69
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmFactory.h +0 -16
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmFactory.m +0 -51
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmNone.h +0 -15
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmNone.m +0 -55
- package/ios/CodePush/JWT/Core/Algorithms/ESFamily/JWTAlgorithmESBase.h +0 -24
- package/ios/CodePush/JWT/Core/Algorithms/ESFamily/JWTAlgorithmESBase.m +0 -41
- package/ios/CodePush/JWT/Core/Algorithms/HSFamily/JWTAlgorithmHSBase.h +0 -28
- package/ios/CodePush/JWT/Core/Algorithms/HSFamily/JWTAlgorithmHSBase.m +0 -205
- package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolder.h +0 -103
- package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolder.m +0 -322
- package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolderChain.h +0 -37
- package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolderChain.m +0 -145
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/JWTAlgorithmRSBase.h +0 -35
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/JWTAlgorithmRSBase.m +0 -551
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/JWTRSAlgorithm.h +0 -23
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKey.h +0 -43
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKey.m +0 -230
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKeyExtractor.h +0 -31
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKeyExtractor.m +0 -113
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoSecurity.h +0 -38
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoSecurity.m +0 -500
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaim.h +0 -18
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaim.m +0 -214
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSet.h +0 -23
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSet.m +0 -29
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetSerializer.h +0 -19
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetSerializer.m +0 -68
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetVerifier.h +0 -18
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetVerifier.m +0 -72
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+ResultTypes.h +0 -67
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+ResultTypes.m +0 -111
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionOne.h +0 -119
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionOne.m +0 -307
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionThree.h +0 -94
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionThree.m +0 -619
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionTwo.h +0 -164
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionTwo.m +0 -514
- package/ios/CodePush/JWT/Core/Coding/JWTCoding.h +0 -24
- package/ios/CodePush/JWT/Core/Coding/JWTCoding.m +0 -11
- package/ios/CodePush/JWT/Core/FrameworkSupplement/JWT.h +0 -52
- package/ios/CodePush/JWT/Core/FrameworkSupplement/Map.modulemap +0 -5
- package/ios/CodePush/JWT/Core/Supplement/JWTBase64Coder.h +0 -28
- package/ios/CodePush/JWT/Core/Supplement/JWTBase64Coder.m +0 -70
- package/ios/CodePush/JWT/Core/Supplement/JWTDeprecations.h +0 -22
- package/ios/CodePush/JWT/Core/Supplement/JWTErrorDescription.h +0 -34
- package/ios/CodePush/JWT/Core/Supplement/JWTErrorDescription.m +0 -73
- package/ios/CodePush/JWT/LICENSE +0 -19
- package/ios/CodePush/JWT/README.md +0 -489
- package/ios/CodePush/SSZipArchive/Common.h +0 -81
- package/ios/CodePush/SSZipArchive/aes/aes.h +0 -198
- package/ios/CodePush/SSZipArchive/aes/aes_via_ace.h +0 -541
- package/ios/CodePush/SSZipArchive/aes/aescrypt.c +0 -294
- package/ios/CodePush/SSZipArchive/aes/aeskey.c +0 -548
- package/ios/CodePush/SSZipArchive/aes/aesopt.h +0 -739
- package/ios/CodePush/SSZipArchive/aes/aestab.c +0 -391
- package/ios/CodePush/SSZipArchive/aes/aestab.h +0 -173
- package/ios/CodePush/SSZipArchive/aes/brg_endian.h +0 -126
- package/ios/CodePush/SSZipArchive/aes/brg_types.h +0 -219
- package/ios/CodePush/SSZipArchive/aes/entropy.c +0 -54
- package/ios/CodePush/SSZipArchive/aes/entropy.h +0 -16
- package/ios/CodePush/SSZipArchive/aes/fileenc.c +0 -144
- package/ios/CodePush/SSZipArchive/aes/fileenc.h +0 -121
- package/ios/CodePush/SSZipArchive/aes/hmac.c +0 -145
- package/ios/CodePush/SSZipArchive/aes/hmac.h +0 -103
- package/ios/CodePush/SSZipArchive/aes/prng.c +0 -155
- package/ios/CodePush/SSZipArchive/aes/prng.h +0 -82
- package/ios/CodePush/SSZipArchive/aes/pwd2key.c +0 -103
- package/ios/CodePush/SSZipArchive/aes/pwd2key.h +0 -57
- package/ios/CodePush/SSZipArchive/aes/sha1.c +0 -258
- package/ios/CodePush/SSZipArchive/aes/sha1.h +0 -73
- package/ios/CodePush/SSZipArchive/minizip/crypt.h +0 -130
- package/ios/CodePush/SSZipArchive/minizip/ioapi.c +0 -369
- package/ios/CodePush/SSZipArchive/minizip/ioapi.h +0 -175
- package/ios/CodePush/SSZipArchive/minizip/mztools.c +0 -284
- package/ios/CodePush/SSZipArchive/minizip/mztools.h +0 -31
- package/ios/CodePush/SSZipArchive/minizip/unzip.c +0 -1839
- package/ios/CodePush/SSZipArchive/minizip/unzip.h +0 -248
- package/ios/CodePush/SSZipArchive/minizip/zip.c +0 -1910
- package/ios/CodePush/SSZipArchive/minizip/zip.h +0 -202
- package/scripts/generateBundledResourcesHash.js +0 -125
- package/scripts/getFilesInFolder.js +0 -19
- package/scripts/recordFilesBeforeBundleCommand.js +0 -41
- package/scripts/release.sh +0 -86
- package/tsconfig.json +0 -20
- package/tslint.json +0 -32
- /package/{logging.js → src/logging.js} +0 -0
- /package/{versioning → src/versioning}/BaseVersioning.test.js +0 -0
- /package/{versioning → src/versioning}/IncrementalVersioning.js +0 -0
- /package/{versioning → src/versioning}/IncrementalVersioning.test.js +0 -0
- /package/{versioning → src/versioning}/SemverVersioning.js +0 -0
- /package/{versioning → src/versioning}/index.js +0 -0
|
@@ -45,7 +45,6 @@ static NSString *const UnzippedFolderName = @"unzipped";
|
|
|
45
45
|
|
|
46
46
|
+ (void)downloadPackage:(NSDictionary *)updatePackage
|
|
47
47
|
expectedBundleFileName:(NSString *)expectedBundleFileName
|
|
48
|
-
publicKey:(NSString *)publicKey
|
|
49
48
|
operationQueue:(dispatch_queue_t)operationQueue
|
|
50
49
|
progressCallback:(void (^)(long long, long long))progressCallback
|
|
51
50
|
doneCallback:(void (^)())doneCallback
|
|
@@ -257,77 +256,21 @@ downloadCompleteCallback:(void (^)())downloadCompleteCallback
|
|
|
257
256
|
}
|
|
258
257
|
|
|
259
258
|
CPLog((isDiffUpdate) ? @"Applying diff update." : @"Applying full update.");
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
if (isSignatureAppearedInBundle) {
|
|
268
|
-
if (![CodePushUpdateUtils verifyFolderHash:newUpdateFolderPath
|
|
269
|
-
expectedHash:newUpdateHash
|
|
270
|
-
error:&error]) {
|
|
271
|
-
CPLog(@"The update contents failed the data integrity check.");
|
|
272
|
-
if (!error) {
|
|
273
|
-
error = [CodePushErrorUtils errorWithMessage:@"The update contents failed the data integrity check."];
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
failCallback(error);
|
|
277
|
-
return;
|
|
278
|
-
} else {
|
|
279
|
-
CPLog(@"The update contents succeeded the data integrity check.");
|
|
280
|
-
}
|
|
281
|
-
BOOL isSignatureValid = [CodePushUpdateUtils verifyUpdateSignatureFor:newUpdateFolderPath
|
|
282
|
-
expectedHash:newUpdateHash
|
|
283
|
-
withPublicKey:publicKey
|
|
284
|
-
error:&error];
|
|
285
|
-
if (!isSignatureValid) {
|
|
286
|
-
CPLog(@"The update contents failed code signing check.");
|
|
287
|
-
if (!error) {
|
|
288
|
-
error = [CodePushErrorUtils errorWithMessage:@"The update contents failed code signing check."];
|
|
289
|
-
}
|
|
290
|
-
failCallback(error);
|
|
291
|
-
return;
|
|
292
|
-
} else {
|
|
293
|
-
CPLog(@"The update contents succeeded the code signing check.");
|
|
294
|
-
}
|
|
295
|
-
} else {
|
|
296
|
-
error = [CodePushErrorUtils errorWithMessage:
|
|
297
|
-
@"Error! Public key was provided but there is no JWT signature within app bundle to verify " \
|
|
298
|
-
"Possible reasons, why that might happen: \n" \
|
|
299
|
-
"1. You've been released CodePush bundle update using version of CodePush CLI that is not support code signing.\n" \
|
|
300
|
-
"2. You've been released CodePush bundle update without providing --privateKeyPath option."];
|
|
301
|
-
failCallback(error);
|
|
302
|
-
return;
|
|
259
|
+
|
|
260
|
+
if (![CodePushUpdateUtils verifyFolderHash:newUpdateFolderPath
|
|
261
|
+
expectedHash:newUpdateHash
|
|
262
|
+
error:&error]) {
|
|
263
|
+
CPLog(@"The update contents failed the data integrity check.");
|
|
264
|
+
if (!error) {
|
|
265
|
+
error = [CodePushErrorUtils errorWithMessage:@"The update contents failed the data integrity check."];
|
|
303
266
|
}
|
|
304
|
-
|
|
267
|
+
|
|
268
|
+
failCallback(error);
|
|
269
|
+
return;
|
|
305
270
|
} else {
|
|
306
|
-
|
|
307
|
-
if (isSignatureAppearedInBundle) {
|
|
308
|
-
CPLog(@"Warning! JWT signature exists in codepush update but code integrity check couldn't be performed" \
|
|
309
|
-
" because there is no public key configured. " \
|
|
310
|
-
"Please ensure that public key is properly configured within your application.");
|
|
311
|
-
needToVerifyHash = true;
|
|
312
|
-
} else {
|
|
313
|
-
needToVerifyHash = isDiffUpdate;
|
|
314
|
-
}
|
|
315
|
-
if(needToVerifyHash){
|
|
316
|
-
if (![CodePushUpdateUtils verifyFolderHash:newUpdateFolderPath
|
|
317
|
-
expectedHash:newUpdateHash
|
|
318
|
-
error:&error]) {
|
|
319
|
-
CPLog(@"The update contents failed the data integrity check.");
|
|
320
|
-
if (!error) {
|
|
321
|
-
error = [CodePushErrorUtils errorWithMessage:@"The update contents failed the data integrity check."];
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
failCallback(error);
|
|
325
|
-
return;
|
|
326
|
-
} else {
|
|
327
|
-
CPLog(@"The update contents succeeded the data integrity check.");
|
|
328
|
-
}
|
|
329
|
-
}
|
|
271
|
+
CPLog(@"The update contents succeeded the data integrity check.");
|
|
330
272
|
}
|
|
273
|
+
|
|
331
274
|
} else {
|
|
332
275
|
[[NSFileManager defaultManager] createDirectoryAtPath:newUpdateFolderPath
|
|
333
276
|
withIntermediateDirectories:YES
|
|
@@ -1,28 +1,23 @@
|
|
|
1
1
|
#import "CodePush.h"
|
|
2
2
|
#include <CommonCrypto/CommonDigest.h>
|
|
3
|
-
#import "JWT.h"
|
|
4
3
|
|
|
5
4
|
@implementation CodePushUpdateUtils
|
|
6
5
|
|
|
7
6
|
NSString * const AssetsFolderName = @"assets";
|
|
8
7
|
NSString * const BinaryHashKey = @"CodePushBinaryHash";
|
|
9
8
|
NSString * const ManifestFolderPrefix = @"CodePush";
|
|
10
|
-
NSString * const BundleJWTFile = @".codepushrelease";
|
|
11
9
|
|
|
12
10
|
/*
|
|
13
11
|
Ignore list for hashing
|
|
14
12
|
*/
|
|
15
13
|
NSString * const IgnoreMacOSX= @"__MACOSX/";
|
|
16
14
|
NSString * const IgnoreDSStore = @".DS_Store";
|
|
17
|
-
NSString * const IgnoreCodePushMetadata = @".codepushrelease";
|
|
18
15
|
|
|
19
16
|
+ (BOOL)isHashIgnoredFor:(NSString *) relativePath
|
|
20
17
|
{
|
|
21
18
|
return [relativePath hasPrefix:IgnoreMacOSX]
|
|
22
19
|
|| [relativePath isEqualToString:IgnoreDSStore]
|
|
23
|
-
|| [relativePath hasSuffix:[NSString stringWithFormat:@"/%@", IgnoreDSStore]]
|
|
24
|
-
|| [relativePath isEqualToString:IgnoreCodePushMetadata]
|
|
25
|
-
|| [relativePath hasSuffix:[NSString stringWithFormat:@"/%@", IgnoreCodePushMetadata]];
|
|
20
|
+
|| [relativePath hasSuffix:[NSString stringWithFormat:@"/%@", IgnoreDSStore]];
|
|
26
21
|
}
|
|
27
22
|
|
|
28
23
|
+ (BOOL)addContentsOfFolderToManifest:(NSString *)folderPath
|
|
@@ -288,89 +283,4 @@ NSString * const IgnoreCodePushMetadata = @".codepushrelease";
|
|
|
288
283
|
return [updateContentsManifestHash isEqualToString:expectedHash];
|
|
289
284
|
}
|
|
290
285
|
|
|
291
|
-
// remove BEGIN / END tags and line breaks from public key string
|
|
292
|
-
+ (NSString *)getKeyValueFromPublicKeyString:(NSString *)publicKeyString
|
|
293
|
-
{
|
|
294
|
-
publicKeyString = [publicKeyString stringByReplacingOccurrencesOfString:@"-----BEGIN PUBLIC KEY-----\n"
|
|
295
|
-
withString:@""];
|
|
296
|
-
publicKeyString = [publicKeyString stringByReplacingOccurrencesOfString:@"-----END PUBLIC KEY-----"
|
|
297
|
-
withString:@""];
|
|
298
|
-
publicKeyString = [publicKeyString stringByReplacingOccurrencesOfString:@"\n"
|
|
299
|
-
withString:@""];
|
|
300
|
-
|
|
301
|
-
return publicKeyString;
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
+ (NSString *)getSignatureFilePath:(NSString *)updateFolderPath
|
|
305
|
-
{
|
|
306
|
-
return [NSString stringWithFormat:@"%@/%@/%@", updateFolderPath, ManifestFolderPrefix, BundleJWTFile];
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
+ (NSString *)getSignatureFor:(NSString *)folderPath
|
|
310
|
-
error:(NSError **)error
|
|
311
|
-
{
|
|
312
|
-
NSString *signatureFilePath = [self getSignatureFilePath:folderPath];
|
|
313
|
-
if ([[NSFileManager defaultManager] fileExistsAtPath:signatureFilePath]) {
|
|
314
|
-
return [NSString stringWithContentsOfFile:signatureFilePath encoding:NSUTF8StringEncoding error:error];
|
|
315
|
-
} else {
|
|
316
|
-
*error = [CodePushErrorUtils errorWithMessage:[NSString stringWithFormat: @"Cannot find signature at %@", signatureFilePath]];
|
|
317
|
-
return nil;
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
+ (NSDictionary *) verifyAndDecodeJWT:(NSString *)jwt
|
|
322
|
-
withPublicKey:(NSString *)publicKey
|
|
323
|
-
error:(NSError **)error
|
|
324
|
-
{
|
|
325
|
-
id <JWTAlgorithmDataHolderProtocol> verifyDataHolder = [JWTAlgorithmRSFamilyDataHolder new].keyExtractorType([JWTCryptoKeyExtractor publicKeyWithPEMBase64].type).algorithmName(@"RS256").secret(publicKey);
|
|
326
|
-
|
|
327
|
-
JWTCodingBuilder *verifyBuilder = [JWTDecodingBuilder decodeMessage:jwt].addHolder(verifyDataHolder);
|
|
328
|
-
JWTCodingResultType *verifyResult = verifyBuilder.result;
|
|
329
|
-
if (verifyResult.successResult) {
|
|
330
|
-
return verifyResult.successResult.payload;
|
|
331
|
-
}
|
|
332
|
-
else {
|
|
333
|
-
*error = verifyResult.errorResult.error;
|
|
334
|
-
return nil;
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
+ (BOOL)verifyUpdateSignatureFor:(NSString *)folderPath
|
|
339
|
-
expectedHash:(NSString *)newUpdateHash
|
|
340
|
-
withPublicKey:(NSString *)publicKeyString
|
|
341
|
-
error:(NSError **)error
|
|
342
|
-
{
|
|
343
|
-
NSLog(@"Verifying signature for folder path: %@", folderPath);
|
|
344
|
-
|
|
345
|
-
NSString *publicKey = [self getKeyValueFromPublicKeyString: publicKeyString];
|
|
346
|
-
|
|
347
|
-
NSError *signatureVerificationError;
|
|
348
|
-
NSString *signature = [self getSignatureFor: folderPath
|
|
349
|
-
error: &signatureVerificationError];
|
|
350
|
-
if (signatureVerificationError) {
|
|
351
|
-
CPLog(@"The update could not be verified because no signature was found. %@", signatureVerificationError);
|
|
352
|
-
*error = signatureVerificationError;
|
|
353
|
-
return false;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
NSError *payloadDecodingError;
|
|
357
|
-
NSDictionary *envelopedPayload = [self verifyAndDecodeJWT:signature withPublicKey:publicKey error:&payloadDecodingError];
|
|
358
|
-
if(payloadDecodingError){
|
|
359
|
-
CPLog(@"The update could not be verified because it was not signed by a trusted party. %@", payloadDecodingError);
|
|
360
|
-
*error = payloadDecodingError;
|
|
361
|
-
return false;
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
CPLog(@"JWT signature verification succeeded, payload content: %@", envelopedPayload);
|
|
365
|
-
|
|
366
|
-
if(![envelopedPayload objectForKey:@"contentHash"]){
|
|
367
|
-
CPLog(@"The update could not be verified because the signature did not specify a content hash.");
|
|
368
|
-
return false;
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
NSString *contentHash = envelopedPayload[@"contentHash"];
|
|
372
|
-
|
|
373
|
-
return [contentHash isEqualToString:newUpdateHash];
|
|
374
|
-
}
|
|
375
|
-
|
|
376
286
|
@end
|
|
@@ -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/
|
|
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
|
-
|
|
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
|
|
24
|
-
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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 */
|