@onekeyfe/react-native-device-utils 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.
@@ -15,7 +15,7 @@ namespace margelo::nitro::reactnativedeviceutils {
15
15
  using namespace facebook;
16
16
 
17
17
  /**
18
- * The C++ JNI bridge between the C++ enum "AndroidChannel" and the the Kotlin enum "AndroidChannel".
18
+ * The C++ JNI bridge between the C++ enum "AndroidChannel" and the Kotlin enum "AndroidChannel".
19
19
  */
20
20
  struct JAndroidChannel final: public jni::JavaClass<JAndroidChannel> {
21
21
  public:
@@ -17,7 +17,7 @@ namespace margelo::nitro::reactnativedeviceutils {
17
17
  using namespace facebook;
18
18
 
19
19
  /**
20
- * The C++ JNI bridge between the C++ struct "DualScreenInfoRect" and the the Kotlin data class "DualScreenInfoRect".
20
+ * The C++ JNI bridge between the C++ struct "DualScreenInfoRect" and the Kotlin data class "DualScreenInfoRect".
21
21
  */
22
22
  struct JDualScreenInfoRect final: public jni::JavaClass<JDualScreenInfoRect> {
23
23
  public:
@@ -17,7 +17,7 @@ namespace margelo::nitro::reactnativedeviceutils {
17
17
  using namespace facebook;
18
18
 
19
19
  /**
20
- * The C++ JNI bridge between the C++ struct "GooglePlayServicesStatus" and the the Kotlin data class "GooglePlayServicesStatus".
20
+ * The C++ JNI bridge between the C++ struct "GooglePlayServicesStatus" and the Kotlin data class "GooglePlayServicesStatus".
21
21
  */
22
22
  struct JGooglePlayServicesStatus final: public jni::JavaClass<JGooglePlayServicesStatus> {
23
23
  public:
@@ -100,16 +100,16 @@ namespace margelo::nitro::reactnativedeviceutils {
100
100
  auto __promise = Promise<std::vector<DualScreenInfoRect>>::create();
101
101
  __result->cthis()->addOnResolvedListener([=](const jni::alias_ref<jni::JObject>& __boxedResult) {
102
102
  auto __result = jni::static_ref_cast<jni::JArrayClass<JDualScreenInfoRect>>(__boxedResult);
103
- __promise->resolve([&]() {
104
- size_t __size = __result->size();
103
+ __promise->resolve([&](auto&& __input) {
104
+ size_t __size = __input->size();
105
105
  std::vector<DualScreenInfoRect> __vector;
106
106
  __vector.reserve(__size);
107
107
  for (size_t __i = 0; __i < __size; __i++) {
108
- auto __element = __result->getElement(__i);
108
+ auto __element = __input->getElement(__i);
109
109
  __vector.push_back(__element->toCpp());
110
110
  }
111
111
  return __vector;
112
- }());
112
+ }(__result));
113
113
  });
114
114
  __result->cthis()->addOnRejectedListener([=](const jni::alias_ref<jni::JThrowable>& __throwable) {
115
115
  jni::JniException __jniError(__throwable);
@@ -15,7 +15,7 @@ namespace margelo::nitro::reactnativedeviceutils {
15
15
  using namespace facebook;
16
16
 
17
17
  /**
18
- * The C++ JNI bridge between the C++ enum "InstallerPackageName" and the the Kotlin enum "InstallerPackageName".
18
+ * The C++ JNI bridge between the C++ enum "InstallerPackageName" and the Kotlin enum "InstallerPackageName".
19
19
  */
20
20
  struct JInstallerPackageName final: public jni::JavaClass<JInstallerPackageName> {
21
21
  public:
@@ -18,7 +18,7 @@ namespace margelo::nitro::reactnativedeviceutils {
18
18
  using namespace facebook;
19
19
 
20
20
  /**
21
- * The C++ JNI bridge between the C++ struct "LaunchOptions" and the the Kotlin data class "LaunchOptions".
21
+ * The C++ JNI bridge between the C++ struct "LaunchOptions" and the Kotlin data class "LaunchOptions".
22
22
  */
23
23
  struct JLaunchOptions final: public jni::JavaClass<JLaunchOptions> {
24
24
  public:
@@ -15,7 +15,7 @@ namespace margelo::nitro::reactnativedeviceutils {
15
15
  using namespace facebook;
16
16
 
17
17
  /**
18
- * The C++ JNI bridge between the C++ enum "UserInterfaceStyle" and the the Kotlin enum "UserInterfaceStyle".
18
+ * The C++ JNI bridge between the C++ enum "UserInterfaceStyle" and the Kotlin enum "UserInterfaceStyle".
19
19
  */
20
20
  struct JUserInterfaceStyle final: public jni::JavaClass<JUserInterfaceStyle> {
21
21
  public:
@@ -17,7 +17,7 @@ namespace margelo::nitro::reactnativedeviceutils {
17
17
  using namespace facebook;
18
18
 
19
19
  /**
20
- * The C++ JNI bridge between the C++ struct "WebViewPackageInfo" and the the Kotlin data class "WebViewPackageInfo".
20
+ * The C++ JNI bridge between the C++ struct "WebViewPackageInfo" and the Kotlin data class "WebViewPackageInfo".
21
21
  */
22
22
  struct JWebViewPackageInfo final: public jni::JavaClass<JWebViewPackageInfo> {
23
23
  public:
@@ -9,6 +9,7 @@ package com.margelo.nitro.reactnativedeviceutils
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
  /**
@@ -32,6 +33,24 @@ data class DualScreenInfoRect(
32
33
  ) {
33
34
  /* primary constructor */
34
35
 
36
+ override fun equals(other: Any?): Boolean {
37
+ if (this === other) return true
38
+ if (other !is DualScreenInfoRect) return false
39
+ return Objects.deepEquals(this.x, other.x)
40
+ && Objects.deepEquals(this.y, other.y)
41
+ && Objects.deepEquals(this.width, other.width)
42
+ && Objects.deepEquals(this.height, other.height)
43
+ }
44
+
45
+ override fun hashCode(): Int {
46
+ return arrayOf<Any?>(
47
+ x,
48
+ y,
49
+ width,
50
+ height
51
+ ).contentDeepHashCode()
52
+ }
53
+
35
54
  companion object {
36
55
  /**
37
56
  * Constructor called from C++
@@ -10,7 +10,6 @@ package com.margelo.nitro.reactnativedeviceutils
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
14
13
 
15
14
 
16
15
  /**
@@ -59,7 +58,6 @@ class Func_void_bool_cxx: Func_void_bool {
59
58
  override fun invoke(isSpanning: Boolean): Unit
60
59
  = invoke_cxx(isSpanning)
61
60
 
62
- @FastNative
63
61
  private external fun invoke_cxx(isSpanning: Boolean): Unit
64
62
  }
65
63
 
@@ -9,6 +9,7 @@ package com.margelo.nitro.reactnativedeviceutils
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 GooglePlayServicesStatus(
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 GooglePlayServicesStatus) return false
33
+ return Objects.deepEquals(this.status, other.status)
34
+ && Objects.deepEquals(this.isAvailable, other.isAvailable)
35
+ }
36
+
37
+ override fun hashCode(): Int {
38
+ return arrayOf<Any?>(
39
+ status,
40
+ isAvailable
41
+ ).contentDeepHashCode()
42
+ }
43
+
29
44
  companion object {
30
45
  /**
31
46
  * Constructor called from C++
@@ -10,6 +10,7 @@ package com.margelo.nitro.reactnativedeviceutils
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
 
@@ -148,6 +149,7 @@ abstract class HybridReactNativeDeviceUtilsSpec: HybridObject() {
148
149
  @Keep
149
150
  protected open class CxxPart(javaPart: HybridReactNativeDeviceUtilsSpec): HybridObject.CxxPart(javaPart) {
150
151
  // C++ JHybridReactNativeDeviceUtilsSpec::CxxPart::initHybrid(...)
152
+ @FastNative
151
153
  external override fun initHybrid(): HybridData
152
154
  }
153
155
  override fun createCxxPart(): CxxPart {
@@ -9,6 +9,7 @@ package com.margelo.nitro.reactnativedeviceutils
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 LaunchOptions(
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 LaunchOptions) return false
33
+ return Objects.deepEquals(this.launchType, other.launchType)
34
+ && Objects.deepEquals(this.deepLink, other.deepLink)
35
+ }
36
+
37
+ override fun hashCode(): Int {
38
+ return arrayOf<Any?>(
39
+ launchType,
40
+ deepLink
41
+ ).contentDeepHashCode()
42
+ }
43
+
29
44
  companion object {
30
45
  /**
31
46
  * Constructor called from C++
@@ -9,6 +9,7 @@ package com.margelo.nitro.reactnativedeviceutils
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 WebViewPackageInfo(
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 WebViewPackageInfo) return false
36
+ return Objects.deepEquals(this.packageName, other.packageName)
37
+ && Objects.deepEquals(this.versionName, other.versionName)
38
+ && Objects.deepEquals(this.versionCode, other.versionCode)
39
+ }
40
+
41
+ override fun hashCode(): Int {
42
+ return arrayOf<Any?>(
43
+ packageName,
44
+ versionName,
45
+ versionCode
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-device-utils",
3
- "version": "3.0.86",
3
+ "version": "3.0.87",
4
4
  "description": "react-native-device-utils",
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",