@regulaforensics/cordova-plugin-document-reader-api 8.3.248 → 8.4.15-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/README.md +4 -0
- package/example/package.json +2 -2
- package/package.json +1 -1
- package/plugin.xml +2 -2
- package/src/android/BluetoothUtil.kt +9 -5
- package/src/android/Config.kt +20 -0
- package/src/android/JSONConstructor.kt +3 -0
- package/src/android/Main.kt +8 -5
- package/src/android/build.gradle +2 -2
- package/src/ios/RGLWConfig.m +10 -9
- package/src/ios/RGLWDocumentReader.m +1 -1
- package/src/ios/RGLWJSONConstructor.m +3 -0
- package/src/ios/RGLWMain.h +2 -2
- package/src/ios/RGLWMain.m +2 -2
- package/www/DocumentReader.js +26 -0
package/README.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
# Deprecated
|
|
2
|
+
|
|
3
|
+
Introduced a new unified [NPM package](https://www.npmjs.com/package/@regulaforensics/document-reader) that supports React, Ionic, and Cordova wrappers in a single distribution. The individual packages for each wrapper are now deprecated and will only be supported for a few upcoming releases before being removed in future versions. We’ll provide advance notice prior to their removal. Follow the Migration Guide for detailed steps to transition to the new unified package.
|
|
4
|
+
|
|
1
5
|
# Regula Document Reader SDK for Cordova
|
|
2
6
|
|
|
3
7
|
Regula Document Reader SDK allows you to read various kinds of identification documents, passports, driving licenses, ID cards, etc. All processing is performed completely _**offline**_ on your device. No any data leaving your device.
|
package/example/package.json
CHANGED
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"author": "Regula Forensics Inc.",
|
|
14
14
|
"license": "commercial",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@regulaforensics/cordova-plugin-document-reader-api": "8.
|
|
17
|
-
"@regulaforensics/cordova-plugin-document-reader-core-fullauthrfid": "8.
|
|
16
|
+
"@regulaforensics/cordova-plugin-document-reader-api": "8.4.15-nightly",
|
|
17
|
+
"@regulaforensics/cordova-plugin-document-reader-core-fullauthrfid": "8.5.1192-nightly",
|
|
18
18
|
"cordova-android": "13.0.0",
|
|
19
19
|
"cordova-ios": "7.1.1",
|
|
20
20
|
"cordova-plugin-add-swift-support": "2.0.2",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@regulaforensics/cordova-plugin-document-reader-api",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.4.15-nightly",
|
|
4
4
|
"description": "Cordova plugin for reading and validation of identification documents (API framework)",
|
|
5
5
|
"cordova": {
|
|
6
6
|
"id": "@regulaforensics/cordova-plugin-document-reader-api",
|
package/plugin.xml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<?xml version='1.0' encoding='utf-8'?>
|
|
2
|
-
<plugin id="@regulaforensics/cordova-plugin-document-reader-api" version="8.
|
|
2
|
+
<plugin id="@regulaforensics/cordova-plugin-document-reader-api" version="8.4.15-nightly" xmlns="http://apache.org/cordova/ns/plugins/1.0">
|
|
3
3
|
<name>DocumentReaderApi</name>
|
|
4
4
|
<description>Cordova plugin Document reader api</description>
|
|
5
5
|
<license>commercial</license>
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
<source url="https://github.com/CocoaPods/Specs.git"/>
|
|
30
30
|
</config>
|
|
31
31
|
<pods>
|
|
32
|
-
<pod name="
|
|
32
|
+
<pod name="DocumentReaderNightly" spec="8.5.5505" />
|
|
33
33
|
</pods>
|
|
34
34
|
</podspec>
|
|
35
35
|
</platform>
|
|
@@ -7,6 +7,7 @@ import android.annotation.SuppressLint
|
|
|
7
7
|
import android.app.Activity
|
|
8
8
|
import android.bluetooth.BluetoothAdapter
|
|
9
9
|
import android.content.ComponentName
|
|
10
|
+
import android.content.Context.BIND_AUTO_CREATE
|
|
10
11
|
import android.content.Intent
|
|
11
12
|
import android.content.ServiceConnection
|
|
12
13
|
import android.content.pm.PackageManager.PERMISSION_GRANTED
|
|
@@ -31,9 +32,10 @@ const val INTENT_REQUEST_ENABLE_BLUETOOTH = 197
|
|
|
31
32
|
|
|
32
33
|
@SuppressLint("StaticFieldLeak")
|
|
33
34
|
var bluetooth: BLEWrapper? = null
|
|
35
|
+
lateinit var savedDeviceNameForPermissionResult: String
|
|
34
36
|
lateinit var savedCallbackForPermissionResult: Callback
|
|
35
37
|
|
|
36
|
-
fun connectBluetoothDevice(callback: Callback) {
|
|
38
|
+
fun connectBluetoothDevice(deviceName: String, callback: Callback) {
|
|
37
39
|
if (bluetooth?.isConnected == true) {
|
|
38
40
|
Log.e("REGULA", "Bluetooth device already connected, returning false")
|
|
39
41
|
callback(false)
|
|
@@ -41,6 +43,7 @@ fun connectBluetoothDevice(callback: Callback) {
|
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
if (!isBluetoothSettingsReady(activity)) {
|
|
46
|
+
savedDeviceNameForPermissionResult = deviceName
|
|
44
47
|
savedCallbackForPermissionResult = callback
|
|
45
48
|
return
|
|
46
49
|
}
|
|
@@ -55,6 +58,7 @@ fun connectBluetoothDevice(callback: Callback) {
|
|
|
55
58
|
Timer().schedule(timeout, SEARCHING_TIMEOUT)
|
|
56
59
|
|
|
57
60
|
val bleIntent = Intent(context, RegulaBleService::class.java)
|
|
61
|
+
bleIntent.putExtra(RegulaBleService.DEVICE_NAME, deviceName)
|
|
58
62
|
context.startService(bleIntent)
|
|
59
63
|
context.bindService(bleIntent, object : ServiceConnection {
|
|
60
64
|
override fun onServiceConnected(name: ComponentName, service: IBinder) {
|
|
@@ -70,7 +74,7 @@ fun connectBluetoothDevice(callback: Callback) {
|
|
|
70
74
|
}
|
|
71
75
|
|
|
72
76
|
override fun onServiceDisconnected(name: ComponentName) {}
|
|
73
|
-
},
|
|
77
|
+
}, BIND_AUTO_CREATE)
|
|
74
78
|
}
|
|
75
79
|
|
|
76
80
|
fun onRequestPermissionsResult(
|
|
@@ -83,7 +87,7 @@ fun onRequestPermissionsResult(
|
|
|
83
87
|
savedCallbackForPermissionResult(false)
|
|
84
88
|
return true
|
|
85
89
|
}
|
|
86
|
-
connectBluetoothDevice(savedCallbackForPermissionResult)
|
|
90
|
+
connectBluetoothDevice(savedDeviceNameForPermissionResult, savedCallbackForPermissionResult)
|
|
87
91
|
return true
|
|
88
92
|
}
|
|
89
93
|
|
|
@@ -95,7 +99,7 @@ fun onActivityResult(requestCode: Int, rc: Int, @Suppress("UNUSED_PARAMETER") da
|
|
|
95
99
|
|
|
96
100
|
if (requestCode == INTENT_REQUEST_ENABLE_BLUETOOTH || requestCode == INTENT_REQUEST_ENABLE_LOCATION) {
|
|
97
101
|
if (resultCode == Activity.RESULT_OK)
|
|
98
|
-
connectBluetoothDevice(savedCallbackForPermissionResult)
|
|
102
|
+
connectBluetoothDevice(savedDeviceNameForPermissionResult, savedCallbackForPermissionResult)
|
|
99
103
|
else
|
|
100
104
|
savedCallbackForPermissionResult(false)
|
|
101
105
|
return true
|
|
@@ -126,7 +130,7 @@ fun deniedBluetoothPermissions(): Array<String>? {
|
|
|
126
130
|
result.addAll(deniedBluetoothPermission(BLUETOOTH_CONNECT))
|
|
127
131
|
} else
|
|
128
132
|
result.addAll(deniedBluetoothPermission(ACCESS_FINE_LOCATION))
|
|
129
|
-
return result.let { if (it.
|
|
133
|
+
return result.let { if (it.isNotEmpty()) it.toTypedArray() else null }
|
|
130
134
|
}
|
|
131
135
|
|
|
132
136
|
fun deniedBluetoothPermission(permission: String): Array<String> {
|
package/src/android/Config.kt
CHANGED
|
@@ -47,6 +47,7 @@ fun setFunctionality(config: Functionality, input: JSONObject) = input.forEach {
|
|
|
47
47
|
"recordScanningProcess" -> editor.setDoRecordProcessingVideo(v as Boolean)
|
|
48
48
|
"manualMultipageMode" -> editor.setManualMultipageMode(v as Boolean)
|
|
49
49
|
"torchTurnedOn" -> editor.setTorchTurnedOn(v as Boolean)
|
|
50
|
+
"preventScreenRecording" -> editor.setPreventScreenRecording(v as Boolean)
|
|
50
51
|
"showCaptureButtonDelayFromDetect" -> editor.setShowCaptureButtonDelayFromDetect(v.toLong())
|
|
51
52
|
"showCaptureButtonDelayFromStart" -> editor.setShowCaptureButtonDelayFromStart(v.toLong())
|
|
52
53
|
"orientation" -> editor.setOrientation(v.toInt())
|
|
@@ -82,6 +83,7 @@ fun getFunctionality(input: Functionality) = mapOf(
|
|
|
82
83
|
"recordScanningProcess" to input.doRecordProcessingVideo(),
|
|
83
84
|
"manualMultipageMode" to input.isManualMultipageMode,
|
|
84
85
|
"torchTurnedOn" to input.isTorchTurnedOn,
|
|
86
|
+
"preventScreenRecording" to input.doPreventScreenRecording(),
|
|
85
87
|
"showCaptureButtonDelayFromDetect" to input.showCaptureButtonDelayFromDetect,
|
|
86
88
|
"showCaptureButtonDelayFromStart" to input.showCaptureButtonDelayFromStart,
|
|
87
89
|
"orientation" to input.orientation,
|
|
@@ -141,6 +143,7 @@ fun setProcessParams(processParams: ProcessParam, opts: JSONObject) = opts.forEa
|
|
|
141
143
|
"generateAlpha2Codes" -> processParams.generateAlpha2Codes = v as Boolean
|
|
142
144
|
"disableAuthResolutionFilter" -> processParams.disableAuthResolutionFilter = v as Boolean
|
|
143
145
|
"strictSecurityChecks" -> processParams.strictSecurityChecks = v as Boolean
|
|
146
|
+
"returnTransliteratedFields" -> processParams.returnTransliteratedFields = v as Boolean
|
|
144
147
|
"measureSystem" -> processParams.measureSystem = v.toInt()
|
|
145
148
|
"barcodeParserType" -> processParams.barcodeParserType = v.toInt()
|
|
146
149
|
"perspectiveAngle" -> processParams.perspectiveAngle = v.toInt()
|
|
@@ -227,6 +230,7 @@ fun getProcessParams(processParams: ProcessParam) = mapOf(
|
|
|
227
230
|
"generateAlpha2Codes" to processParams.generateAlpha2Codes,
|
|
228
231
|
"disableAuthResolutionFilter" to processParams.disableAuthResolutionFilter,
|
|
229
232
|
"strictSecurityChecks" to processParams.strictSecurityChecks,
|
|
233
|
+
"returnTransliteratedFields" to processParams.returnTransliteratedFields,
|
|
230
234
|
"measureSystem" to processParams.measureSystem,
|
|
231
235
|
"barcodeParserType" to processParams.barcodeParserType,
|
|
232
236
|
"perspectiveAngle" to processParams.perspectiveAngle,
|
|
@@ -752,6 +756,10 @@ fun setColors(input: ParamsCustomization.CustomizationEditor, opts: JSONObject)
|
|
|
752
756
|
"rfidProcessingScreenProgressBarBackground" -> input.setColor(CustomizationColor.RFID_PROCESSING_SCREEN_PROGRESS_BAR_BACKGROUND, value)
|
|
753
757
|
"rfidProcessingScreenResultLabelText" -> input.setColor(CustomizationColor.RFID_PROCESSING_SCREEN_RESULT_LABEL_TEXT, value)
|
|
754
758
|
"rfidProcessingScreenLoadingBar" -> input.setColor(CustomizationColor.RFID_PROCESSING_SCREEN_LOADING_BAR, value)
|
|
759
|
+
"rfidEnableNfcTitleText" -> input.setColor(CustomizationColor.RFID_ENABLE_NFC_TITLE_TEXT, value)
|
|
760
|
+
"rfidEnableNfcDescriptionText" -> input.setColor(CustomizationColor.RFID_ENABLE_NFC_DESCRIPTION_TEXT, value)
|
|
761
|
+
"rfidEnableNfcButtonText" -> input.setColor(CustomizationColor.RFID_ENABLE_NFC_BUTTON_TEXT, value)
|
|
762
|
+
"rfidEnableNfcButtonBackground" -> input.setColor(CustomizationColor.RFID_ENABLE_NFC_BUTTON_BACKGROUND, value)
|
|
755
763
|
}
|
|
756
764
|
}
|
|
757
765
|
|
|
@@ -764,6 +772,10 @@ fun getColors(input: Map<CustomizationColor, Long>) = mapOf(
|
|
|
764
772
|
"rfidProcessingScreenProgressBarBackground" to input[CustomizationColor.RFID_PROCESSING_SCREEN_PROGRESS_BAR_BACKGROUND],
|
|
765
773
|
"rfidProcessingScreenResultLabelText" to input[CustomizationColor.RFID_PROCESSING_SCREEN_RESULT_LABEL_TEXT],
|
|
766
774
|
"rfidProcessingScreenLoadingBar" to input[CustomizationColor.RFID_PROCESSING_SCREEN_LOADING_BAR],
|
|
775
|
+
"rfidEnableNfcTitleText" to input[CustomizationColor.RFID_ENABLE_NFC_TITLE_TEXT],
|
|
776
|
+
"rfidEnableNfcDescriptionText" to input[CustomizationColor.RFID_ENABLE_NFC_DESCRIPTION_TEXT],
|
|
777
|
+
"rfidEnableNfcButtonText" to input[CustomizationColor.RFID_ENABLE_NFC_BUTTON_TEXT],
|
|
778
|
+
"rfidEnableNfcButtonBackground" to input[CustomizationColor.RFID_ENABLE_NFC_BUTTON_BACKGROUND],
|
|
767
779
|
).toJson()
|
|
768
780
|
|
|
769
781
|
fun setFonts(input: ParamsCustomization.CustomizationEditor, opts: JSONObject) = opts.forEach { key, value ->
|
|
@@ -771,6 +783,9 @@ fun setFonts(input: ParamsCustomization.CustomizationEditor, opts: JSONObject) =
|
|
|
771
783
|
"rfidProcessingScreenHintLabel" -> CustomizationFont.RFID_PROCESSING_SCREEN_HINT_LABEL.setFont(input, value)
|
|
772
784
|
"rfidProcessingScreenProgressLabel" -> CustomizationFont.RFID_PROCESSING_SCREEN_PROGRESS_LABEL.setFont(input, value)
|
|
773
785
|
"rfidProcessingScreenResultLabel" -> CustomizationFont.RFID_PROCESSING_SCREEN_RESULT_LABEL.setFont(input, value)
|
|
786
|
+
"rfidEnableNfcTitleText" -> CustomizationFont.RFID_ENABLE_NFC_TITLE_TEXT.setFont(input, value)
|
|
787
|
+
"rfidEnableNfcDescriptionText" -> CustomizationFont.RFID_ENABLE_NFC_DESCRIPTION_TEXT.setFont(input, value)
|
|
788
|
+
"rfidEnableNfcButtonText" -> CustomizationFont.RFID_ENABLE_NFC_BUTTON_TEXT.setFont(input, value)
|
|
774
789
|
}
|
|
775
790
|
}
|
|
776
791
|
|
|
@@ -778,16 +793,21 @@ fun getFonts(fonts: Map<CustomizationFont, Typeface>, sizes: Map<CustomizationFo
|
|
|
778
793
|
"rfidProcessingScreenHintLabel" to CustomizationFont.RFID_PROCESSING_SCREEN_HINT_LABEL.getFont(fonts, sizes),
|
|
779
794
|
"rfidProcessingScreenProgressLabel" to CustomizationFont.RFID_PROCESSING_SCREEN_PROGRESS_LABEL.getFont(fonts, sizes),
|
|
780
795
|
"rfidProcessingScreenResultLabel" to CustomizationFont.RFID_PROCESSING_SCREEN_RESULT_LABEL.getFont(fonts, sizes),
|
|
796
|
+
"rfidEnableNfcTitleText" to CustomizationFont.RFID_ENABLE_NFC_TITLE_TEXT.getFont(fonts, sizes),
|
|
797
|
+
"rfidEnableNfcDescriptionText" to CustomizationFont.RFID_ENABLE_NFC_DESCRIPTION_TEXT.getFont(fonts, sizes),
|
|
798
|
+
"rfidEnableNfcButtonText" to CustomizationFont.RFID_ENABLE_NFC_BUTTON_TEXT.getFont(fonts, sizes),
|
|
781
799
|
).toJson()
|
|
782
800
|
|
|
783
801
|
fun setImages(input: ParamsCustomization.CustomizationEditor, opts: JSONObject) = opts.forEach { key, v ->
|
|
784
802
|
when (key) {
|
|
785
803
|
"rfidProcessingScreenFailureImage" -> input.setImage(CustomizationImage.RFID_PROCESSING_SCREEN_FAILURE_IMAGE, v.toDrawable())
|
|
804
|
+
"rfidEnableNfcImage" -> input.setImage(CustomizationImage.RFID_ENABLE_NFC_IMAGE, v.toDrawable())
|
|
786
805
|
}
|
|
787
806
|
}
|
|
788
807
|
|
|
789
808
|
fun getImages(input: Map<CustomizationImage, Drawable>) = mapOf(
|
|
790
809
|
"rfidProcessingScreenFailureImage" to (input[CustomizationImage.RFID_PROCESSING_SCREEN_FAILURE_IMAGE] ?: ContextCompat.getDrawable(context, com.regula.documentreader.api.R.drawable.reg_ic_error)).toBase64(),
|
|
810
|
+
"rfidEnableNfcImage" to (input[CustomizationImage.RFID_ENABLE_NFC_IMAGE] ?: ContextCompat.getDrawable(context, com.regula.documentreader.api.R.drawable.reg_enable_nfc)).toBase64(),
|
|
791
811
|
).toJson()
|
|
792
812
|
|
|
793
813
|
fun CustomizationFont.getFont(fonts: Map<CustomizationFont, Typeface>, sizes: Map<CustomizationFont, Int>) =
|
|
@@ -192,6 +192,7 @@ fun initConfigFromJSON(input: JSONObject) = input.let {
|
|
|
192
192
|
|
|
193
193
|
if (it.has("licenseUpdate")) result.setLicenseUpdate(it.getBoolean("licenseUpdate"))
|
|
194
194
|
if (it.has("delayedNNLoad")) result.isDelayedNNLoad = it.getBoolean("delayedNNLoad")
|
|
195
|
+
result.licenseUpdateTimeout = it.getDoubleOrNull("licenseUpdateTimeout")
|
|
195
196
|
result.blackList = it.getJSONObjectOrNull("blackList")
|
|
196
197
|
result
|
|
197
198
|
}
|
|
@@ -203,6 +204,7 @@ fun generateInitConfig(input: DocReaderConfig?) = input?.let {
|
|
|
203
204
|
"databasePath" to it.customDbPath,
|
|
204
205
|
"licenseUpdate" to it.isLicenseUpdate,
|
|
205
206
|
"delayedNNLoad" to it.isDelayedNNLoad,
|
|
207
|
+
"licenseUpdateTimeout" to it.licenseUpdateTimeout,
|
|
206
208
|
"blackList" to it.blackList
|
|
207
209
|
).toJson()
|
|
208
210
|
}
|
|
@@ -213,6 +215,7 @@ fun initBleDeviceConfigFromJSON(input: JSONObject) = input.let {
|
|
|
213
215
|
|
|
214
216
|
if (it.has("licenseUpdate")) result.setLicenseUpdate(it.getBoolean("licenseUpdate"))
|
|
215
217
|
if (it.has("delayedNNLoad")) result.isDelayedNNLoad = it.getBoolean("delayedNNLoad")
|
|
218
|
+
result.licenseUpdateTimeout = it.getDoubleOrNull("licenseUpdateTimeout")
|
|
216
219
|
result.blackList = it.getJSONObjectOrNull("blackList")
|
|
217
220
|
result
|
|
218
221
|
}
|
package/src/android/Main.kt
CHANGED
|
@@ -16,6 +16,7 @@ import com.regula.documentreader.api.DocumentReader.Instance
|
|
|
16
16
|
import com.regula.documentreader.api.completions.IDocumentReaderCompletion
|
|
17
17
|
import com.regula.documentreader.api.completions.IDocumentReaderInitCompletion
|
|
18
18
|
import com.regula.documentreader.api.completions.IDocumentReaderPrepareDbCompletion
|
|
19
|
+
import com.regula.documentreader.api.completions.IVideoEncoderCompletion
|
|
19
20
|
import com.regula.documentreader.api.completions.model.PrepareProgress
|
|
20
21
|
import com.regula.documentreader.api.completions.rfid.IRfidPKDCertificateCompletion
|
|
21
22
|
import com.regula.documentreader.api.completions.rfid.IRfidReaderCompletion
|
|
@@ -44,11 +45,11 @@ import org.json.JSONObject
|
|
|
44
45
|
import com.regula.plugin.documentreader.Convert.toBase64
|
|
45
46
|
import com.regula.plugin.documentreader.Convert.toByteArray
|
|
46
47
|
|
|
47
|
-
fun methodCall(method: String, callback: (Any?) -> Unit): Any = when (method) {
|
|
48
|
+
fun methodCall(method: String, callback: (Any?) -> Unit): Any? = when (method) {
|
|
48
49
|
"getDocumentReaderIsReady" -> getDocumentReaderIsReady(callback)
|
|
49
50
|
"getDocumentReaderStatus" -> getDocumentReaderStatus(callback)
|
|
50
51
|
"getRfidSessionStatus" -> getRfidSessionStatus(callback)
|
|
51
|
-
"setRfidSessionStatus" -> setRfidSessionStatus(
|
|
52
|
+
"setRfidSessionStatus" -> setRfidSessionStatus()
|
|
52
53
|
"getTag" -> getTag(callback)
|
|
53
54
|
"setTag" -> setTag(argsNullable(0))
|
|
54
55
|
"getTenant" -> getTenant(callback)
|
|
@@ -90,7 +91,7 @@ fun methodCall(method: String, callback: (Any?) -> Unit): Any = when (method) {
|
|
|
90
91
|
"addPKDCertificates" -> addPKDCertificates(args(0))
|
|
91
92
|
"clearPKDCertificates" -> clearPKDCertificates()
|
|
92
93
|
"startNewSession" -> startNewSession()
|
|
93
|
-
"connectBluetoothDevice" -> connectBluetoothDevice(callback)
|
|
94
|
+
"connectBluetoothDevice" -> connectBluetoothDevice(args(0), callback)
|
|
94
95
|
"btDeviceRequestFlashing" -> btDeviceRequestFlashing()
|
|
95
96
|
"btDeviceRequestFlashingFullIR" -> btDeviceRequestFlashingFullIR()
|
|
96
97
|
"btDeviceRequestTurnOffAll" -> btDeviceRequestTurnOffAll()
|
|
@@ -148,7 +149,7 @@ fun getDocumentReaderStatus(callback: Callback) = callback(Instance().status)
|
|
|
148
149
|
|
|
149
150
|
fun getRfidSessionStatus(iosOnly: Callback) = iosOnly(null)
|
|
150
151
|
|
|
151
|
-
fun setRfidSessionStatus(
|
|
152
|
+
fun setRfidSessionStatus() = Unit
|
|
152
153
|
|
|
153
154
|
fun getTag(callback: Callback) = callback(Instance().tag)
|
|
154
155
|
|
|
@@ -476,7 +477,8 @@ fun prepareCompletion(callback: Callback) = object : IDocumentReaderPrepareDbCom
|
|
|
476
477
|
|
|
477
478
|
fun initCompletion(callback: Callback) = IDocumentReaderInitCompletion { success, error ->
|
|
478
479
|
if (success) {
|
|
479
|
-
|
|
480
|
+
videoEncoderCompletion = IVideoEncoderCompletion { _, file -> sendEvent(videoEncoderCompletionEvent, file.path) }
|
|
481
|
+
Instance().setVideoEncoderCompletion(videoEncoderCompletion)
|
|
480
482
|
Instance().setOnClickListener { sendEvent(onCustomButtonTappedEvent, it.tag) }
|
|
481
483
|
}
|
|
482
484
|
callback(generateSuccessCompletion(success, error))
|
|
@@ -577,3 +579,4 @@ fun stopBackgroundRFID() {
|
|
|
577
579
|
|
|
578
580
|
// Weak references
|
|
579
581
|
lateinit var localizationCallbacks: LocalizationCallbacks
|
|
582
|
+
lateinit var videoEncoderCompletion: IVideoEncoderCompletion
|
package/src/android/build.gradle
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
repositories {
|
|
2
2
|
maven {
|
|
3
|
-
url "https://maven.regulaforensics.com/RegulaDocumentReader"
|
|
3
|
+
url "https://maven.regulaforensics.com/RegulaDocumentReader/Nightly"
|
|
4
4
|
}
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
dependencies {
|
|
8
8
|
//noinspection GradleDependency
|
|
9
|
-
implementation ('com.regula.documentreader:api:8.
|
|
9
|
+
implementation ('com.regula.documentreader:api:8.5.12064'){
|
|
10
10
|
transitive = true
|
|
11
11
|
}
|
|
12
12
|
}
|
package/src/ios/RGLWConfig.m
CHANGED
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
if([options valueForKey:@"singleResult"] != nil)
|
|
35
35
|
functionality.singleResult = [[options valueForKey:@"singleResult"] boolValue];
|
|
36
36
|
if(options[@"torchTurnedOn"]) functionality.torchTurnedOn = [options[@"torchTurnedOn"] boolValue];
|
|
37
|
+
if(options[@"preventScreenRecording"]) functionality.preventScreenRecording = [options[@"preventScreenRecording"] boolValue];
|
|
37
38
|
|
|
38
39
|
// Int
|
|
39
40
|
if([options valueForKey:@"showCaptureButtonDelayFromDetect"] != nil)
|
|
@@ -88,6 +89,7 @@
|
|
|
88
89
|
result[@"manualMultipageMode"] = [NSNumber numberWithBool:functionality.manualMultipageMode];
|
|
89
90
|
result[@"singleResult"] = [NSNumber numberWithBool:functionality.singleResult];
|
|
90
91
|
result[@"torchTurnedOn"] = @(functionality.torchTurnedOn);
|
|
92
|
+
result[@"preventScreenRecording"] = @(functionality.preventScreenRecording);
|
|
91
93
|
|
|
92
94
|
// Int
|
|
93
95
|
result[@"showCaptureButtonDelayFromDetect"] = [NSNumber numberWithDouble:functionality.showCaptureButtonDelayFromDetect];
|
|
@@ -186,6 +188,7 @@
|
|
|
186
188
|
if (options[@"generateAlpha2Codes"]) processParams.generateAlpha2Codes = options[@"generateAlpha2Codes"];
|
|
187
189
|
if (options[@"disableAuthResolutionFilter"]) processParams.disableAuthResolutionFilter = options[@"disableAuthResolutionFilter"];
|
|
188
190
|
if (options[@"strictSecurityChecks"]) processParams.strictSecurityChecks = options[@"strictSecurityChecks"];
|
|
191
|
+
if (options[@"returnTransliteratedFields"]) processParams.returnTransliteratedFields = options[@"returnTransliteratedFields"];
|
|
189
192
|
|
|
190
193
|
// Int
|
|
191
194
|
if([options valueForKey:@"measureSystem"] != nil)
|
|
@@ -257,22 +260,19 @@
|
|
|
257
260
|
processParams.lcidFilter = [options mutableArrayValueForKey:@"lcidFilter"];
|
|
258
261
|
|
|
259
262
|
// JSONObject
|
|
260
|
-
if([
|
|
263
|
+
if (options[@"customParams"]) processParams.customParams = options[@"customParams"];
|
|
264
|
+
if ([options valueForKey:@"imageQA"] != nil)
|
|
261
265
|
[self setImageQA:processParams.imageQA input:[options valueForKey:@"imageQA"]];
|
|
262
|
-
if([options valueForKey:@"rfidParams"] != nil)
|
|
266
|
+
if ([options valueForKey:@"rfidParams"] != nil)
|
|
263
267
|
processParams.rfidParams = [RGLWJSONConstructor rfidParamsFromJson:[options valueForKey:@"rfidParams"]];
|
|
264
|
-
if([options valueForKey:@"faceApiParams"] != nil)
|
|
268
|
+
if ([options valueForKey:@"faceApiParams"] != nil)
|
|
265
269
|
processParams.faceApiParams = [RGLWJSONConstructor faceAPIParamsFromJson:[options valueForKey:@"faceApiParams"]];
|
|
266
|
-
if([options valueForKey:@"backendProcessingConfig"] != nil)
|
|
270
|
+
if ([options valueForKey:@"backendProcessingConfig"] != nil)
|
|
267
271
|
processParams.backendProcessingConfig = [RGLWJSONConstructor backendProcessingConfigFromJson:[options valueForKey:@"backendProcessingConfig"]];
|
|
268
|
-
if([options valueForKey:@"authenticityParams"] != nil) {
|
|
272
|
+
if ([options valueForKey:@"authenticityParams"] != nil) {
|
|
269
273
|
if(processParams.authenticityParams == nil) processParams.authenticityParams = [RGLAuthenticityParams defaultParams];
|
|
270
274
|
[self setAuthenticityParams:processParams.authenticityParams input:[options valueForKey:@"authenticityParams"]];
|
|
271
275
|
}
|
|
272
|
-
|
|
273
|
-
// Custom
|
|
274
|
-
if([options valueForKey:@"customParams"] != nil)
|
|
275
|
-
processParams.customParams = [options valueForKey:@"customParams"];
|
|
276
276
|
}
|
|
277
277
|
|
|
278
278
|
+(NSDictionary*)getProcessParams:(RGLProcessParams*)processParams {
|
|
@@ -318,6 +318,7 @@
|
|
|
318
318
|
result[@"generateAlpha2Codes"] = processParams.generateAlpha2Codes;
|
|
319
319
|
result[@"disableAuthResolutionFilter"] = processParams.disableAuthResolutionFilter;
|
|
320
320
|
result[@"strictSecurityChecks"] = processParams.strictSecurityChecks;
|
|
321
|
+
result[@"returnTransliteratedFields"] = processParams.returnTransliteratedFields;
|
|
321
322
|
|
|
322
323
|
// Int
|
|
323
324
|
result[@"measureSystem"] = [NSNumber numberWithInteger:processParams.measureSystem];
|
|
@@ -17,7 +17,7 @@ UIViewController*(^RGLWRootViewController)(void) = ^UIViewController*(){
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
static RGLWEventSender sendEvent = ^(NSString* event, id data) {
|
|
20
|
-
NSArray *skippedEvents = @[
|
|
20
|
+
NSArray *skippedEvents = @[drVideoEncoderCompletionEvent, drOnCustomButtonTappedEvent];
|
|
21
21
|
if([skippedEvents containsObject:event]) return;
|
|
22
22
|
|
|
23
23
|
NSArray *singleEvents = @[completionEvent, databaseProgressEvent];
|
|
@@ -161,6 +161,7 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
161
161
|
|
|
162
162
|
if (input[@"databasePath"]) config.databasePath = [[NSBundle mainBundle] pathForResource:input[@"databasePath"] ofType:nil];
|
|
163
163
|
if (input[@"licenseUpdate"]) config.licenseUpdateCheck = [input[@"licenseUpdate"] boolValue];
|
|
164
|
+
if (input[@"licenseUpdateTimeout"]) config.licenseUpdateTimeout = input[@"licenseUpdateTimeout"];
|
|
164
165
|
if (input[@"delayedNNLoad"]) config.delayedNNLoadEnabled = [input[@"delayedNNLoad"] boolValue];
|
|
165
166
|
|
|
166
167
|
return config;
|
|
@@ -173,6 +174,7 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
173
174
|
result[@"license"] = [self base64Encode: input.licenseData];
|
|
174
175
|
result[@"databasePath"] = input.databasePath;
|
|
175
176
|
result[@"licenseUpdate"] = @(input.licenseUpdateCheck);
|
|
177
|
+
result[@"licenseUpdateTimeout"] = input.licenseUpdateTimeout;
|
|
176
178
|
result[@"delayedNNLoad"] = @(input.delayedNNLoadEnabled);
|
|
177
179
|
|
|
178
180
|
return result;
|
|
@@ -184,6 +186,7 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
184
186
|
|
|
185
187
|
if (input[@"databasePath"]) config.databasePath = [[NSBundle mainBundle] pathForResource:input[@"databasePath"] ofType:nil];
|
|
186
188
|
if (input[@"licenseUpdate"]) config.licenseUpdateCheck = [input[@"licenseUpdate"] boolValue];
|
|
189
|
+
if (input[@"licenseUpdateTimeout"]) config.licenseUpdateTimeout = input[@"licenseUpdateTimeout"];
|
|
187
190
|
if (input[@"delayedNNLoad"]) config.delayedNNLoadEnabled = [input[@"delayedNNLoad"] boolValue];
|
|
188
191
|
|
|
189
192
|
return config;
|
package/src/ios/RGLWMain.h
CHANGED
|
@@ -32,5 +32,5 @@ static NSString* _Nonnull rfidOnRetryReadChipEvent = @"rfidOnRetryReadChipEvent"
|
|
|
32
32
|
static NSString* _Nonnull paCertificateCompletionEvent = @"pa_certificate_completion";
|
|
33
33
|
static NSString* _Nonnull taCertificateCompletionEvent = @"ta_certificate_completion";
|
|
34
34
|
static NSString* _Nonnull taSignatureCompletionEvent = @"ta_signature_completion";
|
|
35
|
-
static NSString* _Nonnull
|
|
36
|
-
static NSString* _Nonnull
|
|
35
|
+
static NSString* _Nonnull drVideoEncoderCompletionEvent = @"video_encoder_completion";
|
|
36
|
+
static NSString* _Nonnull drOnCustomButtonTappedEvent = @"onCustomButtonTappedEvent";
|
package/src/ios/RGLWMain.m
CHANGED
|
@@ -561,12 +561,12 @@ RGLWCallback savedCallbackForBluetoothResult;
|
|
|
561
561
|
|
|
562
562
|
// RGLCustomizationActionDelegate
|
|
563
563
|
- (void)onCustomButtonTappedWithTag:(NSInteger)tag {
|
|
564
|
-
sendEvent(
|
|
564
|
+
sendEvent(drOnCustomButtonTappedEvent, @(tag));
|
|
565
565
|
}
|
|
566
566
|
|
|
567
567
|
// RGLRecordScanningProcessDelegate
|
|
568
568
|
- (void)didFinishRecordingToFile:(NSURL *)fileURL {
|
|
569
|
-
sendEvent(
|
|
569
|
+
sendEvent(drVideoEncoderCompletionEvent, fileURL.absoluteString);
|
|
570
570
|
}
|
|
571
571
|
|
|
572
572
|
- (void)didFailWithError:(NSError *)error {
|
package/www/DocumentReader.js
CHANGED
|
@@ -1011,6 +1011,7 @@ class DocReaderConfig {
|
|
|
1011
1011
|
result.customDb = jsonObject["customDb"]
|
|
1012
1012
|
result.databasePath = jsonObject["databasePath"]
|
|
1013
1013
|
result.licenseUpdate = jsonObject["licenseUpdate"]
|
|
1014
|
+
result.licenseUpdateTimeout = jsonObject["licenseUpdateTimeout"]
|
|
1014
1015
|
result.delayedNNLoad = jsonObject["delayedNNLoad"]
|
|
1015
1016
|
result.blackList = jsonObject["blackList"]
|
|
1016
1017
|
|
|
@@ -1182,6 +1183,7 @@ class Functionality {
|
|
|
1182
1183
|
result.manualMultipageMode = jsonObject["manualMultipageMode"]
|
|
1183
1184
|
result.singleResult = jsonObject["singleResult"]
|
|
1184
1185
|
result.torchTurnedOn = jsonObject["torchTurnedOn"]
|
|
1186
|
+
result.preventScreenRecording = jsonObject["preventScreenRecording"]
|
|
1185
1187
|
result.showCaptureButtonDelayFromDetect = jsonObject["showCaptureButtonDelayFromDetect"]
|
|
1186
1188
|
result.showCaptureButtonDelayFromStart = jsonObject["showCaptureButtonDelayFromStart"]
|
|
1187
1189
|
result.rfidTimeout = jsonObject["rfidTimeout"]
|
|
@@ -1391,6 +1393,7 @@ class ProcessParams {
|
|
|
1391
1393
|
result.generateAlpha2Codes = jsonObject["generateAlpha2Codes"]
|
|
1392
1394
|
result.disableAuthResolutionFilter = jsonObject["disableAuthResolutionFilter"]
|
|
1393
1395
|
result.strictSecurityChecks = jsonObject["strictSecurityChecks"]
|
|
1396
|
+
result.returnTransliteratedFields = jsonObject["returnTransliteratedFields"]
|
|
1394
1397
|
result.barcodeParserType = jsonObject["barcodeParserType"]
|
|
1395
1398
|
result.perspectiveAngle = jsonObject["perspectiveAngle"]
|
|
1396
1399
|
result.minDPI = jsonObject["minDPI"]
|
|
@@ -1484,6 +1487,10 @@ class CustomizationColors {
|
|
|
1484
1487
|
result.rfidProcessingScreenProgressBarBackground = jsonObject["rfidProcessingScreenProgressBarBackground"]
|
|
1485
1488
|
result.rfidProcessingScreenResultLabelText = jsonObject["rfidProcessingScreenResultLabelText"]
|
|
1486
1489
|
result.rfidProcessingScreenLoadingBar = jsonObject["rfidProcessingScreenLoadingBar"]
|
|
1490
|
+
result.rfidEnableNfcTitleText = jsonObject["rfidEnableNfcTitleText"]
|
|
1491
|
+
result.rfidEnableNfcDescriptionText = jsonObject["rfidEnableNfcDescriptionText"]
|
|
1492
|
+
result.rfidEnableNfcButtonText = jsonObject["rfidEnableNfcButtonText"]
|
|
1493
|
+
result.rfidEnableNfcButtonBackground = jsonObject["rfidEnableNfcButtonBackground"]
|
|
1487
1494
|
|
|
1488
1495
|
return result
|
|
1489
1496
|
}
|
|
@@ -1497,6 +1504,9 @@ class CustomizationFonts {
|
|
|
1497
1504
|
result.rfidProcessingScreenHintLabel = Font.fromJson(jsonObject["rfidProcessingScreenHintLabel"])
|
|
1498
1505
|
result.rfidProcessingScreenProgressLabel = Font.fromJson(jsonObject["rfidProcessingScreenProgressLabel"])
|
|
1499
1506
|
result.rfidProcessingScreenResultLabel = Font.fromJson(jsonObject["rfidProcessingScreenResultLabel"])
|
|
1507
|
+
result.rfidEnableNfcTitleText = Font.fromJson(jsonObject["rfidEnableNfcTitleText"])
|
|
1508
|
+
result.rfidEnableNfcDescriptionText = Font.fromJson(jsonObject["rfidEnableNfcDescriptionText"])
|
|
1509
|
+
result.rfidEnableNfcButtonText = Font.fromJson(jsonObject["rfidEnableNfcButtonText"])
|
|
1500
1510
|
|
|
1501
1511
|
return result
|
|
1502
1512
|
}
|
|
@@ -1508,6 +1518,7 @@ class CustomizationImages {
|
|
|
1508
1518
|
const result = new CustomizationImages()
|
|
1509
1519
|
|
|
1510
1520
|
result.rfidProcessingScreenFailureImage = jsonObject["rfidProcessingScreenFailureImage"]
|
|
1521
|
+
result.rfidEnableNfcImage = jsonObject["rfidEnableNfcImage"]
|
|
1511
1522
|
|
|
1512
1523
|
return result
|
|
1513
1524
|
}
|
|
@@ -1832,6 +1843,10 @@ const CustomizationColor = {
|
|
|
1832
1843
|
RFID_PROCESSING_SCREEN_PROGRESS_BAR_BACKGROUND: "rfidProcessingScreenProgressBarBackground",
|
|
1833
1844
|
RFID_PROCESSING_SCREEN_RESULT_LABEL_TEXT: "rfidProcessingScreenResultLabelText",
|
|
1834
1845
|
RFID_PROCESSING_SCREEN_LOADING_BAR: "rfidProcessingScreenLoadingBar",
|
|
1846
|
+
RFID_ENABLE_NFC_TITLE_TEXT: "rfidEnableNfcTitleText",
|
|
1847
|
+
RFID_ENABLE_NFC_DESCRIPTION_TEXT: "rfidEnableNfcDescriptionText",
|
|
1848
|
+
RFID_ENABLE_NFC_BUTTON_TEXT: "rfidEnableNfcButtonText",
|
|
1849
|
+
RFID_ENABLE_NFC_BUTTON_BACKGROUND: "rfidEnableNfcButtonBackground",
|
|
1835
1850
|
}
|
|
1836
1851
|
|
|
1837
1852
|
const eRFID_ErrorCodes = {
|
|
@@ -2262,6 +2277,7 @@ const DocumentReaderErrorCodes = {
|
|
|
2262
2277
|
SAVE_DB: 8,
|
|
2263
2278
|
DOWNLOAD_DB_INCORRECT_CHECKSUM: 9,
|
|
2264
2279
|
DB_DOWNLOAD: 10,
|
|
2280
|
+
RFID_ERROR: 12,
|
|
2265
2281
|
LICENSE_ABSENT_OR_CORRUPTED: 13,
|
|
2266
2282
|
LICENSE_INVALID_DATE: 14,
|
|
2267
2283
|
LICENSE_INVALID_VERSION: 15,
|
|
@@ -2284,6 +2300,8 @@ const DocumentReaderErrorCodes = {
|
|
|
2284
2300
|
NATIVE_JAVA_EXCEPTION: 1000,
|
|
2285
2301
|
BACKEND_ONLINE_PROCESSING: 303,
|
|
2286
2302
|
WRONG_INPUT: 400,
|
|
2303
|
+
RESULT_UNAVAILABLE: 410,
|
|
2304
|
+
RESULT_WRONG_OUTPUT: 411,
|
|
2287
2305
|
STATE_EXCEPTION: 500,
|
|
2288
2306
|
BLE_EXCEPTION: 600,
|
|
2289
2307
|
FEATURE_BLUETOOTH_LE_NOT_SUPPORTED: 601,
|
|
@@ -2506,6 +2524,8 @@ const eCheckDiagnose = {
|
|
|
2506
2524
|
FIELD_POS_CORRECTOR_FACE_PRESENCE_CHECK_ERROR: 84,
|
|
2507
2525
|
FIELD_POS_CORRECTOR_FACE_ABSENCE_CHECK_ERROR: 85,
|
|
2508
2526
|
CHD_FIELD_POS_CORRECTOR_INCORRECT_HEAD_POSITION: 86,
|
|
2527
|
+
CHD_FIELD_POS_CORRECTOR_AGE_CHECK_ERROR: 87,
|
|
2528
|
+
CHD_FIELD_POS_CORRECTOR_SEX_CHECK_ERROR: 88,
|
|
2509
2529
|
OVI_IR_INVISIBLE: 90,
|
|
2510
2530
|
OVI_INSUFFICIENT_AREA: 91,
|
|
2511
2531
|
OVI_COLOR_INVARIABLE: 92,
|
|
@@ -2974,6 +2994,8 @@ const eRPRM_SecurityFeatureType = {
|
|
|
2974
2994
|
SECURITY_FEATURE_TYPE_LIVENESS_BLACK_AND_WHITE_COPY_CHECK: 53,
|
|
2975
2995
|
SECURITY_FEATURE_TYPE_LIVENESS_DYNAPRINT_CHECK: 54,
|
|
2976
2996
|
SECURITY_FEATURE_TYPE_LIVENESS_GEOMETRY_CHECK: 55,
|
|
2997
|
+
SECURITY_FEATURE_TYPE_AGE_CHECK: 56,
|
|
2998
|
+
SECURITY_FEATURE_TYPE_SEX_CHECK: 57,
|
|
2977
2999
|
}
|
|
2978
3000
|
|
|
2979
3001
|
const OnlineMode = {
|
|
@@ -3250,6 +3272,9 @@ const CustomizationFont = {
|
|
|
3250
3272
|
RFID_PROCESSING_SCREEN_HINT_LABEL: "rfidProcessingScreenHintLabel",
|
|
3251
3273
|
RFID_PROCESSING_SCREEN_PROGRESS_LABEL: "rfidProcessingScreenProgressLabel",
|
|
3252
3274
|
RFID_PROCESSING_SCREEN_RESULT_LABEL: "rfidProcessingScreenResultLabel",
|
|
3275
|
+
RFID_ENABLE_NFC_TITLE_TEXT: "rfidEnableNfcTitleText",
|
|
3276
|
+
RFID_ENABLE_NFC_DESCRIPTION_TEXT: "rfidEnableNfcDescriptionText",
|
|
3277
|
+
RFID_ENABLE_NFC_BUTTON_TEXT: "rfidEnableNfcButtonText",
|
|
3253
3278
|
}
|
|
3254
3279
|
|
|
3255
3280
|
const ImageFormat = {
|
|
@@ -4256,6 +4281,7 @@ const LCID = {
|
|
|
4256
4281
|
|
|
4257
4282
|
const CustomizationImage = {
|
|
4258
4283
|
RFID_PROCESSING_SCREEN_FAILURE_IMAGE: "rfidProcessingScreenFailureImage",
|
|
4284
|
+
RFID_ENABLE_NFC_IMAGE: "rfidEnableNfcImage",
|
|
4259
4285
|
}
|
|
4260
4286
|
|
|
4261
4287
|
const DocReaderFrame = {
|