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.
- package/RNScanbotBarcodeSDK.podspec +10 -7
- package/android/.DS_Store +0 -0
- package/android/.gradle/6.8/fileChanges/last-build.bin +0 -0
- package/android/.gradle/6.8/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/6.8/gc.properties +0 -0
- package/android/.gradle/7.4/checksums/checksums.lock +0 -0
- package/android/.gradle/7.4/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/7.4/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/7.4/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.4/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/7.4/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.4/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.4/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -2
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/workspace-id.txt +0 -0
- package/android/.gradle/workspace-id.txt.lock +0 -0
- package/android/build.gradle +30 -26
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/android/src/main/AndroidManifest.xml +1 -2
- package/android/src/main/java/com/reactlibrary/ScanbotBarcodeSdkModule.java +5 -12
- package/android/src/main/java/com/reactlibrary/ScanbotBarcodeSdkPackage.java +2 -2
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ObjectMapper.java +25 -14
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkConfiguration.java +4 -1
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule.java +91 -80
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkPackage.java +1 -2
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/StorageUtils.java +5 -69
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/barcode/ScanbotBarcodeDetectorAdditionalConfigBuilder.java +1 -1
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/barcode/ScanbotBarcodeDetectorConfigBuilder.java +1 -1
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraView.java +8 -14
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewConfiguration.java +4 -1
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/components/base/communication/ScanbotEventEmitter.java +5 -3
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/components/base/communication/ScanbotEventReceiver.java +15 -4
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/utils/JSONUtils.java +29 -40
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/utils/LogUtils.java +4 -1
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/utils/ResponseUtils.java +2 -10
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/utils/ScanbotViewUtils.java +0 -17
- package/android/src/new-architecture/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewManager.java +128 -0
- package/android/src/{main/java → old-architecture}/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewManager.java +1 -1
- package/index.js +1 -1
- package/ios/Categories/SBSDKPolygon+JSON.h +1 -1
- package/ios/Categories/SBSDKPolygon+JSON.m +1 -1
- package/ios/Categories/UIColor+JSON.h +1 -1
- package/ios/Categories/UIColor+JSON.m +1 -1
- package/ios/ScanbotBarcodeSDKConfiguration.h +1 -1
- package/ios/ScanbotBarcodeSDKConfiguration.m +1 -1
- package/ios/ScanbotBarcodeSdk.h +1 -1
- package/ios/ScanbotBarcodeSdk.m +1 -1
- package/ios/SharedConfiguration.h +1 -1
- package/ios/SharedConfiguration.m +1 -1
- package/ios/Utils/BarcodeMapping.h +1 -1
- package/ios/Utils/HashUtils.h +1 -1
- package/ios/Utils/JSONMappings.h +1 -1
- package/ios/Utils/LoggingUtils.h +1 -1
- package/ios/Utils/ObjectMapper.h +1 -1
- package/ios/Utils/ObjectMapper.m +1 -1
- package/ios/Utils/ScanbotStorageUtils.h +1 -1
- package/ios/Utils/ScanbotStorageUtils.m +1 -1
- package/js/RTNScanbotBarcodeCameraViewNativeComponent.tsx +208 -0
- package/package.json +22 -2
- package/src/components/barcode-camera-view/scanbot-barcode-camera-view.tsx +7 -2
- package/src/components/barcode-camera-view/scanbot-native-barcode-camera-view.tsx +7 -5
- package/src/configuration.ts +1 -1
- package/src/enum.ts +1 -1
- package/android/build/generated/source/buildConfig/debug/io/scanbot/barcodesdk/plugin/reactnative/BuildConfig.java +0 -18
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +0 -11
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output.json +0 -1
- package/android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json +0 -1
- package/android/build/intermediates/compile_library_classes/debug/classes.jar +0 -0
- package/android/build/intermediates/compile_only_not_namespaced_r_class_jar/debug/R.jar +0 -0
- package/android/build/intermediates/incremental/packageDebugResources/compile-file-map.properties +0 -3
- package/android/build/intermediates/incremental/packageDebugResources/merger.xml +0 -2
- package/android/build/intermediates/javac/debug/classes/com/reactlibrary/ScanbotBarcodeSdkModule.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/reactlibrary/ScanbotBarcodeSdkPackage.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/BitmapHelper.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/BuildConfig.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/JSONUtils$WritableMapBuilder.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/JSONUtils.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/LogUtils.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ObjectMapper.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ResponseUtils.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkConfiguration.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule$2$1$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule$2$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule$2.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule$3.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule$4.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkPackage.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/StorageUtils.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/EventEmitter$NativeEvent.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/EventEmitter.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewConfiguration.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewFragment$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewFragment$2.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewFragment$3$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewFragment$3.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewFragment.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewManager$1$1$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewManager$1$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewManager$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewManager.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/common/ScanbotComponentFrameLayout$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/common/ScanbotComponentFrameLayout$ILayoutChangeListener.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/common/ScanbotComponentFrameLayout.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/common/ScanbotComponentRootView$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/common/ScanbotComponentRootView$2.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/common/ScanbotComponentRootView$ILayoutChangeListener.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/common/ScanbotComponentRootView$IOnChildRemovedListener.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/common/ScanbotComponentRootView.class +0 -0
- package/android/build/intermediates/library_manifest/debug/AndroidManifest.xml +0 -11
- package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLibraryResources/R-def.txt +0 -8
- package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +0 -13
- package/android/build/intermediates/merged_manifests/debug/output.json +0 -1
- package/android/build/intermediates/packaged_res/debug/layout/component_barcode_camera_view.xml +0 -11
- package/android/build/intermediates/packaged_res/debug/layout/fragment_barcode_scanner.xml +0 -23
- package/android/build/intermediates/res/symbol-table-with-package/debug/package-aware-r.txt +0 -3598
- package/android/build/intermediates/symbols/debug/R.txt +0 -5145
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -37
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ReactBarcodeExtensionsFilter.java +0 -61
- 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
|
|
12
|
-
s.summary
|
|
13
|
-
s.homepage
|
|
14
|
-
s.authors
|
|
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
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#
|
|
2
|
-
gradle.version=7.
|
|
1
|
+
#Wed Aug 23 17:42:42 CEST 2023
|
|
2
|
+
gradle.version=7.4
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/build.gradle
CHANGED
|
@@ -6,25 +6,28 @@ def DEFAULT_TARGET_SDK_VERSION = 31
|
|
|
6
6
|
|
|
7
7
|
def sdkVersion = '3.6.0'
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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-
|
|
3
|
+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
|
|
4
4
|
zipStoreBase=GRADLE_USER_HOME
|
|
5
5
|
zipStorePath=wrapper/dists
|
|
@@ -1,24 +1,17 @@
|
|
|
1
1
|
/*
|
|
2
2
|
Scanbot Barcode Scanner SDK React Native Plugin
|
|
3
|
-
Copyright (c)
|
|
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
|
|
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)
|
|
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)
|
|
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"
|
|
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
|
-
|
|
104
|
-
|
|
105
|
-
|
|
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
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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)
|
|
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;
|