@regulaforensics/face-sdk 8.3.1174-rc → 8.3.1177-rc
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 +1 -1
- package/android/cordova.gradle +1 -1
- package/android/src/main/java/com/regula/plugin/facesdk/Config.kt +91 -0
- package/android/src/main/java/com/regula/plugin/facesdk/JSONConstructor.kt +106 -3
- package/android/src/main/java/com/regula/plugin/facesdk/Main.kt +39 -1
- package/android/src/main/java/com/regula/plugin/facesdk/Utils.kt +0 -1
- package/examples/capacitor/README.md +1 -1
- package/examples/capacitor/package.json +2 -2
- package/examples/capacitor/scripts/android.sh +3 -1
- package/examples/capacitor/scripts/ios.sh +3 -1
- package/examples/capacitor/scripts/setup.sh +2 -0
- package/examples/ionic/README.md +1 -1
- package/examples/ionic/config.xml +0 -2
- package/examples/ionic/index.tsx +1 -1
- package/examples/ionic/package-lock.json +2360 -1733
- package/examples/ionic/package.json +21 -25
- package/examples/ionic/scripts/android.sh +4 -1
- package/examples/ionic/scripts/ios.sh +4 -1
- package/examples/ionic/scripts/setup.sh +2 -0
- package/examples/ionic/tsconfig.json +1 -1
- package/examples/react_native/README.md +1 -1
- package/examples/react_native/package.json +2 -2
- package/examples/react_native/scripts/android.sh +5 -5
- package/examples/react_native/scripts/ios.sh +5 -5
- package/examples/react_native/scripts/setup.sh +2 -0
- package/ios/Config.swift +107 -1
- package/ios/Decoder.swift +71 -3
- package/ios/Main.swift +24 -4
- package/package.json +1 -1
- package/plugin.xml +2 -2
- package/test/json.tsx +135 -57
- package/test/package-lock.json +1 -1
- package/test/test.tsx +183 -60
- package/www/capacitor/customization/customization_images.js +48 -0
- package/www/capacitor/customization/font.js +3 -3
- package/www/capacitor/detect_faces/detect_faces_config.js +5 -5
- package/www/capacitor/detect_faces/detect_faces_request.js +2 -2
- package/www/capacitor/face_capture/face_capture_config.js +14 -14
- package/www/capacitor/image_params/output_image_crop.js +4 -4
- package/www/capacitor/image_params/output_image_params.js +3 -3
- package/www/capacitor/image_quality/image_quality_characteristic.js +4 -4
- package/www/capacitor/image_quality/image_quality_group.js +2 -2
- package/www/capacitor/index.js +153 -32
- package/www/capacitor/init/init_config.js +2 -2
- package/www/capacitor/internal/bridge.js +2 -2
- package/www/capacitor/internal/cordova.js +2 -2
- package/www/capacitor/liveness/enrollment_config.js +102 -0
- package/www/capacitor/liveness/enrollment_request.js +39 -0
- package/www/capacitor/liveness/enrollment_response.js +26 -0
- package/www/capacitor/liveness/error_response.js +21 -0
- package/www/capacitor/liveness/liveness_config.js +18 -17
- package/www/capacitor/liveness/liveness_exception.js +7 -5
- package/www/capacitor/liveness/liveness_notification.js +2 -0
- package/www/capacitor/liveness/verification_config.js +98 -0
- package/www/capacitor/liveness/verification_response.js +27 -0
- package/www/capacitor/liveness/verify_match_response.js +21 -0
- package/www/capacitor/match_faces/match_faces_config.js +3 -3
- package/www/capacitor/match_faces/match_faces_image.js +2 -2
- package/www/capacitor/match_faces/match_faces_request.js +4 -4
- package/www/capacitor/person_database/edit_group_persons_request.js +3 -3
- package/www/capacitor/person_database/person_database.js +4 -4
- package/www/capacitor/person_database/search_person_request.js +7 -7
- package/www/cordova.js +703 -173
- package/www/react-native/customization/customization_images.js +48 -0
- package/www/react-native/customization/font.js +3 -3
- package/www/react-native/detect_faces/detect_faces_config.js +5 -5
- package/www/react-native/detect_faces/detect_faces_request.js +2 -2
- package/www/react-native/face_capture/face_capture_config.js +14 -14
- package/www/react-native/image_params/output_image_crop.js +4 -4
- package/www/react-native/image_params/output_image_params.js +3 -3
- package/www/react-native/image_quality/image_quality_characteristic.js +4 -4
- package/www/react-native/image_quality/image_quality_group.js +2 -2
- package/www/react-native/index.js +153 -32
- package/www/react-native/init/init_config.js +2 -2
- package/www/react-native/internal/bridge.js +2 -2
- package/www/react-native/liveness/enrollment_config.js +102 -0
- package/www/react-native/liveness/enrollment_request.js +39 -0
- package/www/react-native/liveness/enrollment_response.js +26 -0
- package/www/react-native/liveness/error_response.js +21 -0
- package/www/react-native/liveness/liveness_config.js +18 -17
- package/www/react-native/liveness/liveness_exception.js +7 -5
- package/www/react-native/liveness/liveness_notification.js +2 -0
- package/www/react-native/liveness/verification_config.js +98 -0
- package/www/react-native/liveness/verification_response.js +27 -0
- package/www/react-native/liveness/verify_match_response.js +21 -0
- package/www/react-native/match_faces/match_faces_config.js +3 -3
- package/www/react-native/match_faces/match_faces_image.js +2 -2
- package/www/react-native/match_faces/match_faces_request.js +4 -4
- package/www/react-native/person_database/edit_group_persons_request.js +3 -3
- package/www/react-native/person_database/person_database.js +4 -4
- package/www/react-native/person_database/search_person_request.js +7 -7
- package/www/types/customization/customization_images.d.ts +6 -0
- package/www/types/customization/font.d.ts +1 -1
- package/www/types/detect_faces/detect_faces_config.d.ts +1 -1
- package/www/types/detect_faces/detect_faces_request.d.ts +1 -1
- package/www/types/face_capture/face_capture_config.d.ts +1 -1
- package/www/types/image_params/output_image_crop.d.ts +1 -1
- package/www/types/image_params/output_image_params.d.ts +1 -1
- package/www/types/image_quality/image_quality_group.d.ts +1 -1
- package/www/types/index.d.ts +137 -15
- package/www/types/init/init_config.d.ts +1 -1
- package/www/types/liveness/enrollment_config.d.ts +97 -0
- package/www/types/liveness/enrollment_request.d.ts +24 -0
- package/www/types/liveness/enrollment_response.d.ts +9 -0
- package/www/types/liveness/error_response.d.ts +6 -0
- package/www/types/liveness/liveness_config.d.ts +2 -1
- package/www/types/liveness/liveness_exception.d.ts +32 -2
- package/www/types/liveness/liveness_notification.d.ts +2 -0
- package/www/types/liveness/verification_config.d.ts +95 -0
- package/www/types/liveness/verification_response.d.ts +10 -0
- package/www/types/liveness/verify_match_response.d.ts +6 -0
- package/www/types/match_faces/match_faces_config.d.ts +1 -1
- package/www/types/match_faces/match_faces_image.d.ts +1 -1
- package/www/types/match_faces/match_faces_request.d.ts +1 -1
- package/www/types/person_database/edit_group_persons_request.d.ts +1 -1
- package/www/types/person_database/person_database.d.ts +2 -2
- package/www/types/person_database/search_person_request.d.ts +1 -1
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.1177-rc'
|
|
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 'FaceSDKStage', '8.3.
|
|
19
|
+
s.dependency 'FaceSDKStage', '8.3.4623'
|
|
20
20
|
s.dependency 'React'
|
|
21
21
|
end
|
package/android/build.gradle
CHANGED
|
@@ -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.5126'){
|
|
33
33
|
transitive = true
|
|
34
34
|
}
|
|
35
35
|
}
|
package/android/cordova.gradle
CHANGED
|
@@ -3,9 +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
7
|
import com.regula.facesdk.configuration.FaceCaptureConfiguration
|
|
7
8
|
import com.regula.facesdk.configuration.LivenessConfiguration
|
|
8
9
|
import com.regula.facesdk.configuration.MatchFacesConfiguration
|
|
10
|
+
//import com.regula.facesdk.configuration.VerificationConfiguration
|
|
9
11
|
import com.regula.facesdk.detection.request.ImageQualityCharacteristic
|
|
10
12
|
import com.regula.facesdk.detection.request.ImageQualityGroup
|
|
11
13
|
import com.regula.facesdk.detection.request.ImageQualityRange
|
|
@@ -85,6 +87,95 @@ fun getLivenessConfig(input: LivenessConfiguration) = mapOf(
|
|
|
85
87
|
"metadata" to input.metadata,
|
|
86
88
|
).toJson()
|
|
87
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()
|
|
178
|
+
|
|
88
179
|
fun setMatchFacesConfig(builder: MatchFacesConfiguration.Builder, config: JSONObject) = config.forEach { k, v ->
|
|
89
180
|
when (k) {
|
|
90
181
|
"processingMode" -> builder.setProcessingMode(ProcessingMode.values()[v.toInt()])
|
|
@@ -9,10 +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
13
|
import com.regula.facesdk.configuration.FaceCaptureConfiguration
|
|
13
14
|
import com.regula.facesdk.configuration.InitializationConfiguration
|
|
14
15
|
import com.regula.facesdk.configuration.LivenessConfiguration
|
|
15
16
|
import com.regula.facesdk.configuration.MatchFacesConfiguration
|
|
17
|
+
//import com.regula.facesdk.configuration.VerificationConfiguration
|
|
16
18
|
import com.regula.facesdk.detection.request.DetectFacesConfiguration
|
|
17
19
|
import com.regula.facesdk.detection.request.DetectFacesRequest
|
|
18
20
|
import com.regula.facesdk.detection.request.ImageQualityCharacteristic
|
|
@@ -50,9 +52,13 @@ import com.regula.facesdk.exception.UnderlineException
|
|
|
50
52
|
import com.regula.facesdk.model.Image
|
|
51
53
|
import com.regula.facesdk.model.LivenessNotification
|
|
52
54
|
import com.regula.facesdk.model.MatchFacesImage
|
|
55
|
+
//import com.regula.facesdk.model.results.EnrollmentResponse
|
|
56
|
+
//import com.regula.facesdk.model.results.ErrorResponse
|
|
53
57
|
import com.regula.facesdk.model.results.FaceCaptureResponse
|
|
54
58
|
import com.regula.facesdk.model.results.FaceSDKVersion
|
|
55
59
|
import com.regula.facesdk.model.results.LivenessResponse
|
|
60
|
+
//import com.regula.facesdk.model.results.VerificationResponse
|
|
61
|
+
//import com.regula.facesdk.model.results.VerificationMatchResponse
|
|
56
62
|
import com.regula.facesdk.model.results.matchfaces.MatchFacesComparedFace
|
|
57
63
|
import com.regula.facesdk.model.results.matchfaces.MatchFacesComparedFacesPair
|
|
58
64
|
import com.regula.facesdk.model.results.matchfaces.MatchFacesDetection
|
|
@@ -65,6 +71,7 @@ import com.regula.facesdk.model.results.person.PersonImage
|
|
|
65
71
|
import com.regula.facesdk.model.results.person.SearchPerson
|
|
66
72
|
import com.regula.facesdk.model.results.person.SearchPerson.Detection
|
|
67
73
|
import com.regula.facesdk.model.results.person.SearchPersonImage
|
|
74
|
+
//import com.regula.facesdk.request.EnrollmentRequest
|
|
68
75
|
import com.regula.facesdk.request.MatchFacesRequest
|
|
69
76
|
import com.regula.facesdk.request.person.EditGroupPersonsRequest
|
|
70
77
|
import com.regula.facesdk.request.person.ImageUpload
|
|
@@ -74,6 +81,8 @@ import com.regula.plugin.facesdk.Convert.toBitmap
|
|
|
74
81
|
import com.regula.plugin.facesdk.Convert.toByteArray
|
|
75
82
|
import org.json.JSONArray
|
|
76
83
|
import org.json.JSONObject
|
|
84
|
+
import java.lang.Double
|
|
85
|
+
import java.lang.Float
|
|
77
86
|
|
|
78
87
|
// Config ------------------------------
|
|
79
88
|
|
|
@@ -101,6 +110,22 @@ fun livenessConfigFromJSON(input: JSONObject) = input.let {
|
|
|
101
110
|
|
|
102
111
|
fun generateLivenessConfig(input: LivenessConfiguration) = getLivenessConfig(input)
|
|
103
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)
|
|
128
|
+
|
|
104
129
|
fun matchFacesConfigFromJSON(input: JSONObject) = input.let {
|
|
105
130
|
val result = MatchFacesConfiguration.Builder()
|
|
106
131
|
setMatchFacesConfig(result, it)
|
|
@@ -340,6 +365,24 @@ fun generateFaceCaptureResponse(it: FaceCaptureResponse) = mapOf(
|
|
|
340
365
|
|
|
341
366
|
// Liveness ------------------------------
|
|
342
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
|
+
//}
|
|
385
|
+
|
|
343
386
|
fun livenessResponseFromJSON(input: JSONObject?) = input?.let {
|
|
344
387
|
val result = LivenessResponse()
|
|
345
388
|
it.getStringOrNull("image").toBitmap()?.let { bitmap ->
|
|
@@ -374,6 +417,66 @@ fun generateLivenessNotification(it: LivenessNotification) = mapOf(
|
|
|
374
417
|
"response" to generateLivenessResponse(it.response)
|
|
375
418
|
).toJson()
|
|
376
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
|
+
//}
|
|
479
|
+
|
|
377
480
|
// MatchFaces ------------------------------
|
|
378
481
|
|
|
379
482
|
fun matchFacesImageFromJSON(input: JSONObject?) = input?.let {
|
|
@@ -485,7 +588,7 @@ fun generateRect(input: Rect?) = input?.let {
|
|
|
485
588
|
}
|
|
486
589
|
|
|
487
590
|
fun matchFacesDetectionFaceFromJSON(input: JSONObject?) = input?.let {
|
|
488
|
-
val result = MatchFacesDetectionFace::class.constructor(Int::class,
|
|
591
|
+
val result = MatchFacesDetectionFace::class.constructor(Int::class, Double::class, ArrayList::class, Rect::class, Rect::class).instantiate(
|
|
489
592
|
it.getIntOrNull("faceIndex"),
|
|
490
593
|
it.getDoubleOrNull("rotationAngle"),
|
|
491
594
|
it.getJSONArrayOrNull("landmarks").toList(::pointFromJSON).toArrayList(),
|
|
@@ -541,7 +644,7 @@ fun generateComparedFace(it: MatchFacesComparedFace) = mapOf(
|
|
|
541
644
|
).toJson()
|
|
542
645
|
|
|
543
646
|
fun comparedFacesPairFromJSON(input: JSONObject): MatchFacesComparedFacesPair = input.let {
|
|
544
|
-
MatchFacesComparedFacesPair::class.constructor(MatchFacesComparedFace::class, MatchFacesComparedFace::class, MatchFacesException::class,
|
|
647
|
+
MatchFacesComparedFacesPair::class.constructor(MatchFacesComparedFace::class, MatchFacesComparedFace::class, MatchFacesException::class, Float::class, Float::class).instantiate(
|
|
545
648
|
comparedFaceFromJSON(it.getJSONObject("first")),
|
|
546
649
|
comparedFaceFromJSON(it.getJSONObject("second")),
|
|
547
650
|
matchFacesExceptionFromJSON(it.getJSONObjectOrNull("error")),
|
|
@@ -912,4 +1015,4 @@ fun generateSearchPerson(input: SearchPerson?) = input?.let {
|
|
|
912
1015
|
"metadata" to it.metadata,
|
|
913
1016
|
"createdAt" to it.createdAt.toStr()
|
|
914
1017
|
).toJson()
|
|
915
|
-
}
|
|
1018
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
package com.regula.plugin.facesdk
|
|
2
2
|
|
|
3
3
|
import android.annotation.SuppressLint
|
|
4
|
-
import com.regula.plugin.facesdk.Convert.toBase64
|
|
5
4
|
import com.regula.common.LocalizationCallbacks
|
|
6
5
|
import com.regula.facesdk.FaceSDK.Instance
|
|
7
6
|
import com.regula.facesdk.callback.DetectFacesCompletion
|
|
@@ -17,12 +16,16 @@ import com.regula.facesdk.enums.InitErrorCode
|
|
|
17
16
|
import com.regula.facesdk.exception.InitException
|
|
18
17
|
import com.regula.facesdk.listener.NetworkInterceptorListener
|
|
19
18
|
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
|
|
20
22
|
import com.regula.facesdk.model.results.matchfaces.MatchFacesSimilarityThresholdSplit
|
|
21
23
|
import com.regula.facesdk.model.results.person.DbBaseItem
|
|
22
24
|
import com.regula.facesdk.model.results.person.PageableItemList
|
|
23
25
|
import com.regula.facesdk.model.results.person.Person
|
|
24
26
|
import com.regula.facesdk.model.results.person.PersonGroup
|
|
25
27
|
import com.regula.facesdk.model.results.person.SearchPerson
|
|
28
|
+
import com.regula.plugin.facesdk.Convert.toBase64
|
|
26
29
|
import org.json.JSONArray
|
|
27
30
|
import org.json.JSONObject
|
|
28
31
|
|
|
@@ -45,6 +48,9 @@ fun methodCall(method: String, callback: (Any?) -> Unit): Any = when (method) {
|
|
|
45
48
|
"startFaceCapture" -> startFaceCapture(callback, argsNullable(0))
|
|
46
49
|
"stopFaceCapture" -> stopFaceCapture()
|
|
47
50
|
"startLiveness" -> startLiveness(callback, argsNullable(0))
|
|
51
|
+
// "startEnrollment" -> startEnrollment(callback, args(0))
|
|
52
|
+
// "startVerification" -> startVerification(callback, args(0))
|
|
53
|
+
// "enrollWithTrustedPhoto" -> enrollWithTrustedPhoto(callback, args(0))
|
|
48
54
|
"stopLiveness" -> stopLiveness()
|
|
49
55
|
"matchFaces" -> matchFaces(callback, args(0), argsNullable(1))
|
|
50
56
|
"splitComparedFaces" -> splitComparedFaces(callback, args(0), args(1))
|
|
@@ -154,6 +160,24 @@ fun startLiveness(callback: Callback, config: JSONObject?) = config?.let {
|
|
|
154
160
|
livenessNotificationCompletion()
|
|
155
161
|
)
|
|
156
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)) }
|
|
180
|
+
|
|
157
181
|
fun stopLiveness() = Instance().stopLivenessProcessing(context)
|
|
158
182
|
|
|
159
183
|
fun matchFaces(callback: Callback, request: JSONObject, config: JSONObject?) = config?.let {
|
|
@@ -371,6 +395,20 @@ fun detectFacesCompletion(callback: Callback) = DetectFacesCompletion {
|
|
|
371
395
|
callback(generateDetectFacesResponse(it))
|
|
372
396
|
}
|
|
373
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
|
+
//}
|
|
411
|
+
|
|
374
412
|
fun <T> databaseItemCompletion(callback: Callback, toJson: ((T?) -> JSONObject?)?) = object : PersonDBCallback<T> {
|
|
375
413
|
override fun onSuccess(data: T?) = callback(generatePersonDBResponse(toJson?.let { it(data) } ?: true, null))
|
|
376
414
|
override fun onFailure(error: String) = callback(generatePersonDBResponse(null, error))
|
|
@@ -15,7 +15,6 @@ 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
|
|
19
18
|
import com.regula.facesdk.enums.ImageType
|
|
20
19
|
import com.regula.facesdk.enums.InitErrorCode
|
|
21
20
|
import com.regula.facesdk.enums.OutputImageCropAspectRatio
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* IOS: `npm run ios`.
|
|
10
10
|
* Android: `npm run android`.
|
|
11
11
|
|
|
12
|
-
**Note**: this is just one way of running the app. You can also pass
|
|
12
|
+
**Note**: this is just one way of running the app. You can also pass `-- -o` or `-- --open` argument to the command, and this will open Xcode/Android Studio, then run the app directly from the IDE. Overall, this is a more consistent way, so if you're having troubles running the app from terminal, try running it from the IDE.
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
## How to use offline match
|
|
@@ -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.1177-rc",
|
|
10
|
+
"@regulaforensics/face-core-basic": "8.3.644-rc",
|
|
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",
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
set -e
|
|
3
3
|
|
|
4
|
-
if [[
|
|
4
|
+
if [[ " $* " == *" --open "* ]] || [[ " $* " == *" -o "* ]]; then
|
|
5
5
|
ionic cap sync android
|
|
6
6
|
open -a 'Android Studio' android
|
|
7
7
|
else
|
|
8
8
|
ionic cap run android
|
|
9
9
|
fi
|
|
10
|
+
|
|
11
|
+
exit 0
|
package/examples/ionic/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* IOS: `npm run ios`.
|
|
10
10
|
* Android: `npm run android`.
|
|
11
11
|
|
|
12
|
-
**Note**: this is just one way of running the app. You can also pass
|
|
12
|
+
**Note**: this is just one way of running the app. You can also pass `-- -o` or `-- --open` argument to the command, and this will open Xcode/Android Studio, then run the app directly from the IDE. Overall, this is a more consistent way, so if you're having troubles running the app from terminal, try running it from the IDE.
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
## How to use offline match
|
|
@@ -6,8 +6,6 @@
|
|
|
6
6
|
<platform name="android">
|
|
7
7
|
<preference name="orientation" value="portrait" />
|
|
8
8
|
<preference name="AndroidEdgeToEdge" value="true" />
|
|
9
|
-
<preference name="android-minSdkVersion" value="24" />
|
|
10
|
-
<preference name="android-targetSdkVersion" value="36" />
|
|
11
9
|
<preference name="GradlePluginKotlinEnabled" value="true" />
|
|
12
10
|
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
|
|
13
11
|
<application android:usesCleartextTraffic="true" />
|
package/examples/ionic/index.tsx
CHANGED
|
@@ -14,7 +14,7 @@ import { main } from './src/main'
|
|
|
14
14
|
export async function loadAssetIfExists(path: string): Promise<string | null> {
|
|
15
15
|
try {
|
|
16
16
|
var dir = await File.resolveDirectoryUrl(File.applicationDirectory + "www/assets")
|
|
17
|
-
var fileEntry = await File.getFile(dir, path,
|
|
17
|
+
var fileEntry = await File.getFile(dir, path, {})
|
|
18
18
|
var result = await new Promise<string | null>((resolve, _) => {
|
|
19
19
|
fileEntry.file(file => {
|
|
20
20
|
var reader = new FileReader()
|