@regulaforensics/document-reader 1.1.1318-rc

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (483) hide show
  1. package/Package.swift +28 -0
  2. package/README.md +19 -0
  3. package/android/CVDDocumentReader.kt +76 -0
  4. package/android/build.gradle.kts +37 -0
  5. package/android/cordova.gradle.kts +13 -0
  6. package/android/src/main/kotlin/com/regula/plugin/document/reader/BluetoothUtil.kt +164 -0
  7. package/android/src/main/kotlin/com/regula/plugin/document/reader/Config.kt +1021 -0
  8. package/android/src/main/kotlin/com/regula/plugin/document/reader/JSONConstructor.kt +2192 -0
  9. package/android/src/main/kotlin/com/regula/plugin/document/reader/Main.kt +656 -0
  10. package/android/src/main/kotlin/com/regula/plugin/document/reader/RNDocumentReaderModule.kt +101 -0
  11. package/android/src/main/kotlin/com/regula/plugin/document/reader/Utils.kt +248 -0
  12. package/app.plugin.js +45 -0
  13. package/examples/capacitor/README.md +24 -0
  14. package/examples/capacitor/android/app/build.gradle +41 -0
  15. package/examples/capacitor/android/app/proguard-rules.pro +21 -0
  16. package/examples/capacitor/android/app/src/main/AndroidManifest.xml +36 -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/example/dr/capacitor/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/ic_launcher_foreground.png +0 -0
  21. package/examples/capacitor/android/app/src/main/res/drawable/ic_launcher_round.png +0 -0
  22. package/examples/capacitor/android/app/src/main/res/drawable/launcher.xml +4 -0
  23. package/examples/capacitor/android/app/src/main/res/drawable/launcher_round.xml +4 -0
  24. package/examples/capacitor/android/app/src/main/res/drawable/splash.png +0 -0
  25. package/examples/capacitor/android/app/src/main/res/layout/activity_main.xml +12 -0
  26. package/examples/capacitor/android/app/src/main/res/values/styles.xml +22 -0
  27. package/examples/capacitor/android/app/src/main/res/xml/file_paths.xml +5 -0
  28. package/examples/capacitor/android/build.gradle +39 -0
  29. package/examples/capacitor/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  30. package/examples/capacitor/android/gradle/wrapper/gradle-wrapper.properties +7 -0
  31. package/examples/capacitor/android/gradle.properties +26 -0
  32. package/examples/capacitor/android/gradlew +248 -0
  33. package/examples/capacitor/android/gradlew.bat +82 -0
  34. package/examples/capacitor/android/settings.gradle +5 -0
  35. package/examples/capacitor/android/variables.gradle +20 -0
  36. package/examples/capacitor/capacitor.config.json +15 -0
  37. package/examples/capacitor/index.html +5 -0
  38. package/examples/capacitor/index.tsx +31 -0
  39. package/examples/capacitor/ios/App/App/App.entitlements +10 -0
  40. package/examples/capacitor/ios/App/App/AppDelegate.swift +14 -0
  41. package/examples/capacitor/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png +0 -0
  42. package/examples/capacitor/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json +14 -0
  43. package/examples/capacitor/ios/App/App/Assets.xcassets/Contents.json +6 -0
  44. package/examples/capacitor/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json +23 -0
  45. package/examples/capacitor/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png +0 -0
  46. package/examples/capacitor/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png +0 -0
  47. package/examples/capacitor/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png +0 -0
  48. package/examples/capacitor/ios/App/App/Base.lproj/LaunchScreen.storyboard +32 -0
  49. package/examples/capacitor/ios/App/App/Info.plist +88 -0
  50. package/examples/capacitor/ios/App/App/SceneDelegate.swift +23 -0
  51. package/examples/capacitor/ios/App/App.xcodeproj/project.pbxproj +374 -0
  52. package/examples/capacitor/ios/App/App.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  53. package/examples/capacitor/ios/App/CapApp-SPM/Sources/CapApp-SPM/CapApp-SPM.swift +1 -0
  54. package/examples/capacitor/package-lock.json +1965 -0
  55. package/examples/capacitor/package.json +26 -0
  56. package/examples/capacitor/public/assets/.gitkeep +0 -0
  57. package/examples/capacitor/public/images/document.png +0 -0
  58. package/examples/capacitor/public/images/portrait.png +0 -0
  59. package/examples/capacitor/scripts/android.sh +8 -0
  60. package/examples/capacitor/scripts/ios.sh +8 -0
  61. package/examples/capacitor/scripts/setup.sh +9 -0
  62. package/examples/capacitor/src/extra/bt_device.tsx +33 -0
  63. package/examples/capacitor/src/extra/custom_rfid.tsx +61 -0
  64. package/examples/capacitor/src/main.css +153 -0
  65. package/examples/capacitor/src/main.html +38 -0
  66. package/examples/capacitor/src/main.tsx +172 -0
  67. package/examples/capacitor/tsconfig.json +5 -0
  68. package/examples/capacitor/vite.config.ts +5 -0
  69. package/examples/ionic/README.md +24 -0
  70. package/examples/ionic/angular.json +39 -0
  71. package/examples/ionic/assets/.gitkeep +0 -0
  72. package/examples/ionic/config.xml +61 -0
  73. package/examples/ionic/images/document.png +0 -0
  74. package/examples/ionic/images/icon.png +0 -0
  75. package/examples/ionic/images/portrait.png +0 -0
  76. package/examples/ionic/index.html +19 -0
  77. package/examples/ionic/index.tsx +63 -0
  78. package/examples/ionic/ionic.config.json +7 -0
  79. package/examples/ionic/package-lock.json +17554 -0
  80. package/examples/ionic/package.json +76 -0
  81. package/examples/ionic/patches/cordova-plugin-ionic-webview+5.0.1.patch +23 -0
  82. package/examples/ionic/scripts/android.sh +9 -0
  83. package/examples/ionic/scripts/ios.sh +11 -0
  84. package/examples/ionic/scripts/setup.sh +8 -0
  85. package/examples/ionic/src/extra/bt_device.tsx +33 -0
  86. package/examples/ionic/src/extra/custom_rfid.tsx +61 -0
  87. package/examples/ionic/src/main.css +148 -0
  88. package/examples/ionic/src/main.html +38 -0
  89. package/examples/ionic/src/main.tsx +172 -0
  90. package/examples/ionic/tsconfig.json +13 -0
  91. package/examples/react_native/README.md +24 -0
  92. package/examples/react_native/app.config.ts +54 -0
  93. package/examples/react_native/assets/.gitkeep +0 -0
  94. package/examples/react_native/images/document.png +0 -0
  95. package/examples/react_native/images/icon.png +0 -0
  96. package/examples/react_native/images/portrait.png +0 -0
  97. package/examples/react_native/index.tsx +111 -0
  98. package/examples/react_native/metro.config.js +5 -0
  99. package/examples/react_native/package-lock.json +6924 -0
  100. package/examples/react_native/package.json +37 -0
  101. package/examples/react_native/scripts/android.sh +8 -0
  102. package/examples/react_native/scripts/ios.sh +6 -0
  103. package/examples/react_native/scripts/setup.sh +10 -0
  104. package/examples/react_native/scripts/withoutMetroServer.js +89 -0
  105. package/examples/react_native/src/extra/bt_device.tsx +33 -0
  106. package/examples/react_native/src/extra/custom_rfid.tsx +61 -0
  107. package/examples/react_native/src/main.css +148 -0
  108. package/examples/react_native/src/main.html +38 -0
  109. package/examples/react_native/src/main.tsx +172 -0
  110. package/ios/CVDDocumentReader.h +7 -0
  111. package/ios/CVDDocumentReader.m +43 -0
  112. package/ios/RGLWConfig.h +44 -0
  113. package/ios/RGLWConfig.m +1577 -0
  114. package/ios/RGLWJSONConstructor.h +216 -0
  115. package/ios/RGLWJSONConstructor.m +2875 -0
  116. package/ios/RGLWMain.h +34 -0
  117. package/ios/RGLWMain.m +722 -0
  118. package/ios/RNDocumentReader.h +8 -0
  119. package/ios/RNDocumentReader.m +52 -0
  120. package/ios/spm/module.modulemap +7 -0
  121. package/package.json +39 -0
  122. package/plugin.xml +51 -0
  123. package/react-native-document-reader.podspec +14 -0
  124. package/test/json.tsx +1159 -0
  125. package/test/package-lock.json +584 -0
  126. package/test/package.json +9 -0
  127. package/test/test.tsx +315 -0
  128. package/test/utils.tsx +38 -0
  129. package/www/capacitor/config/FinalizeConfig.js +35 -0
  130. package/www/capacitor/config/InitConfig.js +55 -0
  131. package/www/capacitor/config/OnlineProcessingConfig.js +52 -0
  132. package/www/capacitor/config/RFIDConfig.js +47 -0
  133. package/www/capacitor/config/RecognizeConfig.js +138 -0
  134. package/www/capacitor/config/ScannerConfig.js +48 -0
  135. package/www/capacitor/index.js +758 -0
  136. package/www/capacitor/info/DocReaderException.js +68 -0
  137. package/www/capacitor/info/DocReaderScenario.js +89 -0
  138. package/www/capacitor/info/DocReaderVersion.js +32 -0
  139. package/www/capacitor/info/DocumentsDatabase.js +39 -0
  140. package/www/capacitor/info/License.js +30 -0
  141. package/www/capacitor/info/PrepareProgress.js +31 -0
  142. package/www/capacitor/info/RFIDException.js +26 -0
  143. package/www/capacitor/internal/bridge.js +131 -0
  144. package/www/capacitor/internal/cordova.js +17 -0
  145. package/www/capacitor/mdl/DataRetrieval.js +55 -0
  146. package/www/capacitor/mdl/DeviceEngagement.js +30 -0
  147. package/www/capacitor/mdl/DeviceRetrievalMethod.js +41 -0
  148. package/www/capacitor/mdl/DocumentRequestMDL.js +212 -0
  149. package/www/capacitor/mdl/NameSpaceMDL.js +33 -0
  150. package/www/capacitor/params/Functionality.js +387 -0
  151. package/www/capacitor/params/customization/Customization.js +664 -0
  152. package/www/capacitor/params/customization/CustomizationColors.js +231 -0
  153. package/www/capacitor/params/customization/CustomizationContentModes.js +55 -0
  154. package/www/capacitor/params/customization/CustomizationFonts.js +156 -0
  155. package/www/capacitor/params/customization/CustomizationImages.js +199 -0
  156. package/www/capacitor/params/customization/CustomizationMatrices.js +39 -0
  157. package/www/capacitor/params/customization/CustomizationTimings.js +71 -0
  158. package/www/capacitor/params/process_params/AuthenticityParams.js +166 -0
  159. package/www/capacitor/params/process_params/AuthenticityPropertiesParams.js +39 -0
  160. package/www/capacitor/params/process_params/BackendProcessingConfig.js +38 -0
  161. package/www/capacitor/params/process_params/Bsi.js +23 -0
  162. package/www/capacitor/params/process_params/FaceApiParams.js +55 -0
  163. package/www/capacitor/params/process_params/FaceApiSearchParams.js +29 -0
  164. package/www/capacitor/params/process_params/GlaresCheckParams.js +25 -0
  165. package/www/capacitor/params/process_params/ImageQA.js +122 -0
  166. package/www/capacitor/params/process_params/LivenessParams.js +87 -0
  167. package/www/capacitor/params/process_params/OcclusionCheckParams.js +21 -0
  168. package/www/capacitor/params/process_params/ProcessParams.js +724 -0
  169. package/www/capacitor/params/process_params/RFIDParams.js +21 -0
  170. package/www/capacitor/params/rfid_scenario/DTCDataGroup.js +63 -0
  171. package/www/capacitor/params/rfid_scenario/EDLDataGroups.js +135 -0
  172. package/www/capacitor/params/rfid_scenario/EIDDataGroups.js +191 -0
  173. package/www/capacitor/params/rfid_scenario/EPassportDataGroups.js +151 -0
  174. package/www/capacitor/params/rfid_scenario/RFIDScenario.js +584 -0
  175. package/www/capacitor/results/DocumentType.js +302 -0
  176. package/www/capacitor/results/Position.js +88 -0
  177. package/www/capacitor/results/Results.js +354 -0
  178. package/www/capacitor/results/TransactionInfo.js +24 -0
  179. package/www/capacitor/results/authenticity/Authenticity.js +24 -0
  180. package/www/capacitor/results/authenticity/AuthenticityCheck.js +43 -0
  181. package/www/capacitor/results/authenticity/AuthenticityElement.js +37 -0
  182. package/www/capacitor/results/authenticity/AuthenticityResult.js +33 -0
  183. package/www/capacitor/results/authenticity/CheckDiagnose.js +133 -0
  184. package/www/capacitor/results/authenticity/SecurityFeatureType.js +67 -0
  185. package/www/capacitor/results/barcode/BarcodeField.js +34 -0
  186. package/www/capacitor/results/barcode/BarcodeResult.js +30 -0
  187. package/www/capacitor/results/barcode/BarcodeStatus.js +33 -0
  188. package/www/capacitor/results/barcode/BarcodeType.js +21 -0
  189. package/www/capacitor/results/barcode/PDF417Info.js +24 -0
  190. package/www/capacitor/results/image_quality/ImageQuality.js +40 -0
  191. package/www/capacitor/results/image_quality/ImageQualityCheckType.js +19 -0
  192. package/www/capacitor/results/image_quality/ImageQualityGroup.js +39 -0
  193. package/www/capacitor/results/rfid/AccessControlProcedureType.js +30 -0
  194. package/www/capacitor/results/rfid/Application.js +63 -0
  195. package/www/capacitor/results/rfid/Attribute.js +23 -0
  196. package/www/capacitor/results/rfid/Authority.js +36 -0
  197. package/www/capacitor/results/rfid/CardProperties.js +57 -0
  198. package/www/capacitor/results/rfid/CertificateChain.js +69 -0
  199. package/www/capacitor/results/rfid/CertificateData.js +21 -0
  200. package/www/capacitor/results/rfid/DataField.js +23 -0
  201. package/www/capacitor/results/rfid/Extension.js +21 -0
  202. package/www/capacitor/results/rfid/File.js +56 -0
  203. package/www/capacitor/results/rfid/FileData.js +27 -0
  204. package/www/capacitor/results/rfid/RFIDAccessControlProcedureType.js +10 -0
  205. package/www/capacitor/results/rfid/RFIDCertificateType.js +14 -0
  206. package/www/capacitor/results/rfid/RFIDDataFileType.js +106 -0
  207. package/www/capacitor/results/rfid/RFIDSessionData.js +92 -0
  208. package/www/capacitor/results/rfid/RFIDValidity.js +23 -0
  209. package/www/capacitor/results/rfid/RFIDValue.js +30 -0
  210. package/www/capacitor/results/rfid/SecurityObject.js +41 -0
  211. package/www/capacitor/results/rfid/SecurityObjectCertificates.js +20 -0
  212. package/www/capacitor/results/rfid/SignerInfo.js +74 -0
  213. package/www/capacitor/results/status/AgeStatus.js +35 -0
  214. package/www/capacitor/results/status/CheckResult.js +5 -0
  215. package/www/capacitor/results/status/OpticalStatus.js +44 -0
  216. package/www/capacitor/results/status/RFIDStatus.js +38 -0
  217. package/www/capacitor/results/status/ResultsStatus.js +53 -0
  218. package/www/capacitor/results/visible_digital_seals/BytesData.js +27 -0
  219. package/www/capacitor/results/visible_digital_seals/DocFeature.js +23 -0
  220. package/www/capacitor/results/visible_digital_seals/LDSParsingErrorCodes.js +136 -0
  221. package/www/capacitor/results/visible_digital_seals/LDSParsingNotificationCodes.js +239 -0
  222. package/www/capacitor/results/visible_digital_seals/VDSData.js +75 -0
  223. package/www/capacitor/results/visible_digital_seals/VDSNCData.js +54 -0
  224. package/www/capacitor/results/visual_results/Comparison.js +27 -0
  225. package/www/capacitor/results/visual_results/FieldType.js +671 -0
  226. package/www/capacitor/results/visual_results/GraphicField.js +47 -0
  227. package/www/capacitor/results/visual_results/GraphicFieldType.js +25 -0
  228. package/www/capacitor/results/visual_results/GraphicResult.js +28 -0
  229. package/www/capacitor/results/visual_results/LCID.js +174 -0
  230. package/www/capacitor/results/visual_results/Lights.js +11 -0
  231. package/www/capacitor/results/visual_results/RFIDOrigin.js +27 -0
  232. package/www/capacitor/results/visual_results/Rect.js +27 -0
  233. package/www/capacitor/results/visual_results/Symbol.js +26 -0
  234. package/www/capacitor/results/visual_results/TextField.js +85 -0
  235. package/www/capacitor/results/visual_results/TextResult.js +52 -0
  236. package/www/capacitor/results/visual_results/TextSource.js +27 -0
  237. package/www/capacitor/results/visual_results/Validity.js +24 -0
  238. package/www/capacitor/results/visual_results/Value.js +52 -0
  239. package/www/capacitor/rfid/CAProtocol.js +27 -0
  240. package/www/capacitor/rfid/PAAttribute.js +24 -0
  241. package/www/capacitor/rfid/PACEProtocol.js +24 -0
  242. package/www/capacitor/rfid/PAResourcesIssuer.js +35 -0
  243. package/www/capacitor/rfid/PKDCertificate.js +65 -0
  244. package/www/capacitor/rfid/RFIDErrorCodes.js +123 -0
  245. package/www/capacitor/rfid/RFIDNotification.js +71 -0
  246. package/www/capacitor/rfid/TAChallenge.js +33 -0
  247. package/www/capacitor/rfid/TccParams.js +34 -0
  248. package/www/cordova.js +12948 -0
  249. package/www/react-native/config/FinalizeConfig.js +35 -0
  250. package/www/react-native/config/InitConfig.js +55 -0
  251. package/www/react-native/config/OnlineProcessingConfig.js +52 -0
  252. package/www/react-native/config/RFIDConfig.js +47 -0
  253. package/www/react-native/config/RecognizeConfig.js +138 -0
  254. package/www/react-native/config/ScannerConfig.js +48 -0
  255. package/www/react-native/index.js +758 -0
  256. package/www/react-native/info/DocReaderException.js +68 -0
  257. package/www/react-native/info/DocReaderScenario.js +89 -0
  258. package/www/react-native/info/DocReaderVersion.js +32 -0
  259. package/www/react-native/info/DocumentsDatabase.js +39 -0
  260. package/www/react-native/info/License.js +30 -0
  261. package/www/react-native/info/PrepareProgress.js +31 -0
  262. package/www/react-native/info/RFIDException.js +26 -0
  263. package/www/react-native/internal/bridge.js +131 -0
  264. package/www/react-native/mdl/DataRetrieval.js +55 -0
  265. package/www/react-native/mdl/DeviceEngagement.js +30 -0
  266. package/www/react-native/mdl/DeviceRetrievalMethod.js +41 -0
  267. package/www/react-native/mdl/DocumentRequestMDL.js +212 -0
  268. package/www/react-native/mdl/NameSpaceMDL.js +33 -0
  269. package/www/react-native/params/Functionality.js +387 -0
  270. package/www/react-native/params/customization/Customization.js +664 -0
  271. package/www/react-native/params/customization/CustomizationColors.js +231 -0
  272. package/www/react-native/params/customization/CustomizationContentModes.js +55 -0
  273. package/www/react-native/params/customization/CustomizationFonts.js +156 -0
  274. package/www/react-native/params/customization/CustomizationImages.js +199 -0
  275. package/www/react-native/params/customization/CustomizationMatrices.js +39 -0
  276. package/www/react-native/params/customization/CustomizationTimings.js +71 -0
  277. package/www/react-native/params/process_params/AuthenticityParams.js +166 -0
  278. package/www/react-native/params/process_params/AuthenticityPropertiesParams.js +39 -0
  279. package/www/react-native/params/process_params/BackendProcessingConfig.js +38 -0
  280. package/www/react-native/params/process_params/Bsi.js +23 -0
  281. package/www/react-native/params/process_params/FaceApiParams.js +55 -0
  282. package/www/react-native/params/process_params/FaceApiSearchParams.js +29 -0
  283. package/www/react-native/params/process_params/GlaresCheckParams.js +25 -0
  284. package/www/react-native/params/process_params/ImageQA.js +122 -0
  285. package/www/react-native/params/process_params/LivenessParams.js +87 -0
  286. package/www/react-native/params/process_params/OcclusionCheckParams.js +21 -0
  287. package/www/react-native/params/process_params/ProcessParams.js +724 -0
  288. package/www/react-native/params/process_params/RFIDParams.js +21 -0
  289. package/www/react-native/params/rfid_scenario/DTCDataGroup.js +63 -0
  290. package/www/react-native/params/rfid_scenario/EDLDataGroups.js +135 -0
  291. package/www/react-native/params/rfid_scenario/EIDDataGroups.js +191 -0
  292. package/www/react-native/params/rfid_scenario/EPassportDataGroups.js +151 -0
  293. package/www/react-native/params/rfid_scenario/RFIDScenario.js +584 -0
  294. package/www/react-native/results/DocumentType.js +302 -0
  295. package/www/react-native/results/Position.js +88 -0
  296. package/www/react-native/results/Results.js +354 -0
  297. package/www/react-native/results/TransactionInfo.js +24 -0
  298. package/www/react-native/results/authenticity/Authenticity.js +24 -0
  299. package/www/react-native/results/authenticity/AuthenticityCheck.js +43 -0
  300. package/www/react-native/results/authenticity/AuthenticityElement.js +37 -0
  301. package/www/react-native/results/authenticity/AuthenticityResult.js +33 -0
  302. package/www/react-native/results/authenticity/CheckDiagnose.js +133 -0
  303. package/www/react-native/results/authenticity/SecurityFeatureType.js +67 -0
  304. package/www/react-native/results/barcode/BarcodeField.js +34 -0
  305. package/www/react-native/results/barcode/BarcodeResult.js +30 -0
  306. package/www/react-native/results/barcode/BarcodeStatus.js +33 -0
  307. package/www/react-native/results/barcode/BarcodeType.js +21 -0
  308. package/www/react-native/results/barcode/PDF417Info.js +24 -0
  309. package/www/react-native/results/image_quality/ImageQuality.js +40 -0
  310. package/www/react-native/results/image_quality/ImageQualityCheckType.js +19 -0
  311. package/www/react-native/results/image_quality/ImageQualityGroup.js +39 -0
  312. package/www/react-native/results/rfid/AccessControlProcedureType.js +30 -0
  313. package/www/react-native/results/rfid/Application.js +63 -0
  314. package/www/react-native/results/rfid/Attribute.js +23 -0
  315. package/www/react-native/results/rfid/Authority.js +36 -0
  316. package/www/react-native/results/rfid/CardProperties.js +57 -0
  317. package/www/react-native/results/rfid/CertificateChain.js +69 -0
  318. package/www/react-native/results/rfid/CertificateData.js +21 -0
  319. package/www/react-native/results/rfid/DataField.js +23 -0
  320. package/www/react-native/results/rfid/Extension.js +21 -0
  321. package/www/react-native/results/rfid/File.js +56 -0
  322. package/www/react-native/results/rfid/FileData.js +27 -0
  323. package/www/react-native/results/rfid/RFIDAccessControlProcedureType.js +10 -0
  324. package/www/react-native/results/rfid/RFIDCertificateType.js +14 -0
  325. package/www/react-native/results/rfid/RFIDDataFileType.js +106 -0
  326. package/www/react-native/results/rfid/RFIDSessionData.js +92 -0
  327. package/www/react-native/results/rfid/RFIDValidity.js +23 -0
  328. package/www/react-native/results/rfid/RFIDValue.js +30 -0
  329. package/www/react-native/results/rfid/SecurityObject.js +41 -0
  330. package/www/react-native/results/rfid/SecurityObjectCertificates.js +20 -0
  331. package/www/react-native/results/rfid/SignerInfo.js +74 -0
  332. package/www/react-native/results/status/AgeStatus.js +35 -0
  333. package/www/react-native/results/status/CheckResult.js +5 -0
  334. package/www/react-native/results/status/OpticalStatus.js +44 -0
  335. package/www/react-native/results/status/RFIDStatus.js +38 -0
  336. package/www/react-native/results/status/ResultsStatus.js +53 -0
  337. package/www/react-native/results/visible_digital_seals/BytesData.js +27 -0
  338. package/www/react-native/results/visible_digital_seals/DocFeature.js +23 -0
  339. package/www/react-native/results/visible_digital_seals/LDSParsingErrorCodes.js +136 -0
  340. package/www/react-native/results/visible_digital_seals/LDSParsingNotificationCodes.js +239 -0
  341. package/www/react-native/results/visible_digital_seals/VDSData.js +75 -0
  342. package/www/react-native/results/visible_digital_seals/VDSNCData.js +54 -0
  343. package/www/react-native/results/visual_results/Comparison.js +27 -0
  344. package/www/react-native/results/visual_results/FieldType.js +671 -0
  345. package/www/react-native/results/visual_results/GraphicField.js +47 -0
  346. package/www/react-native/results/visual_results/GraphicFieldType.js +25 -0
  347. package/www/react-native/results/visual_results/GraphicResult.js +28 -0
  348. package/www/react-native/results/visual_results/LCID.js +174 -0
  349. package/www/react-native/results/visual_results/Lights.js +11 -0
  350. package/www/react-native/results/visual_results/RFIDOrigin.js +27 -0
  351. package/www/react-native/results/visual_results/Rect.js +27 -0
  352. package/www/react-native/results/visual_results/Symbol.js +26 -0
  353. package/www/react-native/results/visual_results/TextField.js +85 -0
  354. package/www/react-native/results/visual_results/TextResult.js +52 -0
  355. package/www/react-native/results/visual_results/TextSource.js +27 -0
  356. package/www/react-native/results/visual_results/Validity.js +24 -0
  357. package/www/react-native/results/visual_results/Value.js +52 -0
  358. package/www/react-native/rfid/CAProtocol.js +27 -0
  359. package/www/react-native/rfid/PAAttribute.js +24 -0
  360. package/www/react-native/rfid/PACEProtocol.js +24 -0
  361. package/www/react-native/rfid/PAResourcesIssuer.js +35 -0
  362. package/www/react-native/rfid/PKDCertificate.js +65 -0
  363. package/www/react-native/rfid/RFIDErrorCodes.js +123 -0
  364. package/www/react-native/rfid/RFIDNotification.js +71 -0
  365. package/www/react-native/rfid/TAChallenge.js +33 -0
  366. package/www/react-native/rfid/TccParams.js +34 -0
  367. package/www/types/config/FinalizeConfig.d.ts +6 -0
  368. package/www/types/config/InitConfig.d.ts +68 -0
  369. package/www/types/config/OnlineProcessingConfig.d.ts +22 -0
  370. package/www/types/config/RFIDConfig.d.ts +178 -0
  371. package/www/types/config/RecognizeConfig.d.ts +126 -0
  372. package/www/types/config/ScannerConfig.d.ts +54 -0
  373. package/www/types/index.d.ts +656 -0
  374. package/www/types/info/DocReaderException.d.ts +85 -0
  375. package/www/types/info/DocReaderScenario.d.ts +90 -0
  376. package/www/types/info/DocReaderVersion.d.ts +28 -0
  377. package/www/types/info/DocumentsDatabase.d.ts +42 -0
  378. package/www/types/info/License.d.ts +23 -0
  379. package/www/types/info/PrepareProgress.d.ts +15 -0
  380. package/www/types/info/RFIDException.d.ts +8 -0
  381. package/www/types/mdl/DataRetrieval.d.ts +28 -0
  382. package/www/types/mdl/DeviceEngagement.d.ts +16 -0
  383. package/www/types/mdl/DeviceRetrievalMethod.d.ts +18 -0
  384. package/www/types/mdl/DocumentRequestMDL.d.ts +63 -0
  385. package/www/types/mdl/NameSpaceMDL.d.ts +16 -0
  386. package/www/types/params/Functionality.d.ts +337 -0
  387. package/www/types/params/customization/Customization.d.ts +584 -0
  388. package/www/types/params/customization/CustomizationColors.d.ts +42 -0
  389. package/www/types/params/customization/CustomizationContentModes.d.ts +41 -0
  390. package/www/types/params/customization/CustomizationFonts.d.ts +63 -0
  391. package/www/types/params/customization/CustomizationImages.d.ts +34 -0
  392. package/www/types/params/customization/CustomizationMatrices.d.ts +10 -0
  393. package/www/types/params/customization/CustomizationTimings.d.ts +14 -0
  394. package/www/types/params/process_params/AuthenticityParams.d.ts +31 -0
  395. package/www/types/params/process_params/AuthenticityPropertiesParams.d.ts +12 -0
  396. package/www/types/params/process_params/BackendProcessingConfig.d.ts +27 -0
  397. package/www/types/params/process_params/Bsi.d.ts +3 -0
  398. package/www/types/params/process_params/FaceApiParams.d.ts +72 -0
  399. package/www/types/params/process_params/FaceApiSearchParams.d.ts +35 -0
  400. package/www/types/params/process_params/GlaresCheckParams.d.ts +26 -0
  401. package/www/types/params/process_params/ImageQA.d.ts +85 -0
  402. package/www/types/params/process_params/LivenessParams.d.ts +18 -0
  403. package/www/types/params/process_params/OcclusionCheckParams.d.ts +16 -0
  404. package/www/types/params/process_params/ProcessParams.d.ts +496 -0
  405. package/www/types/params/process_params/RFIDParams.d.ts +19 -0
  406. package/www/types/params/rfid_scenario/DTCDataGroup.d.ts +13 -0
  407. package/www/types/params/rfid_scenario/EDLDataGroups.d.ts +22 -0
  408. package/www/types/params/rfid_scenario/EIDDataGroups.d.ts +29 -0
  409. package/www/types/params/rfid_scenario/EPassportDataGroups.d.ts +24 -0
  410. package/www/types/params/rfid_scenario/RFIDScenario.d.ts +178 -0
  411. package/www/types/results/DocumentType.d.ts +525 -0
  412. package/www/types/results/Position.d.ts +50 -0
  413. package/www/types/results/Results.d.ts +295 -0
  414. package/www/types/results/TransactionInfo.d.ts +9 -0
  415. package/www/types/results/authenticity/Authenticity.d.ts +68 -0
  416. package/www/types/results/authenticity/AuthenticityCheck.d.ts +23 -0
  417. package/www/types/results/authenticity/AuthenticityElement.d.ts +26 -0
  418. package/www/types/results/authenticity/AuthenticityResult.d.ts +16 -0
  419. package/www/types/results/authenticity/CheckDiagnose.d.ts +242 -0
  420. package/www/types/results/authenticity/SecurityFeatureType.d.ts +110 -0
  421. package/www/types/results/barcode/BarcodeField.d.ts +37 -0
  422. package/www/types/results/barcode/BarcodeResult.d.ts +14 -0
  423. package/www/types/results/barcode/BarcodeStatus.d.ts +66 -0
  424. package/www/types/results/barcode/BarcodeType.d.ts +45 -0
  425. package/www/types/results/barcode/PDF417Info.d.ts +15 -0
  426. package/www/types/results/image_quality/ImageQuality.d.ts +18 -0
  427. package/www/types/results/image_quality/ImageQualityCheckType.d.ts +30 -0
  428. package/www/types/results/image_quality/ImageQualityGroup.d.ts +17 -0
  429. package/www/types/results/rfid/AccessControlProcedureType.d.ts +21 -0
  430. package/www/types/results/rfid/Application.d.ts +48 -0
  431. package/www/types/results/rfid/Attribute.d.ts +9 -0
  432. package/www/types/results/rfid/Authority.d.ts +11 -0
  433. package/www/types/results/rfid/CardProperties.d.ts +48 -0
  434. package/www/types/results/rfid/CertificateChain.d.ts +28 -0
  435. package/www/types/results/rfid/CertificateData.d.ts +7 -0
  436. package/www/types/results/rfid/DataField.d.ts +9 -0
  437. package/www/types/results/rfid/Extension.d.ts +7 -0
  438. package/www/types/results/rfid/File.d.ts +22 -0
  439. package/www/types/results/rfid/FileData.d.ts +9 -0
  440. package/www/types/results/rfid/RFIDAccessControlProcedureType.d.ts +18 -0
  441. package/www/types/results/rfid/RFIDCertificateType.d.ts +14 -0
  442. package/www/types/results/rfid/RFIDDataFileType.d.ts +108 -0
  443. package/www/types/results/rfid/RFIDSessionData.d.ts +48 -0
  444. package/www/types/results/rfid/RFIDValidity.d.ts +9 -0
  445. package/www/types/results/rfid/RFIDValue.d.ts +10 -0
  446. package/www/types/results/rfid/SecurityObject.d.ts +28 -0
  447. package/www/types/results/rfid/SecurityObjectCertificates.d.ts +8 -0
  448. package/www/types/results/rfid/SignerInfo.d.ts +41 -0
  449. package/www/types/results/status/AgeStatus.d.ts +14 -0
  450. package/www/types/results/status/CheckResult.d.ts +8 -0
  451. package/www/types/results/status/OpticalStatus.d.ts +29 -0
  452. package/www/types/results/status/RFIDStatus.d.ts +22 -0
  453. package/www/types/results/status/ResultsStatus.d.ts +32 -0
  454. package/www/types/results/visible_digital_seals/BytesData.d.ts +9 -0
  455. package/www/types/results/visible_digital_seals/DocFeature.d.ts +9 -0
  456. package/www/types/results/visible_digital_seals/LDSParsingErrorCodes.d.ts +134 -0
  457. package/www/types/results/visible_digital_seals/LDSParsingNotificationCodes.d.ts +237 -0
  458. package/www/types/results/visible_digital_seals/VDSData.d.ts +32 -0
  459. package/www/types/results/visible_digital_seals/VDSNCData.d.ts +35 -0
  460. package/www/types/results/visual_results/Comparison.d.ts +15 -0
  461. package/www/types/results/visual_results/FieldType.d.ts +1328 -0
  462. package/www/types/results/visual_results/GraphicField.d.ts +29 -0
  463. package/www/types/results/visual_results/GraphicFieldType.d.ts +52 -0
  464. package/www/types/results/visual_results/GraphicResult.d.ts +10 -0
  465. package/www/types/results/visual_results/LCID.d.ts +173 -0
  466. package/www/types/results/visual_results/Lights.d.ts +23 -0
  467. package/www/types/results/visual_results/RFIDOrigin.d.ts +10 -0
  468. package/www/types/results/visual_results/Rect.d.ts +9 -0
  469. package/www/types/results/visual_results/Symbol.d.ts +14 -0
  470. package/www/types/results/visual_results/TextField.d.ts +40 -0
  471. package/www/types/results/visual_results/TextResult.d.ts +23 -0
  472. package/www/types/results/visual_results/TextSource.d.ts +15 -0
  473. package/www/types/results/visual_results/Validity.d.ts +13 -0
  474. package/www/types/results/visual_results/Value.d.ts +27 -0
  475. package/www/types/rfid/CAProtocol.d.ts +6 -0
  476. package/www/types/rfid/PAAttribute.d.ts +4 -0
  477. package/www/types/rfid/PACEProtocol.d.ts +5 -0
  478. package/www/types/rfid/PAResourcesIssuer.d.ts +7 -0
  479. package/www/types/rfid/PKDCertificate.d.ts +40 -0
  480. package/www/types/rfid/RFIDErrorCodes.d.ts +121 -0
  481. package/www/types/rfid/RFIDNotification.d.ts +156 -0
  482. package/www/types/rfid/TAChallenge.d.ts +7 -0
  483. package/www/types/rfid/TccParams.d.ts +25 -0
@@ -0,0 +1,656 @@
1
+ @file:SuppressLint("MissingPermission")
2
+ @file:Suppress("EnumValuesSoftDeprecate")
3
+
4
+ package com.regula.plugin.document.reader
5
+
6
+ import android.annotation.SuppressLint
7
+ import android.app.PendingIntent
8
+ import android.content.Intent
9
+ import android.content.IntentFilter
10
+ import android.nfc.NfcAdapter
11
+ import android.nfc.tech.IsoDep
12
+ import android.os.Build
13
+ import androidx.lifecycle.Lifecycle
14
+ import androidx.lifecycle.LifecycleEventObserver
15
+ import com.regula.common.LocalizationCallbacks
16
+ import com.regula.documentreader.api.DocumentReader.Instance
17
+ import com.regula.documentreader.api.completions.IDocumentReaderCompletion
18
+ import com.regula.documentreader.api.completions.IDocumentReaderInitCompletion
19
+ import com.regula.documentreader.api.completions.IDocumentReaderPrepareDbCompletion
20
+ import com.regula.documentreader.api.completions.IVideoEncoderCompletion
21
+ import com.regula.documentreader.api.completions.model.PrepareProgress
22
+ import com.regula.documentreader.api.completions.rfid.ICaProtocolCompletion
23
+ import com.regula.documentreader.api.completions.rfid.IPaceProtocolCompletion
24
+ import com.regula.documentreader.api.completions.rfid.IRfidAaChallengeCompletion
25
+ import com.regula.documentreader.api.completions.rfid.IRfidPKDCertificateCompletion
26
+ import com.regula.documentreader.api.completions.rfid.IRfidReaderCompletion
27
+ import com.regula.documentreader.api.completions.rfid.IRfidReaderRequest
28
+ import com.regula.documentreader.api.completions.rfid.IRfidTASignatureCompletion
29
+ import com.regula.documentreader.api.completions.rfid.certificates.IRfidAccessControl
30
+ import com.regula.documentreader.api.enums.DocReaderAction
31
+ import com.regula.documentreader.api.enums.LCID
32
+ import com.regula.documentreader.api.enums.eImageQualityCheckType
33
+ import com.regula.documentreader.api.enums.eLDS_ParsingErrorCodes
34
+ import com.regula.documentreader.api.enums.eLDS_ParsingNotificationCodes
35
+ import com.regula.documentreader.api.enums.eMDLDeviceEngagement
36
+ import com.regula.documentreader.api.enums.eRFID_DataFile_Type
37
+ import com.regula.documentreader.api.enums.eRFID_ErrorCodes
38
+ import com.regula.documentreader.api.enums.eVisualFieldType
39
+ import com.regula.documentreader.api.errors.DocReaderRfidException
40
+ import com.regula.documentreader.api.errors.DocumentReaderException
41
+ import com.regula.documentreader.api.internal.core.CoreScenarioUtil
42
+ import com.regula.documentreader.api.params.mdl.DataRetrieval
43
+ import com.regula.documentreader.api.params.rfid.CaProtocol
44
+ import com.regula.documentreader.api.params.rfid.PaceProtocol
45
+ import com.regula.documentreader.api.results.DocumentReaderNotification
46
+ import com.regula.documentreader.api.results.DocumentReaderResults
47
+ import com.regula.documentreader.api.results.DocumentReaderResults.fromRawResults
48
+ import com.regula.documentreader.api.results.DocumentReaderScenario
49
+ import org.json.JSONArray
50
+ import org.json.JSONObject
51
+ import com.regula.plugin.document.reader.Convert.toBase64
52
+ import com.regula.plugin.document.reader.Convert.toByteArray
53
+
54
+ fun methodCall(method: String, callback: (Any?) -> Unit): Any = when (method) {
55
+ "getDocumentReaderIsReady" -> getDocumentReaderIsReady(callback)
56
+ "getDocumentReaderStatus" -> getDocumentReaderStatus(callback)
57
+ "getRfidSessionStatus" -> getRfidSessionStatus(callback)
58
+ "setRfidSessionStatus" -> setRfidSessionStatus()
59
+ "getTag" -> getTag(callback)
60
+ "setTag" -> setTag(argsNullable(0))
61
+ "getTenant" -> getTenant(callback)
62
+ "setTenant" -> setTenant(argsNullable(0))
63
+ "getEnv" -> getEnv(callback)
64
+ "setEnv" -> setEnv(argsNullable(0))
65
+ "getLocale" -> getLocale(callback)
66
+ "setLocale" -> setLocale(argsNullable(0))
67
+ "getFunctionality" -> getFunctionality(callback)
68
+ "setFunctionality" -> setFunctionality(args(0))
69
+ "getProcessParams" -> getProcessParams(callback)
70
+ "setProcessParams" -> setProcessParams(args(0))
71
+ "getCustomization" -> getCustomization(callback)
72
+ "setCustomization" -> setCustomization(args(0))
73
+ "getRfidScenario" -> getRfidScenario(callback)
74
+ "setRfidScenario" -> setRfidScenario(args(0))
75
+ "resetConfiguration" -> resetConfiguration()
76
+ "initialize" -> initialize(callback, args(0))
77
+ "initializeReader" -> initialize(callback, args(0)) // deprecated
78
+ "initializeReaderWithBleDeviceConfig" -> initializeReaderWithBleDeviceConfig(callback, args(0)) // deprecated
79
+ "deinitializeReader" -> deinitializeReader()
80
+ "prepareDatabase" -> prepareDatabase(callback, args(0))
81
+ "removeDatabase" -> removeDatabase(callback)
82
+ "runAutoUpdate" -> runAutoUpdate(callback, args(0))
83
+ "cancelDBUpdate" -> cancelDBUpdate(callback)
84
+ "checkDatabaseUpdate" -> checkDatabaseUpdate(callback, args(0))
85
+ "scan" -> scan(args(0))
86
+ "startScanner" -> startScanner(args(0))
87
+ "recognize" -> recognize(args(0))
88
+ "startNewPage" -> startNewPage()
89
+ "stopScanner" -> stopScanner()
90
+ "startRFIDReader" -> startRFIDReader(argsNullable(0))
91
+ "readRFID" -> readRFID(argsNullable(0))
92
+ "stopRFIDReader" -> stopRFIDReader()
93
+ "providePACertificates" -> providePACertificates(argsNullable(0))
94
+ "provideTACertificates" -> provideTACertificates(argsNullable(0))
95
+ "provideTASignature" -> provideTASignature(args(0))
96
+ "provideAAChallenge" -> provideAAChallenge(args(0))
97
+ "selectPACEProtocol" -> selectPACEProtocol(args(0))
98
+ "selectCAProtocol" -> selectCAProtocol(args(0))
99
+ "setTCCParams" -> setTCCParams(callback, args(0))
100
+ "addPKDCertificates" -> addPKDCertificates(args(0))
101
+ "clearPKDCertificates" -> clearPKDCertificates()
102
+ "startNewSession" -> startNewSession()
103
+ "connectBluetoothDevice" -> connectBluetoothDevice(args(0), callback)
104
+ "btDeviceRequestFlashing" -> btDeviceRequestFlashing()
105
+ "btDeviceRequestFlashingFullIR" -> btDeviceRequestFlashingFullIR()
106
+ "btDeviceRequestTurnOffAll" -> btDeviceRequestTurnOffAll()
107
+ "startReadMDl" -> startReadMDl(args(0), args(1), callback)
108
+ "startEngageDevice" -> startEngageDevice(args(0), callback)
109
+ "engageDeviceNFC" -> engageDeviceNFC(callback)
110
+ "engageDeviceData" -> engageDeviceData(args(0), callback)
111
+ "startRetrieveData" -> startRetrieveData(args(0), args(1), callback)
112
+ "retrieveDataNFC" -> retrieveDataNFC(args(0), callback)
113
+ "retrieveDataBLE" -> retrieveDataBLE(args(0), args(1), callback)
114
+ "setLocalizationDictionary" -> setLocalizationDictionary(args(0))
115
+ "getLicense" -> getLicense(callback)
116
+ "getAvailableScenarios" -> getAvailableScenarios(callback)
117
+ "getIsRFIDAvailableForUse" -> getIsRFIDAvailableForUse(callback)
118
+ "isAuthenticatorAvailableForUse" -> isAuthenticatorAvailableForUse(callback)
119
+ "isAuthenticatorRFIDAvailableForUse" -> isAuthenticatorRFIDAvailableForUse(callback)
120
+ "getDocReaderVersion" -> getDocReaderVersion(callback)
121
+ "getDocReaderDocumentsDatabase" -> getDocReaderDocumentsDatabase(callback)
122
+ "textFieldValueByType" -> textFieldValueByType(callback, args(0), args(1))
123
+ "textFieldValueByTypeLcid" -> textFieldValueByTypeLcid(callback, args(0), args(1), args(2))
124
+ "textFieldValueByTypeSource" -> textFieldValueByTypeSource(callback, args(0), args(1), args(2))
125
+ "textFieldValueByTypeLcidSource" -> textFieldValueByTypeLcidSource(callback, args(0), args(1), args(2), args(3))
126
+ "textFieldValueByTypeSourceOriginal" -> textFieldValueByTypeSourceOriginal(callback, args(0), args(1), args(2), args(3))
127
+ "textFieldValueByTypeLcidSourceOriginal" -> textFieldValueByTypeLcidSourceOriginal(callback, args(0), args(1), args(2), args(3), args(4))
128
+ "textFieldByType" -> textFieldByType(callback, args(0), args(1))
129
+ "textFieldByTypeLcid" -> textFieldByTypeLcid(callback, args(0), args(1), args(2))
130
+ "graphicFieldByTypeSource" -> graphicFieldByTypeSource(callback, args(0), args(1), args(2))
131
+ "graphicFieldByTypeSourcePageIndex" -> graphicFieldByTypeSourcePageIndex(callback, args(0), args(1), args(2), args(3))
132
+ "graphicFieldByTypeSourcePageIndexLight" -> graphicFieldByTypeSourcePageIndexLight(callback, args(0), args(1), args(2), args(3), args(4))
133
+ "graphicFieldImageByType" -> graphicFieldImageByType(callback, args(0), args(1))
134
+ "graphicFieldImageByTypeSource" -> graphicFieldImageByTypeSource(callback, args(0), args(1), args(2))
135
+ "graphicFieldImageByTypeSourcePageIndex" -> graphicFieldImageByTypeSourcePageIndex(callback, args(0), args(1), args(2), args(3))
136
+ "graphicFieldImageByTypeSourcePageIndexLight" -> graphicFieldImageByTypeSourcePageIndexLight(callback, args(0), args(1), args(2), args(3), args(4))
137
+ "containers" -> containers(callback, args(0), args(1))
138
+ "encryptedContainers" -> encryptedContainers(callback, args(0))
139
+ "finalizePackage" -> finalizePackage(callback)
140
+ "finalizePackageWithFinalizeConfig" -> finalizePackageWithFinalizeConfig(callback, args(0))
141
+ "endBackendTransaction" -> endBackendTransaction()
142
+ "getTranslation" -> getTranslation(callback, args(0), args(1))
143
+ else -> Unit
144
+ }
145
+
146
+ inline fun <reified T> args(index: Int) = argsNullable<T>(index)!!
147
+ typealias Callback = (Any?) -> Unit
148
+
149
+ const val completionEvent = "completion"
150
+ const val databaseProgressEvent = "database_progress"
151
+
152
+ const val rfidOnProgressEvent = "rfidOnProgressCompletion"
153
+ const val rfidOnChipDetectedEvent = "rfidOnChipDetectedEvent"
154
+ const val rfidOnRetryReadChipEvent = "rfidOnRetryReadChipEvent"
155
+
156
+ const val paCertificateCompletionEvent = "pa_certificate_completion"
157
+ const val taCertificateCompletionEvent = "ta_certificate_completion"
158
+ const val taSignatureCompletionEvent = "ta_signature_completion"
159
+ const val aaChallengeCompletionEvent = "aaChallengeCompletionEvent"
160
+ const val paceProtocolCompletionEvent = "paceProtocolCompletionEvent"
161
+ const val caProtocolCompletionEvent = "caProtocolCompletionEvent"
162
+
163
+ const val videoEncoderCompletionEvent = "video_encoder_completion"
164
+ const val onCustomButtonTappedEvent = "onCustomButtonTappedEvent"
165
+
166
+ fun getDocumentReaderIsReady(callback: Callback) = callback(Instance().isReady)
167
+
168
+ fun getDocumentReaderStatus(callback: Callback) = callback(Instance().status)
169
+
170
+ fun getRfidSessionStatus(iosOnly: Callback) = iosOnly(null)
171
+
172
+ fun setRfidSessionStatus() = Unit
173
+
174
+ fun getTag(callback: Callback) = callback(Instance().tag)
175
+
176
+ fun setTag(tag: String?) = tag.let { Instance().tag = it }
177
+
178
+ fun getTenant(callback: Callback) = callback(Instance().tenant)
179
+
180
+ fun setTenant(tag: String?) = tag.let { Instance().tenant = it }
181
+
182
+ fun getEnv(callback: Callback) = callback(Instance().env)
183
+
184
+ fun setEnv(tag: String?) = tag.let { Instance().env = it }
185
+
186
+ fun getLocale(callback: Callback) = callback(Instance().locale)
187
+
188
+ fun setLocale(locale: String?) = locale.let { Instance().locale = it }
189
+
190
+ fun getFunctionality(callback: Callback) = callback(getFunctionality(Instance().functionality()))
191
+
192
+ fun setFunctionality(functionality: JSONObject) = setFunctionality(Instance().functionality(), functionality)
193
+
194
+ fun getProcessParams(callback: Callback) = callback(getProcessParams(Instance().processParams()))
195
+
196
+ fun setProcessParams(processParams: JSONObject) = setProcessParams(Instance().processParams(), processParams)
197
+
198
+ fun getCustomization(callback: Callback) = callback(getCustomization(Instance().customization()))
199
+
200
+ fun setCustomization(customization: JSONObject) = setCustomization(Instance().customization(), customization)
201
+
202
+ fun getRfidScenario(callback: Callback) = callback(getRfidScenario(Instance().rfidScenario()))
203
+
204
+ fun setRfidScenario(rfidScenario: JSONObject) = setRfidScenario(Instance().rfidScenario(), rfidScenario)
205
+
206
+ fun resetConfiguration() = Instance().resetConfiguration()
207
+
208
+ fun initialize(callback: Callback, config: JSONObject) =
209
+ if (config.getBooleanOrNull("useBleDevice") != true)
210
+ Instance().initializeReader(context, initConfigFromJSON(config), initCompletion(callback))
211
+ else
212
+ Instance().initializeReader(context, initBleDeviceConfigFromJSON(config), initCompletion(callback))
213
+
214
+ // deprecated
215
+ fun initializeReaderWithBleDeviceConfig(callback: Callback, config: JSONObject) = Instance().initializeReader(context, initBleDeviceConfigFromJSON(config), initCompletion(callback))
216
+
217
+ fun deinitializeReader() = Instance().deinitializeReader()
218
+
219
+ fun prepareDatabase(callback: Callback, databaseID: String) = Instance().prepareDatabase(
220
+ context,
221
+ databaseID,
222
+ prepareCompletion(callback)
223
+ )
224
+
225
+ fun removeDatabase(callback: Callback) = callback(Instance().removeDatabase(context))
226
+
227
+ fun runAutoUpdate(callback: Callback, databaseID: String) = Instance().runAutoUpdate(
228
+ context,
229
+ databaseID,
230
+ prepareCompletion(callback)
231
+ )
232
+
233
+ fun cancelDBUpdate(callback: Callback) = callback(Instance().cancelDBUpdate(context))
234
+
235
+ fun checkDatabaseUpdate(callback: Callback, databaseID: String) = Instance().checkDatabaseUpdate(
236
+ context,
237
+ databaseID
238
+ ) { callback(generateDocReaderDocumentsDatabase(it)) }
239
+
240
+ @Suppress("DEPRECATION")
241
+ fun scan(config: JSONObject) {
242
+ stopBackgroundRFID()
243
+ Instance().showScanner(activity, scannerConfigFromJSON(config), IDocumentReaderCompletion(completion))
244
+ }
245
+
246
+ fun startScanner(config: JSONObject) {
247
+ stopBackgroundRFID()
248
+ Instance().startScanner(activity, scannerConfigFromJSON(config), IDocumentReaderCompletion(completion))
249
+ }
250
+
251
+ fun recognize(config: JSONObject) {
252
+ stopBackgroundRFID()
253
+ Instance().recognize(recognizeConfigFromJSON(config), IDocumentReaderCompletion(completion))
254
+ }
255
+
256
+ fun startNewPage() = Instance().startNewPage()
257
+
258
+ fun stopScanner() = Instance().stopScanner(context)
259
+
260
+ fun startRFIDReader(config: JSONObject?) {
261
+ stopBackgroundRFID()
262
+ Instance().startRFIDReader(activity, rfidReaderCompletion, getRfidReaderRequest(config))
263
+ }
264
+
265
+ fun readRFID(config: JSONObject?) {
266
+ rfidReaderRequest = getRfidReaderRequest(config)
267
+ startForegroundDispatch("readRFID")
268
+ }
269
+
270
+ fun stopRFIDReader() {
271
+ Instance().stopRFIDReader(context)
272
+ stopBackgroundRFID()
273
+ }
274
+
275
+ fun providePACertificates(certificates: JSONArray?) = paCertificateCompletion.onCertificatesReceived(
276
+ certificates.toArray(::pkdCertificateFromJSON)
277
+ )
278
+
279
+ fun provideTACertificates(certificates: JSONArray?) = taCertificateCompletion.onCertificatesReceived(
280
+ certificates.toArray(::pkdCertificateFromJSON)
281
+ )
282
+
283
+ fun provideTASignature(signature: String?) = taSignatureCompletion.onSignatureReceived(
284
+ signature.toByteArray()
285
+ )
286
+
287
+ fun provideAAChallenge(challenge: String?) = aaChallengeCompletion.onChallengeReceived(challenge)
288
+
289
+ fun selectPACEProtocol(protocol: JSONObject) = paceProtocolCompletion.onPaceProtocolSelected(
290
+ paceProtocolFromJSON(protocol)!!
291
+ )
292
+
293
+ fun selectCAProtocol(protocol: JSONObject) = caProtocolCompletion.onCaProtocolSelected(
294
+ caProtocolFromJSON(protocol)!!
295
+ )
296
+
297
+ fun setTCCParams(callback: Callback, params: JSONObject) {
298
+ Instance().setTccParams(tccParamsFromJSON(params)) { success, error ->
299
+ callback(generateSuccessCompletion(success, error))
300
+ }
301
+ }
302
+
303
+ fun addPKDCertificates(certificates: JSONArray) = Instance().addPKDCertificates(
304
+ certificates.toList(::pkdCertificateFromJSON)!!
305
+ )
306
+
307
+ fun clearPKDCertificates() = Instance().clearPKDCertificates()
308
+
309
+ fun startNewSession() = Instance().startNewSession()
310
+
311
+ fun startReadMDl(type: Int, dataRetrieval: JSONObject, callback: Callback) {
312
+ stopBackgroundRFID()
313
+ Instance().startReadMDL(activity, eMDLDeviceEngagement.values()[type], dataRetrievalFromJSON(dataRetrieval)!!) { v1, v2, v3 -> callback(generateCompletion(v1, v2, v3)) }
314
+ }
315
+
316
+ fun startEngageDevice(type: Int, callback: Callback) {
317
+ stopBackgroundRFID()
318
+ Instance().startEngageDevice(activity, eMDLDeviceEngagement.values()[type]) { v1, v2 -> callback(generateDeviceEngagementCompletion(v1, v2)) }
319
+ }
320
+
321
+ lateinit var engageDeviceNFCCallback: Callback
322
+ fun engageDeviceNFC(callback: Callback) {
323
+ engageDeviceNFCCallback = callback
324
+ stopBackgroundRFID()
325
+ startForegroundDispatch("engageDeviceNFC")
326
+ }
327
+
328
+ fun engageDeviceData(data: String, callback: Callback) {
329
+ stopBackgroundRFID()
330
+ Instance().engageDeviceData(data) { v1, v2 -> callback(generateDeviceEngagementCompletion(v1, v2)) }
331
+ }
332
+
333
+ fun startRetrieveData(dataRetrieval: JSONObject, deviceEngagement: JSONObject, callback: Callback) {
334
+ stopBackgroundRFID()
335
+ Instance().startRetrieveData(activity, deviceEngagementFromJSON(deviceEngagement)!!, dataRetrievalFromJSON(dataRetrieval)!!) { v1, v2, v3 -> callback(generateCompletion(v1, v2, v3)) }
336
+ }
337
+
338
+ lateinit var retrieveDataNFCCallback: Callback
339
+ lateinit var retrieveDataNFCProp: DataRetrieval
340
+ fun retrieveDataNFC(dataRetrieval: JSONObject, callback: Callback) {
341
+ retrieveDataNFCCallback = callback
342
+ retrieveDataNFCProp = dataRetrievalFromJSON(dataRetrieval)!!
343
+ stopBackgroundRFID()
344
+ startForegroundDispatch("retrieveDataNFC")
345
+ }
346
+
347
+ fun retrieveDataBLE(dataRetrieval: JSONObject, deviceEngagement: JSONObject, callback: Callback) {
348
+ stopBackgroundRFID()
349
+ Instance().retrieveDataBLE(context, deviceEngagementFromJSON(deviceEngagement)!!, dataRetrievalFromJSON(dataRetrieval)!!) { v1, v2, v3 -> callback(generateCompletion(v1, v2, v3)) }
350
+ }
351
+
352
+ fun setLocalizationDictionary(dictionary: JSONObject) {
353
+ localizationCallbacks = LocalizationCallbacks { if (dictionary.has(it)) dictionary.getString(it) else null }
354
+ Instance().setLocalizationCallback(localizationCallbacks)
355
+ }
356
+
357
+ fun getLicense(callback: Callback) = callback(generateLicense(Instance().license()))
358
+
359
+ fun getAvailableScenarios(callback: Callback) {
360
+ val scenarios: MutableList<DocumentReaderScenario> = ArrayList()
361
+ for (scenario: DocumentReaderScenario in Instance().availableScenarios)
362
+ scenarios.add(CoreScenarioUtil.getScenario(scenario.name))
363
+ callback(scenarios.toJsonNullable(::generateDocumentReaderScenario))
364
+ }
365
+
366
+ fun getIsRFIDAvailableForUse(callback: Callback) = callback(Instance().isRFIDAvailableForUse)
367
+
368
+ fun isAuthenticatorAvailableForUse(callback: Callback) = callback(Instance().isAuthenticatorAvailableForUse)
369
+
370
+ fun isAuthenticatorRFIDAvailableForUse(callback: Callback) = callback(Instance().isAuthenticatorRFIDAvailableForUse)
371
+
372
+ fun getDocReaderVersion(callback: Callback) = callback(generateDocReaderVersion(Instance().version))
373
+
374
+ fun getDocReaderDocumentsDatabase(callback: Callback) = callback(Instance().version?.let {
375
+ generateDocReaderDocumentsDatabase(it.database)
376
+ })
377
+
378
+ fun finalizePackage(callback: Callback) = Instance().finalizePackage { action, info, error ->
379
+ callback(generateFinalizePackageCompletion(action, info, error))
380
+ }
381
+
382
+ fun finalizePackageWithFinalizeConfig(callback: Callback, config: JSONObject) = Instance().finalizePackage(
383
+ finalizeConfigFromJSON(config)
384
+ ) { action, info, error ->
385
+ callback(generateFinalizePackageCompletion(action, info, error))
386
+ }
387
+
388
+ fun endBackendTransaction() = Instance().endBackendTransaction()
389
+
390
+ fun textFieldValueByType(
391
+ callback: Callback,
392
+ raw: String,
393
+ fieldType: Int
394
+ ) = callback(fromRawResults(raw).getTextFieldValueByType(fieldType))
395
+
396
+ fun textFieldValueByTypeLcid(
397
+ callback: Callback,
398
+ raw: String,
399
+ fieldType: Int,
400
+ lcid: Int
401
+ ) = callback(fromRawResults(raw).getTextFieldValueByType(fieldType, lcid))
402
+
403
+ fun textFieldValueByTypeSource(
404
+ callback: Callback,
405
+ raw: String,
406
+ fieldType: Int,
407
+ source: Int
408
+ ) = callback(fromRawResults(raw).getTextFieldValueByTypeAndSource(fieldType, source))
409
+
410
+ fun textFieldValueByTypeLcidSource(
411
+ callback: Callback,
412
+ raw: String,
413
+ fieldType: Int,
414
+ lcid: Int,
415
+ source: Int
416
+ ) = callback(fromRawResults(raw).getTextFieldValueByType(fieldType, lcid, source))
417
+
418
+ fun textFieldValueByTypeSourceOriginal(
419
+ callback: Callback,
420
+ raw: String,
421
+ fieldType: Int,
422
+ source: Int,
423
+ original: Boolean
424
+ ) = callback(fromRawResults(raw).getTextFieldValueByTypeAndSource(fieldType, source, original))
425
+
426
+ fun textFieldValueByTypeLcidSourceOriginal(
427
+ callback: Callback,
428
+ raw: String,
429
+ fieldType: Int,
430
+ lcid: Int,
431
+ source: Int,
432
+ original: Boolean
433
+ ) = callback(fromRawResults(raw).getTextFieldValueByType(fieldType, lcid, source, original))
434
+
435
+ fun textFieldByType(
436
+ callback: Callback,
437
+ raw: String,
438
+ fieldType: Int
439
+ ) = callback(generateDocumentReaderTextField(fromRawResults(raw).getTextFieldByType(fieldType)))
440
+
441
+ fun textFieldByTypeLcid(
442
+ callback: Callback,
443
+ raw: String,
444
+ fieldType: Int,
445
+ lcid: Int
446
+ ) = callback(generateDocumentReaderTextField(fromRawResults(raw).getTextFieldByType(fieldType, lcid)))
447
+
448
+ fun graphicFieldByTypeSource(
449
+ callback: Callback,
450
+ raw: String,
451
+ fieldType: Int,
452
+ source: Int
453
+ ) = callback(generateDocumentReaderGraphicField(fromRawResults(raw).getGraphicFieldByType(fieldType, source)))
454
+
455
+ fun graphicFieldByTypeSourcePageIndex(
456
+ callback: Callback,
457
+ raw: String,
458
+ fieldType: Int,
459
+ source: Int,
460
+ pageIndex: Int
461
+ ) = callback(generateDocumentReaderGraphicField(fromRawResults(raw).getGraphicFieldByType(fieldType, source, pageIndex)))
462
+
463
+ fun graphicFieldByTypeSourcePageIndexLight(
464
+ callback: Callback,
465
+ raw: String,
466
+ fieldType: Int,
467
+ source: Int,
468
+ pageIndex: Int,
469
+ light: Int
470
+ ) = callback(generateDocumentReaderGraphicField(fromRawResults(raw).getGraphicFieldByType(fieldType, source, pageIndex, light)))
471
+
472
+ fun graphicFieldImageByType(
473
+ callback: Callback,
474
+ raw: String,
475
+ fieldType: Int
476
+ ) = callback(fromRawResults(raw).getGraphicFieldImageByType(fieldType).toBase64())
477
+
478
+ fun graphicFieldImageByTypeSource(
479
+ callback: Callback,
480
+ raw: String,
481
+ fieldType: Int,
482
+ source: Int
483
+ ) = callback(fromRawResults(raw).getGraphicFieldImageByType(fieldType, source).toBase64())
484
+
485
+ fun graphicFieldImageByTypeSourcePageIndex(
486
+ callback: Callback,
487
+ raw: String,
488
+ fieldType: Int,
489
+ source: Int,
490
+ pageIndex: Int
491
+ ) = callback(fromRawResults(raw).getGraphicFieldImageByType(fieldType, source, pageIndex).toBase64())
492
+
493
+ fun graphicFieldImageByTypeSourcePageIndexLight(
494
+ callback: Callback,
495
+ raw: String,
496
+ fieldType: Int,
497
+ source: Int,
498
+ pageIndex: Int,
499
+ light: Int
500
+ ) = callback(fromRawResults(raw).getGraphicFieldImageByType(fieldType, source, pageIndex, light).toBase64())
501
+
502
+ fun containers(
503
+ callback: Callback,
504
+ raw: String,
505
+ resultType: JSONArray
506
+ ) = callback(fromRawResults(raw).getContainers(resultType.toIntArray()!!))
507
+
508
+ fun encryptedContainers(
509
+ callback: Callback,
510
+ raw: String
511
+ ) = callback(fromRawResults(raw).encryptedContainers)
512
+
513
+ fun getTranslation(callback: Callback, className: String, value: Int) = when (className) {
514
+ "RFIDErrorCodes" -> callback(eRFID_ErrorCodes.getTranslation(context, value))
515
+ "LDSParsingErrorCodes" -> callback(eLDS_ParsingErrorCodes.getTranslation(context, value))
516
+ "LDSParsingNotificationCodes" -> callback(eLDS_ParsingNotificationCodes.getTranslation(context, value))
517
+ "ImageQualityCheckType" -> callback(eImageQualityCheckType.getTranslation(context, value))
518
+ "RFIDDataFileType" -> callback(eRFID_DataFile_Type.getTranslation(context, value))
519
+ "VisualFieldType" -> callback(eVisualFieldType.getTranslation(context, value))
520
+ "LCID" -> callback(LCID.getTranslation(context, value))
521
+ else -> Unit
522
+ }
523
+
524
+ // --------------------------------------------------------------------------------------------------------------------------
525
+
526
+ val completion = { action: Int, results: DocumentReaderResults?, error: DocumentReaderException? ->
527
+ sendEvent(completionEvent, generateCompletion(action, results, error))
528
+ if ((action == DocReaderAction.ERROR) ||
529
+ (action == DocReaderAction.CANCEL) ||
530
+ ((action == DocReaderAction.COMPLETE) && (results?.rfidResult == 1))
531
+ ) stopBackgroundRFID()
532
+ }
533
+
534
+ val rfidReaderCompletion = object : IRfidReaderCompletion() {
535
+ override fun onCompleted(action: Int, results: DocumentReaderResults?, error: DocumentReaderException?): Unit = completion(action, results, error)
536
+ override fun onChipDetected(): Unit = sendEvent(rfidOnChipDetectedEvent)
537
+ override fun onRetryReadChip(error: DocReaderRfidException) = sendEvent(rfidOnRetryReadChipEvent, generateRegulaException(error))
538
+ override fun onProgress(notification: DocumentReaderNotification) = sendEvent(rfidOnProgressEvent, generateDocumentReaderNotification(notification))
539
+ }
540
+
541
+ fun prepareCompletion(callback: Callback) = object : IDocumentReaderPrepareDbCompletion() {
542
+ override fun onPrepareProgressChanged(progress: PrepareProgress) = sendEvent(databaseProgressEvent, generatePrepareProgress(progress))
543
+ override fun onPrepareCompleted(success: Boolean, error: DocumentReaderException?) = callback(generateSuccessCompletion(success, error))
544
+ }
545
+
546
+ fun initCompletion(callback: Callback) = IDocumentReaderInitCompletion { success, error ->
547
+ if (success) {
548
+ videoEncoderCompletion = IVideoEncoderCompletion { _, file -> sendEvent(videoEncoderCompletionEvent, file.path) }
549
+ Instance().setVideoEncoderCompletion(videoEncoderCompletion)
550
+ Instance().setOnClickListener { sendEvent(onCustomButtonTappedEvent, it.tag) }
551
+ }
552
+ callback(generateSuccessCompletion(success, error))
553
+ }
554
+
555
+ lateinit var paCertificateCompletion: IRfidPKDCertificateCompletion
556
+ lateinit var taCertificateCompletion: IRfidPKDCertificateCompletion
557
+ lateinit var taSignatureCompletion: IRfidTASignatureCompletion
558
+ lateinit var aaChallengeCompletion: IRfidAaChallengeCompletion
559
+ lateinit var paceProtocolCompletion: IPaceProtocolCompletion
560
+ lateinit var caProtocolCompletion: ICaProtocolCompletion
561
+
562
+ var rfidReaderRequest = getRfidReaderRequest()
563
+
564
+ fun getRfidReaderRequest(config: JSONObject? = null): IRfidReaderRequest {
565
+ val result = IRfidReaderRequest()
566
+ if (config == null) return result
567
+
568
+ if (config.getBooleanOrNull("paCertificates") == true) result.setPACertificates { serialNumber, issuer, completion ->
569
+ paCertificateCompletion = completion
570
+ sendEvent(paCertificateCompletionEvent, generatePACertificateCompletion(serialNumber, issuer))
571
+ }
572
+ if (config.getBooleanOrNull("taCertificates") == true) result.setTACertificates { keyCAR, completion ->
573
+ taCertificateCompletion = completion
574
+ sendEvent(taCertificateCompletionEvent, keyCAR)
575
+ }
576
+ if (config.getBooleanOrNull("taSignature") == true) result.setTASignature { challenge, completion ->
577
+ taSignatureCompletion = completion
578
+ sendEvent(taSignatureCompletionEvent, generateTAChallenge(challenge))
579
+ }
580
+ if (config.getBooleanOrNull("aaChallenge") == true) result.setRfidAaChallenge { challenge, completion ->
581
+ aaChallengeCompletion = completion
582
+ sendEvent(aaChallengeCompletionEvent, challenge)
583
+ }
584
+ if (config.getBooleanOrNull("paceProtocol") == true || config.getBooleanOrNull("caProtocol") == true) result.setRfidAccessControl(object : IRfidAccessControl {
585
+ override fun onRequestPaceProtocol(list: List<PaceProtocol?>, completion: IPaceProtocolCompletion) {
586
+ paceProtocolCompletion = completion
587
+ sendEvent(paceProtocolCompletionEvent, list.toJson(::generatePaceProtocol))
588
+ }
589
+ override fun onRequestCaProtocol(list: List<CaProtocol?>, completion: ICaProtocolCompletion) {
590
+ caProtocolCompletion = completion
591
+ sendEvent(caProtocolCompletionEvent, list.toJson(::generateCaProtocol))
592
+ }
593
+ })
594
+
595
+ return result
596
+ }
597
+
598
+ @Suppress("DEPRECATION", "MissingPermission")
599
+ fun newIntent(intent: Intent): Boolean {
600
+ if (intent.action != NfcAdapter.ACTION_TECH_DISCOVERED) return false
601
+ val isoDep = IsoDep.get(intent.getParcelableExtra(NfcAdapter.EXTRA_TAG))
602
+ when (nfcFunction) {
603
+ "readRFID" -> Instance().readRFID(isoDep, rfidReaderCompletion, rfidReaderRequest)
604
+ "engageDeviceNFC" -> Instance().engageDeviceNFC(isoDep) { v1, v2 -> engageDeviceNFCCallback(generateDeviceEngagementCompletion(v1, v2)) }
605
+ "retrieveDataNFC" -> Instance().retrieveDataNFC(isoDep, retrieveDataNFCProp) { v1, v2, v3 -> retrieveDataNFCCallback(generateCompletion(v1, v2, v3)) }
606
+ }
607
+ return true
608
+ }
609
+
610
+ var backgroundRFIDEnabled = false
611
+ var nfcFunction = ""
612
+ lateinit var lifecycleObserver: LifecycleEventObserver
613
+
614
+ fun startForegroundDispatch(tag: String) {
615
+ backgroundRFIDEnabled = true
616
+ nfcFunction = tag
617
+ val filters: Array<IntentFilter?> = arrayOfNulls(1)
618
+ filters[0] = IntentFilter()
619
+ filters[0]!!.addAction(NfcAdapter.ACTION_TECH_DISCOVERED)
620
+ filters[0]!!.addCategory(Intent.CATEGORY_DEFAULT)
621
+ val techList = arrayOf(arrayOf("android.nfc.tech.IsoDep"))
622
+ val intent = Intent(activity, activity.javaClass)
623
+ val flag = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) PendingIntent.FLAG_MUTABLE else 0
624
+ val pendingIntent = PendingIntent.getActivity(activity, 0, intent, flag)
625
+
626
+ if (lifecycle.currentState.isAtLeast(Lifecycle.State.RESUMED))
627
+ enableForegroundDispatch(pendingIntent, filters, techList)
628
+ lifecycleObserver = LifecycleEventObserver { _, event ->
629
+ if (backgroundRFIDEnabled) when (event) {
630
+ Lifecycle.Event.ON_RESUME -> enableForegroundDispatch(pendingIntent, filters, techList)
631
+ Lifecycle.Event.ON_PAUSE -> disableForegroundDispatch()
632
+ else -> Unit
633
+ }
634
+ }
635
+ activity.runOnUiThread { lifecycle.addObserver(lifecycleObserver) }
636
+ }
637
+
638
+ fun enableForegroundDispatch(
639
+ pendingIntent: PendingIntent,
640
+ filters: Array<IntentFilter?>,
641
+ techList: Array<Array<String>>
642
+ ) = NfcAdapter.getDefaultAdapter(context).enableForegroundDispatch(activity, pendingIntent, filters, techList)
643
+
644
+ fun disableForegroundDispatch() = NfcAdapter.getDefaultAdapter(activity).disableForegroundDispatch(activity)
645
+
646
+ fun stopBackgroundRFID() {
647
+ if (!backgroundRFIDEnabled) return
648
+ backgroundRFIDEnabled = false
649
+ if (lifecycle.currentState.isAtLeast(Lifecycle.State.RESUMED))
650
+ disableForegroundDispatch()
651
+ activity.runOnUiThread { lifecycle.removeObserver(lifecycleObserver) }
652
+ }
653
+
654
+ // Weak references
655
+ lateinit var localizationCallbacks: LocalizationCallbacks
656
+ lateinit var videoEncoderCompletion: IVideoEncoderCompletion