anyline-ocr-react-native-module 51.1.1 → 51.4.0
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/android/build.gradle +2 -2
- package/android/src/main/java/com/anyline/reactnative/AnylineSDKPlugin.java +21 -8
- package/android/src/main/java/com/anyline/reactnative/FeedbackConfig.java +2 -1
- package/android/src/main/java/com/anyline/reactnative/ImageTextConfig.java +1 -0
- package/android/src/main/java/com/anyline/reactnative/InstructionConfig.java +1 -0
- package/android/src/main/java/com/anyline/reactnative/ScanActivity.java +53 -38
- package/android/src/main/java/com/anyline/reactnative/updateAsset/AnylineUpdateDelegateImpl.java +1 -1
- package/android/src/main/java/com/anyline/reactnative/updateAsset/AssetContextJsonParser.java +3 -3
- package/index.js +9 -1
- package/ios/ALNFCScanViewController.m +2 -1
- package/ios/ALPluginScanViewController.m +2 -3
- package/ios/AnylineSDKPlugin.h +2 -0
- package/ios/AnylineSDKPlugin.m +8 -1
- package/package.json +8 -8
- package/android/.gradle/7.6/checksums/checksums.lock +0 -0
- package/android/.gradle/7.6/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/7.6/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/7.6/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.6/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/7.6/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/7.6/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/7.6/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.6/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/7.6/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.6/fileHashes/resourceHashesCache.bin +0 -0
- package/android/.gradle/7.6/gc.properties +0 -0
- package/android/.gradle/8.1.1/checksums/checksums.lock +0 -0
- package/android/.gradle/8.1.1/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/8.1.1/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/8.1.1/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/8.1.1/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.1.1/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.1.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.1.1/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/file-system.probe +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/PipelineViewerConfig.xml +0 -6
- package/android/.idea/compiler.xml +0 -6
- package/android/.idea/gradle.xml +0 -19
- package/android/.idea/jarRepositories.xml +0 -30
- package/android/.idea/misc.xml +0 -9
- package/android/.idea/vcs.xml +0 -6
- package/android/build/generated/data_binding_trigger/debug/com/anyline/reactnative/DataBindingTriggerClass.java +0 -4
- package/android/build/generated/source/buildConfig/debug/com/anyline/reactnative/BuildConfig.java +0 -10
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +0 -21
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json +0 -16
- package/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +0 -2
- package/android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json +0 -1
- package/android/build/intermediates/data_binding_layout_info_type_package/debug/out/activity_scan-layout.xml +0 -1
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +0 -50
- package/android/build/intermediates/incremental/debug/packageDebugResources/merged.dir/values/values.xml +0 -24
- package/android/build/intermediates/incremental/debug/packageDebugResources/merged.dir/values-w820dp-v13/values-w820dp-v13.xml +0 -4
- package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +0 -4
- package/android/build/intermediates/incremental/debug/packageDebugResources/stripped.dir/layout/activity_scan.xml +0 -90
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +0 -2
- package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +0 -2
- package/android/build/intermediates/incremental/packageDebugResources/compile-file-map.properties +0 -50
- package/android/build/intermediates/incremental/packageDebugResources/merged.dir/values/values.xml +0 -24
- package/android/build/intermediates/incremental/packageDebugResources/merged.dir/values-w820dp-v13/values-w820dp-v13.xml +0 -4
- package/android/build/intermediates/incremental/packageDebugResources/merger.xml +0 -4
- package/android/build/intermediates/incremental/packageDebugResources/stripped.dir/layout/activity_scan.xml +0 -90
- package/android/build/intermediates/library_assets/debug/out/cow_tag_scanner.ale +0 -46
- package/android/build/intermediates/library_assets/debug/out/info_sound_TIN.wav +0 -0
- package/android/build/intermediates/library_manifest/debug/AndroidManifest.xml +0 -21
- package/android/build/intermediates/local_only_symbol_list/debug/R-def.txt +0 -44
- package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +0 -34
- package/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml +0 -19
- package/android/build/intermediates/packaged_manifests/debug/output-metadata.json +0 -16
- package/android/build/intermediates/packaged_res/debug/drawable/dot_overlay.png +0 -0
- package/android/build/intermediates/packaged_res/debug/drawable/manual_picture.png +0 -0
- package/android/build/intermediates/packaged_res/debug/drawable/rotate_screen_background.xml +0 -18
- package/android/build/intermediates/packaged_res/debug/drawable/rotate_screen_white.png +0 -0
- package/android/build/intermediates/packaged_res/debug/drawable-hdpi-v4/ic_flash_auto.png +0 -0
- package/android/build/intermediates/packaged_res/debug/drawable-hdpi-v4/ic_flash_off.png +0 -0
- package/android/build/intermediates/packaged_res/debug/drawable-hdpi-v4/ic_flash_on.png +0 -0
- package/android/build/intermediates/packaged_res/debug/drawable-hdpi-v4/ic_move_back.png +0 -0
- package/android/build/intermediates/packaged_res/debug/drawable-hdpi-v4/ic_move_closer.png +0 -0
- package/android/build/intermediates/packaged_res/debug/drawable-hdpi-v4/ic_too_bright.png +0 -0
- package/android/build/intermediates/packaged_res/debug/drawable-hdpi-v4/ic_too_dark.png +0 -0
- package/android/build/intermediates/packaged_res/debug/drawable-hdpi-v4/ic_wrong_format.png +0 -0
- package/android/build/intermediates/packaged_res/debug/drawable-mdpi-v4/ic_flash_auto.png +0 -0
- package/android/build/intermediates/packaged_res/debug/drawable-mdpi-v4/ic_flash_off.png +0 -0
- package/android/build/intermediates/packaged_res/debug/drawable-mdpi-v4/ic_flash_on.png +0 -0
- package/android/build/intermediates/packaged_res/debug/drawable-mdpi-v4/ic_move_back.png +0 -0
- package/android/build/intermediates/packaged_res/debug/drawable-mdpi-v4/ic_move_closer.png +0 -0
- package/android/build/intermediates/packaged_res/debug/drawable-mdpi-v4/ic_too_bright.png +0 -0
- package/android/build/intermediates/packaged_res/debug/drawable-mdpi-v4/ic_too_dark.png +0 -0
- package/android/build/intermediates/packaged_res/debug/drawable-mdpi-v4/ic_wrong_format.png +0 -0
- package/android/build/intermediates/packaged_res/debug/drawable-xhdpi-v4/ic_flash_auto.png +0 -0
- package/android/build/intermediates/packaged_res/debug/drawable-xhdpi-v4/ic_flash_off.png +0 -0
- package/android/build/intermediates/packaged_res/debug/drawable-xhdpi-v4/ic_flash_on.png +0 -0
- package/android/build/intermediates/packaged_res/debug/drawable-xhdpi-v4/ic_move_back.png +0 -0
- package/android/build/intermediates/packaged_res/debug/drawable-xhdpi-v4/ic_move_closer.png +0 -0
- package/android/build/intermediates/packaged_res/debug/drawable-xhdpi-v4/ic_too_bright.png +0 -0
- package/android/build/intermediates/packaged_res/debug/drawable-xhdpi-v4/ic_too_dark.png +0 -0
- package/android/build/intermediates/packaged_res/debug/drawable-xhdpi-v4/ic_wrong_format.png +0 -0
- package/android/build/intermediates/packaged_res/debug/drawable-xxhdpi-v4/ic_flash_auto.png +0 -0
- package/android/build/intermediates/packaged_res/debug/drawable-xxhdpi-v4/ic_flash_off.png +0 -0
- package/android/build/intermediates/packaged_res/debug/drawable-xxhdpi-v4/ic_flash_on.png +0 -0
- package/android/build/intermediates/packaged_res/debug/drawable-xxhdpi-v4/ic_move_back.png +0 -0
- package/android/build/intermediates/packaged_res/debug/drawable-xxhdpi-v4/ic_move_closer.png +0 -0
- package/android/build/intermediates/packaged_res/debug/drawable-xxhdpi-v4/ic_too_bright.png +0 -0
- package/android/build/intermediates/packaged_res/debug/drawable-xxhdpi-v4/ic_too_dark.png +0 -0
- package/android/build/intermediates/packaged_res/debug/drawable-xxhdpi-v4/ic_wrong_format.png +0 -0
- package/android/build/intermediates/packaged_res/debug/drawable-xxxhdpi-v4/ic_flash_auto.png +0 -0
- package/android/build/intermediates/packaged_res/debug/drawable-xxxhdpi-v4/ic_flash_off.png +0 -0
- package/android/build/intermediates/packaged_res/debug/drawable-xxxhdpi-v4/ic_flash_on.png +0 -0
- package/android/build/intermediates/packaged_res/debug/drawable-xxxhdpi-v4/ic_move_back.png +0 -0
- package/android/build/intermediates/packaged_res/debug/drawable-xxxhdpi-v4/ic_move_closer.png +0 -0
- package/android/build/intermediates/packaged_res/debug/drawable-xxxhdpi-v4/ic_too_bright.png +0 -0
- package/android/build/intermediates/packaged_res/debug/drawable-xxxhdpi-v4/ic_too_dark.png +0 -0
- package/android/build/intermediates/packaged_res/debug/drawable-xxxhdpi-v4/ic_wrong_format.png +0 -0
- package/android/build/intermediates/packaged_res/debug/layout/activity_scan.xml +0 -90
- package/android/build/intermediates/packaged_res/debug/mipmap-hdpi-v4/ic_launcher.png +0 -0
- package/android/build/intermediates/packaged_res/debug/mipmap-mdpi-v4/ic_launcher.png +0 -0
- package/android/build/intermediates/packaged_res/debug/mipmap-xhdpi-v4/ic_launcher.png +0 -0
- package/android/build/intermediates/packaged_res/debug/mipmap-xxhdpi-v4/ic_launcher.png +0 -0
- package/android/build/intermediates/packaged_res/debug/values/values.xml +0 -24
- package/android/build/intermediates/packaged_res/debug/values-w820dp-v13/values-w820dp-v13.xml +0 -4
- package/android/build/intermediates/variant_model/debug/out +0 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -59
- package/android/local.properties +0 -8
- package/android/src/main/assets/info_sound_TIN.wav +0 -0
- package/android/src/main/res/drawable/dot_overlay.png +0 -0
package/android/build.gradle
CHANGED
|
@@ -55,13 +55,13 @@ android {
|
|
|
55
55
|
|
|
56
56
|
repositories {
|
|
57
57
|
maven {
|
|
58
|
-
url 'https://
|
|
58
|
+
url 'https://mobile-sdk-android.anyline.io/release/'
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
dependencies {
|
|
63
63
|
implementation fileTree(dir: "libs", include: ["*.jar"])
|
|
64
|
-
implementation 'io.anyline:anylinesdk:51.
|
|
64
|
+
implementation 'io.anyline:anylinesdk:51.4.0'
|
|
65
65
|
implementation "com.facebook.react:react-native:+"
|
|
66
66
|
implementation("com.google.android.material:material:1.9.0")
|
|
67
67
|
implementation 'androidx.multidex:multidex:2.0.1'
|
|
@@ -20,8 +20,11 @@ import org.json.JSONObject;
|
|
|
20
20
|
import java.io.IOException;
|
|
21
21
|
import java.util.HashMap;
|
|
22
22
|
|
|
23
|
-
import io.
|
|
24
|
-
import io.
|
|
23
|
+
import io.anyline2.WrapperConfig;
|
|
24
|
+
import io.anyline2.WrapperInfo;
|
|
25
|
+
import io.anyline2.core.ScanController;
|
|
26
|
+
import io.anyline2.legacy.products.AnylineUpdater;
|
|
27
|
+
import io.anyline2.legacy.trainer.AssetContext;
|
|
25
28
|
import io.anyline2.AnylineSdk;
|
|
26
29
|
import io.anyline2.CacheConfig;
|
|
27
30
|
import io.anyline2.CorrectedResultReporting;
|
|
@@ -52,6 +55,8 @@ class AnylineSDKPlugin extends ReactContextBaseJavaModule implements ResultRepor
|
|
|
52
55
|
private String config;
|
|
53
56
|
private AssetContextJsonParser assetContextJsonParser;
|
|
54
57
|
|
|
58
|
+
private static WrapperConfig wrapperConfig;
|
|
59
|
+
|
|
55
60
|
AnylineSDKPlugin(ReactApplicationContext context) {
|
|
56
61
|
super(context);
|
|
57
62
|
this.reactContext = context;
|
|
@@ -68,6 +73,13 @@ class AnylineSDKPlugin extends ReactContextBaseJavaModule implements ResultRepor
|
|
|
68
73
|
promise.resolve(at.nineyards.anyline.BuildConfig.VERSION_NAME);
|
|
69
74
|
}
|
|
70
75
|
|
|
76
|
+
@ReactMethod
|
|
77
|
+
protected void setPluginVersion(final String pluginVersion) {
|
|
78
|
+
wrapperConfig = new WrapperConfig.Wrapper(
|
|
79
|
+
new WrapperInfo(WrapperInfo.WrapperType.ReactNative, pluginVersion)
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
71
83
|
@ReactMethod
|
|
72
84
|
public void licenseKeyExpiryDate(final Promise promise) {
|
|
73
85
|
try {
|
|
@@ -100,9 +112,10 @@ class AnylineSDKPlugin extends ReactContextBaseJavaModule implements ResultRepor
|
|
|
100
112
|
|
|
101
113
|
if (assetContext != null) {
|
|
102
114
|
AnylineUpdater.update(
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
115
|
+
reactContext,
|
|
116
|
+
assetContext,
|
|
117
|
+
new AnylineUpdateDelegateImpl(reactContext, onUpdateError, onUpdateFinished),
|
|
118
|
+
ScanController.PluginType.OCR
|
|
106
119
|
);
|
|
107
120
|
}
|
|
108
121
|
} catch (JSONException e) {
|
|
@@ -123,7 +136,7 @@ class AnylineSDKPlugin extends ReactContextBaseJavaModule implements ResultRepor
|
|
|
123
136
|
cacheConfig = CacheConfig.Preset.OfflineLicenseEventCachingEnabled.INSTANCE;
|
|
124
137
|
}
|
|
125
138
|
try {
|
|
126
|
-
AnylineSdk.init(license, reactContext, "", cacheConfig);
|
|
139
|
+
AnylineSdk.init(license, reactContext, "", cacheConfig, wrapperConfig);
|
|
127
140
|
this.license = license;
|
|
128
141
|
if (promise != null) {
|
|
129
142
|
promise.resolve(true);
|
|
@@ -148,7 +161,7 @@ class AnylineSDKPlugin extends ReactContextBaseJavaModule implements ResultRepor
|
|
|
148
161
|
cacheConfig = CacheConfig.Preset.OfflineLicenseEventCachingEnabled.INSTANCE;
|
|
149
162
|
}
|
|
150
163
|
try {
|
|
151
|
-
AnylineSdk.init(license, reactContext, "", cacheConfig);
|
|
164
|
+
AnylineSdk.init(license, reactContext, "", cacheConfig, wrapperConfig);
|
|
152
165
|
} catch (LicenseException e) {
|
|
153
166
|
e.printStackTrace();
|
|
154
167
|
returnError(e.getMessage());
|
|
@@ -257,7 +270,7 @@ class AnylineSDKPlugin extends ReactContextBaseJavaModule implements ResultRepor
|
|
|
257
270
|
if (configObject.has("license")) {
|
|
258
271
|
//if there is a license on JSON config then this license will be
|
|
259
272
|
//used to init or re-init the SDK
|
|
260
|
-
AnylineSdk.init(configObject.getString("license"), reactContext);
|
|
273
|
+
AnylineSdk.init(configObject.getString("license"), reactContext, "", CacheConfig.Preset.Default.INSTANCE, wrapperConfig);
|
|
261
274
|
license = configObject.get("license").toString();
|
|
262
275
|
} else {
|
|
263
276
|
throw new JSONException("No License in config. Please check your configuration.");
|
|
@@ -6,8 +6,9 @@ import org.json.JSONObject;
|
|
|
6
6
|
|
|
7
7
|
import java.io.IOException;
|
|
8
8
|
|
|
9
|
-
import io.
|
|
9
|
+
import io.anyline2.util.SoundUtil;
|
|
10
10
|
|
|
11
|
+
@Deprecated
|
|
11
12
|
public class FeedbackConfig {
|
|
12
13
|
private SoundUtil soundUtil;
|
|
13
14
|
public ImageTextConfig wrongFormat = null;
|
|
@@ -6,7 +6,6 @@ import static com.anyline.reactnative.AnylineSDKPlugin.RESULT_ERROR;
|
|
|
6
6
|
|
|
7
7
|
import android.content.Intent;
|
|
8
8
|
import android.content.pm.ActivityInfo;
|
|
9
|
-
import android.graphics.Bitmap;
|
|
10
9
|
import android.graphics.Color;
|
|
11
10
|
import android.graphics.Rect;
|
|
12
11
|
import android.os.Bundle;
|
|
@@ -15,7 +14,6 @@ import android.os.Looper;
|
|
|
15
14
|
import android.util.Pair;
|
|
16
15
|
import android.view.View;
|
|
17
16
|
import android.view.Gravity;
|
|
18
|
-
import android.util.Log;
|
|
19
17
|
|
|
20
18
|
import androidx.annotation.NonNull;
|
|
21
19
|
import androidx.annotation.Nullable;
|
|
@@ -28,12 +26,10 @@ import org.json.JSONArray;
|
|
|
28
26
|
import org.json.JSONException;
|
|
29
27
|
import org.json.JSONObject;
|
|
30
28
|
|
|
31
|
-
import java.io.IOException;
|
|
32
29
|
import java.util.Timer;
|
|
33
30
|
import java.util.TimerTask;
|
|
34
31
|
|
|
35
32
|
import io.anyline2.ScanResult;
|
|
36
|
-
import io.anyline2.view.BrightnessHelper;
|
|
37
33
|
import io.anyline2.view.ScanView;
|
|
38
34
|
import io.anyline2.viewplugin.ScanViewPlugin;
|
|
39
35
|
import io.anyline2.viewplugin.ViewPluginBase;
|
|
@@ -50,19 +46,31 @@ public class ScanActivity extends AppCompatActivity {
|
|
|
50
46
|
private boolean defaultOrientationApplied;
|
|
51
47
|
private int orientation;
|
|
52
48
|
|
|
49
|
+
@Deprecated
|
|
53
50
|
private InstructionConfig instructionConfig = null;
|
|
51
|
+
@Deprecated
|
|
54
52
|
private ImageTextConfig imageCutoutConfig = null;
|
|
53
|
+
@Deprecated
|
|
55
54
|
private FeedbackConfig feedbackConfig = null;
|
|
56
55
|
|
|
56
|
+
@Deprecated
|
|
57
57
|
private long cleanUIFeedbackIntervalMills = 2000L;
|
|
58
|
+
@Deprecated
|
|
58
59
|
private Timer cleanUIFeedbackTimer = null;
|
|
59
60
|
|
|
61
|
+
@Deprecated
|
|
60
62
|
private static final String FEEDBACK_SCANINFO_LIGHTINGCONDITION = "$lightingCondition";
|
|
63
|
+
@Deprecated
|
|
61
64
|
private static final String FEEDBACK_SCANINFO_LIGHTINGCONDITION_TOODARK = "TOODARK";
|
|
65
|
+
@Deprecated
|
|
62
66
|
private static final String FEEDBACK_SCANINFO_LIGHTINGCONDITION_TOOBRIGHT = "TOOBRIGHT";
|
|
67
|
+
@Deprecated
|
|
63
68
|
private static final int FEEDBACK_RUNSKIPPED_WRONGFORMAT = 5006;
|
|
69
|
+
@Deprecated
|
|
64
70
|
private static final int FEEDBACK_RUNSKIPPED_WRONGDATE = 5027;
|
|
71
|
+
@Deprecated
|
|
65
72
|
private static final int FEEDBACK_RUNSKIPPED_TOOCLOSE = 5023;
|
|
73
|
+
@Deprecated
|
|
66
74
|
private static final int FEEDBACK_RUNSKIPPED_TOOFAR = 5024;
|
|
67
75
|
|
|
68
76
|
@Override
|
|
@@ -94,40 +102,7 @@ public class ScanActivity extends AppCompatActivity {
|
|
|
94
102
|
|
|
95
103
|
ViewPluginBase viewPluginBase = scanView.getScanViewPlugin();
|
|
96
104
|
|
|
97
|
-
viewPluginBase
|
|
98
|
-
if (jsonObject.optString("name", "").equals(FEEDBACK_SCANINFO_LIGHTINGCONDITION)) {
|
|
99
|
-
String lightingConditionValue = jsonObject.optString("value", "");
|
|
100
|
-
if (feedbackConfig != null) {
|
|
101
|
-
if (lightingConditionValue.equalsIgnoreCase(FEEDBACK_SCANINFO_LIGHTINGCONDITION_TOODARK)) {
|
|
102
|
-
if (feedbackConfig.brightnessTooLow != null) {
|
|
103
|
-
updateUIFeedback(feedbackConfig.brightnessTooLow);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
else if (lightingConditionValue.equalsIgnoreCase(FEEDBACK_SCANINFO_LIGHTINGCONDITION_TOOBRIGHT)) {
|
|
107
|
-
if (feedbackConfig.brightnessTooHigh != null) {
|
|
108
|
-
updateUIFeedback(feedbackConfig.brightnessTooHigh);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
viewPluginBase.runSkippedReceived = jsonObject -> {
|
|
116
|
-
if (feedbackConfig != null) {
|
|
117
|
-
if (jsonObject.optInt("code", 0) == FEEDBACK_RUNSKIPPED_WRONGFORMAT
|
|
118
|
-
|| jsonObject.optInt("code", 0) == FEEDBACK_RUNSKIPPED_WRONGDATE) {
|
|
119
|
-
if (feedbackConfig.wrongFormat != null) {
|
|
120
|
-
updateUIFeedback(feedbackConfig.wrongFormat);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
if (jsonObject.optInt("code", 0) == FEEDBACK_RUNSKIPPED_TOOCLOSE
|
|
124
|
-
|| jsonObject.optInt("code", 0) == FEEDBACK_RUNSKIPPED_TOOFAR) {
|
|
125
|
-
if (feedbackConfig.distance != null) {
|
|
126
|
-
updateUIFeedback(feedbackConfig.distance);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
};
|
|
105
|
+
observeUIFeedbackEvents(viewPluginBase);
|
|
131
106
|
|
|
132
107
|
viewPluginBase.resultReceived = scanResult -> {
|
|
133
108
|
setResult(AnylineSDKPlugin.RESULT_OK);
|
|
@@ -222,6 +197,45 @@ public class ScanActivity extends AppCompatActivity {
|
|
|
222
197
|
}
|
|
223
198
|
}
|
|
224
199
|
|
|
200
|
+
@Deprecated
|
|
201
|
+
private void observeUIFeedbackEvents(ViewPluginBase viewPluginBase) {
|
|
202
|
+
viewPluginBase.scanInfoReceived = jsonObject -> {
|
|
203
|
+
if (jsonObject.optString("name", "").equals(FEEDBACK_SCANINFO_LIGHTINGCONDITION)) {
|
|
204
|
+
String lightingConditionValue = jsonObject.optString("value", "");
|
|
205
|
+
if (feedbackConfig != null) {
|
|
206
|
+
if (lightingConditionValue.equalsIgnoreCase(FEEDBACK_SCANINFO_LIGHTINGCONDITION_TOODARK)) {
|
|
207
|
+
if (feedbackConfig.brightnessTooLow != null) {
|
|
208
|
+
updateUIFeedback(feedbackConfig.brightnessTooLow);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
else if (lightingConditionValue.equalsIgnoreCase(FEEDBACK_SCANINFO_LIGHTINGCONDITION_TOOBRIGHT)) {
|
|
212
|
+
if (feedbackConfig.brightnessTooHigh != null) {
|
|
213
|
+
updateUIFeedback(feedbackConfig.brightnessTooHigh);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
viewPluginBase.runSkippedReceived = jsonObject -> {
|
|
221
|
+
if (feedbackConfig != null) {
|
|
222
|
+
if (jsonObject.optInt("code", 0) == FEEDBACK_RUNSKIPPED_WRONGFORMAT
|
|
223
|
+
|| jsonObject.optInt("code", 0) == FEEDBACK_RUNSKIPPED_WRONGDATE) {
|
|
224
|
+
if (feedbackConfig.wrongFormat != null) {
|
|
225
|
+
updateUIFeedback(feedbackConfig.wrongFormat);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
if (jsonObject.optInt("code", 0) == FEEDBACK_RUNSKIPPED_TOOCLOSE
|
|
229
|
+
|| jsonObject.optInt("code", 0) == FEEDBACK_RUNSKIPPED_TOOFAR) {
|
|
230
|
+
if (feedbackConfig.distance != null) {
|
|
231
|
+
updateUIFeedback(feedbackConfig.distance);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
@Deprecated
|
|
225
239
|
private void setupCustomUIFeedback(JSONObject configJSON) {
|
|
226
240
|
JSONObject optionsJsonObject = configJSON.optJSONObject("options");
|
|
227
241
|
if (optionsJsonObject != null) {
|
|
@@ -299,6 +313,7 @@ public class ScanActivity extends AppCompatActivity {
|
|
|
299
313
|
};
|
|
300
314
|
}
|
|
301
315
|
|
|
316
|
+
@Deprecated
|
|
302
317
|
private void updateUIFeedback(ImageTextConfig imageTextFeedback) {
|
|
303
318
|
if (imageTextFeedback.text != null) {
|
|
304
319
|
if (binding.textviewBrightDistanceFeedback.getText().equals(imageTextFeedback.text)) {
|
package/android/src/main/java/com/anyline/reactnative/updateAsset/AnylineUpdateDelegateImpl.java
CHANGED
|
@@ -6,7 +6,7 @@ import com.facebook.react.bridge.ReactContext;
|
|
|
6
6
|
import com.facebook.react.bridge.WritableMap;
|
|
7
7
|
import com.facebook.react.modules.core.DeviceEventManagerModule;
|
|
8
8
|
|
|
9
|
-
import io.
|
|
9
|
+
import io.anyline2.legacy.products.IAnylineUpdateDelegate;
|
|
10
10
|
|
|
11
11
|
public class AnylineUpdateDelegateImpl implements IAnylineUpdateDelegate {
|
|
12
12
|
|
package/android/src/main/java/com/anyline/reactnative/updateAsset/AssetContextJsonParser.java
CHANGED
|
@@ -7,9 +7,9 @@ import org.json.JSONObject;
|
|
|
7
7
|
|
|
8
8
|
import javax.annotation.Nullable;
|
|
9
9
|
|
|
10
|
-
import io.
|
|
11
|
-
import io.
|
|
12
|
-
import io.
|
|
10
|
+
import io.anyline2.legacy.products.ProductContext;
|
|
11
|
+
import io.anyline2.legacy.trainer.AssetContext;
|
|
12
|
+
import io.anyline2.legacy.trainer.ProjectContext;
|
|
13
13
|
|
|
14
14
|
public class AssetContextJsonParser {
|
|
15
15
|
|
package/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import {NativeModules} from 'react-native';
|
|
2
|
+
import AnylineOCR from 'anyline-ocr-react-native-module';
|
|
3
|
+
import {version as pluginVersion} from './package.json';
|
|
2
4
|
|
|
3
5
|
const Buffer = require('buffer/').Buffer;
|
|
4
6
|
|
|
@@ -14,4 +16,10 @@ export const getLicenseExpiryDate = (License) => {
|
|
|
14
16
|
const licenseJsonString = licenseString.substr(0, licenseString.lastIndexOf('}')+1);
|
|
15
17
|
const licenseJson = JSON.parse(licenseJsonString);
|
|
16
18
|
return licenseJson.valid;
|
|
17
|
-
};
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
AnylineOCR.setPluginVersion(pluginVersion);
|
|
22
|
+
|
|
23
|
+
AnylineOCR.getPluginVersion = () => {
|
|
24
|
+
return pluginVersion;
|
|
25
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#import <Anyline/Anyline.h>
|
|
2
2
|
#import "ALNFCScanViewController.h"
|
|
3
3
|
#import "ALPluginHelper.h"
|
|
4
|
+
#import "AnylineSDKPlugin.h"
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
API_AVAILABLE(ios(13.0))
|
|
@@ -78,7 +79,7 @@ API_AVAILABLE(ios(13.0))
|
|
|
78
79
|
NSError *error;
|
|
79
80
|
BOOL isInitialized = [ALLicenseUtil sharedInstance].isLicenseValid;
|
|
80
81
|
if (!isInitialized) {
|
|
81
|
-
[AnylineSDK setupWithLicenseKey:self.licenseKey error:&error];
|
|
82
|
+
[AnylineSDK setupWithLicenseKey:self.licenseKey cacheConfig:nil wrapperConfig:wrapperConfig error:&error];
|
|
82
83
|
if ([self showErrorAlertIfNeeded:error]) {
|
|
83
84
|
return;
|
|
84
85
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
#import "ALPluginScanViewController.h"
|
|
4
4
|
#import "ALPluginHelper.h"
|
|
5
5
|
#import "ALRoundedView.h"
|
|
6
|
+
#import "AnylineSDKPlugin.h"
|
|
6
7
|
|
|
7
8
|
@interface ALPluginScanViewController () <ALScanPluginDelegate, ALViewPluginCompositeDelegate, ALScanViewDelegate>
|
|
8
9
|
|
|
@@ -70,14 +71,12 @@
|
|
|
70
71
|
// Otherwise, make a license key check here.
|
|
71
72
|
BOOL isInitialized = [ALLicenseUtil sharedInstance].isLicenseValid;
|
|
72
73
|
if (!isInitialized) {
|
|
73
|
-
[AnylineSDK setupWithLicenseKey:self.licenseKey error:&error];
|
|
74
|
+
[AnylineSDK setupWithLicenseKey:self.licenseKey cacheConfig:nil wrapperConfig:wrapperConfig error:&error];
|
|
74
75
|
if ([self showErrorAlertIfNeeded:error]) {
|
|
75
76
|
return;
|
|
76
77
|
}
|
|
77
78
|
}
|
|
78
79
|
|
|
79
|
-
NSString *appVersion = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
|
|
80
|
-
|
|
81
80
|
self.scanView = [ALScanViewFactory withJSONDictionary:self.config
|
|
82
81
|
delegate:self
|
|
83
82
|
error:&error];
|
package/ios/AnylineSDKPlugin.h
CHANGED
package/ios/AnylineSDKPlugin.m
CHANGED
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
#import "ALNFCScanViewController.h"
|
|
8
8
|
|
|
9
|
+
ALWrapperConfig *wrapperConfig = nil;
|
|
10
|
+
|
|
9
11
|
@interface AnylineSDKPlugin()
|
|
10
12
|
|
|
11
13
|
@property (nonatomic, strong) ALScanViewPluginConfig *conf;
|
|
@@ -71,8 +73,9 @@ RCT_EXPORT_METHOD(setupAnylineSDKWithCacheConfig:(NSString *)licenseKey
|
|
|
71
73
|
self.returnMethod = @"promise";
|
|
72
74
|
self.licenseKey = licenseKey;
|
|
73
75
|
|
|
76
|
+
ALCacheConfig *cacheConfig = enableOfflineCache ? [ALCacheConfig offlineLicenseCachingEnabled] : nil;
|
|
74
77
|
NSError *error;
|
|
75
|
-
BOOL success = [AnylineSDK setupWithLicenseKey:licenseKey error:&error];
|
|
78
|
+
BOOL success = [AnylineSDK setupWithLicenseKey:licenseKey cacheConfig:cacheConfig wrapperConfig:wrapperConfig error:&error];
|
|
76
79
|
|
|
77
80
|
NSString *errorString = nil;
|
|
78
81
|
NSDictionary *successObj = nil;
|
|
@@ -100,6 +103,10 @@ RCT_EXPORT_METHOD(getSDKVersion:(RCTPromiseResolveBlock)resolve rejecter:(RCTPro
|
|
|
100
103
|
resolve(AnylineSDK.versionNumber);
|
|
101
104
|
}
|
|
102
105
|
|
|
106
|
+
RCT_EXPORT_METHOD(setPluginVersion:(NSString *)pluginVersion) {
|
|
107
|
+
wrapperConfig = [ALWrapperConfig reactNative:pluginVersion];
|
|
108
|
+
}
|
|
109
|
+
|
|
103
110
|
RCT_EXPORT_METHOD(licenseKeyExpiryDate:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
|
|
104
111
|
BOOL isInitialized = [[ALLicenseUtil sharedInstance] isLicenseValid];
|
|
105
112
|
if (!isInitialized) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"_from": "anyline-ocr-react-native-module@^51.
|
|
3
|
-
"_id": "anyline-ocr-react-native-module@^51.
|
|
2
|
+
"_from": "anyline-ocr-react-native-module@^51.4.0",
|
|
3
|
+
"_id": "anyline-ocr-react-native-module@^51.4.0",
|
|
4
4
|
"_inBundle": false,
|
|
5
5
|
"_integrity": "sha512-BGi9zNkSsoxXywDBIqzgBRvKUBniQOJHDKBrozZubKthZNRBAj8Ry5tW0Me0yLXt/fauME//hbC0wsenfPJZqw==",
|
|
6
6
|
"_location": "/anyline-ocr-react-native-module",
|
|
@@ -8,19 +8,19 @@
|
|
|
8
8
|
"_requested": {
|
|
9
9
|
"type": "range",
|
|
10
10
|
"registry": true,
|
|
11
|
-
"raw": "anyline-ocr-react-native-module@^51.
|
|
11
|
+
"raw": "anyline-ocr-react-native-module@^51.4.0",
|
|
12
12
|
"name": "anyline-ocr-react-native-module",
|
|
13
13
|
"escapedName": "anyline-ocr-react-native-module",
|
|
14
|
-
"rawSpec": "^51.
|
|
14
|
+
"rawSpec": "^51.4.0",
|
|
15
15
|
"saveSpec": null,
|
|
16
|
-
"fetchSpec": "^51.
|
|
16
|
+
"fetchSpec": "^51.4.0"
|
|
17
17
|
},
|
|
18
18
|
"_requiredBy": [
|
|
19
19
|
"/"
|
|
20
20
|
],
|
|
21
|
-
"_resolved": "https://registry.npmjs.org/anyline-ocr-react-native-module/-/anyline-ocr-react-native-module-
|
|
21
|
+
"_resolved": "https://registry.npmjs.org/anyline-ocr-react-native-module/-/anyline-ocr-react-native-module-51.4.0.tgz",
|
|
22
22
|
"_shasum": "bacbcd260cc662244f59393ed81a6edba009b52c",
|
|
23
|
-
"_spec": "anyline-ocr-react-native-module@^51.
|
|
23
|
+
"_spec": "anyline-ocr-react-native-module@^51.4.0",
|
|
24
24
|
"_where": "/Users/amiransari/Projects/anyline-ocr-react-native-module1/example/RNExampleApp",
|
|
25
25
|
"bugs": {
|
|
26
26
|
"url": "https://github.com/Anyline/anyline-ocr-react-native-module/issues"
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"type": "git",
|
|
48
48
|
"url": "git+https://github.com/Anyline/anyline-ocr-react-native-module.git"
|
|
49
49
|
},
|
|
50
|
-
"version": "51.
|
|
50
|
+
"version": "51.4.0"
|
|
51
51
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
package/android/.idea/gradle.xml
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="GradleMigrationSettings" migrationVersion="1" />
|
|
4
|
-
<component name="GradleSettings">
|
|
5
|
-
<option name="linkedExternalProjectsSettings">
|
|
6
|
-
<GradleProjectSettings>
|
|
7
|
-
<option name="testRunner" value="GRADLE" />
|
|
8
|
-
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
|
9
|
-
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
|
10
|
-
<option name="gradleJvm" value="11" />
|
|
11
|
-
<option name="modules">
|
|
12
|
-
<set>
|
|
13
|
-
<option value="$PROJECT_DIR$" />
|
|
14
|
-
</set>
|
|
15
|
-
</option>
|
|
16
|
-
</GradleProjectSettings>
|
|
17
|
-
</option>
|
|
18
|
-
</component>
|
|
19
|
-
</project>
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="RemoteRepositoriesConfiguration">
|
|
4
|
-
<remote-repository>
|
|
5
|
-
<option name="id" value="central" />
|
|
6
|
-
<option name="name" value="Maven Central repository" />
|
|
7
|
-
<option name="url" value="https://repo1.maven.org/maven2" />
|
|
8
|
-
</remote-repository>
|
|
9
|
-
<remote-repository>
|
|
10
|
-
<option name="id" value="jboss.community" />
|
|
11
|
-
<option name="name" value="JBoss Community repository" />
|
|
12
|
-
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
|
13
|
-
</remote-repository>
|
|
14
|
-
<remote-repository>
|
|
15
|
-
<option name="id" value="maven" />
|
|
16
|
-
<option name="name" value="maven" />
|
|
17
|
-
<option name="url" value="https://anylinesdk.blob.core.windows.net/maven/" />
|
|
18
|
-
</remote-repository>
|
|
19
|
-
<remote-repository>
|
|
20
|
-
<option name="id" value="MavenRepo" />
|
|
21
|
-
<option name="name" value="MavenRepo" />
|
|
22
|
-
<option name="url" value="https://repo.maven.apache.org/maven2/" />
|
|
23
|
-
</remote-repository>
|
|
24
|
-
<remote-repository>
|
|
25
|
-
<option name="id" value="Google" />
|
|
26
|
-
<option name="name" value="Google" />
|
|
27
|
-
<option name="url" value="https://dl.google.com/dl/android/maven2/" />
|
|
28
|
-
</remote-repository>
|
|
29
|
-
</component>
|
|
30
|
-
</project>
|
package/android/.idea/misc.xml
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
<project version="4">
|
|
2
|
-
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
|
3
|
-
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK">
|
|
4
|
-
<output url="file://$PROJECT_DIR$/build/classes" />
|
|
5
|
-
</component>
|
|
6
|
-
<component name="ProjectType">
|
|
7
|
-
<option name="id" value="Android" />
|
|
8
|
-
</component>
|
|
9
|
-
</project>
|
package/android/.idea/vcs.xml
DELETED
package/android/build/generated/source/buildConfig/debug/com/anyline/reactnative/BuildConfig.java
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Automatically generated file. DO NOT MODIFY
|
|
3
|
-
*/
|
|
4
|
-
package com.anyline.reactnative;
|
|
5
|
-
|
|
6
|
-
public final class BuildConfig {
|
|
7
|
-
public static final boolean DEBUG = Boolean.parseBoolean("true");
|
|
8
|
-
public static final String LIBRARY_PACKAGE_NAME = "com.anyline.reactnative";
|
|
9
|
-
public static final String BUILD_TYPE = "debug";
|
|
10
|
-
}
|
package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
-
package="com.anyline.reactnative"
|
|
4
|
-
android:versionCode="1"
|
|
5
|
-
android:versionName="1.0" >
|
|
6
|
-
|
|
7
|
-
<uses-sdk
|
|
8
|
-
android:minSdkVersion="21"
|
|
9
|
-
android:targetSdkVersion="31" />
|
|
10
|
-
|
|
11
|
-
<uses-permission android:name="android.permission.INTERNET" />
|
|
12
|
-
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
|
|
13
|
-
<uses-permission android:name="android.permission.CAMERA" />
|
|
14
|
-
|
|
15
|
-
<application android:allowBackup="true" >
|
|
16
|
-
<activity
|
|
17
|
-
android:name="com.anyline.reactnative.ScanActivity"
|
|
18
|
-
android:screenOrientation="portrait" />
|
|
19
|
-
</application>
|
|
20
|
-
|
|
21
|
-
</manifest>
|