@regulaforensics/react-native-document-reader-api 9.3.477-nightly → 9.3.478-beta

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.
@@ -14,6 +14,6 @@ Pod::Spec.new do |s|
14
14
  s.source = { :http => 'file:' + __dir__ }
15
15
  s.ios.deployment_target = '13.0'
16
16
  s.source_files = "ios/*.{h,m}"
17
- s.dependency 'DocumentReaderNightly', '9.3.6090'
17
+ s.dependency 'DocumentReaderStage', '9.3.6080'
18
18
  s.dependency 'React'
19
19
  end
@@ -20,7 +20,7 @@ android {
20
20
  rootProject.allprojects {
21
21
  repositories {
22
22
  maven {
23
- url "https://maven.regulaforensics.com/RegulaDocumentReader/Nightly"
23
+ url "https://maven.regulaforensics.com/RegulaDocumentReader/Stage"
24
24
  }
25
25
  }
26
26
  }
@@ -29,7 +29,7 @@ dependencies {
29
29
  //noinspection GradleDynamicVersion
30
30
  implementation 'com.facebook.react:react-native:+'
31
31
  //noinspection GradleDependency
32
- implementation('com.regula.documentreader:api:9.3.12623') {
32
+ implementation('com.regula.documentreader:api:9.2.12625') {
33
33
  transitive = true
34
34
  }
35
35
  }
@@ -2,15 +2,18 @@
2
2
 
3
3
  package com.regula.plugin.documentreader
4
4
 
5
+ import android.graphics.Matrix
5
6
  import android.graphics.Paint
6
7
  import android.graphics.Typeface
7
8
  import android.graphics.drawable.Drawable
8
9
  import android.text.SpannableString
9
10
  import android.widget.ImageView
10
- import androidx.core.content.ContextCompat
11
11
  import com.regula.documentreader.api.enums.CustomizationColor
12
12
  import com.regula.documentreader.api.enums.CustomizationFont
13
13
  import com.regula.documentreader.api.enums.CustomizationImage
14
+ import com.regula.documentreader.api.enums.CustomizationMatrix
15
+ import com.regula.documentreader.api.enums.CustomizationScaleType
16
+ import com.regula.documentreader.api.enums.CustomizationTiming
14
17
  import com.regula.documentreader.api.enums.LogLevel
15
18
  import com.regula.documentreader.api.params.AuthenticityParams
16
19
  import com.regula.documentreader.api.params.Functionality
@@ -147,6 +150,9 @@ fun setProcessParams(processParams: ProcessParam, opts: JSONObject) = opts.forEa
147
150
  "strictSecurityChecks" -> processParams.strictSecurityChecks = v as Boolean
148
151
  "returnTransliteratedFields" -> processParams.returnTransliteratedFields = v as Boolean
149
152
  "checkCaptureProcessIntegrity" -> processParams.checkCaptureProcessIntegrity = v as Boolean
153
+ "strictExpiryDate" -> processParams.strictExpiryDate = v as Boolean
154
+ "debugSaveBinarySession" -> processParams.debugSaveBinarySession = v as Boolean
155
+ "checkVDS" -> processParams.checkVDS = v as Boolean
150
156
  "measureSystem" -> processParams.measureSystem = v.toInt()
151
157
  "barcodeParserType" -> processParams.barcodeParserType = v.toInt()
152
158
  "perspectiveAngle" -> processParams.perspectiveAngle = v.toInt()
@@ -237,6 +243,9 @@ fun getProcessParams(processParams: ProcessParam) = mapOf(
237
243
  "strictSecurityChecks" to processParams.strictSecurityChecks,
238
244
  "returnTransliteratedFields" to processParams.returnTransliteratedFields,
239
245
  "checkCaptureProcessIntegrity" to processParams.checkCaptureProcessIntegrity,
246
+ "strictExpiryDate" to processParams.strictExpiryDate,
247
+ "debugSaveBinarySession" to processParams.debugSaveBinarySession,
248
+ "checkVDS" to processParams.checkVDS,
240
249
  "measureSystem" to processParams.measureSystem,
241
250
  "barcodeParserType" to processParams.barcodeParserType,
242
251
  "perspectiveAngle" to processParams.perspectiveAngle,
@@ -347,6 +356,8 @@ fun setCustomization(customization: ParamsCustomization, opts: JSONObject) = opt
347
356
  "colors" -> setColors(editor, v as JSONObject)
348
357
  "fonts" -> setFonts(editor, v as JSONObject)
349
358
  "images" -> setImages(editor, v as JSONObject)
359
+ "timings" -> setTimings(editor, v as JSONObject)
360
+ "matrices" -> setMatrices(editor, v as JSONObject)
350
361
  "statusTextFont" -> {
351
362
  val font = typefaceFromJSON(v as JSONObject)
352
363
  editor.setStatusTextFont(font.first)
@@ -436,7 +447,9 @@ fun getCustomization(customization: ParamsCustomization) = mapOf(
436
447
  "uiCustomizationLayer" to customization.uiCustomizationLayer,
437
448
  "colors" to getColors(customization.colors),
438
449
  "fonts" to getFonts(customization.typeFaces, customization.fontSizes),
439
- "images" to getImages(customization.images)
450
+ "images" to getImages(customization.images),
451
+ "timings" to getTimings(customization.timings),
452
+ "matrices" to getMatrices(customization.matrices),
440
453
  ).toJson()
441
454
 
442
455
  fun setRfidScenario(rfidScenario: RfidScenario, opts: JSONObject) = opts.forEach { k, v ->
@@ -755,31 +768,35 @@ fun getLivenessParams(input: LivenessParams?) = input?.let {
755
768
  ).toJson()
756
769
  }
757
770
 
758
- fun setColors(input: ParamsCustomization.CustomizationEditor, opts: JSONObject) = opts.forEach { key, v ->
759
- val value = v.toLong()
760
- when (key) {
761
- "rfidProcessingScreenBackground" -> input.setColor(CustomizationColor.RFID_PROCESSING_SCREEN_BACKGROUND, value)
762
- "rfidProcessingScreenHintLabelText" -> input.setColor(CustomizationColor.RFID_PROCESSING_SCREEN_HINT_LABEL_TEXT, value)
763
- "rfidProcessingScreenHintLabelBackground" -> input.setColor(CustomizationColor.RFID_PROCESSING_SCREEN_HINT_LABEL_BACKGROUND, value)
764
- "rfidProcessingScreenProgressLabelText" -> input.setColor(CustomizationColor.RFID_PROCESSING_SCREEN_PROGRESS_LABEL_TEXT, value)
765
- "rfidProcessingScreenProgressBar" -> input.setColor(CustomizationColor.RFID_PROCESSING_SCREEN_PROGRESS_BAR, value)
766
- "rfidProcessingScreenProgressBarBackground" -> input.setColor(CustomizationColor.RFID_PROCESSING_SCREEN_PROGRESS_BAR_BACKGROUND, value)
767
- "rfidProcessingScreenResultLabelText" -> input.setColor(CustomizationColor.RFID_PROCESSING_SCREEN_RESULT_LABEL_TEXT, value)
768
- "rfidProcessingScreenLoadingBar" -> input.setColor(CustomizationColor.RFID_PROCESSING_SCREEN_LOADING_BAR, value)
769
- "rfidEnableNfcTitleText" -> input.setColor(CustomizationColor.RFID_ENABLE_NFC_TITLE_TEXT, value)
770
- "rfidEnableNfcDescriptionText" -> input.setColor(CustomizationColor.RFID_ENABLE_NFC_DESCRIPTION_TEXT, value)
771
- "rfidEnableNfcButtonText" -> input.setColor(CustomizationColor.RFID_ENABLE_NFC_BUTTON_TEXT, value)
772
- "rfidEnableNfcButtonBackground" -> input.setColor(CustomizationColor.RFID_ENABLE_NFC_BUTTON_BACKGROUND, value)
773
- "mdlProcessingScreenBackground" -> input.setColor(CustomizationColor.MDL_PROCESSING_SCREEN_BACKGROUND, value)
774
- "mdlProcessingScreenHintLabelText" -> input.setColor(CustomizationColor.MDL_PROCESSING_SCREEN_HINT_LABEL_TEXT, value)
775
- "mdlProcessingScreenHintLabelBackground" -> input.setColor(CustomizationColor.MDL_PROCESSING_SCREEN_HINT_LABEL_BACKGROUND, value)
776
- "mdlProcessingScreenProgressLabelText" -> input.setColor(CustomizationColor.MDL_PROCESSING_SCREEN_PROGRESS_LABEL_TEXT, value)
777
- "mdlProcessingScreenResultLabelText" -> input.setColor(CustomizationColor.MDL_PROCESSING_SCREEN_RESULT_LABEL_TEXT, value)
778
- "mdlProcessingScreenLoadingBar" -> input.setColor(CustomizationColor.MDL_PROCESSING_SCREEN_LOADING_BAR, value)
779
- "mdlEnableNfcTitleText" -> input.setColor(CustomizationColor.MDL_ENABLE_NFC_TITLE_TEXT, value)
780
- "mdlEnableNfcDescriptionText" -> input.setColor(CustomizationColor.MDL_ENABLE_NFC_DESCRIPTION_TEXT, value)
781
- "mdlEnableNfcButtonText" -> input.setColor(CustomizationColor.MDL_ENABLE_NFC_BUTTON_TEXT, value)
782
- "mdlEnableNfcButtonBackground" -> input.setColor(CustomizationColor.MDL_ENABLE_NFC_BUTTON_BACKGROUND, value)
771
+ fun setColors(input: ParamsCustomization.CustomizationEditor, opts: JSONObject) = opts.forEach { k, value ->
772
+ val v = value.toLong()
773
+ when (k) {
774
+ "rfidProcessingScreenBackground" -> input.setColor(CustomizationColor.RFID_PROCESSING_SCREEN_BACKGROUND, v)
775
+ "rfidProcessingScreenHintLabelText" -> input.setColor(CustomizationColor.RFID_PROCESSING_SCREEN_HINT_LABEL_TEXT, v)
776
+ "rfidProcessingScreenHintLabelBackground" -> input.setColor(CustomizationColor.RFID_PROCESSING_SCREEN_HINT_LABEL_BACKGROUND, v)
777
+ "rfidProcessingScreenProgressLabelText" -> input.setColor(CustomizationColor.RFID_PROCESSING_SCREEN_PROGRESS_LABEL_TEXT, v)
778
+ "rfidProcessingScreenProgressBar" -> input.setColor(CustomizationColor.RFID_PROCESSING_SCREEN_PROGRESS_BAR, v)
779
+ "rfidProcessingScreenProgressBarBackground" -> input.setColor(CustomizationColor.RFID_PROCESSING_SCREEN_PROGRESS_BAR_BACKGROUND, v)
780
+ "rfidProcessingScreenResultLabelText" -> input.setColor(CustomizationColor.RFID_PROCESSING_SCREEN_RESULT_LABEL_TEXT, v)
781
+ "rfidProcessingScreenLoadingBar" -> input.setColor(CustomizationColor.RFID_PROCESSING_SCREEN_LOADING_BAR, v)
782
+ "rfidEnableNfcTitleText" -> input.setColor(CustomizationColor.RFID_ENABLE_NFC_TITLE_TEXT, v)
783
+ "rfidEnableNfcDescriptionText" -> input.setColor(CustomizationColor.RFID_ENABLE_NFC_DESCRIPTION_TEXT, v)
784
+ "rfidEnableNfcButtonText" -> input.setColor(CustomizationColor.RFID_ENABLE_NFC_BUTTON_TEXT, v)
785
+ "rfidEnableNfcButtonBackground" -> input.setColor(CustomizationColor.RFID_ENABLE_NFC_BUTTON_BACKGROUND, v)
786
+ "mdlProcessingScreenBackground" -> input.setColor(CustomizationColor.MDL_PROCESSING_SCREEN_BACKGROUND, v)
787
+ "mdlProcessingScreenHintLabelText" -> input.setColor(CustomizationColor.MDL_PROCESSING_SCREEN_HINT_LABEL_TEXT, v)
788
+ "mdlProcessingScreenHintLabelBackground" -> input.setColor(CustomizationColor.MDL_PROCESSING_SCREEN_HINT_LABEL_BACKGROUND, v)
789
+ "mdlProcessingScreenProgressLabelText" -> input.setColor(CustomizationColor.MDL_PROCESSING_SCREEN_PROGRESS_LABEL_TEXT, v)
790
+ "mdlProcessingScreenResultLabelText" -> input.setColor(CustomizationColor.MDL_PROCESSING_SCREEN_RESULT_LABEL_TEXT, v)
791
+ "mdlProcessingScreenLoadingBar" -> input.setColor(CustomizationColor.MDL_PROCESSING_SCREEN_LOADING_BAR, v)
792
+ "mdlEnableNfcTitleText" -> input.setColor(CustomizationColor.MDL_ENABLE_NFC_TITLE_TEXT, v)
793
+ "mdlEnableNfcDescriptionText" -> input.setColor(CustomizationColor.MDL_ENABLE_NFC_DESCRIPTION_TEXT, v)
794
+ "mdlEnableNfcButtonText" -> input.setColor(CustomizationColor.MDL_ENABLE_NFC_BUTTON_TEXT, v)
795
+ "mdlEnableNfcButtonBackground" -> input.setColor(CustomizationColor.MDL_ENABLE_NFC_BUTTON_BACKGROUND, v)
796
+ "nextPageIdCardFront" -> input.setColor(CustomizationColor.NEXT_PAGE_ID_CARD_FRONT, v)
797
+ "nextPageIdCardBack" -> input.setColor(CustomizationColor.NEXT_PAGE_ID_CARD_BACK, v)
798
+ "nextPagePassportShift" -> input.setColor(CustomizationColor.NEXT_PAGE_PASSPORT_SHIFT, v)
799
+ "nextPagePassportFlip" -> input.setColor(CustomizationColor.NEXT_PAGE_PASSPORT_FLIP, v)
783
800
  }
784
801
  }
785
802
 
@@ -806,22 +823,26 @@ fun getColors(input: Map<CustomizationColor, Long>) = mapOf(
806
823
  "mdlEnableNfcDescriptionText" to input[CustomizationColor.MDL_ENABLE_NFC_DESCRIPTION_TEXT],
807
824
  "mdlEnableNfcButtonText" to input[CustomizationColor.MDL_ENABLE_NFC_BUTTON_TEXT],
808
825
  "mdlEnableNfcButtonBackground" to input[CustomizationColor.MDL_ENABLE_NFC_BUTTON_BACKGROUND],
826
+ "nextPageIdCardFront" to input[CustomizationColor.NEXT_PAGE_ID_CARD_FRONT],
827
+ "nextPageIdCardBack" to input[CustomizationColor.NEXT_PAGE_ID_CARD_BACK],
828
+ "nextPagePassportShift" to input[CustomizationColor.NEXT_PAGE_PASSPORT_SHIFT],
829
+ "nextPagePassportFlip" to input[CustomizationColor.NEXT_PAGE_PASSPORT_FLIP],
809
830
  ).toJson()
810
831
 
811
- fun setFonts(input: ParamsCustomization.CustomizationEditor, opts: JSONObject) = opts.forEach { key, value ->
812
- when (key) {
813
- "rfidProcessingScreenHintLabel" -> CustomizationFont.RFID_PROCESSING_SCREEN_HINT_LABEL.setFont(input, value)
814
- "rfidProcessingScreenProgressLabel" -> CustomizationFont.RFID_PROCESSING_SCREEN_PROGRESS_LABEL.setFont(input, value)
815
- "rfidProcessingScreenResultLabel" -> CustomizationFont.RFID_PROCESSING_SCREEN_RESULT_LABEL.setFont(input, value)
816
- "rfidEnableNfcTitleText" -> CustomizationFont.RFID_ENABLE_NFC_TITLE_TEXT.setFont(input, value)
817
- "rfidEnableNfcDescriptionText" -> CustomizationFont.RFID_ENABLE_NFC_DESCRIPTION_TEXT.setFont(input, value)
818
- "rfidEnableNfcButtonText" -> CustomizationFont.RFID_ENABLE_NFC_BUTTON_TEXT.setFont(input, value)
819
- "mdlProcessingScreenHintLabel" -> CustomizationFont.MDL_PROCESSING_SCREEN_HINT_LABEL.setFont(input, value)
820
- "mdlProcessingScreenProgressLabel" -> CustomizationFont.MDL_PROCESSING_SCREEN_PROGRESS_LABEL.setFont(input, value)
821
- "mdlProcessingScreenResultLabel" -> CustomizationFont.MDL_PROCESSING_SCREEN_RESULT_LABEL.setFont(input, value)
822
- "mdlEnableNfcTitleText" -> CustomizationFont.MDL_ENABLE_NFC_TITLE_TEXT.setFont(input, value)
823
- "mdlEnableNfcDescriptionText" -> CustomizationFont.MDL_ENABLE_NFC_DESCRIPTION_TEXT.setFont(input, value)
824
- "mdlEnableNfcButtonText" -> CustomizationFont.MDL_ENABLE_NFC_BUTTON_TEXT.setFont(input, value)
832
+ fun setFonts(input: ParamsCustomization.CustomizationEditor, opts: JSONObject) = opts.forEach { k, v ->
833
+ when (k) {
834
+ "rfidProcessingScreenHintLabel" -> CustomizationFont.RFID_PROCESSING_SCREEN_HINT_LABEL.setFont(input, v)
835
+ "rfidProcessingScreenProgressLabel" -> CustomizationFont.RFID_PROCESSING_SCREEN_PROGRESS_LABEL.setFont(input, v)
836
+ "rfidProcessingScreenResultLabel" -> CustomizationFont.RFID_PROCESSING_SCREEN_RESULT_LABEL.setFont(input, v)
837
+ "rfidEnableNfcTitleText" -> CustomizationFont.RFID_ENABLE_NFC_TITLE_TEXT.setFont(input, v)
838
+ "rfidEnableNfcDescriptionText" -> CustomizationFont.RFID_ENABLE_NFC_DESCRIPTION_TEXT.setFont(input, v)
839
+ "rfidEnableNfcButtonText" -> CustomizationFont.RFID_ENABLE_NFC_BUTTON_TEXT.setFont(input, v)
840
+ "mdlProcessingScreenHintLabel" -> CustomizationFont.MDL_PROCESSING_SCREEN_HINT_LABEL.setFont(input, v)
841
+ "mdlProcessingScreenProgressLabel" -> CustomizationFont.MDL_PROCESSING_SCREEN_PROGRESS_LABEL.setFont(input, v)
842
+ "mdlProcessingScreenResultLabel" -> CustomizationFont.MDL_PROCESSING_SCREEN_RESULT_LABEL.setFont(input, v)
843
+ "mdlEnableNfcTitleText" -> CustomizationFont.MDL_ENABLE_NFC_TITLE_TEXT.setFont(input, v)
844
+ "mdlEnableNfcDescriptionText" -> CustomizationFont.MDL_ENABLE_NFC_DESCRIPTION_TEXT.setFont(input, v)
845
+ "mdlEnableNfcButtonText" -> CustomizationFont.MDL_ENABLE_NFC_BUTTON_TEXT.setFont(input, v)
825
846
  }
826
847
  }
827
848
 
@@ -840,20 +861,88 @@ fun getFonts(fonts: Map<CustomizationFont, Typeface>, sizes: Map<CustomizationFo
840
861
  "mdlEnableNfcButtonText" to CustomizationFont.MDL_ENABLE_NFC_BUTTON_TEXT.getFont(fonts, sizes),
841
862
  ).toJson()
842
863
 
843
- fun setImages(input: ParamsCustomization.CustomizationEditor, opts: JSONObject) = opts.forEach { key, v ->
844
- when (key) {
864
+ fun setImages(input: ParamsCustomization.CustomizationEditor, opts: JSONObject) = opts.forEach { k, v ->
865
+ when (k) {
866
+ "helpAnimation" -> input.setImage(CustomizationImage.HELP_ANIMATION, v.toDrawable())
867
+ "livenessAnimation" -> input.setImage(CustomizationImage.LIVENESS_ANIMATION, v.toDrawable())
868
+ "borderBackground" -> input.setImage(CustomizationImage.BORDER_BACKGROUND, v.toDrawable())
869
+ "torchButtonOn" -> input.setImage(CustomizationImage.TORCH_BUTTON_ON, v.toDrawable())
870
+ "torchButtonOff" -> input.setImage(CustomizationImage.TORCH_BUTTON_OFF, v.toDrawable())
871
+ "captureButton" -> input.setImage(CustomizationImage.CAPTURE_BUTTON, v.toDrawable())
872
+ "switchButton" -> input.setImage(CustomizationImage.SWITCH_BUTTON, v.toDrawable())
873
+ "closeButton" -> input.setImage(CustomizationImage.CLOSE_BUTTON, v.toDrawable())
874
+ "multipageButton" -> input.setImage(CustomizationImage.MULTIPAGE_BUTTON, v.toDrawable())
845
875
  "rfidProcessingScreenFailureImage" -> input.setImage(CustomizationImage.RFID_PROCESSING_SCREEN_FAILURE_IMAGE, v.toDrawable())
846
876
  "rfidEnableNfcImage" -> input.setImage(CustomizationImage.RFID_ENABLE_NFC_IMAGE, v.toDrawable())
877
+ "rfidDisableNfcImage" -> input.setImage(CustomizationImage.RFID_DISABLE_NFC_IMAGE, v.toDrawable())
847
878
  "mdlProcessingScreenFailureImage" -> input.setImage(CustomizationImage.MDL_PROCESSING_SCREEN_FAILURE_IMAGE, v.toDrawable())
848
879
  "mdlEnableNfcImage" -> input.setImage(CustomizationImage.MDL_ENABLE_NFC_IMAGE, v.toDrawable())
880
+ "mdlDisableNfcImage" -> input.setImage(CustomizationImage.MDL_DISABLE_NFC_IMAGE, v.toDrawable())
881
+ "nextPageIdCardFront" -> input.setImage(CustomizationImage.NEXT_PAGE_ID_CARD_FRONT, v.toDrawable())
882
+ "nextPageIdCardBack" -> input.setImage(CustomizationImage.NEXT_PAGE_ID_CARD_BACK, v.toDrawable())
883
+ "nextPagePassportShift" -> input.setImage(CustomizationImage.NEXT_PAGE_PASSPORT_SHIFT, v.toDrawable())
884
+ "nextPagePassportFlipStart" -> input.setImage(CustomizationImage.NEXT_PAGE_PASSPORT_FLIP_START, v.toDrawable())
885
+ "nextPagePassportFlipClean" -> input.setImage(CustomizationImage.NEXT_PAGE_PASSPORT_FLIP_CLEAN, v.toDrawable())
886
+ "nextPagePassportFlipTop" -> input.setImage(CustomizationImage.NEXT_PAGE_PASSPORT_FLIP_TOP, v.toDrawable())
887
+ "nextPagePassportFlipBottom" -> input.setImage(CustomizationImage.NEXT_PAGE_PASSPORT_FLIP_BOTTOM, v.toDrawable())
888
+ }
889
+ }
890
+
891
+ fun getImages(input: Map<String, Drawable>) = mapOf(
892
+ "helpAnimation" to input[CustomizationImage.HELP_ANIMATION.value].toBase64(),
893
+ "livenessAnimation" to input[CustomizationImage.LIVENESS_ANIMATION.value].toBase64(),
894
+ "borderBackground" to input[CustomizationImage.BORDER_BACKGROUND.value].toBase64(),
895
+ "torchButtonOn" to input[CustomizationImage.TORCH_BUTTON_ON.value].toBase64(),
896
+ "torchButtonOff" to input[CustomizationImage.TORCH_BUTTON_OFF.value].toBase64(),
897
+ "captureButton" to input[CustomizationImage.CAPTURE_BUTTON.value].toBase64(),
898
+ "switchButton" to input[CustomizationImage.SWITCH_BUTTON.value].toBase64(),
899
+ "closeButton" to input[CustomizationImage.CLOSE_BUTTON.value].toBase64(),
900
+ "multipageButton" to input[CustomizationImage.MULTIPAGE_BUTTON.value].toBase64(),
901
+ "rfidProcessingScreenFailureImage" to input[CustomizationImage.RFID_PROCESSING_SCREEN_FAILURE_IMAGE.value].toBase64(),
902
+ "rfidEnableNfcImage" to input[CustomizationImage.RFID_ENABLE_NFC_IMAGE.value].toBase64(),
903
+ "rfidDisableNfcImage" to input[CustomizationImage.RFID_DISABLE_NFC_IMAGE.value].toBase64(),
904
+ "mdlProcessingScreenFailureImage" to input[CustomizationImage.MDL_PROCESSING_SCREEN_FAILURE_IMAGE.value].toBase64(),
905
+ "mdlEnableNfcImage" to input[CustomizationImage.MDL_ENABLE_NFC_IMAGE.value].toBase64(),
906
+ "mdlDisableNfcImage" to input[CustomizationImage.MDL_DISABLE_NFC_IMAGE.value].toBase64(),
907
+ "nextPageIdCardFront" to input[CustomizationImage.NEXT_PAGE_ID_CARD_FRONT.value].toBase64(),
908
+ "nextPageIdCardBack" to input[CustomizationImage.NEXT_PAGE_ID_CARD_BACK.value].toBase64(),
909
+ "nextPagePassportShift" to input[CustomizationImage.NEXT_PAGE_PASSPORT_SHIFT.value].toBase64(),
910
+ "nextPagePassportFlipStart" to input[CustomizationImage.NEXT_PAGE_PASSPORT_FLIP_START.value].toBase64(),
911
+ "nextPagePassportFlipClean" to input[CustomizationImage.NEXT_PAGE_PASSPORT_FLIP_CLEAN.value].toBase64(),
912
+ "nextPagePassportFlipTop" to input[CustomizationImage.NEXT_PAGE_PASSPORT_FLIP_TOP.value].toBase64(),
913
+ "nextPagePassportFlipBottom" to input[CustomizationImage.NEXT_PAGE_PASSPORT_FLIP_BOTTOM.value].toBase64(),
914
+ ).toJson()
915
+
916
+ fun setTimings(input: ParamsCustomization.CustomizationEditor, opts: JSONObject) = opts.forEach { k, v ->
917
+ when (k) {
918
+ "nextPageIdCardStartDelay" -> input.setTiming(CustomizationTiming.NEXT_PAGE_ID_CARD_START_DELAY, v.toInt())
919
+ "nextPageIdCardEndDelay" -> input.setTiming(CustomizationTiming.NEXT_PAGE_ID_CARD_END_DELAY, v.toInt())
920
+ "nextPagePassportShiftStartDelay" -> input.setTiming(CustomizationTiming.NEXT_PAGE_PASSPORT_SHIFT_START_DELAY, v.toInt())
921
+ "nextPagePassportShiftEndDelay" -> input.setTiming(CustomizationTiming.NEXT_PAGE_PASSPORT_SHIFT_END_DELAY, v.toInt())
922
+ "nextPagePassportFlipStartDelay" -> input.setTiming(CustomizationTiming.NEXT_PAGE_PASSPORT_FLIP_START_DELAY, v.toInt())
923
+ "nextPagePassportFlipEndDelay" -> input.setTiming(CustomizationTiming.NEXT_PAGE_PASSPORT_FLIP_END_DELAY, v.toInt())
924
+ }
925
+ }
926
+
927
+ fun getTimings(input: Map<CustomizationTiming, Int>) = mapOf(
928
+ "nextPageIdCardStartDelay" to input[CustomizationTiming.NEXT_PAGE_ID_CARD_START_DELAY],
929
+ "nextPageIdCardEndDelay" to input[CustomizationTiming.NEXT_PAGE_ID_CARD_END_DELAY],
930
+ "nextPagePassportShiftStartDelay" to input[CustomizationTiming.NEXT_PAGE_PASSPORT_SHIFT_START_DELAY],
931
+ "nextPagePassportShiftEndDelay" to input[CustomizationTiming.NEXT_PAGE_PASSPORT_SHIFT_END_DELAY],
932
+ "nextPagePassportFlipStartDelay" to input[CustomizationTiming.NEXT_PAGE_PASSPORT_FLIP_START_DELAY],
933
+ "nextPagePassportFlipEndDelay" to input[CustomizationTiming.NEXT_PAGE_PASSPORT_FLIP_END_DELAY],
934
+ ).toJson()
935
+
936
+ fun setMatrices(input: ParamsCustomization.CustomizationEditor, opts: JSONObject) = opts.forEach { k, v ->
937
+ when (k) {
938
+ "nextPageIdCardFront" -> input.setMatrix(CustomizationMatrix.NEXT_PAGE_ID_CARD_FRONT, matrixFromJSON(v as JSONArray?)).setScaleType(CustomizationScaleType.NEXT_PAGE_ID_CARD_FRONT, ImageView.ScaleType.MATRIX)
939
+ "nextPageIdCardBack" -> input.setMatrix(CustomizationMatrix.NEXT_PAGE_ID_CARD_BACK, matrixFromJSON(v as JSONArray?)).setScaleType(CustomizationScaleType.NEXT_PAGE_ID_CARD_BACK, ImageView.ScaleType.MATRIX)
849
940
  }
850
941
  }
851
942
 
852
- fun getImages(input: Map<CustomizationImage, Drawable>) = mapOf(
853
- "rfidProcessingScreenFailureImage" to (input[CustomizationImage.RFID_PROCESSING_SCREEN_FAILURE_IMAGE] ?: ContextCompat.getDrawable(context, com.regula.documentreader.api.R.drawable.reg_ic_error)).toBase64(),
854
- "rfidEnableNfcImage" to (input[CustomizationImage.RFID_ENABLE_NFC_IMAGE] ?: ContextCompat.getDrawable(context, com.regula.documentreader.api.R.drawable.reg_enable_nfc)).toBase64(),
855
- "mdlProcessingScreenFailureImage" to (input[CustomizationImage.MDL_PROCESSING_SCREEN_FAILURE_IMAGE] ?: ContextCompat.getDrawable(context, com.regula.documentreader.api.R.drawable.reg_enable_nfc)).toBase64(),
856
- "mdlEnableNfcImage" to (input[CustomizationImage.MDL_ENABLE_NFC_IMAGE] ?: ContextCompat.getDrawable(context, com.regula.documentreader.api.R.drawable.reg_enable_nfc)).toBase64(),
943
+ fun getMatrices(input: Map<CustomizationMatrix, Matrix>) = mapOf(
944
+ "nextPageIdCardFront" to generateMatrix(input[CustomizationMatrix.NEXT_PAGE_ID_CARD_FRONT]),
945
+ "nextPageIdCardBack" to generateMatrix(input[CustomizationMatrix.NEXT_PAGE_ID_CARD_BACK]),
857
946
  ).toJson()
858
947
 
859
948
  fun CustomizationFont.getFont(fonts: Map<CustomizationFont, Typeface>, sizes: Map<CustomizationFont, Int>) =
@@ -310,6 +310,7 @@ fun backendProcessingConfigFromJSON(input: JSONObject?) = input?.let {
310
310
  }
311
311
  result.rfidServerSideChipVerification = it.getBooleanOrNull("rfidServerSideChipVerification")
312
312
  result.timeoutConnection = it.getDoubleOrNull("timeoutConnection")
313
+ if (it.has("mdlVerification")) result.mdlVerification = it.getBoolean("mdlVerification")
313
314
  result
314
315
  }
315
316
 
@@ -322,7 +323,8 @@ fun generateBackendProcessingConfig(input: BackendProcessingConfig?) = input?.le
322
323
  val httpHeaders = JSONObject()
323
324
  for ((key, value) in it.httpHeaders!!) httpHeaders.put(key, value)
324
325
  httpHeaders
325
- }
326
+ },
327
+ "mdlVerification" to it.mdlVerification,
326
328
  ).toJson()
327
329
  }
328
330
 
@@ -916,18 +918,18 @@ fun generateCameraSize(width: Int?, height: Int?): JSONObject? {
916
918
  fun documentReaderDocumentTypeFromJSON(input: JSONObject?) = input?.let {
917
919
  val result = DocumentReaderDocumentType()
918
920
 
919
- result.pageIndex = it.optInt("pageIndex")
920
- result.documentID = it.optInt("documentID")
921
- result.dType = it.optInt("dType")
922
- result.dFormat = it.optInt("dFormat")
923
- result.dMRZ = it.optBoolean("dMRZ")
924
- result.isDeprecated = it.optBoolean("isDeprecated")
925
- result.name = it.optString("name")
926
- result.ICAOCode = it.optString("ICAOCode")
927
- result.dDescription = it.optString("dDescription")
928
- result.dCountryName = it.optString("dCountryName")
929
- result.dYear = it.optString("dYear")
930
- result.FDSID = it.optJSONArray("FDSID").toIntArray()
921
+ result.pageIndex = it.getInt("pageIndex")
922
+ result.documentID = it.getInt("documentID")
923
+ result.dType = it.getInt("dType")
924
+ result.dFormat = it.getInt("dFormat")
925
+ result.dMRZ = it.getBoolean("dMRZ")
926
+ result.isDeprecated = it.getBoolean("isDeprecated")
927
+ result.name = it.getStringOrNull("name")
928
+ result.ICAOCode = it.getStringOrNull("ICAOCode")
929
+ result.dDescription = it.getStringOrNull("dDescription")
930
+ result.dCountryName = it.getStringOrNull("dCountryName")
931
+ result.dYear = it.getStringOrNull("dYear")
932
+ result.FDSID = it.getJSONArrayOrNull("FDSID").toIntArray()
931
933
 
932
934
  result
933
935
  }
@@ -1451,7 +1453,7 @@ fun generateDocumentReaderAuthenticityElement(input: DocumentReaderAuthenticityE
1451
1453
  fun paResourcesIssuerFromJSON(input: JSONObject?) = input?.let {
1452
1454
  val result = PAResourcesIssuer()
1453
1455
  result.data = it.optString("data").toByteArray()
1454
- result.friendlyName = it.optString("friendlyName")
1456
+ result.friendlyName = it.getStringOrNull("friendlyName")
1455
1457
  result.attributes = it.optJSONArray("attributes").toArray(::paAttributeFromJSON)
1456
1458
  result
1457
1459
  }
@@ -1731,9 +1733,9 @@ fun generateDocumentReaderRFIDOrigin(input: DocumentReaderRfidOrigin?) = input?.
1731
1733
 
1732
1734
  fun documentReaderTextSourceFromJSON(input: JSONObject?) = input?.let {
1733
1735
  val result = DocumentReaderTextSource()
1734
- result.sourceType = it.optInt("sourceType")
1735
- result.source = it.optString("source")
1736
- result.validityStatus = it.optInt("validityStatus")
1736
+ result.sourceType = it.getInt("sourceType")
1737
+ result.source = it.getStringOrNull("source")
1738
+ result.validityStatus = it.getInt("validityStatus")
1737
1739
  result
1738
1740
  }
1739
1741
 
@@ -1875,7 +1877,7 @@ fun documentReaderResultsFromJSON(input: JSONObject?) = input?.let {
1875
1877
  result.mrzPosition = it.optJSONArray("mrzPosition").toList(::elementPositionFromJSON)!!
1876
1878
  result.imageQuality = it.optJSONArray("imageQuality").toList(::imageQualityGroupFromJSON)!!
1877
1879
  result.rawResult = it.optString("rawResult")
1878
- result.bsiTr03135Results = it.optString("bsiTr03135Results")
1880
+ result.bsiTr03135Results = it.getStringOrNull("bsiTr03135Results")
1879
1881
  result.rfidSessionData = rfidSessionDataFromJSON(it.optJSONObject("rfidSessionData"))
1880
1882
  result.authenticityResult = documentReaderAuthenticityResultFromJSON(it.optJSONObject("authenticityResult"))
1881
1883
  result.barcodeResult = documentReaderBarcodeResultFromJSON(it.optJSONObject("barcodeResult"))
@@ -2124,6 +2126,7 @@ fun finalizeConfigFromJSON(input: JSONObject?) = input?.let {
2124
2126
  if (it.has("rawImages")) result.setRawImages(it.getBoolean("rawImages"))
2125
2127
  if (it.has("video")) result.setVideo(it.getBoolean("video"))
2126
2128
  if (it.has("rfidSession")) result.setRfidSession(it.getBoolean("rfidSession"))
2129
+ if (it.has("mdlSession")) result.setMdlSession(it.getBoolean("mdlSession"))
2127
2130
  result.build()
2128
2131
  }
2129
2132
 
@@ -2131,6 +2134,7 @@ fun generateFinalizeConfig(input: FinalizeConfig?) = input?.let {
2131
2134
  mapOf(
2132
2135
  "rawImages" to it.getPrivateProperty("rawImages"),
2133
2136
  "video" to it.getPrivateProperty("video"),
2134
- "rfidSession" to it.getPrivateProperty("rfidSession")
2137
+ "rfidSession" to it.getPrivateProperty("rfidSession"),
2138
+ "mdlSession" to it.getPrivateProperty("mdlSession"),
2135
2139
  ).toJson()
2136
2140
  }
@@ -157,6 +157,11 @@ fun JSONObject.getStringOrNull(name: String): String? {
157
157
  return null
158
158
  }
159
159
 
160
+ fun JSONObject.getJSONArrayOrNull(name: String): JSONArray? {
161
+ if (has(name) && get(name).toString() != "null") return getJSONArray(name)
162
+ return null
163
+ }
164
+
160
165
  fun <T : Any> KClass<T>.constructor(vararg argTypes: KClass<*>): Constructor<T> {
161
166
  val types = mutableListOf<Class<*>>()
162
167
  for (argType in argTypes) types.add(argType.java)
@@ -2088,9 +2088,9 @@
2088
2088
  }
2089
2089
  },
2090
2090
  "node_modules/@eslint/eslintrc/node_modules/minimatch": {
2091
- "version": "3.1.2",
2092
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
2093
- "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
2091
+ "version": "3.1.5",
2092
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz",
2093
+ "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==",
2094
2094
  "dev": true,
2095
2095
  "license": "ISC",
2096
2096
  "dependencies": {
@@ -2155,9 +2155,9 @@
2155
2155
  }
2156
2156
  },
2157
2157
  "node_modules/@humanwhocodes/config-array/node_modules/minimatch": {
2158
- "version": "3.1.2",
2159
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
2160
- "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
2158
+ "version": "3.1.5",
2159
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz",
2160
+ "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==",
2161
2161
  "dev": true,
2162
2162
  "license": "ISC",
2163
2163
  "dependencies": {
@@ -3859,9 +3859,9 @@
3859
3859
  }
3860
3860
  },
3861
3861
  "node_modules/ajv": {
3862
- "version": "6.12.6",
3863
- "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
3864
- "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
3862
+ "version": "6.14.0",
3863
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.14.0.tgz",
3864
+ "integrity": "sha512-IWrosm/yrn43eiKqkfkHis7QioDleaXQHdDVPKg0FSwwd/DuvyX79TZnFOnYpB7dcsFAMmtFztZuXPDvSePkFw==",
3865
3865
  "dev": true,
3866
3866
  "license": "MIT",
3867
3867
  "dependencies": {
@@ -6191,9 +6191,9 @@
6191
6191
  }
6192
6192
  },
6193
6193
  "node_modules/eslint-plugin-react/node_modules/minimatch": {
6194
- "version": "3.1.2",
6195
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
6196
- "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
6194
+ "version": "3.1.5",
6195
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz",
6196
+ "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==",
6197
6197
  "dev": true,
6198
6198
  "license": "ISC",
6199
6199
  "dependencies": {
@@ -6317,9 +6317,9 @@
6317
6317
  }
6318
6318
  },
6319
6319
  "node_modules/eslint/node_modules/minimatch": {
6320
- "version": "3.1.2",
6321
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
6322
- "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
6320
+ "version": "3.1.5",
6321
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz",
6322
+ "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==",
6323
6323
  "dev": true,
6324
6324
  "license": "ISC",
6325
6325
  "dependencies": {
@@ -6544,9 +6544,9 @@
6544
6544
  "license": "MIT"
6545
6545
  },
6546
6546
  "node_modules/fast-xml-parser": {
6547
- "version": "4.5.3",
6548
- "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.5.3.tgz",
6549
- "integrity": "sha512-RKihhV+SHsIUGXObeVy9AXiBbFwkVk7Syp8XgwN5U3JV416+Gwp/GO9i0JYKmikykgz/UHRrrV4ROuZEo/T0ig==",
6547
+ "version": "4.5.4",
6548
+ "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.5.4.tgz",
6549
+ "integrity": "sha512-jE8ugADnYOBsu1uaoayVl1tVKAMNOXyjwvv2U6udEA2ORBhDooJDWoGxTkhd4Qn4yh59JVVt/pKXtjPwx9OguQ==",
6550
6550
  "devOptional": true,
6551
6551
  "funding": [
6552
6552
  {
@@ -6556,7 +6556,7 @@
6556
6556
  ],
6557
6557
  "license": "MIT",
6558
6558
  "dependencies": {
6559
- "strnum": "^1.1.1"
6559
+ "strnum": "^1.0.5"
6560
6560
  },
6561
6561
  "bin": {
6562
6562
  "fxparser": "src/cli/cli.js"
@@ -6684,9 +6684,9 @@
6684
6684
  }
6685
6685
  },
6686
6686
  "node_modules/flatted": {
6687
- "version": "3.3.3",
6688
- "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz",
6689
- "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==",
6687
+ "version": "3.4.2",
6688
+ "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.2.tgz",
6689
+ "integrity": "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==",
6690
6690
  "dev": true,
6691
6691
  "license": "ISC"
6692
6692
  },
@@ -6949,9 +6949,9 @@
6949
6949
  }
6950
6950
  },
6951
6951
  "node_modules/glob/node_modules/minimatch": {
6952
- "version": "3.1.2",
6953
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
6954
- "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
6952
+ "version": "3.1.5",
6953
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz",
6954
+ "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==",
6955
6955
  "license": "ISC",
6956
6956
  "dependencies": {
6957
6957
  "brace-expansion": "^1.1.7"
@@ -9855,13 +9855,13 @@
9855
9855
  }
9856
9856
  },
9857
9857
  "node_modules/minimatch": {
9858
- "version": "9.0.5",
9859
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz",
9860
- "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==",
9858
+ "version": "9.0.9",
9859
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz",
9860
+ "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==",
9861
9861
  "dev": true,
9862
9862
  "license": "ISC",
9863
9863
  "dependencies": {
9864
- "brace-expansion": "^2.0.1"
9864
+ "brace-expansion": "^2.0.2"
9865
9865
  },
9866
9866
  "engines": {
9867
9867
  "node": ">=16 || 14 >=14.17"
@@ -12149,9 +12149,9 @@
12149
12149
  }
12150
12150
  },
12151
12151
  "node_modules/test-exclude/node_modules/minimatch": {
12152
- "version": "3.1.2",
12153
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
12154
- "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
12152
+ "version": "3.1.5",
12153
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz",
12154
+ "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==",
12155
12155
  "license": "ISC",
12156
12156
  "dependencies": {
12157
12157
  "brace-expansion": "^1.1.7"
@@ -10,8 +10,8 @@
10
10
  "test": "jest"
11
11
  },
12
12
  "dependencies": {
13
- "@regulaforensics/react-native-document-reader-api": "9.3.477-nightly",
14
- "@regulaforensics/react-native-document-reader-core-fullauthrfid": "9.3.2112-nightly",
13
+ "@regulaforensics/react-native-document-reader-api": "9.3.478-beta",
14
+ "@regulaforensics/react-native-document-reader-core-fullauthrfid": "9.2.1883",
15
15
  "@rneui/base": "4.0.0-rc.7",
16
16
  "@rneui/themed": "4.0.0-rc.7",
17
17
  "react": "19.0.0",