anyline-ocr-react-native-module 42.0.0 → 42.2.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/.gradle/6.7/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/6.7/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/6.7/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +1 -1
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- 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/.idea/compiler.xml +6 -0
- package/android/.idea/gradle.xml +18 -0
- package/android/.idea/jarRepositories.xml +35 -0
- package/android/.idea/misc.xml +10 -0
- package/android/.idea/vcs.xml +6 -0
- package/android/build.gradle +4 -4
- package/android/local.properties +8 -0
- package/android/src/main/java/com/anyline/reactnative/Anyline4Activity.java +79 -98
- package/android/src/main/java/com/anyline/reactnative/AnylinePluginHelper.java +8 -4
- package/android/src/main/java/com/anyline/reactnative/AnylineSDKPlugin.java +20 -4
- package/package.json +8 -8
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#Wed
|
|
1
|
+
#Wed Nov 16 08:16:14 CET 2022
|
|
2
2
|
gradle.version=6.7
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,18 @@
|
|
|
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="modules">
|
|
11
|
+
<set>
|
|
12
|
+
<option value="$PROJECT_DIR$" />
|
|
13
|
+
</set>
|
|
14
|
+
</option>
|
|
15
|
+
</GradleProjectSettings>
|
|
16
|
+
</option>
|
|
17
|
+
</component>
|
|
18
|
+
</project>
|
|
@@ -0,0 +1,35 @@
|
|
|
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/testing/" />
|
|
18
|
+
</remote-repository>
|
|
19
|
+
<remote-repository>
|
|
20
|
+
<option name="id" value="BintrayJCenter" />
|
|
21
|
+
<option name="name" value="BintrayJCenter" />
|
|
22
|
+
<option name="url" value="https://jcenter.bintray.com/" />
|
|
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
|
+
<remote-repository>
|
|
30
|
+
<option name="id" value="maven" />
|
|
31
|
+
<option name="name" value="maven" />
|
|
32
|
+
<option name="url" value="https://anylinesdk.blob.core.windows.net/maven/" />
|
|
33
|
+
</remote-repository>
|
|
34
|
+
</component>
|
|
35
|
+
</project>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
|
4
|
+
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="Android Studio default JDK" project-jdk-type="JavaSDK">
|
|
5
|
+
<output url="file://$PROJECT_DIR$/build/classes" />
|
|
6
|
+
</component>
|
|
7
|
+
<component name="ProjectType">
|
|
8
|
+
<option name="id" value="Android" />
|
|
9
|
+
</component>
|
|
10
|
+
</project>
|
package/android/build.gradle
CHANGED
|
@@ -19,11 +19,11 @@ allprojects {
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
android {
|
|
22
|
-
compileSdkVersion
|
|
22
|
+
compileSdkVersion rootProject.ext.compileSdkVersion
|
|
23
23
|
|
|
24
24
|
defaultConfig {
|
|
25
|
-
minSdkVersion
|
|
26
|
-
targetSdkVersion
|
|
25
|
+
minSdkVersion rootProject.ext.minSdkVersion
|
|
26
|
+
targetSdkVersion rootProject.ext.targetSdkVersion
|
|
27
27
|
versionCode 1
|
|
28
28
|
versionName "1.0"
|
|
29
29
|
ndk {
|
|
@@ -65,7 +65,7 @@ repositories {
|
|
|
65
65
|
|
|
66
66
|
dependencies {
|
|
67
67
|
implementation fileTree(dir: "libs", include: ["*.jar"])
|
|
68
|
-
implementation 'io.anyline:anylinesdk:42.
|
|
68
|
+
implementation 'io.anyline:anylinesdk:42.2.0'
|
|
69
69
|
implementation "com.facebook.react:react-native:+" // from node_modules
|
|
70
70
|
implementation("com.google.android.material:material:1.4.0-rc01")
|
|
71
71
|
implementation 'androidx.multidex:multidex:2.0.1'
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
## This file must *NOT* be checked into Version Control Systems,
|
|
2
|
+
# as it contains information specific to your local configuration.
|
|
3
|
+
#
|
|
4
|
+
# Location of the SDK. This is only used by Gradle.
|
|
5
|
+
# For customization when using a Version Control System, please read the
|
|
6
|
+
# header note.
|
|
7
|
+
#Wed Nov 16 08:15:22 CET 2022
|
|
8
|
+
sdk.dir=/Users/patrickfekete/Library/Android/sdk
|
|
@@ -51,9 +51,9 @@ import io.anyline.plugin.meter.MeterScanViewPlugin;
|
|
|
51
51
|
import io.anyline.plugin.ocr.OcrScanResult;
|
|
52
52
|
import io.anyline.plugin.ocr.OcrScanViewPlugin;
|
|
53
53
|
import io.anyline.plugin.tire.TireScanResult;
|
|
54
|
-
import io.anyline.plugin.tire.TireScanPlugin;
|
|
55
54
|
import io.anyline.plugin.tire.TireScanViewPlugin;
|
|
56
55
|
import io.anyline.view.AbstractBaseScanViewPlugin;
|
|
56
|
+
import io.anyline.plugin.tire.TireSizeScanResult;
|
|
57
57
|
import io.anyline.view.CutoutRect;
|
|
58
58
|
import io.anyline.view.ParallelScanViewComposite;
|
|
59
59
|
import io.anyline.view.ScanView;
|
|
@@ -62,7 +62,7 @@ import io.anyline.view.SerialScanViewComposite;
|
|
|
62
62
|
|
|
63
63
|
public class Anyline4Activity extends AnylineBaseActivity {
|
|
64
64
|
private static final String TAG = Anyline4Activity.class.getSimpleName();
|
|
65
|
-
|
|
65
|
+
private static final String KEY_DEFAULT_ORIENTATION_APPLIED = "default_orientation_applied";
|
|
66
66
|
private ScanView anylineScanView;
|
|
67
67
|
private AbstractBaseScanViewPlugin scanViewPlugin;
|
|
68
68
|
private RadioGroup radioGroup;
|
|
@@ -71,7 +71,6 @@ public class Anyline4Activity extends AnylineBaseActivity {
|
|
|
71
71
|
private Boolean isFirstCameraOpen; // only if camera is opened the first time get coordinates of the cutout to avoid flickering when switching between analog and digital
|
|
72
72
|
private RelativeLayout parentLayout;
|
|
73
73
|
private boolean defaultOrientationApplied;
|
|
74
|
-
private static final String KEY_DEFAULT_ORIENTATION_APPLIED = "default_orientation_applied";
|
|
75
74
|
|
|
76
75
|
@Override
|
|
77
76
|
protected void onCreate(Bundle savedInstanceState) {
|
|
@@ -241,8 +240,8 @@ public class Anyline4Activity extends AnylineBaseActivity {
|
|
|
241
240
|
} else if (subResult instanceof BarcodeScanResult) {
|
|
242
241
|
try {
|
|
243
242
|
jsonResult.put(
|
|
244
|
-
|
|
245
|
-
|
|
243
|
+
subResult.getPluginId(),
|
|
244
|
+
extractBarcodeResult(jsonResult, subResult)
|
|
246
245
|
);
|
|
247
246
|
} catch (Exception e) {
|
|
248
247
|
Log.e(TAG, "EXCEPTION", e);
|
|
@@ -264,23 +263,19 @@ public class Anyline4Activity extends AnylineBaseActivity {
|
|
|
264
263
|
}
|
|
265
264
|
});
|
|
266
265
|
} else if (scanViewPlugin instanceof LicensePlateScanViewPlugin) {
|
|
267
|
-
scanViewPlugin.addScanResultListener(
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
} catch (JSONException e) {
|
|
278
|
-
e.printStackTrace();
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
setResult(scanViewPlugin, jsonResult);
|
|
266
|
+
scanViewPlugin.addScanResultListener((ScanResultListener<LicensePlateScanResult>) licensePlateResult -> {
|
|
267
|
+
JSONObject jsonResult = new JSONObject();
|
|
268
|
+
try {
|
|
269
|
+
jsonResult.put("country", licensePlateResult.getCountry());
|
|
270
|
+
jsonResult.put("licensePlate", licensePlateResult.getResult());
|
|
271
|
+
|
|
272
|
+
jsonResult = AnylinePluginHelper.jsonHelper(Anyline4Activity.this, licensePlateResult,
|
|
273
|
+
jsonResult);
|
|
274
|
+
} catch (JSONException e) {
|
|
275
|
+
e.printStackTrace();
|
|
282
276
|
}
|
|
283
277
|
|
|
278
|
+
setResult(scanViewPlugin, jsonResult);
|
|
284
279
|
});
|
|
285
280
|
} else if (scanViewPlugin instanceof IdScanViewPlugin) {
|
|
286
281
|
if (((IdScanPlugin) ((IdScanViewPlugin) scanViewPlugin).getScanPlugin()).getIdConfig() instanceof MrzConfig) {
|
|
@@ -290,90 +285,79 @@ public class Anyline4Activity extends AnylineBaseActivity {
|
|
|
290
285
|
cropAndTransformError = json.getString("cropAndTransformErrorMessage");
|
|
291
286
|
}
|
|
292
287
|
|
|
293
|
-
scanViewPlugin.addScanResultListener(
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
if (jsonResult.get("issuingCountryCode").equals("D")
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
} else {
|
|
303
|
-
jsonResult.remove("address");
|
|
304
|
-
}
|
|
305
|
-
|
|
288
|
+
scanViewPlugin.addScanResultListener((ScanResultListener<ScanResult<ID>>) idScanResult -> {
|
|
289
|
+
JSONObject jsonResult = ((MrzIdentification) idScanResult.getResult()).toJSONObject();
|
|
290
|
+
try {
|
|
291
|
+
if (jsonResult.get("issuingCountryCode").equals("D")
|
|
292
|
+
&& jsonResult.get("documentType").equals("ID")) {
|
|
293
|
+
if (jsonResult.get("issuingCountryCode").equals("D")) {
|
|
294
|
+
jsonResult.put("address", jsonResult.get("address"));
|
|
295
|
+
} else {
|
|
296
|
+
jsonResult.remove("address");
|
|
306
297
|
}
|
|
307
|
-
} catch (JSONException e) {
|
|
308
|
-
e.printStackTrace();
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
try {
|
|
312
|
-
jsonResult = AnylinePluginHelper.jsonHelper(Anyline4Activity.this, idScanResult,
|
|
313
|
-
jsonResult);
|
|
314
|
-
} catch (Exception e) {
|
|
315
|
-
Log.e(TAG, "Exception is: ", e);
|
|
316
298
|
|
|
317
299
|
}
|
|
300
|
+
} catch (JSONException e) {
|
|
301
|
+
e.printStackTrace();
|
|
302
|
+
}
|
|
318
303
|
|
|
319
|
-
|
|
304
|
+
try {
|
|
305
|
+
jsonResult = AnylinePluginHelper.jsonHelper(Anyline4Activity.this, idScanResult,
|
|
306
|
+
jsonResult);
|
|
307
|
+
} catch (Exception e) {
|
|
308
|
+
Log.e(TAG, "Exception is: ", e);
|
|
320
309
|
|
|
321
310
|
}
|
|
322
311
|
|
|
312
|
+
setResult(scanViewPlugin, jsonResult);
|
|
313
|
+
|
|
323
314
|
});
|
|
324
315
|
} else if (((IdScanPlugin) ((IdScanViewPlugin) scanViewPlugin).getScanPlugin()).getIdConfig() instanceof UniversalIdConfig) {
|
|
325
|
-
scanViewPlugin.addScanResultListener(
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
Identification identification = (Identification) idScanResult.getResult();
|
|
329
|
-
HashMap<String, String> data = (HashMap<String, String>) identification.getResultData();
|
|
316
|
+
scanViewPlugin.addScanResultListener((ScanResultListener<ScanResult<ID>>) idScanResult -> {
|
|
317
|
+
Identification identification = (Identification) idScanResult.getResult();
|
|
318
|
+
HashMap<String, String> data = (HashMap<String, String>) identification.getResultData();
|
|
330
319
|
|
|
331
|
-
|
|
320
|
+
JSONObject jsonResult = new JSONObject(data);
|
|
332
321
|
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
322
|
+
try {
|
|
323
|
+
jsonResult = AnylinePluginHelper.jsonHelper(Anyline4Activity.this, idScanResult,
|
|
324
|
+
jsonResult);
|
|
325
|
+
} catch (Exception e) {
|
|
326
|
+
Log.e(TAG, "Exception is: ", e);
|
|
338
327
|
|
|
339
|
-
}
|
|
340
|
-
setResult(scanViewPlugin, jsonResult);
|
|
341
328
|
}
|
|
329
|
+
setResult(scanViewPlugin, jsonResult);
|
|
342
330
|
});
|
|
343
331
|
}
|
|
344
332
|
} else if (scanViewPlugin instanceof OcrScanViewPlugin) {
|
|
345
|
-
scanViewPlugin.addScanResultListener(
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
} catch (JSONException e) {
|
|
354
|
-
e.printStackTrace();
|
|
355
|
-
}
|
|
356
|
-
setResult(scanViewPlugin, jsonResult);
|
|
357
|
-
|
|
333
|
+
scanViewPlugin.addScanResultListener((ScanResultListener<OcrScanResult>) ocrScanResult -> {
|
|
334
|
+
JSONObject jsonResult = new JSONObject();
|
|
335
|
+
try {
|
|
336
|
+
jsonResult.put("text", ocrScanResult.getResult().trim());
|
|
337
|
+
jsonResult = AnylinePluginHelper.jsonHelper(Anyline4Activity.this, ocrScanResult,
|
|
338
|
+
jsonResult);
|
|
339
|
+
} catch (JSONException e) {
|
|
340
|
+
e.printStackTrace();
|
|
358
341
|
}
|
|
342
|
+
setResult(scanViewPlugin, jsonResult);
|
|
359
343
|
|
|
360
344
|
});
|
|
361
345
|
|
|
362
346
|
} else if (scanViewPlugin instanceof TireScanViewPlugin) {
|
|
363
|
-
scanViewPlugin.addScanResultListener(
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
e.printStackTrace();
|
|
347
|
+
scanViewPlugin.addScanResultListener((ScanResultListener<TireScanResult>) tireScanResult -> {
|
|
348
|
+
JSONObject jsonResult = new JSONObject();
|
|
349
|
+
try {
|
|
350
|
+
jsonResult.put("text", tireScanResult.getResult().trim());
|
|
351
|
+
jsonResult = AnylinePluginHelper.jsonHelper(Anyline4Activity.this, tireScanResult,
|
|
352
|
+
jsonResult);
|
|
353
|
+
if (tireScanResult instanceof TireSizeScanResult) {
|
|
354
|
+
String tireScanDetailedResult = ((TireSizeScanResult) tireScanResult).getResult().toJson();
|
|
355
|
+
jsonResult.put("tireScanDetailedResult", tireScanDetailedResult);
|
|
373
356
|
}
|
|
374
|
-
|
|
375
|
-
|
|
357
|
+
} catch (JSONException e) {
|
|
358
|
+
e.printStackTrace();
|
|
376
359
|
}
|
|
360
|
+
setResult(scanViewPlugin, jsonResult);
|
|
377
361
|
|
|
378
362
|
});
|
|
379
363
|
|
|
@@ -423,24 +407,21 @@ public class Anyline4Activity extends AnylineBaseActivity {
|
|
|
423
407
|
addSegmentRadioButtonUI(json);
|
|
424
408
|
|
|
425
409
|
anylineScanView.setCameraOpenListener(this);
|
|
426
|
-
scanViewPlugin.addScanResultListener(
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
} catch (Exception e) {
|
|
439
|
-
Log.e(TAG, "EXCEPTION", e);
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
setResult(scanViewPlugin, jsonResult);
|
|
410
|
+
scanViewPlugin.addScanResultListener((ScanResultListener<MeterScanResult>) meterScanResult -> {
|
|
411
|
+
JSONObject jsonResult = new JSONObject();
|
|
412
|
+
try {
|
|
413
|
+
jsonResult = AnylinePluginHelper.setMeterScanMode(meterScanResult.getScanMode(),
|
|
414
|
+
jsonResult);
|
|
415
|
+
jsonResult.put("reading", meterScanResult.getResult());
|
|
416
|
+
|
|
417
|
+
jsonResult = AnylinePluginHelper.jsonHelper(Anyline4Activity.this, meterScanResult,
|
|
418
|
+
jsonResult);
|
|
419
|
+
|
|
420
|
+
} catch (Exception e) {
|
|
421
|
+
Log.e(TAG, "EXCEPTION", e);
|
|
443
422
|
}
|
|
423
|
+
|
|
424
|
+
setResult(scanViewPlugin, jsonResult);
|
|
444
425
|
});
|
|
445
426
|
}
|
|
446
427
|
|
|
@@ -144,6 +144,10 @@ public class AnylinePluginHelper {
|
|
|
144
144
|
scanResult.getCutoutImage().save(imageFile, 90);
|
|
145
145
|
jsonObject.put("imagePath", imageFile.getAbsolutePath());
|
|
146
146
|
|
|
147
|
+
if (scanResult.getBlobKey() != null) {
|
|
148
|
+
jsonObject.put("blobKey", scanResult.getBlobKey());
|
|
149
|
+
}
|
|
150
|
+
|
|
147
151
|
File imageFileFull = TempFileUtil.createTempFileCheckCache(activity, UUID.randomUUID().toString(), ".jpg");
|
|
148
152
|
scanResult.getFullImage().save(imageFileFull, 90);
|
|
149
153
|
jsonObject.put("fullImagePath", imageFileFull.getAbsolutePath());
|
|
@@ -185,6 +189,10 @@ public class AnylinePluginHelper {
|
|
|
185
189
|
return json;
|
|
186
190
|
}
|
|
187
191
|
|
|
192
|
+
private static List<Barcode> getNativeBarcodeList() {
|
|
193
|
+
return finalBarcodeList;
|
|
194
|
+
}
|
|
195
|
+
|
|
188
196
|
private static void setNativeBarcodeList(List<Barcode> barcodes) {
|
|
189
197
|
final List<Barcode> barcodeList = new ArrayList<>();
|
|
190
198
|
final List<String> barcodesDisplayedVal = new ArrayList<>();
|
|
@@ -208,10 +216,6 @@ public class AnylinePluginHelper {
|
|
|
208
216
|
|
|
209
217
|
}
|
|
210
218
|
|
|
211
|
-
private static List<Barcode> getNativeBarcodeList() {
|
|
212
|
-
return finalBarcodeList;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
219
|
private static String findValidFormatForReference(int format) {
|
|
216
220
|
if (format == Barcode.FORMAT_AZTEC) {
|
|
217
221
|
return BarcodeFormat.AZTEC.toString();
|
|
@@ -21,9 +21,11 @@ import org.json.JSONObject;
|
|
|
21
21
|
|
|
22
22
|
import at.nineyards.anyline.core.LicenseException;
|
|
23
23
|
import io.anyline.AnylineSDK;
|
|
24
|
+
import io.anyline.plugin.ScanResult;
|
|
24
25
|
import io.anyline.products.AnylineUpdater;
|
|
25
26
|
import io.anyline.products.IAnylineUpdateDelegate;
|
|
26
27
|
import io.anyline.trainer.AssetContext;
|
|
28
|
+
import io.anyline.trainer.TrainerUtils;
|
|
27
29
|
|
|
28
30
|
class AnylineSDKPlugin extends ReactContextBaseJavaModule implements ResultReporter.OnResultListener {
|
|
29
31
|
|
|
@@ -38,9 +40,6 @@ class AnylineSDKPlugin extends ReactContextBaseJavaModule implements ResultRepor
|
|
|
38
40
|
public static final int RESULT_CANCELED = 0;
|
|
39
41
|
public static final int RESULT_OK = 1;
|
|
40
42
|
public static final int RESULT_ERROR = 2;
|
|
41
|
-
|
|
42
|
-
private static final String E_ERROR = "E_ERROR";
|
|
43
|
-
|
|
44
43
|
public static final int DIGITAL_METER = 3;
|
|
45
44
|
public static final int ANALOG_METER = 4;
|
|
46
45
|
public static final int AUTO_ANALOG_DIGITAL_METER = 5;
|
|
@@ -53,7 +52,7 @@ class AnylineSDKPlugin extends ReactContextBaseJavaModule implements ResultRepor
|
|
|
53
52
|
public static final int SERIAL_NUMBER = 12;
|
|
54
53
|
public static final int DOT_MATRIX_METER = 13;
|
|
55
54
|
public static final int REQUEST_ANYLINE_4 = 14;
|
|
56
|
-
|
|
55
|
+
private static final String E_ERROR = "E_ERROR";
|
|
57
56
|
private JSONObject configObject;
|
|
58
57
|
private ReactApplicationContext reactContext;
|
|
59
58
|
private String license;
|
|
@@ -152,6 +151,23 @@ class AnylineSDKPlugin extends ReactContextBaseJavaModule implements ResultRepor
|
|
|
152
151
|
routeScanMode(scanMode);
|
|
153
152
|
}
|
|
154
153
|
|
|
154
|
+
@ReactMethod
|
|
155
|
+
public void reportCorrectedResult(String blobKey, String correctedResult, Callback onResponseCallback) {
|
|
156
|
+
ScanResult.reportCorrectedResult(
|
|
157
|
+
this.reactContext,
|
|
158
|
+
blobKey,
|
|
159
|
+
correctedResult,
|
|
160
|
+
"",
|
|
161
|
+
new TrainerUtils.ReportCorrectedResultHandler() {
|
|
162
|
+
|
|
163
|
+
@Override
|
|
164
|
+
public void onReportCorrectedResult(String s) {
|
|
165
|
+
onResponseCallback.invoke(s);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
|
|
155
171
|
@ReactMethod
|
|
156
172
|
public void setupPromise(String config, String scanMode, final Promise promise) {
|
|
157
173
|
this.promise = promise;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"_from": "anyline-ocr-react-native-module@^42.
|
|
3
|
-
"_id": "anyline-ocr-react-native-module@^42.
|
|
2
|
+
"_from": "anyline-ocr-react-native-module@^42.2.0",
|
|
3
|
+
"_id": "anyline-ocr-react-native-module@^42.2.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@^42.
|
|
11
|
+
"raw": "anyline-ocr-react-native-module@^42.2.0",
|
|
12
12
|
"name": "anyline-ocr-react-native-module",
|
|
13
13
|
"escapedName": "anyline-ocr-react-native-module",
|
|
14
|
-
"rawSpec": "^42.
|
|
14
|
+
"rawSpec": "^42.2.0",
|
|
15
15
|
"saveSpec": null,
|
|
16
|
-
"fetchSpec": "^42.
|
|
16
|
+
"fetchSpec": "^42.2.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-42.
|
|
21
|
+
"_resolved": "https://registry.npmjs.org/anyline-ocr-react-native-module/-/anyline-ocr-react-native-module-42.2.0.tgz",
|
|
22
22
|
"_shasum": "bacbcd260cc662244f59393ed81a6edba009b52c",
|
|
23
|
-
"_spec": "anyline-ocr-react-native-module@^42.
|
|
23
|
+
"_spec": "anyline-ocr-react-native-module@^42.2.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": "42.
|
|
50
|
+
"version": "42.2.0"
|
|
51
51
|
}
|