@regulaforensics/face-sdk 8.3.1107-rc → 8.3.1111-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 +2 -2
- package/android/build.gradle +2 -2
- package/android/cordova.gradle +2 -2
- package/android/src/main/java/com/regula/plugin/facesdk/Config.kt +0 -91
- package/android/src/main/java/com/regula/plugin/facesdk/JSONConstructor.kt +3 -106
- package/android/src/main/java/com/regula/plugin/facesdk/Main.kt +1 -39
- package/android/src/main/java/com/regula/plugin/facesdk/Utils.kt +1 -0
- package/app.plugin.js +42 -0
- package/examples/capacitor/ios/App/Podfile +2 -1
- package/examples/capacitor/package.json +2 -2
- package/examples/ionic/package-lock.json +465 -472
- package/examples/ionic/package.json +14 -13
- package/examples/react_native/app.config.ts +1 -0
- package/examples/react_native/package-lock.json +11 -11
- package/examples/react_native/package.json +2 -2
- package/ios/Config.swift +1 -109
- package/ios/Decoder.swift +3 -71
- package/ios/Main.swift +4 -24
- package/package.json +4 -1
- package/plugin.xml +3 -3
- package/test/json.tsx +57 -134
- package/test/package-lock.json +1 -1
- package/test/test.tsx +60 -68
- package/www/capacitor/customization/customization_images.js +0 -40
- package/www/capacitor/index.js +12 -33
- package/www/capacitor/liveness/liveness_config.js +0 -1
- package/www/capacitor/liveness/liveness_exception.js +5 -6
- package/www/capacitor/liveness/liveness_notification.js +0 -2
- package/www/cordova.js +106 -606
- package/www/react-native/customization/customization_images.js +0 -40
- package/www/react-native/index.js +12 -33
- package/www/react-native/liveness/liveness_config.js +0 -1
- package/www/react-native/liveness/liveness_exception.js +5 -6
- package/www/react-native/liveness/liveness_notification.js +0 -2
- package/www/types/customization/customization_images.d.ts +0 -5
- package/www/types/index.d.ts +3 -28
- package/www/types/liveness/liveness_config.d.ts +0 -1
- package/www/types/liveness/liveness_exception.d.ts +0 -1
- package/www/types/liveness/liveness_notification.d.ts +0 -2
- package/www/capacitor/liveness/enrollment_config.js +0 -102
- package/www/capacitor/liveness/enrollment_request.js +0 -34
- package/www/capacitor/liveness/enrollment_response.js +0 -26
- package/www/capacitor/liveness/error_response.js +0 -21
- package/www/capacitor/liveness/verification_config.js +0 -98
- package/www/capacitor/liveness/verification_response.js +0 -27
- package/www/capacitor/liveness/verify_match_response.js +0 -21
- package/www/react-native/liveness/enrollment_config.js +0 -102
- package/www/react-native/liveness/enrollment_request.js +0 -34
- package/www/react-native/liveness/enrollment_response.js +0 -26
- package/www/react-native/liveness/error_response.js +0 -21
- package/www/react-native/liveness/verification_config.js +0 -98
- package/www/react-native/liveness/verification_response.js +0 -27
- package/www/react-native/liveness/verify_match_response.js +0 -21
- package/www/types/liveness/enrollment_config.d.ts +0 -97
- package/www/types/liveness/enrollment_request.d.ts +0 -6
- package/www/types/liveness/enrollment_response.d.ts +0 -9
- package/www/types/liveness/error_response.d.ts +0 -6
- package/www/types/liveness/verification_config.d.ts +0 -95
- package/www/types/liveness/verification_response.d.ts +0 -10
- package/www/types/liveness/verify_match_response.d.ts +0 -6
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 = '8.3.
|
|
8
|
+
s.version = '8.3.1111-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 = '13.0'
|
|
17
17
|
s.source_files = [ 'ios/**/*.swift', 'ios/**/RN*.m' ]
|
|
18
18
|
s.exclude_files = [ 'ios/CDVFaceSDK.swift' ]
|
|
19
|
-
s.dependency '
|
|
19
|
+
s.dependency 'FaceSDKNightly', '8.3.4503'
|
|
20
20
|
s.dependency 'React'
|
|
21
21
|
end
|
package/android/build.gradle
CHANGED
|
@@ -20,7 +20,7 @@ android {
|
|
|
20
20
|
rootProject.allprojects {
|
|
21
21
|
repositories {
|
|
22
22
|
maven {
|
|
23
|
-
url "https://maven.regulaforensics.com/RegulaDocumentReader/
|
|
23
|
+
url "https://maven.regulaforensics.com/RegulaDocumentReader/Nightly"
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -29,7 +29,7 @@ dependencies {
|
|
|
29
29
|
//noinspection GradleDynamicVersion
|
|
30
30
|
implementation 'com.facebook.react:react-native:+'
|
|
31
31
|
//noinspection GradleDependency
|
|
32
|
-
implementation('com.regula.face:api:8.3.
|
|
32
|
+
implementation('com.regula.face:api:8.3.5031'){
|
|
33
33
|
transitive = true
|
|
34
34
|
}
|
|
35
35
|
}
|
package/android/cordova.gradle
CHANGED
|
@@ -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:8.3.
|
|
15
|
+
implementation('com.regula.face:api:8.3.5031'){
|
|
16
16
|
transitive = true
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -3,11 +3,9 @@
|
|
|
3
3
|
package com.regula.plugin.facesdk
|
|
4
4
|
|
|
5
5
|
import com.regula.facesdk.configuration.Customization
|
|
6
|
-
import com.regula.facesdk.configuration.EnrollmentConfiguration
|
|
7
6
|
import com.regula.facesdk.configuration.FaceCaptureConfiguration
|
|
8
7
|
import com.regula.facesdk.configuration.LivenessConfiguration
|
|
9
8
|
import com.regula.facesdk.configuration.MatchFacesConfiguration
|
|
10
|
-
import com.regula.facesdk.configuration.VerificationConfiguration
|
|
11
9
|
import com.regula.facesdk.detection.request.ImageQualityCharacteristic
|
|
12
10
|
import com.regula.facesdk.detection.request.ImageQualityGroup
|
|
13
11
|
import com.regula.facesdk.detection.request.ImageQualityRange
|
|
@@ -87,95 +85,6 @@ fun getLivenessConfig(input: LivenessConfiguration) = mapOf(
|
|
|
87
85
|
"metadata" to input.metadata,
|
|
88
86
|
).toJson()
|
|
89
87
|
|
|
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
|
-
|
|
179
88
|
fun setMatchFacesConfig(builder: MatchFacesConfiguration.Builder, config: JSONObject) = config.forEach { k, v ->
|
|
180
89
|
when (k) {
|
|
181
90
|
"processingMode" -> builder.setProcessingMode(ProcessingMode.values()[v.toInt()])
|
|
@@ -9,12 +9,10 @@ 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
|
|
13
12
|
import com.regula.facesdk.configuration.FaceCaptureConfiguration
|
|
14
13
|
import com.regula.facesdk.configuration.InitializationConfiguration
|
|
15
14
|
import com.regula.facesdk.configuration.LivenessConfiguration
|
|
16
15
|
import com.regula.facesdk.configuration.MatchFacesConfiguration
|
|
17
|
-
import com.regula.facesdk.configuration.VerificationConfiguration
|
|
18
16
|
import com.regula.facesdk.detection.request.DetectFacesConfiguration
|
|
19
17
|
import com.regula.facesdk.detection.request.DetectFacesRequest
|
|
20
18
|
import com.regula.facesdk.detection.request.ImageQualityCharacteristic
|
|
@@ -52,13 +50,9 @@ import com.regula.facesdk.exception.UnderlineException
|
|
|
52
50
|
import com.regula.facesdk.model.Image
|
|
53
51
|
import com.regula.facesdk.model.LivenessNotification
|
|
54
52
|
import com.regula.facesdk.model.MatchFacesImage
|
|
55
|
-
import com.regula.facesdk.model.results.EnrollmentResponse
|
|
56
|
-
import com.regula.facesdk.model.results.ErrorResponse
|
|
57
53
|
import com.regula.facesdk.model.results.FaceCaptureResponse
|
|
58
54
|
import com.regula.facesdk.model.results.FaceSDKVersion
|
|
59
55
|
import com.regula.facesdk.model.results.LivenessResponse
|
|
60
|
-
import com.regula.facesdk.model.results.VerificationResponse
|
|
61
|
-
import com.regula.facesdk.model.results.VerifyMatchResponse
|
|
62
56
|
import com.regula.facesdk.model.results.matchfaces.MatchFacesComparedFace
|
|
63
57
|
import com.regula.facesdk.model.results.matchfaces.MatchFacesComparedFacesPair
|
|
64
58
|
import com.regula.facesdk.model.results.matchfaces.MatchFacesDetection
|
|
@@ -71,7 +65,6 @@ import com.regula.facesdk.model.results.person.PersonImage
|
|
|
71
65
|
import com.regula.facesdk.model.results.person.SearchPerson
|
|
72
66
|
import com.regula.facesdk.model.results.person.SearchPerson.Detection
|
|
73
67
|
import com.regula.facesdk.model.results.person.SearchPersonImage
|
|
74
|
-
import com.regula.facesdk.request.EnrollmentRequest
|
|
75
68
|
import com.regula.facesdk.request.MatchFacesRequest
|
|
76
69
|
import com.regula.facesdk.request.person.EditGroupPersonsRequest
|
|
77
70
|
import com.regula.facesdk.request.person.ImageUpload
|
|
@@ -81,8 +74,6 @@ import com.regula.plugin.facesdk.Convert.toBitmap
|
|
|
81
74
|
import com.regula.plugin.facesdk.Convert.toByteArray
|
|
82
75
|
import org.json.JSONArray
|
|
83
76
|
import org.json.JSONObject
|
|
84
|
-
import java.lang.Double
|
|
85
|
-
import java.lang.Float
|
|
86
77
|
|
|
87
78
|
// Config ------------------------------
|
|
88
79
|
|
|
@@ -110,22 +101,6 @@ fun livenessConfigFromJSON(input: JSONObject) = input.let {
|
|
|
110
101
|
|
|
111
102
|
fun generateLivenessConfig(input: LivenessConfiguration) = getLivenessConfig(input)
|
|
112
103
|
|
|
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
|
-
|
|
129
104
|
fun matchFacesConfigFromJSON(input: JSONObject) = input.let {
|
|
130
105
|
val result = MatchFacesConfiguration.Builder()
|
|
131
106
|
setMatchFacesConfig(result, it)
|
|
@@ -365,24 +340,6 @@ fun generateFaceCaptureResponse(it: FaceCaptureResponse) = mapOf(
|
|
|
365
340
|
|
|
366
341
|
// Liveness ------------------------------
|
|
367
342
|
|
|
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
|
-
|
|
386
343
|
fun livenessResponseFromJSON(input: JSONObject?) = input?.let {
|
|
387
344
|
val result = LivenessResponse()
|
|
388
345
|
it.getStringOrNull("image").toBitmap()?.let { bitmap ->
|
|
@@ -417,66 +374,6 @@ fun generateLivenessNotification(it: LivenessNotification) = mapOf(
|
|
|
417
374
|
"response" to generateLivenessResponse(it.response)
|
|
418
375
|
).toJson()
|
|
419
376
|
|
|
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
|
-
VerifyMatchResponse(
|
|
452
|
-
it.getBoolean("passed"),
|
|
453
|
-
it.get("similarity").toFloat()
|
|
454
|
-
)
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
fun generateVerifyMatchResponse(input: VerifyMatchResponse?) = 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
|
-
|
|
480
377
|
// MatchFaces ------------------------------
|
|
481
378
|
|
|
482
379
|
fun matchFacesImageFromJSON(input: JSONObject?) = input?.let {
|
|
@@ -588,7 +485,7 @@ fun generateRect(input: Rect?) = input?.let {
|
|
|
588
485
|
}
|
|
589
486
|
|
|
590
487
|
fun matchFacesDetectionFaceFromJSON(input: JSONObject?) = input?.let {
|
|
591
|
-
val result = MatchFacesDetectionFace::class.constructor(Int::class, Double::class, ArrayList::class, Rect::class, Rect::class).instantiate(
|
|
488
|
+
val result = MatchFacesDetectionFace::class.constructor(Int::class, java.lang.Double::class, ArrayList::class, Rect::class, Rect::class).instantiate(
|
|
592
489
|
it.getIntOrNull("faceIndex"),
|
|
593
490
|
it.getDoubleOrNull("rotationAngle"),
|
|
594
491
|
it.getJSONArrayOrNull("landmarks").toList(::pointFromJSON).toArrayList(),
|
|
@@ -644,7 +541,7 @@ fun generateComparedFace(it: MatchFacesComparedFace) = mapOf(
|
|
|
644
541
|
).toJson()
|
|
645
542
|
|
|
646
543
|
fun comparedFacesPairFromJSON(input: JSONObject): MatchFacesComparedFacesPair = input.let {
|
|
647
|
-
MatchFacesComparedFacesPair::class.constructor(MatchFacesComparedFace::class, MatchFacesComparedFace::class, MatchFacesException::class, Float::class, Float::class).instantiate(
|
|
544
|
+
MatchFacesComparedFacesPair::class.constructor(MatchFacesComparedFace::class, MatchFacesComparedFace::class, MatchFacesException::class, java.lang.Float::class, java.lang.Float::class).instantiate(
|
|
648
545
|
comparedFaceFromJSON(it.getJSONObject("first")),
|
|
649
546
|
comparedFaceFromJSON(it.getJSONObject("second")),
|
|
650
547
|
matchFacesExceptionFromJSON(it.getJSONObjectOrNull("error")),
|
|
@@ -1015,4 +912,4 @@ fun generateSearchPerson(input: SearchPerson?) = input?.let {
|
|
|
1015
912
|
"metadata" to it.metadata,
|
|
1016
913
|
"createdAt" to it.createdAt.toStr()
|
|
1017
914
|
).toJson()
|
|
1018
|
-
}
|
|
915
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
package com.regula.plugin.facesdk
|
|
2
2
|
|
|
3
3
|
import android.annotation.SuppressLint
|
|
4
|
+
import com.regula.plugin.facesdk.Convert.toBase64
|
|
4
5
|
import com.regula.common.LocalizationCallbacks
|
|
5
6
|
import com.regula.facesdk.FaceSDK.Instance
|
|
6
7
|
import com.regula.facesdk.callback.DetectFacesCompletion
|
|
@@ -16,16 +17,12 @@ import com.regula.facesdk.enums.InitErrorCode
|
|
|
16
17
|
import com.regula.facesdk.exception.InitException
|
|
17
18
|
import com.regula.facesdk.listener.NetworkInterceptorListener
|
|
18
19
|
import com.regula.facesdk.model.LivenessNotification
|
|
19
|
-
import com.regula.facesdk.model.results.EnrollmentResponse
|
|
20
|
-
import com.regula.facesdk.model.results.LivenessResponse
|
|
21
|
-
import com.regula.facesdk.model.results.VerificationResponse
|
|
22
20
|
import com.regula.facesdk.model.results.matchfaces.MatchFacesSimilarityThresholdSplit
|
|
23
21
|
import com.regula.facesdk.model.results.person.DbBaseItem
|
|
24
22
|
import com.regula.facesdk.model.results.person.PageableItemList
|
|
25
23
|
import com.regula.facesdk.model.results.person.Person
|
|
26
24
|
import com.regula.facesdk.model.results.person.PersonGroup
|
|
27
25
|
import com.regula.facesdk.model.results.person.SearchPerson
|
|
28
|
-
import com.regula.plugin.facesdk.Convert.toBase64
|
|
29
26
|
import org.json.JSONArray
|
|
30
27
|
import org.json.JSONObject
|
|
31
28
|
|
|
@@ -48,9 +45,6 @@ fun methodCall(method: String, callback: (Any?) -> Unit): Any = when (method) {
|
|
|
48
45
|
"startFaceCapture" -> startFaceCapture(callback, argsNullable(0))
|
|
49
46
|
"stopFaceCapture" -> stopFaceCapture()
|
|
50
47
|
"startLiveness" -> startLiveness(callback, argsNullable(0))
|
|
51
|
-
"startEnrollment" -> startEnrollment(callback, args(0))
|
|
52
|
-
"startVerification" -> startVerification(callback, args(0))
|
|
53
|
-
"enrollWithTrustedPhoto" -> enrollWithTrustedPhoto(callback, args(0))
|
|
54
48
|
"stopLiveness" -> stopLiveness()
|
|
55
49
|
"matchFaces" -> matchFaces(callback, args(0), argsNullable(1))
|
|
56
50
|
"splitComparedFaces" -> splitComparedFaces(callback, args(0), args(1))
|
|
@@ -160,24 +154,6 @@ fun startLiveness(callback: Callback, config: JSONObject?) = config?.let {
|
|
|
160
154
|
livenessNotificationCompletion()
|
|
161
155
|
)
|
|
162
156
|
|
|
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
|
-
|
|
181
157
|
fun stopLiveness() = Instance().stopLivenessProcessing(context)
|
|
182
158
|
|
|
183
159
|
fun matchFaces(callback: Callback, request: JSONObject, config: JSONObject?) = config?.let {
|
|
@@ -395,20 +371,6 @@ fun detectFacesCompletion(callback: Callback) = DetectFacesCompletion {
|
|
|
395
371
|
callback(generateDetectFacesResponse(it))
|
|
396
372
|
}
|
|
397
373
|
|
|
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
|
-
|
|
412
374
|
fun <T> databaseItemCompletion(callback: Callback, toJson: ((T?) -> JSONObject?)?) = object : PersonDBCallback<T> {
|
|
413
375
|
override fun onSuccess(data: T?) = callback(generatePersonDBResponse(toJson?.let { it(data) } ?: true, null))
|
|
414
376
|
override fun onFailure(error: String) = callback(generatePersonDBResponse(null, error))
|
|
@@ -15,6 +15,7 @@ import com.regula.common.ble.BLEWrapper
|
|
|
15
15
|
import com.regula.facesdk.configuration.Customization
|
|
16
16
|
import com.regula.facesdk.enums.CustomizationColor
|
|
17
17
|
import com.regula.facesdk.enums.CustomizationFont
|
|
18
|
+
import com.regula.facesdk.enums.CustomizationImage
|
|
18
19
|
import com.regula.facesdk.enums.ImageType
|
|
19
20
|
import com.regula.facesdk.enums.InitErrorCode
|
|
20
21
|
import com.regula.facesdk.enums.OutputImageCropAspectRatio
|
package/app.plugin.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const { createRequire } = require('module'); // passing vulnerability checks
|
|
2
|
+
const { withPodfile } = createRequire(process.cwd() + '/package.json')('@expo/config-plugins');
|
|
3
|
+
|
|
4
|
+
const SOURCES = [
|
|
5
|
+
'https://github.com/CocoaPods/Specs.git',
|
|
6
|
+
'https://github.com/regulaforensics/podspecs.git',
|
|
7
|
+
];
|
|
8
|
+
|
|
9
|
+
module.exports = function withRegulaPodSources(config) {
|
|
10
|
+
return withPodfile(config, (config) => {
|
|
11
|
+
let podfile = config.modResults.contents;
|
|
12
|
+
|
|
13
|
+
const missingSources = SOURCES.filter(
|
|
14
|
+
(source) =>
|
|
15
|
+
!podfile.includes(`source '${source}'`) &&
|
|
16
|
+
!podfile.includes(`source "${source}"`)
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
if (missingSources.length === 0) {
|
|
20
|
+
return config;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const header = [
|
|
24
|
+
'# ============================================================================',
|
|
25
|
+
'# Regula Pod Sources',
|
|
26
|
+
'# Added automatically by @regulaforensics/face-sdk',
|
|
27
|
+
'#',
|
|
28
|
+
'# Sources:',
|
|
29
|
+
...SOURCES.map((s) => `# - ${s}`),
|
|
30
|
+
'# ============================================================================',
|
|
31
|
+
'',
|
|
32
|
+
...missingSources.map((s) => `source '${s}'`),
|
|
33
|
+
'',
|
|
34
|
+
'',
|
|
35
|
+
'',
|
|
36
|
+
].join('\n');
|
|
37
|
+
|
|
38
|
+
config.modResults.contents = header + podfile;
|
|
39
|
+
|
|
40
|
+
return config;
|
|
41
|
+
});
|
|
42
|
+
};
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
"android": "scripts/android.sh"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@regulaforensics/face-sdk": "8.3.
|
|
10
|
-
"@regulaforensics/face-core-basic": "8.3.
|
|
9
|
+
"@regulaforensics/face-sdk": "8.3.1111-nightly",
|
|
10
|
+
"@regulaforensics/face-core-basic": "8.3.607-nightly",
|
|
11
11
|
"@awesome-cordova-plugins/file": "^8.1.0",
|
|
12
12
|
"@awesome-cordova-plugins/camera": "^8.1.0",
|
|
13
13
|
"cordova-plugin-file": "^8.1.3",
|