@onekeyfe/react-native-bundle-crypto 3.0.86 → 3.0.87
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++/JDirHashEntry.hpp +1 -1
- package/nitrogen/generated/android/c++/JHybridReactNativeBundleCryptoSpec.cpp +12 -12
- package/nitrogen/generated/android/c++/JSha256Result.hpp +1 -1
- package/nitrogen/generated/android/c++/JVerifyDetachedAscResult.hpp +1 -1
- package/nitrogen/generated/android/c++/JVerifyGpgCleartextResult.hpp +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundlecrypto/DirHashEntry.kt +15 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundlecrypto/HybridReactNativeBundleCryptoSpec.kt +2 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundlecrypto/Sha256Result.kt +15 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundlecrypto/VerifyDetachedAscResult.kt +17 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundlecrypto/VerifyGpgCleartextResult.kt +17 -0
- package/nitrogen/generated/ios/ReactNativeBundleCrypto+autolinking.rb +2 -0
- package/package.json +4 -4
|
@@ -17,7 +17,7 @@ namespace margelo::nitro::reactnativebundlecrypto {
|
|
|
17
17
|
using namespace facebook;
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* The C++ JNI bridge between the C++ struct "DirHashEntry" and the
|
|
20
|
+
* The C++ JNI bridge between the C++ struct "DirHashEntry" and the Kotlin data class "DirHashEntry".
|
|
21
21
|
*/
|
|
22
22
|
struct JDirHashEntry final: public jni::JavaClass<JDirHashEntry> {
|
|
23
23
|
public:
|
|
@@ -119,16 +119,16 @@ namespace margelo::nitro::reactnativebundlecrypto {
|
|
|
119
119
|
}
|
|
120
120
|
std::shared_ptr<Promise<bool>> JHybridReactNativeBundleCryptoSpec::verifyDirAgainstHashes(const std::string& dirPath, const std::vector<DirHashEntry>& entries) {
|
|
121
121
|
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<jni::JString> /* dirPath */, jni::alias_ref<jni::JArrayClass<JDirHashEntry>> /* entries */)>("verifyDirAgainstHashes");
|
|
122
|
-
auto __result = method(_javaPart, jni::make_jstring(dirPath), [&]() {
|
|
123
|
-
size_t __size =
|
|
122
|
+
auto __result = method(_javaPart, jni::make_jstring(dirPath), [&](auto&& __input) {
|
|
123
|
+
size_t __size = __input.size();
|
|
124
124
|
jni::local_ref<jni::JArrayClass<JDirHashEntry>> __array = jni::JArrayClass<JDirHashEntry>::newArray(__size);
|
|
125
125
|
for (size_t __i = 0; __i < __size; __i++) {
|
|
126
|
-
const auto& __element =
|
|
126
|
+
const auto& __element = __input[__i];
|
|
127
127
|
auto __elementJni = JDirHashEntry::fromCpp(__element);
|
|
128
128
|
__array->setElement(__i, *__elementJni);
|
|
129
129
|
}
|
|
130
130
|
return __array;
|
|
131
|
-
}());
|
|
131
|
+
}(entries));
|
|
132
132
|
return [&]() {
|
|
133
133
|
auto __promise = Promise<bool>::create();
|
|
134
134
|
__result->cthis()->addOnResolvedListener([=](const jni::alias_ref<jni::JObject>& __boxedResult) {
|
|
@@ -149,16 +149,16 @@ namespace margelo::nitro::reactnativebundlecrypto {
|
|
|
149
149
|
auto __promise = Promise<std::vector<DirHashEntry>>::create();
|
|
150
150
|
__result->cthis()->addOnResolvedListener([=](const jni::alias_ref<jni::JObject>& __boxedResult) {
|
|
151
151
|
auto __result = jni::static_ref_cast<jni::JArrayClass<JDirHashEntry>>(__boxedResult);
|
|
152
|
-
__promise->resolve([&]() {
|
|
153
|
-
size_t __size =
|
|
152
|
+
__promise->resolve([&](auto&& __input) {
|
|
153
|
+
size_t __size = __input->size();
|
|
154
154
|
std::vector<DirHashEntry> __vector;
|
|
155
155
|
__vector.reserve(__size);
|
|
156
156
|
for (size_t __i = 0; __i < __size; __i++) {
|
|
157
|
-
auto __element =
|
|
157
|
+
auto __element = __input->getElement(__i);
|
|
158
158
|
__vector.push_back(__element->toCpp());
|
|
159
159
|
}
|
|
160
160
|
return __vector;
|
|
161
|
-
}());
|
|
161
|
+
}(__result));
|
|
162
162
|
});
|
|
163
163
|
__result->cthis()->addOnRejectedListener([=](const jni::alias_ref<jni::JThrowable>& __throwable) {
|
|
164
164
|
jni::JniException __jniError(__throwable);
|
|
@@ -220,16 +220,16 @@ namespace margelo::nitro::reactnativebundlecrypto {
|
|
|
220
220
|
auto __promise = Promise<std::vector<std::string>>::create();
|
|
221
221
|
__result->cthis()->addOnResolvedListener([=](const jni::alias_ref<jni::JObject>& __boxedResult) {
|
|
222
222
|
auto __result = jni::static_ref_cast<jni::JArrayClass<jni::JString>>(__boxedResult);
|
|
223
|
-
__promise->resolve([&]() {
|
|
224
|
-
size_t __size =
|
|
223
|
+
__promise->resolve([&](auto&& __input) {
|
|
224
|
+
size_t __size = __input->size();
|
|
225
225
|
std::vector<std::string> __vector;
|
|
226
226
|
__vector.reserve(__size);
|
|
227
227
|
for (size_t __i = 0; __i < __size; __i++) {
|
|
228
|
-
auto __element =
|
|
228
|
+
auto __element = __input->getElement(__i);
|
|
229
229
|
__vector.push_back(__element->toStdString());
|
|
230
230
|
}
|
|
231
231
|
return __vector;
|
|
232
|
-
}());
|
|
232
|
+
}(__result));
|
|
233
233
|
});
|
|
234
234
|
__result->cthis()->addOnRejectedListener([=](const jni::alias_ref<jni::JThrowable>& __throwable) {
|
|
235
235
|
jni::JniException __jniError(__throwable);
|
|
@@ -18,7 +18,7 @@ namespace margelo::nitro::reactnativebundlecrypto {
|
|
|
18
18
|
using namespace facebook;
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
* The C++ JNI bridge between the C++ struct "Sha256Result" and the
|
|
21
|
+
* The C++ JNI bridge between the C++ struct "Sha256Result" and the Kotlin data class "Sha256Result".
|
|
22
22
|
*/
|
|
23
23
|
struct JSha256Result final: public jni::JavaClass<JSha256Result> {
|
|
24
24
|
public:
|
|
@@ -18,7 +18,7 @@ namespace margelo::nitro::reactnativebundlecrypto {
|
|
|
18
18
|
using namespace facebook;
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
* The C++ JNI bridge between the C++ struct "VerifyDetachedAscResult" and the
|
|
21
|
+
* The C++ JNI bridge between the C++ struct "VerifyDetachedAscResult" and the Kotlin data class "VerifyDetachedAscResult".
|
|
22
22
|
*/
|
|
23
23
|
struct JVerifyDetachedAscResult final: public jni::JavaClass<JVerifyDetachedAscResult> {
|
|
24
24
|
public:
|
|
@@ -18,7 +18,7 @@ namespace margelo::nitro::reactnativebundlecrypto {
|
|
|
18
18
|
using namespace facebook;
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
* The C++ JNI bridge between the C++ struct "VerifyGpgCleartextResult" and the
|
|
21
|
+
* The C++ JNI bridge between the C++ struct "VerifyGpgCleartextResult" and the Kotlin data class "VerifyGpgCleartextResult".
|
|
22
22
|
*/
|
|
23
23
|
struct JVerifyGpgCleartextResult final: public jni::JavaClass<JVerifyGpgCleartextResult> {
|
|
24
24
|
public:
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundlecrypto/DirHashEntry.kt
CHANGED
|
@@ -9,6 +9,7 @@ package com.margelo.nitro.reactnativebundlecrypto
|
|
|
9
9
|
|
|
10
10
|
import androidx.annotation.Keep
|
|
11
11
|
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
import java.util.Objects
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
/**
|
|
@@ -26,6 +27,20 @@ data class DirHashEntry(
|
|
|
26
27
|
) {
|
|
27
28
|
/* primary constructor */
|
|
28
29
|
|
|
30
|
+
override fun equals(other: Any?): Boolean {
|
|
31
|
+
if (this === other) return true
|
|
32
|
+
if (other !is DirHashEntry) return false
|
|
33
|
+
return Objects.deepEquals(this.relativePath, other.relativePath)
|
|
34
|
+
&& Objects.deepEquals(this.sha256, other.sha256)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
override fun hashCode(): Int {
|
|
38
|
+
return arrayOf<Any?>(
|
|
39
|
+
relativePath,
|
|
40
|
+
sha256
|
|
41
|
+
).contentDeepHashCode()
|
|
42
|
+
}
|
|
43
|
+
|
|
29
44
|
companion object {
|
|
30
45
|
/**
|
|
31
46
|
* Constructor called from C++
|
|
@@ -10,6 +10,7 @@ package com.margelo.nitro.reactnativebundlecrypto
|
|
|
10
10
|
import androidx.annotation.Keep
|
|
11
11
|
import com.facebook.jni.HybridData
|
|
12
12
|
import com.facebook.proguard.annotations.DoNotStrip
|
|
13
|
+
import dalvik.annotation.optimization.FastNative
|
|
13
14
|
import com.margelo.nitro.core.Promise
|
|
14
15
|
import com.margelo.nitro.core.HybridObject
|
|
15
16
|
|
|
@@ -79,6 +80,7 @@ abstract class HybridReactNativeBundleCryptoSpec: HybridObject() {
|
|
|
79
80
|
@Keep
|
|
80
81
|
protected open class CxxPart(javaPart: HybridReactNativeBundleCryptoSpec): HybridObject.CxxPart(javaPart) {
|
|
81
82
|
// C++ JHybridReactNativeBundleCryptoSpec::CxxPart::initHybrid(...)
|
|
83
|
+
@FastNative
|
|
82
84
|
external override fun initHybrid(): HybridData
|
|
83
85
|
}
|
|
84
86
|
override fun createCxxPart(): CxxPart {
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundlecrypto/Sha256Result.kt
CHANGED
|
@@ -9,6 +9,7 @@ package com.margelo.nitro.reactnativebundlecrypto
|
|
|
9
9
|
|
|
10
10
|
import androidx.annotation.Keep
|
|
11
11
|
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
import java.util.Objects
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
/**
|
|
@@ -26,6 +27,20 @@ data class Sha256Result(
|
|
|
26
27
|
) {
|
|
27
28
|
/* primary constructor */
|
|
28
29
|
|
|
30
|
+
override fun equals(other: Any?): Boolean {
|
|
31
|
+
if (this === other) return true
|
|
32
|
+
if (other !is Sha256Result) return false
|
|
33
|
+
return Objects.deepEquals(this.sha256, other.sha256)
|
|
34
|
+
&& Objects.deepEquals(this.failureReason, other.failureReason)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
override fun hashCode(): Int {
|
|
38
|
+
return arrayOf<Any?>(
|
|
39
|
+
sha256,
|
|
40
|
+
failureReason
|
|
41
|
+
).contentDeepHashCode()
|
|
42
|
+
}
|
|
43
|
+
|
|
29
44
|
companion object {
|
|
30
45
|
/**
|
|
31
46
|
* Constructor called from C++
|
|
@@ -9,6 +9,7 @@ package com.margelo.nitro.reactnativebundlecrypto
|
|
|
9
9
|
|
|
10
10
|
import androidx.annotation.Keep
|
|
11
11
|
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
import java.util.Objects
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
/**
|
|
@@ -29,6 +30,22 @@ data class VerifyDetachedAscResult(
|
|
|
29
30
|
) {
|
|
30
31
|
/* primary constructor */
|
|
31
32
|
|
|
33
|
+
override fun equals(other: Any?): Boolean {
|
|
34
|
+
if (this === other) return true
|
|
35
|
+
if (other !is VerifyDetachedAscResult) return false
|
|
36
|
+
return Objects.deepEquals(this.valid, other.valid)
|
|
37
|
+
&& Objects.deepEquals(this.sha256, other.sha256)
|
|
38
|
+
&& Objects.deepEquals(this.reason, other.reason)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
override fun hashCode(): Int {
|
|
42
|
+
return arrayOf<Any?>(
|
|
43
|
+
valid,
|
|
44
|
+
sha256,
|
|
45
|
+
reason
|
|
46
|
+
).contentDeepHashCode()
|
|
47
|
+
}
|
|
48
|
+
|
|
32
49
|
companion object {
|
|
33
50
|
/**
|
|
34
51
|
* Constructor called from C++
|
|
@@ -9,6 +9,7 @@ package com.margelo.nitro.reactnativebundlecrypto
|
|
|
9
9
|
|
|
10
10
|
import androidx.annotation.Keep
|
|
11
11
|
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
import java.util.Objects
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
/**
|
|
@@ -29,6 +30,22 @@ data class VerifyGpgCleartextResult(
|
|
|
29
30
|
) {
|
|
30
31
|
/* primary constructor */
|
|
31
32
|
|
|
33
|
+
override fun equals(other: Any?): Boolean {
|
|
34
|
+
if (this === other) return true
|
|
35
|
+
if (other !is VerifyGpgCleartextResult) return false
|
|
36
|
+
return Objects.deepEquals(this.valid, other.valid)
|
|
37
|
+
&& Objects.deepEquals(this.sha256, other.sha256)
|
|
38
|
+
&& Objects.deepEquals(this.reason, other.reason)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
override fun hashCode(): Int {
|
|
42
|
+
return arrayOf<Any?>(
|
|
43
|
+
valid,
|
|
44
|
+
sha256,
|
|
45
|
+
reason
|
|
46
|
+
).contentDeepHashCode()
|
|
47
|
+
}
|
|
48
|
+
|
|
32
49
|
companion object {
|
|
33
50
|
/**
|
|
34
51
|
* Constructor called from C++
|
|
@@ -56,5 +56,7 @@ def add_nitrogen_files(spec)
|
|
|
56
56
|
"SWIFT_OBJC_INTEROP_MODE" => "objcxx",
|
|
57
57
|
# Enables stricter modular headers
|
|
58
58
|
"DEFINES_MODULE" => "YES",
|
|
59
|
+
# Disable auto-generated ObjC header for Swift (Static linkage on Xcode 26.4 breaks here)
|
|
60
|
+
"SWIFT_INSTALL_OBJC_HEADER" => "NO",
|
|
59
61
|
})
|
|
60
62
|
end
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/react-native-bundle-crypto",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.87",
|
|
4
4
|
"description": "react-native-bundle-crypto",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
@@ -77,12 +77,12 @@
|
|
|
77
77
|
"eslint-plugin-prettier": "^5.5.4",
|
|
78
78
|
"jest": "^29.7.0",
|
|
79
79
|
"lefthook": "^2.0.3",
|
|
80
|
-
"nitrogen": "0.
|
|
80
|
+
"nitrogen": "0.36.5",
|
|
81
81
|
"prettier": "^2.8.8",
|
|
82
82
|
"react": "19.2.0",
|
|
83
83
|
"react-native": "patch:react-native@npm%3A0.83.0#~/.yarn/patches/react-native-npm-0.83.0-577d0f2d83.patch",
|
|
84
84
|
"react-native-builder-bob": "^0.40.13",
|
|
85
|
-
"react-native-nitro-modules": "0.
|
|
85
|
+
"react-native-nitro-modules": "0.36.5",
|
|
86
86
|
"release-it": "^19.0.4",
|
|
87
87
|
"turbo": "^2.5.6",
|
|
88
88
|
"typescript": "^5.9.2"
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"peerDependencies": {
|
|
91
91
|
"react": "*",
|
|
92
92
|
"react-native": "*",
|
|
93
|
-
"react-native-nitro-modules": "0.
|
|
93
|
+
"react-native-nitro-modules": "0.36.5"
|
|
94
94
|
},
|
|
95
95
|
"react-native-builder-bob": {
|
|
96
96
|
"source": "src",
|