@regulaforensics/face-sdk 7.1.196-nightly → 7.1.201-nightly

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.
Files changed (53) hide show
  1. package/README.md +1 -1
  2. package/RNFaceSDK.podspec +2 -2
  3. package/android/CVDFaceSDK.kt +22 -8
  4. package/android/src/main/java/com/regula/plugin/facesdk/Config.kt +7 -1
  5. package/android/src/main/java/com/regula/plugin/facesdk/JSONConstructor.kt +2 -0
  6. package/android/src/main/java/com/regula/plugin/facesdk/Main.kt +2 -7
  7. package/android/src/main/java/com/regula/plugin/facesdk/RNFaceApiModule.kt +16 -6
  8. package/android/src/main/java/com/regula/plugin/facesdk/Utils.kt +1 -1
  9. package/examples/capacitor/README.md +1 -1
  10. package/examples/capacitor/android/app/capacitor.build.gradle +5 -4
  11. package/examples/capacitor/android/capacitor.settings.gradle +3 -0
  12. package/examples/capacitor/android/gradle/wrapper/gradle-wrapper.properties +1 -1
  13. package/examples/capacitor/android/variables.gradle +12 -12
  14. package/examples/capacitor/ios/App/Podfile +3 -0
  15. package/examples/capacitor/ios/App/Podfile.lock +72 -0
  16. package/examples/capacitor/package-lock.json +11336 -0
  17. package/examples/capacitor/package.json +16 -18
  18. package/examples/capacitor/scripts/setup.sh +2 -0
  19. package/examples/capacitor/src/pages/Home.tsx +16 -12
  20. package/examples/cordova/README.md +1 -1
  21. package/examples/cordova/package-lock.json +1373 -0
  22. package/examples/cordova/package.json +1 -1
  23. package/examples/cordova/scripts/setup.sh +5 -1
  24. package/examples/ionic/README.md +1 -1
  25. package/examples/ionic/package-lock.json +15761 -0
  26. package/examples/ionic/package.json +1 -1
  27. package/examples/ionic/scripts/setup.sh +5 -1
  28. package/examples/ionic/src/app/home/home.page.ts +11 -11
  29. package/examples/react-native/Gemfile.lock +23 -21
  30. package/examples/react-native/ios/Podfile +2 -0
  31. package/examples/react-native/ios/Podfile.lock +471 -424
  32. package/examples/react-native/package-lock.json +615 -702
  33. package/examples/react-native/package.json +6 -6
  34. package/examples/react-native/scripts/android.sh +4 -0
  35. package/examples/react-native/scripts/ios.sh +4 -0
  36. package/ios/RFSWJSONConstructor.m +13 -15
  37. package/ios/RFSWMain.m +1 -1
  38. package/package.json +1 -1
  39. package/plugin.xml +3 -3
  40. package/www/capacitor/detect_faces/detect_faces_request.js +2 -0
  41. package/www/capacitor/image_quality/image_quality_characteristic.js +2 -0
  42. package/www/capacitor/image_quality/image_quality_group.js +1 -0
  43. package/www/capacitor/internal/bridge.js +8 -7
  44. package/www/capacitor/person_database/person_database.js +1 -1
  45. package/www/cordova.js +84 -75
  46. package/www/react-native/detect_faces/detect_faces_request.js +2 -0
  47. package/www/react-native/image_quality/image_quality_characteristic.js +2 -0
  48. package/www/react-native/image_quality/image_quality_group.js +1 -0
  49. package/www/react-native/internal/bridge.js +8 -7
  50. package/www/react-native/person_database/person_database.js +1 -1
  51. package/www/types/person_database/person_database.d.ts +1 -1
  52. package/.gitlab/report.yaml +0 -75
  53. package/.gitlab-ci.yml +0 -49
package/README.md CHANGED
@@ -3,7 +3,7 @@ Face SDK is a framework that is used for face matching, recognition and liveness
3
3
  This plugin makes possible to use it with react-native, cordova and ionic applications.
4
4
 
5
5
  ## Demo applications
6
- In the [examples](examples/) folder you can find demo 4 applications:
6
+ In the [examples](examples/) folder you can find 4 demo applications:
7
7
  * [React-native](examples/react-native)
8
8
  * [Cordova](examples/cordova)
9
9
  * [Ionic(ionic app with cordova, angular)](examples/ionic)
package/RNFaceSDK.podspec CHANGED
@@ -5,7 +5,7 @@ source = File.join(__dir__, 'ios')
5
5
 
6
6
  Pod::Spec.new do |s|
7
7
  s.name = 'RNFaceSDK'
8
- s.version = '7.1.196-nightly'
8
+ s.version = '7.1.201-nightly'
9
9
  s.summary = package['description']
10
10
  s.license = package['license']
11
11
 
@@ -13,7 +13,7 @@ Pod::Spec.new do |s|
13
13
  s.homepage = 'https://regulaforensics.com'
14
14
 
15
15
  s.source = { http: "file:#{source}" }
16
- s.ios.deployment_target = '12.0'
16
+ s.ios.deployment_target = '13.0'
17
17
  s.source_files = 'ios/**/*.{h,m}'
18
18
  s.exclude_files = [ 'ios/CVDFaceSDK.h', 'ios/CVDFaceSDK.m' ]
19
19
  s.dependency 'FaceSDKNightly', '7.1.2555'
@@ -1,19 +1,27 @@
1
1
  package com.regula.plugin.facesdk
2
2
 
3
+ import android.content.Context
4
+ import android.util.Log
3
5
  import org.apache.cordova.CallbackContext
4
6
  import org.apache.cordova.CordovaPlugin
5
- import org.apache.cordova.CordovaWebView
6
7
  import org.apache.cordova.PluginResult
7
8
  import org.json.JSONArray
8
9
 
9
- lateinit var args: JSONArray
10
- lateinit var eventSender: CordovaWebView
11
10
  val eventCallbackIds = mutableMapOf<String, String>()
12
11
 
12
+ lateinit var args: JSONArray
13
+ lateinit var binding: CordovaPlugin
14
+ val context: Context
15
+ get() = binding.cordova.context
16
+
13
17
  fun sendEvent(callbackId: String, data: Any? = "") {
14
- val pluginResult = PluginResult(PluginResult.Status.OK, data.toSendable() as String?)
18
+ val pluginResult = when (data) {
19
+ is Int -> PluginResult(PluginResult.Status.OK, data)
20
+ is Boolean -> PluginResult(PluginResult.Status.OK, data)
21
+ else -> PluginResult(PluginResult.Status.OK, data.toSendable() as String?)
22
+ }
15
23
  pluginResult.keepCallback = true
16
- eventSender.sendPluginResult(pluginResult, eventCallbackIds[callbackId] ?: callbackId)
24
+ binding.webView.sendPluginResult(pluginResult, eventCallbackIds[callbackId] ?: callbackId)
17
25
  }
18
26
 
19
27
  @Suppress("UNCHECKED_CAST")
@@ -22,13 +30,19 @@ fun <T> argsNullable(index: Int): T? = if (args.get(index).toString() != "null")
22
30
  } else null
23
31
 
24
32
  class CVDFaceSDK : CordovaPlugin() {
33
+ init {
34
+ binding = this
35
+ }
36
+
25
37
  override fun execute(action: String, arguments: JSONArray, callbackContext: CallbackContext): Boolean {
26
- activity = cordova.activity
27
- eventSender = webView
28
38
  args = arguments
29
39
  val method = args.remove(0) as String
30
40
  if (method == "setEvent") eventCallbackIds[args(0)] = callbackContext.callbackId
31
- methodCall(method) { data: Any? -> sendEvent(callbackContext.callbackId, data) }
41
+ try {
42
+ methodCall(method) { data: Any? -> sendEvent(callbackContext.callbackId, data) }
43
+ } catch (error: Exception) {
44
+ Log.e("REGULA", "Caught exception in \"$method\" function:", error)
45
+ }
32
46
  return true
33
47
  }
34
48
  }
@@ -1,3 +1,5 @@
1
+ @file:Suppress("EnumValuesSoftDeprecate")
2
+
1
3
  package com.regula.plugin.facesdk
2
4
 
3
5
  import com.regula.facesdk.configuration.Customization
@@ -20,6 +22,7 @@ fun setFaceCaptureConfig(builder: FaceCaptureConfiguration.Builder, config: JSON
20
22
  "closeButtonEnabled" -> builder.setCloseButtonEnabled(v as Boolean)
21
23
  "torchButtonEnabled" -> builder.setTorchButtonEnabled(v as Boolean)
22
24
  "vibrateOnSteps" -> builder.setVibrateOnStep(v as Boolean)
25
+ "detectOcclusion" -> builder.setDetectOcclusion(v as Boolean)
23
26
  "cameraPositionAndroid" -> builder.setCameraId(v.toInt())
24
27
  "screenOrientation" -> builder.setScreenOrientation(*screenOrientationArrayFromJSON(v as JSONArray))
25
28
  "timeout" -> builder.setTimeout(v.toFloat())
@@ -33,6 +36,7 @@ fun getFaceCaptureConfig(input: FaceCaptureConfiguration) = mapOf(
33
36
  "closeButtonEnabled" to input.isCloseButtonEnabled,
34
37
  "torchButtonEnabled" to input.isTorchButtonEnabled,
35
38
  "vibrateOnSteps" to input.isVibrateOnSteps,
39
+ "detectOcclusion" to input.isDetectOcclusion,
36
40
  "cameraPositionAndroid" to input.cameraId,
37
41
  "screenOrientation" to generateScreenOrientationArray(input.screenOrientation),
38
42
  "timeout" to input.timeout,
@@ -78,11 +82,13 @@ fun getLivenessConfig(input: LivenessConfiguration) = mapOf(
78
82
  fun setMatchFacesConfig(builder: MatchFacesConfiguration.Builder, config: JSONObject) = config.forEach { k, v ->
79
83
  when (k) {
80
84
  "processingMode" -> builder.setProcessingMode(ProcessingMode.values()[v.toInt()])
85
+ "locationTrackingEnabled" -> builder.setLocationTrackingEnabled(v as Boolean)
81
86
  }
82
87
  }
83
88
 
84
89
  fun getMatchFacesConfig(input: MatchFacesConfiguration) = mapOf(
85
- "processingMode" to input.processingMode.ordinal
90
+ "processingMode" to input.processingMode.ordinal,
91
+ "locationTrackingEnabled" to input.isLocationTrackingEnabled
86
92
  ).toJson()
87
93
 
88
94
  fun setCustomization(input: Customization, config: JSONObject) = config.forEach { key, value ->
@@ -1,3 +1,5 @@
1
+ @file:Suppress("EnumValuesSoftDeprecate", "unused")
2
+
1
3
  package com.regula.plugin.facesdk
2
4
 
3
5
  import android.annotation.SuppressLint
@@ -1,7 +1,5 @@
1
1
  package com.regula.plugin.facesdk
2
2
 
3
- import android.annotation.SuppressLint
4
- import android.app.Activity
5
3
  import com.regula.plugin.facesdk.Convert.toBase64
6
4
  import com.regula.common.LocalizationCallbacks
7
5
  import com.regula.facesdk.FaceSDK.Instance
@@ -68,11 +66,6 @@ fun methodCall(method: String, callback: (Any?) -> Unit): Any = when (method) {
68
66
  inline fun <reified T> args(index: Int) = argsNullable<T>(index)!!
69
67
  typealias Callback = (Any?) -> Unit
70
68
 
71
- @SuppressLint("StaticFieldLeak")
72
- lateinit var activity: Activity
73
- val context
74
- get() = activity
75
-
76
69
  const val cameraSwitchEvent = "cameraSwitchEvent"
77
70
  const val livenessNotificationEvent = "livenessNotificationEvent"
78
71
  const val videoEncoderCompletionEvent = "video_encoder_completion"
@@ -136,11 +129,13 @@ fun stopLiveness() = Instance().stopLivenessProcessing(context)
136
129
 
137
130
  fun matchFaces(callback: Callback, request: JSONObject, config: JSONObject?) = config?.let {
138
131
  Instance().matchFaces(
132
+ context,
139
133
  matchFacesRequestFromJSON(request),
140
134
  matchFacesConfigFromJSON(it),
141
135
  matchFacesCompletion(callback)
142
136
  )
143
137
  } ?: Instance().matchFaces(
138
+ context,
144
139
  matchFacesRequestFromJSON(request),
145
140
  matchFacesCompletion(callback)
146
141
  )
@@ -1,5 +1,7 @@
1
1
  package com.regula.plugin.facesdk
2
2
 
3
+ import android.content.Context
4
+ import android.util.Log
3
5
  import com.facebook.react.ReactPackage
4
6
  import com.facebook.react.bridge.Promise
5
7
  import com.facebook.react.bridge.ReactApplicationContext
@@ -13,13 +15,16 @@ import org.json.JSONArray
13
15
  import org.json.JSONObject
14
16
 
15
17
  var listenerCount = 0
18
+
16
19
  lateinit var args: JSONArray
17
- lateinit var reactContext: ReactContext
20
+ lateinit var binding: ReactContext
21
+ val context: Context
22
+ get() = binding.applicationContext
18
23
 
19
24
  fun sendEvent(event: String, data: Any? = "") {
20
25
  if (listenerCount <= 0) return
21
26
  val result = if (data is JSONObject || data is JSONArray) data.toString() else data.toString() + ""
22
- reactContext.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java).emit(event, result)
27
+ binding.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java).emit(event, result)
23
28
  }
24
29
 
25
30
  @Suppress("UNCHECKED_CAST")
@@ -30,15 +35,16 @@ fun <T> argsNullable(index: Int): T? {
30
35
  return value as T
31
36
  }
32
37
 
38
+ @Suppress("unused")
33
39
  class RNFaceSDKPackage : ReactPackage {
34
40
  override fun createNativeModules(rc: ReactApplicationContext) = listOf(RNFaceSDKModule(rc))
35
41
  override fun createViewManagers(rc: ReactApplicationContext) = emptyList<ViewManager<*, *>>()
36
42
  }
37
43
 
38
44
  @Suppress("unused", "UNUSED_PARAMETER")
39
- class RNFaceSDKModule(rc: ReactApplicationContext) : ReactContextBaseJavaModule(rc) {
45
+ class RNFaceSDKModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) {
40
46
  init {
41
- reactContext = rc
47
+ binding = reactContext
42
48
  }
43
49
 
44
50
  @ReactMethod
@@ -54,8 +60,12 @@ class RNFaceSDKModule(rc: ReactApplicationContext) : ReactContextBaseJavaModule(
54
60
  @ReactMethod
55
61
  fun exec(method: String, arguments: ReadableArray, promise: Promise) {
56
62
  args = JSONArray(arguments.toArrayList())
57
- reactContext.currentActivity?.let { activity = it }
58
- methodCall(method) { data -> promise.resolve(data.toSendable()) }
63
+ try {
64
+ methodCall(method) { data -> promise.resolve(data.toSendable()) }
65
+ } catch (error: Exception) {
66
+ Log.e("REGULA", "Caught exception in \"$method\" function:", error)
67
+ }
59
68
  }
69
+
60
70
  override fun getName() = "RNFaceSDK"
61
71
  }
@@ -1,4 +1,4 @@
1
- @file:Suppress("UNCHECKED_CAST")
1
+ @file:Suppress("UNCHECKED_CAST", "EnumValuesSoftDeprecate")
2
2
 
3
3
  package com.regula.plugin.facesdk
4
4
 
@@ -23,7 +23,7 @@
23
23
  ```bash
24
24
  npm uninstall @regulaforensics/face-core-basic
25
25
  npm install @regulaforensics/face-core-match
26
- ionic cap sync
26
+ npm run setup
27
27
  ```
28
28
 
29
29
  4. Turn off the internet and run the app.
@@ -2,21 +2,22 @@
2
2
 
3
3
  android {
4
4
  compileOptions {
5
- sourceCompatibility JavaVersion.VERSION_17
6
- targetCompatibility JavaVersion.VERSION_17
5
+ sourceCompatibility JavaVersion.VERSION_21
6
+ targetCompatibility JavaVersion.VERSION_21
7
7
  }
8
8
  }
9
9
 
10
10
  apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
11
11
  dependencies {
12
12
  implementation project(':capacitor-app')
13
+ implementation project(':capacitor-dialog')
13
14
  implementation project(':capacitor-haptics')
14
15
  implementation project(':capacitor-keyboard')
15
16
  implementation project(':capacitor-status-bar')
16
-
17
+ implementation "androidx.core:core:1.6.+"
18
+ implementation "androidx.webkit:webkit:1.4.0"
17
19
  }
18
20
 
19
-
20
21
  if (hasProperty('postBuildExtras')) {
21
22
  postBuildExtras()
22
23
  }
@@ -5,6 +5,9 @@ project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/
5
5
  include ':capacitor-app'
6
6
  project(':capacitor-app').projectDir = new File('../node_modules/@capacitor/app/android')
7
7
 
8
+ include ':capacitor-dialog'
9
+ project(':capacitor-dialog').projectDir = new File('../node_modules/@capacitor/dialog/android')
10
+
8
11
  include ':capacitor-haptics'
9
12
  project(':capacitor-haptics').projectDir = new File('../node_modules/@capacitor/haptics/android')
10
13
 
@@ -1,6 +1,6 @@
1
1
  distributionBase=GRADLE_USER_HOME
2
2
  distributionPath=wrapper/dists
3
- distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
3
+ distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip
4
4
  networkTimeout=10000
5
5
  zipStoreBase=GRADLE_USER_HOME
6
6
  zipStorePath=wrapper/dists
@@ -1,16 +1,16 @@
1
1
  ext {
2
- minSdkVersion = 24
3
- compileSdkVersion = 34
4
- targetSdkVersion = 34
5
- androidxActivityVersion = '1.8.2'
6
- androidxAppCompatVersion = '1.6.1'
2
+ minSdkVersion = 23
3
+ compileSdkVersion = 35
4
+ targetSdkVersion = 35
5
+ androidxActivityVersion = '1.9.2'
6
+ androidxAppCompatVersion = '1.7.0'
7
7
  androidxCoordinatorLayoutVersion = '1.2.0'
8
- androidxCoreVersion = '1.12.0'
9
- androidxFragmentVersion = '1.5.6'
10
- coreSplashScreenVersion = '1.0.0'
11
- androidxWebkitVersion = '1.6.1'
8
+ androidxCoreVersion = '1.15.0'
9
+ androidxFragmentVersion = '1.8.4'
10
+ coreSplashScreenVersion = '1.0.1'
11
+ androidxWebkitVersion = '1.12.1'
12
12
  junitVersion = '4.13.2'
13
- androidxJunitVersion = '1.1.5'
14
- androidxEspressoCoreVersion = '3.5.1'
15
- cordovaAndroidVersion = '12.0.1'
13
+ androidxJunitVersion = '1.2.1'
14
+ androidxEspressoCoreVersion = '3.6.1'
15
+ cordovaAndroidVersion = '10.1.1'
16
16
  }
@@ -1,3 +1,5 @@
1
+ source "https://github.com/CocoaPods/Specs.git"
2
+
1
3
  require_relative '../../node_modules/@capacitor/ios/scripts/pods_helpers'
2
4
 
3
5
  platform :ios, '14.0'
@@ -12,6 +14,7 @@ def capacitor_pods
12
14
  pod 'Capacitor', :path => '../../node_modules/@capacitor/ios'
13
15
  pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios'
14
16
  pod 'CapacitorApp', :path => '../../node_modules/@capacitor/app'
17
+ pod 'CapacitorDialog', :path => '../../node_modules/@capacitor/dialog'
15
18
  pod 'CapacitorHaptics', :path => '../../node_modules/@capacitor/haptics'
16
19
  pod 'CapacitorKeyboard', :path => '../../node_modules/@capacitor/keyboard'
17
20
  pod 'CapacitorStatusBar', :path => '../../node_modules/@capacitor/status-bar'
@@ -0,0 +1,72 @@
1
+ PODS:
2
+ - Capacitor (7.0.1):
3
+ - CapacitorCordova
4
+ - CapacitorApp (7.0.0):
5
+ - Capacitor
6
+ - CapacitorCordova (7.0.1)
7
+ - CapacitorDialog (7.0.0):
8
+ - Capacitor
9
+ - CapacitorHaptics (7.0.0):
10
+ - Capacitor
11
+ - CapacitorKeyboard (7.0.0):
12
+ - Capacitor
13
+ - CapacitorStatusBar (7.0.0):
14
+ - Capacitor
15
+ - CordovaPlugins (7.0.1):
16
+ - CapacitorCordova
17
+ - CordovaPluginsResources (0.0.105)
18
+
19
+ DEPENDENCIES:
20
+ - "Capacitor (from `../../node_modules/@capacitor/ios`)"
21
+ - "CapacitorApp (from `../../node_modules/@capacitor/app`)"
22
+ - "CapacitorCordova (from `../../node_modules/@capacitor/ios`)"
23
+ - "CapacitorDialog (from `../../node_modules/@capacitor/dialog`)"
24
+ - "CapacitorHaptics (from `../../node_modules/@capacitor/haptics`)"
25
+ - "CapacitorKeyboard (from `../../node_modules/@capacitor/keyboard`)"
26
+ - "CapacitorStatusBar (from `../../node_modules/@capacitor/status-bar`)"
27
+ - CordovaPlugins (from `../capacitor-cordova-ios-plugins`)
28
+ - CordovaPluginsResources (from `../capacitor-cordova-ios-plugins`)
29
+
30
+ SPEC REPOS:
31
+ https://github.com/CocoaPods/Specs.git:
32
+ - FaceCoreBasic
33
+ - FaceSDK
34
+ - RegulaCommon
35
+
36
+ EXTERNAL SOURCES:
37
+ Capacitor:
38
+ :path: "../../node_modules/@capacitor/ios"
39
+ CapacitorApp:
40
+ :path: "../../node_modules/@capacitor/app"
41
+ CapacitorCordova:
42
+ :path: "../../node_modules/@capacitor/ios"
43
+ CapacitorDialog:
44
+ :path: "../../node_modules/@capacitor/dialog"
45
+ CapacitorHaptics:
46
+ :path: "../../node_modules/@capacitor/haptics"
47
+ CapacitorKeyboard:
48
+ :path: "../../node_modules/@capacitor/keyboard"
49
+ CapacitorStatusBar:
50
+ :path: "../../node_modules/@capacitor/status-bar"
51
+ CordovaPlugins:
52
+ :path: "../capacitor-cordova-ios-plugins"
53
+ CordovaPluginsResources:
54
+ :path: "../capacitor-cordova-ios-plugins"
55
+
56
+ SPEC CHECKSUMS:
57
+ Capacitor: de199cba6c8b20995428ad0b7cb0bc6ca625ffd4
58
+ CapacitorApp: 9cb31064a6c6bb2b1438583733a7bf45557fc1da
59
+ CapacitorCordova: 63d476958d5022d76f197031e8b7ea3519988c64
60
+ CapacitorDialog: 6dc6bdd5d285118ff3732470b9f169c14fc564a7
61
+ CapacitorHaptics: 7be406a91e4eb87287f321c6c68e1709d6837b3a
62
+ CapacitorKeyboard: 4db71e694e7afb5d7c0be09b05495c19f7d6c914
63
+ CapacitorStatusBar: a8c4c83ed2e973bdafb979e80e4b00d027832cb7
64
+ CordovaPlugins: a27ffb01883b6395654b17c5bf6efdeb74bcb275
65
+ CordovaPluginsResources: 0c211f770ed91763a179ebcd9b9346e120b70662
66
+ FaceCoreBasic: a2ff9ed108c4d9d67e892df6be5ccc4729f3cda5
67
+ FaceSDK: e96016e36d5507ad9d9ee3b011d735f5fe51829f
68
+ RegulaCommon: 2a6406d2d3ebbd720b66a9cfa5b9631701d343eb
69
+
70
+ PODFILE CHECKSUM: fad7821e0f76a12156270cf41a925118bf54bbe3
71
+
72
+ COCOAPODS: 1.16.2