react-native-scanbot-barcode-scanner-sdk 3.6.0 → 3.6.1-alpha.1

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 (125) hide show
  1. package/RNScanbotBarcodeSDK.podspec +10 -7
  2. package/android/.DS_Store +0 -0
  3. package/android/.gradle/6.8/fileChanges/last-build.bin +0 -0
  4. package/android/.gradle/6.8/fileHashes/fileHashes.lock +0 -0
  5. package/android/.gradle/6.8/gc.properties +0 -0
  6. package/android/.gradle/7.4/checksums/checksums.lock +0 -0
  7. package/android/.gradle/7.4/checksums/md5-checksums.bin +0 -0
  8. package/android/.gradle/7.4/checksums/sha1-checksums.bin +0 -0
  9. package/android/.gradle/7.4/dependencies-accessors/dependencies-accessors.lock +0 -0
  10. package/android/.gradle/7.4/dependencies-accessors/gc.properties +0 -0
  11. package/android/.gradle/7.4/fileChanges/last-build.bin +0 -0
  12. package/android/.gradle/7.4/fileHashes/fileHashes.lock +0 -0
  13. package/android/.gradle/7.4/gc.properties +0 -0
  14. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  15. package/android/.gradle/buildOutputCleanup/cache.properties +2 -2
  16. package/android/.gradle/checksums/checksums.lock +0 -0
  17. package/android/.gradle/checksums/md5-checksums.bin +0 -0
  18. package/android/.gradle/checksums/sha1-checksums.bin +0 -0
  19. package/android/.gradle/workspace-id.txt +0 -0
  20. package/android/.gradle/workspace-id.txt.lock +0 -0
  21. package/android/build.gradle +30 -26
  22. package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
  23. package/android/src/main/AndroidManifest.xml +1 -2
  24. package/android/src/main/java/com/reactlibrary/ScanbotBarcodeSdkModule.java +5 -12
  25. package/android/src/main/java/com/reactlibrary/ScanbotBarcodeSdkPackage.java +2 -2
  26. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ObjectMapper.java +25 -14
  27. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkConfiguration.java +4 -1
  28. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule.java +91 -80
  29. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkPackage.java +1 -2
  30. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/StorageUtils.java +5 -69
  31. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/barcode/ScanbotBarcodeDetectorAdditionalConfigBuilder.java +1 -1
  32. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/barcode/ScanbotBarcodeDetectorConfigBuilder.java +1 -1
  33. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraView.java +8 -14
  34. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewConfiguration.java +4 -1
  35. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/components/base/communication/ScanbotEventEmitter.java +5 -3
  36. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/components/base/communication/ScanbotEventReceiver.java +15 -4
  37. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/utils/JSONUtils.java +29 -40
  38. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/utils/LogUtils.java +4 -1
  39. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/utils/ResponseUtils.java +2 -10
  40. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/utils/ScanbotViewUtils.java +0 -17
  41. package/android/src/new-architecture/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewManager.java +128 -0
  42. package/android/src/{main/java → old-architecture}/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewManager.java +1 -1
  43. package/index.js +1 -1
  44. package/ios/Categories/SBSDKPolygon+JSON.h +1 -1
  45. package/ios/Categories/SBSDKPolygon+JSON.m +1 -1
  46. package/ios/Categories/UIColor+JSON.h +1 -1
  47. package/ios/Categories/UIColor+JSON.m +1 -1
  48. package/ios/ScanbotBarcodeSDKConfiguration.h +1 -1
  49. package/ios/ScanbotBarcodeSDKConfiguration.m +1 -1
  50. package/ios/ScanbotBarcodeSdk.h +1 -1
  51. package/ios/ScanbotBarcodeSdk.m +1 -1
  52. package/ios/SharedConfiguration.h +1 -1
  53. package/ios/SharedConfiguration.m +1 -1
  54. package/ios/Utils/BarcodeMapping.h +1 -1
  55. package/ios/Utils/HashUtils.h +1 -1
  56. package/ios/Utils/JSONMappings.h +1 -1
  57. package/ios/Utils/LoggingUtils.h +1 -1
  58. package/ios/Utils/ObjectMapper.h +1 -1
  59. package/ios/Utils/ObjectMapper.m +1 -1
  60. package/ios/Utils/ScanbotStorageUtils.h +1 -1
  61. package/ios/Utils/ScanbotStorageUtils.m +1 -1
  62. package/js/RTNScanbotBarcodeCameraViewNativeComponent.tsx +208 -0
  63. package/package.json +22 -2
  64. package/src/components/barcode-camera-view/scanbot-barcode-camera-view.tsx +7 -2
  65. package/src/components/barcode-camera-view/scanbot-native-barcode-camera-view.tsx +7 -5
  66. package/src/configuration.ts +1 -1
  67. package/src/enum.ts +1 -1
  68. package/android/build/generated/source/buildConfig/debug/io/scanbot/barcodesdk/plugin/reactnative/BuildConfig.java +0 -18
  69. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +0 -11
  70. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output.json +0 -1
  71. package/android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json +0 -1
  72. package/android/build/intermediates/compile_library_classes/debug/classes.jar +0 -0
  73. package/android/build/intermediates/compile_only_not_namespaced_r_class_jar/debug/R.jar +0 -0
  74. package/android/build/intermediates/incremental/packageDebugResources/compile-file-map.properties +0 -3
  75. package/android/build/intermediates/incremental/packageDebugResources/merger.xml +0 -2
  76. package/android/build/intermediates/javac/debug/classes/com/reactlibrary/ScanbotBarcodeSdkModule.class +0 -0
  77. package/android/build/intermediates/javac/debug/classes/com/reactlibrary/ScanbotBarcodeSdkPackage.class +0 -0
  78. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/BitmapHelper.class +0 -0
  79. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/BuildConfig.class +0 -0
  80. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/JSONUtils$WritableMapBuilder.class +0 -0
  81. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/JSONUtils.class +0 -0
  82. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/LogUtils.class +0 -0
  83. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ObjectMapper.class +0 -0
  84. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ResponseUtils.class +0 -0
  85. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkConfiguration.class +0 -0
  86. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule$1.class +0 -0
  87. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule$2$1$1.class +0 -0
  88. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule$2$1.class +0 -0
  89. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule$2.class +0 -0
  90. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule$3.class +0 -0
  91. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule$4.class +0 -0
  92. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule.class +0 -0
  93. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkPackage.class +0 -0
  94. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/StorageUtils.class +0 -0
  95. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/EventEmitter$NativeEvent.class +0 -0
  96. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/EventEmitter.class +0 -0
  97. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewConfiguration.class +0 -0
  98. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewFragment$1.class +0 -0
  99. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewFragment$2.class +0 -0
  100. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewFragment$3$1.class +0 -0
  101. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewFragment$3.class +0 -0
  102. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewFragment.class +0 -0
  103. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewManager$1$1$1.class +0 -0
  104. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewManager$1$1.class +0 -0
  105. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewManager$1.class +0 -0
  106. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewManager.class +0 -0
  107. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/common/ScanbotComponentFrameLayout$1.class +0 -0
  108. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/common/ScanbotComponentFrameLayout$ILayoutChangeListener.class +0 -0
  109. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/common/ScanbotComponentFrameLayout.class +0 -0
  110. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/common/ScanbotComponentRootView$1.class +0 -0
  111. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/common/ScanbotComponentRootView$2.class +0 -0
  112. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/common/ScanbotComponentRootView$ILayoutChangeListener.class +0 -0
  113. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/common/ScanbotComponentRootView$IOnChildRemovedListener.class +0 -0
  114. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/common/ScanbotComponentRootView.class +0 -0
  115. package/android/build/intermediates/library_manifest/debug/AndroidManifest.xml +0 -11
  116. package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLibraryResources/R-def.txt +0 -8
  117. package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +0 -13
  118. package/android/build/intermediates/merged_manifests/debug/output.json +0 -1
  119. package/android/build/intermediates/packaged_res/debug/layout/component_barcode_camera_view.xml +0 -11
  120. package/android/build/intermediates/packaged_res/debug/layout/fragment_barcode_scanner.xml +0 -23
  121. package/android/build/intermediates/res/symbol-table-with-package/debug/package-aware-r.txt +0 -3598
  122. package/android/build/intermediates/symbols/debug/R.txt +0 -5145
  123. package/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -37
  124. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ReactBarcodeExtensionsFilter.java +0 -61
  125. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/utils/BitmapHelper.java +0 -30
@@ -1,24 +1,27 @@
1
+ # AUTOGENERATED: DO NOT MODIFY MANUALLY
2
+
1
3
  require "json"
2
4
 
3
5
  package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4
6
 
5
7
  ScanbotBarcodeScannerSDKVersion = '3.6.0'
6
8
 
7
- package = JSON.parse(File.read(File.join(__dir__, "package.json")))
8
-
9
9
  Pod::Spec.new do |s|
10
10
  s.name = "RNScanbotBarcodeSDK"
11
- s.version = package['version']
12
- s.summary = package['description']
13
- s.homepage = package['homepage']
14
- s.authors = package['author']
11
+ s.version = package['version']
12
+ s.summary = package['description']
13
+ s.homepage = package['homepage']
14
+ s.authors = package['author']
15
15
  s.license = { :type => 'Commercial' }
16
16
  s.platforms = { :ios => "9.0" }
17
- s.source = { :http => 'https://download.scanbot.io/barcode-scanner-sdk/react-native/react-native-scanbot-barcode-scanner-sdk-' + package['version'] + '.tgz' }
18
17
 
18
+
19
+ s.source = { :http => 'https://download.scanbot.io/barcode-scanner-sdk/react-native/react-native-scanbot-barcode-scanner-sdk-' + package['version'] + '.tgz' }
19
20
  s.source_files = "ios/**/*.{h,m,swift}"
20
21
  s.requires_arc = true
21
22
 
23
+ install_modules_dependencies(s)
24
+
22
25
  s.dependency "React"
23
26
  s.dependency "ScanbotBarcodeScannerSDK", ScanbotBarcodeScannerSDKVersion
24
27
 
Binary file
File without changes
File without changes
@@ -1,2 +1,2 @@
1
- #Thu Apr 20 12:17:41 CEST 2023
2
- gradle.version=7.1.1
1
+ #Wed Aug 23 17:42:42 CEST 2023
2
+ gradle.version=7.4
Binary file
@@ -6,25 +6,28 @@ def DEFAULT_TARGET_SDK_VERSION = 31
6
6
 
7
7
  def sdkVersion = '3.6.0'
8
8
 
9
- buildscript {
10
- if (project == rootProject) {
11
- repositories {
12
- google()
13
- mavenCentral()
14
- jcenter()
15
- }
16
- dependencies {
17
- classpath 'com.android.tools.build:gradle:3.5.3'
18
- }
19
- }
9
+ def isNewArchitectureEnabled = {
10
+ return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
20
11
  }
21
12
 
22
- apply plugin: 'com.android.library'
23
-
24
- def safeExtGet(prop, fallback) {
13
+ buildscript {
14
+ ext.safeExtGet = {prop, fallback ->
25
15
  rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
16
+ }
17
+ repositories {
18
+ google()
19
+ gradlePluginPortal()
20
+ jcenter()
21
+ mavenCentral()
22
+ }
23
+ dependencies {
24
+ classpath("com.android.tools.build:gradle:7.3.1")
25
+ }
26
26
  }
27
27
 
28
+ apply plugin: 'com.android.library'
29
+ apply plugin: 'com.facebook.react'
30
+
28
31
  android {
29
32
  compileSdkVersion safeExtGet('ScanbotBarcodeScannerSdk_compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
30
33
  defaultConfig {
@@ -32,6 +35,17 @@ android {
32
35
  targetSdkVersion safeExtGet('ScanbotBarcodeScannerSdk_targetSdkVersion', DEFAULT_TARGET_SDK_VERSION)
33
36
  versionCode 1
34
37
  versionName "1.0"
38
+ buildConfigField("boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString())
39
+ }
40
+
41
+ sourceSets {
42
+ main {
43
+ if (isNewArchitectureEnabled()) {
44
+ java.srcDirs += ['src/main', 'src/new-architecture']
45
+ } else {
46
+ java.srcDirs += ['src/main', 'src/old-architecture']
47
+ }
48
+ }
35
49
  }
36
50
 
37
51
  buildTypes {
@@ -43,21 +57,12 @@ android {
43
57
  lintOptions {
44
58
  disable 'GradleCompatible'
45
59
  }
46
-
47
- compileOptions {
48
- sourceCompatibility JavaVersion.VERSION_1_8
49
- targetCompatibility JavaVersion.VERSION_1_8
50
- }
51
60
  }
52
61
 
53
62
  repositories {
54
63
  mavenLocal()
55
- maven {
56
- // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
57
- url("$rootDir/../node_modules/react-native/android")
58
- }
59
- google()
60
64
  mavenCentral()
65
+ google()
61
66
  jcenter()
62
67
 
63
68
  // Scanbot SDK Maven Repositories (NEXUS)
@@ -70,8 +75,7 @@ repositories {
70
75
  }
71
76
 
72
77
  dependencies {
73
- //noinspection GradleDynamicVersion
74
- implementation 'com.facebook.react:react-native:+' // From node_modules
78
+ implementation 'com.facebook.react:react-native'
75
79
 
76
80
  implementation 'androidx.appcompat:appcompat:1.1.0'
77
81
  implementation 'androidx.core:core-ktx:1.1.0'
@@ -1,5 +1,5 @@
1
1
  distributionBase=GRADLE_USER_HOME
2
2
  distributionPath=wrapper/dists
3
- distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip
3
+ distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
4
4
  zipStoreBase=GRADLE_USER_HOME
5
5
  zipStorePath=wrapper/dists
@@ -1,4 +1,3 @@
1
- <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
- package="io.scanbot.barcodesdk.plugin.reactnative">
1
+ <manifest package="io.scanbot.barcodesdk.plugin.reactnative">
3
2
 
4
3
  </manifest>
@@ -1,24 +1,17 @@
1
1
  /*
2
2
  Scanbot Barcode Scanner SDK React Native Plugin
3
- Copyright (c) 2020 doo GmbH. All rights reserved.
3
+ Copyright (c) 2023 Scanbot SDK GmbH. All rights reserved.
4
4
  https://scanbot.io/sdk
5
5
  */
6
6
  package com.reactlibrary;
7
7
 
8
- import com.facebook.react.bridge.ReactApplicationContext;
8
+ import androidx.annotation.NonNull;
9
+
9
10
  import com.facebook.react.bridge.ReactContextBaseJavaModule;
10
- import com.facebook.react.bridge.ReactMethod;
11
- import com.facebook.react.bridge.Callback;
12
11
 
12
+ /** @noinspection unused*/
13
13
  public class ScanbotBarcodeSdkModule extends ReactContextBaseJavaModule {
14
-
15
- private final ReactApplicationContext reactContext;
16
-
17
- public ScanbotBarcodeSdkModule(ReactApplicationContext reactContext) {
18
- super(reactContext);
19
- this.reactContext = reactContext;
20
- }
21
-
14
+ @NonNull
22
15
  @Override
23
16
  public String getName() {
24
17
  return "ScanbotBarcodeSdk";
@@ -1,13 +1,12 @@
1
1
  /*
2
2
  Scanbot Barcode Scanner SDK React Native Plugin
3
- Copyright (c) 2020 doo GmbH. All rights reserved.
3
+ Copyright (c) 2023 Scanbot SDK GmbH. All rights reserved.
4
4
  https://scanbot.io/sdk
5
5
  */
6
6
  package com.reactlibrary;
7
7
 
8
8
  import androidx.annotation.NonNull;
9
9
 
10
- import java.util.Arrays;
11
10
  import java.util.Collections;
12
11
  import java.util.List;
13
12
 
@@ -19,6 +18,7 @@ import com.facebook.react.uimanager.ViewManager;
19
18
  import io.scanbot.barcodesdk.plugin.reactnative.ScanbotBarcodeSdkModule;
20
19
  import io.scanbot.barcodesdk.plugin.reactnative.components.barcodecameraview.ScanbotBarcodeCameraViewManager;
21
20
 
21
+ /** @noinspection unused*/
22
22
  public class ScanbotBarcodeSdkPackage implements ReactPackage {
23
23
  @NonNull
24
24
  @Override
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  Scanbot Barcode Scanner SDK React Native Plugin
3
- Copyright (c) 2020 doo GmbH. All rights reserved.
3
+ Copyright (c) 2023 Scanbot SDK GmbH. All rights reserved.
4
4
  https://scanbot.io/sdk
5
5
  */
6
6
  package io.scanbot.barcodesdk.plugin.reactnative;
@@ -17,7 +17,7 @@ import java.util.Map;
17
17
  import io.scanbot.sdk.ui.camera.FinderAspectRatio;
18
18
 
19
19
  public final class ObjectMapper {
20
- private static Map<String, Map<String, Method>> methodCache = new HashMap<>();
20
+ private static final Map<String, Map<String, Method>> methodCache = new HashMap<>();
21
21
 
22
22
  private static Map<String, Map<String, String>> enumMappings;
23
23
 
@@ -44,7 +44,7 @@ public final class ObjectMapper {
44
44
  ObjectMapper.enumMappings = enumMappings;
45
45
  }
46
46
 
47
- @SuppressWarnings({"unchecked", "SuspiciousMethodCalls", "rawtypes", "ConstantConditions"})
47
+ @SuppressWarnings({"unchecked", "SuspiciousMethodCalls", "rawtypes"})
48
48
  private static void map(final Map<String, Object> source, final Object target)
49
49
  throws IllegalAccessException, InvocationTargetException {
50
50
  final Class cls = target.getClass();
@@ -93,22 +93,33 @@ public final class ObjectMapper {
93
93
 
94
94
  if (enumMappings != null && enumMappings.containsKey(prop)) {
95
95
  Map<String, String> enumNames = enumMappings.get(prop);
96
- if (enumNames.containsKey(value)) {
96
+ if (enumNames != null && enumNames.containsKey(value)) {
97
97
  value = enumNames.get(value);
98
98
  }
99
99
  }
100
100
 
101
101
  if (setterName.equals("setFinderAspectRatio")) {
102
- Map<String, Object> pointMap = (Map<String, Object>) value;
103
- int x = ((Number) pointMap.get("width")).intValue();
104
- int y = ((Number) pointMap.get("height")).intValue();
105
- setter.invoke(target, new FinderAspectRatio(x, y));
102
+ final Map<String, Object> pointMap = (Map<String, Object>) value;
103
+ if (pointMap != null) {
104
+ final Object widthObj = pointMap.get("width");
105
+ final Object heightObj = pointMap.get("width");
106
+ if (widthObj != null && heightObj != null) {
107
+ int x = ((Number) widthObj).intValue();
108
+ int y = ((Number) heightObj).intValue();
109
+ // TODO: FinderAspectRatio is deprecated
110
+ setter.invoke(target, new FinderAspectRatio(x, y));
111
+ }
112
+ }
106
113
  } else if (setter.getParameterTypes().length == 2 && value instanceof Map) {
107
- // map Size to a binary function
108
- Map<String, Object> pointMap = (Map<String, Object>) value;
109
- int x = ((Number) pointMap.get("width")).intValue();
110
- int y = ((Number) pointMap.get("height")).intValue();
111
- setter.invoke(target, x, y);
114
+ final Map<String, Object> pointMap = (Map<String, Object>) value;
115
+ final Object widthObj = pointMap.get("width");
116
+ final Object heightObj = pointMap.get("width");
117
+ if (widthObj != null && heightObj != null) {
118
+ int x = ((Number) widthObj).intValue();
119
+ int y = ((Number) heightObj).intValue();
120
+ // TODO: FinderAspectRatio is deprecated
121
+ setter.invoke(target, new FinderAspectRatio(x, y));
122
+ }
112
123
  } else {
113
124
  final Class paramType = setter.getParameterTypes()[0];
114
125
  if (setterName.contains("Color")) {
@@ -122,7 +133,7 @@ public final class ObjectMapper {
122
133
  } else if (paramType == double.class) {
123
134
  assert value instanceof Number;
124
135
  value = ((Number) value).doubleValue();
125
- } else if (paramType.isEnum()) {
136
+ } else if (paramType.isEnum() && value != null) {
126
137
  try {
127
138
  value = Enum.valueOf(paramType, (String) value);
128
139
  } catch (final Exception ignored) {
@@ -1,10 +1,13 @@
1
1
  /*
2
2
  Scanbot Barcode Scanner SDK React Native Plugin
3
- Copyright (c) 2020 doo GmbH. All rights reserved.
3
+ Copyright (c) 2023 Scanbot SDK GmbH. All rights reserved.
4
4
  https://scanbot.io/sdk
5
5
  */
6
6
  package io.scanbot.barcodesdk.plugin.reactnative;
7
7
 
8
+ // The following noinspection rule has been introduced since
9
+ // methods in this class are called through reflection
10
+ /** @noinspection unused*/
8
11
  public class ScanbotBarcodeSdkConfiguration {
9
12
  private boolean loggingEnabled = false;
10
13
  private boolean enableNativeLogging = false;