@onekeyfe/react-native-keychain-module 3.0.81 → 3.0.85
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.
- package/nitrogen/generated/android/c++/JGetItemParams.hpp +2 -2
- package/nitrogen/generated/android/c++/JGetItemResult.hpp +2 -2
- package/nitrogen/generated/android/c++/JHasItemParams.hpp +2 -2
- package/nitrogen/generated/android/c++/JHybridKeychainModuleSpec.cpp +26 -24
- package/nitrogen/generated/android/c++/JHybridKeychainModuleSpec.hpp +20 -22
- package/nitrogen/generated/android/c++/JRemoveItemParams.hpp +2 -2
- package/nitrogen/generated/android/c++/JSetItemParams.hpp +2 -2
- package/nitrogen/generated/android/c++/JVariant_NullType_GetItemResult.cpp +1 -1
- package/nitrogen/generated/android/c++/JVariant_NullType_GetItemResult.hpp +6 -6
- package/nitrogen/generated/android/keychainmodule+autolinking.cmake +1 -1
- package/nitrogen/generated/android/keychainmodule+autolinking.gradle +1 -1
- package/nitrogen/generated/android/keychainmoduleOnLoad.cpp +27 -17
- package/nitrogen/generated/android/keychainmoduleOnLoad.hpp +14 -5
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/GetItemParams.kt +2 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/GetItemResult.kt +2 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/HasItemParams.kt +2 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/HybridKeychainModuleSpec.kt +16 -19
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/RemoveItemParams.kt +2 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/SetItemParams.kt +2 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/Variant_NullType_GetItemResult.kt +1 -7
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/keychainmoduleOnLoad.kt +1 -1
- package/nitrogen/generated/ios/KeychainModule+autolinking.rb +2 -2
- package/nitrogen/generated/ios/KeychainModule-Swift-Cxx-Bridge.cpp +1 -1
- package/nitrogen/generated/ios/KeychainModule-Swift-Cxx-Bridge.hpp +4 -4
- package/nitrogen/generated/ios/KeychainModule-Swift-Cxx-Umbrella.hpp +1 -1
- package/nitrogen/generated/ios/KeychainModuleAutolinking.mm +1 -1
- package/nitrogen/generated/ios/KeychainModuleAutolinking.swift +9 -8
- package/nitrogen/generated/ios/c++/HybridKeychainModuleSpecSwift.cpp +1 -1
- package/nitrogen/generated/ios/c++/HybridKeychainModuleSpecSwift.hpp +7 -1
- package/nitrogen/generated/ios/swift/Func_void.swift +1 -2
- package/nitrogen/generated/ios/swift/Func_void_bool.swift +1 -2
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +1 -2
- package/nitrogen/generated/ios/swift/Func_void_std__variant_nitro__NullType__GetItemResult_.swift +1 -2
- package/nitrogen/generated/ios/swift/GetItemParams.swift +3 -10
- package/nitrogen/generated/ios/swift/GetItemResult.swift +5 -18
- package/nitrogen/generated/ios/swift/HasItemParams.swift +3 -10
- package/nitrogen/generated/ios/swift/HybridKeychainModuleSpec.swift +3 -4
- package/nitrogen/generated/ios/swift/HybridKeychainModuleSpec_cxx.swift +9 -2
- package/nitrogen/generated/ios/swift/RemoveItemParams.swift +3 -10
- package/nitrogen/generated/ios/swift/SetItemParams.swift +32 -81
- package/nitrogen/generated/ios/swift/Variant_NullType_GetItemResult.swift +1 -1
- package/nitrogen/generated/shared/c++/GetItemParams.hpp +13 -5
- package/nitrogen/generated/shared/c++/GetItemResult.hpp +16 -8
- package/nitrogen/generated/shared/c++/HasItemParams.hpp +13 -5
- package/nitrogen/generated/shared/c++/HybridKeychainModuleSpec.cpp +1 -1
- package/nitrogen/generated/shared/c++/HybridKeychainModuleSpec.hpp +1 -1
- package/nitrogen/generated/shared/c++/RemoveItemParams.hpp +13 -5
- package/nitrogen/generated/shared/c++/SetItemParams.hpp +25 -17
- package/package.json +4 -4
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// JGetItemParams.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -21,7 +21,7 @@ namespace margelo::nitro::keychainmodule {
|
|
|
21
21
|
*/
|
|
22
22
|
struct JGetItemParams final: public jni::JavaClass<JGetItemParams> {
|
|
23
23
|
public:
|
|
24
|
-
static auto
|
|
24
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/keychainmodule/GetItemParams;";
|
|
25
25
|
|
|
26
26
|
public:
|
|
27
27
|
/**
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// JGetItemResult.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -21,7 +21,7 @@ namespace margelo::nitro::keychainmodule {
|
|
|
21
21
|
*/
|
|
22
22
|
struct JGetItemResult final: public jni::JavaClass<JGetItemResult> {
|
|
23
23
|
public:
|
|
24
|
-
static auto
|
|
24
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/keychainmodule/GetItemResult;";
|
|
25
25
|
|
|
26
26
|
public:
|
|
27
27
|
/**
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// JHasItemParams.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -21,7 +21,7 @@ namespace margelo::nitro::keychainmodule {
|
|
|
21
21
|
*/
|
|
22
22
|
struct JHasItemParams final: public jni::JavaClass<JHasItemParams> {
|
|
23
23
|
public:
|
|
24
|
-
static auto
|
|
24
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/keychainmodule/HasItemParams;";
|
|
25
25
|
|
|
26
26
|
public:
|
|
27
27
|
/**
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// JHybridKeychainModuleSpec.cpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#include "JHybridKeychainModuleSpec.hpp"
|
|
@@ -20,6 +20,7 @@ namespace margelo::nitro::keychainmodule { struct HasItemParams; }
|
|
|
20
20
|
|
|
21
21
|
#include <NitroModules/Promise.hpp>
|
|
22
22
|
#include <NitroModules/JPromise.hpp>
|
|
23
|
+
#include <NitroModules/JUnit.hpp>
|
|
23
24
|
#include <NitroModules/Null.hpp>
|
|
24
25
|
#include "GetItemResult.hpp"
|
|
25
26
|
#include <variant>
|
|
@@ -39,30 +40,31 @@ namespace margelo::nitro::keychainmodule { struct HasItemParams; }
|
|
|
39
40
|
|
|
40
41
|
namespace margelo::nitro::keychainmodule {
|
|
41
42
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
});
|
|
43
|
+
std::shared_ptr<JHybridKeychainModuleSpec> JHybridKeychainModuleSpec::JavaPart::getJHybridKeychainModuleSpec() {
|
|
44
|
+
auto hybridObject = JHybridObject::JavaPart::getJHybridObject();
|
|
45
|
+
auto castHybridObject = std::dynamic_pointer_cast<JHybridKeychainModuleSpec>(hybridObject);
|
|
46
|
+
if (castHybridObject == nullptr) [[unlikely]] {
|
|
47
|
+
throw std::runtime_error("Failed to downcast JHybridObject to JHybridKeychainModuleSpec!");
|
|
48
|
+
}
|
|
49
|
+
return castHybridObject;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
return method(_javaPart);
|
|
52
|
+
jni::local_ref<JHybridKeychainModuleSpec::CxxPart::jhybriddata> JHybridKeychainModuleSpec::CxxPart::initHybrid(jni::alias_ref<jhybridobject> jThis) {
|
|
53
|
+
return makeCxxInstance(jThis);
|
|
55
54
|
}
|
|
56
55
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
std::shared_ptr<JHybridObject> JHybridKeychainModuleSpec::CxxPart::createHybridObject(const jni::local_ref<JHybridObject::JavaPart>& javaPart) {
|
|
57
|
+
auto castJavaPart = jni::dynamic_ref_cast<JHybridKeychainModuleSpec::JavaPart>(javaPart);
|
|
58
|
+
if (castJavaPart == nullptr) [[unlikely]] {
|
|
59
|
+
throw std::runtime_error("Failed to cast JHybridObject::JavaPart to JHybridKeychainModuleSpec::JavaPart!");
|
|
60
|
+
}
|
|
61
|
+
return std::make_shared<JHybridKeychainModuleSpec>(castJavaPart);
|
|
60
62
|
}
|
|
61
63
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
void JHybridKeychainModuleSpec::CxxPart::registerNatives() {
|
|
65
|
+
registerHybrid({
|
|
66
|
+
makeNativeMethod("initHybrid", JHybridKeychainModuleSpec::CxxPart::initHybrid),
|
|
67
|
+
});
|
|
66
68
|
}
|
|
67
69
|
|
|
68
70
|
// Properties
|
|
@@ -70,7 +72,7 @@ namespace margelo::nitro::keychainmodule {
|
|
|
70
72
|
|
|
71
73
|
// Methods
|
|
72
74
|
std::shared_ptr<Promise<void>> JHybridKeychainModuleSpec::setItem(const SetItemParams& params) {
|
|
73
|
-
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<JSetItemParams> /* params */)>("setItem");
|
|
75
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<JSetItemParams> /* params */)>("setItem");
|
|
74
76
|
auto __result = method(_javaPart, JSetItemParams::fromCpp(params));
|
|
75
77
|
return [&]() {
|
|
76
78
|
auto __promise = Promise<void>::create();
|
|
@@ -85,7 +87,7 @@ namespace margelo::nitro::keychainmodule {
|
|
|
85
87
|
}();
|
|
86
88
|
}
|
|
87
89
|
std::shared_ptr<Promise<std::variant<nitro::NullType, GetItemResult>>> JHybridKeychainModuleSpec::getItem(const GetItemParams& params) {
|
|
88
|
-
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<JGetItemParams> /* params */)>("getItem");
|
|
90
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<JGetItemParams> /* params */)>("getItem");
|
|
89
91
|
auto __result = method(_javaPart, JGetItemParams::fromCpp(params));
|
|
90
92
|
return [&]() {
|
|
91
93
|
auto __promise = Promise<std::variant<nitro::NullType, GetItemResult>>::create();
|
|
@@ -101,7 +103,7 @@ namespace margelo::nitro::keychainmodule {
|
|
|
101
103
|
}();
|
|
102
104
|
}
|
|
103
105
|
std::shared_ptr<Promise<void>> JHybridKeychainModuleSpec::removeItem(const RemoveItemParams& params) {
|
|
104
|
-
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<JRemoveItemParams> /* params */)>("removeItem");
|
|
106
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<JRemoveItemParams> /* params */)>("removeItem");
|
|
105
107
|
auto __result = method(_javaPart, JRemoveItemParams::fromCpp(params));
|
|
106
108
|
return [&]() {
|
|
107
109
|
auto __promise = Promise<void>::create();
|
|
@@ -116,7 +118,7 @@ namespace margelo::nitro::keychainmodule {
|
|
|
116
118
|
}();
|
|
117
119
|
}
|
|
118
120
|
std::shared_ptr<Promise<bool>> JHybridKeychainModuleSpec::hasItem(const HasItemParams& params) {
|
|
119
|
-
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<JHasItemParams> /* params */)>("hasItem");
|
|
121
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<JHasItemParams> /* params */)>("hasItem");
|
|
120
122
|
auto __result = method(_javaPart, JHasItemParams::fromCpp(params));
|
|
121
123
|
return [&]() {
|
|
122
124
|
auto __promise = Promise<bool>::create();
|
|
@@ -132,7 +134,7 @@ namespace margelo::nitro::keychainmodule {
|
|
|
132
134
|
}();
|
|
133
135
|
}
|
|
134
136
|
std::shared_ptr<Promise<bool>> JHybridKeychainModuleSpec::isICloudSyncEnabled() {
|
|
135
|
-
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>()>("isICloudSyncEnabled");
|
|
137
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>()>("isICloudSyncEnabled");
|
|
136
138
|
auto __result = method(_javaPart);
|
|
137
139
|
return [&]() {
|
|
138
140
|
auto __promise = Promise<bool>::create();
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// HybridKeychainModuleSpec.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -18,33 +18,33 @@ namespace margelo::nitro::keychainmodule {
|
|
|
18
18
|
|
|
19
19
|
using namespace facebook;
|
|
20
20
|
|
|
21
|
-
class JHybridKeychainModuleSpec: public
|
|
22
|
-
public virtual HybridKeychainModuleSpec {
|
|
21
|
+
class JHybridKeychainModuleSpec: public virtual HybridKeychainModuleSpec, public virtual JHybridObject {
|
|
23
22
|
public:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
HybridBase
|
|
33
|
-
|
|
23
|
+
struct JavaPart: public jni::JavaClass<JavaPart, JHybridObject::JavaPart> {
|
|
24
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/keychainmodule/HybridKeychainModuleSpec;";
|
|
25
|
+
std::shared_ptr<JHybridKeychainModuleSpec> getJHybridKeychainModuleSpec();
|
|
26
|
+
};
|
|
27
|
+
struct CxxPart: public jni::HybridClass<CxxPart, JHybridObject::CxxPart> {
|
|
28
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/keychainmodule/HybridKeychainModuleSpec$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 JHybridKeychainModuleSpec(const jni::local_ref<JHybridKeychainModuleSpec::JavaPart>& javaPart):
|
|
38
|
+
HybridObject(HybridKeychainModuleSpec::TAG),
|
|
39
|
+
JHybridObject(javaPart),
|
|
40
|
+
_javaPart(jni::make_global(javaPart)) {}
|
|
36
41
|
~JHybridKeychainModuleSpec() 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
|
-
|
|
43
|
-
void dispose() noexcept override;
|
|
44
|
-
std::string toString() override;
|
|
45
|
-
|
|
46
|
-
public:
|
|
47
|
-
inline const jni::global_ref<JHybridKeychainModuleSpec::javaobject>& getJavaPart() const noexcept {
|
|
47
|
+
inline const jni::global_ref<JHybridKeychainModuleSpec::JavaPart>& getJavaPart() const noexcept {
|
|
48
48
|
return _javaPart;
|
|
49
49
|
}
|
|
50
50
|
|
|
@@ -61,9 +61,7 @@ namespace margelo::nitro::keychainmodule {
|
|
|
61
61
|
std::shared_ptr<Promise<bool>> isICloudSyncEnabled() override;
|
|
62
62
|
|
|
63
63
|
private:
|
|
64
|
-
|
|
65
|
-
using HybridBase::HybridBase;
|
|
66
|
-
jni::global_ref<JHybridKeychainModuleSpec::javaobject> _javaPart;
|
|
64
|
+
jni::global_ref<JHybridKeychainModuleSpec::JavaPart> _javaPart;
|
|
67
65
|
};
|
|
68
66
|
|
|
69
67
|
} // namespace margelo::nitro::keychainmodule
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// JRemoveItemParams.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -21,7 +21,7 @@ namespace margelo::nitro::keychainmodule {
|
|
|
21
21
|
*/
|
|
22
22
|
struct JRemoveItemParams final: public jni::JavaClass<JRemoveItemParams> {
|
|
23
23
|
public:
|
|
24
|
-
static auto
|
|
24
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/keychainmodule/RemoveItemParams;";
|
|
25
25
|
|
|
26
26
|
public:
|
|
27
27
|
/**
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// JSetItemParams.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -22,7 +22,7 @@ namespace margelo::nitro::keychainmodule {
|
|
|
22
22
|
*/
|
|
23
23
|
struct JSetItemParams final: public jni::JavaClass<JSetItemParams> {
|
|
24
24
|
public:
|
|
25
|
-
static auto
|
|
25
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/keychainmodule/SetItemParams;";
|
|
26
26
|
|
|
27
27
|
public:
|
|
28
28
|
/**
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// JVariant_NullType_GetItemResult.cpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#include "JVariant_NullType_GetItemResult.hpp"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// JVariant_NullType_GetItemResult.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -26,7 +26,7 @@ namespace margelo::nitro::keychainmodule {
|
|
|
26
26
|
*/
|
|
27
27
|
class JVariant_NullType_GetItemResult: public jni::JavaClass<JVariant_NullType_GetItemResult> {
|
|
28
28
|
public:
|
|
29
|
-
static auto
|
|
29
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/keychainmodule/Variant_NullType_GetItemResult;";
|
|
30
30
|
|
|
31
31
|
static jni::local_ref<JVariant_NullType_GetItemResult> create_0(jni::alias_ref<JNull> value) {
|
|
32
32
|
static const auto method = javaClassStatic()->getStaticMethod<JVariant_NullType_GetItemResult(jni::alias_ref<JNull>)>("create");
|
|
@@ -49,9 +49,9 @@ namespace margelo::nitro::keychainmodule {
|
|
|
49
49
|
};
|
|
50
50
|
|
|
51
51
|
namespace JVariant_NullType_GetItemResult_impl {
|
|
52
|
-
class First: public jni::JavaClass<First, JVariant_NullType_GetItemResult> {
|
|
52
|
+
class First final: public jni::JavaClass<First, JVariant_NullType_GetItemResult> {
|
|
53
53
|
public:
|
|
54
|
-
static auto
|
|
54
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/keychainmodule/Variant_NullType_GetItemResult$First;";
|
|
55
55
|
|
|
56
56
|
[[nodiscard]] jni::local_ref<JNull> getValue() const {
|
|
57
57
|
static const auto field = javaClassStatic()->getField<JNull>("value");
|
|
@@ -59,9 +59,9 @@ namespace margelo::nitro::keychainmodule {
|
|
|
59
59
|
}
|
|
60
60
|
};
|
|
61
61
|
|
|
62
|
-
class Second: public jni::JavaClass<Second, JVariant_NullType_GetItemResult> {
|
|
62
|
+
class Second final: public jni::JavaClass<Second, JVariant_NullType_GetItemResult> {
|
|
63
63
|
public:
|
|
64
|
-
static auto
|
|
64
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/keychainmodule/Variant_NullType_GetItemResult$Second;";
|
|
65
65
|
|
|
66
66
|
[[nodiscard]] jni::local_ref<JGetItemResult> getValue() const {
|
|
67
67
|
static const auto field = javaClassStatic()->getField<JGetItemResult>("value");
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# keychainmodule+autolinking.cmake
|
|
3
3
|
# This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
# https://github.com/mrousavy/nitro
|
|
5
|
-
# Copyright ©
|
|
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
|
/// keychainmodule+autolinking.gradle
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
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
|
/// keychainmoduleOnLoad.cpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#ifndef BUILDING_KEYCHAINMODULE_WITH_GENERATED_CMAKE_PROJECT
|
|
@@ -21,24 +21,34 @@
|
|
|
21
21
|
namespace margelo::nitro::keychainmodule {
|
|
22
22
|
|
|
23
23
|
int initialize(JavaVM* vm) {
|
|
24
|
+
return facebook::jni::initialize(vm, []() {
|
|
25
|
+
::margelo::nitro::keychainmodule::registerAllNatives();
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
struct JHybridKeychainModuleSpecImpl: public jni::JavaClass<JHybridKeychainModuleSpecImpl, JHybridKeychainModuleSpec::JavaPart> {
|
|
30
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/keychainmodule/KeychainModule;";
|
|
31
|
+
static std::shared_ptr<JHybridKeychainModuleSpec> create() {
|
|
32
|
+
static const auto constructorFn = javaClassStatic()->getConstructor<JHybridKeychainModuleSpecImpl::javaobject()>();
|
|
33
|
+
jni::local_ref<JHybridKeychainModuleSpec::JavaPart> javaPart = javaClassStatic()->newObject(constructorFn);
|
|
34
|
+
return javaPart->getJHybridKeychainModuleSpec();
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
void registerAllNatives() {
|
|
24
39
|
using namespace margelo::nitro;
|
|
25
40
|
using namespace margelo::nitro::keychainmodule;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
auto instance = object.create();
|
|
38
|
-
return instance->cthis()->shared();
|
|
39
|
-
}
|
|
40
|
-
);
|
|
41
|
-
});
|
|
41
|
+
|
|
42
|
+
// Register native JNI methods
|
|
43
|
+
margelo::nitro::keychainmodule::JHybridKeychainModuleSpec::CxxPart::registerNatives();
|
|
44
|
+
|
|
45
|
+
// Register Nitro Hybrid Objects
|
|
46
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
47
|
+
"KeychainModule",
|
|
48
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
49
|
+
return JHybridKeychainModuleSpecImpl::create();
|
|
50
|
+
}
|
|
51
|
+
);
|
|
42
52
|
}
|
|
43
53
|
|
|
44
54
|
} // namespace margelo::nitro::keychainmodule
|
|
@@ -2,24 +2,33 @@
|
|
|
2
2
|
/// keychainmoduleOnLoad.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
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::keychainmodule {
|
|
12
13
|
|
|
14
|
+
[[deprecated("Use registerNatives() instead.")]]
|
|
15
|
+
int initialize(JavaVM* vm);
|
|
16
|
+
|
|
13
17
|
/**
|
|
14
|
-
*
|
|
15
|
-
* Call this in your `JNI_OnLoad` function (probably inside `cpp-adapter.cpp`)
|
|
18
|
+
* Register the native (C++) part of keychainmodule, 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
|
|
24
|
+
* return facebook::jni::initialize(vm, []() {
|
|
25
|
+
* // register all keychainmodule HybridObjects
|
|
26
|
+
* margelo::nitro::keychainmodule::registerNatives();
|
|
27
|
+
* // any other custom registrations go here.
|
|
28
|
+
* });
|
|
20
29
|
* }
|
|
21
30
|
* ```
|
|
22
31
|
*/
|
|
23
|
-
|
|
32
|
+
void registerAllNatives();
|
|
24
33
|
|
|
25
34
|
} // namespace margelo::nitro::keychainmodule
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// GetItemParams.kt
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
package com.margelo.nitro.keychainmodule
|
|
@@ -23,7 +23,7 @@ data class GetItemParams(
|
|
|
23
23
|
) {
|
|
24
24
|
/* primary constructor */
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
companion object {
|
|
27
27
|
/**
|
|
28
28
|
* Constructor called from C++
|
|
29
29
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// GetItemResult.kt
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
package com.margelo.nitro.keychainmodule
|
|
@@ -26,7 +26,7 @@ data class GetItemResult(
|
|
|
26
26
|
) {
|
|
27
27
|
/* primary constructor */
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
companion object {
|
|
30
30
|
/**
|
|
31
31
|
* Constructor called from C++
|
|
32
32
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// HasItemParams.kt
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
package com.margelo.nitro.keychainmodule
|
|
@@ -23,7 +23,7 @@ data class HasItemParams(
|
|
|
23
23
|
) {
|
|
24
24
|
/* primary constructor */
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
companion object {
|
|
27
27
|
/**
|
|
28
28
|
* Constructor called from C++
|
|
29
29
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// HybridKeychainModuleSpec.kt
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
package com.margelo.nitro.keychainmodule
|
|
@@ -26,23 +26,6 @@ import com.margelo.nitro.core.HybridObject
|
|
|
26
26
|
"LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName"
|
|
27
27
|
)
|
|
28
28
|
abstract class HybridKeychainModuleSpec: HybridObject() {
|
|
29
|
-
@DoNotStrip
|
|
30
|
-
private var mHybridData: HybridData = initHybrid()
|
|
31
|
-
|
|
32
|
-
init {
|
|
33
|
-
super.updateNative(mHybridData)
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
override fun updateNative(hybridData: HybridData) {
|
|
37
|
-
mHybridData = hybridData
|
|
38
|
-
super.updateNative(hybridData)
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// Default implementation of `HybridObject.toString()`
|
|
42
|
-
override fun toString(): String {
|
|
43
|
-
return "[HybridObject KeychainModule]"
|
|
44
|
-
}
|
|
45
|
-
|
|
46
29
|
// Properties
|
|
47
30
|
|
|
48
31
|
|
|
@@ -67,7 +50,21 @@ abstract class HybridKeychainModuleSpec: HybridObject() {
|
|
|
67
50
|
@Keep
|
|
68
51
|
abstract fun isICloudSyncEnabled(): Promise<Boolean>
|
|
69
52
|
|
|
70
|
-
|
|
53
|
+
// Default implementation of `HybridObject.toString()`
|
|
54
|
+
override fun toString(): String {
|
|
55
|
+
return "[HybridObject KeychainModule]"
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// C++ backing class
|
|
59
|
+
@DoNotStrip
|
|
60
|
+
@Keep
|
|
61
|
+
protected open class CxxPart(javaPart: HybridKeychainModuleSpec): HybridObject.CxxPart(javaPart) {
|
|
62
|
+
// C++ JHybridKeychainModuleSpec::CxxPart::initHybrid(...)
|
|
63
|
+
external override fun initHybrid(): HybridData
|
|
64
|
+
}
|
|
65
|
+
override fun createCxxPart(): CxxPart {
|
|
66
|
+
return CxxPart(this)
|
|
67
|
+
}
|
|
71
68
|
|
|
72
69
|
companion object {
|
|
73
70
|
protected const val TAG = "HybridKeychainModuleSpec"
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/RemoveItemParams.kt
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// RemoveItemParams.kt
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
package com.margelo.nitro.keychainmodule
|
|
@@ -23,7 +23,7 @@ data class RemoveItemParams(
|
|
|
23
23
|
) {
|
|
24
24
|
/* primary constructor */
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
companion object {
|
|
27
27
|
/**
|
|
28
28
|
* Constructor called from C++
|
|
29
29
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// SetItemParams.kt
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
package com.margelo.nitro.keychainmodule
|
|
@@ -35,7 +35,7 @@ data class SetItemParams(
|
|
|
35
35
|
) {
|
|
36
36
|
/* primary constructor */
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
companion object {
|
|
39
39
|
/**
|
|
40
40
|
* Constructor called from C++
|
|
41
41
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// Variant_NullType_GetItemResult.kt
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
package com.margelo.nitro.keychainmodule
|
|
@@ -21,12 +21,6 @@ sealed class Variant_NullType_GetItemResult {
|
|
|
21
21
|
@DoNotStrip
|
|
22
22
|
data class Second(@DoNotStrip val value: GetItemResult): Variant_NullType_GetItemResult()
|
|
23
23
|
|
|
24
|
-
@Deprecated("getAs() is not type-safe. Use fold/asFirstOrNull/asSecondOrNull instead.", level = DeprecationLevel.ERROR)
|
|
25
|
-
inline fun <reified T> getAs(): T? = when (this) {
|
|
26
|
-
is First -> value as? T
|
|
27
|
-
is Second -> value as? T
|
|
28
|
-
}
|
|
29
|
-
|
|
30
24
|
val isFirst: Boolean
|
|
31
25
|
get() = this is First
|
|
32
26
|
val isSecond: Boolean
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/keychainmoduleOnLoad.kt
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// keychainmoduleOnLoad.kt
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
package com.margelo.nitro.keychainmodule
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# KeychainModule+autolinking.rb
|
|
3
3
|
# This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
# https://github.com/mrousavy/nitro
|
|
5
|
-
# Copyright ©
|
|
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
|
|
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",
|