@regulaforensics/document-reader 8.4.401-beta → 8.4.507-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/README.md +1 -1
- package/RNDocumentReader.podspec +2 -2
- package/android/build.gradle +2 -2
- package/android/cordova.gradle +2 -2
- package/android/src/main/java/com/regula/plugin/documentreader/Config.kt +11 -31
- package/android/src/main/java/com/regula/plugin/documentreader/JSONConstructor.kt +338 -59
- package/android/src/main/java/com/regula/plugin/documentreader/Main.kt +69 -35
- package/android/src/main/java/com/regula/plugin/documentreader/Utils.kt +62 -0
- package/examples/capacitor/ios/App/App/Info.plist +2 -0
- package/examples/capacitor/package-lock.json +9 -9
- package/examples/capacitor/package.json +3 -3
- package/examples/ionic/config.xml +2 -0
- package/examples/ionic/package-lock.json +5262 -2655
- package/examples/ionic/package.json +12 -12
- package/examples/react_native/app.config.ts +3 -1
- package/examples/react_native/package-lock.json +37 -37
- package/examples/react_native/package.json +3 -3
- package/ios/RGLWConfig.m +11 -32
- package/ios/RGLWJSONConstructor.h +19 -1
- package/ios/RGLWJSONConstructor.m +349 -18
- package/ios/RGLWMain.m +49 -46
- package/package.json +1 -1
- package/plugin.xml +2 -2
- package/test/json.tsx +201 -124
- package/test/package-lock.json +1 -1
- package/test/test.tsx +12 -3
- package/www/capacitor/engagement/DataRetrieval.js +55 -0
- package/www/capacitor/engagement/DeviceEngagement.js +30 -0
- package/www/capacitor/engagement/DeviceRetrievalMethod.js +41 -0
- package/www/capacitor/engagement/DocumentRequestMDL.js +212 -0
- package/www/capacitor/engagement/NameSpaceMDL.js +33 -0
- package/www/capacitor/index.js +58 -7
- package/www/capacitor/info/DocReaderException.js +2 -0
- package/www/capacitor/params/Functionality.js +16 -0
- package/www/capacitor/params/customization/Customization.js +8 -0
- package/www/capacitor/params/process_params/AuthenticityParams.js +1 -44
- package/www/capacitor/params/process_params/LivenessParams.js +0 -36
- package/www/capacitor/params/process_params/ProcessParams.js +26 -30
- package/www/capacitor/results/Results.js +8 -1
- package/www/capacitor/results/status/AgeStatus.js +35 -0
- package/www/capacitor/results/status/ResultsStatus.js +13 -0
- package/www/capacitor/results/visible_digital_seals/DocFeature.js +23 -0
- package/www/capacitor/results/visible_digital_seals/VDSData.js +75 -0
- package/www/capacitor/results/visual_results/FieldType.js +3 -0
- package/www/capacitor/rfid/PKDCertificate.js +3 -0
- package/www/cordova.js +1276 -683
- package/www/react-native/engagement/DataRetrieval.js +55 -0
- package/www/react-native/engagement/DeviceEngagement.js +30 -0
- package/www/react-native/engagement/DeviceRetrievalMethod.js +41 -0
- package/www/react-native/engagement/DocumentRequestMDL.js +212 -0
- package/www/react-native/engagement/NameSpaceMDL.js +33 -0
- package/www/react-native/index.js +58 -7
- package/www/react-native/info/DocReaderException.js +2 -0
- package/www/react-native/params/Functionality.js +16 -0
- package/www/react-native/params/customization/Customization.js +8 -0
- package/www/react-native/params/process_params/AuthenticityParams.js +1 -44
- package/www/react-native/params/process_params/LivenessParams.js +0 -36
- package/www/react-native/params/process_params/ProcessParams.js +26 -30
- package/www/react-native/results/Results.js +8 -1
- package/www/react-native/results/status/AgeStatus.js +35 -0
- package/www/react-native/results/status/ResultsStatus.js +13 -0
- package/www/react-native/results/visible_digital_seals/DocFeature.js +23 -0
- package/www/react-native/results/visible_digital_seals/VDSData.js +75 -0
- package/www/react-native/results/visual_results/FieldType.js +3 -0
- package/www/react-native/rfid/PKDCertificate.js +3 -0
- package/www/types/engagement/DataRetrieval.d.ts +28 -0
- package/www/types/engagement/DeviceEngagement.d.ts +16 -0
- package/www/types/engagement/DeviceRetrievalMethod.d.ts +18 -0
- package/www/types/engagement/DocumentRequestMDL.d.ts +61 -0
- package/www/types/engagement/NameSpaceMDL.d.ts +16 -0
- package/www/types/index.d.ts +40 -8
- package/www/types/info/DocReaderException.d.ts +2 -0
- package/www/types/params/Functionality.d.ts +7 -0
- package/www/types/params/customization/Customization.d.ts +5 -0
- package/www/types/params/process_params/AuthenticityParams.d.ts +0 -25
- package/www/types/params/process_params/LivenessParams.d.ts +0 -18
- package/www/types/params/process_params/ProcessParams.d.ts +18 -11
- package/www/types/results/Results.d.ts +9 -1
- package/www/types/results/status/AgeStatus.d.ts +14 -0
- package/www/types/results/status/ResultsStatus.d.ts +9 -0
- package/www/types/results/visible_digital_seals/DocFeature.d.ts +9 -0
- package/www/types/results/visible_digital_seals/VDSData.d.ts +32 -0
- package/www/types/results/visible_digital_seals/VDSNCData.d.ts +1 -1
- package/www/types/results/visual_results/FieldType.d.ts +6 -0
- package/www/types/rfid/PKDCertificate.d.ts +7 -1
- package/www/capacitor/params/process_params/FilterObject.js +0 -60
- package/www/react-native/params/process_params/FilterObject.js +0 -60
- package/www/types/params/process_params/FilterObject.d.ts +0 -32
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
@file:SuppressLint("MissingPermission")
|
|
2
|
+
@file:Suppress("EnumValuesSoftDeprecate")
|
|
2
3
|
|
|
3
4
|
package com.regula.plugin.documentreader
|
|
4
5
|
|
|
@@ -16,6 +17,7 @@ import com.regula.documentreader.api.DocumentReader.Instance
|
|
|
16
17
|
import com.regula.documentreader.api.completions.IDocumentReaderCompletion
|
|
17
18
|
import com.regula.documentreader.api.completions.IDocumentReaderInitCompletion
|
|
18
19
|
import com.regula.documentreader.api.completions.IDocumentReaderPrepareDbCompletion
|
|
20
|
+
import com.regula.documentreader.api.completions.IVideoEncoderCompletion
|
|
19
21
|
import com.regula.documentreader.api.completions.model.PrepareProgress
|
|
20
22
|
import com.regula.documentreader.api.completions.rfid.IRfidPKDCertificateCompletion
|
|
21
23
|
import com.regula.documentreader.api.completions.rfid.IRfidReaderCompletion
|
|
@@ -29,12 +31,14 @@ import com.regula.documentreader.api.enums.LCID
|
|
|
29
31
|
import com.regula.documentreader.api.enums.eImageQualityCheckType
|
|
30
32
|
import com.regula.documentreader.api.enums.eLDS_ParsingErrorCodes
|
|
31
33
|
import com.regula.documentreader.api.enums.eLDS_ParsingNotificationCodes
|
|
34
|
+
import com.regula.documentreader.api.enums.eMDLDeviceEngagement
|
|
32
35
|
import com.regula.documentreader.api.enums.eRFID_DataFile_Type
|
|
33
36
|
import com.regula.documentreader.api.enums.eRFID_ErrorCodes
|
|
34
37
|
import com.regula.documentreader.api.enums.eVisualFieldType
|
|
35
38
|
import com.regula.documentreader.api.errors.DocReaderRfidException
|
|
36
39
|
import com.regula.documentreader.api.errors.DocumentReaderException
|
|
37
40
|
import com.regula.documentreader.api.internal.core.CoreScenarioUtil
|
|
41
|
+
import com.regula.documentreader.api.params.mdl.DataRetrieval
|
|
38
42
|
import com.regula.documentreader.api.results.DocumentReaderNotification
|
|
39
43
|
import com.regula.documentreader.api.results.DocumentReaderResults
|
|
40
44
|
import com.regula.documentreader.api.results.DocumentReaderResults.fromRawResults
|
|
@@ -44,7 +48,7 @@ import org.json.JSONObject
|
|
|
44
48
|
import com.regula.plugin.documentreader.Convert.toBase64
|
|
45
49
|
import com.regula.plugin.documentreader.Convert.toByteArray
|
|
46
50
|
|
|
47
|
-
fun methodCall(method: String, callback: (Any?) -> Unit): Any
|
|
51
|
+
fun methodCall(method: String, callback: (Any?) -> Unit): Any = when (method) {
|
|
48
52
|
"getDocumentReaderIsReady" -> getDocumentReaderIsReady(callback)
|
|
49
53
|
"getDocumentReaderStatus" -> getDocumentReaderStatus(callback)
|
|
50
54
|
"getRfidSessionStatus" -> getRfidSessionStatus(callback)
|
|
@@ -94,6 +98,13 @@ fun methodCall(method: String, callback: (Any?) -> Unit): Any? = when (method) {
|
|
|
94
98
|
"btDeviceRequestFlashing" -> btDeviceRequestFlashing()
|
|
95
99
|
"btDeviceRequestFlashingFullIR" -> btDeviceRequestFlashingFullIR()
|
|
96
100
|
"btDeviceRequestTurnOffAll" -> btDeviceRequestTurnOffAll()
|
|
101
|
+
"startReadMDl" -> startReadMDl(args(0), args(1), callback)
|
|
102
|
+
"startEngageDevice" -> startEngageDevice(args(0), callback)
|
|
103
|
+
"engageDeviceNFC" -> engageDeviceNFC(callback)
|
|
104
|
+
"engageDeviceData" -> engageDeviceData(args(0), callback)
|
|
105
|
+
"startRetrieveData" -> startRetrieveData(args(0), args(1), callback)
|
|
106
|
+
"retrieveDataNFC" -> retrieveDataNFC(args(0), callback)
|
|
107
|
+
"retrieveDataBLE" -> retrieveDataBLE(args(0), args(1), callback)
|
|
97
108
|
"setLocalizationDictionary" -> setLocalizationDictionary(args(0))
|
|
98
109
|
"getLicense" -> getLicense(callback)
|
|
99
110
|
"getAvailableScenarios" -> getAvailableScenarios(callback)
|
|
@@ -122,16 +133,6 @@ fun methodCall(method: String, callback: (Any?) -> Unit): Any? = when (method) {
|
|
|
122
133
|
"finalizePackage" -> finalizePackage(callback)
|
|
123
134
|
"endBackendTransaction" -> endBackendTransaction()
|
|
124
135
|
"getTranslation" -> getTranslation(callback, args(0), args(1))
|
|
125
|
-
// remove after finishing old dr support
|
|
126
|
-
"processParamsSetCheckFilter" -> processParamsSetCheckFilter(args(0), args(1))
|
|
127
|
-
"processParamsRemoveCheckFilter" -> processParamsRemoveCheckFilter(args(0))
|
|
128
|
-
"processParamsClearCheckFilter" -> processParamsClearCheckFilter()
|
|
129
|
-
"authenticityParamsSetCheckFilter" -> authenticityParamsSetCheckFilter(args(0), args(1))
|
|
130
|
-
"authenticityParamsRemoveCheckFilter" -> authenticityParamsRemoveCheckFilter(args(0))
|
|
131
|
-
"authenticityParamsClearCheckFilter" -> authenticityParamsClearCheckFilter()
|
|
132
|
-
"livenessParamsSetCheckFilter" -> livenessParamsSetCheckFilter(args(0), args(1))
|
|
133
|
-
"livenessParamsRemoveCheckFilter" -> livenessParamsRemoveCheckFilter(args(0))
|
|
134
|
-
"livenessParamsClearCheckFilter" -> livenessParamsClearCheckFilter()
|
|
135
136
|
else -> Unit
|
|
136
137
|
}
|
|
137
138
|
|
|
@@ -229,12 +230,12 @@ fun checkDatabaseUpdate(callback: Callback, databaseID: String) = Instance().che
|
|
|
229
230
|
@Suppress("DEPRECATION")
|
|
230
231
|
fun scan(config: JSONObject) {
|
|
231
232
|
stopBackgroundRFID()
|
|
232
|
-
Instance().showScanner(
|
|
233
|
+
Instance().showScanner(activity, scannerConfigFromJSON(config), IDocumentReaderCompletion(completion))
|
|
233
234
|
}
|
|
234
235
|
|
|
235
236
|
fun startScanner(config: JSONObject) {
|
|
236
237
|
stopBackgroundRFID()
|
|
237
|
-
Instance().startScanner(
|
|
238
|
+
Instance().startScanner(activity, scannerConfigFromJSON(config), IDocumentReaderCompletion(completion))
|
|
238
239
|
}
|
|
239
240
|
|
|
240
241
|
fun recognize(config: JSONObject) {
|
|
@@ -253,7 +254,7 @@ fun startRFIDReader(onRequestPACertificates: Boolean, onRequestTACertificates: B
|
|
|
253
254
|
onRequestTACertificates,
|
|
254
255
|
onRequestTASignature
|
|
255
256
|
)
|
|
256
|
-
Instance().startRFIDReader(
|
|
257
|
+
Instance().startRFIDReader(activity, rfidReaderCompletion, requestType.getRfidReaderRequest())
|
|
257
258
|
}
|
|
258
259
|
|
|
259
260
|
fun readRFID(onRequestPACertificates: Boolean, onRequestTACertificates: Boolean, onRequestTASignature: Boolean) {
|
|
@@ -262,7 +263,7 @@ fun readRFID(onRequestPACertificates: Boolean, onRequestTACertificates: Boolean,
|
|
|
262
263
|
onRequestTACertificates,
|
|
263
264
|
onRequestTASignature
|
|
264
265
|
)
|
|
265
|
-
startForegroundDispatch()
|
|
266
|
+
startForegroundDispatch("readRFID")
|
|
266
267
|
}
|
|
267
268
|
|
|
268
269
|
fun stopRFIDReader() {
|
|
@@ -296,6 +297,47 @@ fun clearPKDCertificates() = Instance().clearPKDCertificates()
|
|
|
296
297
|
|
|
297
298
|
fun startNewSession() = Instance().startNewSession()
|
|
298
299
|
|
|
300
|
+
fun startReadMDl(type: Int, dataRetrieval: JSONObject, callback: Callback) {
|
|
301
|
+
stopBackgroundRFID()
|
|
302
|
+
Instance().startReadMDL(activity, eMDLDeviceEngagement.values()[type], dataRetrievalFromJSON(dataRetrieval)!!) { v1, v2, v3 -> callback(generateCompletion(v1, v2, v3)) }
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
fun startEngageDevice(type: Int, callback: Callback) {
|
|
306
|
+
stopBackgroundRFID()
|
|
307
|
+
Instance().startEngageDevice(activity, eMDLDeviceEngagement.values()[type]) { v1, v2 -> callback(generateDeviceEngagementCompletion(v1, v2)) }
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
lateinit var engageDeviceNFCCallback: Callback
|
|
311
|
+
fun engageDeviceNFC(callback: Callback) {
|
|
312
|
+
engageDeviceNFCCallback = callback
|
|
313
|
+
stopBackgroundRFID()
|
|
314
|
+
startForegroundDispatch("engageDeviceNFC")
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
fun engageDeviceData(data: String, callback: Callback) {
|
|
318
|
+
stopBackgroundRFID()
|
|
319
|
+
Instance().engageDeviceData(data) { v1, v2 -> callback(generateDeviceEngagementCompletion(v1, v2)) }
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
fun startRetrieveData(dataRetrieval: JSONObject, deviceEngagement: JSONObject, callback: Callback) {
|
|
323
|
+
stopBackgroundRFID()
|
|
324
|
+
Instance().startRetrieveData(activity, deviceEngagementFromJSON(deviceEngagement)!!, dataRetrievalFromJSON(dataRetrieval)!!){ v1, v2, v3 -> callback(generateCompletion(v1, v2, v3)) }
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
lateinit var retrieveDataNFCCallback: Callback
|
|
328
|
+
lateinit var retrieveDataNFCProp: DataRetrieval
|
|
329
|
+
fun retrieveDataNFC(dataRetrieval: JSONObject, callback: Callback) {
|
|
330
|
+
retrieveDataNFCCallback = callback
|
|
331
|
+
retrieveDataNFCProp = dataRetrievalFromJSON(dataRetrieval)!!
|
|
332
|
+
stopBackgroundRFID()
|
|
333
|
+
startForegroundDispatch("retrieveDataNFC")
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
fun retrieveDataBLE(dataRetrieval: JSONObject, deviceEngagement: JSONObject, callback: Callback) {
|
|
337
|
+
stopBackgroundRFID()
|
|
338
|
+
Instance().retrieveDataBLE(context, deviceEngagementFromJSON(deviceEngagement)!!, dataRetrievalFromJSON(dataRetrieval)!!){ v1, v2, v3 -> callback(generateCompletion(v1, v2, v3)) }
|
|
339
|
+
}
|
|
340
|
+
|
|
299
341
|
fun setLocalizationDictionary(dictionary: JSONObject) {
|
|
300
342
|
localizationCallbacks = LocalizationCallbacks { if (dictionary.has(it)) dictionary.getString(it) else null }
|
|
301
343
|
Instance().setLocalizationCallback(localizationCallbacks)
|
|
@@ -462,19 +504,6 @@ fun getTranslation(callback: Callback, className: String, value: Int) = when (cl
|
|
|
462
504
|
else -> Unit
|
|
463
505
|
}
|
|
464
506
|
|
|
465
|
-
// remove after finishing old dr support
|
|
466
|
-
fun processParamsSetCheckFilter(checkType: String, filter: JSONObject) = Instance().processParams().setCheckFilter(checkType, filterObjectFromJSON(filter))
|
|
467
|
-
fun processParamsRemoveCheckFilter(checkType: String) = Instance().processParams().removeCheckFilter(checkType)
|
|
468
|
-
fun processParamsClearCheckFilter() = Instance().processParams().clearCheckFilter()
|
|
469
|
-
|
|
470
|
-
fun authenticityParamsSetCheckFilter(checkType: String, filter: JSONObject) = Instance().processParams().authenticityParams?.setCheckFilter(checkType, filterObjectFromJSON(filter))
|
|
471
|
-
fun authenticityParamsRemoveCheckFilter(checkType: String) = Instance().processParams().authenticityParams?.removeCheckFilter(checkType)
|
|
472
|
-
fun authenticityParamsClearCheckFilter() = Instance().processParams().authenticityParams?.clearCheckFilter()
|
|
473
|
-
|
|
474
|
-
fun livenessParamsSetCheckFilter(checkType: String, filter: JSONObject) = Instance().processParams().authenticityParams?.livenessParams?.setCheckFilter(checkType, filterObjectFromJSON(filter))
|
|
475
|
-
fun livenessParamsRemoveCheckFilter(checkType: String) = Instance().processParams().authenticityParams?.livenessParams?.removeCheckFilter(checkType)
|
|
476
|
-
fun livenessParamsClearCheckFilter() = Instance().processParams().authenticityParams?.livenessParams?.clearCheckFilter()
|
|
477
|
-
|
|
478
507
|
// --------------------------------------------------------------------------------------------------------------------------
|
|
479
508
|
|
|
480
509
|
val completion = { action: Int, results: DocumentReaderResults?, error: DocumentReaderException? ->
|
|
@@ -499,7 +528,8 @@ fun prepareCompletion(callback: Callback) = object : IDocumentReaderPrepareDbCom
|
|
|
499
528
|
|
|
500
529
|
fun initCompletion(callback: Callback) = IDocumentReaderInitCompletion { success, error ->
|
|
501
530
|
if (success) {
|
|
502
|
-
|
|
531
|
+
videoEncoderCompletion = IVideoEncoderCompletion { _, file -> sendEvent(videoEncoderCompletionEvent, file.path) }
|
|
532
|
+
Instance().setVideoEncoderCompletion(videoEncoderCompletion)
|
|
503
533
|
Instance().setOnClickListener { sendEvent(onCustomButtonTappedEvent, it.tag) }
|
|
504
534
|
}
|
|
505
535
|
callback(generateSuccessCompletion(success, error))
|
|
@@ -548,19 +578,22 @@ var requestType = RfidReaderRequestType(
|
|
|
548
578
|
@Suppress("DEPRECATION", "MissingPermission")
|
|
549
579
|
fun newIntent(intent: Intent): Boolean {
|
|
550
580
|
if (intent.action != NfcAdapter.ACTION_TECH_DISCOVERED) return false
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
rfidReaderCompletion,
|
|
554
|
-
|
|
555
|
-
|
|
581
|
+
val isoDep = IsoDep.get(intent.getParcelableExtra(NfcAdapter.EXTRA_TAG))
|
|
582
|
+
when (nfcFunction) {
|
|
583
|
+
"readRFID" -> Instance().readRFID(isoDep, rfidReaderCompletion, requestType.getRfidReaderRequest())
|
|
584
|
+
"engageDeviceNFC" -> Instance().engageDeviceNFC(isoDep) { v1, v2 -> engageDeviceNFCCallback(generateDeviceEngagementCompletion(v1, v2)) }
|
|
585
|
+
"retrieveDataNFC" -> Instance().retrieveDataNFC(isoDep, retrieveDataNFCProp) { v1, v2, v3 -> retrieveDataNFCCallback(generateCompletion(v1, v2, v3)) }
|
|
586
|
+
}
|
|
556
587
|
return true
|
|
557
588
|
}
|
|
558
589
|
|
|
559
590
|
var backgroundRFIDEnabled = false
|
|
591
|
+
var nfcFunction = ""
|
|
560
592
|
lateinit var lifecycleObserver: LifecycleEventObserver
|
|
561
593
|
|
|
562
|
-
fun startForegroundDispatch() {
|
|
594
|
+
fun startForegroundDispatch(tag: String) {
|
|
563
595
|
backgroundRFIDEnabled = true
|
|
596
|
+
nfcFunction = tag
|
|
564
597
|
val filters: Array<IntentFilter?> = arrayOfNulls(1)
|
|
565
598
|
filters[0] = IntentFilter()
|
|
566
599
|
filters[0]!!.addAction(NfcAdapter.ACTION_TECH_DISCOVERED)
|
|
@@ -600,3 +633,4 @@ fun stopBackgroundRFID() {
|
|
|
600
633
|
|
|
601
634
|
// Weak references
|
|
602
635
|
lateinit var localizationCallbacks: LocalizationCallbacks
|
|
636
|
+
lateinit var videoEncoderCompletion: IVideoEncoderCompletion
|
|
@@ -12,7 +12,9 @@ import android.util.Base64
|
|
|
12
12
|
import org.json.JSONArray
|
|
13
13
|
import org.json.JSONObject
|
|
14
14
|
import java.io.ByteArrayOutputStream
|
|
15
|
+
import java.lang.reflect.Constructor
|
|
15
16
|
import kotlin.math.sqrt
|
|
17
|
+
import kotlin.reflect.KClass
|
|
16
18
|
|
|
17
19
|
fun List<*>.toJson(): JSONArray {
|
|
18
20
|
val result = JSONArray()
|
|
@@ -105,6 +107,18 @@ fun IntArray?.toJson() = this?.let {
|
|
|
105
107
|
result
|
|
106
108
|
}
|
|
107
109
|
|
|
110
|
+
fun JSONArray.toLongArray(): LongArray {
|
|
111
|
+
val result = LongArray(length())
|
|
112
|
+
for (i in 0 until length()) result[i] = getLong(i)
|
|
113
|
+
return result
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
fun LongArray.toJson(): JSONArray {
|
|
117
|
+
val result = JSONArray()
|
|
118
|
+
for (i in indices) result.put(i, this[i])
|
|
119
|
+
return result
|
|
120
|
+
}
|
|
121
|
+
|
|
108
122
|
fun JSONObject.forEach(action: (String, Any) -> Unit) {
|
|
109
123
|
val keys: Iterator<String> = keys()
|
|
110
124
|
while (keys.hasNext()) {
|
|
@@ -123,6 +137,11 @@ fun JSONObject.getIntOrNull(name: String): Int? {
|
|
|
123
137
|
return null
|
|
124
138
|
}
|
|
125
139
|
|
|
140
|
+
fun JSONObject.getLongOrNull(name: String): Long? {
|
|
141
|
+
if (has(name) && get(name).toString() != "null") return getLong(name)
|
|
142
|
+
return null
|
|
143
|
+
}
|
|
144
|
+
|
|
126
145
|
fun JSONObject.getDoubleOrNull(name: String): Double? {
|
|
127
146
|
if (has(name) && get(name).toString() != "null") return getDouble(name)
|
|
128
147
|
return null
|
|
@@ -138,6 +157,49 @@ fun JSONObject.getStringOrNull(name: String): String? {
|
|
|
138
157
|
return null
|
|
139
158
|
}
|
|
140
159
|
|
|
160
|
+
fun <T : Any> KClass<T>.constructor(vararg argTypes: KClass<*>): Constructor<T> {
|
|
161
|
+
val types = mutableListOf<Class<*>>()
|
|
162
|
+
for (argType in argTypes) types.add(argType.java)
|
|
163
|
+
return java.getDeclaredConstructor(*types.toTypedArray())
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
fun <T : Any> Constructor<T>.instantiate(vararg args: Any?): T {
|
|
167
|
+
isAccessible = true
|
|
168
|
+
return newInstance(*args)
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
fun <T : Any> T.setPrivateProperty(varName: String, data: Any?) {
|
|
172
|
+
try {
|
|
173
|
+
setPrivateProperty(javaClass, varName, data)
|
|
174
|
+
} catch (_: java.lang.Exception) {
|
|
175
|
+
try {
|
|
176
|
+
setPrivateProperty(javaClass.superclass!!, varName, data)
|
|
177
|
+
} catch (_: java.lang.Exception) {
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
fun <T : Any> T.setPrivateProperty(clazz: Class<T>, varName: String, data: Any?) = clazz.getDeclaredField(varName).let {
|
|
183
|
+
it.isAccessible = true
|
|
184
|
+
it.set(this, data)
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
fun <T : Any> T.getPrivateProperty(varName: String): Any? {
|
|
188
|
+
var clazz: Class<*>? = this.javaClass
|
|
189
|
+
while (clazz != null) {
|
|
190
|
+
try {
|
|
191
|
+
val field = clazz.getDeclaredField(varName)
|
|
192
|
+
field.isAccessible = true
|
|
193
|
+
return field.get(this)
|
|
194
|
+
} catch (_: NoSuchFieldException) {
|
|
195
|
+
clazz = clazz.superclass
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
throw NoSuchFieldException(
|
|
199
|
+
"Field '$varName' not found in class hierarchy of ${this.javaClass.name}"
|
|
200
|
+
)
|
|
201
|
+
}
|
|
202
|
+
|
|
141
203
|
internal object Convert {
|
|
142
204
|
fun String?.toByteArray(): ByteArray? {
|
|
143
205
|
var str = this ?: return null
|
|
@@ -2278,14 +2278,14 @@
|
|
|
2278
2278
|
}
|
|
2279
2279
|
},
|
|
2280
2280
|
"node_modules/glob": {
|
|
2281
|
-
"version": "11.0
|
|
2282
|
-
"resolved": "https://registry.npmjs.org/glob/-/glob-11.0.
|
|
2283
|
-
"integrity": "sha512-
|
|
2284
|
-
"license": "
|
|
2281
|
+
"version": "11.1.0",
|
|
2282
|
+
"resolved": "https://registry.npmjs.org/glob/-/glob-11.1.0.tgz",
|
|
2283
|
+
"integrity": "sha512-vuNwKSaKiqm7g0THUBu2x7ckSs3XJLXE+2ssL7/MfTGPLLcrJQ/4Uq1CjPTtO5cCIiRxqvN6Twy1qOwhL0Xjcw==",
|
|
2284
|
+
"license": "BlueOak-1.0.0",
|
|
2285
2285
|
"dependencies": {
|
|
2286
2286
|
"foreground-child": "^3.3.1",
|
|
2287
2287
|
"jackspeak": "^4.1.1",
|
|
2288
|
-
"minimatch": "^10.
|
|
2288
|
+
"minimatch": "^10.1.1",
|
|
2289
2289
|
"minipass": "^7.1.2",
|
|
2290
2290
|
"package-json-from-dist": "^1.0.0",
|
|
2291
2291
|
"path-scurry": "^2.0.0"
|
|
@@ -2502,10 +2502,10 @@
|
|
|
2502
2502
|
}
|
|
2503
2503
|
},
|
|
2504
2504
|
"node_modules/minimatch": {
|
|
2505
|
-
"version": "10.
|
|
2506
|
-
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.
|
|
2507
|
-
"integrity": "sha512-
|
|
2508
|
-
"license": "
|
|
2505
|
+
"version": "10.1.1",
|
|
2506
|
+
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.1.1.tgz",
|
|
2507
|
+
"integrity": "sha512-enIvLvRAFZYXJzkCYG5RKmPfrFArdLv+R+lbQ53BmIMLIry74bjKzX6iHAm8WYamJkhSSEabrWN5D97XnKObjQ==",
|
|
2508
|
+
"license": "BlueOak-1.0.0",
|
|
2509
2509
|
"dependencies": {
|
|
2510
2510
|
"@isaacs/brace-expansion": "^5.0.0"
|
|
2511
2511
|
},
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
"android": "scripts/android.sh"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@regulaforensics/document-reader": "8.4.
|
|
10
|
-
"@regulaforensics/document-reader-core-fullauthrfid": "
|
|
11
|
-
"@regulaforensics/document-reader-btdevice": "8.4.
|
|
9
|
+
"@regulaforensics/document-reader": "8.4.507-rc",
|
|
10
|
+
"@regulaforensics/document-reader-core-fullauthrfid": "9.1.1281",
|
|
11
|
+
"@regulaforensics/document-reader-btdevice": "8.4.31",
|
|
12
12
|
"@awesome-cordova-plugins/file": "6.6.0",
|
|
13
13
|
"@awesome-cordova-plugins/camera": "6.6.0",
|
|
14
14
|
"cordova-plugin-file": "8.1.3",
|
|
@@ -44,7 +44,9 @@
|
|
|
44
44
|
<string>A0000002480100</string>
|
|
45
45
|
<string>A0000002480200</string>
|
|
46
46
|
<string>A0000002480300</string>
|
|
47
|
+
<string>A0000002480400</string>
|
|
47
48
|
<string>A00000045645444C2D3031</string>
|
|
49
|
+
<string>D2760000850101</string>
|
|
48
50
|
</array>
|
|
49
51
|
</config-file>
|
|
50
52
|
<config-file parent="com.apple.developer.nfc.readersession.formats" target="*-Debug.plist">
|