@smileid/usesmileid_huawei_face 12.3.1-SNAPSHOT.77 → 12.4.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  Full release notes: [Smile ID docs](https://docs.usesmileid.com/developer-resources/sdks/mobile/release-notes/react-native-expo).
2
2
 
3
+ ## 12.4.0
4
+
5
+ See the repository CHANGELOG for the 12.4.0 release notes.
6
+
7
+
3
8
  ## 12.3.0
4
9
 
5
10
  See the repository CHANGELOG for the 12.3.0 release notes.
package/README.md CHANGED
@@ -10,13 +10,16 @@ Google Mobile Services (Huawei post-2019 hardware, etc.); use
10
10
 
11
11
  The native side runs the entire face-scan pipeline. This package
12
12
  contributes a Kotlin Expo Module that constructs
13
- `UseSmileIDFaceSession(HuaweiFaceDetectorAnalyzer())` against the Huawei
14
- HMS-backed analyzer in the `com.usesmileid:huawei-face` AAR, and a
13
+ `UseSmileIDFaceSession(HuaweiFaceDetectorAnalyzer.forDevice(context))` against the
14
+ Huawei HMS-backed analyzer in the `com.usesmileid:huawei-face` AAR, and a
15
15
  TS wrapper that bridges `configure / analyze / reset / close` with
16
16
  Zod-validated wire payloads.
17
17
 
18
18
  No ML logic is reimplemented in this package — it's a pure passthrough.
19
19
 
20
+ On a phone without HMS Core the analyzer refuses before any HMS code runs, so the flow fails with
21
+ `ML_ANALYZER_NOT_FOUND` rather than the app aborting on its first frame.
22
+
20
23
  ## Installation
21
24
 
22
25
  ```sh
@@ -17,7 +17,7 @@ plugins {
17
17
  }
18
18
 
19
19
  group = 'com.usesmileid.huawei.face'
20
- version = '12.3.0'
20
+ version = '12.4.0'
21
21
 
22
22
  // HMS ML is published only to Huawei's own Maven repository — none of the
23
23
  // com.huawei.hms:ml-computer-vision-* artifacts exist on Maven Central. Expo
@@ -56,7 +56,7 @@ android {
56
56
  // android/build.gradle and the rest of the @expo/* modules.
57
57
  defaultConfig {
58
58
  versionCode 1
59
- versionName '12.3.0'
59
+ versionName '12.4.0'
60
60
  // R8 keep-rules to bundle into partner apps that depend on this
61
61
  // module. Without these, R8 may rename the Expo module entry
62
62
  // point and the JS-bridged member functions, breaking autolinking.
@@ -69,7 +69,7 @@ dependencies {
69
69
  // kamera native core: the analyzer executor takes analysis frames from
70
70
  // kamera's KameraFrameHub so pixels never cross the JS bridge. Resolves from
71
71
  // Maven Central; a local publishToMavenLocal build wins (see kamera.md).
72
- implementation 'com.usesmileid:kamera:1.2.1-20261030.012251-13'
72
+ implementation 'com.usesmileid:kamera:1.3.0'
73
73
 
74
74
  // The analyzer executor and frame storage every provider module shares, from the bridge module.
75
75
  implementation project(':smileid-usesmileid_bridge')
@@ -78,11 +78,14 @@ dependencies {
78
78
  // Targets Huawei AppGallery / no-GMS devices via HMS ML kit. The
79
79
  // Expo Module is a thin Kotlin shim that constructs the session
80
80
  // and bridges its four methods to JS via Expo Modules.
81
- implementation 'com.usesmileid:huawei-face:12.3.0-20261030.021402-367'
81
+ implementation 'com.usesmileid:huawei-face:12.4.0'
82
82
  // The bridge build the bridge module ships. The provider's SDK artifact names its bridge too, and a
83
83
  // snapshot names the moving x.y.z-SNAPSHOT, so this keeps the provider compiling against the build
84
84
  // the app runs.
85
- implementation 'com.usesmileid:bridge:12.3.0-20261030.021402-368'
85
+ implementation 'com.usesmileid:bridge:12.4.0'
86
+ // The device-check test is written against kotlin.test, which runs on JUnit 4 here, with a mocked context.
87
+ testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
88
+ testImplementation 'org.mockito:mockito-core:5.0.0'
86
89
 
87
90
 
88
91
  }
@@ -1,12 +1,12 @@
1
1
  package com.usesmileid.huawei.face
2
2
 
3
+ import android.content.Context
3
4
  import com.usesmileid.bridge.dsl.builder.FaceDetectorMode
4
5
  import com.usesmileid.bridge.huawei.face.HuaweiFaceDetectorAnalyzer
5
6
  import com.usesmileid.bridge.model.BoundingBox as NativeBoundingBox
6
7
  import com.usesmileid.bridge.model.CaptureReadyEvent as NativeCaptureReadyEvent
7
8
  import com.usesmileid.bridge.model.FaceDetectorOutput as NativeFaceOutput
8
9
  import com.usesmileid.bridge.model.HeadPoseResult
9
- import com.usesmileid.bridge.model.YuvFrame as NativeYuvFrame
10
10
  import com.usesmileid.bridge.registry.FaceAnalyzerFactoryRegistry
11
11
  import com.usesmileid.bridge.session.FaceScanConfig
12
12
  import com.usesmileid.bridge.session.UseSmileIDCaptureStep
@@ -26,7 +26,7 @@ import com.usesmileid.bridge.config.ThresholdConfig
26
26
 
27
27
  /**
28
28
  * Expo Module bridging the existing native session
29
- * `UseSmileIDFaceSession(HuaweiFaceDetectorAnalyzer())` (shipped in the
29
+ * `UseSmileIDFaceSession(HuaweiFaceDetectorAnalyzer.forDevice(context))` (shipped in the
30
30
  * `com.smileidentity:huawei-face` AAR) to the JS side. The Huawei
31
31
  * variant targets devices without Google Mobile Services and uses
32
32
  * Huawei HMS ML kit for face detection.
@@ -60,12 +60,6 @@ class UseSmileIDHuaweiFaceModule : Module() {
60
60
  )
61
61
  }
62
62
 
63
- override suspend fun scan(
64
- session: UseSmileIDFaceSession,
65
- frame: NativeYuvFrame,
66
- rotation: Int,
67
- ): UseSmileIDFaceScanResult = session.scan(frame, rotation)
68
-
69
63
  override fun drainEvents(session: UseSmileIDFaceSession): List<NativeCaptureReadyEvent> =
70
64
  session.drainCaptureReadyEvents()
71
65
 
@@ -106,9 +100,10 @@ class UseSmileIDHuaweiFaceModule : Module() {
106
100
  Name("UseSmileIDHuaweiFace")
107
101
 
108
102
  OnCreate {
109
- if (LinkedAnalyzers.has(KEY)) FaceAnalyzerFactoryRegistry.register(KEY) { HuaweiFaceDetectorAnalyzer() }
110
103
  val ctx = appContext.reactContext
111
104
  ?: throw IllegalStateException("Module not attached to a React context")
105
+ val applicationContext = ctx.applicationContext
106
+ if (LinkedAnalyzers.has(KEY)) FaceAnalyzerFactoryRegistry.register(KEY) { huaweiFaceAnalyzerFor(applicationContext) }
112
107
  executor.onAttach(ctx)
113
108
 
114
109
  }
@@ -282,3 +277,10 @@ private fun NativeCaptureReadyEvent.toWireMap(): Map<String, Any?> = when (this)
282
277
  "url" to file.toURI().toString(),
283
278
  )
284
279
  }
280
+
281
+ /**
282
+ * The HMS face analyzer built for this device: on a phone without HMS Core it refuses with
283
+ * `ML_ANALYZER_NOT_FOUND` before HMS's native code, which otherwise aborts the app on its first frame.
284
+ */
285
+ internal fun huaweiFaceAnalyzerFor(context: Context): HuaweiFaceDetectorAnalyzer =
286
+ HuaweiFaceDetectorAnalyzer.forDevice(context)
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ import type { FaceConfig, FaceScanResult } from "@smileid/usesmileid_bridge";
4
4
  * Google Mobile Services).
5
5
  *
6
6
  * Thin shim around the existing native session
7
- * `com.usesmileid.bridge.session.UseSmileIDFaceSession(HuaweiFaceDetectorAnalyzer())`
7
+ * `com.usesmileid.bridge.session.UseSmileIDFaceSession(HuaweiFaceDetectorAnalyzer.forDevice(context))`
8
8
  * shipped in the `com.smileidentity:huawei-face` AAR. The native side
9
9
  * runs the entire pipeline (analyzer + validator + transitioner +
10
10
  * state machine); this TS layer routes calls and validates wire
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smileid/usesmileid_huawei_face",
3
- "version": "12.3.1-SNAPSHOT.77",
3
+ "version": "12.4.0",
4
4
  "description": "Huawei HMS face detection implementation for the UseSmileID React Native (Expo) SDK.",
5
5
  "homepage": "https://usesmileid.com",
6
6
  "repository": {
@@ -47,8 +47,8 @@
47
47
  "CHANGELOG.md"
48
48
  ],
49
49
  "dependencies": {
50
- "@smileid/usesmileid_bridge": "12.3.1-SNAPSHOT.77",
51
- "@smileid/usesmileid_platform_interface": "12.3.1-SNAPSHOT.77"
50
+ "@smileid/usesmileid_bridge": "12.4.0",
51
+ "@smileid/usesmileid_platform_interface": "12.4.0"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "expo": ">=56.0.0",
@@ -58,7 +58,7 @@
58
58
  "devDependencies": {
59
59
  "@types/node": "^26.6.4",
60
60
  "expo": "~57.0.26",
61
- "expo-modules-core": "^57.0.23",
61
+ "expo-modules-core": "^57.0.24",
62
62
  "react-native": "^0.86.3",
63
63
  "typescript": "^6.0.3"
64
64
  },