@swiftpatch/react-native 2.0.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 (182) hide show
  1. package/README.md +430 -0
  2. package/android/build.gradle +105 -0
  3. package/android/src/main/AndroidManifest.xml +6 -0
  4. package/android/src/main/java/com/swiftpatch/BundleManager.kt +107 -0
  5. package/android/src/main/java/com/swiftpatch/CrashDetector.kt +79 -0
  6. package/android/src/main/java/com/swiftpatch/CryptoVerifier.kt +69 -0
  7. package/android/src/main/java/com/swiftpatch/DownloadManager.kt +120 -0
  8. package/android/src/main/java/com/swiftpatch/EventQueue.kt +86 -0
  9. package/android/src/main/java/com/swiftpatch/FileUtils.kt +60 -0
  10. package/android/src/main/java/com/swiftpatch/PatchApplier.kt +60 -0
  11. package/android/src/main/java/com/swiftpatch/SignalCrashHandler.kt +84 -0
  12. package/android/src/main/java/com/swiftpatch/SlotManager.kt +299 -0
  13. package/android/src/main/java/com/swiftpatch/SwiftPatchModule.kt +630 -0
  14. package/android/src/main/java/com/swiftpatch/SwiftPatchPackage.kt +21 -0
  15. package/android/src/main/jni/CMakeLists.txt +12 -0
  16. package/android/src/main/jni/bspatch.c +188 -0
  17. package/android/src/main/jni/bspatch.h +57 -0
  18. package/android/src/main/jni/bspatch_jni.c +28 -0
  19. package/ios/Libraries/bspatch/bspatch.c +188 -0
  20. package/ios/Libraries/bspatch/bspatch.h +50 -0
  21. package/ios/Libraries/bspatch/module.modulemap +4 -0
  22. package/ios/SwiftPatch/BundleManager.swift +113 -0
  23. package/ios/SwiftPatch/CrashDetector.swift +71 -0
  24. package/ios/SwiftPatch/CryptoVerifier.swift +70 -0
  25. package/ios/SwiftPatch/DownloadManager.swift +125 -0
  26. package/ios/SwiftPatch/EventQueue.swift +116 -0
  27. package/ios/SwiftPatch/FileUtils.swift +38 -0
  28. package/ios/SwiftPatch/PatchApplier.swift +41 -0
  29. package/ios/SwiftPatch/SignalCrashHandler.swift +129 -0
  30. package/ios/SwiftPatch/SlotManager.swift +360 -0
  31. package/ios/SwiftPatch/SwiftPatchModule.m +56 -0
  32. package/ios/SwiftPatch/SwiftPatchModule.swift +621 -0
  33. package/lib/commonjs/SwiftPatchCore.js +140 -0
  34. package/lib/commonjs/SwiftPatchCore.js.map +1 -0
  35. package/lib/commonjs/SwiftPatchProvider.js +617 -0
  36. package/lib/commonjs/SwiftPatchProvider.js.map +1 -0
  37. package/lib/commonjs/constants.js +50 -0
  38. package/lib/commonjs/constants.js.map +1 -0
  39. package/lib/commonjs/core/Downloader.js +63 -0
  40. package/lib/commonjs/core/Downloader.js.map +1 -0
  41. package/lib/commonjs/core/Installer.js +46 -0
  42. package/lib/commonjs/core/Installer.js.map +1 -0
  43. package/lib/commonjs/core/Rollback.js +36 -0
  44. package/lib/commonjs/core/Rollback.js.map +1 -0
  45. package/lib/commonjs/core/UpdateChecker.js +57 -0
  46. package/lib/commonjs/core/UpdateChecker.js.map +1 -0
  47. package/lib/commonjs/core/Verifier.js +82 -0
  48. package/lib/commonjs/core/Verifier.js.map +1 -0
  49. package/lib/commonjs/core/index.js +41 -0
  50. package/lib/commonjs/core/index.js.map +1 -0
  51. package/lib/commonjs/index.js +154 -0
  52. package/lib/commonjs/index.js.map +1 -0
  53. package/lib/commonjs/modal/SwiftPatchModal.js +667 -0
  54. package/lib/commonjs/modal/SwiftPatchModal.js.map +1 -0
  55. package/lib/commonjs/modal/useSwiftPatchModal.js +26 -0
  56. package/lib/commonjs/modal/useSwiftPatchModal.js.map +1 -0
  57. package/lib/commonjs/native/NativeSwiftPatch.js +85 -0
  58. package/lib/commonjs/native/NativeSwiftPatch.js.map +1 -0
  59. package/lib/commonjs/native/NativeSwiftPatchSpec.js +15 -0
  60. package/lib/commonjs/native/NativeSwiftPatchSpec.js.map +1 -0
  61. package/lib/commonjs/package.json +1 -0
  62. package/lib/commonjs/types.js +126 -0
  63. package/lib/commonjs/types.js.map +1 -0
  64. package/lib/commonjs/useSwiftPatch.js +31 -0
  65. package/lib/commonjs/useSwiftPatch.js.map +1 -0
  66. package/lib/commonjs/utils/api.js +206 -0
  67. package/lib/commonjs/utils/api.js.map +1 -0
  68. package/lib/commonjs/utils/device.js +23 -0
  69. package/lib/commonjs/utils/device.js.map +1 -0
  70. package/lib/commonjs/utils/logger.js +30 -0
  71. package/lib/commonjs/utils/logger.js.map +1 -0
  72. package/lib/commonjs/utils/storage.js +31 -0
  73. package/lib/commonjs/utils/storage.js.map +1 -0
  74. package/lib/commonjs/withSwiftPatch.js +42 -0
  75. package/lib/commonjs/withSwiftPatch.js.map +1 -0
  76. package/lib/module/SwiftPatchCore.js +135 -0
  77. package/lib/module/SwiftPatchCore.js.map +1 -0
  78. package/lib/module/SwiftPatchProvider.js +611 -0
  79. package/lib/module/SwiftPatchProvider.js.map +1 -0
  80. package/lib/module/constants.js +46 -0
  81. package/lib/module/constants.js.map +1 -0
  82. package/lib/module/core/Downloader.js +57 -0
  83. package/lib/module/core/Downloader.js.map +1 -0
  84. package/lib/module/core/Installer.js +41 -0
  85. package/lib/module/core/Installer.js.map +1 -0
  86. package/lib/module/core/Rollback.js +31 -0
  87. package/lib/module/core/Rollback.js.map +1 -0
  88. package/lib/module/core/UpdateChecker.js +51 -0
  89. package/lib/module/core/UpdateChecker.js.map +1 -0
  90. package/lib/module/core/Verifier.js +76 -0
  91. package/lib/module/core/Verifier.js.map +1 -0
  92. package/lib/module/core/index.js +8 -0
  93. package/lib/module/core/index.js.map +1 -0
  94. package/lib/module/index.js +34 -0
  95. package/lib/module/index.js.map +1 -0
  96. package/lib/module/modal/SwiftPatchModal.js +661 -0
  97. package/lib/module/modal/SwiftPatchModal.js.map +1 -0
  98. package/lib/module/modal/useSwiftPatchModal.js +22 -0
  99. package/lib/module/modal/useSwiftPatchModal.js.map +1 -0
  100. package/lib/module/native/NativeSwiftPatch.js +78 -0
  101. package/lib/module/native/NativeSwiftPatch.js.map +1 -0
  102. package/lib/module/native/NativeSwiftPatchSpec.js +12 -0
  103. package/lib/module/native/NativeSwiftPatchSpec.js.map +1 -0
  104. package/lib/module/types.js +139 -0
  105. package/lib/module/types.js.map +1 -0
  106. package/lib/module/useSwiftPatch.js +26 -0
  107. package/lib/module/useSwiftPatch.js.map +1 -0
  108. package/lib/module/utils/api.js +197 -0
  109. package/lib/module/utils/api.js.map +1 -0
  110. package/lib/module/utils/device.js +18 -0
  111. package/lib/module/utils/device.js.map +1 -0
  112. package/lib/module/utils/logger.js +26 -0
  113. package/lib/module/utils/logger.js.map +1 -0
  114. package/lib/module/utils/storage.js +24 -0
  115. package/lib/module/utils/storage.js.map +1 -0
  116. package/lib/module/withSwiftPatch.js +37 -0
  117. package/lib/module/withSwiftPatch.js.map +1 -0
  118. package/lib/typescript/SwiftPatchCore.d.ts +64 -0
  119. package/lib/typescript/SwiftPatchCore.d.ts.map +1 -0
  120. package/lib/typescript/SwiftPatchProvider.d.ts +22 -0
  121. package/lib/typescript/SwiftPatchProvider.d.ts.map +1 -0
  122. package/lib/typescript/constants.d.ts +33 -0
  123. package/lib/typescript/constants.d.ts.map +1 -0
  124. package/lib/typescript/core/Downloader.d.ts +34 -0
  125. package/lib/typescript/core/Downloader.d.ts.map +1 -0
  126. package/lib/typescript/core/Installer.d.ts +25 -0
  127. package/lib/typescript/core/Installer.d.ts.map +1 -0
  128. package/lib/typescript/core/Rollback.d.ts +18 -0
  129. package/lib/typescript/core/Rollback.d.ts.map +1 -0
  130. package/lib/typescript/core/UpdateChecker.d.ts +27 -0
  131. package/lib/typescript/core/UpdateChecker.d.ts.map +1 -0
  132. package/lib/typescript/core/Verifier.d.ts +31 -0
  133. package/lib/typescript/core/Verifier.d.ts.map +1 -0
  134. package/lib/typescript/core/index.d.ts +8 -0
  135. package/lib/typescript/core/index.d.ts.map +1 -0
  136. package/lib/typescript/index.d.ts +13 -0
  137. package/lib/typescript/index.d.ts.map +1 -0
  138. package/lib/typescript/modal/SwiftPatchModal.d.ts +11 -0
  139. package/lib/typescript/modal/SwiftPatchModal.d.ts.map +1 -0
  140. package/lib/typescript/modal/useSwiftPatchModal.d.ts +7 -0
  141. package/lib/typescript/modal/useSwiftPatchModal.d.ts.map +1 -0
  142. package/lib/typescript/native/NativeSwiftPatch.d.ts +61 -0
  143. package/lib/typescript/native/NativeSwiftPatch.d.ts.map +1 -0
  144. package/lib/typescript/native/NativeSwiftPatchSpec.d.ts +67 -0
  145. package/lib/typescript/native/NativeSwiftPatchSpec.d.ts.map +1 -0
  146. package/lib/typescript/types.d.ts +266 -0
  147. package/lib/typescript/types.d.ts.map +1 -0
  148. package/lib/typescript/useSwiftPatch.d.ts +12 -0
  149. package/lib/typescript/useSwiftPatch.d.ts.map +1 -0
  150. package/lib/typescript/utils/api.d.ts +87 -0
  151. package/lib/typescript/utils/api.d.ts.map +1 -0
  152. package/lib/typescript/utils/device.d.ts +9 -0
  153. package/lib/typescript/utils/device.d.ts.map +1 -0
  154. package/lib/typescript/utils/logger.d.ts +8 -0
  155. package/lib/typescript/utils/logger.d.ts.map +1 -0
  156. package/lib/typescript/utils/storage.d.ts +14 -0
  157. package/lib/typescript/utils/storage.d.ts.map +1 -0
  158. package/lib/typescript/withSwiftPatch.d.ts +12 -0
  159. package/lib/typescript/withSwiftPatch.d.ts.map +1 -0
  160. package/package.json +99 -0
  161. package/react-native-swiftpatch.podspec +50 -0
  162. package/src/SwiftPatchCore.ts +148 -0
  163. package/src/SwiftPatchProvider.tsx +514 -0
  164. package/src/constants.ts +49 -0
  165. package/src/core/Downloader.ts +74 -0
  166. package/src/core/Installer.ts +38 -0
  167. package/src/core/Rollback.ts +28 -0
  168. package/src/core/UpdateChecker.ts +70 -0
  169. package/src/core/Verifier.ts +92 -0
  170. package/src/core/index.ts +11 -0
  171. package/src/index.ts +64 -0
  172. package/src/modal/SwiftPatchModal.tsx +657 -0
  173. package/src/modal/useSwiftPatchModal.ts +24 -0
  174. package/src/native/NativeSwiftPatch.ts +205 -0
  175. package/src/native/NativeSwiftPatchSpec.ts +139 -0
  176. package/src/types.ts +336 -0
  177. package/src/useSwiftPatch.ts +29 -0
  178. package/src/utils/api.ts +244 -0
  179. package/src/utils/device.ts +15 -0
  180. package/src/utils/logger.ts +29 -0
  181. package/src/utils/storage.ts +23 -0
  182. package/src/withSwiftPatch.tsx +41 -0
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SDK_VERSION = exports.NativeEvents = exports.EVENT_POLL_INTERVAL_MS = exports.DEFAULT_CONFIG = exports.CRASH_DETECTION_WINDOW_MS = void 0;
7
+ var _types = require("./types");
8
+ /**
9
+ * Default SDK configuration values
10
+ */
11
+ const DEFAULT_CONFIG = exports.DEFAULT_CONFIG = {
12
+ serverUrl: 'https://orbitplus.hyperbrainlabs.com/api/v1',
13
+ checkOnResume: true,
14
+ checkInterval: 60_000,
15
+ installMode: _types.InstallMode.ON_NEXT_RESTART,
16
+ mandatoryInstallMode: _types.InstallMode.IMMEDIATE,
17
+ debug: false,
18
+ customHeaders: {},
19
+ publicKey: null,
20
+ autoStabilizeAfterLaunches: 0,
21
+ sdkPin: null
22
+ };
23
+
24
+ /**
25
+ * Native event names emitted from native modules
26
+ */
27
+ const NativeEvents = exports.NativeEvents = {
28
+ DOWNLOAD_PROGRESS: 'SwiftPatch:downloadProgress',
29
+ INSTALL_COMPLETE: 'SwiftPatch:installComplete',
30
+ ROLLBACK_OCCURRED: 'SwiftPatch:rollbackOccurred',
31
+ ERROR: 'SwiftPatch:error',
32
+ VERSION_CHANGED: 'SwiftPatch:versionChanged',
33
+ NATIVE_EVENT: 'SwiftPatch:event'
34
+ };
35
+
36
+ /**
37
+ * SDK version identifier
38
+ */
39
+ const SDK_VERSION = exports.SDK_VERSION = '2.0.0';
40
+
41
+ /**
42
+ * Crash detection window in milliseconds
43
+ */
44
+ const CRASH_DETECTION_WINDOW_MS = exports.CRASH_DETECTION_WINDOW_MS = 10_000;
45
+
46
+ /**
47
+ * Event polling interval (ms)
48
+ */
49
+ const EVENT_POLL_INTERVAL_MS = exports.EVENT_POLL_INTERVAL_MS = 3_000;
50
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_types","require","DEFAULT_CONFIG","exports","serverUrl","checkOnResume","checkInterval","installMode","InstallMode","ON_NEXT_RESTART","mandatoryInstallMode","IMMEDIATE","debug","customHeaders","publicKey","autoStabilizeAfterLaunches","sdkPin","NativeEvents","DOWNLOAD_PROGRESS","INSTALL_COMPLETE","ROLLBACK_OCCURRED","ERROR","VERSION_CHANGED","NATIVE_EVENT","SDK_VERSION","CRASH_DETECTION_WINDOW_MS","EVENT_POLL_INTERVAL_MS"],"sourceRoot":"../../src","sources":["constants.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAGA;AACA;AACA;AACO,MAAMC,cAIZ,GAAAC,OAAA,CAAAD,cAAA,GAAG;EACFE,SAAS,EAAE,6CAA6C;EACxDC,aAAa,EAAE,IAAI;EACnBC,aAAa,EAAE,MAAM;EACrBC,WAAW,EAAEC,kBAAW,CAACC,eAAe;EACxCC,oBAAoB,EAAEF,kBAAW,CAACG,SAAS;EAC3CC,KAAK,EAAE,KAAK;EACZC,aAAa,EAAE,CAAC,CAAC;EACjBC,SAAS,EAAE,IAAI;EACfC,0BAA0B,EAAE,CAAC;EAC7BC,MAAM,EAAE;AACV,CAAC;;AAED;AACA;AACA;AACO,MAAMC,YAAY,GAAAd,OAAA,CAAAc,YAAA,GAAG;EAC1BC,iBAAiB,EAAE,6BAA6B;EAChDC,gBAAgB,EAAE,4BAA4B;EAC9CC,iBAAiB,EAAE,6BAA6B;EAChDC,KAAK,EAAE,kBAAkB;EACzBC,eAAe,EAAE,2BAA2B;EAC5CC,YAAY,EAAE;AAChB,CAAU;;AAEV;AACA;AACA;AACO,MAAMC,WAAW,GAAArB,OAAA,CAAAqB,WAAA,GAAG,OAAO;;AAElC;AACA;AACA;AACO,MAAMC,yBAAyB,GAAAtB,OAAA,CAAAsB,yBAAA,GAAG,MAAM;;AAE/C;AACA;AACA;AACO,MAAMC,sBAAsB,GAAAvB,OAAA,CAAAuB,sBAAA,GAAG,KAAK","ignoreList":[]}
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Downloader = void 0;
7
+ var _NativeSwiftPatch = _interopRequireWildcard(require("../native/NativeSwiftPatch"));
8
+ var _logger = require("../utils/logger");
9
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
10
+ /**
11
+ * Core module responsible for downloading OTA bundles or patches.
12
+ *
13
+ * Delegates to the native module for actual download + disk I/O.
14
+ * Provides progress tracking and cancellation.
15
+ */
16
+ class Downloader {
17
+ unsubscribeProgress = null;
18
+
19
+ /**
20
+ * Download a bundle or patch from the given options.
21
+ */
22
+ async download(options) {
23
+ _logger.logger.info(`Downloading ${options.isPatch ? 'patch' : 'full bundle'}: ${options.expectedHash}`);
24
+ await _NativeSwiftPatch.default.downloadUpdate(options.url, options.expectedHash, options.isPatch, options.signature);
25
+ _logger.logger.info('Download complete');
26
+ }
27
+
28
+ /**
29
+ * Convenience: download a release (extracts fields from ReleaseInfo).
30
+ */
31
+ async downloadRelease(release) {
32
+ await this.download({
33
+ url: release.downloadUrl,
34
+ expectedHash: release.bundleHash,
35
+ isPatch: release.isPatch,
36
+ signature: release.signature || null
37
+ });
38
+ }
39
+
40
+ /**
41
+ * Register a callback for download progress events.
42
+ * Returns an unsubscribe function.
43
+ */
44
+ onProgress(callback) {
45
+ this.unsubscribeProgress = (0, _NativeSwiftPatch.onDownloadProgress)(callback);
46
+ return () => {
47
+ if (this.unsubscribeProgress) {
48
+ this.unsubscribeProgress();
49
+ this.unsubscribeProgress = null;
50
+ }
51
+ };
52
+ }
53
+
54
+ /**
55
+ * Cancel an in-progress download.
56
+ */
57
+ async cancel() {
58
+ _logger.logger.info('Cancelling download');
59
+ await _NativeSwiftPatch.default.cancelDownload();
60
+ }
61
+ }
62
+ exports.Downloader = Downloader;
63
+ //# sourceMappingURL=Downloader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_NativeSwiftPatch","_interopRequireWildcard","require","_logger","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","Downloader","unsubscribeProgress","download","options","logger","info","isPatch","expectedHash","NativeSwiftPatch","downloadUpdate","url","signature","downloadRelease","release","downloadUrl","bundleHash","onProgress","callback","onDownloadProgress","cancel","cancelDownload","exports"],"sourceRoot":"../../../src","sources":["core/Downloader.ts"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,OAAA,GAAAD,OAAA;AAAyC,SAAAD,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAL,uBAAA,YAAAA,CAAAG,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAUzC;AACA;AACA;AACA;AACA;AACA;AACO,MAAMkB,UAAU,CAAC;EACdC,mBAAmB,GAAwB,IAAI;;EAEvD;AACF;AACA;EACE,MAAMC,QAAQA,CAACC,OAAwB,EAAiB;IACtDC,cAAM,CAACC,IAAI,CACT,eAAeF,OAAO,CAACG,OAAO,GAAG,OAAO,GAAG,aAAa,KAAKH,OAAO,CAACI,YAAY,EACnF,CAAC;IAED,MAAMC,yBAAgB,CAACC,cAAc,CACnCN,OAAO,CAACO,GAAG,EACXP,OAAO,CAACI,YAAY,EACpBJ,OAAO,CAACG,OAAO,EACfH,OAAO,CAACQ,SACV,CAAC;IAEDP,cAAM,CAACC,IAAI,CAAC,mBAAmB,CAAC;EAClC;;EAEA;AACF;AACA;EACE,MAAMO,eAAeA,CAACC,OAAoB,EAAiB;IACzD,MAAM,IAAI,CAACX,QAAQ,CAAC;MAClBQ,GAAG,EAAEG,OAAO,CAACC,WAAW;MACxBP,YAAY,EAAEM,OAAO,CAACE,UAAU;MAChCT,OAAO,EAAEO,OAAO,CAACP,OAAO;MACxBK,SAAS,EAAEE,OAAO,CAACF,SAAS,IAAI;IAClC,CAAC,CAAC;EACJ;;EAEA;AACF;AACA;AACA;EACEK,UAAUA,CAACC,QAA8C,EAAc;IACrE,IAAI,CAAChB,mBAAmB,GAAG,IAAAiB,oCAAkB,EAACD,QAAQ,CAAC;IACvD,OAAO,MAAM;MACX,IAAI,IAAI,CAAChB,mBAAmB,EAAE;QAC5B,IAAI,CAACA,mBAAmB,CAAC,CAAC;QAC1B,IAAI,CAACA,mBAAmB,GAAG,IAAI;MACjC;IACF,CAAC;EACH;;EAEA;AACF;AACA;EACE,MAAMkB,MAAMA,CAAA,EAAkB;IAC5Bf,cAAM,CAACC,IAAI,CAAC,qBAAqB,CAAC;IAClC,MAAMG,yBAAgB,CAACY,cAAc,CAAC,CAAC;EACzC;AACF;AAACC,OAAA,CAAArB,UAAA,GAAAA,UAAA","ignoreList":[]}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Installer = void 0;
7
+ var _NativeSwiftPatch = _interopRequireDefault(require("../native/NativeSwiftPatch"));
8
+ var _logger = require("../utils/logger");
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ /**
11
+ * Core module responsible for installing verified bundles.
12
+ *
13
+ * Delegates to the native module for atomic file operations
14
+ * and pending install tracking.
15
+ */
16
+ class Installer {
17
+ /**
18
+ * Install a downloaded and verified bundle by its hash.
19
+ * The native module handles moving the file to the correct location
20
+ * and setting it as the pending bundle.
21
+ */
22
+ async install(bundleHash) {
23
+ _logger.logger.info(`Installing bundle: ${bundleHash}`);
24
+ await _NativeSwiftPatch.default.installUpdate(bundleHash);
25
+ _logger.logger.info('Bundle installed, restart required to activate');
26
+ }
27
+
28
+ /**
29
+ * Confirm the current installation as stable.
30
+ * Call this after the app has been running without crashes
31
+ * for the crash detection window period.
32
+ */
33
+ async confirm() {
34
+ _logger.logger.info('Confirming installation as stable');
35
+ await _NativeSwiftPatch.default.confirmInstall();
36
+ }
37
+
38
+ /**
39
+ * Check if there is a pending installation awaiting restart.
40
+ */
41
+ async hasPending() {
42
+ return _NativeSwiftPatch.default.hasPendingInstall();
43
+ }
44
+ }
45
+ exports.Installer = Installer;
46
+ //# sourceMappingURL=Installer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_NativeSwiftPatch","_interopRequireDefault","require","_logger","e","__esModule","default","Installer","install","bundleHash","logger","info","NativeSwiftPatch","installUpdate","confirm","confirmInstall","hasPending","hasPendingInstall","exports"],"sourceRoot":"../../../src","sources":["core/Installer.ts"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAAyC,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEzC;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,SAAS,CAAC;EACrB;AACF;AACA;AACA;AACA;EACE,MAAMC,OAAOA,CAACC,UAAkB,EAAiB;IAC/CC,cAAM,CAACC,IAAI,CAAC,sBAAsBF,UAAU,EAAE,CAAC;IAC/C,MAAMG,yBAAgB,CAACC,aAAa,CAACJ,UAAU,CAAC;IAChDC,cAAM,CAACC,IAAI,CAAC,gDAAgD,CAAC;EAC/D;;EAEA;AACF;AACA;AACA;AACA;EACE,MAAMG,OAAOA,CAAA,EAAkB;IAC7BJ,cAAM,CAACC,IAAI,CAAC,mCAAmC,CAAC;IAChD,MAAMC,yBAAgB,CAACG,cAAc,CAAC,CAAC;EACzC;;EAEA;AACF;AACA;EACE,MAAMC,UAAUA,CAAA,EAAqB;IACnC,OAAOJ,yBAAgB,CAACK,iBAAiB,CAAC,CAAC;EAC7C;AACF;AAACC,OAAA,CAAAX,SAAA,GAAAA,SAAA","ignoreList":[]}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Rollback = void 0;
7
+ var _NativeSwiftPatch = _interopRequireDefault(require("../native/NativeSwiftPatch"));
8
+ var _logger = require("../utils/logger");
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ /**
11
+ * Core module responsible for rollback operations.
12
+ *
13
+ * Delegates to the native module for reverting to the
14
+ * previous bundle version and clearing pending updates.
15
+ */
16
+ class Rollback {
17
+ /**
18
+ * Rollback to the previous bundle version.
19
+ * The native module restores the prior known-good bundle.
20
+ */
21
+ async rollback() {
22
+ _logger.logger.info('Rolling back to previous bundle');
23
+ await _NativeSwiftPatch.default.rollback();
24
+ _logger.logger.info('Rollback complete');
25
+ }
26
+
27
+ /**
28
+ * Clear any pending update that has not yet been activated.
29
+ */
30
+ async clearPending() {
31
+ _logger.logger.info('Clearing pending update');
32
+ await _NativeSwiftPatch.default.clearPendingUpdate();
33
+ }
34
+ }
35
+ exports.Rollback = Rollback;
36
+ //# sourceMappingURL=Rollback.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_NativeSwiftPatch","_interopRequireDefault","require","_logger","e","__esModule","default","Rollback","rollback","logger","info","NativeSwiftPatch","clearPending","clearPendingUpdate","exports"],"sourceRoot":"../../../src","sources":["core/Rollback.ts"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAAyC,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEzC;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,QAAQ,CAAC;EACpB;AACF;AACA;AACA;EACE,MAAMC,QAAQA,CAAA,EAAkB;IAC9BC,cAAM,CAACC,IAAI,CAAC,iCAAiC,CAAC;IAC9C,MAAMC,yBAAgB,CAACH,QAAQ,CAAC,CAAC;IACjCC,cAAM,CAACC,IAAI,CAAC,mBAAmB,CAAC;EAClC;;EAEA;AACF;AACA;EACE,MAAME,YAAYA,CAAA,EAAkB;IAClCH,cAAM,CAACC,IAAI,CAAC,yBAAyB,CAAC;IACtC,MAAMC,yBAAgB,CAACE,kBAAkB,CAAC,CAAC;EAC7C;AACF;AAACC,OAAA,CAAAP,QAAA,GAAAA,QAAA","ignoreList":[]}
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.UpdateChecker = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _NativeSwiftPatch = _interopRequireDefault(require("../native/NativeSwiftPatch"));
9
+ var _api = require("../utils/api");
10
+ var _logger = require("../utils/logger");
11
+ var _constants = require("../constants");
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
+ /**
14
+ * Core module responsible for checking for available OTA updates.
15
+ *
16
+ * Gathers device info from the native module and calls the
17
+ * server's check-update endpoint.
18
+ */
19
+ class UpdateChecker {
20
+ constructor(options) {
21
+ this.options = options;
22
+ }
23
+
24
+ /**
25
+ * Check the server for an available update.
26
+ * Gathers appVersion, currentBundleHash, deviceId from native module.
27
+ */
28
+ async check() {
29
+ const appVersion = await _NativeSwiftPatch.default.getAppVersion();
30
+ const currentBundle = await _NativeSwiftPatch.default.getCurrentBundle();
31
+ const deviceId = await _NativeSwiftPatch.default.getDeviceId();
32
+ _logger.logger.debug(`Checking for update: appVersion=${appVersion}, platform=${_reactNative.Platform.OS}, sdkVersion=${_constants.SDK_VERSION}`);
33
+ const result = await (0, _api.checkForUpdateAPI)({
34
+ serverUrl: this.options.serverUrl,
35
+ deploymentKey: this.options.deploymentKey,
36
+ appVersion,
37
+ currentBundleHash: currentBundle?.hash || null,
38
+ platform: _reactNative.Platform.OS,
39
+ deviceId,
40
+ customHeaders: this.options.customHeaders
41
+ });
42
+ if (result.updateAvailable && result.release) {
43
+ _logger.logger.info(`Update available: ${result.release.version}`);
44
+ return {
45
+ updateAvailable: true,
46
+ release: result.release
47
+ };
48
+ }
49
+ _logger.logger.debug('No update available');
50
+ return {
51
+ updateAvailable: false,
52
+ reason: result.reason || 'NO_UPDATE'
53
+ };
54
+ }
55
+ }
56
+ exports.UpdateChecker = UpdateChecker;
57
+ //# sourceMappingURL=UpdateChecker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_NativeSwiftPatch","_interopRequireDefault","_api","_logger","_constants","e","__esModule","default","UpdateChecker","constructor","options","check","appVersion","NativeSwiftPatch","getAppVersion","currentBundle","getCurrentBundle","deviceId","getDeviceId","logger","debug","Platform","OS","SDK_VERSION","result","checkForUpdateAPI","serverUrl","deploymentKey","currentBundleHash","hash","platform","customHeaders","updateAvailable","release","info","version","reason","exports"],"sourceRoot":"../../../src","sources":["core/UpdateChecker.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,IAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AAA2C,SAAAE,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAe3C;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,aAAa,CAAC;EAGzBC,WAAWA,CAACC,OAA2B,EAAE;IACvC,IAAI,CAACA,OAAO,GAAGA,OAAO;EACxB;;EAEA;AACF;AACA;AACA;EACE,MAAMC,KAAKA,CAAA,EAA+B;IACxC,MAAMC,UAAU,GAAG,MAAMC,yBAAgB,CAACC,aAAa,CAAC,CAAC;IACzD,MAAMC,aAAa,GAAG,MAAMF,yBAAgB,CAACG,gBAAgB,CAAC,CAAC;IAC/D,MAAMC,QAAQ,GAAG,MAAMJ,yBAAgB,CAACK,WAAW,CAAC,CAAC;IAErDC,cAAM,CAACC,KAAK,CACV,mCAAmCR,UAAU,cAAcS,qBAAQ,CAACC,EAAE,gBAAgBC,sBAAW,EACnG,CAAC;IAED,MAAMC,MAAM,GAAG,MAAM,IAAAC,sBAAiB,EAAC;MACrCC,SAAS,EAAE,IAAI,CAAChB,OAAO,CAACgB,SAAS;MACjCC,aAAa,EAAE,IAAI,CAACjB,OAAO,CAACiB,aAAa;MACzCf,UAAU;MACVgB,iBAAiB,EAAEb,aAAa,EAAEc,IAAI,IAAI,IAAI;MAC9CC,QAAQ,EAAET,qBAAQ,CAACC,EAAuB;MAC1CL,QAAQ;MACRc,aAAa,EAAE,IAAI,CAACrB,OAAO,CAACqB;IAC9B,CAAC,CAAC;IAEF,IAAIP,MAAM,CAACQ,eAAe,IAAIR,MAAM,CAACS,OAAO,EAAE;MAC5Cd,cAAM,CAACe,IAAI,CAAC,qBAAqBV,MAAM,CAACS,OAAO,CAACE,OAAO,EAAE,CAAC;MAC1D,OAAO;QACLH,eAAe,EAAE,IAAI;QACrBC,OAAO,EAAET,MAAM,CAACS;MAClB,CAAC;IACH;IAEAd,cAAM,CAACC,KAAK,CAAC,qBAAqB,CAAC;IACnC,OAAO;MACLY,eAAe,EAAE,KAAK;MACtBI,MAAM,EAAGZ,MAAM,CAASY,MAAM,IAAI;IACpC,CAAC;EACH;AACF;AAACC,OAAA,CAAA7B,aAAA,GAAAA,aAAA","ignoreList":[]}
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Verifier = void 0;
7
+ var _NativeSwiftPatch = _interopRequireDefault(require("../native/NativeSwiftPatch"));
8
+ var _logger = require("../utils/logger");
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ /**
11
+ * Core module responsible for verifying downloaded bundles.
12
+ *
13
+ * 4-step verification pipeline:
14
+ * 1. Apply patch if isPatch (via native bspatch)
15
+ * 2. Compute SHA-256 hash of the resulting bundle (via native)
16
+ * 3. Verify hash matches release.bundleHash
17
+ * 4. Verify RSA signature if provided (via native)
18
+ */
19
+ class Verifier {
20
+ publicKey = null;
21
+
22
+ /**
23
+ * Set the RSA public key for signature verification.
24
+ */
25
+ setPublicKey(key) {
26
+ this.publicKey = key;
27
+ }
28
+
29
+ /**
30
+ * Run the full verification pipeline on a downloaded bundle/patch.
31
+ *
32
+ * @param downloadedPath Path to the downloaded file on disk
33
+ * @param release Release metadata from the server
34
+ * @param currentBundlePath Path to the current bundle (needed if isPatch)
35
+ * @returns The path to the final verified bundle
36
+ */
37
+ async verify(downloadedPath, release, currentBundlePath) {
38
+ let bundlePath = downloadedPath;
39
+
40
+ // Step 1: Apply patch if this is a diff patch
41
+ if (release.isPatch) {
42
+ if (!currentBundlePath) {
43
+ throw new Error('Current bundle path required to apply patch');
44
+ }
45
+ _logger.logger.info('Applying binary patch...');
46
+ const outputPath = `${downloadedPath}.patched`;
47
+ bundlePath = await _NativeSwiftPatch.default.applyPatch(currentBundlePath, downloadedPath, outputPath);
48
+ _logger.logger.info('Patch applied successfully');
49
+ }
50
+
51
+ // Step 2: Compute SHA-256 hash
52
+ _logger.logger.debug('Computing bundle hash...');
53
+ const computedHash = await _NativeSwiftPatch.default.computeHash(bundlePath);
54
+
55
+ // Step 3: Verify hash matches expected
56
+ if (computedHash !== release.bundleHash) {
57
+ throw new Error(`Hash mismatch: expected ${release.bundleHash}, got ${computedHash}`);
58
+ }
59
+ _logger.logger.info('Hash verified successfully');
60
+
61
+ // Step 4: Verify RSA signature if provided
62
+ if (release.signature && this.publicKey) {
63
+ _logger.logger.debug('Verifying RSA signature...');
64
+ const isValid = await _NativeSwiftPatch.default.verifySignature(computedHash, release.signature, this.publicKey);
65
+ if (!isValid) {
66
+ throw new Error('RSA signature verification failed');
67
+ }
68
+ _logger.logger.info('Signature verified successfully');
69
+ }
70
+ return bundlePath;
71
+ }
72
+
73
+ /**
74
+ * Quick hash-only verification.
75
+ */
76
+ async verifyHash(bundlePath, expectedHash) {
77
+ const hash = await _NativeSwiftPatch.default.computeHash(bundlePath);
78
+ return hash === expectedHash;
79
+ }
80
+ }
81
+ exports.Verifier = Verifier;
82
+ //# sourceMappingURL=Verifier.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_NativeSwiftPatch","_interopRequireDefault","require","_logger","e","__esModule","default","Verifier","publicKey","setPublicKey","key","verify","downloadedPath","release","currentBundlePath","bundlePath","isPatch","Error","logger","info","outputPath","NativeSwiftPatch","applyPatch","debug","computedHash","computeHash","bundleHash","signature","isValid","verifySignature","verifyHash","expectedHash","hash","exports"],"sourceRoot":"../../../src","sources":["core/Verifier.ts"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAAyC,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,QAAQ,CAAC;EACZC,SAAS,GAAkB,IAAI;;EAEvC;AACF;AACA;EACEC,YAAYA,CAACC,GAAkB,EAAQ;IACrC,IAAI,CAACF,SAAS,GAAGE,GAAG;EACtB;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACE,MAAMC,MAAMA,CACVC,cAAsB,EACtBC,OAAoB,EACpBC,iBAA0B,EACT;IACjB,IAAIC,UAAU,GAAGH,cAAc;;IAE/B;IACA,IAAIC,OAAO,CAACG,OAAO,EAAE;MACnB,IAAI,CAACF,iBAAiB,EAAE;QACtB,MAAM,IAAIG,KAAK,CAAC,6CAA6C,CAAC;MAChE;MAEAC,cAAM,CAACC,IAAI,CAAC,0BAA0B,CAAC;MACvC,MAAMC,UAAU,GAAG,GAAGR,cAAc,UAAU;MAC9CG,UAAU,GAAG,MAAMM,yBAAgB,CAACC,UAAU,CAC5CR,iBAAiB,EACjBF,cAAc,EACdQ,UACF,CAAC;MACDF,cAAM,CAACC,IAAI,CAAC,4BAA4B,CAAC;IAC3C;;IAEA;IACAD,cAAM,CAACK,KAAK,CAAC,0BAA0B,CAAC;IACxC,MAAMC,YAAY,GAAG,MAAMH,yBAAgB,CAACI,WAAW,CAACV,UAAU,CAAC;;IAEnE;IACA,IAAIS,YAAY,KAAKX,OAAO,CAACa,UAAU,EAAE;MACvC,MAAM,IAAIT,KAAK,CACb,2BAA2BJ,OAAO,CAACa,UAAU,SAASF,YAAY,EACpE,CAAC;IACH;IACAN,cAAM,CAACC,IAAI,CAAC,4BAA4B,CAAC;;IAEzC;IACA,IAAIN,OAAO,CAACc,SAAS,IAAI,IAAI,CAACnB,SAAS,EAAE;MACvCU,cAAM,CAACK,KAAK,CAAC,4BAA4B,CAAC;MAC1C,MAAMK,OAAO,GAAG,MAAMP,yBAAgB,CAACQ,eAAe,CACpDL,YAAY,EACZX,OAAO,CAACc,SAAS,EACjB,IAAI,CAACnB,SACP,CAAC;MAED,IAAI,CAACoB,OAAO,EAAE;QACZ,MAAM,IAAIX,KAAK,CAAC,mCAAmC,CAAC;MACtD;MACAC,cAAM,CAACC,IAAI,CAAC,iCAAiC,CAAC;IAChD;IAEA,OAAOJ,UAAU;EACnB;;EAEA;AACF;AACA;EACE,MAAMe,UAAUA,CAACf,UAAkB,EAAEgB,YAAoB,EAAoB;IAC3E,MAAMC,IAAI,GAAG,MAAMX,yBAAgB,CAACI,WAAW,CAACV,UAAU,CAAC;IAC3D,OAAOiB,IAAI,KAAKD,YAAY;EAC9B;AACF;AAACE,OAAA,CAAA1B,QAAA,GAAAA,QAAA","ignoreList":[]}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "Downloader", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _Downloader.Downloader;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "Installer", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _Installer.Installer;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "Rollback", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _Rollback.Rollback;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "UpdateChecker", {
25
+ enumerable: true,
26
+ get: function () {
27
+ return _UpdateChecker.UpdateChecker;
28
+ }
29
+ });
30
+ Object.defineProperty(exports, "Verifier", {
31
+ enumerable: true,
32
+ get: function () {
33
+ return _Verifier.Verifier;
34
+ }
35
+ });
36
+ var _UpdateChecker = require("./UpdateChecker");
37
+ var _Downloader = require("./Downloader");
38
+ var _Verifier = require("./Verifier");
39
+ var _Installer = require("./Installer");
40
+ var _Rollback = require("./Rollback");
41
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_UpdateChecker","require","_Downloader","_Verifier","_Installer","_Rollback"],"sourceRoot":"../../../src","sources":["core/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AAGA,IAAAC,WAAA,GAAAD,OAAA;AAGA,IAAAE,SAAA,GAAAF,OAAA;AAEA,IAAAG,UAAA,GAAAH,OAAA;AAEA,IAAAI,SAAA,GAAAJ,OAAA","ignoreList":[]}
@@ -0,0 +1,154 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "Downloader", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _core.Downloader;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "EnvironmentMode", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _types.EnvironmentMode;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "InstallMode", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _types.InstallMode;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "Installer", {
25
+ enumerable: true,
26
+ get: function () {
27
+ return _core.Installer;
28
+ }
29
+ });
30
+ Object.defineProperty(exports, "NativeSwiftPatch", {
31
+ enumerable: true,
32
+ get: function () {
33
+ return _NativeSwiftPatch.default;
34
+ }
35
+ });
36
+ Object.defineProperty(exports, "Rollback", {
37
+ enumerable: true,
38
+ get: function () {
39
+ return _core.Rollback;
40
+ }
41
+ });
42
+ Object.defineProperty(exports, "SlotState", {
43
+ enumerable: true,
44
+ get: function () {
45
+ return _types.SlotState;
46
+ }
47
+ });
48
+ Object.defineProperty(exports, "SwiftPatch", {
49
+ enumerable: true,
50
+ get: function () {
51
+ return _SwiftPatchCore.SwiftPatch;
52
+ }
53
+ });
54
+ Object.defineProperty(exports, "SwiftPatchErrorCode", {
55
+ enumerable: true,
56
+ get: function () {
57
+ return _types.SwiftPatchErrorCode;
58
+ }
59
+ });
60
+ Object.defineProperty(exports, "SwiftPatchEventType", {
61
+ enumerable: true,
62
+ get: function () {
63
+ return _types.SwiftPatchEventType;
64
+ }
65
+ });
66
+ Object.defineProperty(exports, "SwiftPatchModal", {
67
+ enumerable: true,
68
+ get: function () {
69
+ return _SwiftPatchModal.SwiftPatchModal;
70
+ }
71
+ });
72
+ Object.defineProperty(exports, "SwiftPatchProvider", {
73
+ enumerable: true,
74
+ get: function () {
75
+ return _SwiftPatchProvider.SwiftPatchProvider;
76
+ }
77
+ });
78
+ Object.defineProperty(exports, "UpdateChecker", {
79
+ enumerable: true,
80
+ get: function () {
81
+ return _core.UpdateChecker;
82
+ }
83
+ });
84
+ Object.defineProperty(exports, "UpdateStatus", {
85
+ enumerable: true,
86
+ get: function () {
87
+ return _types.UpdateStatus;
88
+ }
89
+ });
90
+ Object.defineProperty(exports, "Verifier", {
91
+ enumerable: true,
92
+ get: function () {
93
+ return _core.Verifier;
94
+ }
95
+ });
96
+ exports.restart = restart;
97
+ Object.defineProperty(exports, "useSwiftPatch", {
98
+ enumerable: true,
99
+ get: function () {
100
+ return _useSwiftPatch.useSwiftPatch;
101
+ }
102
+ });
103
+ Object.defineProperty(exports, "useSwiftPatchModal", {
104
+ enumerable: true,
105
+ get: function () {
106
+ return _useSwiftPatchModal.useSwiftPatchModal;
107
+ }
108
+ });
109
+ Object.defineProperty(exports, "useSwiftPatchUpdate", {
110
+ enumerable: true,
111
+ get: function () {
112
+ return _useSwiftPatch.useSwiftPatchUpdate;
113
+ }
114
+ });
115
+ Object.defineProperty(exports, "withSwiftPatch", {
116
+ enumerable: true,
117
+ get: function () {
118
+ return _withSwiftPatch.withSwiftPatch;
119
+ }
120
+ });
121
+ var _SwiftPatchProvider = require("./SwiftPatchProvider");
122
+ var _useSwiftPatch = require("./useSwiftPatch");
123
+ var _useSwiftPatchModal = require("./modal/useSwiftPatchModal");
124
+ var _withSwiftPatch = require("./withSwiftPatch");
125
+ var _SwiftPatchCore = require("./SwiftPatchCore");
126
+ var _SwiftPatchModal = require("./modal/SwiftPatchModal");
127
+ var _types = require("./types");
128
+ var _NativeSwiftPatch = _interopRequireDefault(require("./native/NativeSwiftPatch"));
129
+ var _core = require("./core");
130
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
131
+ // Provider
132
+
133
+ // Hooks
134
+
135
+ // HOC
136
+
137
+ // Imperative API (for non-React usage)
138
+
139
+ // Modal component
140
+
141
+ // Types
142
+
143
+ // Enums
144
+
145
+ // Native module (for advanced usage)
146
+
147
+ // Core modules (for advanced/custom usage)
148
+
149
+ // Utility: restart the app
150
+ function restart() {
151
+ const NativeModule = require('./native/NativeSwiftPatch').default;
152
+ NativeModule.restart();
153
+ }
154
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_SwiftPatchProvider","require","_useSwiftPatch","_useSwiftPatchModal","_withSwiftPatch","_SwiftPatchCore","_SwiftPatchModal","_types","_NativeSwiftPatch","_interopRequireDefault","_core","e","__esModule","default","restart","NativeModule"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,mBAAA,GAAAC,OAAA;AAGA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,mBAAA,GAAAF,OAAA;AAGA,IAAAG,eAAA,GAAAH,OAAA;AAGA,IAAAI,eAAA,GAAAJ,OAAA;AAGA,IAAAK,gBAAA,GAAAL,OAAA;AAmBA,IAAAM,MAAA,GAAAN,OAAA;AAUA,IAAAO,iBAAA,GAAAC,sBAAA,CAAAR,OAAA;AAGA,IAAAS,KAAA,GAAAT,OAAA;AAMgB,SAAAQ,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AApDhB;;AAGA;;AAIA;;AAGA;;AAGA;;AAGA;;AAgBA;;AAUA;;AAGA;;AAcA;AACO,SAASG,OAAOA,CAAA,EAAS;EAC9B,MAAMC,YAAY,GAAGd,OAAO,CAAC,2BAA2B,CAAC,CAACY,OAAO;EACjEE,YAAY,CAACD,OAAO,CAAC,CAAC;AACxB","ignoreList":[]}