@algocare/react-native-code-push 12.6.3 → 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.
Files changed (292) hide show
  1. package/CodePush.podspec +6 -8
  2. package/README.md +343 -586
  3. package/android/app/build.gradle +2 -1
  4. package/android/app/proguard-rules.pro +14 -0
  5. package/android/app/src/debug/AndroidManifest.xml +9 -0
  6. package/android/app/src/main/AndroidManifest.xml +1 -2
  7. package/android/app/src/main/java/com/microsoft/codepush/react/CodePush.java +14 -139
  8. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushConstants.java +0 -3
  9. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushNativeModule.java +108 -63
  10. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUpdateManager.java +2 -33
  11. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUpdateUtils.java +13 -109
  12. package/android/build.gradle +3 -0
  13. package/app.plugin.js +1 -0
  14. package/bin/code-push.js +6 -0
  15. package/cli/commands/bundleCommand/bundleCodePush.ts +118 -0
  16. package/cli/commands/bundleCommand/index.ts +34 -0
  17. package/cli/commands/createHistoryCommand/createReleaseHistory.ts +37 -0
  18. package/cli/commands/createHistoryCommand/createReleaseHistoryList.ts +40 -0
  19. package/cli/commands/createHistoryCommand/index.ts +44 -0
  20. package/cli/commands/createPullRequestHistoryCommand/createPullRequestHistory.ts +33 -0
  21. package/cli/commands/createPullRequestHistoryCommand/index.ts +31 -0
  22. package/cli/commands/createPullRequestReleaseCommand/addToPullRequestRelease.ts +71 -0
  23. package/cli/commands/createPullRequestReleaseCommand/createPullRequestRelease.ts +75 -0
  24. package/cli/commands/createPullRequestReleaseCommand/index.ts +74 -0
  25. package/cli/commands/getPackageHashCommand/index.ts +45 -0
  26. package/cli/commands/initCommand/index.ts +14 -0
  27. package/cli/commands/initCommand/initAndroid.ts +91 -0
  28. package/cli/commands/initCommand/initIos.ts +123 -0
  29. package/cli/commands/initCommand/test/initAndroid.test.ts +128 -0
  30. package/cli/commands/initCommand/test/initIos.test.ts +99 -0
  31. package/cli/commands/releaseCommand/addToReleaseHistory.ts +57 -0
  32. package/cli/commands/releaseCommand/index.ts +90 -0
  33. package/cli/commands/releaseCommand/release.ts +105 -0
  34. package/cli/commands/removePullRequestHistoryCommand/index.ts +37 -0
  35. package/cli/commands/removePullRequestHistoryCommand/removePullRequestHistory.ts +28 -0
  36. package/cli/commands/showHistoryCommand/index.ts +31 -0
  37. package/cli/commands/updateHistoryCommand/index.ts +55 -0
  38. package/cli/commands/updateHistoryCommand/updateReleaseHistory.ts +42 -0
  39. package/cli/constant.ts +4 -0
  40. package/cli/dist/commands/bundleCommand/bundleCodePush.js +65 -0
  41. package/cli/dist/commands/bundleCommand/index.js +15 -0
  42. package/cli/dist/commands/createHistoryCommand/createReleaseHistory.js +25 -0
  43. package/cli/dist/commands/createHistoryCommand/createReleaseHistoryList.js +27 -0
  44. package/cli/dist/commands/createHistoryCommand/index.js +20 -0
  45. package/cli/dist/commands/createPullRequestHistoryCommand/createPullRequestHistory.js +23 -0
  46. package/cli/dist/commands/createPullRequestHistoryCommand/index.js +15 -0
  47. package/cli/dist/commands/createPullRequestReleaseCommand/addToPullRequestRelease.js +51 -0
  48. package/cli/dist/commands/createPullRequestReleaseCommand/createPullRequestRelease.js +39 -0
  49. package/cli/dist/commands/createPullRequestReleaseCommand/index.js +35 -0
  50. package/cli/dist/commands/getPackageHashCommand/index.js +26 -0
  51. package/cli/dist/commands/initCommand/index.js +12 -0
  52. package/cli/dist/commands/initCommand/initAndroid.js +73 -0
  53. package/cli/dist/commands/initCommand/initIos.js +108 -0
  54. package/cli/dist/commands/initCommand/test/initAndroid.test.js +113 -0
  55. package/cli/dist/commands/initCommand/test/initIos.test.js +95 -0
  56. package/cli/dist/commands/releaseCommand/addToReleaseHistory.js +35 -0
  57. package/cli/dist/commands/releaseCommand/index.js +45 -0
  58. package/cli/dist/commands/releaseCommand/release.js +62 -0
  59. package/cli/dist/commands/removePullRequestHistoryCommand/index.js +19 -0
  60. package/cli/dist/commands/removePullRequestHistoryCommand/removePullRequestHistory.js +18 -0
  61. package/cli/dist/commands/showHistoryCommand/index.js +15 -0
  62. package/cli/dist/commands/updateHistoryCommand/index.js +31 -0
  63. package/cli/dist/commands/updateHistoryCommand/updateReleaseHistory.js +28 -0
  64. package/cli/dist/constant.js +4 -0
  65. package/cli/dist/functions/getReactTempDir.js +10 -0
  66. package/cli/{functions → dist/functions}/makeCodePushBundle.js +5 -11
  67. package/cli/{functions → dist/functions}/prepareToBundleJS.js +2 -5
  68. package/cli/dist/functions/runExpoBundleCommand.js +35 -0
  69. package/cli/{functions → dist/functions}/runHermesEmitBinaryCommand.js +36 -71
  70. package/cli/{functions → dist/functions}/runReactNativeBundleCommand.js +19 -24
  71. package/cli/dist/index.js +54 -0
  72. package/cli/dist/utils/datetime.js +17 -0
  73. package/cli/dist/utils/file-utils.js +19 -0
  74. package/cli/dist/utils/fsUtils.js +44 -0
  75. package/cli/{utils → dist/utils}/hash-utils.js +19 -130
  76. package/cli/{utils → dist/utils}/promisfied-fs.js +5 -16
  77. package/cli/dist/utils/showLogo.js +21 -0
  78. package/cli/dist/utils/unzip.js +41 -0
  79. package/cli/{utils → dist/utils}/zip.js +15 -51
  80. package/cli/functions/{getReactTempDir.js → getReactTempDir.ts} +2 -6
  81. package/cli/functions/makeCodePushBundle.ts +26 -0
  82. package/cli/functions/prepareToBundleJS.ts +10 -0
  83. package/cli/functions/runExpoBundleCommand.ts +45 -0
  84. package/cli/functions/runHermesEmitBinaryCommand.ts +203 -0
  85. package/cli/functions/runReactNativeBundleCommand.ts +67 -0
  86. package/cli/index.ts +68 -0
  87. package/cli/package.json +35 -0
  88. package/cli/utils/datetime.ts +19 -0
  89. package/cli/utils/{file-utils.js → file-utils.ts} +4 -21
  90. package/cli/utils/fsUtils.ts +50 -0
  91. package/cli/utils/hash-utils.ts +143 -0
  92. package/cli/utils/promisfied-fs.ts +19 -0
  93. package/cli/utils/{showLogo.js → showLogo.ts} +4 -6
  94. package/cli/utils/unzip.ts +46 -0
  95. package/cli/utils/zip.ts +65 -0
  96. package/expo/plugin/withCodePush.js +14 -0
  97. package/expo/plugin/withCodePushAndroid.js +92 -0
  98. package/expo/plugin/withCodePushIos.js +143 -0
  99. package/ios/CodePush/CodePush.h +0 -16
  100. package/ios/CodePush/CodePush.m +30 -20
  101. package/ios/CodePush/CodePushConfig.m +1 -11
  102. package/ios/CodePush/CodePushPackage.m +12 -69
  103. package/ios/CodePush/CodePushUpdateUtils.m +1 -91
  104. package/ios/CodePush/SSZipArchive/Info.plist +26 -0
  105. package/ios/CodePush/SSZipArchive/README.md +1 -1
  106. package/ios/CodePush/SSZipArchive/SSZipArchive.h +129 -27
  107. package/ios/CodePush/SSZipArchive/SSZipArchive.m +1119 -314
  108. package/ios/CodePush/SSZipArchive/SSZipCommon.h +71 -0
  109. package/ios/CodePush/SSZipArchive/Supporting Files/PrivacyInfo.xcprivacy +23 -0
  110. package/ios/CodePush/SSZipArchive/include/ZipArchive.h +25 -0
  111. package/ios/CodePush/SSZipArchive/minizip/LICENSE +17 -0
  112. package/ios/CodePush/SSZipArchive/minizip/mz.h +273 -0
  113. package/ios/CodePush/SSZipArchive/minizip/mz_compat.c +1306 -0
  114. package/ios/CodePush/SSZipArchive/minizip/mz_compat.h +346 -0
  115. package/ios/CodePush/SSZipArchive/minizip/mz_crypt.c +187 -0
  116. package/ios/CodePush/SSZipArchive/minizip/mz_crypt.h +65 -0
  117. package/ios/CodePush/SSZipArchive/minizip/mz_crypt_apple.c +526 -0
  118. package/ios/CodePush/SSZipArchive/minizip/mz_os.c +348 -0
  119. package/ios/CodePush/SSZipArchive/minizip/mz_os.h +176 -0
  120. package/ios/CodePush/SSZipArchive/minizip/mz_os_posix.c +350 -0
  121. package/ios/CodePush/SSZipArchive/minizip/mz_strm.c +556 -0
  122. package/ios/CodePush/SSZipArchive/minizip/mz_strm.h +132 -0
  123. package/ios/CodePush/SSZipArchive/minizip/mz_strm_buf.c +383 -0
  124. package/ios/CodePush/SSZipArchive/minizip/mz_strm_buf.h +42 -0
  125. package/ios/CodePush/SSZipArchive/minizip/mz_strm_mem.c +269 -0
  126. package/ios/CodePush/SSZipArchive/minizip/mz_strm_mem.h +48 -0
  127. package/ios/CodePush/SSZipArchive/minizip/mz_strm_os.h +40 -0
  128. package/ios/CodePush/SSZipArchive/minizip/mz_strm_os_posix.c +203 -0
  129. package/ios/CodePush/SSZipArchive/minizip/mz_strm_pkcrypt.c +334 -0
  130. package/ios/CodePush/SSZipArchive/minizip/mz_strm_pkcrypt.h +46 -0
  131. package/ios/CodePush/SSZipArchive/minizip/mz_strm_split.c +429 -0
  132. package/ios/CodePush/SSZipArchive/minizip/mz_strm_split.h +43 -0
  133. package/ios/CodePush/SSZipArchive/minizip/mz_strm_wzaes.c +360 -0
  134. package/ios/CodePush/SSZipArchive/minizip/mz_strm_wzaes.h +46 -0
  135. package/ios/CodePush/SSZipArchive/minizip/mz_strm_zlib.c +389 -0
  136. package/ios/CodePush/SSZipArchive/minizip/mz_strm_zlib.h +43 -0
  137. package/ios/CodePush/SSZipArchive/minizip/mz_zip.c +2782 -0
  138. package/ios/CodePush/SSZipArchive/minizip/mz_zip.h +262 -0
  139. package/ios/CodePush/SSZipArchive/minizip/mz_zip_rw.c +1942 -0
  140. package/ios/CodePush/SSZipArchive/minizip/mz_zip_rw.h +285 -0
  141. package/ios/CodePush.xcodeproj/project.pbxproj +244 -453
  142. package/ios/PrivacyInfo.xcprivacy +31 -0
  143. package/package.json +67 -41
  144. package/react-native.config.js +1 -1
  145. package/{AlertAdapter.js → src/AlertAdapter.js} +5 -5
  146. package/src/CodePush.js +947 -0
  147. package/{package-mixins.js → src/package-mixins.js} +1 -1
  148. package/{versioning → src/versioning}/BaseVersioning.js +12 -1
  149. package/{versioning → src/versioning}/SemverVersioning.test.js +78 -0
  150. package/typings/react-native-code-push.d.ts +559 -495
  151. package/CONTRIBUTING.md +0 -134
  152. package/CodePush.js +0 -972
  153. package/SECURITY.md +0 -41
  154. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushBuilder.java +0 -37
  155. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushInvalidPublicKeyException.java +0 -12
  156. package/android/app/src/main/java/com/microsoft/codepush/react/ReactInstanceHolder.java +0 -17
  157. package/android/codepush.gradle +0 -162
  158. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  159. package/android/gradle/wrapper/gradle-wrapper.properties +0 -5
  160. package/android/gradlew +0 -164
  161. package/android/gradlew.bat +0 -90
  162. package/babel.config.js +0 -3
  163. package/cli/commands/bundleCommand/bundleCodePush.js +0 -57
  164. package/cli/commands/bundleCommand/index.js +0 -55
  165. package/cli/commands/common.js +0 -245
  166. package/cli/commands/createHistoryCommand/createReleaseHistory.js +0 -42
  167. package/cli/commands/createHistoryCommand/createReleaseHistoryList.js +0 -52
  168. package/cli/commands/createHistoryCommand/index.js +0 -95
  169. package/cli/commands/createPullRequestHistoryCommand/createPullRequestHistory.js +0 -34
  170. package/cli/commands/createPullRequestHistoryCommand/index.js +0 -29
  171. package/cli/commands/createPullRequestReleaseCommand/addToPullRequestRelease.js +0 -74
  172. package/cli/commands/createPullRequestReleaseCommand/createPullRequestRelease.js +0 -91
  173. package/cli/commands/createPullRequestReleaseCommand/index.js +0 -68
  174. package/cli/commands/getPackageHashCommand/index.js +0 -42
  175. package/cli/commands/releaseCommand/addToReleaseHistory.js +0 -85
  176. package/cli/commands/releaseCommand/index.js +0 -151
  177. package/cli/commands/releaseCommand/release.js +0 -121
  178. package/cli/commands/removePullRequestHistoryCommand/index.js +0 -28
  179. package/cli/commands/removePullRequestHistoryCommand/removePullRequestHistory.js +0 -23
  180. package/cli/commands/showHistoryCommand/index.js +0 -88
  181. package/cli/commands/updateHistoryCommand/index.js +0 -123
  182. package/cli/commands/updateHistoryCommand/updateReleaseHistory.js +0 -69
  183. package/cli/constant.js +0 -8
  184. package/cli/index.js +0 -63
  185. package/cli/utils/datetime.js +0 -22
  186. package/cli/utils/fsUtils.js +0 -64
  187. package/cli/utils/version.js +0 -26
  188. package/code-push.config.example.supabase.ts +0 -114
  189. package/code-push.config.js +0 -229
  190. package/code-push.config.ts +0 -175
  191. package/docs/api-android.md +0 -83
  192. package/docs/api-ios.md +0 -31
  193. package/docs/api-js.md +0 -592
  194. package/docs/multi-deployment-testing-android.md +0 -148
  195. package/docs/multi-deployment-testing-ios.md +0 -59
  196. package/docs/setup-android.md +0 -482
  197. package/docs/setup-ios.md +0 -280
  198. package/eslint.config.mjs +0 -32
  199. package/ios/CodePush/Base64/Base64/MF_Base64Additions.h +0 -34
  200. package/ios/CodePush/Base64/Base64/MF_Base64Additions.m +0 -252
  201. package/ios/CodePush/Base64/README.md +0 -47
  202. package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithm.h +0 -69
  203. package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmFactory.h +0 -16
  204. package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmFactory.m +0 -51
  205. package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmNone.h +0 -15
  206. package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmNone.m +0 -55
  207. package/ios/CodePush/JWT/Core/Algorithms/ESFamily/JWTAlgorithmESBase.h +0 -24
  208. package/ios/CodePush/JWT/Core/Algorithms/ESFamily/JWTAlgorithmESBase.m +0 -41
  209. package/ios/CodePush/JWT/Core/Algorithms/HSFamily/JWTAlgorithmHSBase.h +0 -28
  210. package/ios/CodePush/JWT/Core/Algorithms/HSFamily/JWTAlgorithmHSBase.m +0 -205
  211. package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolder.h +0 -103
  212. package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolder.m +0 -322
  213. package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolderChain.h +0 -37
  214. package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolderChain.m +0 -145
  215. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/JWTAlgorithmRSBase.h +0 -35
  216. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/JWTAlgorithmRSBase.m +0 -551
  217. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/JWTRSAlgorithm.h +0 -23
  218. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKey.h +0 -43
  219. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKey.m +0 -230
  220. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKeyExtractor.h +0 -31
  221. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKeyExtractor.m +0 -113
  222. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoSecurity.h +0 -38
  223. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoSecurity.m +0 -500
  224. package/ios/CodePush/JWT/Core/ClaimSet/JWTClaim.h +0 -18
  225. package/ios/CodePush/JWT/Core/ClaimSet/JWTClaim.m +0 -214
  226. package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSet.h +0 -23
  227. package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSet.m +0 -29
  228. package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetSerializer.h +0 -19
  229. package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetSerializer.m +0 -68
  230. package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetVerifier.h +0 -18
  231. package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetVerifier.m +0 -72
  232. package/ios/CodePush/JWT/Core/Coding/JWTCoding+ResultTypes.h +0 -67
  233. package/ios/CodePush/JWT/Core/Coding/JWTCoding+ResultTypes.m +0 -111
  234. package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionOne.h +0 -119
  235. package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionOne.m +0 -307
  236. package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionThree.h +0 -94
  237. package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionThree.m +0 -619
  238. package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionTwo.h +0 -164
  239. package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionTwo.m +0 -514
  240. package/ios/CodePush/JWT/Core/Coding/JWTCoding.h +0 -24
  241. package/ios/CodePush/JWT/Core/Coding/JWTCoding.m +0 -11
  242. package/ios/CodePush/JWT/Core/FrameworkSupplement/JWT.h +0 -52
  243. package/ios/CodePush/JWT/Core/FrameworkSupplement/Map.modulemap +0 -5
  244. package/ios/CodePush/JWT/Core/Supplement/JWTBase64Coder.h +0 -28
  245. package/ios/CodePush/JWT/Core/Supplement/JWTBase64Coder.m +0 -70
  246. package/ios/CodePush/JWT/Core/Supplement/JWTDeprecations.h +0 -22
  247. package/ios/CodePush/JWT/Core/Supplement/JWTErrorDescription.h +0 -34
  248. package/ios/CodePush/JWT/Core/Supplement/JWTErrorDescription.m +0 -73
  249. package/ios/CodePush/JWT/LICENSE +0 -19
  250. package/ios/CodePush/JWT/README.md +0 -489
  251. package/ios/CodePush/SSZipArchive/Common.h +0 -81
  252. package/ios/CodePush/SSZipArchive/aes/aes.h +0 -198
  253. package/ios/CodePush/SSZipArchive/aes/aes_via_ace.h +0 -541
  254. package/ios/CodePush/SSZipArchive/aes/aescrypt.c +0 -294
  255. package/ios/CodePush/SSZipArchive/aes/aeskey.c +0 -548
  256. package/ios/CodePush/SSZipArchive/aes/aesopt.h +0 -739
  257. package/ios/CodePush/SSZipArchive/aes/aestab.c +0 -391
  258. package/ios/CodePush/SSZipArchive/aes/aestab.h +0 -173
  259. package/ios/CodePush/SSZipArchive/aes/brg_endian.h +0 -126
  260. package/ios/CodePush/SSZipArchive/aes/brg_types.h +0 -219
  261. package/ios/CodePush/SSZipArchive/aes/entropy.c +0 -54
  262. package/ios/CodePush/SSZipArchive/aes/entropy.h +0 -16
  263. package/ios/CodePush/SSZipArchive/aes/fileenc.c +0 -144
  264. package/ios/CodePush/SSZipArchive/aes/fileenc.h +0 -121
  265. package/ios/CodePush/SSZipArchive/aes/hmac.c +0 -145
  266. package/ios/CodePush/SSZipArchive/aes/hmac.h +0 -103
  267. package/ios/CodePush/SSZipArchive/aes/prng.c +0 -155
  268. package/ios/CodePush/SSZipArchive/aes/prng.h +0 -82
  269. package/ios/CodePush/SSZipArchive/aes/pwd2key.c +0 -103
  270. package/ios/CodePush/SSZipArchive/aes/pwd2key.h +0 -57
  271. package/ios/CodePush/SSZipArchive/aes/sha1.c +0 -258
  272. package/ios/CodePush/SSZipArchive/aes/sha1.h +0 -73
  273. package/ios/CodePush/SSZipArchive/minizip/crypt.h +0 -130
  274. package/ios/CodePush/SSZipArchive/minizip/ioapi.c +0 -369
  275. package/ios/CodePush/SSZipArchive/minizip/ioapi.h +0 -175
  276. package/ios/CodePush/SSZipArchive/minizip/mztools.c +0 -284
  277. package/ios/CodePush/SSZipArchive/minizip/mztools.h +0 -31
  278. package/ios/CodePush/SSZipArchive/minizip/unzip.c +0 -1839
  279. package/ios/CodePush/SSZipArchive/minizip/unzip.h +0 -248
  280. package/ios/CodePush/SSZipArchive/minizip/zip.c +0 -1910
  281. package/ios/CodePush/SSZipArchive/minizip/zip.h +0 -202
  282. package/scripts/generateBundledResourcesHash.js +0 -125
  283. package/scripts/getFilesInFolder.js +0 -19
  284. package/scripts/recordFilesBeforeBundleCommand.js +0 -41
  285. package/tsconfig.json +0 -20
  286. package/tslint.json +0 -32
  287. /package/{logging.js → src/logging.js} +0 -0
  288. /package/{versioning → src/versioning}/BaseVersioning.test.js +0 -0
  289. /package/{versioning → src/versioning}/IncrementalVersioning.js +0 -0
  290. /package/{versioning → src/versioning}/IncrementalVersioning.test.js +0 -0
  291. /package/{versioning → src/versioning}/SemverVersioning.js +0 -0
  292. /package/{versioning → src/versioning}/index.js +0 -0
@@ -1,202 +0,0 @@
1
- /* zip.h -- IO on .zip files using zlib
2
- Version 1.1, February 14h, 2010
3
- part of the MiniZip project
4
-
5
- Copyright (C) 1998-2010 Gilles Vollant
6
- http://www.winimage.com/zLibDll/minizip.html
7
- Modifications for Zip64 support
8
- Copyright (C) 2009-2010 Mathias Svensson
9
- http://result42.com
10
-
11
- This program is distributed under the terms of the same license as zlib.
12
- See the accompanying LICENSE file for the full text of the license.
13
- */
14
-
15
- #ifndef _ZIP_H
16
- #define _ZIP_H
17
-
18
- #define HAVE_AES
19
-
20
- #ifdef __cplusplus
21
- extern "C" {
22
- #endif
23
-
24
- #ifndef _ZLIB_H
25
- # include "zlib.h"
26
- #endif
27
-
28
- #ifndef _ZLIBIOAPI_H
29
- # include "ioapi.h"
30
- #endif
31
-
32
- #ifdef HAVE_BZIP2
33
- # include "bzlib.h"
34
- #endif
35
-
36
- #define Z_BZIP2ED 12
37
-
38
- #if defined(STRICTZIP) || defined(STRICTZIPUNZIP)
39
- /* like the STRICT of WIN32, we define a pointer that cannot be converted
40
- from (void*) without cast */
41
- typedef struct TagzipFile__ { int unused; } zipFile__;
42
- typedef zipFile__ *zipFile;
43
- #else
44
- typedef voidp zipFile;
45
- #endif
46
-
47
- #define ZIP_OK (0)
48
- #define ZIP_EOF (0)
49
- #define ZIP_ERRNO (Z_ERRNO)
50
- #define ZIP_PARAMERROR (-102)
51
- #define ZIP_BADZIPFILE (-103)
52
- #define ZIP_INTERNALERROR (-104)
53
-
54
- #ifndef DEF_MEM_LEVEL
55
- # if MAX_MEM_LEVEL >= 8
56
- # define DEF_MEM_LEVEL 8
57
- # else
58
- # define DEF_MEM_LEVEL MAX_MEM_LEVEL
59
- # endif
60
- #endif
61
- /* default memLevel */
62
-
63
- /* tm_zip contain date/time info */
64
- typedef struct tm_zip_s
65
- {
66
- uInt tm_sec; /* seconds after the minute - [0,59] */
67
- uInt tm_min; /* minutes after the hour - [0,59] */
68
- uInt tm_hour; /* hours since midnight - [0,23] */
69
- uInt tm_mday; /* day of the month - [1,31] */
70
- uInt tm_mon; /* months since January - [0,11] */
71
- uInt tm_year; /* years - [1980..2044] */
72
- } tm_zip;
73
-
74
- typedef struct
75
- {
76
- tm_zip tmz_date; /* date in understandable format */
77
- uLong dosDate; /* if dos_date == 0, tmu_date is used */
78
- uLong internal_fa; /* internal file attributes 2 bytes */
79
- uLong external_fa; /* external file attributes 4 bytes */
80
- } zip_fileinfo;
81
-
82
- typedef const char* zipcharpc;
83
-
84
- #define APPEND_STATUS_CREATE (0)
85
- #define APPEND_STATUS_CREATEAFTER (1)
86
- #define APPEND_STATUS_ADDINZIP (2)
87
-
88
- /***************************************************************************/
89
- /* Writing a zip file */
90
-
91
- extern zipFile ZEXPORT zipOpen OF((const char *pathname, int append));
92
- extern zipFile ZEXPORT zipOpen64 OF((const void *pathname, int append));
93
- /* Create a zipfile.
94
-
95
- pathname should contain the full pathname (by example, on a Windows XP computer
96
- "c:\\zlib\\zlib113.zip" or on an Unix computer "zlib/zlib113.zip".
97
-
98
- return NULL if zipfile cannot be opened
99
- return zipFile handle if no error
100
-
101
- If the file pathname exist and append == APPEND_STATUS_CREATEAFTER, the zip
102
- will be created at the end of the file. (useful if the file contain a self extractor code)
103
- If the file pathname exist and append == APPEND_STATUS_ADDINZIP, we will add files in existing
104
- zip (be sure you don't add file that doesn't exist)
105
-
106
- NOTE: There is no delete function into a zipfile. If you want delete file into a zipfile,
107
- you must open a zipfile, and create another. Of course, you can use RAW reading and writing to copy
108
- the file you did not want delete. */
109
-
110
- extern zipFile ZEXPORT zipOpen2 OF((const char *pathname, int append, zipcharpc* globalcomment,
111
- zlib_filefunc_def* pzlib_filefunc_def));
112
-
113
- extern zipFile ZEXPORT zipOpen2_64 OF((const void *pathname, int append, zipcharpc* globalcomment,
114
- zlib_filefunc64_def* pzlib_filefunc_def));
115
-
116
- extern zipFile ZEXPORT zipOpen3 OF((const char *pathname, int append, ZPOS64_T disk_size,
117
- zipcharpc* globalcomment, zlib_filefunc_def* pzlib_filefunc_def));
118
- /* Same as zipOpen2 but allows specification of spanned zip size */
119
-
120
- extern zipFile ZEXPORT zipOpen3_64 OF((const void *pathname, int append, ZPOS64_T disk_size,
121
- zipcharpc* globalcomment, zlib_filefunc64_def* pzlib_filefunc_def));
122
-
123
- extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file, const char* filename, const zip_fileinfo* zipfi,
124
- const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global,
125
- uInt size_extrafield_global, const char* comment, int method, int level));
126
- /* Open a file in the ZIP for writing.
127
-
128
- filename : the filename in zip (if NULL, '-' without quote will be used
129
- *zipfi contain supplemental information
130
- extrafield_local buffer to store the local header extra field data, can be NULL
131
- size_extrafield_local size of extrafield_local buffer
132
- extrafield_global buffer to store the global header extra field data, can be NULL
133
- size_extrafield_global size of extrafield_local buffer
134
- comment buffer for comment string
135
- method contain the compression method (0 for store, Z_DEFLATED for deflate)
136
- level contain the level of compression (can be Z_DEFAULT_COMPRESSION)
137
- zip64 is set to 1 if a zip64 extended information block should be added to the local file header.
138
- this MUST be '1' if the uncompressed size is >= 0xffffffff. */
139
-
140
- extern int ZEXPORT zipOpenNewFileInZip64 OF((zipFile file, const char* filename, const zip_fileinfo* zipfi,
141
- const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global,
142
- uInt size_extrafield_global, const char* comment, int method, int level, int zip64));
143
- /* Same as zipOpenNewFileInZip with zip64 support */
144
-
145
- extern int ZEXPORT zipOpenNewFileInZip2 OF((zipFile file, const char* filename, const zip_fileinfo* zipfi,
146
- const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global,
147
- uInt size_extrafield_global, const char* comment, int method, int level, int raw));
148
- /* Same as zipOpenNewFileInZip, except if raw=1, we write raw file */
149
-
150
- extern int ZEXPORT zipOpenNewFileInZip2_64 OF((zipFile file, const char* filename, const zip_fileinfo* zipfi,
151
- const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global,
152
- uInt size_extrafield_global, const char* comment, int method, int level, int raw, int zip64));
153
- /* Same as zipOpenNewFileInZip3 with zip64 support */
154
-
155
- extern int ZEXPORT zipOpenNewFileInZip3 OF((zipFile file, const char* filename, const zip_fileinfo* zipfi,
156
- const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global,
157
- uInt size_extrafield_global, const char* comment, int method, int level, int raw, int windowBits, int memLevel,
158
- int strategy, const char* password, uLong crcForCrypting));
159
- /* Same as zipOpenNewFileInZip2, except
160
- windowBits, memLevel, strategy : see parameter strategy in deflateInit2
161
- password : crypting password (NULL for no crypting)
162
- crcForCrypting : crc of file to compress (needed for crypting) */
163
-
164
- extern int ZEXPORT zipOpenNewFileInZip3_64 OF((zipFile file, const char* filename, const zip_fileinfo* zipfi,
165
- const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global,
166
- uInt size_extrafield_global, const char* comment, int method, int level, int raw, int windowBits, int memLevel,
167
- int strategy, const char* password, uLong crcForCrypting, int zip64));
168
- /* Same as zipOpenNewFileInZip3 with zip64 support */
169
-
170
- extern int ZEXPORT zipOpenNewFileInZip4 OF((zipFile file, const char* filename, const zip_fileinfo* zipfi,
171
- const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global,
172
- uInt size_extrafield_global, const char* comment, int method, int level, int raw, int windowBits, int memLevel,
173
- int strategy, const char* password, uLong crcForCrypting, uLong versionMadeBy, uLong flagBase));
174
- /* Same as zipOpenNewFileInZip3 except versionMadeBy & flag fields */
175
-
176
- extern int ZEXPORT zipOpenNewFileInZip4_64 OF((zipFile file, const char* filename, const zip_fileinfo* zipfi,
177
- const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global,
178
- uInt size_extrafield_global, const char* comment, int method, int level, int raw, int windowBits, int memLevel,
179
- int strategy, const char* password, uLong crcForCrypting, uLong versionMadeBy, uLong flagBase, int zip64));
180
- /* Same as zipOpenNewFileInZip4 with zip64 support */
181
-
182
- extern int ZEXPORT zipWriteInFileInZip OF((zipFile file, const void* buf, unsigned len));
183
- /* Write data in the zipfile */
184
-
185
- extern int ZEXPORT zipCloseFileInZip OF((zipFile file));
186
- /* Close the current file in the zipfile */
187
-
188
- extern int ZEXPORT zipCloseFileInZipRaw OF((zipFile file, uLong uncompressed_size, uLong crc32));
189
- extern int ZEXPORT zipCloseFileInZipRaw64 OF((zipFile file, ZPOS64_T uncompressed_size, uLong crc32));
190
- /* Close the current file in the zipfile, for file opened with parameter raw=1 in zipOpenNewFileInZip2
191
- uncompressed_size and crc32 are value for the uncompressed size */
192
-
193
- extern int ZEXPORT zipClose OF((zipFile file, const char* global_comment));
194
- /* Close the zipfile */
195
-
196
- /***************************************************************************/
197
-
198
- #ifdef __cplusplus
199
- }
200
- #endif
201
-
202
- #endif /* _ZIP_H */
@@ -1,125 +0,0 @@
1
- /*
2
- * This script generates a hash of all the React Native bundled assets and writes it into
3
- * into the APK. The hash in "updateCheck" requests to prevent downloading an identical
4
- * update to the one already present in the binary.
5
- *
6
- * It first creates a snapshot of the contents in the resource directory by creating
7
- * a map with the modified time of all the files in the directory. It then compares this
8
- * snapshot with the one saved earlier in "recordFilesBeforeBundleCommand.js" to figure
9
- * out which files were generated by the "react-native bundle" command. It then computes
10
- * the hash for each file to generate a manifest, and then computes a hash over the entire
11
- * manifest to generate the final hash, which is saved to the APK's assets directory.
12
- */
13
-
14
- var crypto = require("crypto");
15
- var fs = require("fs");
16
- var path = require("path");
17
-
18
- var getFilesInFolder = require("./getFilesInFolder");
19
-
20
- var CODE_PUSH_FOLDER_PREFIX = "CodePush";
21
- var CODE_PUSH_HASH_FILE_NAME = "CodePushHash";
22
- var CODE_PUSH_HASH_OLD_FILE_NAME = "CodePushHash.json";
23
- var HASH_ALGORITHM = "sha256";
24
-
25
- var resourcesDir = process.argv[2];
26
- var jsBundleFilePath = process.argv[3];
27
- var assetsDir = process.argv[4];
28
- var tempFileName = process.argv[5];
29
-
30
- var oldFileToModifiedTimeMap = {};
31
- var tempFileLocalPath = null;
32
- if (tempFileName) {
33
- tempFileLocalPath = path.join(require("os").tmpdir(), tempFileName);
34
- oldFileToModifiedTimeMap = require(tempFileLocalPath);
35
- }
36
- var resourceFiles = [];
37
-
38
- getFilesInFolder(resourcesDir, resourceFiles);
39
-
40
- var newFileToModifiedTimeMap = {};
41
-
42
- resourceFiles.forEach(function(resourceFile) {
43
- newFileToModifiedTimeMap[resourceFile.path.substring(resourcesDir.length)] = resourceFile.mtime;
44
- });
45
-
46
- var bundleGeneratedAssetFiles = [];
47
-
48
- for (var newFilePath in newFileToModifiedTimeMap) {
49
- if (!oldFileToModifiedTimeMap[newFilePath] || oldFileToModifiedTimeMap[newFilePath] < newFileToModifiedTimeMap[newFilePath].getTime()) {
50
- bundleGeneratedAssetFiles.push(newFilePath);
51
- }
52
- }
53
-
54
- var manifest = [];
55
-
56
- if (bundleGeneratedAssetFiles.length) {
57
- bundleGeneratedAssetFiles.forEach(function(assetFile) {
58
- // Generate hash for each asset file
59
- addFileToManifest(resourcesDir, assetFile, manifest, function() {
60
- if (manifest.length === bundleGeneratedAssetFiles.length) {
61
- addJsBundleAndMetaToManifest();
62
- }
63
- });
64
- });
65
- } else {
66
- addJsBundleAndMetaToManifest();
67
- }
68
-
69
- function addJsBundleAndMetaToManifest() {
70
- addFileToManifest(path.dirname(jsBundleFilePath), path.basename(jsBundleFilePath), manifest, function() {
71
- var jsBundleMetaFilePath = jsBundleFilePath + ".meta";
72
- addFileToManifest(path.dirname(jsBundleMetaFilePath), path.basename(jsBundleMetaFilePath), manifest, function() {
73
- manifest = manifest.sort();
74
- var finalHash = crypto.createHash(HASH_ALGORITHM)
75
- .update(JSON.stringify(manifest))
76
- .digest("hex");
77
-
78
- console.log(finalHash);
79
-
80
- var savedResourcesManifestPath = assetsDir + "/" + CODE_PUSH_HASH_FILE_NAME;
81
- fs.writeFileSync(savedResourcesManifestPath, finalHash);
82
-
83
- // "CodePushHash.json" file name breaks flow type checking.
84
- // To fix the issue we need to delete "CodePushHash.json" file and
85
- // use "CodePushHash" file name instead to store the hash value.
86
- // Relates to https://github.com/microsoft/react-native-code-push/issues/577
87
- var oldSavedResourcesManifestPath = assetsDir + "/" + CODE_PUSH_HASH_OLD_FILE_NAME;
88
- if (fs.existsSync(oldSavedResourcesManifestPath)) {
89
- fs.unlinkSync(oldSavedResourcesManifestPath);
90
- }
91
- });
92
- });
93
- }
94
-
95
- function addFileToManifest(folder, assetFile, manifest, done) {
96
- var fullFilePath = path.join(folder, assetFile);
97
- if (!fileExists(fullFilePath)) {
98
- done();
99
- return;
100
- }
101
-
102
- var readStream = fs.createReadStream(path.join(folder, assetFile));
103
- var hashStream = crypto.createHash(HASH_ALGORITHM);
104
-
105
- readStream.pipe(hashStream)
106
- .on("error", function(error) {
107
- throw error;
108
- })
109
- .on("finish", function() {
110
- hashStream.end();
111
- var buffer = hashStream.read();
112
- var fileHash = buffer.toString("hex");
113
- manifest.push(path.join(CODE_PUSH_FOLDER_PREFIX, assetFile).replace(/\\/g, "/") + ":" + fileHash);
114
- done();
115
- });
116
- }
117
-
118
- function fileExists(file) {
119
- try { return fs.statSync(file).isFile(); }
120
- catch (e) { return false; }
121
- }
122
-
123
- if (tempFileLocalPath) {
124
- fs.unlinkSync(tempFileLocalPath);
125
- }
@@ -1,19 +0,0 @@
1
- var fs = require("fs");
2
- var path = require("path");
3
-
4
- // Utility function that collects the stats of every file in a directory
5
- // as well as in its subdirectories.
6
- function getFilesInFolder(folderName, fileList) {
7
- var folderFiles = fs.readdirSync(folderName);
8
- folderFiles.forEach(function(file) {
9
- var fileStats = fs.statSync(path.join(folderName, file));
10
- if (fileStats.isDirectory()) {
11
- getFilesInFolder(path.join(folderName, file), fileList);
12
- } else {
13
- fileStats.path = path.join(folderName, file);
14
- fileList.push(fileStats);
15
- }
16
- });
17
- }
18
-
19
- module.exports = getFilesInFolder;
@@ -1,41 +0,0 @@
1
- /*
2
- * This script creates a snapshot of the contents in the resource directory
3
- * by creating a map with the modified time of all the files in the directory
4
- * and saving it to a temp file. This snapshot is later referenced in
5
- * "generatePackageHash.js" to figure out which files have changed or were
6
- * newly generated by the "react-native bundle" command.
7
- */
8
-
9
- var fs = require("fs");
10
- var path = require("path");
11
-
12
- var getFilesInFolder = require("./getFilesInFolder");
13
-
14
-
15
- var resourcesDir = process.argv[2];
16
- var tempFileName = process.argv[3];
17
-
18
- var tempFileLocalPath = path.join(require("os").tmpdir(), tempFileName);
19
- var resourceFiles = [];
20
-
21
- try {
22
- getFilesInFolder(resourcesDir, resourceFiles);
23
- } catch(error) {
24
- var targetPathNotFoundExceptionMessage = "\nResources directory path does not exist.\n";
25
- targetPathNotFoundExceptionMessage += "Unable to find '" + resourcesDir;
26
- targetPathNotFoundExceptionMessage += "' directory. Please check version of Android Plugin for Gradle.";
27
- error.message += targetPathNotFoundExceptionMessage;
28
- throw error;
29
- }
30
-
31
- var fileToModifiedTimeMap = {};
32
-
33
- resourceFiles.forEach(function(resourceFile) {
34
- fileToModifiedTimeMap[resourceFile.path.substring(resourcesDir.length)] = resourceFile.mtime.getTime();
35
- });
36
-
37
- fs.writeFile(tempFileLocalPath, JSON.stringify(fileToModifiedTimeMap), function(err) {
38
- if (err) {
39
- throw err;
40
- }
41
- });
package/tsconfig.json DELETED
@@ -1,20 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES5",
4
- "module": "CommonJS",
5
- "lib": ["es6"],
6
- "noImplicitAny": true,
7
- "noEmitOnError": true,
8
- "moduleResolution": "node",
9
- "sourceMap": true,
10
- "rootDir": "test",
11
- "outDir": "bin",
12
- "removeComments": true,
13
- "esModuleInterop": true
14
- },
15
- "ts-node": {
16
- "compilerOptions": {
17
- "module": "commonjs"
18
- }
19
- }
20
- }
package/tslint.json DELETED
@@ -1,32 +0,0 @@
1
- {
2
- "defaultSeverity": "error",
3
- "rules": {
4
- "class-name": true,
5
- "comment-format": [true,
6
- "check-space"
7
- ],
8
- "indent": [true,
9
- "spaces"
10
- ],
11
- "one-line": [true,
12
- "check-open-brace"
13
- ],
14
- "quotemark": [true,
15
- "double"
16
- ],
17
- "semicolon": true,
18
- "whitespace": [true,
19
- "check-branch",
20
- "check-operator",
21
- "check-separator",
22
- "check-type"
23
- ],
24
- "typedef-whitespace": [true, {
25
- "call-signature": "nospace",
26
- "index-signature": "nospace",
27
- "parameter": "nospace",
28
- "property-declaration": "nospace",
29
- "variable-declaration": "nospace"
30
- }]
31
- }
32
- }
File without changes
File without changes