@regulaforensics/face-sdk 6.5.115-beta → 6.5.132-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 (42) hide show
  1. package/.gitlab/report.yaml +75 -0
  2. package/.gitlab-ci.yml +49 -0
  3. package/README.md +1 -1
  4. package/RNFaceSDK.podspec +2 -2
  5. package/android/CVDFaceSDK.kt +7 -16
  6. package/android/build.gradle +2 -2
  7. package/android/cordova.gradle +2 -2
  8. package/android/src/main/java/com/regula/plugin/facesdk/Config.kt +1 -7
  9. package/android/src/main/java/com/regula/plugin/facesdk/JSONConstructor.kt +0 -2
  10. package/android/src/main/java/com/regula/plugin/facesdk/Main.kt +7 -2
  11. package/android/src/main/java/com/regula/plugin/facesdk/RNFaceApiModule.kt +5 -9
  12. package/android/src/main/java/com/regula/plugin/facesdk/Utils.kt +1 -1
  13. package/examples/capacitor/android/app/capacitor.build.gradle +4 -5
  14. package/examples/capacitor/android/capacitor.settings.gradle +0 -3
  15. package/examples/capacitor/android/gradle/wrapper/gradle-wrapper.properties +1 -1
  16. package/examples/capacitor/android/variables.gradle +12 -12
  17. package/examples/capacitor/ios/App/Podfile +0 -1
  18. package/examples/capacitor/package.json +19 -17
  19. package/examples/capacitor/scripts/setup.sh +0 -2
  20. package/examples/capacitor/src/pages/Home.tsx +12 -16
  21. package/examples/cordova/package.json +2 -2
  22. package/examples/cordova/scripts/setup.sh +1 -4
  23. package/examples/ionic/package.json +2 -2
  24. package/examples/ionic/scripts/setup.sh +1 -4
  25. package/examples/ionic/src/app/home/home.page.ts +11 -11
  26. package/examples/react-native/ios/Podfile.lock +7 -7
  27. package/examples/react-native/package.json +2 -2
  28. package/examples/react-native/scripts/android.sh +0 -4
  29. package/examples/react-native/scripts/ios.sh +0 -4
  30. package/package.json +1 -1
  31. package/plugin.xml +3 -2
  32. package/www/capacitor/image_quality/image_quality_characteristic.js +0 -2
  33. package/www/capacitor/image_quality/image_quality_group.js +0 -1
  34. package/www/capacitor/internal/bridge.js +7 -8
  35. package/www/cordova.js +66 -72
  36. package/www/react-native/image_quality/image_quality_characteristic.js +0 -2
  37. package/www/react-native/image_quality/image_quality_group.js +0 -1
  38. package/www/react-native/internal/bridge.js +7 -8
  39. package/examples/capacitor/ios/App/Podfile.lock +0 -78
  40. package/examples/capacitor/package-lock.json +0 -11336
  41. package/examples/cordova/package-lock.json +0 -1373
  42. package/examples/ionic/package-lock.json +0 -15761
@@ -0,0 +1,75 @@
1
+ spec:
2
+ inputs:
3
+ stage:
4
+ default: reports
5
+ image:
6
+ default: ubuntu:22.04
7
+ ignore_vulnerabilities:
8
+ default: "false"
9
+ sast_report_file:
10
+ default: gl-sast-report.json
11
+ secret_detection_report_file:
12
+ default: gl-secret-detection-report.json
13
+ dependency_scanning_report_file:
14
+ default: gl-dependency-scanning-report.json
15
+ ---
16
+
17
+ view reports:
18
+ image: $[[ inputs.image ]]
19
+ stage: $[[ inputs.stage ]]
20
+ variables:
21
+ IGNORE_VULNERABILITIES: $[[ inputs.ignore_vulnerabilities ]]
22
+ SAST_REPORT_FILE: $[[ inputs.sast_report_file ]]
23
+ SECRET_DETECTION_REPORT_FILE: $[[ inputs.secret_detection_report_file ]]
24
+ DEPENDENCY_SCANNING_REPORT_FILE: $[[ inputs.dependency_scanning_report_file ]]
25
+ RED: \033[0;31m
26
+ YELLOW: \033[1;33m
27
+ GREEN: \033[0;32m
28
+ NC: \033[0m
29
+ needs:
30
+ - job: semgrep-sast
31
+ artifacts: true
32
+ - job: secret_detection
33
+ artifacts: true
34
+ - job: gemnasium-dependency_scanning
35
+ artifacts: true
36
+ rules:
37
+ - if: $CI_PIPELINE_SOURCE == "merge_request_event"
38
+ script:
39
+ - ls -la
40
+ - apt update && apt install -y jq
41
+ - |
42
+ for f in SAST_REPORT_FILE SECRET_DETECTION_REPORT_FILE DEPENDENCY_SCANNING_REPORT_FILE
43
+ do
44
+ if [[ -f "${!f}" ]]
45
+ then
46
+ echo -e "${GREEN}File ${!f} exists, adding report${NC}"
47
+ r=${f/%_FILE}
48
+ declare $r="$(cat ${!f} | jq 'select(.vulnerabilities != []).vulnerabilities')"
49
+ if [[ ! -z "${!r}" ]]
50
+ then
51
+ VULNERABILITIES_FOUND=true
52
+ echo -e "${RED}Found $r vulnerabilities${NC}"
53
+ echo "${!r}"
54
+ echo
55
+ fi
56
+ else
57
+ echo -e "${YELLOW}File ${!f} doesn't exist, skipping${NC}"
58
+ fi
59
+ done
60
+
61
+ if [[ "$VULNERABILITIES_FOUND" == true ]]
62
+ then
63
+ if [[ "$IGNORE_VULNERABILITIES" == true ]]
64
+ then
65
+ echo -e "${GREEN}All found vulnerabilities were ignored due to IGNORE_VULNERABILITIES=true${NC}"
66
+ exit 0
67
+ else
68
+ echo -e "${RED}Vulnerabilities found, please see reports above${NC}"
69
+ exit 1
70
+ fi
71
+ fi
72
+
73
+ echo -e "${GREEN}No vulnerabilities found${NC}"
74
+
75
+ exit 0
package/.gitlab-ci.yml ADDED
@@ -0,0 +1,49 @@
1
+ stages:
2
+ - test
3
+ - reports
4
+
5
+ include:
6
+ - template: Jobs/SAST.gitlab-ci.yml
7
+ - template: Jobs/Secret-Detection.gitlab-ci.yml
8
+ - template: Jobs/Dependency-Scanning.gitlab-ci.yml
9
+ - local: .gitlab/report.yaml
10
+ rules:
11
+ - if: $CI_PIPELINE_SOURCE == "merge_request_event"
12
+ inputs:
13
+ stage: reports
14
+ image: ubuntu:22.04
15
+ ignore_vulnerabilities: "false"
16
+ sast_report_file: gl-sast-report.json
17
+ secret_detection_report_file: gl-secret-detection-report.json
18
+ dependency_scanning_report_file: gl-dependency-scanning-report.json
19
+
20
+ trivy scan:
21
+ stage: test
22
+ image: aquasec/trivy
23
+ rules:
24
+ - if: $CI_PIPELINE_SOURCE == "merge_request_event"
25
+ script:
26
+ - trivy fs --severity CRITICAL,HIGH,MEDIUM,LOW --ignore-unfixed --db-repository container-registry.regula.local:80/aquasecurity/trivy-db:2 --exit-code 1 .
27
+
28
+ semgrep-sast:
29
+ rules:
30
+ - if: $CI_PIPELINE_SOURCE == "merge_request_event"
31
+ artifacts:
32
+ paths:
33
+ - gl-sast-report.json
34
+
35
+ secret_detection:
36
+ rules:
37
+ - if: $CI_PIPELINE_SOURCE == "merge_request_event"
38
+ artifacts:
39
+ paths:
40
+ - gl-secret-detection-report.json
41
+
42
+ gemnasium-dependency_scanning:
43
+ variables:
44
+ DS_MAX_DEPTH: -1
45
+ rules:
46
+ - if: $CI_PIPELINE_SOURCE == "merge_request_event"
47
+ artifacts:
48
+ paths:
49
+ - gl-dependency-scanning-report.json
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 4 demo applications:
6
+ In the [examples](examples/) folder you can find demo 4 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 = '6.5.115-beta'
8
+ s.version = '6.5.132-nightly'
9
9
  s.summary = package['description']
10
10
  s.license = package['license']
11
11
 
@@ -16,6 +16,6 @@ Pod::Spec.new do |s|
16
16
  s.ios.deployment_target = '12.0'
17
17
  s.source_files = 'ios/**/*.{h,m}'
18
18
  s.exclude_files = [ 'ios/CVDFaceSDK.h', 'ios/CVDFaceSDK.m' ]
19
- s.dependency 'FaceSDK', '6.4.2321'
19
+ s.dependency 'FaceSDKNightly', '6.4.2460'
20
20
  s.dependency 'React'
21
21
  end
@@ -1,26 +1,19 @@
1
1
  package com.regula.plugin.facesdk
2
2
 
3
- import android.content.Context
4
3
  import org.apache.cordova.CallbackContext
5
4
  import org.apache.cordova.CordovaPlugin
5
+ import org.apache.cordova.CordovaWebView
6
6
  import org.apache.cordova.PluginResult
7
7
  import org.json.JSONArray
8
8
 
9
- val eventCallbackIds = mutableMapOf<String, String>()
10
-
11
9
  lateinit var args: JSONArray
12
- lateinit var binding: CordovaPlugin
13
- val context: Context
14
- get() = binding.cordova.context
10
+ lateinit var eventSender: CordovaWebView
11
+ val eventCallbackIds = mutableMapOf<String, String>()
15
12
 
16
13
  fun sendEvent(callbackId: String, data: Any? = "") {
17
- val pluginResult = when (data) {
18
- is Int -> PluginResult(PluginResult.Status.OK, data)
19
- is Boolean -> PluginResult(PluginResult.Status.OK, data)
20
- else -> PluginResult(PluginResult.Status.OK, data.toSendable() as String?)
21
- }
14
+ val pluginResult = PluginResult(PluginResult.Status.OK, data.toSendable() as String?)
22
15
  pluginResult.keepCallback = true
23
- binding.webView.sendPluginResult(pluginResult, eventCallbackIds[callbackId] ?: callbackId)
16
+ eventSender.sendPluginResult(pluginResult, eventCallbackIds[callbackId] ?: callbackId)
24
17
  }
25
18
 
26
19
  @Suppress("UNCHECKED_CAST")
@@ -29,11 +22,9 @@ fun <T> argsNullable(index: Int): T? = if (args.get(index).toString() != "null")
29
22
  } else null
30
23
 
31
24
  class CVDFaceSDK : CordovaPlugin() {
32
- init {
33
- binding = this
34
- }
35
-
36
25
  override fun execute(action: String, arguments: JSONArray, callbackContext: CallbackContext): Boolean {
26
+ activity = cordova.activity
27
+ eventSender = webView
37
28
  args = arguments
38
29
  val method = args.remove(0) as String
39
30
  if (method == "setEvent") eventCallbackIds[args(0)] = callbackContext.callbackId
@@ -32,7 +32,7 @@ android {
32
32
  rootProject.allprojects {
33
33
  repositories {
34
34
  maven {
35
- url "https://maven.regulaforensics.com/RegulaDocumentReader"
35
+ url "https://maven.regulaforensics.com/RegulaDocumentReader/Nightly"
36
36
  }
37
37
  }
38
38
  }
@@ -41,7 +41,7 @@ dependencies {
41
41
  //noinspection GradleDynamicVersion
42
42
  implementation 'com.facebook.react:react-native:+'
43
43
  //noinspection GradleDependency
44
- implementation('com.regula.face:api:6.4.3456'){
44
+ implementation('com.regula.face:api:6.4.3589'){
45
45
  transitive = true
46
46
  }
47
47
  }
@@ -6,13 +6,13 @@ android {
6
6
 
7
7
  repositories {
8
8
  maven {
9
- url "https://maven.regulaforensics.com/RegulaDocumentReader"
9
+ url "https://maven.regulaforensics.com/RegulaDocumentReader/Nightly"
10
10
  }
11
11
  }
12
12
 
13
13
  dependencies {
14
14
  //noinspection GradleDependency
15
- implementation('com.regula.face:api:6.4.3456'){
15
+ implementation('com.regula.face:api:6.4.3589'){
16
16
  transitive = true
17
17
  }
18
18
  }
@@ -1,5 +1,3 @@
1
- @file:Suppress("EnumValuesSoftDeprecate")
2
-
3
1
  package com.regula.plugin.facesdk
4
2
 
5
3
  import com.regula.facesdk.configuration.Customization
@@ -22,7 +20,6 @@ fun setFaceCaptureConfig(builder: FaceCaptureConfiguration.Builder, config: JSON
22
20
  "closeButtonEnabled" -> builder.setCloseButtonEnabled(v as Boolean)
23
21
  "torchButtonEnabled" -> builder.setTorchButtonEnabled(v as Boolean)
24
22
  "vibrateOnSteps" -> builder.setVibrateOnStep(v as Boolean)
25
- "detectOcclusion" -> builder.setDetectOcclusion(v as Boolean)
26
23
  "cameraPositionAndroid" -> builder.setCameraId(v.toInt())
27
24
  "screenOrientation" -> builder.setScreenOrientation(*screenOrientationArrayFromJSON(v as JSONArray))
28
25
  "timeout" -> builder.setTimeout(v.toFloat())
@@ -36,7 +33,6 @@ fun getFaceCaptureConfig(input: FaceCaptureConfiguration) = mapOf(
36
33
  "closeButtonEnabled" to input.isCloseButtonEnabled,
37
34
  "torchButtonEnabled" to input.isTorchButtonEnabled,
38
35
  "vibrateOnSteps" to input.isVibrateOnSteps,
39
- "detectOcclusion" to input.isDetectOcclusion,
40
36
  "cameraPositionAndroid" to input.cameraId,
41
37
  "screenOrientation" to generateScreenOrientationArray(input.screenOrientation),
42
38
  "timeout" to input.timeout,
@@ -82,13 +78,11 @@ fun getLivenessConfig(input: LivenessConfiguration) = mapOf(
82
78
  fun setMatchFacesConfig(builder: MatchFacesConfiguration.Builder, config: JSONObject) = config.forEach { k, v ->
83
79
  when (k) {
84
80
  "processingMode" -> builder.setProcessingMode(ProcessingMode.values()[v.toInt()])
85
- "locationTrackingEnabled" -> builder.setLocationTrackingEnabled(v as Boolean)
86
81
  }
87
82
  }
88
83
 
89
84
  fun getMatchFacesConfig(input: MatchFacesConfiguration) = mapOf(
90
- "processingMode" to input.processingMode.ordinal,
91
- "locationTrackingEnabled" to input.isLocationTrackingEnabled
85
+ "processingMode" to input.processingMode.ordinal
92
86
  ).toJson()
93
87
 
94
88
  fun setCustomization(input: Customization, config: JSONObject) = config.forEach { key, value ->
@@ -1,5 +1,3 @@
1
- @file:Suppress("EnumValuesSoftDeprecate", "unused")
2
-
3
1
  package com.regula.plugin.facesdk
4
2
 
5
3
  import android.annotation.SuppressLint
@@ -1,5 +1,7 @@
1
1
  package com.regula.plugin.facesdk
2
2
 
3
+ import android.annotation.SuppressLint
4
+ import android.app.Activity
3
5
  import com.regula.plugin.facesdk.Convert.toBase64
4
6
  import com.regula.common.LocalizationCallbacks
5
7
  import com.regula.facesdk.FaceSDK.Instance
@@ -66,6 +68,11 @@ fun methodCall(method: String, callback: (Any?) -> Unit): Any = when (method) {
66
68
  inline fun <reified T> args(index: Int) = argsNullable<T>(index)!!
67
69
  typealias Callback = (Any?) -> Unit
68
70
 
71
+ @SuppressLint("StaticFieldLeak")
72
+ lateinit var activity: Activity
73
+ val context
74
+ get() = activity
75
+
69
76
  const val cameraSwitchEvent = "cameraSwitchEvent"
70
77
  const val livenessNotificationEvent = "livenessNotificationEvent"
71
78
  const val videoEncoderCompletionEvent = "video_encoder_completion"
@@ -129,13 +136,11 @@ fun stopLiveness() = Instance().stopLivenessProcessing(context)
129
136
 
130
137
  fun matchFaces(callback: Callback, request: JSONObject, config: JSONObject?) = config?.let {
131
138
  Instance().matchFaces(
132
- context,
133
139
  matchFacesRequestFromJSON(request),
134
140
  matchFacesConfigFromJSON(it),
135
141
  matchFacesCompletion(callback)
136
142
  )
137
143
  } ?: Instance().matchFaces(
138
- context,
139
144
  matchFacesRequestFromJSON(request),
140
145
  matchFacesCompletion(callback)
141
146
  )
@@ -1,6 +1,5 @@
1
1
  package com.regula.plugin.facesdk
2
2
 
3
- import android.content.Context
4
3
  import com.facebook.react.ReactPackage
5
4
  import com.facebook.react.bridge.Promise
6
5
  import com.facebook.react.bridge.ReactApplicationContext
@@ -14,16 +13,13 @@ import org.json.JSONArray
14
13
  import org.json.JSONObject
15
14
 
16
15
  var listenerCount = 0
17
-
18
16
  lateinit var args: JSONArray
19
- lateinit var binding: ReactContext
20
- val context: Context
21
- get() = binding.applicationContext
17
+ lateinit var reactContext: ReactContext
22
18
 
23
19
  fun sendEvent(event: String, data: Any? = "") {
24
20
  if (listenerCount <= 0) return
25
21
  val result = if (data is JSONObject || data is JSONArray) data.toString() else data.toString() + ""
26
- binding.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java).emit(event, result)
22
+ reactContext.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java).emit(event, result)
27
23
  }
28
24
 
29
25
  @Suppress("UNCHECKED_CAST")
@@ -34,16 +30,15 @@ fun <T> argsNullable(index: Int): T? {
34
30
  return value as T
35
31
  }
36
32
 
37
- @Suppress("unused")
38
33
  class RNFaceSDKPackage : ReactPackage {
39
34
  override fun createNativeModules(rc: ReactApplicationContext) = listOf(RNFaceSDKModule(rc))
40
35
  override fun createViewManagers(rc: ReactApplicationContext) = emptyList<ViewManager<*, *>>()
41
36
  }
42
37
 
43
38
  @Suppress("unused", "UNUSED_PARAMETER")
44
- class RNFaceSDKModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) {
39
+ class RNFaceSDKModule(rc: ReactApplicationContext) : ReactContextBaseJavaModule(rc) {
45
40
  init {
46
- binding = reactContext
41
+ reactContext = rc
47
42
  }
48
43
 
49
44
  @ReactMethod
@@ -59,6 +54,7 @@ class RNFaceSDKModule(reactContext: ReactApplicationContext) : ReactContextBaseJ
59
54
  @ReactMethod
60
55
  fun exec(method: String, arguments: ReadableArray, promise: Promise) {
61
56
  args = JSONArray(arguments.toArrayList())
57
+ reactContext.currentActivity?.let { activity = it }
62
58
  methodCall(method) { data -> promise.resolve(data.toSendable()) }
63
59
  }
64
60
  override fun getName() = "RNFaceSDK"
@@ -1,4 +1,4 @@
1
- @file:Suppress("UNCHECKED_CAST", "EnumValuesSoftDeprecate")
1
+ @file:Suppress("UNCHECKED_CAST")
2
2
 
3
3
  package com.regula.plugin.facesdk
4
4
 
@@ -2,22 +2,21 @@
2
2
 
3
3
  android {
4
4
  compileOptions {
5
- sourceCompatibility JavaVersion.VERSION_21
6
- targetCompatibility JavaVersion.VERSION_21
5
+ sourceCompatibility JavaVersion.VERSION_17
6
+ targetCompatibility JavaVersion.VERSION_17
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')
14
13
  implementation project(':capacitor-haptics')
15
14
  implementation project(':capacitor-keyboard')
16
15
  implementation project(':capacitor-status-bar')
17
- implementation "androidx.core:core:1.6.+"
18
- implementation "androidx.webkit:webkit:1.4.0"
16
+
19
17
  }
20
18
 
19
+
21
20
  if (hasProperty('postBuildExtras')) {
22
21
  postBuildExtras()
23
22
  }
@@ -5,9 +5,6 @@ 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
-
11
8
  include ':capacitor-haptics'
12
9
  project(':capacitor-haptics').projectDir = new File('../node_modules/@capacitor/haptics/android')
13
10
 
@@ -1,6 +1,6 @@
1
1
  distributionBase=GRADLE_USER_HOME
2
2
  distributionPath=wrapper/dists
3
- distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip
3
+ distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-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 = 23
3
- compileSdkVersion = 35
4
- targetSdkVersion = 35
5
- androidxActivityVersion = '1.9.2'
6
- androidxAppCompatVersion = '1.7.0'
2
+ minSdkVersion = 24
3
+ compileSdkVersion = 34
4
+ targetSdkVersion = 34
5
+ androidxActivityVersion = '1.8.2'
6
+ androidxAppCompatVersion = '1.6.1'
7
7
  androidxCoordinatorLayoutVersion = '1.2.0'
8
- androidxCoreVersion = '1.15.0'
9
- androidxFragmentVersion = '1.8.4'
10
- coreSplashScreenVersion = '1.0.1'
11
- androidxWebkitVersion = '1.12.1'
8
+ androidxCoreVersion = '1.12.0'
9
+ androidxFragmentVersion = '1.5.6'
10
+ coreSplashScreenVersion = '1.0.0'
11
+ androidxWebkitVersion = '1.6.1'
12
12
  junitVersion = '4.13.2'
13
- androidxJunitVersion = '1.2.1'
14
- androidxEspressoCoreVersion = '3.6.1'
15
- cordovaAndroidVersion = '10.1.1'
13
+ androidxJunitVersion = '1.1.5'
14
+ androidxEspressoCoreVersion = '3.5.1'
15
+ cordovaAndroidVersion = '12.0.1'
16
16
  }
@@ -12,7 +12,6 @@ def capacitor_pods
12
12
  pod 'Capacitor', :path => '../../node_modules/@capacitor/ios'
13
13
  pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios'
14
14
  pod 'CapacitorApp', :path => '../../node_modules/@capacitor/app'
15
- pod 'CapacitorDialog', :path => '../../node_modules/@capacitor/dialog'
16
15
  pod 'CapacitorHaptics', :path => '../../node_modules/@capacitor/haptics'
17
16
  pod 'CapacitorKeyboard', :path => '../../node_modules/@capacitor/keyboard'
18
17
  pod 'CapacitorStatusBar', :path => '../../node_modules/@capacitor/status-bar'
@@ -15,33 +15,34 @@
15
15
  "lint": "eslint"
16
16
  },
17
17
  "dependencies": {
18
- "@regulaforensics/face-sdk": "6.5.115-beta",
19
- "@regulaforensics/face-core-basic": "6.5.63-beta",
20
- "@awesome-cordova-plugins/camera": "6.14.0",
21
- "@awesome-cordova-plugins/file": "6.14.0",
22
- "@capacitor/android": "^7.0.0",
23
- "@capacitor/app": "^7.0.0",
24
- "@capacitor/core": "^7.0.0",
25
- "@capacitor/dialog": "^7.0.0",
26
- "@capacitor/haptics": "^7.0.0",
27
- "@capacitor/ios": "^7.0.0",
28
- "@capacitor/keyboard": "^7.0.0",
29
- "@capacitor/status-bar": "^7.0.0",
18
+ "@regulaforensics/face-sdk": "6.5.132-nightly",
19
+ "@regulaforensics/face-core-basic": "6.4.76-nightly",
20
+ "@awesome-cordova-plugins/camera": "6.6.0",
21
+ "@awesome-cordova-plugins/file": "6.6.0",
22
+ "@awesome-cordova-plugins/dialogs": "6.6.0",
23
+ "@capacitor/android": "7.0.0-rc.0",
24
+ "@capacitor/core": "7.0.0-rc.0",
25
+ "@capacitor/ios": "7.0.0-rc.0",
26
+ "@capacitor/app": "7.0.0-rc.0",
27
+ "@capacitor/haptics": "7.0.0-rc.0",
28
+ "@capacitor/keyboard": "7.0.0-rc.0",
29
+ "@capacitor/status-bar": "7.0.0-rc.0",
30
30
  "@ionic/react": "^7.0.0",
31
31
  "@ionic/react-router": "^7.0.0",
32
32
  "@types/react-router": "^5.1.20",
33
33
  "@types/react-router-dom": "^5.3.3",
34
- "cordova-plugin-camera": "8.0.0",
35
- "cordova-plugin-file": "8.1.3",
36
- "ionicons": "^7.0.0",
34
+ "cordova-plugin-camera": "7.0.0",
35
+ "cordova-plugin-file": "8.0.1",
36
+ "cordova-plugin-dialogs": "^2.0.2",
37
37
  "jetifier": "2.0.0",
38
+ "ionicons": "^7.0.0",
38
39
  "react": "^18.2.0",
39
40
  "react-dom": "^18.2.0",
40
41
  "react-router": "^5.3.4",
41
42
  "react-router-dom": "^5.3.4"
42
43
  },
43
44
  "devDependencies": {
44
- "@capacitor/cli": "^7.0.0",
45
+ "@capacitor/cli": "7.0.0-rc.0",
45
46
  "@testing-library/dom": ">=7.21.4",
46
47
  "@testing-library/jest-dom": "^5.16.5",
47
48
  "@testing-library/react": "^14.0.0",
@@ -58,5 +59,6 @@
58
59
  "typescript": "^5.1.6",
59
60
  "vite": "^5.0.0",
60
61
  "vitest": "^0.34.6"
61
- }
62
+ },
63
+ "description": "An Ionic project"
62
64
  }
@@ -2,5 +2,3 @@
2
2
  set -e
3
3
 
4
4
  npm install
5
- cd ios/App
6
- pod install || pod update
@@ -1,7 +1,7 @@
1
1
  import { IonPage } from '@ionic/react'
2
2
  import React from "react"
3
3
  import { File } from '@awesome-cordova-plugins/file'
4
- import { Dialog } from '@capacitor/dialog'
4
+ import { Dialogs } from '@awesome-cordova-plugins/dialogs'
5
5
  import { Camera, DestinationType, MediaType, PictureSourceType } from '@awesome-cordova-plugins/camera'
6
6
  import { FaceSDK, MatchFacesRequest, MatchFacesImage, InitConfig, LivenessSkipStep, ImageType, LivenessStatus, LivenessConfig } from '@regulaforensics/face-sdk'
7
7
 
@@ -20,7 +20,7 @@ async function startLiveness() {
20
20
  }
21
21
  })
22
22
  if (response.image == null) return
23
- setImage("data:image/png;base64," + response.image, ImageType.LIVE, 1)
23
+ setImage(response.image, ImageType.LIVE, 1)
24
24
  setLivenessStatus(response.liveness == LivenessStatus.PASSED ? "passed" : "unknown")
25
25
  }
26
26
 
@@ -69,12 +69,12 @@ function setImage(base64: string, type: number, position: number) {
69
69
  var mfImage = new MatchFacesImage(base64, type)
70
70
  if (position == 1) {
71
71
  image1 = mfImage
72
- setUiImage1(base64)
72
+ setUiImage1("data:image/png;base64," + base64)
73
73
  setLivenessStatus("null")
74
74
  }
75
75
  if (position == 2) {
76
76
  image2 = mfImage
77
- setUiImage2(base64)
77
+ setUiImage2("data:image/png;base64," + base64)
78
78
  }
79
79
  }
80
80
 
@@ -82,26 +82,22 @@ async function useCamera(position: number) {
82
82
  var response = await faceSdk.startFaceCapture()
83
83
  if (response.image == null) return
84
84
  var image = response.image
85
- setImage("data:image/png;base64," + image.image, image.imageType, position)
85
+ setImage(image.image, image.imageType, position)
86
86
  }
87
87
 
88
- async function useGallery(position: number) {
89
- var image = await Camera.getPicture({
88
+ function useGallery(position: number) {
89
+ Camera.getPicture({
90
90
  destinationType: DestinationType.DATA_URL,
91
91
  mediaType: MediaType.PICTURE,
92
92
  sourceType: PictureSourceType.PHOTOLIBRARY
93
- })
94
- setImage(image, ImageType.PRINTED, position)
93
+ }).then((result: string) => setImage(result, ImageType.PRINTED, position))
95
94
  }
96
95
 
97
- async function pickImage(position: number) {
98
- var response = await Dialog.confirm({
99
- message: "Select option",
100
- okButtonTitle: "Use camera",
101
- cancelButtonTitle: "Use gallery"
96
+ function pickImage(position: number) {
97
+ Dialogs.confirm("", "Select option", ["Use gallery", "Use camera"]).then(button => {
98
+ if (button == 1) useGallery(position)
99
+ else useCamera(position)
102
100
  })
103
- if (response.value) useCamera(position)
104
- else useGallery(position)
105
101
  }
106
102
 
107
103
  async function loadAssetIfExists(path: string): Promise<string | null> {
@@ -9,8 +9,8 @@
9
9
  "android": "scripts/android.sh"
10
10
  },
11
11
  "dependencies": {
12
- "@regulaforensics/face-sdk": "6.5.115-beta",
13
- "@regulaforensics/face-core-basic": "6.5.63-beta",
12
+ "@regulaforensics/face-sdk": "6.5.132-nightly",
13
+ "@regulaforensics/face-core-basic": "6.4.76-nightly",
14
14
  "cordova-android": "13.0.0",
15
15
  "cordova-ios": "7.1.1",
16
16
  "cordova-plugin-add-swift-support": "2.0.2",
@@ -2,7 +2,4 @@
2
2
  set -e
3
3
 
4
4
  npm install
5
- cordova prepare || {
6
- pod repo update
7
- ionic cordova prepare
8
- }
5
+ cordova prepare
@@ -16,8 +16,8 @@
16
16
  },
17
17
  "private": true,
18
18
  "dependencies": {
19
- "@regulaforensics/face-sdk": "6.5.115-beta",
20
- "@regulaforensics/face-core-basic": "6.5.63-beta",
19
+ "@regulaforensics/face-sdk": "6.5.132-nightly",
20
+ "@regulaforensics/face-core-basic": "6.4.76-nightly",
21
21
  "cordova-plugin-camera": "8.0.0",
22
22
  "@awesome-cordova-plugins/camera": "6.14.0",
23
23
  "@awesome-cordova-plugins/core": "6.14.0",
@@ -2,7 +2,4 @@
2
2
  set -e
3
3
 
4
4
  npm install
5
- ionic cordova prepare || {
6
- pod repo update
7
- ionic cordova prepare
8
- }
5
+ ionic cordova prepare