@onekeyfe/react-native-app-update 3.0.81-alpha.8 → 3.0.82

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 (39) hide show
  1. package/nitrogen/generated/android/c++/JAppUpdateDownloadParams.hpp +2 -2
  2. package/nitrogen/generated/android/c++/JAppUpdateFileParams.hpp +2 -2
  3. package/nitrogen/generated/android/c++/JDownloadEvent.hpp +2 -2
  4. package/nitrogen/generated/android/c++/JFunc_void_DownloadEvent.hpp +3 -3
  5. package/nitrogen/generated/android/c++/JHybridReactNativeAppUpdateSpec.cpp +33 -31
  6. package/nitrogen/generated/android/c++/JHybridReactNativeAppUpdateSpec.hpp +20 -22
  7. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeappupdate/AppUpdateDownloadParams.kt +2 -2
  8. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeappupdate/AppUpdateFileParams.kt +2 -2
  9. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeappupdate/DownloadEvent.kt +2 -2
  10. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeappupdate/Func_void_DownloadEvent.kt +1 -1
  11. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeappupdate/HybridReactNativeAppUpdateSpec.kt +16 -19
  12. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeappupdate/reactnativeappupdateOnLoad.kt +1 -1
  13. package/nitrogen/generated/android/reactnativeappupdate+autolinking.cmake +1 -1
  14. package/nitrogen/generated/android/reactnativeappupdate+autolinking.gradle +1 -1
  15. package/nitrogen/generated/android/reactnativeappupdateOnLoad.cpp +28 -18
  16. package/nitrogen/generated/android/reactnativeappupdateOnLoad.hpp +14 -5
  17. package/nitrogen/generated/ios/ReactNativeAppUpdate+autolinking.rb +2 -2
  18. package/nitrogen/generated/ios/ReactNativeAppUpdate-Swift-Cxx-Bridge.cpp +1 -1
  19. package/nitrogen/generated/ios/ReactNativeAppUpdate-Swift-Cxx-Bridge.hpp +1 -1
  20. package/nitrogen/generated/ios/ReactNativeAppUpdate-Swift-Cxx-Umbrella.hpp +1 -1
  21. package/nitrogen/generated/ios/ReactNativeAppUpdateAutolinking.mm +1 -1
  22. package/nitrogen/generated/ios/ReactNativeAppUpdateAutolinking.swift +9 -8
  23. package/nitrogen/generated/ios/c++/HybridReactNativeAppUpdateSpecSwift.cpp +1 -1
  24. package/nitrogen/generated/ios/c++/HybridReactNativeAppUpdateSpecSwift.hpp +7 -1
  25. package/nitrogen/generated/ios/swift/AppUpdateDownloadParams.swift +7 -26
  26. package/nitrogen/generated/ios/swift/AppUpdateFileParams.swift +3 -10
  27. package/nitrogen/generated/ios/swift/DownloadEvent.swift +7 -26
  28. package/nitrogen/generated/ios/swift/Func_void.swift +1 -2
  29. package/nitrogen/generated/ios/swift/Func_void_DownloadEvent.swift +1 -2
  30. package/nitrogen/generated/ios/swift/Func_void_bool.swift +1 -2
  31. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +1 -2
  32. package/nitrogen/generated/ios/swift/HybridReactNativeAppUpdateSpec.swift +3 -4
  33. package/nitrogen/generated/ios/swift/HybridReactNativeAppUpdateSpec_cxx.swift +9 -2
  34. package/nitrogen/generated/shared/c++/AppUpdateDownloadParams.hpp +19 -11
  35. package/nitrogen/generated/shared/c++/AppUpdateFileParams.hpp +13 -5
  36. package/nitrogen/generated/shared/c++/DownloadEvent.hpp +19 -11
  37. package/nitrogen/generated/shared/c++/HybridReactNativeAppUpdateSpec.cpp +1 -1
  38. package/nitrogen/generated/shared/c++/HybridReactNativeAppUpdateSpec.hpp +1 -1
  39. package/package.json +5 -6
@@ -2,7 +2,7 @@
2
2
  /// JAppUpdateDownloadParams.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once
@@ -21,7 +21,7 @@ namespace margelo::nitro::reactnativeappupdate {
21
21
  */
22
22
  struct JAppUpdateDownloadParams final: public jni::JavaClass<JAppUpdateDownloadParams> {
23
23
  public:
24
- static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativeappupdate/AppUpdateDownloadParams;";
24
+ static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/reactnativeappupdate/AppUpdateDownloadParams;";
25
25
 
26
26
  public:
27
27
  /**
@@ -2,7 +2,7 @@
2
2
  /// JAppUpdateFileParams.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once
@@ -21,7 +21,7 @@ namespace margelo::nitro::reactnativeappupdate {
21
21
  */
22
22
  struct JAppUpdateFileParams final: public jni::JavaClass<JAppUpdateFileParams> {
23
23
  public:
24
- static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativeappupdate/AppUpdateFileParams;";
24
+ static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/reactnativeappupdate/AppUpdateFileParams;";
25
25
 
26
26
  public:
27
27
  /**
@@ -2,7 +2,7 @@
2
2
  /// JDownloadEvent.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once
@@ -21,7 +21,7 @@ namespace margelo::nitro::reactnativeappupdate {
21
21
  */
22
22
  struct JDownloadEvent final: public jni::JavaClass<JDownloadEvent> {
23
23
  public:
24
- static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativeappupdate/DownloadEvent;";
24
+ static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/reactnativeappupdate/DownloadEvent;";
25
25
 
26
26
  public:
27
27
  /**
@@ -2,7 +2,7 @@
2
2
  /// JFunc_void_DownloadEvent.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once
@@ -26,7 +26,7 @@ namespace margelo::nitro::reactnativeappupdate {
26
26
  */
27
27
  struct JFunc_void_DownloadEvent: public jni::JavaClass<JFunc_void_DownloadEvent> {
28
28
  public:
29
- static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativeappupdate/Func_void_DownloadEvent;";
29
+ static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/reactnativeappupdate/Func_void_DownloadEvent;";
30
30
 
31
31
  public:
32
32
  /**
@@ -62,7 +62,7 @@ namespace margelo::nitro::reactnativeappupdate {
62
62
  }
63
63
 
64
64
  public:
65
- static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativeappupdate/Func_void_DownloadEvent_cxx;";
65
+ static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/reactnativeappupdate/Func_void_DownloadEvent_cxx;";
66
66
  static void registerNatives() {
67
67
  registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_DownloadEvent_cxx::invoke_cxx)});
68
68
  }
@@ -2,7 +2,7 @@
2
2
  /// JHybridReactNativeAppUpdateSpec.cpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #include "JHybridReactNativeAppUpdateSpec.hpp"
@@ -16,6 +16,7 @@ namespace margelo::nitro::reactnativeappupdate { struct DownloadEvent; }
16
16
 
17
17
  #include <NitroModules/Promise.hpp>
18
18
  #include <NitroModules/JPromise.hpp>
19
+ #include <NitroModules/JUnit.hpp>
19
20
  #include "AppUpdateDownloadParams.hpp"
20
21
  #include "JAppUpdateDownloadParams.hpp"
21
22
  #include <string>
@@ -29,30 +30,31 @@ namespace margelo::nitro::reactnativeappupdate { struct DownloadEvent; }
29
30
 
30
31
  namespace margelo::nitro::reactnativeappupdate {
31
32
 
32
- jni::local_ref<JHybridReactNativeAppUpdateSpec::jhybriddata> JHybridReactNativeAppUpdateSpec::initHybrid(jni::alias_ref<jhybridobject> jThis) {
33
- return makeCxxInstance(jThis);
34
- }
35
-
36
- void JHybridReactNativeAppUpdateSpec::registerNatives() {
37
- registerHybrid({
38
- makeNativeMethod("initHybrid", JHybridReactNativeAppUpdateSpec::initHybrid),
39
- });
33
+ std::shared_ptr<JHybridReactNativeAppUpdateSpec> JHybridReactNativeAppUpdateSpec::JavaPart::getJHybridReactNativeAppUpdateSpec() {
34
+ auto hybridObject = JHybridObject::JavaPart::getJHybridObject();
35
+ auto castHybridObject = std::dynamic_pointer_cast<JHybridReactNativeAppUpdateSpec>(hybridObject);
36
+ if (castHybridObject == nullptr) [[unlikely]] {
37
+ throw std::runtime_error("Failed to downcast JHybridObject to JHybridReactNativeAppUpdateSpec!");
38
+ }
39
+ return castHybridObject;
40
40
  }
41
41
 
42
- size_t JHybridReactNativeAppUpdateSpec::getExternalMemorySize() noexcept {
43
- static const auto method = javaClassStatic()->getMethod<jlong()>("getMemorySize");
44
- return method(_javaPart);
42
+ jni::local_ref<JHybridReactNativeAppUpdateSpec::CxxPart::jhybriddata> JHybridReactNativeAppUpdateSpec::CxxPart::initHybrid(jni::alias_ref<jhybridobject> jThis) {
43
+ return makeCxxInstance(jThis);
45
44
  }
46
45
 
47
- void JHybridReactNativeAppUpdateSpec::dispose() noexcept {
48
- static const auto method = javaClassStatic()->getMethod<void()>("dispose");
49
- method(_javaPart);
46
+ std::shared_ptr<JHybridObject> JHybridReactNativeAppUpdateSpec::CxxPart::createHybridObject(const jni::local_ref<JHybridObject::JavaPart>& javaPart) {
47
+ auto castJavaPart = jni::dynamic_ref_cast<JHybridReactNativeAppUpdateSpec::JavaPart>(javaPart);
48
+ if (castJavaPart == nullptr) [[unlikely]] {
49
+ throw std::runtime_error("Failed to cast JHybridObject::JavaPart to JHybridReactNativeAppUpdateSpec::JavaPart!");
50
+ }
51
+ return std::make_shared<JHybridReactNativeAppUpdateSpec>(castJavaPart);
50
52
  }
51
53
 
52
- std::string JHybridReactNativeAppUpdateSpec::toString() {
53
- static const auto method = javaClassStatic()->getMethod<jni::JString()>("toString");
54
- auto javaString = method(_javaPart);
55
- return javaString->toStdString();
54
+ void JHybridReactNativeAppUpdateSpec::CxxPart::registerNatives() {
55
+ registerHybrid({
56
+ makeNativeMethod("initHybrid", JHybridReactNativeAppUpdateSpec::CxxPart::initHybrid),
57
+ });
56
58
  }
57
59
 
58
60
  // Properties
@@ -60,7 +62,7 @@ namespace margelo::nitro::reactnativeappupdate {
60
62
 
61
63
  // Methods
62
64
  std::shared_ptr<Promise<void>> JHybridReactNativeAppUpdateSpec::downloadAPK(const AppUpdateDownloadParams& params) {
63
- static const auto method = javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<JAppUpdateDownloadParams> /* params */)>("downloadAPK");
65
+ static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<JAppUpdateDownloadParams> /* params */)>("downloadAPK");
64
66
  auto __result = method(_javaPart, JAppUpdateDownloadParams::fromCpp(params));
65
67
  return [&]() {
66
68
  auto __promise = Promise<void>::create();
@@ -75,7 +77,7 @@ namespace margelo::nitro::reactnativeappupdate {
75
77
  }();
76
78
  }
77
79
  std::shared_ptr<Promise<void>> JHybridReactNativeAppUpdateSpec::downloadASC(const AppUpdateFileParams& params) {
78
- static const auto method = javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<JAppUpdateFileParams> /* params */)>("downloadASC");
80
+ static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<JAppUpdateFileParams> /* params */)>("downloadASC");
79
81
  auto __result = method(_javaPart, JAppUpdateFileParams::fromCpp(params));
80
82
  return [&]() {
81
83
  auto __promise = Promise<void>::create();
@@ -90,7 +92,7 @@ namespace margelo::nitro::reactnativeappupdate {
90
92
  }();
91
93
  }
92
94
  std::shared_ptr<Promise<void>> JHybridReactNativeAppUpdateSpec::verifyASC(const AppUpdateFileParams& params) {
93
- static const auto method = javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<JAppUpdateFileParams> /* params */)>("verifyASC");
95
+ static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<JAppUpdateFileParams> /* params */)>("verifyASC");
94
96
  auto __result = method(_javaPart, JAppUpdateFileParams::fromCpp(params));
95
97
  return [&]() {
96
98
  auto __promise = Promise<void>::create();
@@ -105,7 +107,7 @@ namespace margelo::nitro::reactnativeappupdate {
105
107
  }();
106
108
  }
107
109
  std::shared_ptr<Promise<void>> JHybridReactNativeAppUpdateSpec::verifyAPK(const AppUpdateFileParams& params) {
108
- static const auto method = javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<JAppUpdateFileParams> /* params */)>("verifyAPK");
110
+ static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<JAppUpdateFileParams> /* params */)>("verifyAPK");
109
111
  auto __result = method(_javaPart, JAppUpdateFileParams::fromCpp(params));
110
112
  return [&]() {
111
113
  auto __promise = Promise<void>::create();
@@ -120,7 +122,7 @@ namespace margelo::nitro::reactnativeappupdate {
120
122
  }();
121
123
  }
122
124
  std::shared_ptr<Promise<void>> JHybridReactNativeAppUpdateSpec::installAPK(const AppUpdateFileParams& params) {
123
- static const auto method = javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<JAppUpdateFileParams> /* params */)>("installAPK");
125
+ static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<JAppUpdateFileParams> /* params */)>("installAPK");
124
126
  auto __result = method(_javaPart, JAppUpdateFileParams::fromCpp(params));
125
127
  return [&]() {
126
128
  auto __promise = Promise<void>::create();
@@ -135,7 +137,7 @@ namespace margelo::nitro::reactnativeappupdate {
135
137
  }();
136
138
  }
137
139
  std::shared_ptr<Promise<void>> JHybridReactNativeAppUpdateSpec::clearCache() {
138
- static const auto method = javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>()>("clearCache");
140
+ static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>()>("clearCache");
139
141
  auto __result = method(_javaPart);
140
142
  return [&]() {
141
143
  auto __promise = Promise<void>::create();
@@ -150,7 +152,7 @@ namespace margelo::nitro::reactnativeappupdate {
150
152
  }();
151
153
  }
152
154
  std::shared_ptr<Promise<void>> JHybridReactNativeAppUpdateSpec::clearApkCache() {
153
- static const auto method = javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>()>("clearApkCache");
155
+ static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>()>("clearApkCache");
154
156
  auto __result = method(_javaPart);
155
157
  return [&]() {
156
158
  auto __promise = Promise<void>::create();
@@ -165,7 +167,7 @@ namespace margelo::nitro::reactnativeappupdate {
165
167
  }();
166
168
  }
167
169
  std::shared_ptr<Promise<bool>> JHybridReactNativeAppUpdateSpec::testVerification() {
168
- static const auto method = javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>()>("testVerification");
170
+ static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>()>("testVerification");
169
171
  auto __result = method(_javaPart);
170
172
  return [&]() {
171
173
  auto __promise = Promise<bool>::create();
@@ -181,7 +183,7 @@ namespace margelo::nitro::reactnativeappupdate {
181
183
  }();
182
184
  }
183
185
  std::shared_ptr<Promise<bool>> JHybridReactNativeAppUpdateSpec::testSkipVerification() {
184
- static const auto method = javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>()>("testSkipVerification");
186
+ static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>()>("testSkipVerification");
185
187
  auto __result = method(_javaPart);
186
188
  return [&]() {
187
189
  auto __promise = Promise<bool>::create();
@@ -197,17 +199,17 @@ namespace margelo::nitro::reactnativeappupdate {
197
199
  }();
198
200
  }
199
201
  bool JHybridReactNativeAppUpdateSpec::isSkipGpgVerificationAllowed() {
200
- static const auto method = javaClassStatic()->getMethod<jboolean()>("isSkipGpgVerificationAllowed");
202
+ static const auto method = _javaPart->javaClassStatic()->getMethod<jboolean()>("isSkipGpgVerificationAllowed");
201
203
  auto __result = method(_javaPart);
202
204
  return static_cast<bool>(__result);
203
205
  }
204
206
  double JHybridReactNativeAppUpdateSpec::addDownloadListener(const std::function<void(const DownloadEvent& /* event */)>& callback) {
205
- static const auto method = javaClassStatic()->getMethod<double(jni::alias_ref<JFunc_void_DownloadEvent::javaobject> /* callback */)>("addDownloadListener_cxx");
207
+ static const auto method = _javaPart->javaClassStatic()->getMethod<double(jni::alias_ref<JFunc_void_DownloadEvent::javaobject> /* callback */)>("addDownloadListener_cxx");
206
208
  auto __result = method(_javaPart, JFunc_void_DownloadEvent_cxx::fromCpp(callback));
207
209
  return __result;
208
210
  }
209
211
  void JHybridReactNativeAppUpdateSpec::removeDownloadListener(double id) {
210
- static const auto method = javaClassStatic()->getMethod<void(double /* id */)>("removeDownloadListener");
212
+ static const auto method = _javaPart->javaClassStatic()->getMethod<void(double /* id */)>("removeDownloadListener");
211
213
  method(_javaPart, id);
212
214
  }
213
215
 
@@ -2,7 +2,7 @@
2
2
  /// HybridReactNativeAppUpdateSpec.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once
@@ -18,33 +18,33 @@ namespace margelo::nitro::reactnativeappupdate {
18
18
 
19
19
  using namespace facebook;
20
20
 
21
- class JHybridReactNativeAppUpdateSpec: public jni::HybridClass<JHybridReactNativeAppUpdateSpec, JHybridObject>,
22
- public virtual HybridReactNativeAppUpdateSpec {
21
+ class JHybridReactNativeAppUpdateSpec: public virtual HybridReactNativeAppUpdateSpec, public virtual JHybridObject {
23
22
  public:
24
- static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativeappupdate/HybridReactNativeAppUpdateSpec;";
25
- static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject> jThis);
26
- static void registerNatives();
27
-
28
- protected:
29
- // C++ constructor (called from Java via `initHybrid()`)
30
- explicit JHybridReactNativeAppUpdateSpec(jni::alias_ref<jhybridobject> jThis) :
31
- HybridObject(HybridReactNativeAppUpdateSpec::TAG),
32
- HybridBase(jThis),
33
- _javaPart(jni::make_global(jThis)) {}
23
+ struct JavaPart: public jni::JavaClass<JavaPart, JHybridObject::JavaPart> {
24
+ static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/reactnativeappupdate/HybridReactNativeAppUpdateSpec;";
25
+ std::shared_ptr<JHybridReactNativeAppUpdateSpec> getJHybridReactNativeAppUpdateSpec();
26
+ };
27
+ struct CxxPart: public jni::HybridClass<CxxPart, JHybridObject::CxxPart> {
28
+ static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/reactnativeappupdate/HybridReactNativeAppUpdateSpec$CxxPart;";
29
+ static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject> jThis);
30
+ static void registerNatives();
31
+ using HybridBase::HybridBase;
32
+ protected:
33
+ std::shared_ptr<JHybridObject> createHybridObject(const jni::local_ref<JHybridObject::JavaPart>& javaPart) override;
34
+ };
34
35
 
35
36
  public:
37
+ explicit JHybridReactNativeAppUpdateSpec(const jni::local_ref<JHybridReactNativeAppUpdateSpec::JavaPart>& javaPart):
38
+ HybridObject(HybridReactNativeAppUpdateSpec::TAG),
39
+ JHybridObject(javaPart),
40
+ _javaPart(jni::make_global(javaPart)) {}
36
41
  ~JHybridReactNativeAppUpdateSpec() override {
37
42
  // Hermes GC can destroy JS objects on a non-JNI Thread.
38
43
  jni::ThreadScope::WithClassLoader([&] { _javaPart.reset(); });
39
44
  }
40
45
 
41
46
  public:
42
- size_t getExternalMemorySize() noexcept override;
43
- void dispose() noexcept override;
44
- std::string toString() override;
45
-
46
- public:
47
- inline const jni::global_ref<JHybridReactNativeAppUpdateSpec::javaobject>& getJavaPart() const noexcept {
47
+ inline const jni::global_ref<JHybridReactNativeAppUpdateSpec::JavaPart>& getJavaPart() const noexcept {
48
48
  return _javaPart;
49
49
  }
50
50
 
@@ -68,9 +68,7 @@ namespace margelo::nitro::reactnativeappupdate {
68
68
  void removeDownloadListener(double id) override;
69
69
 
70
70
  private:
71
- friend HybridBase;
72
- using HybridBase::HybridBase;
73
- jni::global_ref<JHybridReactNativeAppUpdateSpec::javaobject> _javaPart;
71
+ jni::global_ref<JHybridReactNativeAppUpdateSpec::JavaPart> _javaPart;
74
72
  };
75
73
 
76
74
  } // namespace margelo::nitro::reactnativeappupdate
@@ -2,7 +2,7 @@
2
2
  /// AppUpdateDownloadParams.kt
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  package com.margelo.nitro.reactnativeappupdate
@@ -29,7 +29,7 @@ data class AppUpdateDownloadParams(
29
29
  ) {
30
30
  /* primary constructor */
31
31
 
32
- private companion object {
32
+ companion object {
33
33
  /**
34
34
  * Constructor called from C++
35
35
  */
@@ -2,7 +2,7 @@
2
2
  /// AppUpdateFileParams.kt
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  package com.margelo.nitro.reactnativeappupdate
@@ -23,7 +23,7 @@ data class AppUpdateFileParams(
23
23
  ) {
24
24
  /* primary constructor */
25
25
 
26
- private companion object {
26
+ companion object {
27
27
  /**
28
28
  * Constructor called from C++
29
29
  */
@@ -2,7 +2,7 @@
2
2
  /// DownloadEvent.kt
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  package com.margelo.nitro.reactnativeappupdate
@@ -29,7 +29,7 @@ data class DownloadEvent(
29
29
  ) {
30
30
  /* primary constructor */
31
31
 
32
- private companion object {
32
+ companion object {
33
33
  /**
34
34
  * Constructor called from C++
35
35
  */
@@ -2,7 +2,7 @@
2
2
  /// Func_void_DownloadEvent.kt
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  package com.margelo.nitro.reactnativeappupdate
@@ -2,7 +2,7 @@
2
2
  /// HybridReactNativeAppUpdateSpec.kt
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  package com.margelo.nitro.reactnativeappupdate
@@ -25,23 +25,6 @@ import com.margelo.nitro.core.HybridObject
25
25
  "LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName"
26
26
  )
27
27
  abstract class HybridReactNativeAppUpdateSpec: 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 ReactNativeAppUpdate]"
43
- }
44
-
45
28
  // Properties
46
29
 
47
30
 
@@ -99,7 +82,21 @@ abstract class HybridReactNativeAppUpdateSpec: HybridObject() {
99
82
  @Keep
100
83
  abstract fun removeDownloadListener(id: Double): Unit
101
84
 
102
- private external fun initHybrid(): HybridData
85
+ // Default implementation of `HybridObject.toString()`
86
+ override fun toString(): String {
87
+ return "[HybridObject ReactNativeAppUpdate]"
88
+ }
89
+
90
+ // C++ backing class
91
+ @DoNotStrip
92
+ @Keep
93
+ protected open class CxxPart(javaPart: HybridReactNativeAppUpdateSpec): HybridObject.CxxPart(javaPart) {
94
+ // C++ JHybridReactNativeAppUpdateSpec::CxxPart::initHybrid(...)
95
+ external override fun initHybrid(): HybridData
96
+ }
97
+ override fun createCxxPart(): CxxPart {
98
+ return CxxPart(this)
99
+ }
103
100
 
104
101
  companion object {
105
102
  protected const val TAG = "HybridReactNativeAppUpdateSpec"
@@ -2,7 +2,7 @@
2
2
  /// reactnativeappupdateOnLoad.kt
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  package com.margelo.nitro.reactnativeappupdate
@@ -2,7 +2,7 @@
2
2
  # reactnativeappupdate+autolinking.cmake
3
3
  # This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  # https://github.com/mrousavy/nitro
5
- # Copyright © 2026 Marc Rousavy @ Margelo
5
+ # Copyright © Marc Rousavy @ Margelo
6
6
  #
7
7
 
8
8
  # This is a CMake file that adds all files generated by Nitrogen
@@ -2,7 +2,7 @@
2
2
  /// reactnativeappupdate+autolinking.gradle
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  /// This is a Gradle file that adds all files generated by Nitrogen
@@ -2,7 +2,7 @@
2
2
  /// reactnativeappupdateOnLoad.cpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #ifndef BUILDING_REACTNATIVEAPPUPDATE_WITH_GENERATED_CMAKE_PROJECT
@@ -22,25 +22,35 @@
22
22
  namespace margelo::nitro::reactnativeappupdate {
23
23
 
24
24
  int initialize(JavaVM* vm) {
25
+ return facebook::jni::initialize(vm, []() {
26
+ ::margelo::nitro::reactnativeappupdate::registerAllNatives();
27
+ });
28
+ }
29
+
30
+ struct JHybridReactNativeAppUpdateSpecImpl: public jni::JavaClass<JHybridReactNativeAppUpdateSpecImpl, JHybridReactNativeAppUpdateSpec::JavaPart> {
31
+ static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/reactnativeappupdate/ReactNativeAppUpdate;";
32
+ static std::shared_ptr<JHybridReactNativeAppUpdateSpec> create() {
33
+ static const auto constructorFn = javaClassStatic()->getConstructor<JHybridReactNativeAppUpdateSpecImpl::javaobject()>();
34
+ jni::local_ref<JHybridReactNativeAppUpdateSpec::JavaPart> javaPart = javaClassStatic()->newObject(constructorFn);
35
+ return javaPart->getJHybridReactNativeAppUpdateSpec();
36
+ }
37
+ };
38
+
39
+ void registerAllNatives() {
25
40
  using namespace margelo::nitro;
26
41
  using namespace margelo::nitro::reactnativeappupdate;
27
- using namespace facebook;
28
-
29
- return facebook::jni::initialize(vm, [] {
30
- // Register native JNI methods
31
- margelo::nitro::reactnativeappupdate::JHybridReactNativeAppUpdateSpec::registerNatives();
32
- margelo::nitro::reactnativeappupdate::JFunc_void_DownloadEvent_cxx::registerNatives();
33
-
34
- // Register Nitro Hybrid Objects
35
- HybridObjectRegistry::registerHybridObjectConstructor(
36
- "ReactNativeAppUpdate",
37
- []() -> std::shared_ptr<HybridObject> {
38
- static DefaultConstructableObject<JHybridReactNativeAppUpdateSpec::javaobject> object("com/margelo/nitro/reactnativeappupdate/ReactNativeAppUpdate");
39
- auto instance = object.create();
40
- return instance->cthis()->shared();
41
- }
42
- );
43
- });
42
+
43
+ // Register native JNI methods
44
+ margelo::nitro::reactnativeappupdate::JHybridReactNativeAppUpdateSpec::CxxPart::registerNatives();
45
+ margelo::nitro::reactnativeappupdate::JFunc_void_DownloadEvent_cxx::registerNatives();
46
+
47
+ // Register Nitro Hybrid Objects
48
+ HybridObjectRegistry::registerHybridObjectConstructor(
49
+ "ReactNativeAppUpdate",
50
+ []() -> std::shared_ptr<HybridObject> {
51
+ return JHybridReactNativeAppUpdateSpecImpl::create();
52
+ }
53
+ );
44
54
  }
45
55
 
46
56
  } // namespace margelo::nitro::reactnativeappupdate
@@ -2,24 +2,33 @@
2
2
  /// reactnativeappupdateOnLoad.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #include <jni.h>
9
+ #include <functional>
9
10
  #include <NitroModules/NitroDefines.hpp>
10
11
 
11
12
  namespace margelo::nitro::reactnativeappupdate {
12
13
 
14
+ [[deprecated("Use registerNatives() instead.")]]
15
+ int initialize(JavaVM* vm);
16
+
13
17
  /**
14
- * Initializes the native (C++) part of reactnativeappupdate, and autolinks all Hybrid Objects.
15
- * Call this in your `JNI_OnLoad` function (probably inside `cpp-adapter.cpp`).
18
+ * Register the native (C++) part of reactnativeappupdate, and autolinks all Hybrid Objects.
19
+ * Call this in your `JNI_OnLoad` function (probably inside `cpp-adapter.cpp`),
20
+ * inside a `facebook::jni::initialize(vm, ...)` call.
16
21
  * Example:
17
22
  * ```cpp (cpp-adapter.cpp)
18
23
  * JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) {
19
- * return margelo::nitro::reactnativeappupdate::initialize(vm);
24
+ * return facebook::jni::initialize(vm, []() {
25
+ * // register all reactnativeappupdate HybridObjects
26
+ * margelo::nitro::reactnativeappupdate::registerNatives();
27
+ * // any other custom registrations go here.
28
+ * });
20
29
  * }
21
30
  * ```
22
31
  */
23
- int initialize(JavaVM* vm);
32
+ void registerAllNatives();
24
33
 
25
34
  } // namespace margelo::nitro::reactnativeappupdate
@@ -2,7 +2,7 @@
2
2
  # ReactNativeAppUpdate+autolinking.rb
3
3
  # This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  # https://github.com/mrousavy/nitro
5
- # Copyright © 2026 Marc Rousavy @ Margelo
5
+ # Copyright © Marc Rousavy @ Margelo
6
6
  #
7
7
 
8
8
  # This is a Ruby script that adds all files generated by Nitrogen
@@ -52,7 +52,7 @@ def add_nitrogen_files(spec)
52
52
  spec.pod_target_xcconfig = current_pod_target_xcconfig.merge({
53
53
  # Use C++ 20
54
54
  "CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
55
- # Enables C++ <-> Swift interop (by default it's only C)
55
+ # Enables C++ <-> Swift interop (by default it's only ObjC)
56
56
  "SWIFT_OBJC_INTEROP_MODE" => "objcxx",
57
57
  # Enables stricter modular headers
58
58
  "DEFINES_MODULE" => "YES",
@@ -2,7 +2,7 @@
2
2
  /// ReactNativeAppUpdate-Swift-Cxx-Bridge.cpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #include "ReactNativeAppUpdate-Swift-Cxx-Bridge.hpp"
@@ -2,7 +2,7 @@
2
2
  /// ReactNativeAppUpdate-Swift-Cxx-Bridge.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once
@@ -2,7 +2,7 @@
2
2
  /// ReactNativeAppUpdate-Swift-Cxx-Umbrella.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once
@@ -2,7 +2,7 @@
2
2
  /// ReactNativeAppUpdateAutolinking.mm
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #import <Foundation/Foundation.h>
@@ -2,19 +2,16 @@
2
2
  /// ReactNativeAppUpdateAutolinking.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
+ import NitroModules
9
+
10
+ // TODO: Use empty enums once Swift supports exporting them as namespaces
11
+ // See: https://github.com/swiftlang/swift/pull/83616
8
12
  public final class ReactNativeAppUpdateAutolinking {
9
13
  public typealias bridge = margelo.nitro.reactnativeappupdate.bridge.swift
10
14
 
11
- /**
12
- * Creates an instance of a Swift class that implements `HybridReactNativeAppUpdateSpec`,
13
- * and wraps it in a Swift class that can directly interop with C++ (`HybridReactNativeAppUpdateSpec_cxx`)
14
- *
15
- * This is generated by Nitrogen and will initialize the class specified
16
- * in the `"autolinking"` property of `nitro.json` (in this case, `ReactNativeAppUpdate`).
17
- */
18
15
  public static func createReactNativeAppUpdate() -> bridge.std__shared_ptr_HybridReactNativeAppUpdateSpec_ {
19
16
  let hybridObject = ReactNativeAppUpdate()
20
17
  return { () -> bridge.std__shared_ptr_HybridReactNativeAppUpdateSpec_ in
@@ -22,4 +19,8 @@ public final class ReactNativeAppUpdateAutolinking {
22
19
  return __cxxWrapped.getCxxPart()
23
20
  }()
24
21
  }
22
+
23
+ public static func isReactNativeAppUpdateRecyclable() -> Bool {
24
+ return ReactNativeAppUpdate.self is any RecyclableView.Type
25
+ }
25
26
  }
@@ -2,7 +2,7 @@
2
2
  /// HybridReactNativeAppUpdateSpecSwift.cpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #include "HybridReactNativeAppUpdateSpecSwift.hpp"
@@ -2,7 +2,7 @@
2
2
  /// HybridReactNativeAppUpdateSpecSwift.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once
@@ -57,6 +57,12 @@ namespace margelo::nitro::reactnativeappupdate {
57
57
  inline size_t getExternalMemorySize() noexcept override {
58
58
  return _swiftPart.getMemorySize();
59
59
  }
60
+ bool equals(const std::shared_ptr<HybridObject>& other) override {
61
+ if (auto otherCast = std::dynamic_pointer_cast<HybridReactNativeAppUpdateSpecSwift>(other)) {
62
+ return _swiftPart.equals(otherCast->_swiftPart);
63
+ }
64
+ return false;
65
+ }
60
66
  void dispose() noexcept override {
61
67
  _swiftPart.dispose();
62
68
  }
@@ -2,10 +2,9 @@
2
2
  /// AppUpdateDownloadParams.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
- import Foundation
9
8
  import NitroModules
10
9
 
11
10
  /**
@@ -23,36 +22,18 @@ public extension AppUpdateDownloadParams {
23
22
  self.init(std.string(downloadUrl), std.string(notificationTitle), fileSize)
24
23
  }
25
24
 
25
+ @inline(__always)
26
26
  var downloadUrl: String {
27
- @inline(__always)
28
- get {
29
- return String(self.__downloadUrl)
30
- }
31
- @inline(__always)
32
- set {
33
- self.__downloadUrl = std.string(newValue)
34
- }
27
+ return String(self.__downloadUrl)
35
28
  }
36
29
 
30
+ @inline(__always)
37
31
  var notificationTitle: String {
38
- @inline(__always)
39
- get {
40
- return String(self.__notificationTitle)
41
- }
42
- @inline(__always)
43
- set {
44
- self.__notificationTitle = std.string(newValue)
45
- }
32
+ return String(self.__notificationTitle)
46
33
  }
47
34
 
35
+ @inline(__always)
48
36
  var fileSize: Double {
49
- @inline(__always)
50
- get {
51
- return self.__fileSize
52
- }
53
- @inline(__always)
54
- set {
55
- self.__fileSize = newValue
56
- }
37
+ return self.__fileSize
57
38
  }
58
39
  }
@@ -2,10 +2,9 @@
2
2
  /// AppUpdateFileParams.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
- import Foundation
9
8
  import NitroModules
10
9
 
11
10
  /**
@@ -23,14 +22,8 @@ public extension AppUpdateFileParams {
23
22
  self.init(std.string(downloadUrl))
24
23
  }
25
24
 
25
+ @inline(__always)
26
26
  var downloadUrl: String {
27
- @inline(__always)
28
- get {
29
- return String(self.__downloadUrl)
30
- }
31
- @inline(__always)
32
- set {
33
- self.__downloadUrl = std.string(newValue)
34
- }
27
+ return String(self.__downloadUrl)
35
28
  }
36
29
  }
@@ -2,10 +2,9 @@
2
2
  /// DownloadEvent.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
- import Foundation
9
8
  import NitroModules
10
9
 
11
10
  /**
@@ -23,36 +22,18 @@ public extension DownloadEvent {
23
22
  self.init(std.string(type), progress, std.string(message))
24
23
  }
25
24
 
25
+ @inline(__always)
26
26
  var type: String {
27
- @inline(__always)
28
- get {
29
- return String(self.__type)
30
- }
31
- @inline(__always)
32
- set {
33
- self.__type = std.string(newValue)
34
- }
27
+ return String(self.__type)
35
28
  }
36
29
 
30
+ @inline(__always)
37
31
  var progress: Double {
38
- @inline(__always)
39
- get {
40
- return self.__progress
41
- }
42
- @inline(__always)
43
- set {
44
- self.__progress = newValue
45
- }
32
+ return self.__progress
46
33
  }
47
34
 
35
+ @inline(__always)
48
36
  var message: String {
49
- @inline(__always)
50
- get {
51
- return String(self.__message)
52
- }
53
- @inline(__always)
54
- set {
55
- self.__message = std.string(newValue)
56
- }
37
+ return String(self.__message)
57
38
  }
58
39
  }
@@ -2,10 +2,9 @@
2
2
  /// Func_void.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
- import Foundation
9
8
  import NitroModules
10
9
 
11
10
  /**
@@ -2,10 +2,9 @@
2
2
  /// Func_void_DownloadEvent.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
- import Foundation
9
8
  import NitroModules
10
9
 
11
10
  /**
@@ -2,10 +2,9 @@
2
2
  /// Func_void_bool.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
- import Foundation
9
8
  import NitroModules
10
9
 
11
10
  /**
@@ -2,10 +2,9 @@
2
2
  /// Func_void_std__exception_ptr.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
- import Foundation
9
8
  import NitroModules
10
9
 
11
10
  /**
@@ -2,10 +2,9 @@
2
2
  /// HybridReactNativeAppUpdateSpec.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
- import Foundation
9
8
  import NitroModules
10
9
 
11
10
  /// See ``HybridReactNativeAppUpdateSpec``
@@ -41,14 +40,14 @@ open class HybridReactNativeAppUpdateSpec_base {
41
40
  public init() { }
42
41
  public func getCxxWrapper() -> HybridReactNativeAppUpdateSpec_cxx {
43
42
  #if DEBUG
44
- guard self is HybridReactNativeAppUpdateSpec else {
43
+ guard self is any HybridReactNativeAppUpdateSpec else {
45
44
  fatalError("`self` is not a `HybridReactNativeAppUpdateSpec`! Did you accidentally inherit from `HybridReactNativeAppUpdateSpec_base` instead of `HybridReactNativeAppUpdateSpec`?")
46
45
  }
47
46
  #endif
48
47
  if let cxxWrapper = self.cxxWrapper {
49
48
  return cxxWrapper
50
49
  } else {
51
- let cxxWrapper = HybridReactNativeAppUpdateSpec_cxx(self as! HybridReactNativeAppUpdateSpec)
50
+ let cxxWrapper = HybridReactNativeAppUpdateSpec_cxx(self as! any HybridReactNativeAppUpdateSpec)
52
51
  self.cxxWrapper = cxxWrapper
53
52
  return cxxWrapper
54
53
  }
@@ -2,10 +2,9 @@
2
2
  /// HybridReactNativeAppUpdateSpec_cxx.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
- import Foundation
9
8
  import NitroModules
10
9
 
11
10
  /**
@@ -96,6 +95,14 @@ open class HybridReactNativeAppUpdateSpec_cxx {
96
95
  return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize
97
96
  }
98
97
 
98
+ /**
99
+ * Compares this object with the given [other] object for reference equality.
100
+ */
101
+ @inline(__always)
102
+ public func equals(other: HybridReactNativeAppUpdateSpec_cxx) -> Bool {
103
+ return self.__implementation === other.__implementation
104
+ }
105
+
99
106
  /**
100
107
  * Call dispose() on the Swift class.
101
108
  * This _may_ be called manually from JS.
@@ -2,7 +2,7 @@
2
2
  /// AppUpdateDownloadParams.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once
@@ -22,6 +22,11 @@
22
22
  #else
23
23
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
24
  #endif
25
+ #if __has_include(<NitroModules/PropNameIDCache.hpp>)
26
+ #include <NitroModules/PropNameIDCache.hpp>
27
+ #else
28
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
29
+ #endif
25
30
 
26
31
 
27
32
 
@@ -32,7 +37,7 @@ namespace margelo::nitro::reactnativeappupdate {
32
37
  /**
33
38
  * A struct which can be represented as a JavaScript object (AppUpdateDownloadParams).
34
39
  */
35
- struct AppUpdateDownloadParams {
40
+ struct AppUpdateDownloadParams final {
36
41
  public:
37
42
  std::string downloadUrl SWIFT_PRIVATE;
38
43
  std::string notificationTitle SWIFT_PRIVATE;
@@ -41,6 +46,9 @@ namespace margelo::nitro::reactnativeappupdate {
41
46
  public:
42
47
  AppUpdateDownloadParams() = default;
43
48
  explicit AppUpdateDownloadParams(std::string downloadUrl, std::string notificationTitle, double fileSize): downloadUrl(downloadUrl), notificationTitle(notificationTitle), fileSize(fileSize) {}
49
+
50
+ public:
51
+ friend bool operator==(const AppUpdateDownloadParams& lhs, const AppUpdateDownloadParams& rhs) = default;
44
52
  };
45
53
 
46
54
  } // namespace margelo::nitro::reactnativeappupdate
@@ -53,16 +61,16 @@ namespace margelo::nitro {
53
61
  static inline margelo::nitro::reactnativeappupdate::AppUpdateDownloadParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
54
62
  jsi::Object obj = arg.asObject(runtime);
55
63
  return margelo::nitro::reactnativeappupdate::AppUpdateDownloadParams(
56
- JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "downloadUrl")),
57
- JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "notificationTitle")),
58
- JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "fileSize"))
64
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "downloadUrl"))),
65
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "notificationTitle"))),
66
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "fileSize")))
59
67
  );
60
68
  }
61
69
  static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativeappupdate::AppUpdateDownloadParams& arg) {
62
70
  jsi::Object obj(runtime);
63
- obj.setProperty(runtime, "downloadUrl", JSIConverter<std::string>::toJSI(runtime, arg.downloadUrl));
64
- obj.setProperty(runtime, "notificationTitle", JSIConverter<std::string>::toJSI(runtime, arg.notificationTitle));
65
- obj.setProperty(runtime, "fileSize", JSIConverter<double>::toJSI(runtime, arg.fileSize));
71
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "downloadUrl"), JSIConverter<std::string>::toJSI(runtime, arg.downloadUrl));
72
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "notificationTitle"), JSIConverter<std::string>::toJSI(runtime, arg.notificationTitle));
73
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "fileSize"), JSIConverter<double>::toJSI(runtime, arg.fileSize));
66
74
  return obj;
67
75
  }
68
76
  static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
@@ -73,9 +81,9 @@ namespace margelo::nitro {
73
81
  if (!nitro::isPlainObject(runtime, obj)) {
74
82
  return false;
75
83
  }
76
- if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "downloadUrl"))) return false;
77
- if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "notificationTitle"))) return false;
78
- if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "fileSize"))) return false;
84
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "downloadUrl")))) return false;
85
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "notificationTitle")))) return false;
86
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "fileSize")))) return false;
79
87
  return true;
80
88
  }
81
89
  };
@@ -2,7 +2,7 @@
2
2
  /// AppUpdateFileParams.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once
@@ -22,6 +22,11 @@
22
22
  #else
23
23
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
24
  #endif
25
+ #if __has_include(<NitroModules/PropNameIDCache.hpp>)
26
+ #include <NitroModules/PropNameIDCache.hpp>
27
+ #else
28
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
29
+ #endif
25
30
 
26
31
 
27
32
 
@@ -32,13 +37,16 @@ namespace margelo::nitro::reactnativeappupdate {
32
37
  /**
33
38
  * A struct which can be represented as a JavaScript object (AppUpdateFileParams).
34
39
  */
35
- struct AppUpdateFileParams {
40
+ struct AppUpdateFileParams final {
36
41
  public:
37
42
  std::string downloadUrl SWIFT_PRIVATE;
38
43
 
39
44
  public:
40
45
  AppUpdateFileParams() = default;
41
46
  explicit AppUpdateFileParams(std::string downloadUrl): downloadUrl(downloadUrl) {}
47
+
48
+ public:
49
+ friend bool operator==(const AppUpdateFileParams& lhs, const AppUpdateFileParams& rhs) = default;
42
50
  };
43
51
 
44
52
  } // namespace margelo::nitro::reactnativeappupdate
@@ -51,12 +59,12 @@ namespace margelo::nitro {
51
59
  static inline margelo::nitro::reactnativeappupdate::AppUpdateFileParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
52
60
  jsi::Object obj = arg.asObject(runtime);
53
61
  return margelo::nitro::reactnativeappupdate::AppUpdateFileParams(
54
- JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "downloadUrl"))
62
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "downloadUrl")))
55
63
  );
56
64
  }
57
65
  static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativeappupdate::AppUpdateFileParams& arg) {
58
66
  jsi::Object obj(runtime);
59
- obj.setProperty(runtime, "downloadUrl", JSIConverter<std::string>::toJSI(runtime, arg.downloadUrl));
67
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "downloadUrl"), JSIConverter<std::string>::toJSI(runtime, arg.downloadUrl));
60
68
  return obj;
61
69
  }
62
70
  static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
@@ -67,7 +75,7 @@ namespace margelo::nitro {
67
75
  if (!nitro::isPlainObject(runtime, obj)) {
68
76
  return false;
69
77
  }
70
- if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "downloadUrl"))) return false;
78
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "downloadUrl")))) return false;
71
79
  return true;
72
80
  }
73
81
  };
@@ -2,7 +2,7 @@
2
2
  /// DownloadEvent.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once
@@ -22,6 +22,11 @@
22
22
  #else
23
23
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
24
  #endif
25
+ #if __has_include(<NitroModules/PropNameIDCache.hpp>)
26
+ #include <NitroModules/PropNameIDCache.hpp>
27
+ #else
28
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
29
+ #endif
25
30
 
26
31
 
27
32
 
@@ -32,7 +37,7 @@ namespace margelo::nitro::reactnativeappupdate {
32
37
  /**
33
38
  * A struct which can be represented as a JavaScript object (DownloadEvent).
34
39
  */
35
- struct DownloadEvent {
40
+ struct DownloadEvent final {
36
41
  public:
37
42
  std::string type SWIFT_PRIVATE;
38
43
  double progress SWIFT_PRIVATE;
@@ -41,6 +46,9 @@ namespace margelo::nitro::reactnativeappupdate {
41
46
  public:
42
47
  DownloadEvent() = default;
43
48
  explicit DownloadEvent(std::string type, double progress, std::string message): type(type), progress(progress), message(message) {}
49
+
50
+ public:
51
+ friend bool operator==(const DownloadEvent& lhs, const DownloadEvent& rhs) = default;
44
52
  };
45
53
 
46
54
  } // namespace margelo::nitro::reactnativeappupdate
@@ -53,16 +61,16 @@ namespace margelo::nitro {
53
61
  static inline margelo::nitro::reactnativeappupdate::DownloadEvent fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
54
62
  jsi::Object obj = arg.asObject(runtime);
55
63
  return margelo::nitro::reactnativeappupdate::DownloadEvent(
56
- JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "type")),
57
- JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "progress")),
58
- JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "message"))
64
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "type"))),
65
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "progress"))),
66
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "message")))
59
67
  );
60
68
  }
61
69
  static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativeappupdate::DownloadEvent& arg) {
62
70
  jsi::Object obj(runtime);
63
- obj.setProperty(runtime, "type", JSIConverter<std::string>::toJSI(runtime, arg.type));
64
- obj.setProperty(runtime, "progress", JSIConverter<double>::toJSI(runtime, arg.progress));
65
- obj.setProperty(runtime, "message", JSIConverter<std::string>::toJSI(runtime, arg.message));
71
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "type"), JSIConverter<std::string>::toJSI(runtime, arg.type));
72
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "progress"), JSIConverter<double>::toJSI(runtime, arg.progress));
73
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "message"), JSIConverter<std::string>::toJSI(runtime, arg.message));
66
74
  return obj;
67
75
  }
68
76
  static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
@@ -73,9 +81,9 @@ namespace margelo::nitro {
73
81
  if (!nitro::isPlainObject(runtime, obj)) {
74
82
  return false;
75
83
  }
76
- if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "type"))) return false;
77
- if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "progress"))) return false;
78
- if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "message"))) return false;
84
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "type")))) return false;
85
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "progress")))) return false;
86
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "message")))) return false;
79
87
  return true;
80
88
  }
81
89
  };
@@ -2,7 +2,7 @@
2
2
  /// HybridReactNativeAppUpdateSpec.cpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #include "HybridReactNativeAppUpdateSpec.hpp"
@@ -2,7 +2,7 @@
2
2
  /// HybridReactNativeAppUpdateSpec.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/react-native-app-update",
3
- "version": "3.0.81-alpha.8",
3
+ "version": "3.0.82",
4
4
  "description": "react-native-app-update",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -78,12 +78,12 @@
78
78
  "eslint-plugin-prettier": "^5.5.4",
79
79
  "jest": "^29.7.0",
80
80
  "lefthook": "^2.0.3",
81
- "nitrogen": "0.31.10",
81
+ "nitrogen": "0.35.2",
82
82
  "prettier": "^2.8.8",
83
83
  "react": "19.2.0",
84
84
  "react-native": "patch:react-native@npm%3A0.83.0#~/.yarn/patches/react-native-npm-0.83.0-577d0f2d83.patch",
85
85
  "react-native-builder-bob": "^0.40.13",
86
- "react-native-nitro-modules": "0.33.2",
86
+ "react-native-nitro-modules": "0.35.2",
87
87
  "release-it": "^19.0.4",
88
88
  "turbo": "^2.5.6",
89
89
  "typescript": "^5.9.2"
@@ -91,7 +91,7 @@
91
91
  "peerDependencies": {
92
92
  "react": "*",
93
93
  "react-native": "*",
94
- "react-native-nitro-modules": "0.33.2"
94
+ "react-native-nitro-modules": "0.35.2"
95
95
  },
96
96
  "react-native-builder-bob": {
97
97
  "source": "src",
@@ -166,6 +166,5 @@
166
166
  "release-it"
167
167
  ],
168
168
  "version": "0.56.0"
169
- },
170
- "stableVersion": "3.0.80"
169
+ }
171
170
  }