@onekeyfe/react-native-zip-archive 3.0.81 → 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 (25) hide show
  1. package/nitrogen/generated/android/c++/JHybridReactNativeZipArchiveSpec.cpp +26 -25
  2. package/nitrogen/generated/android/c++/JHybridReactNativeZipArchiveSpec.hpp +20 -22
  3. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeziparchive/HybridReactNativeZipArchiveSpec.kt +16 -19
  4. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeziparchive/reactnativeziparchiveOnLoad.kt +1 -1
  5. package/nitrogen/generated/android/reactnativeziparchive+autolinking.cmake +1 -1
  6. package/nitrogen/generated/android/reactnativeziparchive+autolinking.gradle +1 -1
  7. package/nitrogen/generated/android/reactnativeziparchiveOnLoad.cpp +27 -17
  8. package/nitrogen/generated/android/reactnativeziparchiveOnLoad.hpp +14 -5
  9. package/nitrogen/generated/ios/ReactNativeZipArchive+autolinking.rb +2 -2
  10. package/nitrogen/generated/ios/ReactNativeZipArchive-Swift-Cxx-Bridge.cpp +1 -1
  11. package/nitrogen/generated/ios/ReactNativeZipArchive-Swift-Cxx-Bridge.hpp +1 -1
  12. package/nitrogen/generated/ios/ReactNativeZipArchive-Swift-Cxx-Umbrella.hpp +1 -1
  13. package/nitrogen/generated/ios/ReactNativeZipArchiveAutolinking.mm +1 -1
  14. package/nitrogen/generated/ios/ReactNativeZipArchiveAutolinking.swift +9 -8
  15. package/nitrogen/generated/ios/c++/HybridReactNativeZipArchiveSpecSwift.cpp +1 -1
  16. package/nitrogen/generated/ios/c++/HybridReactNativeZipArchiveSpecSwift.hpp +7 -1
  17. package/nitrogen/generated/ios/swift/Func_void_bool.swift +1 -2
  18. package/nitrogen/generated/ios/swift/Func_void_double.swift +1 -2
  19. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +1 -2
  20. package/nitrogen/generated/ios/swift/Func_void_std__string.swift +1 -2
  21. package/nitrogen/generated/ios/swift/HybridReactNativeZipArchiveSpec.swift +3 -4
  22. package/nitrogen/generated/ios/swift/HybridReactNativeZipArchiveSpec_cxx.swift +9 -2
  23. package/nitrogen/generated/shared/c++/HybridReactNativeZipArchiveSpec.cpp +1 -1
  24. package/nitrogen/generated/shared/c++/HybridReactNativeZipArchiveSpec.hpp +1 -1
  25. package/package.json +4 -4
@@ -2,7 +2,7 @@
2
2
  /// JHybridReactNativeZipArchiveSpec.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 "JHybridReactNativeZipArchiveSpec.hpp"
@@ -16,30 +16,31 @@
16
16
 
17
17
  namespace margelo::nitro::reactnativeziparchive {
18
18
 
19
- jni::local_ref<JHybridReactNativeZipArchiveSpec::jhybriddata> JHybridReactNativeZipArchiveSpec::initHybrid(jni::alias_ref<jhybridobject> jThis) {
20
- return makeCxxInstance(jThis);
21
- }
22
-
23
- void JHybridReactNativeZipArchiveSpec::registerNatives() {
24
- registerHybrid({
25
- makeNativeMethod("initHybrid", JHybridReactNativeZipArchiveSpec::initHybrid),
26
- });
19
+ std::shared_ptr<JHybridReactNativeZipArchiveSpec> JHybridReactNativeZipArchiveSpec::JavaPart::getJHybridReactNativeZipArchiveSpec() {
20
+ auto hybridObject = JHybridObject::JavaPart::getJHybridObject();
21
+ auto castHybridObject = std::dynamic_pointer_cast<JHybridReactNativeZipArchiveSpec>(hybridObject);
22
+ if (castHybridObject == nullptr) [[unlikely]] {
23
+ throw std::runtime_error("Failed to downcast JHybridObject to JHybridReactNativeZipArchiveSpec!");
24
+ }
25
+ return castHybridObject;
27
26
  }
28
27
 
29
- size_t JHybridReactNativeZipArchiveSpec::getExternalMemorySize() noexcept {
30
- static const auto method = javaClassStatic()->getMethod<jlong()>("getMemorySize");
31
- return method(_javaPart);
28
+ jni::local_ref<JHybridReactNativeZipArchiveSpec::CxxPart::jhybriddata> JHybridReactNativeZipArchiveSpec::CxxPart::initHybrid(jni::alias_ref<jhybridobject> jThis) {
29
+ return makeCxxInstance(jThis);
32
30
  }
33
31
 
34
- void JHybridReactNativeZipArchiveSpec::dispose() noexcept {
35
- static const auto method = javaClassStatic()->getMethod<void()>("dispose");
36
- method(_javaPart);
32
+ std::shared_ptr<JHybridObject> JHybridReactNativeZipArchiveSpec::CxxPart::createHybridObject(const jni::local_ref<JHybridObject::JavaPart>& javaPart) {
33
+ auto castJavaPart = jni::dynamic_ref_cast<JHybridReactNativeZipArchiveSpec::JavaPart>(javaPart);
34
+ if (castJavaPart == nullptr) [[unlikely]] {
35
+ throw std::runtime_error("Failed to cast JHybridObject::JavaPart to JHybridReactNativeZipArchiveSpec::JavaPart!");
36
+ }
37
+ return std::make_shared<JHybridReactNativeZipArchiveSpec>(castJavaPart);
37
38
  }
38
39
 
39
- std::string JHybridReactNativeZipArchiveSpec::toString() {
40
- static const auto method = javaClassStatic()->getMethod<jni::JString()>("toString");
41
- auto javaString = method(_javaPart);
42
- return javaString->toStdString();
40
+ void JHybridReactNativeZipArchiveSpec::CxxPart::registerNatives() {
41
+ registerHybrid({
42
+ makeNativeMethod("initHybrid", JHybridReactNativeZipArchiveSpec::CxxPart::initHybrid),
43
+ });
43
44
  }
44
45
 
45
46
  // Properties
@@ -47,7 +48,7 @@ namespace margelo::nitro::reactnativeziparchive {
47
48
 
48
49
  // Methods
49
50
  std::shared_ptr<Promise<bool>> JHybridReactNativeZipArchiveSpec::isPasswordProtected(const std::string& file) {
50
- static const auto method = javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<jni::JString> /* file */)>("isPasswordProtected");
51
+ static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<jni::JString> /* file */)>("isPasswordProtected");
51
52
  auto __result = method(_javaPart, jni::make_jstring(file));
52
53
  return [&]() {
53
54
  auto __promise = Promise<bool>::create();
@@ -63,7 +64,7 @@ namespace margelo::nitro::reactnativeziparchive {
63
64
  }();
64
65
  }
65
66
  std::shared_ptr<Promise<std::string>> JHybridReactNativeZipArchiveSpec::unzip(const std::string& from, const std::string& to) {
66
- static const auto method = javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<jni::JString> /* from */, jni::alias_ref<jni::JString> /* to */)>("unzip");
67
+ static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<jni::JString> /* from */, jni::alias_ref<jni::JString> /* to */)>("unzip");
67
68
  auto __result = method(_javaPart, jni::make_jstring(from), jni::make_jstring(to));
68
69
  return [&]() {
69
70
  auto __promise = Promise<std::string>::create();
@@ -79,7 +80,7 @@ namespace margelo::nitro::reactnativeziparchive {
79
80
  }();
80
81
  }
81
82
  std::shared_ptr<Promise<std::string>> JHybridReactNativeZipArchiveSpec::unzipWithPassword(const std::string& from, const std::string& to, const std::string& password) {
82
- static const auto method = javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<jni::JString> /* from */, jni::alias_ref<jni::JString> /* to */, jni::alias_ref<jni::JString> /* password */)>("unzipWithPassword");
83
+ static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<jni::JString> /* from */, jni::alias_ref<jni::JString> /* to */, jni::alias_ref<jni::JString> /* password */)>("unzipWithPassword");
83
84
  auto __result = method(_javaPart, jni::make_jstring(from), jni::make_jstring(to), jni::make_jstring(password));
84
85
  return [&]() {
85
86
  auto __promise = Promise<std::string>::create();
@@ -95,7 +96,7 @@ namespace margelo::nitro::reactnativeziparchive {
95
96
  }();
96
97
  }
97
98
  std::shared_ptr<Promise<std::string>> JHybridReactNativeZipArchiveSpec::zipFolder(const std::string& from, const std::string& to) {
98
- static const auto method = javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<jni::JString> /* from */, jni::alias_ref<jni::JString> /* to */)>("zipFolder");
99
+ static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<jni::JString> /* from */, jni::alias_ref<jni::JString> /* to */)>("zipFolder");
99
100
  auto __result = method(_javaPart, jni::make_jstring(from), jni::make_jstring(to));
100
101
  return [&]() {
101
102
  auto __promise = Promise<std::string>::create();
@@ -111,7 +112,7 @@ namespace margelo::nitro::reactnativeziparchive {
111
112
  }();
112
113
  }
113
114
  std::shared_ptr<Promise<std::string>> JHybridReactNativeZipArchiveSpec::zipFiles(const std::vector<std::string>& files, const std::string& to) {
114
- static const auto method = javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<jni::JArrayClass<jni::JString>> /* files */, jni::alias_ref<jni::JString> /* to */)>("zipFiles");
115
+ static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<jni::JArrayClass<jni::JString>> /* files */, jni::alias_ref<jni::JString> /* to */)>("zipFiles");
115
116
  auto __result = method(_javaPart, [&]() {
116
117
  size_t __size = files.size();
117
118
  jni::local_ref<jni::JArrayClass<jni::JString>> __array = jni::JArrayClass<jni::JString>::newArray(__size);
@@ -136,7 +137,7 @@ namespace margelo::nitro::reactnativeziparchive {
136
137
  }();
137
138
  }
138
139
  std::shared_ptr<Promise<double>> JHybridReactNativeZipArchiveSpec::getUncompressedSize(const std::string& path) {
139
- static const auto method = javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<jni::JString> /* path */)>("getUncompressedSize");
140
+ static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<jni::JString> /* path */)>("getUncompressedSize");
140
141
  auto __result = method(_javaPart, jni::make_jstring(path));
141
142
  return [&]() {
142
143
  auto __promise = Promise<double>::create();
@@ -2,7 +2,7 @@
2
2
  /// HybridReactNativeZipArchiveSpec.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::reactnativeziparchive {
18
18
 
19
19
  using namespace facebook;
20
20
 
21
- class JHybridReactNativeZipArchiveSpec: public jni::HybridClass<JHybridReactNativeZipArchiveSpec, JHybridObject>,
22
- public virtual HybridReactNativeZipArchiveSpec {
21
+ class JHybridReactNativeZipArchiveSpec: public virtual HybridReactNativeZipArchiveSpec, public virtual JHybridObject {
23
22
  public:
24
- static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativeziparchive/HybridReactNativeZipArchiveSpec;";
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 JHybridReactNativeZipArchiveSpec(jni::alias_ref<jhybridobject> jThis) :
31
- HybridObject(HybridReactNativeZipArchiveSpec::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/reactnativeziparchive/HybridReactNativeZipArchiveSpec;";
25
+ std::shared_ptr<JHybridReactNativeZipArchiveSpec> getJHybridReactNativeZipArchiveSpec();
26
+ };
27
+ struct CxxPart: public jni::HybridClass<CxxPart, JHybridObject::CxxPart> {
28
+ static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/reactnativeziparchive/HybridReactNativeZipArchiveSpec$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 JHybridReactNativeZipArchiveSpec(const jni::local_ref<JHybridReactNativeZipArchiveSpec::JavaPart>& javaPart):
38
+ HybridObject(HybridReactNativeZipArchiveSpec::TAG),
39
+ JHybridObject(javaPart),
40
+ _javaPart(jni::make_global(javaPart)) {}
36
41
  ~JHybridReactNativeZipArchiveSpec() 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<JHybridReactNativeZipArchiveSpec::javaobject>& getJavaPart() const noexcept {
47
+ inline const jni::global_ref<JHybridReactNativeZipArchiveSpec::JavaPart>& getJavaPart() const noexcept {
48
48
  return _javaPart;
49
49
  }
50
50
 
@@ -62,9 +62,7 @@ namespace margelo::nitro::reactnativeziparchive {
62
62
  std::shared_ptr<Promise<double>> getUncompressedSize(const std::string& path) override;
63
63
 
64
64
  private:
65
- friend HybridBase;
66
- using HybridBase::HybridBase;
67
- jni::global_ref<JHybridReactNativeZipArchiveSpec::javaobject> _javaPart;
65
+ jni::global_ref<JHybridReactNativeZipArchiveSpec::JavaPart> _javaPart;
68
66
  };
69
67
 
70
68
  } // namespace margelo::nitro::reactnativeziparchive
@@ -2,7 +2,7 @@
2
2
  /// HybridReactNativeZipArchiveSpec.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.reactnativeziparchive
@@ -25,23 +25,6 @@ import com.margelo.nitro.core.HybridObject
25
25
  "LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName"
26
26
  )
27
27
  abstract class HybridReactNativeZipArchiveSpec: 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 ReactNativeZipArchive]"
43
- }
44
-
45
28
  // Properties
46
29
 
47
30
 
@@ -70,7 +53,21 @@ abstract class HybridReactNativeZipArchiveSpec: HybridObject() {
70
53
  @Keep
71
54
  abstract fun getUncompressedSize(path: String): Promise<Double>
72
55
 
73
- private external fun initHybrid(): HybridData
56
+ // Default implementation of `HybridObject.toString()`
57
+ override fun toString(): String {
58
+ return "[HybridObject ReactNativeZipArchive]"
59
+ }
60
+
61
+ // C++ backing class
62
+ @DoNotStrip
63
+ @Keep
64
+ protected open class CxxPart(javaPart: HybridReactNativeZipArchiveSpec): HybridObject.CxxPart(javaPart) {
65
+ // C++ JHybridReactNativeZipArchiveSpec::CxxPart::initHybrid(...)
66
+ external override fun initHybrid(): HybridData
67
+ }
68
+ override fun createCxxPart(): CxxPart {
69
+ return CxxPart(this)
70
+ }
74
71
 
75
72
  companion object {
76
73
  protected const val TAG = "HybridReactNativeZipArchiveSpec"
@@ -2,7 +2,7 @@
2
2
  /// reactnativeziparchiveOnLoad.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.reactnativeziparchive
@@ -2,7 +2,7 @@
2
2
  # reactnativeziparchive+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
  /// reactnativeziparchive+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
  /// reactnativeziparchiveOnLoad.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_REACTNATIVEZIPARCHIVE_WITH_GENERATED_CMAKE_PROJECT
@@ -21,24 +21,34 @@
21
21
  namespace margelo::nitro::reactnativeziparchive {
22
22
 
23
23
  int initialize(JavaVM* vm) {
24
+ return facebook::jni::initialize(vm, []() {
25
+ ::margelo::nitro::reactnativeziparchive::registerAllNatives();
26
+ });
27
+ }
28
+
29
+ struct JHybridReactNativeZipArchiveSpecImpl: public jni::JavaClass<JHybridReactNativeZipArchiveSpecImpl, JHybridReactNativeZipArchiveSpec::JavaPart> {
30
+ static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/reactnativeziparchive/ReactNativeZipArchive;";
31
+ static std::shared_ptr<JHybridReactNativeZipArchiveSpec> create() {
32
+ static const auto constructorFn = javaClassStatic()->getConstructor<JHybridReactNativeZipArchiveSpecImpl::javaobject()>();
33
+ jni::local_ref<JHybridReactNativeZipArchiveSpec::JavaPart> javaPart = javaClassStatic()->newObject(constructorFn);
34
+ return javaPart->getJHybridReactNativeZipArchiveSpec();
35
+ }
36
+ };
37
+
38
+ void registerAllNatives() {
24
39
  using namespace margelo::nitro;
25
40
  using namespace margelo::nitro::reactnativeziparchive;
26
- using namespace facebook;
27
-
28
- return facebook::jni::initialize(vm, [] {
29
- // Register native JNI methods
30
- margelo::nitro::reactnativeziparchive::JHybridReactNativeZipArchiveSpec::registerNatives();
31
-
32
- // Register Nitro Hybrid Objects
33
- HybridObjectRegistry::registerHybridObjectConstructor(
34
- "ReactNativeZipArchive",
35
- []() -> std::shared_ptr<HybridObject> {
36
- static DefaultConstructableObject<JHybridReactNativeZipArchiveSpec::javaobject> object("com/margelo/nitro/reactnativeziparchive/ReactNativeZipArchive");
37
- auto instance = object.create();
38
- return instance->cthis()->shared();
39
- }
40
- );
41
- });
41
+
42
+ // Register native JNI methods
43
+ margelo::nitro::reactnativeziparchive::JHybridReactNativeZipArchiveSpec::CxxPart::registerNatives();
44
+
45
+ // Register Nitro Hybrid Objects
46
+ HybridObjectRegistry::registerHybridObjectConstructor(
47
+ "ReactNativeZipArchive",
48
+ []() -> std::shared_ptr<HybridObject> {
49
+ return JHybridReactNativeZipArchiveSpecImpl::create();
50
+ }
51
+ );
42
52
  }
43
53
 
44
54
  } // namespace margelo::nitro::reactnativeziparchive
@@ -2,24 +2,33 @@
2
2
  /// reactnativeziparchiveOnLoad.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::reactnativeziparchive {
12
13
 
14
+ [[deprecated("Use registerNatives() instead.")]]
15
+ int initialize(JavaVM* vm);
16
+
13
17
  /**
14
- * Initializes the native (C++) part of reactnativeziparchive, 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 reactnativeziparchive, 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::reactnativeziparchive::initialize(vm);
24
+ * return facebook::jni::initialize(vm, []() {
25
+ * // register all reactnativeziparchive HybridObjects
26
+ * margelo::nitro::reactnativeziparchive::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::reactnativeziparchive
@@ -2,7 +2,7 @@
2
2
  # ReactNativeZipArchive+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
  /// ReactNativeZipArchive-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 "ReactNativeZipArchive-Swift-Cxx-Bridge.hpp"
@@ -2,7 +2,7 @@
2
2
  /// ReactNativeZipArchive-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
  /// ReactNativeZipArchive-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
  /// ReactNativeZipArchiveAutolinking.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
  /// ReactNativeZipArchiveAutolinking.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 ReactNativeZipArchiveAutolinking {
9
13
  public typealias bridge = margelo.nitro.reactnativeziparchive.bridge.swift
10
14
 
11
- /**
12
- * Creates an instance of a Swift class that implements `HybridReactNativeZipArchiveSpec`,
13
- * and wraps it in a Swift class that can directly interop with C++ (`HybridReactNativeZipArchiveSpec_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, `ReactNativeZipArchive`).
17
- */
18
15
  public static func createReactNativeZipArchive() -> bridge.std__shared_ptr_HybridReactNativeZipArchiveSpec_ {
19
16
  let hybridObject = ReactNativeZipArchive()
20
17
  return { () -> bridge.std__shared_ptr_HybridReactNativeZipArchiveSpec_ in
@@ -22,4 +19,8 @@ public final class ReactNativeZipArchiveAutolinking {
22
19
  return __cxxWrapped.getCxxPart()
23
20
  }()
24
21
  }
22
+
23
+ public static func isReactNativeZipArchiveRecyclable() -> Bool {
24
+ return ReactNativeZipArchive.self is any RecyclableView.Type
25
+ }
25
26
  }
@@ -2,7 +2,7 @@
2
2
  /// HybridReactNativeZipArchiveSpecSwift.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 "HybridReactNativeZipArchiveSpecSwift.hpp"
@@ -2,7 +2,7 @@
2
2
  /// HybridReactNativeZipArchiveSpecSwift.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
@@ -49,6 +49,12 @@ namespace margelo::nitro::reactnativeziparchive {
49
49
  inline size_t getExternalMemorySize() noexcept override {
50
50
  return _swiftPart.getMemorySize();
51
51
  }
52
+ bool equals(const std::shared_ptr<HybridObject>& other) override {
53
+ if (auto otherCast = std::dynamic_pointer_cast<HybridReactNativeZipArchiveSpecSwift>(other)) {
54
+ return _swiftPart.equals(otherCast->_swiftPart);
55
+ }
56
+ return false;
57
+ }
52
58
  void dispose() noexcept override {
53
59
  _swiftPart.dispose();
54
60
  }
@@ -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_double.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
  /// Func_void_std__string.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
  /// HybridReactNativeZipArchiveSpec.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 ``HybridReactNativeZipArchiveSpec``
@@ -35,14 +34,14 @@ open class HybridReactNativeZipArchiveSpec_base {
35
34
  public init() { }
36
35
  public func getCxxWrapper() -> HybridReactNativeZipArchiveSpec_cxx {
37
36
  #if DEBUG
38
- guard self is HybridReactNativeZipArchiveSpec else {
37
+ guard self is any HybridReactNativeZipArchiveSpec else {
39
38
  fatalError("`self` is not a `HybridReactNativeZipArchiveSpec`! Did you accidentally inherit from `HybridReactNativeZipArchiveSpec_base` instead of `HybridReactNativeZipArchiveSpec`?")
40
39
  }
41
40
  #endif
42
41
  if let cxxWrapper = self.cxxWrapper {
43
42
  return cxxWrapper
44
43
  } else {
45
- let cxxWrapper = HybridReactNativeZipArchiveSpec_cxx(self as! HybridReactNativeZipArchiveSpec)
44
+ let cxxWrapper = HybridReactNativeZipArchiveSpec_cxx(self as! any HybridReactNativeZipArchiveSpec)
46
45
  self.cxxWrapper = cxxWrapper
47
46
  return cxxWrapper
48
47
  }
@@ -2,10 +2,9 @@
2
2
  /// HybridReactNativeZipArchiveSpec_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 HybridReactNativeZipArchiveSpec_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: HybridReactNativeZipArchiveSpec_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
  /// HybridReactNativeZipArchiveSpec.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 "HybridReactNativeZipArchiveSpec.hpp"
@@ -2,7 +2,7 @@
2
2
  /// HybridReactNativeZipArchiveSpec.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-zip-archive",
3
- "version": "3.0.81",
3
+ "version": "3.0.82",
4
4
  "description": "react-native-zip-archive Nitro HybridObject for OneKey",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -59,15 +59,15 @@
59
59
  "peerDependencies": {
60
60
  "react": "*",
61
61
  "react-native": "*",
62
- "react-native-nitro-modules": "0.33.2"
62
+ "react-native-nitro-modules": "0.35.2"
63
63
  },
64
64
  "devDependencies": {
65
65
  "@react-native/babel-preset": "0.83.0",
66
- "nitrogen": "0.31.10",
66
+ "nitrogen": "0.35.2",
67
67
  "react": "19.2.0",
68
68
  "react-native": "patch:react-native@npm%3A0.83.0#~/.yarn/patches/react-native-npm-0.83.0-577d0f2d83.patch",
69
69
  "react-native-builder-bob": "^0.40.17",
70
- "react-native-nitro-modules": "0.33.2",
70
+ "react-native-nitro-modules": "0.35.2",
71
71
  "typescript": "^5.9.2"
72
72
  },
73
73
  "react-native-builder-bob": {