@regulaforensics/document-reader 9.3.671-nightly → 9.3.674-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.
Files changed (60) hide show
  1. package/RNDocumentReader.podspec +2 -2
  2. package/android/build.gradle +2 -2
  3. package/android/cordova.gradle +2 -2
  4. package/android/src/main/java/com/regula/plugin/documentreader/Config.kt +137 -48
  5. package/android/src/main/java/com/regula/plugin/documentreader/JSONConstructor.kt +23 -19
  6. package/android/src/main/java/com/regula/plugin/documentreader/Main.kt +2 -2
  7. package/android/src/main/java/com/regula/plugin/documentreader/Utils.kt +5 -0
  8. package/examples/capacitor/package.json +1 -1
  9. package/examples/ionic/package.json +1 -1
  10. package/examples/react_native/package.json +1 -1
  11. package/ios/RGLWConfig.m +152 -41
  12. package/ios/RGLWJSONConstructor.m +5 -0
  13. package/package.json +1 -1
  14. package/plugin.xml +2 -2
  15. package/test/json.tsx +48 -2
  16. package/test/package-lock.json +1 -1
  17. package/test/test.tsx +5 -2
  18. package/www/capacitor/config/FinalizeConfig.js +4 -0
  19. package/www/capacitor/index.js +7 -5
  20. package/www/capacitor/params/customization/Customization.js +28 -18
  21. package/www/capacitor/params/customization/CustomizationColors.js +33 -1
  22. package/www/capacitor/params/customization/CustomizationContentModes.js +55 -0
  23. package/www/capacitor/params/customization/CustomizationFonts.js +38 -2
  24. package/www/capacitor/params/customization/CustomizationImages.js +145 -1
  25. package/www/capacitor/params/customization/CustomizationMatrices.js +39 -0
  26. package/www/capacitor/params/customization/CustomizationTimings.js +71 -0
  27. package/www/capacitor/params/process_params/BackendProcessingConfig.js +4 -0
  28. package/www/capacitor/params/process_params/ProcessParams.js +24 -0
  29. package/www/capacitor/results/visual_results/FieldType.js +2 -0
  30. package/www/capacitor/rfid/RFIDNotification.js +4 -1
  31. package/www/cordova.js +568 -140
  32. package/www/react-native/config/FinalizeConfig.js +4 -0
  33. package/www/react-native/index.js +7 -5
  34. package/www/react-native/params/customization/Customization.js +28 -18
  35. package/www/react-native/params/customization/CustomizationColors.js +33 -1
  36. package/www/react-native/params/customization/CustomizationContentModes.js +55 -0
  37. package/www/react-native/params/customization/CustomizationFonts.js +38 -2
  38. package/www/react-native/params/customization/CustomizationImages.js +145 -1
  39. package/www/react-native/params/customization/CustomizationMatrices.js +39 -0
  40. package/www/react-native/params/customization/CustomizationTimings.js +71 -0
  41. package/www/react-native/params/process_params/BackendProcessingConfig.js +4 -0
  42. package/www/react-native/params/process_params/ProcessParams.js +24 -0
  43. package/www/react-native/results/visual_results/FieldType.js +2 -0
  44. package/www/react-native/rfid/RFIDNotification.js +4 -1
  45. package/www/types/config/FinalizeConfig.d.ts +2 -1
  46. package/www/types/index.d.ts +7 -5
  47. package/www/types/params/customization/Customization.d.ts +37 -33
  48. package/www/types/params/customization/CustomizationColors.d.ts +4 -0
  49. package/www/types/params/customization/CustomizationContentModes.d.ts +41 -0
  50. package/www/types/params/customization/CustomizationFonts.d.ts +37 -2
  51. package/www/types/params/customization/CustomizationImages.d.ts +19 -0
  52. package/www/types/params/customization/CustomizationMatrices.d.ts +10 -0
  53. package/www/types/params/customization/CustomizationTimings.d.ts +14 -0
  54. package/www/types/params/process_params/BackendProcessingConfig.d.ts +2 -0
  55. package/www/types/params/process_params/ProcessParams.d.ts +9 -0
  56. package/www/types/results/visual_results/FieldType.d.ts +2 -0
  57. package/www/types/rfid/RFIDNotification.d.ts +4 -1
  58. package/www/capacitor/params/customization/Font.js +0 -36
  59. package/www/react-native/params/customization/Font.js +0 -36
  60. package/www/types/params/customization/Font.d.ts +0 -36
@@ -5,7 +5,7 @@ source = File.join(__dir__, 'ios')
5
5
 
6
6
  Pod::Spec.new do |s|
7
7
  s.name = 'RNDocumentReader'
8
- s.version = '9.3.671-nightly'
8
+ s.version = '9.3.674-rc'
9
9
  s.summary = package['description']
10
10
  s.license = package['license']
11
11
 
@@ -16,6 +16,6 @@ Pod::Spec.new do |s|
16
16
  s.ios.deployment_target = '13.0'
17
17
  s.source_files = 'ios/**/*.{h,m}'
18
18
  s.exclude_files = [ 'ios/CVDDocumentReader.h', 'ios/CVDDocumentReader.m' ]
19
- s.dependency 'DocumentReaderNightly', '9.3.6105'
19
+ s.dependency 'DocumentReaderStage', '9.3.6080'
20
20
  s.dependency 'React'
21
21
  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.12627'){
32
+ implementation('com.regula.documentreader:api:9.2.12629'){
33
33
  transitive = true
34
34
  }
35
35
  }
@@ -1,12 +1,12 @@
1
1
  repositories {
2
2
  maven {
3
- url "https://maven.regulaforensics.com/RegulaDocumentReader/Nightly"
3
+ url "https://maven.regulaforensics.com/RegulaDocumentReader/Stage"
4
4
  }
5
5
  }
6
6
 
7
7
  dependencies {
8
8
  //noinspection GradleDependency
9
- implementation('com.regula.documentreader:api:9.3.12627'){
9
+ implementation('com.regula.documentreader:api:9.2.12629'){
10
10
  transitive = true
11
11
  }
12
12
  }
@@ -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
  }
@@ -73,7 +73,7 @@ fun methodCall(method: String, callback: (Any?) -> Unit): Any = when (method) {
73
73
  "initialize" -> initialize(callback, args(0))
74
74
  "initializeReader" -> initialize(callback, args(0)) // deprecated
75
75
  "initializeReaderWithBleDeviceConfig" -> initializeReaderWithBleDeviceConfig(callback, args(0)) // deprecated
76
- "deinitialize" -> deinitialize()
76
+ "deinitializeReader" -> deinitializeReader()
77
77
  "prepareDatabase" -> prepareDatabase(callback, args(0))
78
78
  "removeDatabase" -> removeDatabase(callback)
79
79
  "runAutoUpdate" -> runAutoUpdate(callback, args(0))
@@ -205,7 +205,7 @@ fun initialize(callback: Callback, config: JSONObject) =
205
205
  // deprecated
206
206
  fun initializeReaderWithBleDeviceConfig(callback: Callback, config: JSONObject) = Instance().initializeReader(context, initBleDeviceConfigFromJSON(config), initCompletion(callback))
207
207
 
208
- fun deinitialize() = Instance().deinitializeReader()
208
+ fun deinitializeReader() = Instance().deinitializeReader()
209
209
 
210
210
  fun prepareDatabase(callback: Callback, databaseID: String) = Instance().prepareDatabase(
211
211
  context,
@@ -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)
@@ -6,7 +6,7 @@
6
6
  "android": "scripts/android.sh"
7
7
  },
8
8
  "dependencies": {
9
- "@regulaforensics/document-reader": "9.3.671-nightly",
9
+ "@regulaforensics/document-reader": "9.3.674-rc",
10
10
  "@regulaforensics/document-reader-core-fullauthrfid": "9.2.1513",
11
11
  "@regulaforensics/document-reader-btdevice": "9.1.35",
12
12
  "@awesome-cordova-plugins/file": "^8.1.0",
@@ -18,7 +18,7 @@
18
18
  "@ionic/cordova-builders": "^12.3.0",
19
19
  "@awesome-cordova-plugins/camera": "^8.1.0",
20
20
  "@awesome-cordova-plugins/file": "^8.1.0",
21
- "@regulaforensics/document-reader": "9.3.671-nightly",
21
+ "@regulaforensics/document-reader": "9.3.674-rc",
22
22
  "@regulaforensics/document-reader-core-fullauthrfid": "9.2.1513",
23
23
  "@regulaforensics/document-reader-btdevice": "9.1.35",
24
24
  "cordova-android": "^14.0.1",
@@ -8,7 +8,7 @@
8
8
  "start": "expo start"
9
9
  },
10
10
  "dependencies": {
11
- "@regulaforensics/document-reader": "9.3.671-nightly",
11
+ "@regulaforensics/document-reader": "9.3.674-rc",
12
12
  "@regulaforensics/document-reader-core-fullauthrfid": "9.2.1513",
13
13
  "@regulaforensics/document-reader-btdevice": "9.1.35",
14
14
  "react-native": "^0.81.4",