11//
2- // Config.java
2+ // Config.kt
33// DocumentReader
44//
55// Created by Pavel Masiuk on 21.09.2023.
@@ -26,6 +26,7 @@ import com.regula.documentreader.api.params.LivenessParams
2626import com.regula.documentreader.api.params.ParamsCustomization
2727import com.regula.documentreader.api.params.ProcessParam
2828import com.regula.documentreader.api.params.RfidScenario
29+ import com.regula.documentreader.api.params.rfid.dg.DTCDataGroup
2930import com.regula.documentreader.api.params.rfid.dg.DataGroups
3031import com.regula.documentreader.api.params.rfid.dg.EIDDataGroups
3132import com.regula.documentreader.api.params.rfid.dg.EPassportDataGroups
@@ -129,12 +130,16 @@ fun setProcessParams(processParams: ProcessParam, opts: JSONObject) = opts.forEa
129130 " shouldReturnPackageForReprocess" -> processParams.shouldReturnPackageForReprocess = v as Boolean
130131 " disablePerforationOCR" -> processParams.disablePerforationOCR = v as Boolean
131132 " respectImageQuality" -> processParams.respectImageQuality = v as Boolean
133+ " strictImageQuality" -> processParams.strictImageQuality = v as Boolean
132134 " splitNames" -> processParams.splitNames = v as Boolean
133135 " doDetectCan" -> processParams.doDetectCan = v as Boolean
134136 " useFaceApi" -> processParams.useFaceApi = v as Boolean
135137 " useAuthenticityCheck" -> processParams.useAuthenticityCheck = v as Boolean
136138 " checkHologram" -> processParams.checkHologram = v as Boolean
137139 " generateNumericCodes" -> processParams.generateNumericCodes = v as Boolean
140+ " strictBarcodeDigitalSignatureCheck" -> processParams.strictBarcodeDigitalSignatureCheck = v as Boolean
141+ " selectLongestNames" -> processParams.selectLongestNames = v as Boolean
142+ " generateDTCVC" -> processParams.generateDTCVC = v as Boolean
138143 " measureSystem" -> processParams.measureSystem = v.toInt()
139144 " barcodeParserType" -> processParams.barcodeParserType = v.toInt()
140145 " perspectiveAngle" -> processParams.perspectiveAngle = v.toInt()
@@ -207,12 +212,16 @@ fun getProcessParams(processParams: ProcessParam) = mapOf(
207212 " shouldReturnPackageForReprocess" to processParams.shouldReturnPackageForReprocess,
208213 " disablePerforationOCR" to processParams.disablePerforationOCR,
209214 " respectImageQuality" to processParams.respectImageQuality,
215+ " strictImageQuality" to processParams.strictImageQuality,
210216 " splitNames" to processParams.splitNames,
211217 " doDetectCan" to processParams.doDetectCan,
212218 " useFaceApi" to processParams.useFaceApi,
213219 " useAuthenticityCheck" to processParams.useAuthenticityCheck,
214220 " checkHologram" to processParams.checkHologram,
215221 " generateNumericCodes" to processParams.generateNumericCodes,
222+ " strictBarcodeDigitalSignatureCheck" to processParams.strictBarcodeDigitalSignatureCheck,
223+ " selectLongestNames" to processParams.selectLongestNames,
224+ " generateDTCVC" to processParams.generateDTCVC,
216225 " measureSystem" to processParams.measureSystem,
217226 " barcodeParserType" to processParams.barcodeParserType,
218227 " perspectiveAngle" to processParams.perspectiveAngle,
@@ -278,6 +287,7 @@ fun setCustomization(customization: ParamsCustomization, opts: JSONObject, conte
278287 " activityIndicatorColor" -> editor.setActivityIndicatorColor(v.toColor())
279288 " statusBackgroundColor" -> editor.setStatusBackgroundColor(v.toColor())
280289 " cameraPreviewBackgroundColor" -> editor.setCameraPreviewBackgroundColor(v.toColor())
290+ " backgroundMaskColor" -> editor.setBackgroundMaskColor(v.toColor())
281291 " statusPositionMultiplier" -> editor.setStatusPositionMultiplier(v.toFloat())
282292 " resultStatusPositionMultiplier" -> editor.setResultStatusPositionMultiplier(v.toFloat())
283293 " toolbarSize" -> editor.setToolbarSize(v.toFloat())
@@ -288,6 +298,8 @@ fun setCustomization(customization: ParamsCustomization, opts: JSONObject, conte
288298 " cameraFramePortraitAspectRatio" -> editor.setCameraFramePortraitAspectRatio(v.toFloat())
289299 " cameraFrameCornerRadius" -> editor.setCameraFrameCornerRadius(v.toFloat())
290300 " livenessAnimationPositionMultiplier" -> editor.setLivenessAnimationPositionMultiplier(v.toFloat())
301+ " nextPageAnimationStartDelay" -> editor.setNextPageAnimationStartDelay(v.toFloat())
302+ " nextPageAnimationEndDelay" -> editor.setNextPageAnimationEndDelay(v.toFloat())
291303 " multipageAnimationFrontImage" -> editor.setMultipageAnimationFrontImage(v.toDrawable(context))
292304 " multipageAnimationBackImage" -> editor.setMultipageAnimationBackImage(v.toDrawable(context))
293305 " borderBackgroundImage" -> editor.setBorderBackgroundImage(v.toDrawable(context))
@@ -349,6 +361,7 @@ fun getCustomization(customization: ParamsCustomization) = mapOf(
349361 " activityIndicatorColor" to customization.activityIndicatorColor.toLong(),
350362 " statusBackgroundColor" to customization.statusBackgroundColor.toLong(),
351363 " cameraPreviewBackgroundColor" to customization.cameraPreviewBackgroundColor.toLong(),
364+ " backgroundMaskColor" to customization.backgroundMaskColor.toLong(),
352365 " statusPositionMultiplier" to customization.statusPositionMultiplier,
353366 " resultStatusPositionMultiplier" to customization.resultStatusPositionMultiplier,
354367 " backgroundMaskAlpha" to customization.backgroundMaskAlpha,
@@ -359,6 +372,8 @@ fun getCustomization(customization: ParamsCustomization) = mapOf(
359372 " cameraFramePortraitAspectRatio" to customization.cameraFramePortraitAspectRatio,
360373 " cameraFrameCornerRadius" to customization.cameraFrameCornerRadius,
361374 " livenessAnimationPositionMultiplier" to customization.livenessAnimationPositionMultiplier,
375+ " nextPageAnimationStartDelay" to customization.nextPageAnimationStartDelay,
376+ " nextPageAnimationEndDelay" to customization.nextPageAnimationEndDelay,
362377 " multipageAnimationFrontImage" to customization.multipageAnimationFrontImage.toString(),
363378 " multipageAnimationBackImage" to customization.multipageAnimationBackImage.toString(),
364379 " borderBackgroundImage" to customization.borderBackgroundImage.toString(),
@@ -422,6 +437,8 @@ fun setRfidScenario(rfidScenario: RfidScenario, opts: JSONObject) = opts.forEach
422437 " applyAmendments" -> rfidScenario.isApplyAmendments = v as Boolean
423438 " autoSettings" -> rfidScenario.isAutoSettings = v as Boolean
424439 " proceedReadingAlways" -> rfidScenario.proceedReadingAlways = v as Boolean
440+ " readDTC" -> rfidScenario.isReadDTC = v as Boolean
441+ " mrzStrictCheck" -> rfidScenario.isMrzStrictCheck = v as Boolean
425442 " signManagementAction" -> rfidScenario.signManagementAction = v.toInt()
426443 " readingBuffer" -> rfidScenario.readingBuffer = v.toInt()
427444 " onlineTAToSignDataType" -> rfidScenario.onlineTAToSignDataType = v.toInt()
@@ -437,9 +454,11 @@ fun setRfidScenario(rfidScenario: RfidScenario, opts: JSONObject) = opts.forEach
437454 " mrz" -> rfidScenario.mrz = v as String
438455 " eSignPINDefault" -> rfidScenario.seteSignPINDefault(v as String )
439456 " eSignPINNewValue" -> rfidScenario.seteSignPINNewValue(v as String )
457+ " cardAccess" -> rfidScenario.cardAccess = v as String
440458 " ePassportDataGroups" -> setDataGroups(rfidScenario.ePassportDataGroups(), v as JSONObject )
441459 " eIDDataGroups" -> setDataGroups(rfidScenario.eIDDataGroups(), v as JSONObject )
442460 " eDLDataGroups" -> setDataGroups(rfidScenario.eDLDataGroups(), v as JSONObject )
461+ " dtcDataGroups" -> setDataGroups(rfidScenario.DTCDataGroup (), v as JSONObject )
443462 }
444463}
445464
@@ -478,6 +497,8 @@ fun getRfidScenario(rfidScenario: RfidScenario) = mapOf(
478497 " applyAmendments" to rfidScenario.isApplyAmendments,
479498 " autoSettings" to rfidScenario.isAutoSettings,
480499 " proceedReadingAlways" to rfidScenario.proceedReadingAlways,
500+ " readDTC" to rfidScenario.isReadDTC,
501+ " mrzStrictCheck" to rfidScenario.isMrzStrictCheck,
481502 " signManagementAction" to rfidScenario.signManagementAction,
482503 " readingBuffer" to rfidScenario.readingBuffer,
483504 " onlineTAToSignDataType" to rfidScenario.onlineTAToSignDataType,
@@ -493,9 +514,11 @@ fun getRfidScenario(rfidScenario: RfidScenario) = mapOf(
493514 " mrz" to rfidScenario.mrz,
494515 " eSignPINDefault" to rfidScenario.geteSignPINDefault(),
495516 " eSignPINNewValue" to rfidScenario.geteSignPINNewValue(),
517+ " cardAccess" to rfidScenario.cardAccess,
496518 " ePassportDataGroups" to getDataGroups(rfidScenario.ePassportDataGroups()),
497519 " eIDDataGroups" to getDataGroups(rfidScenario.eIDDataGroups()),
498- " eDLDataGroups" to getDataGroups(rfidScenario.eDLDataGroups())
520+ " eDLDataGroups" to getDataGroups(rfidScenario.eDLDataGroups()),
521+ " dtcDataGroups" to getDataGroups(rfidScenario.DTCDataGroup ())
499522).toJsonObject()
500523
501524fun setDataGroups (dataGroup : DataGroups , opts : JSONObject ) = opts.forEach { k, v ->
@@ -529,6 +552,15 @@ fun setDataGroups(dataGroup: DataGroups, opts: JSONObject) = opts.forEach { k, v
529552 " DG20" -> dataGroup.isDG20 = value
530553 " DG21" -> dataGroup.isDG21 = value
531554 }
555+ if (dataGroup is DTCDataGroup ) when (k) {
556+ " DG15" -> dataGroup.isDG15 = value
557+ " DG16" -> dataGroup.isDG16 = value
558+ " DG17" -> dataGroup.isDG17 = value
559+ " DG18" -> dataGroup.isDG18 = value
560+ " DG22" -> dataGroup.isDG22 = value
561+ " DG23" -> dataGroup.isDG23 = value
562+ " DG24" -> dataGroup.isDG24 = value
563+ }
532564}
533565
534566fun getDataGroups (dataGroup : DataGroups ): JSONObject {
@@ -561,6 +593,15 @@ fun getDataGroups(dataGroup: DataGroups): JSONObject {
561593 result[" DG20" ] = dataGroup.isDG20
562594 result[" DG21" ] = dataGroup.isDG21
563595 }
596+ if (dataGroup is DTCDataGroup ) {
597+ result[" DG15" ] = dataGroup.isDG15
598+ result[" DG16" ] = dataGroup.isDG16
599+ result[" DG17" ] = dataGroup.isDG17
600+ result[" DG18" ] = dataGroup.isDG18
601+ result[" DG22" ] = dataGroup.isDG22
602+ result[" DG23" ] = dataGroup.isDG23
603+ result[" DG24" ] = dataGroup.isDG24
604+ }
564605 return result.toJsonObject()
565606}
566607
0 commit comments