@onekeyfe/react-native-keychain-module 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.
@@ -17,7 +17,7 @@ namespace margelo::nitro::keychainmodule {
17
17
  using namespace facebook;
18
18
 
19
19
  /**
20
- * The C++ JNI bridge between the C++ struct "GetItemParams" and the the Kotlin data class "GetItemParams".
20
+ * The C++ JNI bridge between the C++ struct "GetItemParams" and the Kotlin data class "GetItemParams".
21
21
  */
22
22
  struct JGetItemParams final: public jni::JavaClass<JGetItemParams> {
23
23
  public:
@@ -17,7 +17,7 @@ namespace margelo::nitro::keychainmodule {
17
17
  using namespace facebook;
18
18
 
19
19
  /**
20
- * The C++ JNI bridge between the C++ struct "GetItemResult" and the the Kotlin data class "GetItemResult".
20
+ * The C++ JNI bridge between the C++ struct "GetItemResult" and the Kotlin data class "GetItemResult".
21
21
  */
22
22
  struct JGetItemResult final: public jni::JavaClass<JGetItemResult> {
23
23
  public:
@@ -17,7 +17,7 @@ namespace margelo::nitro::keychainmodule {
17
17
  using namespace facebook;
18
18
 
19
19
  /**
20
- * The C++ JNI bridge between the C++ struct "HasItemParams" and the the Kotlin data class "HasItemParams".
20
+ * The C++ JNI bridge between the C++ struct "HasItemParams" and the Kotlin data class "HasItemParams".
21
21
  */
22
22
  struct JHasItemParams final: public jni::JavaClass<JHasItemParams> {
23
23
  public:
@@ -17,7 +17,7 @@ namespace margelo::nitro::keychainmodule {
17
17
  using namespace facebook;
18
18
 
19
19
  /**
20
- * The C++ JNI bridge between the C++ struct "RemoveItemParams" and the the Kotlin data class "RemoveItemParams".
20
+ * The C++ JNI bridge between the C++ struct "RemoveItemParams" and the Kotlin data class "RemoveItemParams".
21
21
  */
22
22
  struct JRemoveItemParams final: public jni::JavaClass<JRemoveItemParams> {
23
23
  public:
@@ -18,7 +18,7 @@ namespace margelo::nitro::keychainmodule {
18
18
  using namespace facebook;
19
19
 
20
20
  /**
21
- * The C++ JNI bridge between the C++ struct "SetItemParams" and the the Kotlin data class "SetItemParams".
21
+ * The C++ JNI bridge between the C++ struct "SetItemParams" and the Kotlin data class "SetItemParams".
22
22
  */
23
23
  struct JSetItemParams final: public jni::JavaClass<JSetItemParams> {
24
24
  public:
@@ -9,6 +9,7 @@ package com.margelo.nitro.keychainmodule
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
  /**
@@ -23,6 +24,18 @@ data class GetItemParams(
23
24
  ) {
24
25
  /* primary constructor */
25
26
 
27
+ override fun equals(other: Any?): Boolean {
28
+ if (this === other) return true
29
+ if (other !is GetItemParams) return false
30
+ return Objects.deepEquals(this.key, other.key)
31
+ }
32
+
33
+ override fun hashCode(): Int {
34
+ return arrayOf<Any?>(
35
+ key
36
+ ).contentDeepHashCode()
37
+ }
38
+
26
39
  companion object {
27
40
  /**
28
41
  * Constructor called from C++
@@ -9,6 +9,7 @@ package com.margelo.nitro.keychainmodule
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 GetItemResult(
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 GetItemResult) return false
33
+ return Objects.deepEquals(this.key, other.key)
34
+ && Objects.deepEquals(this.value, other.value)
35
+ }
36
+
37
+ override fun hashCode(): Int {
38
+ return arrayOf<Any?>(
39
+ key,
40
+ value
41
+ ).contentDeepHashCode()
42
+ }
43
+
29
44
  companion object {
30
45
  /**
31
46
  * Constructor called from C++
@@ -9,6 +9,7 @@ package com.margelo.nitro.keychainmodule
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
  /**
@@ -23,6 +24,18 @@ data class HasItemParams(
23
24
  ) {
24
25
  /* primary constructor */
25
26
 
27
+ override fun equals(other: Any?): Boolean {
28
+ if (this === other) return true
29
+ if (other !is HasItemParams) return false
30
+ return Objects.deepEquals(this.key, other.key)
31
+ }
32
+
33
+ override fun hashCode(): Int {
34
+ return arrayOf<Any?>(
35
+ key
36
+ ).contentDeepHashCode()
37
+ }
38
+
26
39
  companion object {
27
40
  /**
28
41
  * Constructor called from C++
@@ -10,6 +10,7 @@ package com.margelo.nitro.keychainmodule
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.NullType
15
16
  import com.margelo.nitro.core.HybridObject
@@ -60,6 +61,7 @@ abstract class HybridKeychainModuleSpec: HybridObject() {
60
61
  @Keep
61
62
  protected open class CxxPart(javaPart: HybridKeychainModuleSpec): HybridObject.CxxPart(javaPart) {
62
63
  // C++ JHybridKeychainModuleSpec::CxxPart::initHybrid(...)
64
+ @FastNative
63
65
  external override fun initHybrid(): HybridData
64
66
  }
65
67
  override fun createCxxPart(): CxxPart {
@@ -9,6 +9,7 @@ package com.margelo.nitro.keychainmodule
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
  /**
@@ -23,6 +24,18 @@ data class RemoveItemParams(
23
24
  ) {
24
25
  /* primary constructor */
25
26
 
27
+ override fun equals(other: Any?): Boolean {
28
+ if (this === other) return true
29
+ if (other !is RemoveItemParams) return false
30
+ return Objects.deepEquals(this.key, other.key)
31
+ }
32
+
33
+ override fun hashCode(): Int {
34
+ return arrayOf<Any?>(
35
+ key
36
+ ).contentDeepHashCode()
37
+ }
38
+
26
39
  companion object {
27
40
  /**
28
41
  * Constructor called from C++
@@ -9,6 +9,7 @@ package com.margelo.nitro.keychainmodule
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
  /**
@@ -35,6 +36,26 @@ data class SetItemParams(
35
36
  ) {
36
37
  /* primary constructor */
37
38
 
39
+ override fun equals(other: Any?): Boolean {
40
+ if (this === other) return true
41
+ if (other !is SetItemParams) return false
42
+ return Objects.deepEquals(this.key, other.key)
43
+ && Objects.deepEquals(this.value, other.value)
44
+ && Objects.deepEquals(this.enableSync, other.enableSync)
45
+ && Objects.deepEquals(this.label, other.label)
46
+ && Objects.deepEquals(this.description, other.description)
47
+ }
48
+
49
+ override fun hashCode(): Int {
50
+ return arrayOf<Any?>(
51
+ key,
52
+ value,
53
+ enableSync,
54
+ label,
55
+ description
56
+ ).contentDeepHashCode()
57
+ }
58
+
38
59
  companion object {
39
60
  /**
40
61
  * Constructor called from C++
@@ -21,6 +21,22 @@ sealed class Variant_NullType_GetItemResult {
21
21
  @DoNotStrip
22
22
  data class Second(@DoNotStrip val value: GetItemResult): Variant_NullType_GetItemResult()
23
23
 
24
+ inline fun <reified T> asType(): T? {
25
+ return when (this) {
26
+ is First -> (value) as? T
27
+ is Second -> (value) as? T
28
+ }
29
+ }
30
+ inline fun <reified T> isType(): Boolean {
31
+ return asType<T>() != null
32
+ }
33
+ inline fun <R> match(first: (NullType) -> R, second: (GetItemResult) -> R): R {
34
+ return when (this) {
35
+ is First -> first(value)
36
+ is Second -> second(value)
37
+ }
38
+ }
39
+
24
40
  val isFirst: Boolean
25
41
  get() = this is First
26
42
  val isSecond: Boolean
@@ -35,13 +51,6 @@ sealed class Variant_NullType_GetItemResult {
35
51
  return value
36
52
  }
37
53
 
38
- inline fun <R> match(first: (NullType) -> R, second: (GetItemResult) -> R): R {
39
- return when (this) {
40
- is First -> first(value)
41
- is Second -> second(value)
42
- }
43
- }
44
-
45
54
  companion object {
46
55
  @JvmStatic
47
56
  @DoNotStrip
@@ -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
@@ -16,3 +16,15 @@ public indirect enum Variant_NullType_GetItemResult {
16
16
  case first(NullType)
17
17
  case second(GetItemResult)
18
18
  }
19
+
20
+ public extension Variant_NullType_GetItemResult {
21
+ func asType<T>(_ type: T.Type = T.self) -> T? {
22
+ switch self {
23
+ case .first(let value): return value as? T
24
+ case .second(let value): return value as? T
25
+ }
26
+ }
27
+ func isType<T>(_ type: T.Type = T.self) -> Bool {
28
+ return self.asType(type) != nil
29
+ }
30
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/react-native-keychain-module",
3
- "version": "3.0.86",
3
+ "version": "3.0.87",
4
4
  "description": "react-native-keychain-module",
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.35.2",
81
+ "nitrogen": "0.36.5",
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.35.2",
86
+ "react-native-nitro-modules": "0.36.5",
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.35.2"
94
+ "react-native-nitro-modules": "0.36.5"
95
95
  },
96
96
  "react-native-builder-bob": {
97
97
  "source": "src",