@regulaforensics/face-sdk 8.3.1237-nightly → 8.3.1242-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.
- package/RNFaceSDK.podspec +1 -1
- package/android/src/main/java/com/regula/plugin/facesdk/Config.kt +90 -90
- package/android/src/main/java/com/regula/plugin/facesdk/JSONConstructor.kt +98 -98
- package/android/src/main/java/com/regula/plugin/facesdk/Main.kt +35 -35
- package/examples/capacitor/package-lock.json +14 -14
- package/examples/capacitor/package.json +1 -1
- package/examples/ionic/package-lock.json +577 -868
- package/examples/ionic/package.json +8 -2
- package/examples/ionic/scripts/android.sh +1 -1
- package/examples/react_native/package-lock.json +2140 -1225
- package/examples/react_native/package.json +6 -2
- package/ios/Config.swift +105 -105
- package/ios/Decoder.swift +67 -67
- package/ios/Main.swift +22 -22
- package/package.json +1 -1
- package/plugin.xml +1 -1
- package/test/test.tsx +15 -15
- package/www/types/index.d.ts +24 -24
package/RNFaceSDK.podspec
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
package com.regula.plugin.facesdk
|
|
4
4
|
|
|
5
5
|
import com.regula.facesdk.configuration.Customization
|
|
6
|
-
import com.regula.facesdk.configuration.EnrollmentConfiguration
|
|
6
|
+
//import com.regula.facesdk.configuration.EnrollmentConfiguration
|
|
7
7
|
import com.regula.facesdk.configuration.FaceCaptureConfiguration
|
|
8
8
|
import com.regula.facesdk.configuration.LivenessConfiguration
|
|
9
9
|
import com.regula.facesdk.configuration.MatchFacesConfiguration
|
|
10
|
-
import com.regula.facesdk.configuration.VerificationConfiguration
|
|
10
|
+
//import com.regula.facesdk.configuration.VerificationConfiguration
|
|
11
11
|
import com.regula.facesdk.detection.request.ImageQualityCharacteristic
|
|
12
12
|
import com.regula.facesdk.detection.request.ImageQualityGroup
|
|
13
13
|
import com.regula.facesdk.detection.request.ImageQualityRange
|
|
@@ -87,94 +87,94 @@ fun getLivenessConfig(input: LivenessConfiguration) = mapOf(
|
|
|
87
87
|
"metadata" to input.metadata,
|
|
88
88
|
).toJson()
|
|
89
89
|
|
|
90
|
-
fun setEnrollmentConfig(builder: EnrollmentConfiguration.Builder, config: JSONObject) = config.forEach { k, v ->
|
|
91
|
-
when (k) {
|
|
92
|
-
"copyright" -> builder.setCopyright(v as Boolean)
|
|
93
|
-
"cameraSwitchEnabled" -> builder.setCameraSwitchEnabled(v as Boolean)
|
|
94
|
-
"closeButtonEnabled" -> builder.setCloseButtonEnabled(v as Boolean)
|
|
95
|
-
"torchButtonEnabled" -> builder.setTorchButtonEnabled(v as Boolean)
|
|
96
|
-
"vibrateOnSteps" -> builder.setVibrateOnStep(v as Boolean)
|
|
97
|
-
"cameraPositionAndroid" -> builder.setCameraId(v.toInt())
|
|
98
|
-
"screenOrientation" -> builder.setScreenOrientation(*screenOrientationArrayFromJSON(v as JSONArray))
|
|
99
|
-
"locationTrackingEnabled" -> builder.setLocationTrackingEnabled(v as Boolean)
|
|
100
|
-
"preventScreenRecording" -> builder.setPreventScreenRecording(v as Boolean)
|
|
101
|
-
"attemptsCount" -> builder.setAttemptsCount(v.toInt())
|
|
102
|
-
"recordingProcess" -> builder.setRecordingProcess(RecordingProcess.values()[v.toInt()])
|
|
103
|
-
"livenessType" -> builder.setType(LivenessType.values()[v.toInt()])
|
|
104
|
-
"tag" -> builder.setTag(v as String)
|
|
105
|
-
"externalId" -> builder.setExternalId(v as String)
|
|
106
|
-
"groupId" -> builder.setGroupId(v as String)
|
|
107
|
-
"duplicatesThreshold" -> if (config.getBooleanOrNull("checkDuplicatesEnabled") == true) builder.enableCheckDuplicates(v.toFloat())
|
|
108
|
-
"skipStep" -> builder.setSkipStep(*livenessSkipStepArrayFromJSON(v as JSONArray))
|
|
109
|
-
"metadata" -> builder.setMetadata(v as JSONObject)
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
fun getEnrollmentConfig(input: EnrollmentConfiguration) = mapOf(
|
|
114
|
-
"copyright" to input.hasCopyright(),
|
|
115
|
-
"cameraSwitchEnabled" to input.isCameraSwitchEnabled,
|
|
116
|
-
"closeButtonEnabled" to input.isCloseButtonEnabled,
|
|
117
|
-
"torchButtonEnabled" to input.isTorchButtonEnabled,
|
|
118
|
-
"vibrateOnSteps" to input.isVibrateOnSteps,
|
|
119
|
-
"cameraPositionAndroid" to input.cameraId,
|
|
120
|
-
"screenOrientation" to generateScreenOrientationArray(input.screenOrientation),
|
|
121
|
-
"locationTrackingEnabled" to input.isLocationTrackingEnabled,
|
|
122
|
-
"preventScreenRecording" to input.doPreventScreenRecording(),
|
|
123
|
-
"attemptsCount" to input.attemptsCount,
|
|
124
|
-
"recordingProcess" to input.recordingProcess.ordinal,
|
|
125
|
-
"livenessType" to input.type.ordinal,
|
|
126
|
-
"tag" to input.tag,
|
|
127
|
-
"externalId" to input.externalId,
|
|
128
|
-
"groupId" to input.groupId,
|
|
129
|
-
"checkDuplicatesEnabled" to input.isCheckDuplicatesEnabled,
|
|
130
|
-
"duplicatesThreshold" to input.duplicatesThreshold,
|
|
131
|
-
"skipStep" to generateLivenessSkipStepArray(input.skipStep),
|
|
132
|
-
"metadata" to input.metadata,
|
|
133
|
-
).toJson()
|
|
134
|
-
|
|
135
|
-
fun setVerificationConfig(builder: VerificationConfiguration.Builder, config: JSONObject) = config.forEach { k, v ->
|
|
136
|
-
when (k) {
|
|
137
|
-
"copyright" -> builder.setCopyright(v as Boolean)
|
|
138
|
-
"cameraSwitchEnabled" -> builder.setCameraSwitchEnabled(v as Boolean)
|
|
139
|
-
"closeButtonEnabled" -> builder.setCloseButtonEnabled(v as Boolean)
|
|
140
|
-
"torchButtonEnabled" -> builder.setTorchButtonEnabled(v as Boolean)
|
|
141
|
-
"vibrateOnSteps" -> builder.setVibrateOnStep(v as Boolean)
|
|
142
|
-
"cameraPositionAndroid" -> builder.setCameraId(v.toInt())
|
|
143
|
-
"screenOrientation" -> builder.setScreenOrientation(*screenOrientationArrayFromJSON(v as JSONArray))
|
|
144
|
-
"locationTrackingEnabled" -> builder.setLocationTrackingEnabled(v as Boolean)
|
|
145
|
-
"preventScreenRecording" -> builder.setPreventScreenRecording(v as Boolean)
|
|
146
|
-
"attemptsCount" -> builder.setAttemptsCount(v.toInt())
|
|
147
|
-
"recordingProcess" -> builder.setRecordingProcess(RecordingProcess.values()[v.toInt()])
|
|
148
|
-
"livenessType" -> builder.setType(LivenessType.values()[v.toInt()])
|
|
149
|
-
"tag" -> builder.setTag(v as String)
|
|
150
|
-
"personId" -> builder.setPrivateProperty("u", v as String)
|
|
151
|
-
"groupId" -> builder.setGroupId(v as String)
|
|
152
|
-
"threshold" -> builder.setThreshold(v.toFloat())
|
|
153
|
-
"skipStep" -> builder.setSkipStep(*livenessSkipStepArrayFromJSON(v as JSONArray))
|
|
154
|
-
"metadata" -> builder.setMetadata(v as JSONObject)
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
fun getVerificationConfig(input: VerificationConfiguration) = mapOf(
|
|
159
|
-
"copyright" to input.hasCopyright(),
|
|
160
|
-
"cameraSwitchEnabled" to input.isCameraSwitchEnabled,
|
|
161
|
-
"closeButtonEnabled" to input.isCloseButtonEnabled,
|
|
162
|
-
"torchButtonEnabled" to input.isTorchButtonEnabled,
|
|
163
|
-
"vibrateOnSteps" to input.isVibrateOnSteps,
|
|
164
|
-
"cameraPositionAndroid" to input.cameraId,
|
|
165
|
-
"screenOrientation" to generateScreenOrientationArray(input.screenOrientation),
|
|
166
|
-
"locationTrackingEnabled" to input.isLocationTrackingEnabled,
|
|
167
|
-
"preventScreenRecording" to input.doPreventScreenRecording(),
|
|
168
|
-
"attemptsCount" to input.attemptsCount,
|
|
169
|
-
"recordingProcess" to input.recordingProcess.ordinal,
|
|
170
|
-
"livenessType" to input.type.ordinal,
|
|
171
|
-
"tag" to input.tag,
|
|
172
|
-
"personId" to input.personId,
|
|
173
|
-
"groupId" to input.groupId,
|
|
174
|
-
"threshold" to input.threshold,
|
|
175
|
-
"skipStep" to generateLivenessSkipStepArray(input.skipStep),
|
|
176
|
-
"metadata" to input.metadata,
|
|
177
|
-
).toJson()
|
|
90
|
+
//fun setEnrollmentConfig(builder: EnrollmentConfiguration.Builder, config: JSONObject) = config.forEach { k, v ->
|
|
91
|
+
// when (k) {
|
|
92
|
+
// "copyright" -> builder.setCopyright(v as Boolean)
|
|
93
|
+
// "cameraSwitchEnabled" -> builder.setCameraSwitchEnabled(v as Boolean)
|
|
94
|
+
// "closeButtonEnabled" -> builder.setCloseButtonEnabled(v as Boolean)
|
|
95
|
+
// "torchButtonEnabled" -> builder.setTorchButtonEnabled(v as Boolean)
|
|
96
|
+
// "vibrateOnSteps" -> builder.setVibrateOnStep(v as Boolean)
|
|
97
|
+
// "cameraPositionAndroid" -> builder.setCameraId(v.toInt())
|
|
98
|
+
// "screenOrientation" -> builder.setScreenOrientation(*screenOrientationArrayFromJSON(v as JSONArray))
|
|
99
|
+
// "locationTrackingEnabled" -> builder.setLocationTrackingEnabled(v as Boolean)
|
|
100
|
+
// "preventScreenRecording" -> builder.setPreventScreenRecording(v as Boolean)
|
|
101
|
+
// "attemptsCount" -> builder.setAttemptsCount(v.toInt())
|
|
102
|
+
// "recordingProcess" -> builder.setRecordingProcess(RecordingProcess.values()[v.toInt()])
|
|
103
|
+
// "livenessType" -> builder.setType(LivenessType.values()[v.toInt()])
|
|
104
|
+
// "tag" -> builder.setTag(v as String)
|
|
105
|
+
// "externalId" -> builder.setExternalId(v as String)
|
|
106
|
+
// "groupId" -> builder.setGroupId(v as String)
|
|
107
|
+
// "duplicatesThreshold" -> if (config.getBooleanOrNull("checkDuplicatesEnabled") == true) builder.enableCheckDuplicates(v.toFloat())
|
|
108
|
+
// "skipStep" -> builder.setSkipStep(*livenessSkipStepArrayFromJSON(v as JSONArray))
|
|
109
|
+
// "metadata" -> builder.setMetadata(v as JSONObject)
|
|
110
|
+
// }
|
|
111
|
+
//}
|
|
112
|
+
//
|
|
113
|
+
//fun getEnrollmentConfig(input: EnrollmentConfiguration) = mapOf(
|
|
114
|
+
// "copyright" to input.hasCopyright(),
|
|
115
|
+
// "cameraSwitchEnabled" to input.isCameraSwitchEnabled,
|
|
116
|
+
// "closeButtonEnabled" to input.isCloseButtonEnabled,
|
|
117
|
+
// "torchButtonEnabled" to input.isTorchButtonEnabled,
|
|
118
|
+
// "vibrateOnSteps" to input.isVibrateOnSteps,
|
|
119
|
+
// "cameraPositionAndroid" to input.cameraId,
|
|
120
|
+
// "screenOrientation" to generateScreenOrientationArray(input.screenOrientation),
|
|
121
|
+
// "locationTrackingEnabled" to input.isLocationTrackingEnabled,
|
|
122
|
+
// "preventScreenRecording" to input.doPreventScreenRecording(),
|
|
123
|
+
// "attemptsCount" to input.attemptsCount,
|
|
124
|
+
// "recordingProcess" to input.recordingProcess.ordinal,
|
|
125
|
+
// "livenessType" to input.type.ordinal,
|
|
126
|
+
// "tag" to input.tag,
|
|
127
|
+
// "externalId" to input.externalId,
|
|
128
|
+
// "groupId" to input.groupId,
|
|
129
|
+
// "checkDuplicatesEnabled" to input.isCheckDuplicatesEnabled,
|
|
130
|
+
// "duplicatesThreshold" to input.duplicatesThreshold,
|
|
131
|
+
// "skipStep" to generateLivenessSkipStepArray(input.skipStep),
|
|
132
|
+
// "metadata" to input.metadata,
|
|
133
|
+
//).toJson()
|
|
134
|
+
//
|
|
135
|
+
//fun setVerificationConfig(builder: VerificationConfiguration.Builder, config: JSONObject) = config.forEach { k, v ->
|
|
136
|
+
// when (k) {
|
|
137
|
+
// "copyright" -> builder.setCopyright(v as Boolean)
|
|
138
|
+
// "cameraSwitchEnabled" -> builder.setCameraSwitchEnabled(v as Boolean)
|
|
139
|
+
// "closeButtonEnabled" -> builder.setCloseButtonEnabled(v as Boolean)
|
|
140
|
+
// "torchButtonEnabled" -> builder.setTorchButtonEnabled(v as Boolean)
|
|
141
|
+
// "vibrateOnSteps" -> builder.setVibrateOnStep(v as Boolean)
|
|
142
|
+
// "cameraPositionAndroid" -> builder.setCameraId(v.toInt())
|
|
143
|
+
// "screenOrientation" -> builder.setScreenOrientation(*screenOrientationArrayFromJSON(v as JSONArray))
|
|
144
|
+
// "locationTrackingEnabled" -> builder.setLocationTrackingEnabled(v as Boolean)
|
|
145
|
+
// "preventScreenRecording" -> builder.setPreventScreenRecording(v as Boolean)
|
|
146
|
+
// "attemptsCount" -> builder.setAttemptsCount(v.toInt())
|
|
147
|
+
// "recordingProcess" -> builder.setRecordingProcess(RecordingProcess.values()[v.toInt()])
|
|
148
|
+
// "livenessType" -> builder.setType(LivenessType.values()[v.toInt()])
|
|
149
|
+
// "tag" -> builder.setTag(v as String)
|
|
150
|
+
// "personId" -> builder.setPrivateProperty("u", v as String)
|
|
151
|
+
// "groupId" -> builder.setGroupId(v as String)
|
|
152
|
+
// "threshold" -> builder.setThreshold(v.toFloat())
|
|
153
|
+
// "skipStep" -> builder.setSkipStep(*livenessSkipStepArrayFromJSON(v as JSONArray))
|
|
154
|
+
// "metadata" -> builder.setMetadata(v as JSONObject)
|
|
155
|
+
// }
|
|
156
|
+
//}
|
|
157
|
+
//
|
|
158
|
+
//fun getVerificationConfig(input: VerificationConfiguration) = mapOf(
|
|
159
|
+
// "copyright" to input.hasCopyright(),
|
|
160
|
+
// "cameraSwitchEnabled" to input.isCameraSwitchEnabled,
|
|
161
|
+
// "closeButtonEnabled" to input.isCloseButtonEnabled,
|
|
162
|
+
// "torchButtonEnabled" to input.isTorchButtonEnabled,
|
|
163
|
+
// "vibrateOnSteps" to input.isVibrateOnSteps,
|
|
164
|
+
// "cameraPositionAndroid" to input.cameraId,
|
|
165
|
+
// "screenOrientation" to generateScreenOrientationArray(input.screenOrientation),
|
|
166
|
+
// "locationTrackingEnabled" to input.isLocationTrackingEnabled,
|
|
167
|
+
// "preventScreenRecording" to input.doPreventScreenRecording(),
|
|
168
|
+
// "attemptsCount" to input.attemptsCount,
|
|
169
|
+
// "recordingProcess" to input.recordingProcess.ordinal,
|
|
170
|
+
// "livenessType" to input.type.ordinal,
|
|
171
|
+
// "tag" to input.tag,
|
|
172
|
+
// "personId" to input.personId,
|
|
173
|
+
// "groupId" to input.groupId,
|
|
174
|
+
// "threshold" to input.threshold,
|
|
175
|
+
// "skipStep" to generateLivenessSkipStepArray(input.skipStep),
|
|
176
|
+
// "metadata" to input.metadata,
|
|
177
|
+
//).toJson()
|
|
178
178
|
|
|
179
179
|
fun setMatchFacesConfig(builder: MatchFacesConfiguration.Builder, config: JSONObject) = config.forEach { k, v ->
|
|
180
180
|
when (k) {
|
|
@@ -9,12 +9,12 @@ import android.graphics.Rect
|
|
|
9
9
|
import android.graphics.Typeface
|
|
10
10
|
import android.util.Pair
|
|
11
11
|
import android.util.Size
|
|
12
|
-
import com.regula.facesdk.configuration.EnrollmentConfiguration
|
|
12
|
+
//import com.regula.facesdk.configuration.EnrollmentConfiguration
|
|
13
13
|
import com.regula.facesdk.configuration.FaceCaptureConfiguration
|
|
14
14
|
import com.regula.facesdk.configuration.InitializationConfiguration
|
|
15
15
|
import com.regula.facesdk.configuration.LivenessConfiguration
|
|
16
16
|
import com.regula.facesdk.configuration.MatchFacesConfiguration
|
|
17
|
-
import com.regula.facesdk.configuration.VerificationConfiguration
|
|
17
|
+
//import com.regula.facesdk.configuration.VerificationConfiguration
|
|
18
18
|
import com.regula.facesdk.detection.request.DetectFacesConfiguration
|
|
19
19
|
import com.regula.facesdk.detection.request.DetectFacesRequest
|
|
20
20
|
import com.regula.facesdk.detection.request.ImageQualityCharacteristic
|
|
@@ -52,13 +52,13 @@ import com.regula.facesdk.exception.UnderlineException
|
|
|
52
52
|
import com.regula.facesdk.model.Image
|
|
53
53
|
import com.regula.facesdk.model.LivenessNotification
|
|
54
54
|
import com.regula.facesdk.model.MatchFacesImage
|
|
55
|
-
import com.regula.facesdk.model.results.EnrollmentResponse
|
|
56
|
-
import com.regula.facesdk.model.results.ErrorResponse
|
|
55
|
+
//import com.regula.facesdk.model.results.EnrollmentResponse
|
|
56
|
+
//import com.regula.facesdk.model.results.ErrorResponse
|
|
57
57
|
import com.regula.facesdk.model.results.FaceCaptureResponse
|
|
58
58
|
import com.regula.facesdk.model.results.FaceSDKVersion
|
|
59
59
|
import com.regula.facesdk.model.results.LivenessResponse
|
|
60
|
-
import com.regula.facesdk.model.results.VerificationResponse
|
|
61
|
-
import com.regula.facesdk.model.results.VerificationMatchResponse
|
|
60
|
+
//import com.regula.facesdk.model.results.VerificationResponse
|
|
61
|
+
//import com.regula.facesdk.model.results.VerificationMatchResponse
|
|
62
62
|
import com.regula.facesdk.model.results.matchfaces.MatchFacesComparedFace
|
|
63
63
|
import com.regula.facesdk.model.results.matchfaces.MatchFacesComparedFacesPair
|
|
64
64
|
import com.regula.facesdk.model.results.matchfaces.MatchFacesDetection
|
|
@@ -71,7 +71,7 @@ import com.regula.facesdk.model.results.person.PersonImage
|
|
|
71
71
|
import com.regula.facesdk.model.results.person.SearchPerson
|
|
72
72
|
import com.regula.facesdk.model.results.person.SearchPerson.Detection
|
|
73
73
|
import com.regula.facesdk.model.results.person.SearchPersonImage
|
|
74
|
-
import com.regula.facesdk.request.EnrollmentRequest
|
|
74
|
+
//import com.regula.facesdk.request.EnrollmentRequest
|
|
75
75
|
import com.regula.facesdk.request.MatchFacesRequest
|
|
76
76
|
import com.regula.facesdk.request.person.EditGroupPersonsRequest
|
|
77
77
|
import com.regula.facesdk.request.person.ImageUpload
|
|
@@ -110,21 +110,21 @@ fun livenessConfigFromJSON(input: JSONObject) = input.let {
|
|
|
110
110
|
|
|
111
111
|
fun generateLivenessConfig(input: LivenessConfiguration) = getLivenessConfig(input)
|
|
112
112
|
|
|
113
|
-
fun enrollmentConfigFromJSON(input: JSONObject) = input.let {
|
|
114
|
-
val result = EnrollmentConfiguration.Builder("")
|
|
115
|
-
setEnrollmentConfig(result, it)
|
|
116
|
-
result.build()
|
|
117
|
-
}!!
|
|
118
|
-
|
|
119
|
-
fun generateEnrollmentConfig(input: EnrollmentConfiguration) = getEnrollmentConfig(input)
|
|
120
|
-
|
|
121
|
-
fun verificationConfigFromJSON(input: JSONObject) = input.let {
|
|
122
|
-
val result = VerificationConfiguration.Builder("")
|
|
123
|
-
setVerificationConfig(result, it)
|
|
124
|
-
result.build()
|
|
125
|
-
}!!
|
|
126
|
-
|
|
127
|
-
fun generateVerificationConfig(input: VerificationConfiguration) = getVerificationConfig(input)
|
|
113
|
+
//fun enrollmentConfigFromJSON(input: JSONObject) = input.let {
|
|
114
|
+
// val result = EnrollmentConfiguration.Builder("")
|
|
115
|
+
// setEnrollmentConfig(result, it)
|
|
116
|
+
// result.build()
|
|
117
|
+
//}!!
|
|
118
|
+
//
|
|
119
|
+
//fun generateEnrollmentConfig(input: EnrollmentConfiguration) = getEnrollmentConfig(input)
|
|
120
|
+
//
|
|
121
|
+
//fun verificationConfigFromJSON(input: JSONObject) = input.let {
|
|
122
|
+
// val result = VerificationConfiguration.Builder("")
|
|
123
|
+
// setVerificationConfig(result, it)
|
|
124
|
+
// result.build()
|
|
125
|
+
//}!!
|
|
126
|
+
//
|
|
127
|
+
//fun generateVerificationConfig(input: VerificationConfiguration) = getVerificationConfig(input)
|
|
128
128
|
|
|
129
129
|
fun matchFacesConfigFromJSON(input: JSONObject) = input.let {
|
|
130
130
|
val result = MatchFacesConfiguration.Builder()
|
|
@@ -365,23 +365,23 @@ fun generateFaceCaptureResponse(it: FaceCaptureResponse) = mapOf(
|
|
|
365
365
|
|
|
366
366
|
// Liveness ------------------------------
|
|
367
367
|
|
|
368
|
-
fun enrollmentRequestFromJSON(input: JSONObject): EnrollmentRequest = input.let {
|
|
369
|
-
val externalId = it.getString("externalId")
|
|
370
|
-
val builder = if (it.has("trustedImage")) EnrollmentRequest.Builder(externalId, it.getString("trustedImage").toBitmap()!!)
|
|
371
|
-
else EnrollmentRequest.Builder(externalId, it.getString("trustedImageUrl"))
|
|
372
|
-
|
|
373
|
-
if (it.has("groupId")) builder.setGroupId(it.getString("groupId"))
|
|
374
|
-
builder.build()
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
fun generateEnrollmentRequest(input: EnrollmentRequest) = input.let {
|
|
378
|
-
mapOf(
|
|
379
|
-
"externalId" to it.externalId,
|
|
380
|
-
"groupId" to it.groupId,
|
|
381
|
-
"trustedImage" to it.trustedImage.toBase64(),
|
|
382
|
-
"trustedImageUrl" to it.trustedImageUrl,
|
|
383
|
-
).toJson()
|
|
384
|
-
}
|
|
368
|
+
//fun enrollmentRequestFromJSON(input: JSONObject): EnrollmentRequest = input.let {
|
|
369
|
+
// val externalId = it.getString("externalId")
|
|
370
|
+
// val builder = if (it.has("trustedImage")) EnrollmentRequest.Builder(externalId, it.getString("trustedImage").toBitmap()!!)
|
|
371
|
+
// else EnrollmentRequest.Builder(externalId, it.getString("trustedImageUrl"))
|
|
372
|
+
//
|
|
373
|
+
// if (it.has("groupId")) builder.setGroupId(it.getString("groupId"))
|
|
374
|
+
// builder.build()
|
|
375
|
+
//}
|
|
376
|
+
//
|
|
377
|
+
//fun generateEnrollmentRequest(input: EnrollmentRequest) = input.let {
|
|
378
|
+
// mapOf(
|
|
379
|
+
// "externalId" to it.externalId,
|
|
380
|
+
// "groupId" to it.groupId,
|
|
381
|
+
// "trustedImage" to it.trustedImage.toBase64(),
|
|
382
|
+
// "trustedImageUrl" to it.trustedImageUrl,
|
|
383
|
+
// ).toJson()
|
|
384
|
+
//}
|
|
385
385
|
|
|
386
386
|
fun livenessResponseFromJSON(input: JSONObject?) = input?.let {
|
|
387
387
|
val result = LivenessResponse()
|
|
@@ -417,65 +417,65 @@ fun generateLivenessNotification(it: LivenessNotification) = mapOf(
|
|
|
417
417
|
"response" to generateLivenessResponse(it.response)
|
|
418
418
|
).toJson()
|
|
419
419
|
|
|
420
|
-
fun errorResponseFromJSON(input: JSONObject?) = input?.let {
|
|
421
|
-
ErrorResponse(
|
|
422
|
-
it.getInt("code"),
|
|
423
|
-
it.getString("message")
|
|
424
|
-
)
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
fun generateErrorResponse(input: ErrorResponse?) = input?.let {
|
|
428
|
-
mapOf(
|
|
429
|
-
"code" to it.code,
|
|
430
|
-
"message" to it.message
|
|
431
|
-
).toJson()
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
fun enrollmentResponseFromJSON(input: JSONObject?) = input?.let {
|
|
435
|
-
EnrollmentResponse(
|
|
436
|
-
it.getStringOrNull("personId"),
|
|
437
|
-
it.getStringOrNull("externalId"),
|
|
438
|
-
errorResponseFromJSON(it.getJSONObjectOrNull("error"))
|
|
439
|
-
)
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
fun generateEnrollmentResponse(input: EnrollmentResponse?) = input?.let {
|
|
443
|
-
mapOf(
|
|
444
|
-
"personId" to it.personId,
|
|
445
|
-
"externalId" to it.externalId,
|
|
446
|
-
"error" to generateErrorResponse(it.errorResponse),
|
|
447
|
-
).toJson()
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
fun verifyMatchResponseFromJSON(input: JSONObject?) = input?.let {
|
|
451
|
-
VerificationMatchResponse(
|
|
452
|
-
it.getBoolean("passed"),
|
|
453
|
-
it.get("similarity").toFloat()
|
|
454
|
-
)
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
fun generateVerifyMatchResponse(input: VerificationMatchResponse?) = input?.let {
|
|
458
|
-
mapOf(
|
|
459
|
-
"passed" to it.isPassed,
|
|
460
|
-
"similarity" to it.similarity
|
|
461
|
-
).toJson()
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
fun verificationResponseFromJSON(input: JSONObject?) = input?.let {
|
|
465
|
-
VerificationResponse(
|
|
466
|
-
it.getBoolean("passed"),
|
|
467
|
-
verifyMatchResponseFromJSON(it.getJSONObjectOrNull("match")),
|
|
468
|
-
errorResponseFromJSON(it.getJSONObjectOrNull("error"))
|
|
469
|
-
)
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
fun generateVerificationResponse(input: VerificationResponse?) = input?.let {
|
|
473
|
-
mapOf(
|
|
474
|
-
"passed" to it.isPassed,
|
|
475
|
-
"match" to generateVerifyMatchResponse(it.match),
|
|
476
|
-
"error" to generateErrorResponse(it.error),
|
|
477
|
-
).toJson()
|
|
478
|
-
}
|
|
420
|
+
//fun errorResponseFromJSON(input: JSONObject?) = input?.let {
|
|
421
|
+
// ErrorResponse(
|
|
422
|
+
// it.getInt("code"),
|
|
423
|
+
// it.getString("message")
|
|
424
|
+
// )
|
|
425
|
+
//}
|
|
426
|
+
//
|
|
427
|
+
//fun generateErrorResponse(input: ErrorResponse?) = input?.let {
|
|
428
|
+
// mapOf(
|
|
429
|
+
// "code" to it.code,
|
|
430
|
+
// "message" to it.message
|
|
431
|
+
// ).toJson()
|
|
432
|
+
//}
|
|
433
|
+
//
|
|
434
|
+
//fun enrollmentResponseFromJSON(input: JSONObject?) = input?.let {
|
|
435
|
+
// EnrollmentResponse(
|
|
436
|
+
// it.getStringOrNull("personId"),
|
|
437
|
+
// it.getStringOrNull("externalId"),
|
|
438
|
+
// errorResponseFromJSON(it.getJSONObjectOrNull("error"))
|
|
439
|
+
// )
|
|
440
|
+
//}
|
|
441
|
+
//
|
|
442
|
+
//fun generateEnrollmentResponse(input: EnrollmentResponse?) = input?.let {
|
|
443
|
+
// mapOf(
|
|
444
|
+
// "personId" to it.personId,
|
|
445
|
+
// "externalId" to it.externalId,
|
|
446
|
+
// "error" to generateErrorResponse(it.errorResponse),
|
|
447
|
+
// ).toJson()
|
|
448
|
+
//}
|
|
449
|
+
//
|
|
450
|
+
//fun verifyMatchResponseFromJSON(input: JSONObject?) = input?.let {
|
|
451
|
+
// VerificationMatchResponse(
|
|
452
|
+
// it.getBoolean("passed"),
|
|
453
|
+
// it.get("similarity").toFloat()
|
|
454
|
+
// )
|
|
455
|
+
//}
|
|
456
|
+
//
|
|
457
|
+
//fun generateVerifyMatchResponse(input: VerificationMatchResponse?) = input?.let {
|
|
458
|
+
// mapOf(
|
|
459
|
+
// "passed" to it.isPassed,
|
|
460
|
+
// "similarity" to it.similarity
|
|
461
|
+
// ).toJson()
|
|
462
|
+
//}
|
|
463
|
+
//
|
|
464
|
+
//fun verificationResponseFromJSON(input: JSONObject?) = input?.let {
|
|
465
|
+
// VerificationResponse(
|
|
466
|
+
// it.getBoolean("passed"),
|
|
467
|
+
// verifyMatchResponseFromJSON(it.getJSONObjectOrNull("match")),
|
|
468
|
+
// errorResponseFromJSON(it.getJSONObjectOrNull("error"))
|
|
469
|
+
// )
|
|
470
|
+
//}
|
|
471
|
+
//
|
|
472
|
+
//fun generateVerificationResponse(input: VerificationResponse?) = input?.let {
|
|
473
|
+
// mapOf(
|
|
474
|
+
// "passed" to it.isPassed,
|
|
475
|
+
// "match" to generateVerifyMatchResponse(it.match),
|
|
476
|
+
// "error" to generateErrorResponse(it.error),
|
|
477
|
+
// ).toJson()
|
|
478
|
+
//}
|
|
479
479
|
|
|
480
480
|
// MatchFaces ------------------------------
|
|
481
481
|
|
|
@@ -16,9 +16,9 @@ import com.regula.facesdk.enums.InitErrorCode
|
|
|
16
16
|
import com.regula.facesdk.exception.InitException
|
|
17
17
|
import com.regula.facesdk.listener.NetworkInterceptorListener
|
|
18
18
|
import com.regula.facesdk.model.LivenessNotification
|
|
19
|
-
import com.regula.facesdk.model.results.EnrollmentResponse
|
|
19
|
+
//import com.regula.facesdk.model.results.EnrollmentResponse
|
|
20
20
|
import com.regula.facesdk.model.results.LivenessResponse
|
|
21
|
-
import com.regula.facesdk.model.results.VerificationResponse
|
|
21
|
+
//import com.regula.facesdk.model.results.VerificationResponse
|
|
22
22
|
import com.regula.facesdk.model.results.matchfaces.MatchFacesSimilarityThresholdSplit
|
|
23
23
|
import com.regula.facesdk.model.results.person.DbBaseItem
|
|
24
24
|
import com.regula.facesdk.model.results.person.PageableItemList
|
|
@@ -48,9 +48,9 @@ fun methodCall(method: String, callback: (Any?) -> Unit): Any = when (method) {
|
|
|
48
48
|
"startFaceCapture" -> startFaceCapture(callback, argsNullable(0))
|
|
49
49
|
"stopFaceCapture" -> stopFaceCapture()
|
|
50
50
|
"startLiveness" -> startLiveness(callback, argsNullable(0))
|
|
51
|
-
"startEnrollment" -> startEnrollment(callback, args(0))
|
|
52
|
-
"startVerification" -> startVerification(callback, args(0))
|
|
53
|
-
"enrollWithTrustedPhoto" -> enrollWithTrustedPhoto(callback, args(0))
|
|
51
|
+
// "startEnrollment" -> startEnrollment(callback, args(0))
|
|
52
|
+
// "startVerification" -> startVerification(callback, args(0))
|
|
53
|
+
// "enrollWithTrustedPhoto" -> enrollWithTrustedPhoto(callback, args(0))
|
|
54
54
|
"stopLiveness" -> stopLiveness()
|
|
55
55
|
"matchFaces" -> matchFaces(callback, args(0), argsNullable(1))
|
|
56
56
|
"splitComparedFaces" -> splitComparedFaces(callback, args(0), args(1))
|
|
@@ -160,23 +160,23 @@ fun startLiveness(callback: Callback, config: JSONObject?) = config?.let {
|
|
|
160
160
|
livenessNotificationCompletion()
|
|
161
161
|
)
|
|
162
162
|
|
|
163
|
-
fun startEnrollment(callback: Callback, config: JSONObject) = Instance().startEnrollment(
|
|
164
|
-
context,
|
|
165
|
-
enrollmentConfigFromJSON(config),
|
|
166
|
-
enrollmentCompletion(callback),
|
|
167
|
-
livenessNotificationCompletion(),
|
|
168
|
-
)
|
|
169
|
-
|
|
170
|
-
fun startVerification(callback: Callback, config: JSONObject) = Instance().startVerification(
|
|
171
|
-
context,
|
|
172
|
-
verificationConfigFromJSON(config),
|
|
173
|
-
verificationCompletion(callback),
|
|
174
|
-
livenessNotificationCompletion(),
|
|
175
|
-
)
|
|
176
|
-
|
|
177
|
-
fun enrollWithTrustedPhoto(callback: Callback, config: JSONObject) = Instance().enrollWithTrustedPhoto(
|
|
178
|
-
enrollmentRequestFromJSON(config),
|
|
179
|
-
) { callback(generateEnrollmentResponse(it)) }
|
|
163
|
+
//fun startEnrollment(callback: Callback, config: JSONObject) = Instance().startEnrollment(
|
|
164
|
+
// context,
|
|
165
|
+
// enrollmentConfigFromJSON(config),
|
|
166
|
+
// enrollmentCompletion(callback),
|
|
167
|
+
// livenessNotificationCompletion(),
|
|
168
|
+
//)
|
|
169
|
+
//
|
|
170
|
+
//fun startVerification(callback: Callback, config: JSONObject) = Instance().startVerification(
|
|
171
|
+
// context,
|
|
172
|
+
// verificationConfigFromJSON(config),
|
|
173
|
+
// verificationCompletion(callback),
|
|
174
|
+
// livenessNotificationCompletion(),
|
|
175
|
+
//)
|
|
176
|
+
//
|
|
177
|
+
//fun enrollWithTrustedPhoto(callback: Callback, config: JSONObject) = Instance().enrollWithTrustedPhoto(
|
|
178
|
+
// enrollmentRequestFromJSON(config),
|
|
179
|
+
//) { callback(generateEnrollmentResponse(it)) }
|
|
180
180
|
|
|
181
181
|
fun stopLiveness() = Instance().stopLivenessProcessing(context)
|
|
182
182
|
|
|
@@ -395,19 +395,19 @@ fun detectFacesCompletion(callback: Callback) = DetectFacesCompletion {
|
|
|
395
395
|
callback(generateDetectFacesResponse(it))
|
|
396
396
|
}
|
|
397
397
|
|
|
398
|
-
fun verificationCompletion(callback: Callback) = { livenessResponse: LivenessResponse, verificationResponse: VerificationResponse? ->
|
|
399
|
-
callback(mapOf(
|
|
400
|
-
"livenessResponse" to generateLivenessResponse(livenessResponse),
|
|
401
|
-
"verificationResponse" to generateVerificationResponse(verificationResponse),
|
|
402
|
-
).toJson())
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
fun enrollmentCompletion(callback: Callback) = { livenessResponse: LivenessResponse, enrollmentResponse: EnrollmentResponse? ->
|
|
406
|
-
callback(mapOf(
|
|
407
|
-
"livenessResponse" to generateLivenessResponse(livenessResponse),
|
|
408
|
-
"enrollmentResponse" to generateEnrollmentResponse(enrollmentResponse),
|
|
409
|
-
).toJson())
|
|
410
|
-
}
|
|
398
|
+
//fun verificationCompletion(callback: Callback) = { livenessResponse: LivenessResponse, verificationResponse: VerificationResponse? ->
|
|
399
|
+
// callback(mapOf(
|
|
400
|
+
// "livenessResponse" to generateLivenessResponse(livenessResponse),
|
|
401
|
+
// "verificationResponse" to generateVerificationResponse(verificationResponse),
|
|
402
|
+
// ).toJson())
|
|
403
|
+
//}
|
|
404
|
+
//
|
|
405
|
+
//fun enrollmentCompletion(callback: Callback) = { livenessResponse: LivenessResponse, enrollmentResponse: EnrollmentResponse? ->
|
|
406
|
+
// callback(mapOf(
|
|
407
|
+
// "livenessResponse" to generateLivenessResponse(livenessResponse),
|
|
408
|
+
// "enrollmentResponse" to generateEnrollmentResponse(enrollmentResponse),
|
|
409
|
+
// ).toJson())
|
|
410
|
+
//}
|
|
411
411
|
|
|
412
412
|
fun <T> databaseItemCompletion(callback: Callback, toJson: ((T?) -> JSONObject?)?) = object : PersonDBCallback<T> {
|
|
413
413
|
override fun onSuccess(data: T?) = callback(generatePersonDBResponse(toJson?.let { it(data) } ?: true, null))
|
|
@@ -1766,15 +1766,15 @@
|
|
|
1766
1766
|
}
|
|
1767
1767
|
},
|
|
1768
1768
|
"node_modules/brace-expansion": {
|
|
1769
|
-
"version": "5.0.
|
|
1770
|
-
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.
|
|
1771
|
-
"integrity": "sha512-
|
|
1769
|
+
"version": "5.0.8",
|
|
1770
|
+
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.8.tgz",
|
|
1771
|
+
"integrity": "sha512-JZyDyq3D4AUifKTPOB7DELf6XsB3WdPuNxCtob1vFXPsSXhdAiHBWJ/tJ8HAc9aH84BK+5JFZLNkJKx3G9kzQg==",
|
|
1772
1772
|
"license": "MIT",
|
|
1773
1773
|
"dependencies": {
|
|
1774
1774
|
"balanced-match": "^4.0.2"
|
|
1775
1775
|
},
|
|
1776
1776
|
"engines": {
|
|
1777
|
-
"node": "
|
|
1777
|
+
"node": "20 || >=22"
|
|
1778
1778
|
}
|
|
1779
1779
|
},
|
|
1780
1780
|
"node_modules/braces": {
|
|
@@ -2435,9 +2435,9 @@
|
|
|
2435
2435
|
"license": "MIT"
|
|
2436
2436
|
},
|
|
2437
2437
|
"node_modules/nanoid": {
|
|
2438
|
-
"version": "3.3.
|
|
2439
|
-
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.
|
|
2440
|
-
"integrity": "sha512-
|
|
2438
|
+
"version": "3.3.16",
|
|
2439
|
+
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.16.tgz",
|
|
2440
|
+
"integrity": "sha512-bzlKTyNJ7+LdGIIwy8ijFpIqEQIvafahV7eYykJ8Cvh42EdJeODoJ6gUJXpQJvej1BddH8OqTXZNE/KfbWAu8Q==",
|
|
2441
2441
|
"funding": [
|
|
2442
2442
|
{
|
|
2443
2443
|
"type": "github",
|
|
@@ -2604,9 +2604,9 @@
|
|
|
2604
2604
|
}
|
|
2605
2605
|
},
|
|
2606
2606
|
"node_modules/postcss": {
|
|
2607
|
-
"version": "8.5.
|
|
2608
|
-
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.
|
|
2609
|
-
"integrity": "sha512-
|
|
2607
|
+
"version": "8.5.24",
|
|
2608
|
+
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.24.tgz",
|
|
2609
|
+
"integrity": "sha512-8RyVklq0owXUTa4xlpzu4l9AaVKIdQvAcOHZWaMh98HgySsUtxRVf/chRe3dsSLqb6i40BzGRzEUddRaI+9TSw==",
|
|
2610
2610
|
"funding": [
|
|
2611
2611
|
{
|
|
2612
2612
|
"type": "opencollective",
|
|
@@ -2624,7 +2624,7 @@
|
|
|
2624
2624
|
"license": "MIT",
|
|
2625
2625
|
"peer": true,
|
|
2626
2626
|
"dependencies": {
|
|
2627
|
-
"nanoid": "^3.3.
|
|
2627
|
+
"nanoid": "^3.3.16",
|
|
2628
2628
|
"picocolors": "^1.1.1",
|
|
2629
2629
|
"source-map-js": "^1.2.1"
|
|
2630
2630
|
},
|
|
@@ -3060,9 +3060,9 @@
|
|
|
3060
3060
|
}
|
|
3061
3061
|
},
|
|
3062
3062
|
"node_modules/tar": {
|
|
3063
|
-
"version": "7.5.
|
|
3064
|
-
"resolved": "https://registry.npmjs.org/tar/-/tar-7.5.
|
|
3065
|
-
"integrity": "sha512-
|
|
3063
|
+
"version": "7.5.21",
|
|
3064
|
+
"resolved": "https://registry.npmjs.org/tar/-/tar-7.5.21.tgz",
|
|
3065
|
+
"integrity": "sha512-XdhtCvlMywwxpCW8YEq3lOXBJpUPTR2OHHcwLPO3HwsJqOHa2Ok/oJ7ruGzp+JrKoRPVCzJwAdEjqLW/vNRPHA==",
|
|
3066
3066
|
"license": "BlueOak-1.0.0",
|
|
3067
3067
|
"dependencies": {
|
|
3068
3068
|
"@isaacs/fs-minipass": "^4.0.0",
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"android": "scripts/android.sh"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@regulaforensics/face-sdk": "8.3.
|
|
9
|
+
"@regulaforensics/face-sdk": "8.3.1242-nightly",
|
|
10
10
|
"@regulaforensics/face-core-basic": "8.3.680-nightly",
|
|
11
11
|
"@awesome-cordova-plugins/file": "^8.1.0",
|
|
12
12
|
"@awesome-cordova-plugins/camera": "^8.1.0",
|