@onekeyfe/react-native-bundle-update 1.1.21

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 (130) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +36 -0
  3. package/ReactNativeBundleUpdate.podspec +34 -0
  4. package/android/CMakeLists.txt +24 -0
  5. package/android/build.gradle +139 -0
  6. package/android/gradle.properties +4 -0
  7. package/android/src/main/AndroidManifest.xml +1 -0
  8. package/android/src/main/cpp/cpp-adapter.cpp +6 -0
  9. package/android/src/main/java/com/margelo/nitro/reactnativebundleupdate/ReactNativeBundleUpdate.kt +1409 -0
  10. package/android/src/main/java/com/margelo/nitro/reactnativebundleupdate/ReactNativeBundleUpdatePackage.kt +24 -0
  11. package/ios/Frameworks/Gopenpgp.xcframework/Info.plist +52 -0
  12. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64/Gopenpgp.framework/Gopenpgp +0 -0
  13. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64/Gopenpgp.framework/Headers/Armor.objc.h +96 -0
  14. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64/Gopenpgp.framework/Headers/Constants.objc.h +197 -0
  15. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64/Gopenpgp.framework/Headers/Crypto.objc.h +1963 -0
  16. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64/Gopenpgp.framework/Headers/Gopenpgp.h +23 -0
  17. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64/Gopenpgp.framework/Headers/Mime.objc.h +59 -0
  18. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64/Gopenpgp.framework/Headers/Mobile.objc.h +252 -0
  19. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64/Gopenpgp.framework/Headers/Profile.objc.h +107 -0
  20. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64/Gopenpgp.framework/Headers/Universe.objc.h +29 -0
  21. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64/Gopenpgp.framework/Headers/ref.h +35 -0
  22. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64/Gopenpgp.framework/Info.plist +20 -0
  23. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64/Gopenpgp.framework/Modules/module.modulemap +13 -0
  24. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64_x86_64-simulator/Gopenpgp.framework/Gopenpgp +0 -0
  25. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64_x86_64-simulator/Gopenpgp.framework/Headers/Armor.objc.h +96 -0
  26. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64_x86_64-simulator/Gopenpgp.framework/Headers/Constants.objc.h +197 -0
  27. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64_x86_64-simulator/Gopenpgp.framework/Headers/Crypto.objc.h +1963 -0
  28. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64_x86_64-simulator/Gopenpgp.framework/Headers/Gopenpgp.h +23 -0
  29. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64_x86_64-simulator/Gopenpgp.framework/Headers/Mime.objc.h +59 -0
  30. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64_x86_64-simulator/Gopenpgp.framework/Headers/Mobile.objc.h +252 -0
  31. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64_x86_64-simulator/Gopenpgp.framework/Headers/Profile.objc.h +107 -0
  32. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64_x86_64-simulator/Gopenpgp.framework/Headers/Universe.objc.h +29 -0
  33. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64_x86_64-simulator/Gopenpgp.framework/Headers/ref.h +35 -0
  34. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64_x86_64-simulator/Gopenpgp.framework/Info.plist +20 -0
  35. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64_x86_64-simulator/Gopenpgp.framework/Modules/module.modulemap +13 -0
  36. package/ios/ReactNativeBundleUpdate.swift +1338 -0
  37. package/lib/module/ReactNativeBundleUpdate.nitro.js +4 -0
  38. package/lib/module/ReactNativeBundleUpdate.nitro.js.map +1 -0
  39. package/lib/module/index.js +6 -0
  40. package/lib/module/index.js.map +1 -0
  41. package/lib/module/package.json +1 -0
  42. package/lib/typescript/package.json +1 -0
  43. package/lib/typescript/src/ReactNativeBundleUpdate.nitro.d.ts +101 -0
  44. package/lib/typescript/src/ReactNativeBundleUpdate.nitro.d.ts.map +1 -0
  45. package/lib/typescript/src/index.d.ts +4 -0
  46. package/lib/typescript/src/index.d.ts.map +1 -0
  47. package/nitro.json +17 -0
  48. package/nitrogen/generated/android/c++/JAscFileInfo.hpp +65 -0
  49. package/nitrogen/generated/android/c++/JBundleDownloadASCParams.hpp +77 -0
  50. package/nitrogen/generated/android/c++/JBundleDownloadEvent.hpp +65 -0
  51. package/nitrogen/generated/android/c++/JBundleDownloadParams.hpp +73 -0
  52. package/nitrogen/generated/android/c++/JBundleDownloadResult.hpp +73 -0
  53. package/nitrogen/generated/android/c++/JBundleInstallParams.hpp +69 -0
  54. package/nitrogen/generated/android/c++/JBundleSwitchParams.hpp +65 -0
  55. package/nitrogen/generated/android/c++/JBundleVerifyASCParams.hpp +73 -0
  56. package/nitrogen/generated/android/c++/JBundleVerifyParams.hpp +69 -0
  57. package/nitrogen/generated/android/c++/JFallbackBundleInfo.hpp +65 -0
  58. package/nitrogen/generated/android/c++/JFunc_void_BundleDownloadEvent.hpp +78 -0
  59. package/nitrogen/generated/android/c++/JHybridReactNativeBundleUpdateSpec.cpp +486 -0
  60. package/nitrogen/generated/android/c++/JHybridReactNativeBundleUpdateSpec.hpp +89 -0
  61. package/nitrogen/generated/android/c++/JLocalBundleInfo.hpp +61 -0
  62. package/nitrogen/generated/android/c++/JTestResult.hpp +61 -0
  63. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/AscFileInfo.kt +44 -0
  64. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleDownloadASCParams.kt +53 -0
  65. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleDownloadEvent.kt +44 -0
  66. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleDownloadParams.kt +50 -0
  67. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleDownloadResult.kt +50 -0
  68. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleInstallParams.kt +47 -0
  69. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleSwitchParams.kt +44 -0
  70. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleVerifyASCParams.kt +50 -0
  71. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleVerifyParams.kt +47 -0
  72. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/FallbackBundleInfo.kt +44 -0
  73. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/Func_void_BundleDownloadEvent.kt +80 -0
  74. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/HybridReactNativeBundleUpdateSpec.kt +159 -0
  75. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/LocalBundleInfo.kt +41 -0
  76. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/TestResult.kt +41 -0
  77. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/reactnativebundleupdateOnLoad.kt +35 -0
  78. package/nitrogen/generated/android/reactnativebundleupdate+autolinking.cmake +81 -0
  79. package/nitrogen/generated/android/reactnativebundleupdate+autolinking.gradle +27 -0
  80. package/nitrogen/generated/android/reactnativebundleupdateOnLoad.cpp +46 -0
  81. package/nitrogen/generated/android/reactnativebundleupdateOnLoad.hpp +25 -0
  82. package/nitrogen/generated/ios/ReactNativeBundleUpdate+autolinking.rb +60 -0
  83. package/nitrogen/generated/ios/ReactNativeBundleUpdate-Swift-Cxx-Bridge.cpp +113 -0
  84. package/nitrogen/generated/ios/ReactNativeBundleUpdate-Swift-Cxx-Bridge.hpp +513 -0
  85. package/nitrogen/generated/ios/ReactNativeBundleUpdate-Swift-Cxx-Umbrella.hpp +83 -0
  86. package/nitrogen/generated/ios/ReactNativeBundleUpdateAutolinking.mm +33 -0
  87. package/nitrogen/generated/ios/ReactNativeBundleUpdateAutolinking.swift +25 -0
  88. package/nitrogen/generated/ios/c++/HybridReactNativeBundleUpdateSpecSwift.cpp +11 -0
  89. package/nitrogen/generated/ios/c++/HybridReactNativeBundleUpdateSpecSwift.hpp +304 -0
  90. package/nitrogen/generated/ios/swift/AscFileInfo.swift +58 -0
  91. package/nitrogen/generated/ios/swift/BundleDownloadASCParams.swift +91 -0
  92. package/nitrogen/generated/ios/swift/BundleDownloadEvent.swift +58 -0
  93. package/nitrogen/generated/ios/swift/BundleDownloadParams.swift +80 -0
  94. package/nitrogen/generated/ios/swift/BundleDownloadResult.swift +80 -0
  95. package/nitrogen/generated/ios/swift/BundleInstallParams.swift +69 -0
  96. package/nitrogen/generated/ios/swift/BundleSwitchParams.swift +58 -0
  97. package/nitrogen/generated/ios/swift/BundleVerifyASCParams.swift +80 -0
  98. package/nitrogen/generated/ios/swift/BundleVerifyParams.swift +69 -0
  99. package/nitrogen/generated/ios/swift/FallbackBundleInfo.swift +58 -0
  100. package/nitrogen/generated/ios/swift/Func_void.swift +47 -0
  101. package/nitrogen/generated/ios/swift/Func_void_BundleDownloadEvent.swift +47 -0
  102. package/nitrogen/generated/ios/swift/Func_void_BundleDownloadResult.swift +47 -0
  103. package/nitrogen/generated/ios/swift/Func_void_TestResult.swift +47 -0
  104. package/nitrogen/generated/ios/swift/Func_void_bool.swift +47 -0
  105. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +47 -0
  106. package/nitrogen/generated/ios/swift/Func_void_std__string.swift +47 -0
  107. package/nitrogen/generated/ios/swift/Func_void_std__vector_AscFileInfo_.swift +47 -0
  108. package/nitrogen/generated/ios/swift/Func_void_std__vector_FallbackBundleInfo_.swift +47 -0
  109. package/nitrogen/generated/ios/swift/Func_void_std__vector_LocalBundleInfo_.swift +47 -0
  110. package/nitrogen/generated/ios/swift/HybridReactNativeBundleUpdateSpec.swift +80 -0
  111. package/nitrogen/generated/ios/swift/HybridReactNativeBundleUpdateSpec_cxx.swift +595 -0
  112. package/nitrogen/generated/ios/swift/LocalBundleInfo.swift +47 -0
  113. package/nitrogen/generated/ios/swift/TestResult.swift +47 -0
  114. package/nitrogen/generated/shared/c++/AscFileInfo.hpp +83 -0
  115. package/nitrogen/generated/shared/c++/BundleDownloadASCParams.hpp +95 -0
  116. package/nitrogen/generated/shared/c++/BundleDownloadEvent.hpp +83 -0
  117. package/nitrogen/generated/shared/c++/BundleDownloadParams.hpp +91 -0
  118. package/nitrogen/generated/shared/c++/BundleDownloadResult.hpp +91 -0
  119. package/nitrogen/generated/shared/c++/BundleInstallParams.hpp +87 -0
  120. package/nitrogen/generated/shared/c++/BundleSwitchParams.hpp +83 -0
  121. package/nitrogen/generated/shared/c++/BundleVerifyASCParams.hpp +91 -0
  122. package/nitrogen/generated/shared/c++/BundleVerifyParams.hpp +87 -0
  123. package/nitrogen/generated/shared/c++/FallbackBundleInfo.hpp +83 -0
  124. package/nitrogen/generated/shared/c++/HybridReactNativeBundleUpdateSpec.cpp +45 -0
  125. package/nitrogen/generated/shared/c++/HybridReactNativeBundleUpdateSpec.hpp +124 -0
  126. package/nitrogen/generated/shared/c++/LocalBundleInfo.hpp +79 -0
  127. package/nitrogen/generated/shared/c++/TestResult.hpp +79 -0
  128. package/package.json +169 -0
  129. package/src/ReactNativeBundleUpdate.nitro.ts +143 -0
  130. package/src/index.tsx +8 -0
@@ -0,0 +1,159 @@
1
+ ///
2
+ /// HybridReactNativeBundleUpdateSpec.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.reactnativebundleupdate
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.jni.HybridData
12
+ import com.facebook.proguard.annotations.DoNotStrip
13
+ import com.margelo.nitro.core.Promise
14
+ import com.margelo.nitro.core.HybridObject
15
+
16
+ /**
17
+ * A Kotlin class representing the ReactNativeBundleUpdate HybridObject.
18
+ * Implement this abstract class to create Kotlin-based instances of ReactNativeBundleUpdate.
19
+ */
20
+ @DoNotStrip
21
+ @Keep
22
+ @Suppress(
23
+ "KotlinJniMissingFunction", "unused",
24
+ "RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet",
25
+ "LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName"
26
+ )
27
+ abstract class HybridReactNativeBundleUpdateSpec: HybridObject() {
28
+ @DoNotStrip
29
+ private var mHybridData: HybridData = initHybrid()
30
+
31
+ init {
32
+ super.updateNative(mHybridData)
33
+ }
34
+
35
+ override fun updateNative(hybridData: HybridData) {
36
+ mHybridData = hybridData
37
+ super.updateNative(hybridData)
38
+ }
39
+
40
+ // Default implementation of `HybridObject.toString()`
41
+ override fun toString(): String {
42
+ return "[HybridObject ReactNativeBundleUpdate]"
43
+ }
44
+
45
+ // Properties
46
+
47
+
48
+ // Methods
49
+ @DoNotStrip
50
+ @Keep
51
+ abstract fun downloadBundle(params: BundleDownloadParams): Promise<BundleDownloadResult>
52
+
53
+ @DoNotStrip
54
+ @Keep
55
+ abstract fun verifyBundle(params: BundleVerifyParams): Promise<Unit>
56
+
57
+ @DoNotStrip
58
+ @Keep
59
+ abstract fun verifyBundleASC(params: BundleVerifyASCParams): Promise<Unit>
60
+
61
+ @DoNotStrip
62
+ @Keep
63
+ abstract fun downloadBundleASC(params: BundleDownloadASCParams): Promise<Unit>
64
+
65
+ @DoNotStrip
66
+ @Keep
67
+ abstract fun installBundle(params: BundleInstallParams): Promise<Unit>
68
+
69
+ @DoNotStrip
70
+ @Keep
71
+ abstract fun clearBundle(): Promise<Unit>
72
+
73
+ @DoNotStrip
74
+ @Keep
75
+ abstract fun clearAllJSBundleData(): Promise<TestResult>
76
+
77
+ @DoNotStrip
78
+ @Keep
79
+ abstract fun getFallbackUpdateBundleData(): Promise<Array<FallbackBundleInfo>>
80
+
81
+ @DoNotStrip
82
+ @Keep
83
+ abstract fun setCurrentUpdateBundleData(params: BundleSwitchParams): Promise<Unit>
84
+
85
+ @DoNotStrip
86
+ @Keep
87
+ abstract fun getWebEmbedPath(): String
88
+
89
+ @DoNotStrip
90
+ @Keep
91
+ abstract fun getWebEmbedPathAsync(): Promise<String>
92
+
93
+ @DoNotStrip
94
+ @Keep
95
+ abstract fun getJsBundlePath(): Promise<String>
96
+
97
+ @DoNotStrip
98
+ @Keep
99
+ abstract fun getNativeAppVersion(): Promise<String>
100
+
101
+ @DoNotStrip
102
+ @Keep
103
+ abstract fun testVerification(): Promise<Boolean>
104
+
105
+ @DoNotStrip
106
+ @Keep
107
+ abstract fun isBundleExists(appVersion: String, bundleVersion: String): Promise<Boolean>
108
+
109
+ @DoNotStrip
110
+ @Keep
111
+ abstract fun verifyExtractedBundle(appVersion: String, bundleVersion: String): Promise<Unit>
112
+
113
+ @DoNotStrip
114
+ @Keep
115
+ abstract fun listLocalBundles(): Promise<Array<LocalBundleInfo>>
116
+
117
+ @DoNotStrip
118
+ @Keep
119
+ abstract fun listAscFiles(): Promise<Array<AscFileInfo>>
120
+
121
+ @DoNotStrip
122
+ @Keep
123
+ abstract fun getSha256FromFilePath(filePath: String): Promise<String>
124
+
125
+ @DoNotStrip
126
+ @Keep
127
+ abstract fun testDeleteJsBundle(appVersion: String, bundleVersion: String): Promise<TestResult>
128
+
129
+ @DoNotStrip
130
+ @Keep
131
+ abstract fun testDeleteJsRuntimeDir(appVersion: String, bundleVersion: String): Promise<TestResult>
132
+
133
+ @DoNotStrip
134
+ @Keep
135
+ abstract fun testDeleteMetadataJson(appVersion: String, bundleVersion: String): Promise<TestResult>
136
+
137
+ @DoNotStrip
138
+ @Keep
139
+ abstract fun testWriteEmptyMetadataJson(appVersion: String, bundleVersion: String): Promise<TestResult>
140
+
141
+ abstract fun addDownloadListener(callback: (event: BundleDownloadEvent) -> Unit): Double
142
+
143
+ @DoNotStrip
144
+ @Keep
145
+ private fun addDownloadListener_cxx(callback: Func_void_BundleDownloadEvent): Double {
146
+ val __result = addDownloadListener(callback)
147
+ return __result
148
+ }
149
+
150
+ @DoNotStrip
151
+ @Keep
152
+ abstract fun removeDownloadListener(id: Double): Unit
153
+
154
+ private external fun initHybrid(): HybridData
155
+
156
+ companion object {
157
+ protected const val TAG = "HybridReactNativeBundleUpdateSpec"
158
+ }
159
+ }
@@ -0,0 +1,41 @@
1
+ ///
2
+ /// LocalBundleInfo.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.reactnativebundleupdate
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+
13
+
14
+ /**
15
+ * Represents the JavaScript object/struct "LocalBundleInfo".
16
+ */
17
+ @DoNotStrip
18
+ @Keep
19
+ data class LocalBundleInfo(
20
+ @DoNotStrip
21
+ @Keep
22
+ val appVersion: String,
23
+ @DoNotStrip
24
+ @Keep
25
+ val bundleVersion: String
26
+ ) {
27
+ /* primary constructor */
28
+
29
+ private companion object {
30
+ /**
31
+ * Constructor called from C++
32
+ */
33
+ @DoNotStrip
34
+ @Keep
35
+ @Suppress("unused")
36
+ @JvmStatic
37
+ private fun fromCpp(appVersion: String, bundleVersion: String): LocalBundleInfo {
38
+ return LocalBundleInfo(appVersion, bundleVersion)
39
+ }
40
+ }
41
+ }
@@ -0,0 +1,41 @@
1
+ ///
2
+ /// TestResult.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.reactnativebundleupdate
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+
13
+
14
+ /**
15
+ * Represents the JavaScript object/struct "TestResult".
16
+ */
17
+ @DoNotStrip
18
+ @Keep
19
+ data class TestResult(
20
+ @DoNotStrip
21
+ @Keep
22
+ val success: Boolean,
23
+ @DoNotStrip
24
+ @Keep
25
+ val message: String
26
+ ) {
27
+ /* primary constructor */
28
+
29
+ private companion object {
30
+ /**
31
+ * Constructor called from C++
32
+ */
33
+ @DoNotStrip
34
+ @Keep
35
+ @Suppress("unused")
36
+ @JvmStatic
37
+ private fun fromCpp(success: Boolean, message: String): TestResult {
38
+ return TestResult(success, message)
39
+ }
40
+ }
41
+ }
@@ -0,0 +1,35 @@
1
+ ///
2
+ /// reactnativebundleupdateOnLoad.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.reactnativebundleupdate
9
+
10
+ import android.util.Log
11
+
12
+ internal class reactnativebundleupdateOnLoad {
13
+ companion object {
14
+ private const val TAG = "reactnativebundleupdateOnLoad"
15
+ private var didLoad = false
16
+ /**
17
+ * Initializes the native part of "reactnativebundleupdate".
18
+ * This method is idempotent and can be called more than once.
19
+ */
20
+ @JvmStatic
21
+ fun initializeNative() {
22
+ if (didLoad) return
23
+ try {
24
+ Log.i(TAG, "Loading reactnativebundleupdate C++ library...")
25
+ System.loadLibrary("reactnativebundleupdate")
26
+ Log.i(TAG, "Successfully loaded reactnativebundleupdate C++ library!")
27
+ didLoad = true
28
+ } catch (e: Error) {
29
+ Log.e(TAG, "Failed to load reactnativebundleupdate C++ library! Is it properly installed and linked? " +
30
+ "Is the name correct? (see `CMakeLists.txt`, at `add_library(...)`)", e)
31
+ throw e
32
+ }
33
+ }
34
+ }
35
+ }
@@ -0,0 +1,81 @@
1
+ #
2
+ # reactnativebundleupdate+autolinking.cmake
3
+ # This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ # https://github.com/mrousavy/nitro
5
+ # Copyright © 2026 Marc Rousavy @ Margelo
6
+ #
7
+
8
+ # This is a CMake file that adds all files generated by Nitrogen
9
+ # to the current CMake project.
10
+ #
11
+ # To use it, add this to your CMakeLists.txt:
12
+ # ```cmake
13
+ # include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/reactnativebundleupdate+autolinking.cmake)
14
+ # ```
15
+
16
+ # Define a flag to check if we are building properly
17
+ add_definitions(-DBUILDING_REACTNATIVEBUNDLEUPDATE_WITH_GENERATED_CMAKE_PROJECT)
18
+
19
+ # Enable Raw Props parsing in react-native (for Nitro Views)
20
+ add_definitions(-DRN_SERIALIZABLE_STATE)
21
+
22
+ # Add all headers that were generated by Nitrogen
23
+ include_directories(
24
+ "../nitrogen/generated/shared/c++"
25
+ "../nitrogen/generated/android/c++"
26
+ "../nitrogen/generated/android/"
27
+ )
28
+
29
+ # Add all .cpp sources that were generated by Nitrogen
30
+ target_sources(
31
+ # CMake project name (Android C++ library name)
32
+ reactnativebundleupdate PRIVATE
33
+ # Autolinking Setup
34
+ ../nitrogen/generated/android/reactnativebundleupdateOnLoad.cpp
35
+ # Shared Nitrogen C++ sources
36
+ ../nitrogen/generated/shared/c++/HybridReactNativeBundleUpdateSpec.cpp
37
+ # Android-specific Nitrogen C++ sources
38
+ ../nitrogen/generated/android/c++/JHybridReactNativeBundleUpdateSpec.cpp
39
+ )
40
+
41
+ # From node_modules/react-native/ReactAndroid/cmake-utils/folly-flags.cmake
42
+ # Used in node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake
43
+ target_compile_definitions(
44
+ reactnativebundleupdate PRIVATE
45
+ -DFOLLY_NO_CONFIG=1
46
+ -DFOLLY_HAVE_CLOCK_GETTIME=1
47
+ -DFOLLY_USE_LIBCPP=1
48
+ -DFOLLY_CFG_NO_COROUTINES=1
49
+ -DFOLLY_MOBILE=1
50
+ -DFOLLY_HAVE_RECVMMSG=1
51
+ -DFOLLY_HAVE_PTHREAD=1
52
+ # Once we target android-23 above, we can comment
53
+ # the following line. NDK uses GNU style stderror_r() after API 23.
54
+ -DFOLLY_HAVE_XSI_STRERROR_R=1
55
+ )
56
+
57
+ # Add all libraries required by the generated specs
58
+ find_package(fbjni REQUIRED) # <-- Used for communication between Java <-> C++
59
+ find_package(ReactAndroid REQUIRED) # <-- Used to set up React Native bindings (e.g. CallInvoker/TurboModule)
60
+ find_package(react-native-nitro-modules REQUIRED) # <-- Used to create all HybridObjects and use the Nitro core library
61
+
62
+ # Link all libraries together
63
+ target_link_libraries(
64
+ reactnativebundleupdate
65
+ fbjni::fbjni # <-- Facebook C++ JNI helpers
66
+ ReactAndroid::jsi # <-- RN: JSI
67
+ react-native-nitro-modules::NitroModules # <-- NitroModules Core :)
68
+ )
69
+
70
+ # Link react-native (different prefab between RN 0.75 and RN 0.76)
71
+ if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 76)
72
+ target_link_libraries(
73
+ reactnativebundleupdate
74
+ ReactAndroid::reactnative # <-- RN: Native Modules umbrella prefab
75
+ )
76
+ else()
77
+ target_link_libraries(
78
+ reactnativebundleupdate
79
+ ReactAndroid::react_nativemodule_core # <-- RN: TurboModules Core
80
+ )
81
+ endif()
@@ -0,0 +1,27 @@
1
+ ///
2
+ /// reactnativebundleupdate+autolinking.gradle
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ /// This is a Gradle file that adds all files generated by Nitrogen
9
+ /// to the current Gradle project.
10
+ ///
11
+ /// To use it, add this to your build.gradle:
12
+ /// ```gradle
13
+ /// apply from: '../nitrogen/generated/android/reactnativebundleupdate+autolinking.gradle'
14
+ /// ```
15
+
16
+ logger.warn("[NitroModules] 🔥 reactnativebundleupdate is boosted by nitro!")
17
+
18
+ android {
19
+ sourceSets {
20
+ main {
21
+ java.srcDirs += [
22
+ // Nitrogen files
23
+ "${project.projectDir}/../nitrogen/generated/android/kotlin"
24
+ ]
25
+ }
26
+ }
27
+ }
@@ -0,0 +1,46 @@
1
+ ///
2
+ /// reactnativebundleupdateOnLoad.cpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #ifndef BUILDING_REACTNATIVEBUNDLEUPDATE_WITH_GENERATED_CMAKE_PROJECT
9
+ #error reactnativebundleupdateOnLoad.cpp is not being built with the autogenerated CMakeLists.txt project. Is a different CMakeLists.txt building this?
10
+ #endif
11
+
12
+ #include "reactnativebundleupdateOnLoad.hpp"
13
+
14
+ #include <jni.h>
15
+ #include <fbjni/fbjni.h>
16
+ #include <NitroModules/HybridObjectRegistry.hpp>
17
+
18
+ #include "JHybridReactNativeBundleUpdateSpec.hpp"
19
+ #include "JFunc_void_BundleDownloadEvent.hpp"
20
+ #include <NitroModules/DefaultConstructableObject.hpp>
21
+
22
+ namespace margelo::nitro::reactnativebundleupdate {
23
+
24
+ int initialize(JavaVM* vm) {
25
+ using namespace margelo::nitro;
26
+ using namespace margelo::nitro::reactnativebundleupdate;
27
+ using namespace facebook;
28
+
29
+ return facebook::jni::initialize(vm, [] {
30
+ // Register native JNI methods
31
+ margelo::nitro::reactnativebundleupdate::JHybridReactNativeBundleUpdateSpec::registerNatives();
32
+ margelo::nitro::reactnativebundleupdate::JFunc_void_BundleDownloadEvent_cxx::registerNatives();
33
+
34
+ // Register Nitro Hybrid Objects
35
+ HybridObjectRegistry::registerHybridObjectConstructor(
36
+ "ReactNativeBundleUpdate",
37
+ []() -> std::shared_ptr<HybridObject> {
38
+ static DefaultConstructableObject<JHybridReactNativeBundleUpdateSpec::javaobject> object("com/margelo/nitro/reactnativebundleupdate/ReactNativeBundleUpdate");
39
+ auto instance = object.create();
40
+ return instance->cthis()->shared();
41
+ }
42
+ );
43
+ });
44
+ }
45
+
46
+ } // namespace margelo::nitro::reactnativebundleupdate
@@ -0,0 +1,25 @@
1
+ ///
2
+ /// reactnativebundleupdateOnLoad.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #include <jni.h>
9
+ #include <NitroModules/NitroDefines.hpp>
10
+
11
+ namespace margelo::nitro::reactnativebundleupdate {
12
+
13
+ /**
14
+ * Initializes the native (C++) part of reactnativebundleupdate, and autolinks all Hybrid Objects.
15
+ * Call this in your `JNI_OnLoad` function (probably inside `cpp-adapter.cpp`).
16
+ * Example:
17
+ * ```cpp (cpp-adapter.cpp)
18
+ * JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) {
19
+ * return margelo::nitro::reactnativebundleupdate::initialize(vm);
20
+ * }
21
+ * ```
22
+ */
23
+ int initialize(JavaVM* vm);
24
+
25
+ } // namespace margelo::nitro::reactnativebundleupdate
@@ -0,0 +1,60 @@
1
+ #
2
+ # ReactNativeBundleUpdate+autolinking.rb
3
+ # This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ # https://github.com/mrousavy/nitro
5
+ # Copyright © 2026 Marc Rousavy @ Margelo
6
+ #
7
+
8
+ # This is a Ruby script that adds all files generated by Nitrogen
9
+ # to the given podspec.
10
+ #
11
+ # To use it, add this to your .podspec:
12
+ # ```ruby
13
+ # Pod::Spec.new do |spec|
14
+ # # ...
15
+ #
16
+ # # Add all files generated by Nitrogen
17
+ # load 'nitrogen/generated/ios/ReactNativeBundleUpdate+autolinking.rb'
18
+ # add_nitrogen_files(spec)
19
+ # end
20
+ # ```
21
+
22
+ def add_nitrogen_files(spec)
23
+ Pod::UI.puts "[NitroModules] 🔥 ReactNativeBundleUpdate is boosted by nitro!"
24
+
25
+ spec.dependency "NitroModules"
26
+
27
+ current_source_files = Array(spec.attributes_hash['source_files'])
28
+ spec.source_files = current_source_files + [
29
+ # Generated cross-platform specs
30
+ "nitrogen/generated/shared/**/*.{h,hpp,c,cpp,swift}",
31
+ # Generated bridges for the cross-platform specs
32
+ "nitrogen/generated/ios/**/*.{h,hpp,c,cpp,mm,swift}",
33
+ ]
34
+
35
+ current_public_header_files = Array(spec.attributes_hash['public_header_files'])
36
+ spec.public_header_files = current_public_header_files + [
37
+ # Generated specs
38
+ "nitrogen/generated/shared/**/*.{h,hpp}",
39
+ # Swift to C++ bridging helpers
40
+ "nitrogen/generated/ios/ReactNativeBundleUpdate-Swift-Cxx-Bridge.hpp"
41
+ ]
42
+
43
+ current_private_header_files = Array(spec.attributes_hash['private_header_files'])
44
+ spec.private_header_files = current_private_header_files + [
45
+ # iOS specific specs
46
+ "nitrogen/generated/ios/c++/**/*.{h,hpp}",
47
+ # Views are framework-specific and should be private
48
+ "nitrogen/generated/shared/**/views/**/*"
49
+ ]
50
+
51
+ current_pod_target_xcconfig = spec.attributes_hash['pod_target_xcconfig'] || {}
52
+ spec.pod_target_xcconfig = current_pod_target_xcconfig.merge({
53
+ # Use C++ 20
54
+ "CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
55
+ # Enables C++ <-> Swift interop (by default it's only C)
56
+ "SWIFT_OBJC_INTEROP_MODE" => "objcxx",
57
+ # Enables stricter modular headers
58
+ "DEFINES_MODULE" => "YES",
59
+ })
60
+ end
@@ -0,0 +1,113 @@
1
+ ///
2
+ /// ReactNativeBundleUpdate-Swift-Cxx-Bridge.cpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #include "ReactNativeBundleUpdate-Swift-Cxx-Bridge.hpp"
9
+
10
+ // Include C++ implementation defined types
11
+ #include "HybridReactNativeBundleUpdateSpecSwift.hpp"
12
+ #include "ReactNativeBundleUpdate-Swift-Cxx-Umbrella.hpp"
13
+ #include <NitroModules/NitroDefines.hpp>
14
+
15
+ namespace margelo::nitro::reactnativebundleupdate::bridge::swift {
16
+
17
+ // pragma MARK: std::function<void(const BundleDownloadResult& /* result */)>
18
+ Func_void_BundleDownloadResult create_Func_void_BundleDownloadResult(void* NON_NULL swiftClosureWrapper) noexcept {
19
+ auto swiftClosure = ReactNativeBundleUpdate::Func_void_BundleDownloadResult::fromUnsafe(swiftClosureWrapper);
20
+ return [swiftClosure = std::move(swiftClosure)](const BundleDownloadResult& result) mutable -> void {
21
+ swiftClosure.call(result);
22
+ };
23
+ }
24
+
25
+ // pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
26
+ Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept {
27
+ auto swiftClosure = ReactNativeBundleUpdate::Func_void_std__exception_ptr::fromUnsafe(swiftClosureWrapper);
28
+ return [swiftClosure = std::move(swiftClosure)](const std::exception_ptr& error) mutable -> void {
29
+ swiftClosure.call(error);
30
+ };
31
+ }
32
+
33
+ // pragma MARK: std::function<void()>
34
+ Func_void create_Func_void(void* NON_NULL swiftClosureWrapper) noexcept {
35
+ auto swiftClosure = ReactNativeBundleUpdate::Func_void::fromUnsafe(swiftClosureWrapper);
36
+ return [swiftClosure = std::move(swiftClosure)]() mutable -> void {
37
+ swiftClosure.call();
38
+ };
39
+ }
40
+
41
+ // pragma MARK: std::function<void(const TestResult& /* result */)>
42
+ Func_void_TestResult create_Func_void_TestResult(void* NON_NULL swiftClosureWrapper) noexcept {
43
+ auto swiftClosure = ReactNativeBundleUpdate::Func_void_TestResult::fromUnsafe(swiftClosureWrapper);
44
+ return [swiftClosure = std::move(swiftClosure)](const TestResult& result) mutable -> void {
45
+ swiftClosure.call(result);
46
+ };
47
+ }
48
+
49
+ // pragma MARK: std::function<void(const std::vector<FallbackBundleInfo>& /* result */)>
50
+ Func_void_std__vector_FallbackBundleInfo_ create_Func_void_std__vector_FallbackBundleInfo_(void* NON_NULL swiftClosureWrapper) noexcept {
51
+ auto swiftClosure = ReactNativeBundleUpdate::Func_void_std__vector_FallbackBundleInfo_::fromUnsafe(swiftClosureWrapper);
52
+ return [swiftClosure = std::move(swiftClosure)](const std::vector<FallbackBundleInfo>& result) mutable -> void {
53
+ swiftClosure.call(result);
54
+ };
55
+ }
56
+
57
+ // pragma MARK: std::function<void(const std::string& /* result */)>
58
+ Func_void_std__string create_Func_void_std__string(void* NON_NULL swiftClosureWrapper) noexcept {
59
+ auto swiftClosure = ReactNativeBundleUpdate::Func_void_std__string::fromUnsafe(swiftClosureWrapper);
60
+ return [swiftClosure = std::move(swiftClosure)](const std::string& result) mutable -> void {
61
+ swiftClosure.call(result);
62
+ };
63
+ }
64
+
65
+ // pragma MARK: std::function<void(bool /* result */)>
66
+ Func_void_bool create_Func_void_bool(void* NON_NULL swiftClosureWrapper) noexcept {
67
+ auto swiftClosure = ReactNativeBundleUpdate::Func_void_bool::fromUnsafe(swiftClosureWrapper);
68
+ return [swiftClosure = std::move(swiftClosure)](bool result) mutable -> void {
69
+ swiftClosure.call(result);
70
+ };
71
+ }
72
+
73
+ // pragma MARK: std::function<void(const std::vector<LocalBundleInfo>& /* result */)>
74
+ Func_void_std__vector_LocalBundleInfo_ create_Func_void_std__vector_LocalBundleInfo_(void* NON_NULL swiftClosureWrapper) noexcept {
75
+ auto swiftClosure = ReactNativeBundleUpdate::Func_void_std__vector_LocalBundleInfo_::fromUnsafe(swiftClosureWrapper);
76
+ return [swiftClosure = std::move(swiftClosure)](const std::vector<LocalBundleInfo>& result) mutable -> void {
77
+ swiftClosure.call(result);
78
+ };
79
+ }
80
+
81
+ // pragma MARK: std::function<void(const std::vector<AscFileInfo>& /* result */)>
82
+ Func_void_std__vector_AscFileInfo_ create_Func_void_std__vector_AscFileInfo_(void* NON_NULL swiftClosureWrapper) noexcept {
83
+ auto swiftClosure = ReactNativeBundleUpdate::Func_void_std__vector_AscFileInfo_::fromUnsafe(swiftClosureWrapper);
84
+ return [swiftClosure = std::move(swiftClosure)](const std::vector<AscFileInfo>& result) mutable -> void {
85
+ swiftClosure.call(result);
86
+ };
87
+ }
88
+
89
+ // pragma MARK: std::function<void(const BundleDownloadEvent& /* event */)>
90
+ Func_void_BundleDownloadEvent create_Func_void_BundleDownloadEvent(void* NON_NULL swiftClosureWrapper) noexcept {
91
+ auto swiftClosure = ReactNativeBundleUpdate::Func_void_BundleDownloadEvent::fromUnsafe(swiftClosureWrapper);
92
+ return [swiftClosure = std::move(swiftClosure)](const BundleDownloadEvent& event) mutable -> void {
93
+ swiftClosure.call(event);
94
+ };
95
+ }
96
+
97
+ // pragma MARK: std::shared_ptr<HybridReactNativeBundleUpdateSpec>
98
+ std::shared_ptr<HybridReactNativeBundleUpdateSpec> create_std__shared_ptr_HybridReactNativeBundleUpdateSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
99
+ ReactNativeBundleUpdate::HybridReactNativeBundleUpdateSpec_cxx swiftPart = ReactNativeBundleUpdate::HybridReactNativeBundleUpdateSpec_cxx::fromUnsafe(swiftUnsafePointer);
100
+ return std::make_shared<margelo::nitro::reactnativebundleupdate::HybridReactNativeBundleUpdateSpecSwift>(swiftPart);
101
+ }
102
+ void* NON_NULL get_std__shared_ptr_HybridReactNativeBundleUpdateSpec_(std__shared_ptr_HybridReactNativeBundleUpdateSpec_ cppType) {
103
+ std::shared_ptr<margelo::nitro::reactnativebundleupdate::HybridReactNativeBundleUpdateSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::reactnativebundleupdate::HybridReactNativeBundleUpdateSpecSwift>(cppType);
104
+ #ifdef NITRO_DEBUG
105
+ if (swiftWrapper == nullptr) [[unlikely]] {
106
+ throw std::runtime_error("Class \"HybridReactNativeBundleUpdateSpec\" is not implemented in Swift!");
107
+ }
108
+ #endif
109
+ ReactNativeBundleUpdate::HybridReactNativeBundleUpdateSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
110
+ return swiftPart.toUnsafe();
111
+ }
112
+
113
+ } // namespace margelo::nitro::reactnativebundleupdate::bridge::swift