@regulaforensics/document-reader 8.2.186-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.
Files changed (439) hide show
  1. package/README.md +18 -0
  2. package/RNDocumentReader.podspec +21 -0
  3. package/android/CVDDocumentReader.kt +74 -0
  4. package/android/build.gradle +36 -0
  5. package/android/cordova.gradle +12 -0
  6. package/android/src/main/java/com/regula/plugin/documentreader/BluetoothUtil.kt +160 -0
  7. package/android/src/main/java/com/regula/plugin/documentreader/Config.kt +826 -0
  8. package/android/src/main/java/com/regula/plugin/documentreader/JSONConstructor.kt +1795 -0
  9. package/android/src/main/java/com/regula/plugin/documentreader/Main.kt +573 -0
  10. package/android/src/main/java/com/regula/plugin/documentreader/RNDocumentReaderModule.kt +100 -0
  11. package/android/src/main/java/com/regula/plugin/documentreader/Utils.kt +181 -0
  12. package/examples/capacitor/README.md +12 -0
  13. package/examples/capacitor/android/app/build.gradle +50 -0
  14. package/examples/capacitor/android/app/capacitor.build.gradle +22 -0
  15. package/examples/capacitor/android/app/proguard-rules.pro +21 -0
  16. package/examples/capacitor/android/app/src/main/AndroidManifest.xml +27 -0
  17. package/examples/capacitor/android/app/src/main/assets/Regula/.gitkeep +0 -0
  18. package/examples/capacitor/android/app/src/main/java/com/regula/dr/fullauthrfid/MainActivity.java +5 -0
  19. package/examples/capacitor/android/app/src/main/res/drawable/ic_launcher.png +0 -0
  20. package/examples/capacitor/android/app/src/main/res/drawable/splash.png +0 -0
  21. package/examples/capacitor/android/app/src/main/res/layout/activity_main.xml +12 -0
  22. package/examples/capacitor/android/app/src/main/res/values/strings.xml +7 -0
  23. package/examples/capacitor/android/app/src/main/res/values/styles.xml +22 -0
  24. package/examples/capacitor/android/build.gradle +30 -0
  25. package/examples/capacitor/android/capacitor.settings.gradle +15 -0
  26. package/examples/capacitor/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  27. package/examples/capacitor/android/gradle/wrapper/gradle-wrapper.properties +7 -0
  28. package/examples/capacitor/android/gradle.properties +22 -0
  29. package/examples/capacitor/android/gradlew +252 -0
  30. package/examples/capacitor/android/gradlew.bat +94 -0
  31. package/examples/capacitor/android/settings.gradle +5 -0
  32. package/examples/capacitor/android/variables.gradle +16 -0
  33. package/examples/capacitor/index.html +10 -0
  34. package/examples/capacitor/ionic.config.json +7 -0
  35. package/examples/capacitor/ios/App/App/App.entitlements +5 -0
  36. package/examples/capacitor/ios/App/App/AppDelegate.swift +49 -0
  37. package/examples/capacitor/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png +0 -0
  38. package/examples/capacitor/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json +14 -0
  39. package/examples/capacitor/ios/App/App/Assets.xcassets/Contents.json +6 -0
  40. package/examples/capacitor/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json +23 -0
  41. package/examples/capacitor/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png +0 -0
  42. package/examples/capacitor/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png +0 -0
  43. package/examples/capacitor/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png +0 -0
  44. package/examples/capacitor/ios/App/App/Base.lproj/LaunchScreen.storyboard +32 -0
  45. package/examples/capacitor/ios/App/App/Base.lproj/Main.storyboard +19 -0
  46. package/examples/capacitor/ios/App/App/Info.plist +53 -0
  47. package/examples/capacitor/ios/App/App.xcodeproj/project.pbxproj +414 -0
  48. package/examples/capacitor/ios/App/App.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  49. package/examples/capacitor/ios/App/App.xcworkspace/contents.xcworkspacedata +10 -0
  50. package/examples/capacitor/ios/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  51. package/examples/capacitor/ios/App/Podfile +26 -0
  52. package/examples/capacitor/ios/App/Podfile.lock +56 -0
  53. package/examples/capacitor/package-lock.json +3467 -0
  54. package/examples/capacitor/package.json +29 -0
  55. package/examples/capacitor/public/assets/.gitkeep +0 -0
  56. package/examples/capacitor/public/images/document.png +0 -0
  57. package/examples/capacitor/public/images/portrait.png +0 -0
  58. package/examples/capacitor/scripts/android.sh +9 -0
  59. package/examples/capacitor/scripts/ios.sh +8 -0
  60. package/examples/capacitor/scripts/setup.sh +6 -0
  61. package/examples/capacitor/src/extra/bt_device.tsx +32 -0
  62. package/examples/capacitor/src/extra/custom_rfid.tsx +74 -0
  63. package/examples/capacitor/src/main.css +131 -0
  64. package/examples/capacitor/src/main.html +41 -0
  65. package/examples/capacitor/src/main.tsx +175 -0
  66. package/examples/capacitor/tsconfig.json +5 -0
  67. package/examples/capacitor/vite.config.ts +17 -0
  68. package/examples/cordova/.vscode/launch.json +28 -0
  69. package/examples/cordova/.vscode/typings/cordova/cordova.d.ts +80 -0
  70. package/examples/cordova/README.md +12 -0
  71. package/examples/cordova/config.xml +29 -0
  72. package/examples/cordova/package-lock.json +1314 -0
  73. package/examples/cordova/package.json +32 -0
  74. package/examples/cordova/scripts/android.sh +8 -0
  75. package/examples/cordova/scripts/ios.sh +8 -0
  76. package/examples/cordova/scripts/setup.sh +8 -0
  77. package/examples/cordova/www/images/document.png +0 -0
  78. package/examples/cordova/www/images/logo.png +0 -0
  79. package/examples/cordova/www/images/portrait.png +0 -0
  80. package/examples/cordova/www/index.html +21 -0
  81. package/examples/cordova/www/src/main.css +130 -0
  82. package/examples/cordova/www/src/main.html +63 -0
  83. package/examples/cordova/www/src/main.js +50 -0
  84. package/examples/ionic/README.md +12 -0
  85. package/examples/ionic/angular.json +39 -0
  86. package/examples/ionic/config.xml +28 -0
  87. package/examples/ionic/index.html +19 -0
  88. package/examples/ionic/index.ts +17 -0
  89. package/examples/ionic/ionic.config.json +7 -0
  90. package/examples/ionic/package-lock.json +16559 -0
  91. package/examples/ionic/package.json +47 -0
  92. package/examples/ionic/scripts/android.sh +8 -0
  93. package/examples/ionic/scripts/ios.sh +8 -0
  94. package/examples/ionic/scripts/setup.sh +8 -0
  95. package/examples/ionic/src/assets/.gitkeep +0 -0
  96. package/examples/ionic/src/images/document.png +0 -0
  97. package/examples/ionic/src/images/icon.png +0 -0
  98. package/examples/ionic/src/images/portrait.png +0 -0
  99. package/examples/ionic/src/main.css +130 -0
  100. package/examples/ionic/src/main.html +63 -0
  101. package/examples/ionic/src/main.ts +66 -0
  102. package/examples/ionic/tsconfig.json +12 -0
  103. package/examples/react_native/README.md +12 -0
  104. package/examples/react_native/app.config.ts +53 -0
  105. package/examples/react_native/assets/.gitkeep +0 -0
  106. package/examples/react_native/images/document.png +0 -0
  107. package/examples/react_native/images/icon/adaptive-icon.png +0 -0
  108. package/examples/react_native/images/icon/icon.png +0 -0
  109. package/examples/react_native/images/portrait.png +0 -0
  110. package/examples/react_native/index.html +11 -0
  111. package/examples/react_native/index.tsx +52 -0
  112. package/examples/react_native/metro.config.js +7 -0
  113. package/examples/react_native/package-lock.json +9254 -0
  114. package/examples/react_native/package.json +27 -0
  115. package/examples/react_native/scripts/android.sh +12 -0
  116. package/examples/react_native/scripts/ios.sh +11 -0
  117. package/examples/react_native/scripts/setup.sh +8 -0
  118. package/examples/react_native/src/main.css +130 -0
  119. package/examples/react_native/src/main.html +63 -0
  120. package/examples/react_native/src/main.tsx +50 -0
  121. package/ios/CVDDocumentReader.h +7 -0
  122. package/ios/CVDDocumentReader.m +39 -0
  123. package/ios/RGLWConfig.h +42 -0
  124. package/ios/RGLWConfig.m +1398 -0
  125. package/ios/RGLWJSONConstructor.h +185 -0
  126. package/ios/RGLWJSONConstructor.m +2379 -0
  127. package/ios/RGLWMain.h +36 -0
  128. package/ios/RGLWMain.m +610 -0
  129. package/ios/RNDocumentReader.h +8 -0
  130. package/ios/RNDocumentReader.m +49 -0
  131. package/package.json +36 -0
  132. package/plugin.xml +51 -0
  133. package/www/capacitor/config/InitConfig.js +25 -0
  134. package/www/capacitor/config/OnlineProcessingConfig.js +41 -0
  135. package/www/capacitor/config/RFIDConfig.js +31 -0
  136. package/www/capacitor/config/RecognizeConfig.js +103 -0
  137. package/www/capacitor/config/ScannerConfig.js +38 -0
  138. package/www/capacitor/index.js +486 -0
  139. package/www/capacitor/info/DocReaderException.js +57 -0
  140. package/www/capacitor/info/DocReaderScenario.js +71 -0
  141. package/www/capacitor/info/DocReaderVersion.js +23 -0
  142. package/www/capacitor/info/DocumentsDatabase.js +27 -0
  143. package/www/capacitor/info/License.js +22 -0
  144. package/www/capacitor/info/PrepareProgress.js +23 -0
  145. package/www/capacitor/info/RFIDException.js +19 -0
  146. package/www/capacitor/internal/bridge.js +98 -0
  147. package/www/capacitor/internal/cordova.js +17 -0
  148. package/www/capacitor/params/Functionality.js +303 -0
  149. package/www/capacitor/params/customization/Customization.js +550 -0
  150. package/www/capacitor/params/customization/CustomizationColors.js +74 -0
  151. package/www/capacitor/params/customization/CustomizationFonts.js +40 -0
  152. package/www/capacitor/params/customization/CustomizationImages.js +25 -0
  153. package/www/capacitor/params/customization/Font.js +28 -0
  154. package/www/capacitor/params/process_params/AuthenticityParams.js +129 -0
  155. package/www/capacitor/params/process_params/BackendProcessingConfig.js +25 -0
  156. package/www/capacitor/params/process_params/FaceApiParams.js +38 -0
  157. package/www/capacitor/params/process_params/FaceApiSearchParams.js +21 -0
  158. package/www/capacitor/params/process_params/GlaresCheckParams.js +18 -0
  159. package/www/capacitor/params/process_params/ImageQA.js +97 -0
  160. package/www/capacitor/params/process_params/LivenessParams.js +67 -0
  161. package/www/capacitor/params/process_params/ProcessParams.js +570 -0
  162. package/www/capacitor/params/process_params/RfidParams.js +15 -0
  163. package/www/capacitor/params/rfid_scenario/DTCDataGroups.js +53 -0
  164. package/www/capacitor/params/rfid_scenario/EDLDataGroups.js +116 -0
  165. package/www/capacitor/params/rfid_scenario/EIDDataGroups.js +165 -0
  166. package/www/capacitor/params/rfid_scenario/EPassportDataGroups.js +130 -0
  167. package/www/capacitor/params/rfid_scenario/RFIDScenario.js +493 -0
  168. package/www/capacitor/results/DocumentType.js +285 -0
  169. package/www/capacitor/results/Position.js +60 -0
  170. package/www/capacitor/results/Results.js +318 -0
  171. package/www/capacitor/results/TransactionInfo.js +16 -0
  172. package/www/capacitor/results/authenticity/Authenticity.js +23 -0
  173. package/www/capacitor/results/authenticity/AuthenticityCheck.js +33 -0
  174. package/www/capacitor/results/authenticity/AuthenticityElement.js +27 -0
  175. package/www/capacitor/results/authenticity/AuthenticityResult.js +26 -0
  176. package/www/capacitor/results/authenticity/CheckDiagnose.js +124 -0
  177. package/www/capacitor/results/authenticity/SecurityFeatureType.js +59 -0
  178. package/www/capacitor/results/barcode/BarcodeField.js +24 -0
  179. package/www/capacitor/results/barcode/BarcodeResult.js +24 -0
  180. package/www/capacitor/results/barcode/BarcodeStatus.js +33 -0
  181. package/www/capacitor/results/barcode/BarcodeType.js +21 -0
  182. package/www/capacitor/results/barcode/PDF417Info.js +16 -0
  183. package/www/capacitor/results/image_quality/ImageQuality.js +31 -0
  184. package/www/capacitor/results/image_quality/ImageQualityCheckType.js +19 -0
  185. package/www/capacitor/results/image_quality/ImageQualityGroup.js +30 -0
  186. package/www/capacitor/results/rfid/AccessControlProcedureType.js +21 -0
  187. package/www/capacitor/results/rfid/Application.js +47 -0
  188. package/www/capacitor/results/rfid/Attribute.js +16 -0
  189. package/www/capacitor/results/rfid/Authority.js +28 -0
  190. package/www/capacitor/results/rfid/CardProperties.js +38 -0
  191. package/www/capacitor/results/rfid/CertificateChain.js +51 -0
  192. package/www/capacitor/results/rfid/CertificateData.js +14 -0
  193. package/www/capacitor/results/rfid/DataField.js +16 -0
  194. package/www/capacitor/results/rfid/Extension.js +14 -0
  195. package/www/capacitor/results/rfid/File.js +39 -0
  196. package/www/capacitor/results/rfid/FileData.js +18 -0
  197. package/www/capacitor/results/rfid/RFIDAccessControlProcedureType.js +10 -0
  198. package/www/capacitor/results/rfid/RFIDCertificateType.js +13 -0
  199. package/www/capacitor/results/rfid/RFIDDataFileType.js +98 -0
  200. package/www/capacitor/results/rfid/RFIDSessionData.js +76 -0
  201. package/www/capacitor/results/rfid/RFIDValidity.js +16 -0
  202. package/www/capacitor/results/rfid/RFIDValue.js +20 -0
  203. package/www/capacitor/results/rfid/SecurityObject.js +31 -0
  204. package/www/capacitor/results/rfid/SecurityObjectCertificates.js +14 -0
  205. package/www/capacitor/results/rfid/SignerInfo.js +57 -0
  206. package/www/capacitor/results/status/CheckResult.js +5 -0
  207. package/www/capacitor/results/status/OpticalStatus.js +30 -0
  208. package/www/capacitor/results/status/RFIDStatus.js +26 -0
  209. package/www/capacitor/results/status/ResultsStatus.js +28 -0
  210. package/www/capacitor/results/visible_digital_seals/BytesData.js +18 -0
  211. package/www/capacitor/results/visible_digital_seals/LDSParsingErrorCodes.js +134 -0
  212. package/www/capacitor/results/visible_digital_seals/LDSParsingNotificationCodes.js +232 -0
  213. package/www/capacitor/results/visible_digital_seals/VDSNCData.js +40 -0
  214. package/www/capacitor/results/visual_results/Comparison.js +19 -0
  215. package/www/capacitor/results/visual_results/FieldType.js +658 -0
  216. package/www/capacitor/results/visual_results/GraphicField.js +33 -0
  217. package/www/capacitor/results/visual_results/GraphicFieldType.js +25 -0
  218. package/www/capacitor/results/visual_results/GraphicResult.js +22 -0
  219. package/www/capacitor/results/visual_results/LCID.js +174 -0
  220. package/www/capacitor/results/visual_results/Lights.js +11 -0
  221. package/www/capacitor/results/visual_results/RFIDOrigin.js +18 -0
  222. package/www/capacitor/results/visual_results/Rect.js +18 -0
  223. package/www/capacitor/results/visual_results/Symbol.js +18 -0
  224. package/www/capacitor/results/visual_results/TextField.js +68 -0
  225. package/www/capacitor/results/visual_results/TextResult.js +42 -0
  226. package/www/capacitor/results/visual_results/TextSource.js +19 -0
  227. package/www/capacitor/results/visual_results/Validity.js +17 -0
  228. package/www/capacitor/results/visual_results/Value.js +39 -0
  229. package/www/capacitor/rfid/PAAttribute.js +17 -0
  230. package/www/capacitor/rfid/PAResourcesIssuer.js +27 -0
  231. package/www/capacitor/rfid/PKDCertificate.js +54 -0
  232. package/www/capacitor/rfid/RFIDErrorCodes.js +123 -0
  233. package/www/capacitor/rfid/RFIDNotification.js +60 -0
  234. package/www/capacitor/rfid/TAChallenge.js +23 -0
  235. package/www/capacitor/rfid/TccParams.js +24 -0
  236. package/www/cordova.js +9816 -0
  237. package/www/react-native/config/InitConfig.js +25 -0
  238. package/www/react-native/config/OnlineProcessingConfig.js +41 -0
  239. package/www/react-native/config/RFIDConfig.js +31 -0
  240. package/www/react-native/config/RecognizeConfig.js +103 -0
  241. package/www/react-native/config/ScannerConfig.js +38 -0
  242. package/www/react-native/index.js +486 -0
  243. package/www/react-native/info/DocReaderException.js +57 -0
  244. package/www/react-native/info/DocReaderScenario.js +71 -0
  245. package/www/react-native/info/DocReaderVersion.js +23 -0
  246. package/www/react-native/info/DocumentsDatabase.js +27 -0
  247. package/www/react-native/info/License.js +22 -0
  248. package/www/react-native/info/PrepareProgress.js +23 -0
  249. package/www/react-native/info/RFIDException.js +19 -0
  250. package/www/react-native/internal/bridge.js +98 -0
  251. package/www/react-native/params/Functionality.js +303 -0
  252. package/www/react-native/params/customization/Customization.js +550 -0
  253. package/www/react-native/params/customization/CustomizationColors.js +74 -0
  254. package/www/react-native/params/customization/CustomizationFonts.js +40 -0
  255. package/www/react-native/params/customization/CustomizationImages.js +25 -0
  256. package/www/react-native/params/customization/Font.js +28 -0
  257. package/www/react-native/params/process_params/AuthenticityParams.js +129 -0
  258. package/www/react-native/params/process_params/BackendProcessingConfig.js +25 -0
  259. package/www/react-native/params/process_params/FaceApiParams.js +38 -0
  260. package/www/react-native/params/process_params/FaceApiSearchParams.js +21 -0
  261. package/www/react-native/params/process_params/GlaresCheckParams.js +18 -0
  262. package/www/react-native/params/process_params/ImageQA.js +97 -0
  263. package/www/react-native/params/process_params/LivenessParams.js +67 -0
  264. package/www/react-native/params/process_params/ProcessParams.js +570 -0
  265. package/www/react-native/params/process_params/RfidParams.js +15 -0
  266. package/www/react-native/params/rfid_scenario/DTCDataGroups.js +53 -0
  267. package/www/react-native/params/rfid_scenario/EDLDataGroups.js +116 -0
  268. package/www/react-native/params/rfid_scenario/EIDDataGroups.js +165 -0
  269. package/www/react-native/params/rfid_scenario/EPassportDataGroups.js +130 -0
  270. package/www/react-native/params/rfid_scenario/RFIDScenario.js +493 -0
  271. package/www/react-native/results/DocumentType.js +285 -0
  272. package/www/react-native/results/Position.js +60 -0
  273. package/www/react-native/results/Results.js +318 -0
  274. package/www/react-native/results/TransactionInfo.js +16 -0
  275. package/www/react-native/results/authenticity/Authenticity.js +23 -0
  276. package/www/react-native/results/authenticity/AuthenticityCheck.js +33 -0
  277. package/www/react-native/results/authenticity/AuthenticityElement.js +27 -0
  278. package/www/react-native/results/authenticity/AuthenticityResult.js +26 -0
  279. package/www/react-native/results/authenticity/CheckDiagnose.js +124 -0
  280. package/www/react-native/results/authenticity/SecurityFeatureType.js +59 -0
  281. package/www/react-native/results/barcode/BarcodeField.js +24 -0
  282. package/www/react-native/results/barcode/BarcodeResult.js +24 -0
  283. package/www/react-native/results/barcode/BarcodeStatus.js +33 -0
  284. package/www/react-native/results/barcode/BarcodeType.js +21 -0
  285. package/www/react-native/results/barcode/PDF417Info.js +16 -0
  286. package/www/react-native/results/image_quality/ImageQuality.js +31 -0
  287. package/www/react-native/results/image_quality/ImageQualityCheckType.js +19 -0
  288. package/www/react-native/results/image_quality/ImageQualityGroup.js +30 -0
  289. package/www/react-native/results/rfid/AccessControlProcedureType.js +21 -0
  290. package/www/react-native/results/rfid/Application.js +47 -0
  291. package/www/react-native/results/rfid/Attribute.js +16 -0
  292. package/www/react-native/results/rfid/Authority.js +28 -0
  293. package/www/react-native/results/rfid/CardProperties.js +38 -0
  294. package/www/react-native/results/rfid/CertificateChain.js +51 -0
  295. package/www/react-native/results/rfid/CertificateData.js +14 -0
  296. package/www/react-native/results/rfid/DataField.js +16 -0
  297. package/www/react-native/results/rfid/Extension.js +14 -0
  298. package/www/react-native/results/rfid/File.js +39 -0
  299. package/www/react-native/results/rfid/FileData.js +18 -0
  300. package/www/react-native/results/rfid/RFIDAccessControlProcedureType.js +10 -0
  301. package/www/react-native/results/rfid/RFIDCertificateType.js +13 -0
  302. package/www/react-native/results/rfid/RFIDDataFileType.js +98 -0
  303. package/www/react-native/results/rfid/RFIDSessionData.js +76 -0
  304. package/www/react-native/results/rfid/RFIDValidity.js +16 -0
  305. package/www/react-native/results/rfid/RFIDValue.js +20 -0
  306. package/www/react-native/results/rfid/SecurityObject.js +31 -0
  307. package/www/react-native/results/rfid/SecurityObjectCertificates.js +14 -0
  308. package/www/react-native/results/rfid/SignerInfo.js +57 -0
  309. package/www/react-native/results/status/CheckResult.js +5 -0
  310. package/www/react-native/results/status/OpticalStatus.js +30 -0
  311. package/www/react-native/results/status/RFIDStatus.js +26 -0
  312. package/www/react-native/results/status/ResultsStatus.js +28 -0
  313. package/www/react-native/results/visible_digital_seals/BytesData.js +18 -0
  314. package/www/react-native/results/visible_digital_seals/LDSParsingErrorCodes.js +134 -0
  315. package/www/react-native/results/visible_digital_seals/LDSParsingNotificationCodes.js +232 -0
  316. package/www/react-native/results/visible_digital_seals/VDSNCData.js +40 -0
  317. package/www/react-native/results/visual_results/Comparison.js +19 -0
  318. package/www/react-native/results/visual_results/FieldType.js +658 -0
  319. package/www/react-native/results/visual_results/GraphicField.js +33 -0
  320. package/www/react-native/results/visual_results/GraphicFieldType.js +25 -0
  321. package/www/react-native/results/visual_results/GraphicResult.js +22 -0
  322. package/www/react-native/results/visual_results/LCID.js +174 -0
  323. package/www/react-native/results/visual_results/Lights.js +11 -0
  324. package/www/react-native/results/visual_results/RFIDOrigin.js +18 -0
  325. package/www/react-native/results/visual_results/Rect.js +18 -0
  326. package/www/react-native/results/visual_results/Symbol.js +18 -0
  327. package/www/react-native/results/visual_results/TextField.js +68 -0
  328. package/www/react-native/results/visual_results/TextResult.js +42 -0
  329. package/www/react-native/results/visual_results/TextSource.js +19 -0
  330. package/www/react-native/results/visual_results/Validity.js +17 -0
  331. package/www/react-native/results/visual_results/Value.js +39 -0
  332. package/www/react-native/rfid/PAAttribute.js +17 -0
  333. package/www/react-native/rfid/PAResourcesIssuer.js +27 -0
  334. package/www/react-native/rfid/PKDCertificate.js +54 -0
  335. package/www/react-native/rfid/RFIDErrorCodes.js +123 -0
  336. package/www/react-native/rfid/RFIDNotification.js +60 -0
  337. package/www/react-native/rfid/TAChallenge.js +23 -0
  338. package/www/react-native/rfid/TccParams.js +24 -0
  339. package/www/types/config/InitConfig.d.ts +63 -0
  340. package/www/types/config/OnlineProcessingConfig.d.ts +22 -0
  341. package/www/types/config/RFIDConfig.d.ts +131 -0
  342. package/www/types/config/RecognizeConfig.d.ts +119 -0
  343. package/www/types/config/ScannerConfig.d.ts +54 -0
  344. package/www/types/index.d.ts +421 -0
  345. package/www/types/info/DocReaderException.d.ts +79 -0
  346. package/www/types/info/DocReaderScenario.d.ts +90 -0
  347. package/www/types/info/DocReaderVersion.d.ts +28 -0
  348. package/www/types/info/DocumentsDatabase.d.ts +42 -0
  349. package/www/types/info/License.d.ts +23 -0
  350. package/www/types/info/PrepareProgress.d.ts +15 -0
  351. package/www/types/info/RFIDException.d.ts +8 -0
  352. package/www/types/params/Functionality.d.ts +316 -0
  353. package/www/types/params/customization/Customization.d.ts +558 -0
  354. package/www/types/params/customization/CustomizationColors.d.ts +16 -0
  355. package/www/types/params/customization/CustomizationFonts.d.ts +13 -0
  356. package/www/types/params/customization/CustomizationImages.d.ts +12 -0
  357. package/www/types/params/customization/Font.d.ts +36 -0
  358. package/www/types/params/process_params/AuthenticityParams.d.ts +30 -0
  359. package/www/types/params/process_params/BackendProcessingConfig.d.ts +25 -0
  360. package/www/types/params/process_params/FaceApiParams.d.ts +68 -0
  361. package/www/types/params/process_params/FaceApiSearchParams.d.ts +35 -0
  362. package/www/types/params/process_params/GlaresCheckParams.d.ts +26 -0
  363. package/www/types/params/process_params/ImageQA.d.ts +79 -0
  364. package/www/types/params/process_params/LivenessParams.d.ts +20 -0
  365. package/www/types/params/process_params/ProcessParams.d.ts +465 -0
  366. package/www/types/params/process_params/RfidParams.d.ts +19 -0
  367. package/www/types/params/rfid_scenario/DTCDataGroups.d.ts +13 -0
  368. package/www/types/params/rfid_scenario/EDLDataGroups.d.ts +22 -0
  369. package/www/types/params/rfid_scenario/EIDDataGroups.d.ts +29 -0
  370. package/www/types/params/rfid_scenario/EPassportDataGroups.d.ts +24 -0
  371. package/www/types/params/rfid_scenario/RFIDScenario.d.ts +167 -0
  372. package/www/types/results/DocumentType.d.ts +525 -0
  373. package/www/types/results/Position.d.ts +50 -0
  374. package/www/types/results/Results.d.ts +283 -0
  375. package/www/types/results/TransactionInfo.d.ts +9 -0
  376. package/www/types/results/authenticity/Authenticity.d.ts +67 -0
  377. package/www/types/results/authenticity/AuthenticityCheck.d.ts +23 -0
  378. package/www/types/results/authenticity/AuthenticityElement.d.ts +26 -0
  379. package/www/types/results/authenticity/AuthenticityResult.d.ts +16 -0
  380. package/www/types/results/authenticity/CheckDiagnose.d.ts +229 -0
  381. package/www/types/results/authenticity/SecurityFeatureType.d.ts +100 -0
  382. package/www/types/results/barcode/BarcodeField.d.ts +37 -0
  383. package/www/types/results/barcode/BarcodeResult.d.ts +14 -0
  384. package/www/types/results/barcode/BarcodeStatus.d.ts +66 -0
  385. package/www/types/results/barcode/BarcodeType.d.ts +45 -0
  386. package/www/types/results/barcode/PDF417Info.d.ts +15 -0
  387. package/www/types/results/image_quality/ImageQuality.d.ts +18 -0
  388. package/www/types/results/image_quality/ImageQualityCheckType.d.ts +30 -0
  389. package/www/types/results/image_quality/ImageQualityGroup.d.ts +17 -0
  390. package/www/types/results/rfid/AccessControlProcedureType.d.ts +21 -0
  391. package/www/types/results/rfid/Application.d.ts +44 -0
  392. package/www/types/results/rfid/Attribute.d.ts +9 -0
  393. package/www/types/results/rfid/Authority.d.ts +11 -0
  394. package/www/types/results/rfid/CardProperties.d.ts +48 -0
  395. package/www/types/results/rfid/CertificateChain.d.ts +28 -0
  396. package/www/types/results/rfid/CertificateData.d.ts +7 -0
  397. package/www/types/results/rfid/DataField.d.ts +9 -0
  398. package/www/types/results/rfid/Extension.d.ts +7 -0
  399. package/www/types/results/rfid/File.d.ts +22 -0
  400. package/www/types/results/rfid/FileData.d.ts +9 -0
  401. package/www/types/results/rfid/RFIDAccessControlProcedureType.d.ts +18 -0
  402. package/www/types/results/rfid/RFIDCertificateType.d.ts +13 -0
  403. package/www/types/results/rfid/RFIDDataFileType.d.ts +101 -0
  404. package/www/types/results/rfid/RFIDSessionData.d.ts +48 -0
  405. package/www/types/results/rfid/RFIDValidity.d.ts +9 -0
  406. package/www/types/results/rfid/RFIDValue.d.ts +10 -0
  407. package/www/types/results/rfid/SecurityObject.d.ts +28 -0
  408. package/www/types/results/rfid/SecurityObjectCertificates.d.ts +8 -0
  409. package/www/types/results/rfid/SignerInfo.d.ts +41 -0
  410. package/www/types/results/status/CheckResult.d.ts +8 -0
  411. package/www/types/results/status/OpticalStatus.d.ts +29 -0
  412. package/www/types/results/status/RFIDStatus.d.ts +22 -0
  413. package/www/types/results/status/ResultsStatus.d.ts +24 -0
  414. package/www/types/results/visible_digital_seals/BytesData.d.ts +9 -0
  415. package/www/types/results/visible_digital_seals/LDSParsingErrorCodes.d.ts +132 -0
  416. package/www/types/results/visible_digital_seals/LDSParsingNotificationCodes.d.ts +230 -0
  417. package/www/types/results/visible_digital_seals/VDSNCData.d.ts +35 -0
  418. package/www/types/results/visual_results/Comparison.d.ts +15 -0
  419. package/www/types/results/visual_results/FieldType.d.ts +1310 -0
  420. package/www/types/results/visual_results/GraphicField.d.ts +29 -0
  421. package/www/types/results/visual_results/GraphicFieldType.d.ts +52 -0
  422. package/www/types/results/visual_results/GraphicResult.d.ts +10 -0
  423. package/www/types/results/visual_results/LCID.d.ts +173 -0
  424. package/www/types/results/visual_results/Lights.d.ts +23 -0
  425. package/www/types/results/visual_results/RFIDOrigin.d.ts +10 -0
  426. package/www/types/results/visual_results/Rect.d.ts +9 -0
  427. package/www/types/results/visual_results/Symbol.d.ts +14 -0
  428. package/www/types/results/visual_results/TextField.d.ts +40 -0
  429. package/www/types/results/visual_results/TextResult.d.ts +23 -0
  430. package/www/types/results/visual_results/TextSource.d.ts +15 -0
  431. package/www/types/results/visual_results/Validity.d.ts +13 -0
  432. package/www/types/results/visual_results/Value.d.ts +27 -0
  433. package/www/types/rfid/PAAttribute.d.ts +4 -0
  434. package/www/types/rfid/PAResourcesIssuer.d.ts +7 -0
  435. package/www/types/rfid/PKDCertificate.d.ts +34 -0
  436. package/www/types/rfid/RFIDErrorCodes.d.ts +121 -0
  437. package/www/types/rfid/RFIDNotification.d.ts +153 -0
  438. package/www/types/rfid/TAChallenge.d.ts +7 -0
  439. package/www/types/rfid/TccParams.d.ts +25 -0
@@ -0,0 +1,1398 @@
1
+ #import <Foundation/Foundation.h>
2
+ #import "RGLWConfig.h"
3
+
4
+ @implementation RGLWConfig
5
+
6
+ +(void)setFunctionality:(NSDictionary*)options :(RGLFunctionality*)functionality {
7
+ // Boolean
8
+ if([options valueForKey:@"showTorchButton"] != nil)
9
+ functionality.showTorchButton = [[options valueForKey:@"showTorchButton"] boolValue];
10
+ if([options valueForKey:@"showCloseButton"] != nil)
11
+ functionality.showCloseButton = [[options valueForKey:@"showCloseButton"] boolValue];
12
+ if([options valueForKey:@"videoCaptureMotionControl"] != nil)
13
+ functionality.videoCaptureMotionControl = [[options valueForKey:@"videoCaptureMotionControl"] boolValue];
14
+ if([options valueForKey:@"showCaptureButton"] != nil)
15
+ functionality.showCaptureButton = [[options valueForKey:@"showCaptureButton"] boolValue];
16
+ if([options valueForKey:@"showChangeFrameButton"] != nil)
17
+ functionality.showChangeFrameButton = [[options valueForKey:@"showChangeFrameButton"] boolValue];
18
+ if([options valueForKey:@"showSkipNextPageButton"] != nil)
19
+ functionality.showSkipNextPageButton = [[options valueForKey:@"showSkipNextPageButton"] boolValue];
20
+ if([options valueForKey:@"useAuthenticator"] != nil)
21
+ functionality.useAuthenticator = [[options valueForKey:@"useAuthenticator"] boolValue];
22
+ if([options valueForKey:@"skipFocusingFrames"] != nil)
23
+ functionality.skipFocusingFrames = [[options valueForKey:@"skipFocusingFrames"] boolValue];
24
+ if([options valueForKey:@"showCameraSwitchButton"] != nil)
25
+ functionality.showCameraSwitchButton = [[options valueForKey:@"showCameraSwitchButton"] boolValue];
26
+ if([options valueForKey:@"displayMetadata"] != nil)
27
+ functionality.showMetadataInfo = [[options valueForKey:@"displayMetadata"] boolValue];
28
+ if([options valueForKey:@"isZoomEnabled"] != nil)
29
+ functionality.isZoomEnabled = [[options valueForKey:@"isZoomEnabled"] boolValue];
30
+ if([options valueForKey:@"recordScanningProcess"] != nil)
31
+ functionality.recordScanningProcess = [[options valueForKey:@"recordScanningProcess"] boolValue];
32
+ if([options valueForKey:@"manualMultipageMode"] != nil)
33
+ functionality.manualMultipageMode = [[options valueForKey:@"manualMultipageMode"] boolValue];
34
+ if([options valueForKey:@"singleResult"] != nil)
35
+ functionality.singleResult = [[options valueForKey:@"singleResult"] boolValue];
36
+ if(options[@"torchTurnedOn"]) functionality.torchTurnedOn = [options[@"torchTurnedOn"] boolValue];
37
+
38
+ // Int
39
+ if([options valueForKey:@"showCaptureButtonDelayFromDetect"] != nil)
40
+ functionality.showCaptureButtonDelayFromDetect = [[options valueForKey:@"showCaptureButtonDelayFromDetect"] doubleValue];
41
+ if([options valueForKey:@"showCaptureButtonDelayFromStart"] != nil)
42
+ functionality.showCaptureButtonDelayFromStart = [[options valueForKey:@"showCaptureButtonDelayFromStart"] doubleValue];
43
+ if([options valueForKey:@"forcePagesCount"] != nil)
44
+ functionality.forcePagesCount = [options valueForKey:@"forcePagesCount"];
45
+ if([options valueForKey:@"orientation"] != nil)
46
+ functionality.orientation = [self interfaceOrientationMaskWithNumber:[options valueForKey:@"orientation"]];
47
+ if([options valueForKey:@"captureMode"] != nil)
48
+ functionality.captureMode = [[options valueForKey:@"captureMode"] integerValue];
49
+ if(options[@"cameraPositionIOS"])
50
+ functionality.cameraPosition = [options[@"cameraPositionIOS"] integerValue];
51
+
52
+ // String
53
+ if([options valueForKey:@"cameraFrame"] != nil)
54
+ functionality.cameraFrame = [self docReaderFrameWithString:[options valueForKey:@"cameraFrame"]];
55
+ #pragma clang diagnostic ignored "-Wdeprecated-declarations"
56
+ if([options valueForKey:@"btDeviceName"] != nil)
57
+ functionality.btDeviceName = [options valueForKey:@"btDeviceName"];
58
+ #pragma clang diagnostic pop
59
+
60
+ // Float
61
+ if([options valueForKey:@"zoomFactor"] != nil)
62
+ functionality.zoomFactor = [[options valueForKey:@"zoomFactor"] floatValue];
63
+
64
+ // Custom
65
+ // in android - cameraSize
66
+ if([options valueForKey:@"videoSessionPreset"] != nil)
67
+ functionality.videoSessionPreset = [self captureSessionPresetWithNumber:[options valueForKey:@"videoSessionPreset"]];
68
+ if([options valueForKey:@"videoOutputSettings"] != nil)
69
+ functionality.videoOutputSettings = [options valueForKey:@"videoOutputSettings"];
70
+ }
71
+
72
+ +(NSDictionary*)getFunctionality:(RGLFunctionality*)functionality {
73
+ NSMutableDictionary *result = [NSMutableDictionary new];
74
+
75
+ // Boolean
76
+ result[@"showTorchButton"] = [NSNumber numberWithBool:functionality.showTorchButton];
77
+ result[@"showCloseButton"] = [NSNumber numberWithBool:functionality.showCloseButton];
78
+ result[@"videoCaptureMotionControl"] = [NSNumber numberWithBool:functionality.videoCaptureMotionControl];
79
+ result[@"showCaptureButton"] = [NSNumber numberWithBool:functionality.showCaptureButton];
80
+ result[@"showChangeFrameButton"] = [NSNumber numberWithBool:functionality.showChangeFrameButton];
81
+ result[@"showSkipNextPageButton"] = [NSNumber numberWithBool:functionality.showSkipNextPageButton];
82
+ result[@"useAuthenticator"] = [NSNumber numberWithBool:functionality.isUseAuthenticator];
83
+ result[@"skipFocusingFrames"] = [NSNumber numberWithBool:functionality.skipFocusingFrames];
84
+ result[@"showCameraSwitchButton"] = [NSNumber numberWithBool:functionality.showCameraSwitchButton];
85
+ result[@"displayMetadata"] = [NSNumber numberWithBool:functionality.showMetadataInfo];
86
+ result[@"isZoomEnabled"] = [NSNumber numberWithBool:functionality.isZoomEnabled];
87
+ result[@"recordScanningProcess"] = [NSNumber numberWithBool:functionality.recordScanningProcess];
88
+ result[@"manualMultipageMode"] = [NSNumber numberWithBool:functionality.manualMultipageMode];
89
+ result[@"singleResult"] = [NSNumber numberWithBool:functionality.singleResult];
90
+ result[@"torchTurnedOn"] = @(functionality.torchTurnedOn);
91
+
92
+ // Int
93
+ result[@"showCaptureButtonDelayFromDetect"] = [NSNumber numberWithDouble:functionality.showCaptureButtonDelayFromDetect];
94
+ result[@"showCaptureButtonDelayFromStart"] = [NSNumber numberWithDouble:functionality.showCaptureButtonDelayFromStart];
95
+ result[@"forcePagesCount"] = functionality.forcePagesCount;
96
+ result[@"orientation"] = [self generateInterfaceOrientationMask:functionality.orientation];
97
+ result[@"captureMode"] = [NSNumber numberWithInteger:functionality.captureMode];
98
+ result[@"cameraPositionIOS"] = @(functionality.cameraPosition);
99
+
100
+ // String
101
+ result[@"cameraFrame"] = [self generateDocReaderFrame:functionality.cameraFrame];
102
+ #pragma clang diagnostic ignored "-Wdeprecated-declarations"
103
+ result[@"btDeviceName"] = functionality.btDeviceName;
104
+ #pragma clang diagnostic pop
105
+
106
+ // Float
107
+ result[@"zoomFactor"] = [NSNumber numberWithFloat:functionality.zoomFactor];
108
+
109
+ // Custom
110
+ // in android - cameraSize
111
+ result[@"videoSessionPreset"] = [self generateCaptureSessionPreset:functionality.videoSessionPreset];
112
+ result[@"videoOutputSettings"] = functionality.videoOutputSettings;
113
+
114
+ return result;
115
+ }
116
+
117
+ +(void)setProcessParams:(NSDictionary*)options :(RGLProcessParams*)processParams {
118
+
119
+ // Boolean
120
+ if([options valueForKey:@"multipageProcessing"] != nil)
121
+ processParams.multipageProcessing = [options valueForKey:@"multipageProcessing"];
122
+ if([options valueForKey:@"logs"] != nil)
123
+ processParams.logs = [options valueForKey:@"logs"];
124
+ if([options valueForKey:@"debugSaveImages"] != nil)
125
+ processParams.debugSaveImages = [options valueForKey:@"debugSaveImages"];
126
+ if([options valueForKey:@"debugSaveLogs"] != nil)
127
+ processParams.debugSaveLogs = [options valueForKey:@"debugSaveLogs"];
128
+ if([options valueForKey:@"returnUncroppedImage"] != nil)
129
+ processParams.returnUncroppedImage = [options valueForKey:@"returnUncroppedImage"];
130
+ if([options valueForKey:@"debugSaveCroppedImages"] != nil)
131
+ processParams.debugSaveCroppedImages = [options valueForKey:@"debugSaveCroppedImages"];
132
+ if([options valueForKey:@"disableFocusingCheck"] != nil)
133
+ processParams.disableFocusingCheck = [options valueForKey:@"disableFocusingCheck"];
134
+ if([options valueForKey:@"debugSaveRFIDSession"] != nil)
135
+ processParams.debugSaveRFIDSession = [options valueForKey:@"debugSaveRFIDSession"];
136
+ if([options valueForKey:@"doublePageSpread"] != nil)
137
+ processParams.doublePageSpread = [options valueForKey:@"doublePageSpread"];
138
+ if([options valueForKey:@"manualCrop"] != nil)
139
+ processParams.manualCrop = [options valueForKey:@"manualCrop"];
140
+ if([options valueForKey:@"integralImage"] != nil)
141
+ processParams.integralImage = [options valueForKey:@"integralImage"];
142
+ if([options valueForKey:@"returnCroppedBarcode"] != nil)
143
+ processParams.returnCroppedBarcode = [options valueForKey:@"returnCroppedBarcode"];
144
+ if([options valueForKey:@"checkRequiredTextFields"] != nil)
145
+ processParams.checkRequiredTextFields = [options valueForKey:@"checkRequiredTextFields"];
146
+ if([options valueForKey:@"depersonalizeLog"] != nil)
147
+ processParams.depersonalizeLog = [options valueForKey:@"depersonalizeLog"];
148
+ if([options valueForKey:@"generateDoublePageSpreadImage"] != nil)
149
+ processParams.generateDoublePageSpreadImage = [options valueForKey:@"generateDoublePageSpreadImage"];
150
+ if([options valueForKey:@"alreadyCropped"] != nil)
151
+ processParams.alreadyCropped = [options valueForKey:@"alreadyCropped"];
152
+ if([options valueForKey:@"matchTextFieldMask"] != nil)
153
+ processParams.matchTextFieldMask = [options valueForKey:@"matchTextFieldMask"];
154
+ if([options valueForKey:@"updateOCRValidityByGlare"] != nil)
155
+ processParams.updateOCRValidityByGlare = [options valueForKey:@"updateOCRValidityByGlare"];
156
+ if([options valueForKey:@"noGraphics"] != nil)
157
+ processParams.noGraphics = [options valueForKey:@"noGraphics"];
158
+ if([options valueForKey:@"multiDocOnImage"] != nil)
159
+ processParams.multiDocOnImage = [options valueForKey:@"multiDocOnImage"];
160
+ if([options valueForKey:@"forceReadMrzBeforeLocate"] != nil)
161
+ processParams.forceReadMrzBeforeLocate = [options valueForKey:@"forceReadMrzBeforeLocate"];
162
+ if([options valueForKey:@"parseBarcodes"] != nil)
163
+ processParams.parseBarcodes = [options valueForKey:@"parseBarcodes"];
164
+ if([options valueForKey:@"shouldReturnPackageForReprocess"] != nil)
165
+ processParams.shouldReturnPackageForReprocess = [options valueForKey:@"shouldReturnPackageForReprocess"];
166
+ if([options valueForKey:@"disablePerforationOCR"] != nil)
167
+ processParams.disablePerforationOCR = [options valueForKey:@"disablePerforationOCR"];
168
+ if([options valueForKey:@"respectImageQuality"] != nil)
169
+ processParams.respectImageQuality = [options valueForKey:@"respectImageQuality"];
170
+ if (options[@"strictImageQuality"]) processParams.strictImageQuality = options[@"strictImageQuality"];
171
+ if([options valueForKey:@"splitNames"] != nil)
172
+ processParams.splitNames = [options valueForKey:@"splitNames"];
173
+ if([options valueForKey:@"doDetectCan"] != nil)
174
+ processParams.doDetectCan = [options valueForKey:@"doDetectCan"];
175
+ if([options valueForKey:@"useFaceApi"] != nil)
176
+ processParams.useFaceApi = [options valueForKey:@"useFaceApi"];
177
+ if([options valueForKey:@"useAuthenticityCheck"] != nil)
178
+ processParams.useAuthenticityCheck = [options valueForKey:@"useAuthenticityCheck"];
179
+ if([options valueForKey:@"checkHologram"] != nil)
180
+ processParams.checkHologram = [options valueForKey:@"checkHologram"];
181
+ if (options[@"generateNumericCodes"]) processParams.generateNumericCodes = options[@"generateNumericCodes"];
182
+ if (options[@"strictBarcodeDigitalSignatureCheck"]) processParams.strictBarcodeDigitalSignatureCheck = options[@"strictBarcodeDigitalSignatureCheck"];
183
+ if (options[@"selectLongestNames"]) processParams.selectLongestNames = options[@"selectLongestNames"];
184
+ if (options[@"generateDTCVC"]) processParams.generateDTCVC = options[@"generateDTCVC"];
185
+ if (options[@"strictDLCategoryExpiry"]) processParams.strictDLCategoryExpiry = options[@"strictDLCategoryExpiry"];
186
+ if (options[@"generateAlpha2Codes"]) processParams.generateAlpha2Codes = options[@"generateAlpha2Codes"];
187
+
188
+ // Int
189
+ if([options valueForKey:@"measureSystem"] != nil)
190
+ processParams.measureSystem = [[options valueForKey:@"measureSystem"] integerValue];
191
+ if([options valueForKey:@"barcodeParserType"] != nil)
192
+ processParams.barcodeParserType = [options valueForKey:@"barcodeParserType"];
193
+ if([options valueForKey:@"perspectiveAngle"] != nil)
194
+ processParams.perspectiveAngle = [options valueForKey:@"perspectiveAngle"];
195
+ if([options valueForKey:@"minDPI"] != nil)
196
+ processParams.minDPI = [options valueForKey:@"minDPI"];
197
+ if([options valueForKey:@"imageDpiOutMax"] != nil)
198
+ processParams.imageDpiOutMax = [options valueForKey:@"imageDpiOutMax"];
199
+ if([options valueForKey:@"forceDocID"] != nil)
200
+ processParams.forceDocID = [options valueForKey:@"forceDocID"];
201
+ if([options valueForKey:@"forceDocFormat"] != nil)
202
+ processParams.forceDocFormat = [options valueForKey:@"forceDocFormat"];
203
+ if([options valueForKey:@"shiftExpiryDate"] != nil)
204
+ processParams.shiftExpiryDate = [options valueForKey:@"shiftExpiryDate"];
205
+ if([options valueForKey:@"minimalHolderAge"] != nil)
206
+ processParams.minimalHolderAge = [options valueForKey:@"minimalHolderAge"];
207
+ if([options valueForKey:@"imageOutputMaxHeight"] != nil)
208
+ processParams.imageOutputMaxHeight = [options valueForKey:@"imageOutputMaxHeight"];
209
+ if([options valueForKey:@"imageOutputMaxWidth"] != nil)
210
+ processParams.imageOutputMaxWidth = [options valueForKey:@"imageOutputMaxWidth"];
211
+ if([options valueForKey:@"processAuth"] != nil)
212
+ processParams.processAuth = [options valueForKey:@"processAuth"];
213
+ if([options valueForKey:@"convertCase"] != nil)
214
+ processParams.convertCase = [self textProcessingWithNumber:[options valueForKey:@"convertCase"]];
215
+ if(options[@"logLevel"]) processParams.logLevel = options[@"logLevel"];
216
+ if(options[@"mrzDetectMode"]) processParams.mrzDetectMode = options[@"mrzDetectMode"];
217
+ if(options[@"pdfPagesLimit"]) processParams.pdfPagesLimit = options[@"pdfPagesLimit"];
218
+
219
+ // String
220
+ if([options valueForKey:@"dateFormat"] != nil)
221
+ processParams.dateFormat = [options valueForKey:@"dateFormat"];
222
+ if([options valueForKey:@"scenario"] != nil)
223
+ processParams.scenario = [options valueForKey:@"scenario"];
224
+ if([options valueForKey:@"captureButtonScenario"] != nil)
225
+ processParams.captureButtonScenario = [options valueForKey:@"captureButtonScenario"];
226
+
227
+ // Double
228
+ if([options valueForKey:@"timeout"] != nil)
229
+ processParams.timeout = [options valueForKey:@"timeout"];
230
+ if([options valueForKey:@"timeoutFromFirstDetect"] != nil)
231
+ processParams.timeoutFromFirstDetect = [options valueForKey:@"timeoutFromFirstDetect"];
232
+ if([options valueForKey:@"timeoutFromFirstDocType"] != nil)
233
+ processParams.timeoutFromFirstDocType = [options valueForKey:@"timeoutFromFirstDocType"];
234
+ if([options valueForKey:@"documentAreaMin"] != nil)
235
+ processParams.documentAreaMin = [options valueForKey:@"documentAreaMin"];
236
+ if([options valueForKey:@"timeoutLiveness"] != nil)
237
+ processParams.timeoutLiveness = [options valueForKey:@"timeoutLiveness"];
238
+
239
+ // JSONArray
240
+ if([options valueForKey:@"documentIDList"] != nil)
241
+ processParams.documentIDList = [options valueForKey:@"documentIDList"];
242
+ if([options valueForKey:@"fieldTypesFilter"] != nil)
243
+ processParams.fieldTypesFilter = [options valueForKey:@"fieldTypesFilter"];
244
+ if([options valueForKey:@"barcodeTypes"] != nil)
245
+ processParams.barcodeTypes = [options valueForKey:@"barcodeTypes"];
246
+ if([options valueForKey:@"resultTypeOutput"] != nil)
247
+ processParams.resultTypeOutput = [options valueForKey:@"resultTypeOutput"];
248
+ if([options valueForKey:@"mrzFormatsFilter"] != nil)
249
+ processParams.mrzFormatsFilter = [options valueForKey:@"mrzFormatsFilter"];
250
+ if([options valueForKey:@"documentGroupFilter"] != nil)
251
+ processParams.documentGroupFilter = [options mutableArrayValueForKey:@"documentGroupFilter"];
252
+ if([options valueForKey:@"lcidIgnoreFilter"] != nil)
253
+ processParams.lcidIgnoreFilter = [options mutableArrayValueForKey:@"lcidIgnoreFilter"];
254
+ if([options valueForKey:@"lcidFilter"] != nil)
255
+ processParams.lcidFilter = [options mutableArrayValueForKey:@"lcidFilter"];
256
+
257
+ // JSONObject
258
+ if([options valueForKey:@"imageQA"] != nil)
259
+ [self setImageQA:processParams.imageQA input:[options valueForKey:@"imageQA"]];
260
+ if([options valueForKey:@"rfidParams"] != nil)
261
+ processParams.rfidParams = [RGLWJSONConstructor rfidParamsFromJson:[options valueForKey:@"rfidParams"]];
262
+ if([options valueForKey:@"faceApiParams"] != nil)
263
+ processParams.faceApiParams = [RGLWJSONConstructor faceAPIParamsFromJson:[options valueForKey:@"faceApiParams"]];
264
+ if([options valueForKey:@"backendProcessingConfig"] != nil)
265
+ processParams.backendProcessingConfig = [RGLWJSONConstructor backendProcessingConfigFromJson:[options valueForKey:@"backendProcessingConfig"]];
266
+ if([options valueForKey:@"authenticityParams"] != nil) {
267
+ if(processParams.authenticityParams == nil) processParams.authenticityParams = [RGLAuthenticityParams defaultParams];
268
+ [self setAuthenticityParams:processParams.authenticityParams input:[options valueForKey:@"authenticityParams"]];
269
+ }
270
+
271
+ // Custom
272
+ if([options valueForKey:@"customParams"] != nil)
273
+ processParams.customParams = [options valueForKey:@"customParams"];
274
+ }
275
+
276
+ +(NSDictionary*)getProcessParams:(RGLProcessParams*)processParams {
277
+ NSMutableDictionary *result = [NSMutableDictionary new];
278
+
279
+ // Boolean
280
+ result[@"multipageProcessing"] = processParams.multipageProcessing;
281
+ result[@"logs"] = processParams.logs;
282
+ result[@"debugSaveImages"] = processParams.debugSaveImages;
283
+ result[@"debugSaveLogs"] = processParams.debugSaveLogs;
284
+ result[@"returnUncroppedImage"] = processParams.returnUncroppedImage;
285
+ result[@"debugSaveCroppedImages"] = processParams.debugSaveCroppedImages;
286
+ result[@"disableFocusingCheck"] = processParams.disableFocusingCheck;
287
+ result[@"debugSaveRFIDSession"] = processParams.debugSaveRFIDSession;
288
+ result[@"doublePageSpread"] = processParams.doublePageSpread;
289
+ result[@"manualCrop"] = processParams.manualCrop;
290
+ result[@"integralImage"] = processParams.integralImage;
291
+ result[@"returnCroppedBarcode"] = processParams.returnCroppedBarcode;
292
+ result[@"checkRequiredTextFields"] = processParams.checkRequiredTextFields;
293
+ result[@"depersonalizeLog"] = processParams.depersonalizeLog;
294
+ result[@"generateDoublePageSpreadImage"] = processParams.generateDoublePageSpreadImage;
295
+ result[@"alreadyCropped"] = processParams.alreadyCropped;
296
+ result[@"matchTextFieldMask"] = processParams.matchTextFieldMask;
297
+ result[@"updateOCRValidityByGlare"] = processParams.updateOCRValidityByGlare;
298
+ result[@"noGraphics"] = processParams.noGraphics;
299
+ result[@"multiDocOnImage"] = processParams.multiDocOnImage;
300
+ result[@"forceReadMrzBeforeLocate"] = processParams.forceReadMrzBeforeLocate;
301
+ result[@"parseBarcodes"] = processParams.parseBarcodes;
302
+ result[@"shouldReturnPackageForReprocess"] = processParams.shouldReturnPackageForReprocess;
303
+ result[@"disablePerforationOCR"] = processParams.disablePerforationOCR;
304
+ result[@"respectImageQuality"] = processParams.respectImageQuality;
305
+ result[@"strictImageQuality"] = processParams.strictImageQuality;
306
+ result[@"splitNames"] = processParams.splitNames;
307
+ result[@"doDetectCan"] = processParams.doDetectCan;
308
+ result[@"useFaceApi"] = processParams.useFaceApi;
309
+ result[@"useAuthenticityCheck"] = processParams.useAuthenticityCheck;
310
+ result[@"checkHologram"] = processParams.checkHologram;
311
+ result[@"generateNumericCodes"] = processParams.generateNumericCodes;
312
+ result[@"strictBarcodeDigitalSignatureCheck"] = processParams.strictBarcodeDigitalSignatureCheck;
313
+ result[@"selectLongestNames"] = processParams.selectLongestNames;
314
+ result[@"generateDTCVC"] = processParams.generateDTCVC;
315
+ result[@"strictDLCategoryExpiry"] = processParams.strictDLCategoryExpiry;
316
+ result[@"generateAlpha2Codes"] = processParams.generateAlpha2Codes;
317
+
318
+ // Int
319
+ result[@"measureSystem"] = [NSNumber numberWithInteger:processParams.measureSystem];
320
+ result[@"barcodeParserType"] = processParams.barcodeParserType;
321
+ result[@"perspectiveAngle"] = processParams.perspectiveAngle;
322
+ result[@"minDPI"] = processParams.minDPI;
323
+ result[@"imageDpiOutMax"] = processParams.imageDpiOutMax;
324
+ result[@"forceDocID"] = processParams.forceDocID;
325
+ result[@"forceDocFormat"] = processParams.forceDocFormat;
326
+ result[@"shiftExpiryDate"] = processParams.shiftExpiryDate;
327
+ result[@"minimalHolderAge"] = processParams.minimalHolderAge;
328
+ result[@"imageOutputMaxHeight"] = processParams.imageOutputMaxHeight;
329
+ result[@"imageOutputMaxWidth"] = processParams.imageOutputMaxWidth;
330
+ result[@"processAuth"] = processParams.processAuth;
331
+ result[@"convertCase"] = [self generateWithTextProcessing:processParams.convertCase];
332
+ result[@"logLevel"] = processParams.logLevel;
333
+ result[@"mrzDetectMode"] = processParams.mrzDetectMode;
334
+ result[@"pdfPagesLimit"] = processParams.pdfPagesLimit;
335
+
336
+ // String
337
+ result[@"dateFormat"] = processParams.dateFormat;
338
+ result[@"scenario"] = processParams.scenario;
339
+ result[@"captureButtonScenario"] = processParams.captureButtonScenario;
340
+
341
+ // Double
342
+ result[@"timeout"] = processParams.timeout;
343
+ result[@"timeoutFromFirstDetect"] = processParams.timeoutFromFirstDetect;
344
+ result[@"timeoutFromFirstDocType"] = processParams.timeoutFromFirstDocType;
345
+ result[@"documentAreaMin"] = processParams.documentAreaMin;
346
+ result[@"timeoutLiveness"] = processParams.timeoutLiveness;
347
+
348
+ // JSONArray
349
+ result[@"documentIDList"] = processParams.documentIDList;
350
+ result[@"barcodeTypes"] = processParams.barcodeTypes;
351
+ result[@"fieldTypesFilter"] = processParams.fieldTypesFilter;
352
+ result[@"documentGroupFilter"] = processParams.documentGroupFilter;
353
+ result[@"lcidIgnoreFilter"] = processParams.lcidIgnoreFilter;
354
+ result[@"lcidFilter"] = processParams.lcidFilter;
355
+ result[@"mrzFormatsFilter"] = processParams.mrzFormatsFilter;
356
+ result[@"resultTypeOutput"] = processParams.resultTypeOutput;
357
+
358
+ // JSONObject
359
+ result[@"imageQA"] = [self getImageQA:processParams.imageQA];
360
+ result[@"rfidParams"] = [RGLWJSONConstructor generateRFIDParams:processParams.rfidParams];
361
+ result[@"faceApiParams"] = [RGLWJSONConstructor generateFaceAPIParams:processParams.faceApiParams];
362
+ result[@"backendProcessingConfig"] = [RGLWJSONConstructor generateBackendProcessingConfig:processParams.backendProcessingConfig];
363
+ result[@"authenticityParams"] = [self getAuthenticityParams:processParams.authenticityParams];
364
+
365
+ // Custom
366
+ result[@"customParams"] = processParams.customParams;
367
+
368
+ return result;
369
+ }
370
+
371
+ +(void)setCustomization:(NSDictionary*)options :(RGLCustomization*)customization {
372
+ // Boolean
373
+ if([options valueForKey:@"showStatusMessages"] != nil)
374
+ customization.showStatusMessages = [[options valueForKey:@"showStatusMessages"] boolValue];
375
+ if([options valueForKey:@"showResultStatusMessages"] != nil)
376
+ customization.showResultStatusMessages = [[options valueForKey:@"showResultStatusMessages"] boolValue];
377
+ if([options valueForKey:@"showHelpAnimation"] != nil)
378
+ customization.showHelpAnimation = [[options valueForKey:@"showHelpAnimation"] boolValue];
379
+ if([options valueForKey:@"showNextPageAnimation"] != nil)
380
+ customization.showNextPageAnimation = [[options valueForKey:@"showNextPageAnimation"] boolValue];
381
+ if([options valueForKey:@"showBackgroundMask"] != nil)
382
+ customization.showBackgroundMask = [[options valueForKey:@"showBackgroundMask"] boolValue];
383
+
384
+ // Int
385
+ if([options valueForKey:@"cameraFrameBorderWidth"] != nil)
386
+ customization.cameraFrameBorderWidth = [[options valueForKey:@"cameraFrameBorderWidth"] floatValue];
387
+ if([options valueForKey:@"cameraFrameLineLength"] != nil)
388
+ customization.cameraFrameLineLength = [[options valueForKey:@"cameraFrameLineLength"] floatValue];
389
+ if([options valueForKey:@"cameraFrameShapeType"] != nil)
390
+ customization.cameraFrameShapeType = [[options valueForKey:@"cameraFrameShapeType"] integerValue];
391
+ if([options valueForKey:@"cameraFrameOffsetWidth"] != nil)
392
+ customization.cameraFrameOffsetWidth = [[options valueForKey:@"cameraFrameOffsetWidth"] floatValue];
393
+ if(options[@"nextPageAnimationStartDelay"]) customization.nextPageAnimationStartDelay = [options[@"nextPageAnimationStartDelay"] floatValue];
394
+ if(options[@"nextPageAnimationEndDelay"]) customization.nextPageAnimationEndDelay = [options[@"nextPageAnimationEndDelay"] floatValue];
395
+
396
+ // String
397
+ if([options valueForKey:@"status"] != nil)
398
+ customization.status = [options valueForKey:@"status"];
399
+ if([options valueForKey:@"resultStatus"] != nil)
400
+ customization.resultStatus = [options valueForKey:@"resultStatus"];
401
+ if(options[@"multipageButtonText"]) customization.multipageButtonText = options[@"multipageButtonText"];
402
+
403
+ // Color
404
+ if([options valueForKey:@"cameraFrameDefaultColor"] != nil)
405
+ customization.cameraFrameDefaultColor = [self colorWithInt:[options valueForKey:@"cameraFrameDefaultColor"]];
406
+ if([options valueForKey:@"cameraFrameActiveColor"] != nil)
407
+ customization.cameraFrameActiveColor = [self colorWithInt:[options valueForKey:@"cameraFrameActiveColor"]];
408
+ if([options valueForKey:@"statusTextColor"] != nil)
409
+ customization.statusTextColor = [self colorWithInt:[options valueForKey:@"statusTextColor"]];
410
+ if([options valueForKey:@"resultStatusTextColor"] != nil)
411
+ customization.resultStatusTextColor = [self colorWithInt:[options valueForKey:@"resultStatusTextColor"]];
412
+ if([options valueForKey:@"resultStatusBackgroundColor"] != nil)
413
+ customization.resultStatusBackgroundColor = [self colorWithInt:[options valueForKey:@"resultStatusBackgroundColor"]];
414
+ if([options valueForKey:@"multipageButtonBackgroundColor"] != nil)
415
+ customization.multipageButtonBackgroundColor = [self colorWithInt:[options valueForKey:@"multipageButtonBackgroundColor"]];
416
+ if([options valueForKey:@"tintColor"] != nil)
417
+ customization.tintColor = [self colorWithInt:[options valueForKey:@"tintColor"]];
418
+ if([options valueForKey:@"activityIndicatorColor"] != nil)
419
+ customization.activityIndicatorColor = [self colorWithInt:[options valueForKey:@"activityIndicatorColor"]];
420
+ if([options valueForKey:@"statusBackgroundColor"] != nil)
421
+ customization.statusBackgroundColor = [self colorWithInt:[options valueForKey:@"statusBackgroundColor"]];
422
+ if([options valueForKey:@"cameraPreviewBackgroundColor"] != nil)
423
+ customization.cameraPreviewBackgroundColor = [self colorWithInt:[options valueForKey:@"cameraPreviewBackgroundColor"]];
424
+ if([options valueForKey:@"backgroundMaskColor"] != nil)
425
+ customization.backgroundMaskColor = [self colorWithInt:[options valueForKey:@"backgroundMaskColor"]];
426
+ if(options[@"multipageButtonTextColor"]) customization.multipageButtonTextColor = [self colorWithInt:options[@"multipageButtonTextColor"]];
427
+
428
+ // Float
429
+ if([options valueForKey:@"statusPositionMultiplier"] != nil)
430
+ customization.statusPositionMultiplier = [[options valueForKey:@"statusPositionMultiplier"] floatValue];
431
+ if([options valueForKey:@"resultStatusPositionMultiplier"] != nil)
432
+ customization.resultStatusPositionMultiplier = [[options valueForKey:@"resultStatusPositionMultiplier"] floatValue];
433
+ if([options valueForKey:@"toolbarSize"] != nil)
434
+ customization.toolbarSize = [[options valueForKey:@"toolbarSize"] floatValue];
435
+ if([options valueForKey:@"backgroundMaskAlpha"] != nil)
436
+ customization.backgroundMaskAlpha = [[options valueForKey:@"backgroundMaskAlpha"] floatValue];
437
+ if([options valueForKey:@"customStatusPositionMultiplier"] != nil)
438
+ customization.customStatusPositionMultiplier = [[options valueForKey:@"customStatusPositionMultiplier"] floatValue];
439
+ if([options valueForKey:@"cameraFrameVerticalPositionMultiplier"] != nil)
440
+ customization.cameraFrameVerticalPositionMultiplier = [[options valueForKey:@"cameraFrameVerticalPositionMultiplier"] floatValue];
441
+ if([options valueForKey:@"cameraFrameLandscapeAspectRatio"] != nil)
442
+ customization.cameraFrameLandscapeAspectRatio = [[options valueForKey:@"cameraFrameLandscapeAspectRatio"] floatValue];
443
+ if([options valueForKey:@"cameraFramePortraitAspectRatio"] != nil)
444
+ customization.cameraFramePortraitAspectRatio = [[options valueForKey:@"cameraFramePortraitAspectRatio"] floatValue];
445
+ if([options valueForKey:@"cameraFrameCornerRadius"] != nil)
446
+ customization.cameraFrameCornerRadius = [[options valueForKey:@"cameraFrameCornerRadius"] floatValue];
447
+ if([options valueForKey:@"livenessAnimationPositionMultiplier"] != nil)
448
+ customization.livenessAnimationPositionMultiplier = [[options valueForKey:@"livenessAnimationPositionMultiplier"] floatValue];
449
+ if(options[@"activityIndicatorPortraitPositionMultiplier"]) customization.activityIndicatorPortraitPositionMultiplier = [options[@"activityIndicatorPortraitPositionMultiplier"] floatValue];
450
+ if(options[@"activityIndicatorLandscapePositionMultiplier"]) customization.activityIndicatorLandscapePositionMultiplier = [options[@"activityIndicatorLandscapePositionMultiplier"] floatValue];
451
+ if(options[@"cameraPreviewVerticalPositionMultiplier"]) customization.previewLayerPositionMultiplier = [options[@"cameraPreviewVerticalPositionMultiplier"] floatValue];
452
+
453
+ // Drawable
454
+ if([options valueForKey:@"multipageAnimationFrontImage"] != nil)
455
+ customization.multipageAnimationFrontImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"multipageAnimationFrontImage"]];
456
+ if([options valueForKey:@"multipageAnimationBackImage"] != nil)
457
+ customization.multipageAnimationBackImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"multipageAnimationBackImage"]];
458
+ if([options valueForKey:@"borderBackgroundImage"] != nil)
459
+ customization.borderBackgroundImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"borderBackgroundImage"]];
460
+ if([options valueForKey:@"helpAnimationImage"] != nil)
461
+ customization.helpAnimationImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"helpAnimationImage"]];
462
+ if([options valueForKey:@"closeButtonImage"] != nil)
463
+ customization.closeButtonImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"closeButtonImage"]];
464
+ if([options valueForKey:@"captureButtonImage"] != nil)
465
+ customization.captureButtonImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"captureButtonImage"]];
466
+ if([options valueForKey:@"changeFrameButtonCollapseImage"] != nil)
467
+ customization.changeFrameButtonCollapseImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"changeFrameButtonCollapseImage"]];
468
+ if([options valueForKey:@"changeFrameButtonExpandImage"] != nil)
469
+ customization.changeFrameButtonExpandImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"changeFrameButtonExpandImage"]];
470
+ if([options valueForKey:@"cameraSwitchButtonImage"] != nil)
471
+ customization.cameraSwitchButtonImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"cameraSwitchButtonImage"]];
472
+ if([options valueForKey:@"torchButtonOnImage"] != nil)
473
+ customization.torchButtonOnImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"torchButtonOnImage"]];
474
+ if([options valueForKey:@"torchButtonOffImage"] != nil)
475
+ customization.torchButtonOffImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"torchButtonOffImage"]];
476
+ if([options valueForKey:@"livenessAnimationImage"] != nil)
477
+ customization.livenessAnimationImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"livenessAnimationImage"]];
478
+
479
+ // Font
480
+ if([options valueForKey:@"statusTextFont"] != nil)
481
+ customization.statusTextFont = [self UIFontFromJSON:[options valueForKey:@"statusTextFont"]];
482
+ if([options valueForKey:@"resultStatusTextFont"] != nil)
483
+ customization.resultStatusTextFont = [self UIFontFromJSON:[options valueForKey:@"resultStatusTextFont"]];
484
+ if(options[@"multipageButtonTextFont"]) customization.multipageButtonTextFont = [self UIFontFromJSON:options[@"multipageButtonTextFont"]];
485
+
486
+ // Custom
487
+ if([options valueForKey:@"customLabelStatus"] != nil)
488
+ customization.customLabelStatus = [[NSAttributedString alloc]initWithString:[options valueForKey:@"customLabelStatus"]];
489
+ if([options valueForKey:@"cameraFrameLineCap"] != nil)
490
+ customization.cameraFrameLineCap = [self lineCapWithNumber:[options valueForKey:@"cameraFrameLineCap"]];
491
+ if([options valueForKey:@"uiCustomizationLayer"] != nil)
492
+ customization.customUILayerJSON = [options valueForKey:@"uiCustomizationLayer"];
493
+
494
+ // ContentMode
495
+ if([options valueForKey:@"helpAnimationImageContentMode"] != nil)
496
+ customization.helpAnimationImageContentMode = [self viewContentModeWithNumber:[options valueForKey:@"helpAnimationImageContentMode"]];
497
+ if([options valueForKey:@"multipageAnimationFrontImageContentMode"] != nil)
498
+ customization.multipageAnimationFrontImageContentMode = [self viewContentModeWithNumber:[options valueForKey:@"multipageAnimationFrontImageContentMode"]];
499
+ if([options valueForKey:@"multipageAnimationBackImageContentMode"] != nil)
500
+ customization.multipageAnimationBackImageContentMode = [self viewContentModeWithNumber:[options valueForKey:@"multipageAnimationBackImageContentMode"]];
501
+ if([options valueForKey:@"livenessAnimationImageContentMode"] != nil)
502
+ customization.livenessAnimationImageContentMode = [self viewContentModeWithNumber:[options valueForKey:@"livenessAnimationImageContentMode"]];
503
+ if([options valueForKey:@"borderBackgroundImageContentMode"] != nil)
504
+ customization.borderBackgroundImageContentMode = [self viewContentModeWithNumber:[options valueForKey:@"borderBackgroundImageContentMode"]];
505
+
506
+ if([options valueForKey:@"colors"] != nil)
507
+ [self setColors:[customization.uiConfiguration valueForKey:@"colors"] input:[options valueForKey:@"colors"]];
508
+ if([options valueForKey:@"fonts"] != nil)
509
+ [self setFonts:[customization.uiConfiguration valueForKey:@"fonts"] input:[options valueForKey:@"fonts"]];
510
+ if([options valueForKey:@"images"] != nil)
511
+ [self setImages:[customization.uiConfiguration valueForKey:@"images"] input:[options valueForKey:@"images"]];
512
+ }
513
+
514
+ +(NSDictionary*)getCustomization:(RGLCustomization*)customization {
515
+ NSMutableDictionary *result = [NSMutableDictionary new];
516
+
517
+ // Boolean
518
+ result[@"showStatusMessages"] = [NSNumber numberWithBool:customization.showStatusMessages];
519
+ result[@"showResultStatusMessages"] = [NSNumber numberWithBool:customization.showResultStatusMessages];
520
+ result[@"showHelpAnimation"] = [NSNumber numberWithBool:customization.showHelpAnimation];
521
+ result[@"showNextPageAnimation"] = [NSNumber numberWithBool:customization.showNextPageAnimation];
522
+ result[@"showBackgroundMask"] = [NSNumber numberWithBool:customization.showBackgroundMask];
523
+
524
+ // Int
525
+ result[@"cameraFrameBorderWidth"] = [NSNumber numberWithFloat:customization.cameraFrameBorderWidth];
526
+ result[@"cameraFrameLineLength"] = [NSNumber numberWithFloat:customization.cameraFrameLineLength];
527
+ result[@"cameraFrameShapeType"] = [NSNumber numberWithFloat:customization.cameraFrameShapeType];
528
+ result[@"cameraFrameOffsetWidth"] = [NSNumber numberWithFloat:customization.cameraFrameOffsetWidth];
529
+ result[@"nextPageAnimationStartDelay"] = [NSNumber numberWithFloat:customization.nextPageAnimationStartDelay];
530
+ result[@"nextPageAnimationEndDelay"] = [NSNumber numberWithFloat:customization.nextPageAnimationEndDelay];
531
+
532
+ // String
533
+ result[@"status"] = customization.status;
534
+ result[@"resultStatus"] = customization.resultStatus;
535
+ result[@"multipageButtonText"] = customization.multipageButtonText;
536
+
537
+ // Color
538
+ result[@"cameraFrameDefaultColor"] = [self intWithColor:customization.cameraFrameDefaultColor];
539
+ result[@"cameraFrameActiveColor"] = [self intWithColor:customization.cameraFrameActiveColor];
540
+ result[@"statusTextColor"] = [self intWithColor:customization.statusTextColor];
541
+ result[@"resultStatusTextColor"] = [self intWithColor:customization.resultStatusTextColor];
542
+ result[@"resultStatusBackgroundColor"] = [self intWithColor:customization.resultStatusBackgroundColor];
543
+ result[@"multipageButtonBackgroundColor"] = [self intWithColor:customization.multipageButtonBackgroundColor];
544
+ result[@"tintColor"] = [self intWithColor:customization.tintColor];
545
+ result[@"activityIndicatorColor"] = [self intWithColor:customization.activityIndicatorColor];
546
+ result[@"statusBackgroundColor"] = [self intWithColor:customization.statusBackgroundColor];
547
+ result[@"cameraPreviewBackgroundColor"] = [self intWithColor:customization.cameraPreviewBackgroundColor];
548
+ result[@"backgroundMaskColor"] = [self intWithColor:customization.backgroundMaskColor];
549
+ result[@"multipageButtonTextColor"] = [self intWithColor:customization.multipageButtonTextColor];
550
+
551
+ // Float
552
+ result[@"statusPositionMultiplier"] = [NSNumber numberWithFloat:customization.statusPositionMultiplier];
553
+ result[@"resultStatusPositionMultiplier"] = [NSNumber numberWithFloat:customization.resultStatusPositionMultiplier];
554
+ result[@"backgroundMaskAlpha"] = [NSNumber numberWithFloat:customization.backgroundMaskAlpha];
555
+ result[@"toolbarSize"] = [NSNumber numberWithFloat:customization.toolbarSize];
556
+ result[@"customStatusPositionMultiplier"] = [NSNumber numberWithFloat:customization.customStatusPositionMultiplier];
557
+ result[@"cameraFrameVerticalPositionMultiplier"] = [NSNumber numberWithFloat:customization.cameraFrameVerticalPositionMultiplier];
558
+ result[@"cameraFrameLandscapeAspectRatio"] = [NSNumber numberWithFloat:customization.cameraFrameLandscapeAspectRatio];
559
+ result[@"cameraFramePortraitAspectRatio"] = [NSNumber numberWithFloat:customization.cameraFramePortraitAspectRatio];
560
+ result[@"cameraFrameCornerRadius"] = [NSNumber numberWithFloat:customization.cameraFrameCornerRadius];
561
+ result[@"livenessAnimationPositionMultiplier"] = [NSNumber numberWithFloat:customization.livenessAnimationPositionMultiplier];
562
+ result[@"activityIndicatorPortraitPositionMultiplier"] = [NSNumber numberWithFloat:customization.activityIndicatorPortraitPositionMultiplier];
563
+ result[@"activityIndicatorLandscapePositionMultiplier"] = [NSNumber numberWithFloat:customization.activityIndicatorLandscapePositionMultiplier];
564
+ result[@"cameraPreviewVerticalPositionMultiplier"] = [NSNumber numberWithFloat:customization.previewLayerPositionMultiplier];
565
+
566
+ // Drawable
567
+ result[@"multipageAnimationFrontImage"] = [RGLWJSONConstructor base64WithImage:customization.multipageAnimationFrontImage];
568
+ result[@"multipageAnimationBackImage"] = [RGLWJSONConstructor base64WithImage:customization.multipageAnimationBackImage];
569
+ result[@"borderBackgroundImage"] = [RGLWJSONConstructor base64WithImage:customization.borderBackgroundImage];
570
+ result[@"helpAnimationImage"] = [RGLWJSONConstructor base64WithImage:customization.helpAnimationImage];
571
+ result[@"closeButtonImage"] = [RGLWJSONConstructor base64WithImage:customization.closeButtonImage];
572
+ result[@"captureButtonImage"] = [RGLWJSONConstructor base64WithImage:customization.captureButtonImage];
573
+ result[@"changeFrameButtonCollapseImage"] = [RGLWJSONConstructor base64WithImage:customization.changeFrameButtonCollapseImage];
574
+ result[@"changeFrameButtonExpandImage"] = [RGLWJSONConstructor base64WithImage:customization.changeFrameButtonExpandImage];
575
+ result[@"cameraSwitchButtonImage"] = [RGLWJSONConstructor base64WithImage:customization.cameraSwitchButtonImage];
576
+ result[@"torchButtonOnImage"] = [RGLWJSONConstructor base64WithImage:customization.torchButtonOnImage];
577
+ result[@"torchButtonOffImage"] = [RGLWJSONConstructor base64WithImage:customization.torchButtonOffImage];
578
+ result[@"livenessAnimationImage"] = [RGLWJSONConstructor base64WithImage:customization.livenessAnimationImage];
579
+
580
+ // Font
581
+ result[@"statusTextFont"] = [self generateUIFont:customization.statusTextFont];
582
+ result[@"resultStatusTextFont"] = [self generateUIFont:customization.resultStatusTextFont];
583
+ result[@"multipageButtonTextFont"] = [self generateUIFont:customization.multipageButtonTextFont];
584
+
585
+ // Custom
586
+ if(customization.customLabelStatus != nil) result[@"customLabelStatus"] = customization.customLabelStatus.string;
587
+ result[@"cameraFrameLineCap"] = [self generateLineCap:customization.cameraFrameLineCap];
588
+ result[@"uiCustomizationLayer"] = customization.customUILayerJSON;
589
+
590
+ // ContentMode
591
+ result[@"helpAnimationImageContentMode"] = [self generateViewContentMode:customization.helpAnimationImageContentMode];
592
+ result[@"multipageAnimationFrontImageContentMode"] = [self generateViewContentMode:customization.multipageAnimationFrontImageContentMode];
593
+ result[@"multipageAnimationBackImageContentMode"] = [self generateViewContentMode:customization.multipageAnimationBackImageContentMode];
594
+ result[@"livenessAnimationImageContentMode"] = [self generateViewContentMode:customization.livenessAnimationImageContentMode];
595
+ result[@"borderBackgroundImageContentMode"] = [self generateViewContentMode:customization.borderBackgroundImageContentMode];
596
+
597
+ result[@"colors"] = [self getColors: [customization.uiConfiguration valueForKey:@"colors"]];
598
+ result[@"fonts"] = [self getFonts: [customization.uiConfiguration valueForKey:@"fonts"]];
599
+ result[@"images"] = [self getImages: [customization.uiConfiguration valueForKey:@"images"]];
600
+
601
+ return result;
602
+ }
603
+
604
+ +(void)setRfidScenario:(NSDictionary*)options :(RGLRFIDScenario*)rfidScenario {
605
+ // Boolean
606
+ if([options valueForKey:@"paceStaticBinding"] != nil)
607
+ rfidScenario.paceStaticBinding = [[options valueForKey:@"paceStaticBinding"] boolValue];
608
+ if([options valueForKey:@"onlineTA"] != nil)
609
+ rfidScenario.onlineTA = [[options valueForKey:@"onlineTA"] boolValue];
610
+ if([options valueForKey:@"writeEid"] != nil)
611
+ rfidScenario.writeEid = [[options valueForKey:@"writeEid"] boolValue];
612
+ if([options valueForKey:@"universalAccessRights"] != nil)
613
+ rfidScenario.universalAccessRights = [[options valueForKey:@"universalAccessRights"] boolValue];
614
+ if([options valueForKey:@"authorizedRestrictedIdentification"] != nil)
615
+ rfidScenario.authorizedRestrictedIdentification = [[options valueForKey:@"authorizedRestrictedIdentification"] boolValue];
616
+ if([options valueForKey:@"auxVerificationCommunityID"] != nil)
617
+ rfidScenario.auxVerificationCommunityID = [[options valueForKey:@"auxVerificationCommunityID"] boolValue];
618
+ if([options valueForKey:@"auxVerificationDateOfBirth"] != nil)
619
+ rfidScenario.auxVerificationDateOfBirth = [[options valueForKey:@"auxVerificationDateOfBirth"] boolValue];
620
+ if([options valueForKey:@"skipAA"] != nil)
621
+ rfidScenario.skipAA = [[options valueForKey:@"skipAA"] boolValue];
622
+ if([options valueForKey:@"strictProcessing"] != nil)
623
+ rfidScenario.strictProcessing = [[options valueForKey:@"strictProcessing"] boolValue];
624
+ if([options valueForKey:@"pkdDSCertPriority"] != nil)
625
+ rfidScenario.pkdDSCertPriority = [[options valueForKey:@"pkdDSCertPriority"] boolValue];
626
+ if([options valueForKey:@"pkdUseExternalCSCA"] != nil)
627
+ rfidScenario.pkdUseExternalCSCA = [[options valueForKey:@"pkdUseExternalCSCA"] boolValue];
628
+ if([options valueForKey:@"trustedPKD"] != nil)
629
+ rfidScenario.trustedPKD = [[options valueForKey:@"trustedPKD"] boolValue];
630
+ if([options valueForKey:@"passiveAuth"] != nil)
631
+ rfidScenario.passiveAuth = [[options valueForKey:@"passiveAuth"] boolValue];
632
+ if([options valueForKey:@"useSFI"] != nil)
633
+ rfidScenario.useSFI = [[options valueForKey:@"useSFI"] boolValue];
634
+ if([options valueForKey:@"readEPassport"] != nil)
635
+ rfidScenario.readEPassport = [[options valueForKey:@"readEPassport"] boolValue];
636
+ if([options valueForKey:@"readEID"] != nil)
637
+ rfidScenario.readEID = [[options valueForKey:@"readEID"] boolValue];
638
+ if([options valueForKey:@"readEDL"] != nil)
639
+ rfidScenario.readEDL = [[options valueForKey:@"readEDL"] boolValue];
640
+ if([options valueForKey:@"authorizedSTSignature"] != nil)
641
+ rfidScenario.authorizedSTSignature = [[options valueForKey:@"authorizedSTSignature"] boolValue];
642
+ if([options valueForKey:@"authorizedSTQSignature"] != nil)
643
+ rfidScenario.authorizedSTQSignature = [[options valueForKey:@"authorizedSTQSignature"] boolValue];
644
+ if([options valueForKey:@"authorizedWriteDG17"] != nil)
645
+ rfidScenario.authorizedWriteDG17 = [[options valueForKey:@"authorizedWriteDG17"] boolValue];
646
+ if([options valueForKey:@"authorizedWriteDG18"] != nil)
647
+ rfidScenario.authorizedWriteDG18 = [[options valueForKey:@"authorizedWriteDG18"] boolValue];
648
+ if([options valueForKey:@"authorizedWriteDG19"] != nil)
649
+ rfidScenario.authorizedWriteDG19 = [[options valueForKey:@"authorizedWriteDG19"] boolValue];
650
+ if([options valueForKey:@"authorizedWriteDG20"] != nil)
651
+ rfidScenario.authorizedWriteDG20 = [[options valueForKey:@"authorizedWriteDG20"] boolValue];
652
+ if([options valueForKey:@"authorizedWriteDG21"] != nil)
653
+ rfidScenario.authorizedWriteDG21 = [[options valueForKey:@"authorizedWriteDG21"] boolValue];
654
+ if([options valueForKey:@"authorizedVerifyAge"] != nil)
655
+ rfidScenario.authorizedVerifyAge = [[options valueForKey:@"authorizedVerifyAge"] boolValue];
656
+ if([options valueForKey:@"authorizedVerifyCommunityID"] != nil)
657
+ rfidScenario.authorizedVerifyCommunityID = [[options valueForKey:@"authorizedVerifyCommunityID"] boolValue];
658
+ if([options valueForKey:@"authorizedPrivilegedTerminal"] != nil)
659
+ rfidScenario.authorizedPrivilegedTerminal = [[options valueForKey:@"authorizedPrivilegedTerminal"] boolValue];
660
+ if([options valueForKey:@"authorizedCANAllowed"] != nil)
661
+ rfidScenario.authorizedCANAllowed = [[options valueForKey:@"authorizedCANAllowed"] boolValue];
662
+ if([options valueForKey:@"authorizedPINManagement"] != nil)
663
+ rfidScenario.authorizedPINManagment = [[options valueForKey:@"authorizedPINManagement"] boolValue];
664
+ if([options valueForKey:@"authorizedInstallCert"] != nil)
665
+ rfidScenario.authorizedInstallCert = [[options valueForKey:@"authorizedInstallCert"] boolValue];
666
+ if([options valueForKey:@"authorizedInstallQCert"] != nil)
667
+ rfidScenario.authorizedInstallQCert = [[options valueForKey:@"authorizedInstallQCert"] boolValue];
668
+ if([options valueForKey:@"applyAmendments"] != nil)
669
+ rfidScenario.applyAmendments = [[options valueForKey:@"applyAmendments"] boolValue];
670
+ if([options valueForKey:@"autoSettings"] != nil)
671
+ rfidScenario.autoSettings = [[options valueForKey:@"autoSettings"] boolValue];
672
+ if([options valueForKey:@"proceedReadingAlways"] != nil)
673
+ rfidScenario.proceedReadingAlways = [[options valueForKey:@"proceedReadingAlways"] boolValue];
674
+ if(options[@"readDTC"]) rfidScenario.readDTC = [options[@"readDTC"] boolValue];
675
+ if(options[@"mrzStrictCheck"]) rfidScenario.mrzStrictCheck = options[@"mrzStrictCheck"];
676
+ if(options[@"loadCRLFromRemote"]) rfidScenario.loadCRLFromRemote = [options[@"loadCRLFromRemote"] boolValue];
677
+ if(options[@"independentSODStatus"]) rfidScenario.independentSODStatus = options[@"independentSODStatus"];
678
+
679
+ // Int
680
+ if([options valueForKey:@"signManagementAction"] != nil)
681
+ rfidScenario.signManagementAction = [[options valueForKey:@"signManagementAction"] integerValue];
682
+ if([options valueForKey:@"readingBuffer"] != nil)
683
+ rfidScenario.readingBuffer = [[options valueForKey:@"readingBuffer"] integerValue];
684
+ if([options valueForKey:@"onlineTAToSignDataType"] != nil)
685
+ rfidScenario.onlineTAToSignDataType = [[options valueForKey:@"onlineTAToSignDataType"] intValue];
686
+ if([options valueForKey:@"profilerType"] != nil)
687
+ rfidScenario.profilerType = [[options valueForKey:@"profilerType"] intValue];
688
+ if([options valueForKey:@"authProcType"] != nil)
689
+ rfidScenario.authProcType = [[options valueForKey:@"authProcType"] integerValue];
690
+ if([options valueForKey:@"baseSMProcedure"] != nil)
691
+ rfidScenario.baseSMProcedure = [[options valueForKey:@"baseSMProcedure"] integerValue];
692
+ if([options valueForKey:@"pacePasswordType"] != nil)
693
+ rfidScenario.pacePasswordType = [[options valueForKey:@"pacePasswordType"] integerValue];
694
+ if([options valueForKey:@"terminalType"] != nil)
695
+ rfidScenario.terminalType = [[options valueForKey:@"terminalType"] integerValue];
696
+ if([options valueForKey:@"defaultReadingBufferSize"] != nil)
697
+ rfidScenario.defaultReadingBufferSize = [[options valueForKey:@"defaultReadingBufferSize"] intValue];
698
+
699
+ // String
700
+ if([options valueForKey:@"password"] != nil)
701
+ rfidScenario.password = [options valueForKey:@"password"];
702
+ if([options valueForKey:@"pkdPA"] != nil)
703
+ rfidScenario.pkdPA = [options valueForKey:@"pkdPA"];
704
+ if([options valueForKey:@"pkdEAC"] != nil)
705
+ rfidScenario.pkdEAC = [options valueForKey:@"pkdEAC"];
706
+ if([options valueForKey:@"mrz"] != nil)
707
+ rfidScenario.mrz = [options valueForKey:@"mrz"];
708
+ if([options valueForKey:@"eSignPINDefault"] != nil)
709
+ rfidScenario.eSignPINDefault = [options valueForKey:@"eSignPINDefault"];
710
+ if([options valueForKey:@"eSignPINNewValue"] != nil)
711
+ rfidScenario.eSignPINNewValue = [options valueForKey:@"eSignPINNewValue"];
712
+ if(options[@"cardAccess"]) rfidScenario.cardAccess = options[@"cardAccess"];
713
+ if(options[@"mrzHash"]) rfidScenario.mrzHash = options[@"mrzHash"];
714
+ if(options[@"documentNumber"]) rfidScenario.documentNumber = options[@"documentNumber"];
715
+ if(options[@"dateOfBirth"]) rfidScenario.dateOfBirth = options[@"dateOfBirth"];
716
+ if(options[@"dateOfExpiry"]) rfidScenario.dateOfExpiry = options[@"dateOfExpiry"];
717
+
718
+ // DataGroup
719
+ if([options valueForKey:@"ePassportDataGroups"] != nil)
720
+ [self setDataGroups :rfidScenario.ePassportDataGroups dict:[options valueForKey:@"ePassportDataGroups"]];
721
+ if([options valueForKey:@"eIDDataGroups"] != nil)
722
+ [self setDataGroups :rfidScenario.eIDDataGroups dict:[options valueForKey:@"eIDDataGroups"]];
723
+ if([options valueForKey:@"eDLDataGroups"] != nil)
724
+ [self setDataGroups :rfidScenario.eDLDataGroups dict:[options valueForKey:@"eDLDataGroups"]];
725
+ if(options[@"dtcDataGroups"]) [self setDTCDataGroup :rfidScenario.DTCDataGroups dict:options[@"dtcDataGroups"]];
726
+ }
727
+
728
+ +(NSDictionary*)getRfidScenario:(RGLRFIDScenario*)rfidScenario {
729
+ NSMutableDictionary *result = [NSMutableDictionary new];
730
+
731
+ // Boolean
732
+ result[@"paceStaticBinding"] = [NSNumber numberWithBool:rfidScenario.paceStaticBinding];
733
+ result[@"onlineTA"] = [NSNumber numberWithBool:rfidScenario.onlineTA];
734
+ result[@"writeEid"] = [NSNumber numberWithBool:rfidScenario.writeEid];
735
+ result[@"universalAccessRights"] = [NSNumber numberWithBool:rfidScenario.universalAccessRights];
736
+ result[@"authorizedRestrictedIdentification"] = [NSNumber numberWithBool:rfidScenario.authorizedRestrictedIdentification];
737
+ result[@"auxVerificationCommunityID"] = [NSNumber numberWithBool:rfidScenario.auxVerificationCommunityID];
738
+ result[@"auxVerificationDateOfBirth"] = [NSNumber numberWithBool:rfidScenario.auxVerificationDateOfBirth];
739
+ result[@"skipAA"] = [NSNumber numberWithBool:rfidScenario.skipAA];
740
+ result[@"strictProcessing"] = [NSNumber numberWithBool:rfidScenario.strictProcessing];
741
+ result[@"pkdDSCertPriority"] = [NSNumber numberWithBool:rfidScenario.pkdDSCertPriority];
742
+ result[@"pkdUseExternalCSCA"] = [NSNumber numberWithBool:rfidScenario.pkdUseExternalCSCA];
743
+ result[@"trustedPKD"] = [NSNumber numberWithBool:rfidScenario.trustedPKD];
744
+ result[@"passiveAuth"] = [NSNumber numberWithBool:rfidScenario.passiveAuth];
745
+ result[@"useSFI"] = [NSNumber numberWithBool:rfidScenario.useSFI];
746
+ result[@"readEPassport"] = [NSNumber numberWithBool:rfidScenario.readEPassport];
747
+ result[@"readEID"] = [NSNumber numberWithBool:rfidScenario.readEID];
748
+ result[@"readEDL"] = [NSNumber numberWithBool:rfidScenario.readEDL];
749
+ result[@"authorizedSTSignature"] = [NSNumber numberWithBool:rfidScenario.authorizedSTSignature];
750
+ result[@"authorizedSTQSignature"] = [NSNumber numberWithBool:rfidScenario.authorizedSTQSignature];
751
+ result[@"authorizedWriteDG17"] = [NSNumber numberWithBool:rfidScenario.authorizedWriteDG17];
752
+ result[@"authorizedWriteDG18"] = [NSNumber numberWithBool:rfidScenario.authorizedWriteDG18];
753
+ result[@"authorizedWriteDG19"] = [NSNumber numberWithBool:rfidScenario.authorizedWriteDG19];
754
+ result[@"authorizedWriteDG20"] = [NSNumber numberWithBool:rfidScenario.authorizedWriteDG20];
755
+ result[@"authorizedWriteDG21"] = [NSNumber numberWithBool:rfidScenario.authorizedWriteDG21];
756
+ result[@"authorizedVerifyAge"] = [NSNumber numberWithBool:rfidScenario.authorizedVerifyAge];
757
+ result[@"authorizedVerifyCommunityID"] = [NSNumber numberWithBool:rfidScenario.authorizedVerifyCommunityID];
758
+ result[@"authorizedPrivilegedTerminal"] = [NSNumber numberWithBool:rfidScenario.authorizedPrivilegedTerminal];
759
+ result[@"authorizedCANAllowed"] = [NSNumber numberWithBool:rfidScenario.authorizedCANAllowed];
760
+ result[@"authorizedPINManagement"] = [NSNumber numberWithBool:rfidScenario.authorizedPINManagment];
761
+ result[@"authorizedInstallCert"] = [NSNumber numberWithBool:rfidScenario.authorizedInstallCert];
762
+ result[@"authorizedInstallQCert"] = [NSNumber numberWithBool:rfidScenario.authorizedInstallQCert];
763
+ result[@"applyAmendments"] = [NSNumber numberWithBool:rfidScenario.applyAmendments];
764
+ result[@"autoSettings"] = [NSNumber numberWithBool:rfidScenario.autoSettings];
765
+ result[@"proceedReadingAlways"] = [NSNumber numberWithBool:rfidScenario.proceedReadingAlways];
766
+ result[@"readDTC"] = [NSNumber numberWithBool:rfidScenario.readDTC];
767
+ result[@"mrzStrictCheck"] = rfidScenario.mrzStrictCheck;
768
+ result[@"loadCRLFromRemote"] = @(rfidScenario.loadCRLFromRemote);
769
+ result[@"independentSODStatus"] = rfidScenario.independentSODStatus;
770
+
771
+ // Int
772
+ result[@"signManagementAction"] = [NSNumber numberWithInteger:rfidScenario.signManagementAction];
773
+ result[@"readingBuffer"] = [NSNumber numberWithInteger:rfidScenario.readingBuffer];
774
+ result[@"onlineTAToSignDataType"] = [NSNumber numberWithInteger:rfidScenario.onlineTAToSignDataType];
775
+ result[@"profilerType"] = [NSNumber numberWithInteger:rfidScenario.profilerType];
776
+ result[@"authProcType"] = [NSNumber numberWithInteger:rfidScenario.authProcType];
777
+ result[@"baseSMProcedure"] = [NSNumber numberWithInteger:rfidScenario.baseSMProcedure];
778
+ result[@"pacePasswordType"] = [NSNumber numberWithInteger:rfidScenario.pacePasswordType];
779
+ result[@"terminalType"] = [NSNumber numberWithInteger:rfidScenario.terminalType];
780
+ result[@"defaultReadingBufferSize"] = [NSNumber numberWithInteger:rfidScenario.defaultReadingBufferSize];
781
+
782
+ // String
783
+ result[@"password"] = rfidScenario.password;
784
+ result[@"pkdPA"] = rfidScenario.pkdPA;
785
+ result[@"pkdEAC"] = rfidScenario.pkdEAC;
786
+ result[@"mrz"] = rfidScenario.mrz;
787
+ result[@"eSignPINDefault"] = rfidScenario.eSignPINDefault;
788
+ result[@"eSignPINNewValue"] = rfidScenario.eSignPINNewValue;
789
+ result[@"cardAccess"] = rfidScenario.cardAccess;
790
+ result[@"mrzHash"] = rfidScenario.mrzHash;
791
+ result[@"documentNumber"] = rfidScenario.documentNumber;
792
+ result[@"dateOfBirth"] = rfidScenario.dateOfBirth;
793
+ result[@"dateOfExpiry"] = rfidScenario.dateOfExpiry;
794
+
795
+ // DataGroup
796
+ result[@"eDLDataGroups"] = [self getDataGroups:rfidScenario.eDLDataGroups];
797
+ result[@"ePassportDataGroups"] = [self getDataGroups:rfidScenario.ePassportDataGroups];
798
+ result[@"eIDDataGroups"] = [self getDataGroups:rfidScenario.eIDDataGroups];
799
+ result[@"dtcDataGroups"] = [self getDTCDataGroup:rfidScenario.DTCDataGroups];
800
+
801
+ return result;
802
+ }
803
+
804
+ +(void)setDataGroups:(RGLDataGroup*)dataGroup dict:(NSDictionary*)dict {
805
+
806
+ // EDLDataGroups/Common: 1-14
807
+ if([dict valueForKey:@"DG1"] != nil)
808
+ dataGroup.dG1 = [[dict valueForKey:@"DG1"] boolValue];
809
+ if([dict valueForKey:@"DG2"] != nil)
810
+ dataGroup.dG2 = [[dict valueForKey:@"DG2"] boolValue];
811
+ if([dict valueForKey:@"DG3"] != nil)
812
+ dataGroup.dG3 = [[dict valueForKey:@"DG3"] boolValue];
813
+ if([dict valueForKey:@"DG4"] != nil)
814
+ dataGroup.dG4 = [[dict valueForKey:@"DG4"] boolValue];
815
+ if([dict valueForKey:@"DG5"] != nil)
816
+ dataGroup.dG5 = [[dict valueForKey:@"DG5"] boolValue];
817
+ if([dict valueForKey:@"DG6"] != nil)
818
+ dataGroup.dG6 = [[dict valueForKey:@"DG6"] boolValue];
819
+ if([dict valueForKey:@"DG7"] != nil)
820
+ dataGroup.dG7 = [[dict valueForKey:@"DG7"] boolValue];
821
+ if([dict valueForKey:@"DG8"] != nil)
822
+ dataGroup.dG8 = [[dict valueForKey:@"DG8"] boolValue];
823
+ if([dict valueForKey:@"DG9"] != nil)
824
+ dataGroup.dG9 = [[dict valueForKey:@"DG9"] boolValue];
825
+ if([dict valueForKey:@"DG10"] != nil)
826
+ dataGroup.dG10 = [[dict valueForKey:@"DG10"] boolValue];
827
+ if([dict valueForKey:@"DG11"] != nil)
828
+ dataGroup.dG11 = [[dict valueForKey:@"DG11"] boolValue];
829
+ if([dict valueForKey:@"DG12"] != nil)
830
+ dataGroup.dG12 = [[dict valueForKey:@"DG12"] boolValue];
831
+ if([dict valueForKey:@"DG13"] != nil)
832
+ dataGroup.dG13 = [[dict valueForKey:@"DG13"] boolValue];
833
+ if([dict valueForKey:@"DG14"] != nil)
834
+ dataGroup.dG14 = [[dict valueForKey:@"DG14"] boolValue];
835
+
836
+ // EPassportDataGroups: 1-16
837
+ if ([dataGroup class] == [RGLePassportDataGroup class]) {
838
+ if([dict valueForKey:@"DG15"] != nil)
839
+ ((RGLePassportDataGroup*)dataGroup).dG15 = [[dict valueForKey:@"DG15"] boolValue];
840
+ if([dict valueForKey:@"DG16"] != nil)
841
+ ((RGLePassportDataGroup*)dataGroup).dG16 = [[dict valueForKey:@"DG16"] boolValue];
842
+ }
843
+
844
+ // EIDDataGroups: 1-21
845
+ if ([dataGroup class] == [RGLeIDDataGroup class]) {
846
+ if([dict valueForKey:@"DG15"] != nil)
847
+ ((RGLeIDDataGroup*)dataGroup).dG15 = [[dict valueForKey:@"DG15"] boolValue];
848
+ if([dict valueForKey:@"DG16"] != nil)
849
+ ((RGLeIDDataGroup*)dataGroup).dG16 = [[dict valueForKey:@"DG16"] boolValue];
850
+ if([dict valueForKey:@"DG17"] != nil)
851
+ ((RGLeIDDataGroup*)dataGroup).dG17 = [[dict valueForKey:@"DG17"] boolValue];
852
+ if([dict valueForKey:@"DG18"] != nil)
853
+ ((RGLeIDDataGroup*)dataGroup).dG18 = [[dict valueForKey:@"DG18"] boolValue];
854
+ if([dict valueForKey:@"DG19"] != nil)
855
+ ((RGLeIDDataGroup*)dataGroup).dG19 = [[dict valueForKey:@"DG19"] boolValue];
856
+ if([dict valueForKey:@"DG20"] != nil)
857
+ ((RGLeIDDataGroup*)dataGroup).dG20 = [[dict valueForKey:@"DG20"] boolValue];
858
+ if([dict valueForKey:@"DG21"] != nil)
859
+ ((RGLeIDDataGroup*)dataGroup).dG21 = [[dict valueForKey:@"DG21"] boolValue];
860
+ }
861
+ }
862
+
863
+ +(NSDictionary *)getDataGroups:(RGLDataGroup*)dataGroup {
864
+ NSMutableDictionary *result = [NSMutableDictionary new];
865
+
866
+ // EDLDataGroups/Common: 1-14
867
+ result[@"DG1"] = [NSNumber numberWithBool:dataGroup.dG1];
868
+ result[@"DG2"] = [NSNumber numberWithBool:dataGroup.dG2];
869
+ result[@"DG3"] = [NSNumber numberWithBool:dataGroup.dG3];
870
+ result[@"DG4"] = [NSNumber numberWithBool:dataGroup.dG4];
871
+ result[@"DG5"] = [NSNumber numberWithBool:dataGroup.dG5];
872
+ result[@"DG6"] = [NSNumber numberWithBool:dataGroup.dG6];
873
+ result[@"DG7"] = [NSNumber numberWithBool:dataGroup.dG7];
874
+ result[@"DG8"] = [NSNumber numberWithBool:dataGroup.dG8];
875
+ result[@"DG9"] = [NSNumber numberWithBool:dataGroup.dG9];
876
+ result[@"DG10"] = [NSNumber numberWithBool:dataGroup.dG10];
877
+ result[@"DG11"] = [NSNumber numberWithBool:dataGroup.dG11];
878
+ result[@"DG12"] = [NSNumber numberWithBool:dataGroup.dG12];
879
+ result[@"DG13"] = [NSNumber numberWithBool:dataGroup.dG13];
880
+ result[@"DG14"] = [NSNumber numberWithBool:dataGroup.dG14];
881
+
882
+ // EPassportDataGroups: 1-16
883
+ if ([dataGroup class] == [RGLePassportDataGroup class]) {
884
+ result[@"DG15"] = [NSNumber numberWithBool:((RGLePassportDataGroup*)dataGroup).dG15];
885
+ result[@"DG16"] = [NSNumber numberWithBool:((RGLePassportDataGroup*)dataGroup).dG16];
886
+ }
887
+
888
+ // EIDDataGroups: 1-21
889
+ if ([dataGroup class] == [RGLeIDDataGroup class]) {
890
+ result[@"DG15"] = [NSNumber numberWithBool:((RGLeIDDataGroup*)dataGroup).dG15];
891
+ result[@"DG16"] = [NSNumber numberWithBool:((RGLeIDDataGroup*)dataGroup).dG16];
892
+ result[@"DG17"] = [NSNumber numberWithBool:((RGLeIDDataGroup*)dataGroup).dG17];
893
+ result[@"DG18"] = [NSNumber numberWithBool:((RGLeIDDataGroup*)dataGroup).dG18];
894
+ result[@"DG19"] = [NSNumber numberWithBool:((RGLeIDDataGroup*)dataGroup).dG19];
895
+ result[@"DG20"] = [NSNumber numberWithBool:((RGLeIDDataGroup*)dataGroup).dG20];
896
+ result[@"DG21"] = [NSNumber numberWithBool:((RGLeIDDataGroup*)dataGroup).dG21];
897
+ }
898
+
899
+ return result;
900
+ }
901
+
902
+ +(void)setDTCDataGroup:(RGLDTCDataGroup*)dataGroup dict:(NSDictionary*)dict {
903
+ if(dict[@"DG17"]) dataGroup.dG17 = [dict[@"DG17"] boolValue];
904
+ if(dict[@"DG18"]) dataGroup.dG18 = [dict[@"DG18"] boolValue];
905
+ if(dict[@"DG22"]) dataGroup.dG22 = [dict[@"DG22"] boolValue];
906
+ if(dict[@"DG23"]) dataGroup.dG23 = [dict[@"DG23"] boolValue];
907
+ if(dict[@"DG24"]) dataGroup.dG24 = [dict[@"DG24"] boolValue];
908
+ }
909
+
910
+ +(NSDictionary *)getDTCDataGroup:(RGLDTCDataGroup*)dataGroup {
911
+ NSMutableDictionary *result = [NSMutableDictionary new];
912
+
913
+ result[@"DG17"] = @(dataGroup.dG17);
914
+ result[@"DG18"] = @(dataGroup.dG18);
915
+ result[@"DG22"] = @(dataGroup.dG22);
916
+ result[@"DG23"] = @(dataGroup.dG23);
917
+ result[@"DG24"] = @(dataGroup.dG24);
918
+
919
+ return result;
920
+ }
921
+
922
+ +(void)setImageQA:(RGLImageQA*)result input:(NSDictionary*)input {
923
+ if([input valueForKey:@"dpiThreshold"] != nil)
924
+ result.dpiThreshold = [input valueForKey:@"dpiThreshold"];
925
+ if([input valueForKey:@"angleThreshold"] != nil)
926
+ result.angleThreshold = [input valueForKey:@"angleThreshold"];
927
+ if([input valueForKey:@"focusCheck"] != nil)
928
+ result.focusCheck = [input valueForKey:@"focusCheck"];
929
+ if([input valueForKey:@"glaresCheck"] != nil)
930
+ result.glaresCheck = [input valueForKey:@"glaresCheck"];
931
+ if([input valueForKey:@"colornessCheck"] != nil)
932
+ result.colornessCheck = [input valueForKey:@"colornessCheck"];
933
+ if([input valueForKey:@"screenCapture"] != nil)
934
+ result.screenCapture = [input valueForKey:@"screenCapture"];
935
+ if (input[@"expectedPass"]) {
936
+ NSMutableArray<RGLImageQualityCheckType>* expectedPass = @[].mutableCopy;
937
+ for(NSNumber* item in input[@"expectedPass"]) [expectedPass addObject:[self imageQualityCheckTypeWithNumber:item]];
938
+ result.expectedPass = expectedPass;
939
+ }
940
+ if([input valueForKey:@"documentPositionIndent"] != nil)
941
+ result.documentPositionIndent = [input valueForKey:@"documentPositionIndent"];
942
+ if([input valueForKey:@"glaresCheckParams"] != nil)
943
+ result.glaresCheckParams = [RGLWJSONConstructor glaresCheckParamsFromJson:[input valueForKey:@"glaresCheckParams"]];
944
+ if([input valueForKey:@"brightnessThreshold"] != nil)
945
+ result.brightnessThreshold = [input valueForKey:@"brightnessThreshold"];
946
+ if(input[@"occlusionCheck"]) result.occlusionCheck = input[@"occlusionCheck"];
947
+ }
948
+
949
+ +(NSDictionary*)getImageQA:(RGLImageQA*)input {
950
+ NSMutableDictionary *result = [NSMutableDictionary new];
951
+
952
+ result[@"dpiThreshold"] = input.dpiThreshold;
953
+ result[@"angleThreshold"] = input.angleThreshold;
954
+ result[@"focusCheck"] = input.focusCheck;
955
+ result[@"glaresCheck"] = input.glaresCheck;
956
+ result[@"colornessCheck"] = input.colornessCheck;
957
+ result[@"screenCapture"] = input.screenCapture;
958
+ if (input.expectedPass) {
959
+ NSMutableArray<NSNumber*>* expectedPass = @[].mutableCopy;
960
+ for(RGLImageQualityCheckType item in input.expectedPass) [expectedPass addObject:[self generateImageQualityCheckType:item]];
961
+ result[@"expectedPass"] = expectedPass;
962
+ }
963
+ result[@"documentPositionIndent"] = input.documentPositionIndent;
964
+ result[@"glaresCheckParams"] = [RGLWJSONConstructor generateGlaresCheckParams:input.glaresCheckParams];
965
+ result[@"brightnessThreshold"] = input.brightnessThreshold;
966
+ result[@"occlusionCheck"] = input.occlusionCheck;
967
+
968
+ return result;
969
+ }
970
+
971
+ +(void)setAuthenticityParams:(RGLAuthenticityParams*)result input:(NSDictionary*)input {
972
+ if([input valueForKey:@"useLivenessCheck"] != nil)
973
+ result.useLivenessCheck = [input valueForKey:@"useLivenessCheck"];
974
+ if([input valueForKey:@"livenessParams"] != nil) {
975
+ if(result.livenessParams == nil) result.livenessParams = [RGLLivenessParams defaultParams];
976
+ [self setLivenessParams:result.livenessParams input:[input valueForKey:@"livenessParams"]];
977
+ }
978
+ if([input valueForKey:@"checkUVLuminiscence"] != nil)
979
+ result.checkUVLuminiscence = [input valueForKey:@"checkUVLuminiscence"];
980
+ if([input valueForKey:@"checkIRB900"] != nil)
981
+ result.checkIRB900 = [input valueForKey:@"checkIRB900"];
982
+ if([input valueForKey:@"checkImagePatterns"] != nil)
983
+ result.checkImagePatterns = [input valueForKey:@"checkImagePatterns"];
984
+ if([input valueForKey:@"checkFibers"] != nil)
985
+ result.checkFibers = [input valueForKey:@"checkFibers"];
986
+ if([input valueForKey:@"checkExtMRZ"] != nil)
987
+ result.checkExtMRZ = [input valueForKey:@"checkExtMRZ"];
988
+ if([input valueForKey:@"checkExtOCR"] != nil)
989
+ result.checkExtOCR = [input valueForKey:@"checkExtOCR"];
990
+ if([input valueForKey:@"checkAxial"] != nil)
991
+ result.checkAxial = [input valueForKey:@"checkAxial"];
992
+ if([input valueForKey:@"checkBarcodeFormat"] != nil)
993
+ result.checkBarcodeFormat = [input valueForKey:@"checkBarcodeFormat"];
994
+ if([input valueForKey:@"checkIRVisibility"] != nil)
995
+ result.checkIRVisibility = [input valueForKey:@"checkIRVisibility"];
996
+ if([input valueForKey:@"checkIPI"] != nil)
997
+ result.checkIPI = [input valueForKey:@"checkIPI"];
998
+ if([input valueForKey:@"checkPhotoEmbedding"] != nil)
999
+ result.checkPhotoEmbedding = [input valueForKey:@"checkPhotoEmbedding"];
1000
+ if([input valueForKey:@"checkPhotoComparison"] != nil)
1001
+ result.checkPhotoComparison = [input valueForKey:@"checkPhotoComparison"];
1002
+ if([input valueForKey:@"checkLetterScreen"] != nil)
1003
+ result.checkLetterScreen = [input valueForKey:@"checkLetterScreen"];
1004
+ if(input[@"checkSecurityText"]) result.checkSecurityText = input[@"checkSecurityText"];
1005
+ }
1006
+
1007
+ +(NSDictionary*)getAuthenticityParams:(RGLAuthenticityParams*)input {
1008
+ if(input == nil) return nil;
1009
+ NSMutableDictionary *result = [NSMutableDictionary new];
1010
+
1011
+ result[@"useLivenessCheck"] = input.useLivenessCheck;
1012
+ result[@"livenessParams"] = [self getLivenessParams:input.livenessParams];
1013
+ result[@"checkUVLuminiscence"] = input.checkUVLuminiscence;
1014
+ result[@"checkIRB900"] = input.checkIRB900;
1015
+ result[@"checkImagePatterns"] = input.checkImagePatterns;
1016
+ result[@"checkFibers"] = input.checkFibers;
1017
+ result[@"checkExtMRZ"] = input.checkExtMRZ;
1018
+ result[@"checkExtOCR"] = input.checkExtOCR;
1019
+ result[@"checkAxial"] = input.checkAxial;
1020
+ result[@"checkBarcodeFormat"] = input.checkBarcodeFormat;
1021
+ result[@"checkIRVisibility"] = input.checkIRVisibility;
1022
+ result[@"checkIPI"] = input.checkIPI;
1023
+ result[@"checkPhotoEmbedding"] = input.checkPhotoEmbedding;
1024
+ result[@"checkPhotoComparison"] = input.checkPhotoComparison;
1025
+ result[@"checkLetterScreen"] = input.checkLetterScreen;
1026
+ result[@"checkSecurityText"] = input.checkSecurityText;
1027
+
1028
+ return result;
1029
+ }
1030
+
1031
+ +(void)setLivenessParams:(RGLLivenessParams*)result input:(NSDictionary*)input {
1032
+ if([input valueForKey:@"checkOVI"] != nil)
1033
+ result.checkOVI = [input valueForKey:@"checkOVI"];
1034
+ if([input valueForKey:@"checkMLI"] != nil)
1035
+ result.checkMLI = [input valueForKey:@"checkMLI"];
1036
+ if([input valueForKey:@"checkHolo"] != nil)
1037
+ result.checkHolo = [input valueForKey:@"checkHolo"];
1038
+ if([input valueForKey:@"checkED"] != nil)
1039
+ result.checkED = [input valueForKey:@"checkED"];
1040
+ if(input[@"checkBlackAndWhiteCopy"]) result.checkBlackAndWhiteCopy = input[@"checkBlackAndWhiteCopy"];
1041
+ if(input[@"checkDynaprint"]) result.checkDynaprint = input[@"checkDynaprint"];
1042
+ if(input[@"checkGeometry"]) result.checkGeometry = input[@"checkGeometry"];
1043
+ }
1044
+
1045
+ +(NSDictionary*)getLivenessParams:(RGLLivenessParams*)input {
1046
+ if(input == nil) return nil;
1047
+ NSMutableDictionary *result = [NSMutableDictionary new];
1048
+
1049
+ result[@"checkOVI"] = input.checkOVI;
1050
+ result[@"checkMLI"] = input.checkMLI;
1051
+ result[@"checkHolo"] = input.checkHolo;
1052
+ result[@"checkED"] = input.checkED;
1053
+ result[@"checkBlackAndWhiteCopy"] = input.checkBlackAndWhiteCopy;
1054
+ result[@"checkDynaprint"] = input.checkDynaprint;
1055
+ result[@"checkGeometry"] = input.checkGeometry;
1056
+
1057
+ return result;
1058
+ }
1059
+
1060
+ +(void)setColors:(NSMutableDictionary*)result input:(NSDictionary*)input {
1061
+ if([input valueForKey:@"rfidProcessingScreenBackground"] != nil)
1062
+ result[@(RFIDProcessingScreenBackground)] = [self colorWithInt:[input valueForKey:@"rfidProcessingScreenBackground"]];
1063
+ if([input valueForKey:@"rfidProcessingScreenHintLabelText"] != nil)
1064
+ result[@(RFIDProcessingScreenHintLabelText)] = [self colorWithInt:[input valueForKey:@"rfidProcessingScreenHintLabelText"]];
1065
+ if([input valueForKey:@"rfidProcessingScreenHintLabelBackground"] != nil)
1066
+ result[@(RFIDProcessingScreenHintLabelBackground)] = [self colorWithInt:[input valueForKey:@"rfidProcessingScreenHintLabelBackground"]];
1067
+ if([input valueForKey:@"rfidProcessingScreenProgressLabelText"] != nil)
1068
+ result[@(RFIDProcessingScreenProgressLabelText)] = [self colorWithInt:[input valueForKey:@"rfidProcessingScreenProgressLabelText"]];
1069
+ if([input valueForKey:@"rfidProcessingScreenProgressBar"] != nil)
1070
+ result[@(RFIDProcessingScreenProgressBar)] = [self colorWithInt:[input valueForKey:@"rfidProcessingScreenProgressBar"]];
1071
+ if([input valueForKey:@"rfidProcessingScreenProgressBarBackground"] != nil)
1072
+ result[@(RFIDProcessingScreenProgressBarBackground)] = [self colorWithInt:[input valueForKey:@"rfidProcessingScreenProgressBarBackground"]];
1073
+ if([input valueForKey:@"rfidProcessingScreenResultLabelText"] != nil)
1074
+ result[@(RFIDProcessingScreenResultLabelText)] = [self colorWithInt:[input valueForKey:@"rfidProcessingScreenResultLabelText"]];
1075
+ if([input valueForKey:@"rfidProcessingScreenLoadingBar"] != nil)
1076
+ result[@(RFIDProcessingScreenLoadingBar)] = [self colorWithInt:[input valueForKey:@"rfidProcessingScreenLoadingBar"]];
1077
+ }
1078
+
1079
+ +(NSDictionary*)getColors:(NSDictionary*)input {
1080
+ return @{
1081
+ @"rfidProcessingScreenBackground": [self intWithColor:input[@(RFIDProcessingScreenBackground)]],
1082
+ @"rfidProcessingScreenHintLabelText": [self intWithColor:input[@(RFIDProcessingScreenHintLabelText)]],
1083
+ @"rfidProcessingScreenHintLabelBackground": [self intWithColor:input[@(RFIDProcessingScreenHintLabelBackground)]],
1084
+ @"rfidProcessingScreenProgressLabelText": [self intWithColor:input[@(RFIDProcessingScreenProgressLabelText)]],
1085
+ @"rfidProcessingScreenProgressBar": [self intWithColor:input[@(RFIDProcessingScreenProgressBar)]],
1086
+ @"rfidProcessingScreenProgressBarBackground": [self intWithColor:input[@(RFIDProcessingScreenProgressBarBackground)]],
1087
+ @"rfidProcessingScreenResultLabelText": [self intWithColor:input[@(RFIDProcessingScreenResultLabelText)]],
1088
+ @"rfidProcessingScreenLoadingBar": [self intWithColor:input[@(RFIDProcessingScreenLoadingBar)]],
1089
+ };
1090
+ }
1091
+
1092
+ +(void)setFonts:(NSMutableDictionary*)result input:(NSDictionary*)input {
1093
+ if([input valueForKey:@"rfidProcessingScreenHintLabel"] != nil)
1094
+ result[@(RFIDProcessingScreenHintLabel)] = [self UIFontFromJSON:[input valueForKey:@"rfidProcessingScreenHintLabel"]];
1095
+ if([input valueForKey:@"rfidProcessingScreenProgressLabel"] != nil)
1096
+ result[@(RFIDProcessingScreenProgressLabel)] = [self UIFontFromJSON:[input valueForKey:@"rfidProcessingScreenProgressLabel"]];
1097
+ if([input valueForKey:@"rfidProcessingScreenResultLabel"] != nil)
1098
+ result[@(RFIDProcessingScreenResultLabel)] = [self UIFontFromJSON:[input valueForKey:@"rfidProcessingScreenResultLabel"]];
1099
+ }
1100
+
1101
+ +(NSDictionary*)getFonts:(NSDictionary*)input {
1102
+ return @{
1103
+ @"rfidProcessingScreenHintLabel": [self generateUIFont:input[@(RFIDProcessingScreenHintLabel)]],
1104
+ @"rfidProcessingScreenProgressLabel": [self generateUIFont:input[@(RFIDProcessingScreenProgressLabel)]],
1105
+ @"rfidProcessingScreenResultLabel": [self generateUIFont:input[@(RFIDProcessingScreenResultLabel)]],
1106
+ };
1107
+ }
1108
+
1109
+ +(void)setImages:(NSMutableDictionary*)result input:(NSDictionary*)input {
1110
+ if([input valueForKey:@"rfidProcessingScreenFailureImage"] != nil)
1111
+ result[@(RFIDProcessingScreenFailureImage)] = [RGLWJSONConstructor imageWithBase64:[input valueForKey:@"rfidProcessingScreenFailureImage"]];
1112
+ }
1113
+
1114
+ +(NSDictionary*)getImages:(NSDictionary*)input {
1115
+ return @{
1116
+ @"rfidProcessingScreenFailureImage": [RGLWJSONConstructor base64WithImage:input[@(RFIDProcessingScreenFailureImage)]],
1117
+ };
1118
+ }
1119
+
1120
+ +(UIColor*)colorWithInt:(NSNumber*)input {
1121
+ // Convert hex int to hex string
1122
+ NSInteger hexInt = [input integerValue];
1123
+ NSString* numbers = @"0123456789ABCDEF";
1124
+ NSString* hexString = @"";
1125
+ while(hexInt>0){
1126
+ int digit = hexInt % 16;
1127
+ hexString = [NSString stringWithFormat:@"%@%@", [numbers substringWithRange:NSMakeRange(digit, 1)], hexString];
1128
+ hexInt = hexInt/16;
1129
+ }
1130
+ // If we use int, then all the starting zeros are lost: 0x0F123456 == 0xF123456
1131
+ if(hexString.length == 5 || hexString.length == 7)
1132
+ hexString = [NSString stringWithFormat:@"0%@", hexString];
1133
+ hexString = [NSString stringWithFormat:@"#%@", hexString];
1134
+
1135
+ // Convert hex string to UIColor
1136
+ NSString *colorString = [[hexString stringByReplacingOccurrencesOfString: @"#" withString: @""] uppercaseString];
1137
+ CGFloat alpha, red, blue, green;
1138
+ switch ([colorString length]) {
1139
+ case 3: // #RGB
1140
+ alpha = 1.0f;
1141
+ red = [self colorComponentFrom: colorString start: 0 length: 1];
1142
+ green = [self colorComponentFrom: colorString start: 1 length: 1];
1143
+ blue = [self colorComponentFrom: colorString start: 2 length: 1];
1144
+ break;
1145
+ case 4: // #ARGB
1146
+ alpha = [self colorComponentFrom: colorString start: 0 length: 1];
1147
+ red = [self colorComponentFrom: colorString start: 1 length: 1];
1148
+ green = [self colorComponentFrom: colorString start: 2 length: 1];
1149
+ blue = [self colorComponentFrom: colorString start: 3 length: 1];
1150
+ break;
1151
+ case 6: // #RRGGBB
1152
+ alpha = 1.0f;
1153
+ red = [self colorComponentFrom: colorString start: 0 length: 2];
1154
+ green = [self colorComponentFrom: colorString start: 2 length: 2];
1155
+ blue = [self colorComponentFrom: colorString start: 4 length: 2];
1156
+ break;
1157
+ case 8: // #AARRGGBB
1158
+ alpha = [self colorComponentFrom: colorString start: 0 length: 2];
1159
+ red = [self colorComponentFrom: colorString start: 2 length: 2];
1160
+ green = [self colorComponentFrom: colorString start: 4 length: 2];
1161
+ blue = [self colorComponentFrom: colorString start: 6 length: 2];
1162
+ break;
1163
+ default:
1164
+ [NSException raise:@"Invalid color value" format: @"Color value %@ is invalid. It should be a hex value of the form #RBG, #ARGB, #RRGGBB, or #AARRGGBB", hexString];
1165
+ break;
1166
+ }
1167
+ return [UIColor colorWithRed: red green: green blue: blue alpha: alpha];
1168
+ }
1169
+
1170
+ +(CGFloat)colorComponentFrom:(NSString*)string start:(NSUInteger)start length:(NSUInteger)length {
1171
+ NSString *substring = [string substringWithRange: NSMakeRange(start, length)];
1172
+ NSString *fullHex = length == 2 ? substring : [NSString stringWithFormat: @"%@%@", substring, substring];
1173
+ unsigned hexComponent;
1174
+ [[NSScanner scannerWithString: fullHex] scanHexInt: &hexComponent];
1175
+ return hexComponent / 255.0;
1176
+ }
1177
+
1178
+ +(NSNumber*)intWithColor:(UIColor*)color {
1179
+ if(color == nil) return nil;
1180
+
1181
+ const CGFloat *components = CGColorGetComponents(color.CGColor);
1182
+ CGFloat r = components[0];
1183
+ CGFloat g = components[1];
1184
+ CGFloat b = components[2];
1185
+ CGFloat a = components[3];
1186
+
1187
+ NSString* hexString = [NSString stringWithFormat:@"#%02lX%02lX%02lX%02lX",
1188
+ lroundf(a * 255),
1189
+ lroundf(r * 255),
1190
+ lroundf(g * 255),
1191
+ lroundf(b * 255)];
1192
+
1193
+ unsigned int hexInt = 0;
1194
+ NSScanner *scanner = [NSScanner scannerWithString:hexString];
1195
+ [scanner setCharactersToBeSkipped:[NSCharacterSet characterSetWithCharactersInString:@"#"]];
1196
+ [scanner scanHexInt:&hexInt];
1197
+
1198
+ return [NSNumber numberWithInteger:hexInt];
1199
+ }
1200
+
1201
+ +(UIFont*)UIFontFromJSON:(NSDictionary*)input {
1202
+ UIFont* result = [UIFont fontWithName:[input valueForKey:@"name"] size:[[input valueForKey:@"size"] integerValue]];
1203
+ if (!result || !result.fontName) return nil;
1204
+ return result;
1205
+ }
1206
+
1207
+ +(NSDictionary*)generateUIFont:(UIFont*)input {
1208
+ if (!input || !input.fontName) return nil;
1209
+ return @{
1210
+ @"name": input.fontName,
1211
+ @"size": @(input.pointSize)
1212
+ };
1213
+ }
1214
+
1215
+ +(AVCaptureSessionPreset)captureSessionPresetWithNumber:(NSNumber*)value {
1216
+ int input = [value intValue];
1217
+ if(input == 0) return AVCaptureSessionPresetLow;
1218
+ if(input == 1) return AVCaptureSessionPresetMedium;
1219
+ if(input == 2) return AVCaptureSessionPresetHigh;
1220
+ if(input == 3) return AVCaptureSessionPresetPhoto;
1221
+ if(input == 4) return AVCaptureSessionPresetInputPriority;
1222
+ if(input == 6) return AVCaptureSessionPreset1280x720;
1223
+ if(input == 7) return AVCaptureSessionPreset1920x1080;
1224
+ if(input == 8) return AVCaptureSessionPreset3840x2160;
1225
+ if(input == 9) return AVCaptureSessionPresetiFrame960x540;
1226
+ if(input == 10) return AVCaptureSessionPresetiFrame1280x720;
1227
+ if(input == 12) return AVCaptureSessionPreset640x480;
1228
+ if(input == 13) return AVCaptureSessionPreset352x288;
1229
+ return AVCaptureSessionPreset1920x1080;
1230
+ }
1231
+
1232
+ +(NSNumber*)generateCaptureSessionPreset:(AVCaptureSessionPreset)value {
1233
+ if(value == AVCaptureSessionPresetLow) return @0;
1234
+ if(value == AVCaptureSessionPresetMedium) return @1;
1235
+ if(value == AVCaptureSessionPresetHigh) return @2;
1236
+ if(value == AVCaptureSessionPresetPhoto) return @3;
1237
+ if(value == AVCaptureSessionPresetInputPriority) return @4;
1238
+ if(value == AVCaptureSessionPreset1280x720) return @6;
1239
+ if(value == AVCaptureSessionPreset1920x1080) return @7;
1240
+ if(value == AVCaptureSessionPreset3840x2160) return @8;
1241
+ if(value == AVCaptureSessionPresetiFrame960x540) return @9;
1242
+ if(value == AVCaptureSessionPresetiFrame1280x720) return @10;
1243
+ if(value == AVCaptureSessionPreset640x480) return @12;
1244
+ if(value == AVCaptureSessionPreset352x288) return @13;
1245
+ return @0;
1246
+ }
1247
+
1248
+ +(CGLineCap)lineCapWithNumber:(NSNumber*)value {
1249
+ int input = [value intValue];
1250
+ if(input == 0) return kCGLineCapButt;
1251
+ if(input == 1) return kCGLineCapRound;
1252
+ if(input == 2) return kCGLineCapSquare;
1253
+ return kCGLineCapButt;
1254
+ }
1255
+
1256
+ +(NSNumber*)generateLineCap:(CGLineCap)value {
1257
+ if(value == kCGLineCapButt) return @0;
1258
+ if(value == kCGLineCapRound) return @1;
1259
+ if(value == kCGLineCapSquare) return @2;
1260
+ return @0;;
1261
+ }
1262
+
1263
+ +(UIInterfaceOrientationMask)interfaceOrientationMaskWithNumber:(NSNumber*)value {
1264
+ int input = [value intValue];
1265
+ if(input == 0) return UIInterfaceOrientationMaskAll;
1266
+ if(input == 1) return UIInterfaceOrientationMaskPortrait;
1267
+ if(input == 2) return UIInterfaceOrientationMaskLandscape;
1268
+ if(input == 3) return UIInterfaceOrientationMaskLandscapeLeft;
1269
+ if(input == 4) return UIInterfaceOrientationMaskLandscapeRight;
1270
+ return UIInterfaceOrientationMaskPortrait;
1271
+ }
1272
+
1273
+ +(NSNumber*)generateInterfaceOrientationMask:(UIInterfaceOrientationMask)value {
1274
+ if(value == UIInterfaceOrientationMaskAll) return @0;
1275
+ if(value == UIInterfaceOrientationMaskPortrait) return @1;
1276
+ if(value == UIInterfaceOrientationMaskLandscape) return @2;
1277
+ if(value == UIInterfaceOrientationMaskLandscapeLeft) return @3;
1278
+ if(value == UIInterfaceOrientationMaskLandscapeRight) return @4;
1279
+ return @0;
1280
+ }
1281
+
1282
+ +(UIViewContentMode)viewContentModeWithNumber:(NSNumber*)value {
1283
+ int input = [value intValue];
1284
+ if(input == 0) return UIViewContentModeScaleToFill;
1285
+ if(input == 1) return UIViewContentModeScaleAspectFit;
1286
+ if(input == 2) return UIViewContentModeScaleAspectFill;
1287
+ if(input == 3) return UIViewContentModeRedraw;
1288
+ if(input == 4) return UIViewContentModeCenter;
1289
+ if(input == 5) return UIViewContentModeTop;
1290
+ if(input == 6) return UIViewContentModeBottom;
1291
+ if(input == 7) return UIViewContentModeLeft;
1292
+ if(input == 8) return UIViewContentModeRight;
1293
+ if(input == 9) return UIViewContentModeTopLeft;
1294
+ if(input == 10) return UIViewContentModeTopRight;
1295
+ if(input == 11) return UIViewContentModeBottomLeft;
1296
+ if(input == 12) return UIViewContentModeBottomRight;
1297
+ return UIViewContentModeCenter;
1298
+ }
1299
+
1300
+ +(NSNumber*)generateViewContentMode:(UIViewContentMode)value {
1301
+ if(value == UIViewContentModeScaleToFill) return @0;
1302
+ if(value == UIViewContentModeScaleAspectFit) return @1;
1303
+ if(value == UIViewContentModeScaleAspectFill) return @2;
1304
+ if(value == UIViewContentModeRedraw) return @3;
1305
+ if(value == UIViewContentModeCenter) return @4;
1306
+ if(value == UIViewContentModeTop) return @5;
1307
+ if(value == UIViewContentModeBottom) return @6;
1308
+ if(value == UIViewContentModeLeft) return @7;
1309
+ if(value == UIViewContentModeRight) return @8;
1310
+ if(value == UIViewContentModeTopLeft) return @9;
1311
+ if(value == UIViewContentModeTopRight) return @10;
1312
+ if(value == UIViewContentModeBottomLeft) return @11;
1313
+ if(value == UIViewContentModeBottomRight) return @12;
1314
+ return @4;
1315
+ }
1316
+
1317
+ +(RGLDocReaderFrame)docReaderFrameWithString:(NSString*)value {
1318
+ if([value isEqual: @"id1"]) return RGLDocReaderFrameScenarioDefault;
1319
+ if([value isEqual: @"max"]) return RGLDocReaderFrameMax;
1320
+ if([value isEqual: @"none"]) return RGLDocReaderFrameNone;
1321
+ if([value isEqual: @"document"]) return RGLDocReaderFrameDocument;
1322
+ return RGLDocReaderFrameNone;
1323
+ }
1324
+
1325
+ +(NSString*)generateDocReaderFrame:(RGLDocReaderFrame)value {
1326
+ if(value == RGLDocReaderFrameScenarioDefault) return @"id1";
1327
+ if(value == RGLDocReaderFrameMax) return @"max";
1328
+ if(value == RGLDocReaderFrameNone) return @"none";
1329
+ if(value == RGLDocReaderFrameDocument) return @"document";
1330
+ return @"none";
1331
+ }
1332
+
1333
+ +(RGLTextProcessing*)textProcessingWithNumber:(NSNumber*)value {
1334
+ int input = [value intValue];
1335
+ if(input == 0) return RGLTextProcessing.noChange;
1336
+ if(input == 1) return RGLTextProcessing.uppercase;
1337
+ if(input == 2) return RGLTextProcessing.lowercase;
1338
+ if(input == 3) return RGLTextProcessing.capital;
1339
+ return RGLTextProcessing.noChange;
1340
+ }
1341
+
1342
+ +(NSNumber*)generateWithTextProcessing:(RGLTextProcessing*)value {
1343
+ return [value valueForKey:@"rawValue"];
1344
+ }
1345
+
1346
+ +(NSNumber*)generateDocReaderAction:(RGLDocReaderAction)value {
1347
+ if(value == RGLDocReaderActionComplete) return @0;
1348
+ if(value == RGLDocReaderActionProcess) return @1;
1349
+ if(value == RGLDocReaderActionMorePagesAvailable) return @2;
1350
+ if(value == RGLDocReaderActionCancel) return @3;
1351
+ if(value == RGLDocReaderActionError) return @4;
1352
+ if(value == RGLDocReaderActionProcessWhiteFlashLight) return @5;
1353
+ if(value == RGLDocReaderActionProcessTimeout) return @6;
1354
+ if(value == RGLDocReaderActionProcessOnServer) return @7;
1355
+ return @4;
1356
+ }
1357
+
1358
+ +(NSNumber*)generateRFIDCompleteAction:(RGLRFIDCompleteAction)value {
1359
+ if(value == RGLRFIDCompleteActionComplete) return @0;
1360
+ if(value == RGLRFIDCompleteActionError) return @4;
1361
+ if(value == RGLRFIDCompleteActionCancel) return @3;
1362
+ if(value == RGLRFIDCompleteActionSessionRestarted) return @0;
1363
+ return @0;
1364
+ }
1365
+
1366
+ +(NSNumber*)generateImageQualityCheckType:(RGLImageQualityCheckType)value {
1367
+ if(value == RGLImageQualityCheckTypeImageGlares) return @0;
1368
+ if(value == RGLImageQualityCheckTypeImageFocus) return @1;
1369
+ if(value == RGLImageQualityCheckTypeImageResolution) return @2;
1370
+ if(value == RGLImageQualityCheckTypeImageColorness) return @3;
1371
+ if(value == RGLImageQualityCheckTypeImagePerspective) return @4;
1372
+ if(value == RGLImageQualityCheckTypeImageBounds) return @5;
1373
+ if(value == RGLImageQualityCheckTypeScreenCapture) return @6;
1374
+ if(value == RGLImageQualityCheckTypePortrait) return @7;
1375
+ if(value == RGLImageQualityCheckTypeHandwritten) return @8;
1376
+ if(value == RGLImageQualityCheckTypeBrightness) return @9;
1377
+ if(value == RGLImageQualityCheckTypeOcclusion) return @10;
1378
+ return 0;
1379
+ }
1380
+
1381
+ +(RGLImageQualityCheckType)imageQualityCheckTypeWithNumber:(NSNumber*)input {
1382
+ if(input == nil) return nil;
1383
+ int value = [input intValue];
1384
+ if(value == 0) return RGLImageQualityCheckTypeImageGlares;
1385
+ if(value == 1) return RGLImageQualityCheckTypeImageFocus;
1386
+ if(value == 2) return RGLImageQualityCheckTypeImageResolution;
1387
+ if(value == 3) return RGLImageQualityCheckTypeImageColorness;
1388
+ if(value == 4) return RGLImageQualityCheckTypeImagePerspective;
1389
+ if(value == 5) return RGLImageQualityCheckTypeImageBounds;
1390
+ if(value == 6) return RGLImageQualityCheckTypeScreenCapture;
1391
+ if(value == 7) return RGLImageQualityCheckTypePortrait;
1392
+ if(value == 8) return RGLImageQualityCheckTypeHandwritten;
1393
+ if(value == 9) return RGLImageQualityCheckTypeBrightness;
1394
+ if(value == 10) return RGLImageQualityCheckTypeOcclusion;
1395
+ return RGLImageQualityCheckTypeImageGlares;
1396
+ }
1397
+
1398
+ @end