Skip to content

Commit 250aacb

Browse files
Release 52.0.2
1 parent 8c9ccc1 commit 250aacb

File tree

4 files changed

+41
-10
lines changed

4 files changed

+41
-10
lines changed

example/RNExampleApp/android/app/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ android {
8787
minSdkVersion rootProject.ext.minSdkVersion
8888
targetSdkVersion rootProject.ext.targetSdkVersion
8989
versionCode 5
90-
versionName "52.0.1"
90+
versionName "52.0.2"
9191
multiDexEnabled true
9292

9393
buildConfigField("boolean", "REACT_NATIVE_UNSTABLE_USE_RUNTIME_SCHEDULER_ALWAYS", (findProperty("reactNative.unstable_useRuntimeSchedulerAlways") ?: true).toString())

example/RNExampleApp/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-example-app",
3-
"version": "52.0.1",
3+
"version": "52.0.2",
44
"private": true,
55
"scripts": {
66
"initProject": "yarn add expo && yarn add ../../plugin",

plugin/android/src/main/java/com/anyline/reactnative/AnylineSDKPlugin.java

+31
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import org.json.JSONException;
1818
import org.json.JSONObject;
1919

20+
import java.io.File;
2021
import java.io.IOException;
2122
import java.util.HashMap;
2223

@@ -224,12 +225,42 @@ public void exportCachedEvents(final Promise promise) {
224225
}
225226
}
226227

228+
/**
229+
* This function removes all previous scan result images from disk, either from external
230+
* or external files dir, e.g.:
231+
* /sdcard/Android/[applicationId]/files/results/image1729849635965
232+
*/
233+
private void deleteAllPreviousScanResultImages() {
234+
String imagePath = "";
235+
if (reactContext.getExternalFilesDir(null) != null) {
236+
imagePath = reactContext
237+
.getExternalFilesDir(null)
238+
.toString() + "/results/";
239+
240+
} else if (reactContext.getFilesDir() != null) {
241+
imagePath = reactContext
242+
.getFilesDir()
243+
.toString() + "/results/";
244+
}
245+
246+
File resultFolder = new File(imagePath);
247+
File[] files = resultFolder.listFiles();
248+
if (files != null) {
249+
for (int fileIndex = 0; fileIndex < files.length; fileIndex++) {
250+
if (files[fileIndex].getName().startsWith("image")) {
251+
files[fileIndex].delete();
252+
}
253+
}
254+
}
255+
}
256+
227257
@ReactMethod
228258
public void setupPromise(String config, String scanMode, final Promise promise) {
229259
this.promise = promise;
230260
this.returnMethod = "promise";
231261
this.config = config;
232262

263+
deleteAllPreviousScanResultImages();
233264
routeScanMode(scanMode);
234265
}
235266

plugin/package.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
{
2-
"_from": "anyline-ocr-react-native-module@^52.0.1",
3-
"_id": "anyline-ocr-react-native-module@^52.0.1",
2+
"_from": "anyline-ocr-react-native-module@^52.0.2",
3+
"_id": "anyline-ocr-react-native-module@^52.0.2",
44
"_inBundle": false,
55
"_integrity": "sha512-BGi9zNkSsoxXywDBIqzgBRvKUBniQOJHDKBrozZubKthZNRBAj8Ry5tW0Me0yLXt/fauME//hbC0wsenfPJZqw==",
66
"_location": "/anyline-ocr-react-native-module",
77
"_phantomChildren": {},
88
"_requested": {
99
"type": "range",
1010
"registry": true,
11-
"raw": "anyline-ocr-react-native-module@^52.0.1",
11+
"raw": "anyline-ocr-react-native-module@^52.0.2",
1212
"name": "anyline-ocr-react-native-module",
1313
"escapedName": "anyline-ocr-react-native-module",
14-
"rawSpec": "^52.0.1",
14+
"rawSpec": "^52.0.2",
1515
"saveSpec": null,
16-
"fetchSpec": "^52.0.1"
16+
"fetchSpec": "^52.0.2"
1717
},
1818
"_requiredBy": [
1919
"/"
2020
],
21-
"_resolved": "https://registry.npmjs.org/anyline-ocr-react-native-module/-/anyline-ocr-react-native-module-52.0.1.tgz",
21+
"_resolved": "https://registry.npmjs.org/anyline-ocr-react-native-module/-/anyline-ocr-react-native-module-52.0.2.tgz",
2222
"_shasum": "bacbcd260cc662244f59393ed81a6edba009b52c",
23-
"_spec": "anyline-ocr-react-native-module@^52.0.1",
23+
"_spec": "anyline-ocr-react-native-module@^52.0.2",
2424
"_where": "/Users/amiransari/Projects/anyline-ocr-react-native-module1/example/RNExampleApp",
2525
"bugs": {
2626
"url": "https://github.com/Anyline/anyline-ocr-react-native-module/issues"
@@ -47,5 +47,5 @@
4747
"type": "git",
4848
"url": "git+https://github.com/Anyline/anyline-ocr-react-native-module.git"
4949
},
50-
"version": "52.0.1"
50+
"version": "52.0.2"
5151
}

0 commit comments

Comments
 (0)