accurascan_kyc 0.1.0 → 0.61.5
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/README.md +67 -91
- package/accurascan-kyc.podspec +1 -1
- package/android/build.gradle +5 -6
- package/android/src/main/AndroidManifest.xml +0 -1
- package/android/src/main/java/com/accurascankyc/AccuraCardBorderView.java +100 -0
- package/android/src/main/java/com/accurascankyc/AccurascanKycModule.java +99 -4
- package/android/src/main/java/com/accurascankyc/ActivityFaceMatch.java +15 -2
- package/android/src/main/java/com/accurascankyc/OcrActivity.java +66 -31
- package/android/src/main/java/com/accurascankyc/OcrResultActivity.java +41 -7
- package/android/src/main/res/layout/custom_frame_layout.xml +2 -3
- package/android/src/main/res/layout-land/custom_frame_layout.xml +2 -3
- package/ios/AccurascanKyc.swift +125 -25
- package/ios/FMController.swift +14 -7
- package/ios/LVController.swift +43 -14
- package/ios/MainStoryboard_iPhone.storyboard +48 -0
- package/ios/ViewController.swift +142 -52
- package/ios/resources/accuraScanLogo.png +0 -0
- package/ios/resources/icn_close.png +0 -0
- package/package.json +6 -6
- package/ios/AccurascanKyc.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -4
package/README.md
CHANGED
|
@@ -11,21 +11,17 @@ Below steps to setup Accura Scan's SDK to your project.
|
|
|
11
11
|
## Note:-
|
|
12
12
|
|
|
13
13
|
`yarn add 'accurascan_kyc'`
|
|
14
|
+
|
|
15
|
+
OR
|
|
16
|
+
|
|
17
|
+
`npm i accurascan_kyc`
|
|
18
|
+
|
|
14
19
|
**Usage**
|
|
15
|
-
Import
|
|
20
|
+
Import npm library into file.
|
|
16
21
|
`import AccurascanKyc from 'accurascan_kyc';`
|
|
17
22
|
|
|
18
23
|
## 1.Setup Android
|
|
19
24
|
|
|
20
|
-
**Add this permissions into Android’s AndroidManifest.xml file.**
|
|
21
|
-
|
|
22
|
-
```
|
|
23
|
-
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
|
24
|
-
<uses-permission android:name="android.permission.CAMERA" />
|
|
25
|
-
<uses-feature android:name="android.hardware.camera" />
|
|
26
|
-
<uses-feature android:name="android.hardware.camera.autofocus" />
|
|
27
|
-
```
|
|
28
|
-
|
|
29
25
|
**Add it in your root build.gradle at the end of repositories.**
|
|
30
26
|
|
|
31
27
|
```
|
|
@@ -58,13 +54,49 @@ packagingOptions {
|
|
|
58
54
|
pickFirst 'lib/x86_64/libssl.so'
|
|
59
55
|
|
|
60
56
|
}
|
|
57
|
+
splits {
|
|
58
|
+
abi {
|
|
59
|
+
enable true
|
|
60
|
+
reset()
|
|
61
|
+
include 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
|
62
|
+
universalApk true
|
|
63
|
+
}
|
|
64
|
+
}
|
|
61
65
|
```
|
|
62
66
|
|
|
63
67
|
## 2.Setup iOS
|
|
64
68
|
|
|
65
69
|
1.Install Git LFS using command install `git-lfs`
|
|
66
70
|
|
|
67
|
-
2.
|
|
71
|
+
2.Add the following in your podfile
|
|
72
|
+
`use_frameworks!` below `prepare_react_native_project!`
|
|
73
|
+
|
|
74
|
+
and if your xcode version is less than 14, add the following code
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
installer.pods_project.targets.each do |target|
|
|
78
|
+
target.build_configurations.each do |config|
|
|
79
|
+
# Bitcode is deprecated by Apple
|
|
80
|
+
config.build_settings['ENABLE_BITCODE'] = 'NO'
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
below
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
post_install do |installer|
|
|
89
|
+
react_native_post_install(
|
|
90
|
+
installer,
|
|
91
|
+
# Set `mac_catalyst_enabled` to `true` in order to apply patches
|
|
92
|
+
# necessary for Mac Catalyst builds
|
|
93
|
+
:mac_catalyst_enabled => false
|
|
94
|
+
)
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
take reference from [here](https://github.com/Anaslokhandwala/Accurascan_KYC/blob/master/ios/Podfile)
|
|
98
|
+
|
|
99
|
+
3.Run `pod install`
|
|
68
100
|
|
|
69
101
|
**Add this permissions into iOS Info.plist file.**
|
|
70
102
|
|
|
@@ -79,7 +111,8 @@ packagingOptions {
|
|
|
79
111
|
|
|
80
112
|
## 3.Setup Accura Scan licenses into your projects
|
|
81
113
|
|
|
82
|
-
Accura Scan has two license require for use full functionality of this library. Generate your own Accura license from here
|
|
114
|
+
Accura Scan has two license require for use full functionality of this library. Generate your own Accura license from [here](https://accurascan.com/developer/dashboard) using your bundle id.
|
|
115
|
+
|
|
83
116
|
**key.license**
|
|
84
117
|
|
|
85
118
|
This license is compulsory for this library to work. it will get all setup of accura SDK.
|
|
@@ -123,21 +156,13 @@ Place both the license in your project's Runner directory, and add the licenses
|
|
|
123
156
|
**Error:** String
|
|
124
157
|
|
|
125
158
|
**Success:** JSON String Response = {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
**isOCREnable:** boolean,
|
|
134
|
-
|
|
135
|
-
**isBarcodeEnable:** boolean,
|
|
136
|
-
|
|
137
|
-
**isBankCardEnable:** boolean,
|
|
138
|
-
|
|
139
|
-
**isMRZEnable:** boolean
|
|
140
|
-
|
|
159
|
+
countries: Array[<CountryModels>],
|
|
160
|
+
barcodes: Array[],
|
|
161
|
+
isValid: boolean,
|
|
162
|
+
isOCREnable: boolean,
|
|
163
|
+
isBarcodeEnable: boolean,
|
|
164
|
+
isBankCardEnable: boolean,
|
|
165
|
+
isMRZEnable: boolean
|
|
141
166
|
}
|
|
142
167
|
|
|
143
168
|
### Setting up Configuration's,Error mssages and Scaning title messages
|
|
@@ -243,19 +268,12 @@ onPressMRZ = () => {
|
|
|
243
268
|
#### value: other_mrz or passport_mrz or id_mrz or visa_mrz<br></br>
|
|
244
269
|
|
|
245
270
|
**Success:** JSON Response {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
**face:** URI?
|
|
254
|
-
|
|
255
|
-
**front_img:** URI?
|
|
256
|
-
|
|
257
|
-
**back_img:** URI?
|
|
258
|
-
|
|
271
|
+
front_data: JSONObjects?,
|
|
272
|
+
back_data: JSONObjects?,
|
|
273
|
+
type: Recognition Type,
|
|
274
|
+
face: URI?
|
|
275
|
+
front_img: URI?
|
|
276
|
+
back_img: URI?
|
|
259
277
|
}
|
|
260
278
|
|
|
261
279
|
**Error:** String
|
|
@@ -277,10 +295,10 @@ onPressOCR = () => {
|
|
|
277
295
|
|
|
278
296
|
if (isValid) {
|
|
279
297
|
let passArgs = [
|
|
280
|
-
this.countrySelected.id,
|
|
281
|
-
this.cardSelected.id,
|
|
282
|
-
this.cardSelected.name,
|
|
283
|
-
this.cardSelected.type,
|
|
298
|
+
this.countrySelected.id, //integer
|
|
299
|
+
this.cardSelected.id, //integer
|
|
300
|
+
this.cardSelected.name, //String
|
|
301
|
+
this.cardSelected.type, //integer
|
|
284
302
|
]; //[{"enableLogs":false},1,41,"Emirates National ID",0,"portrait-primary"]
|
|
285
303
|
//Method for start OCR scaning from native OS.
|
|
286
304
|
AccurascanKyc.startOcrWithCard(passArgs, (error, response) => {
|
|
@@ -294,25 +312,7 @@ onPressOCR = () => {
|
|
|
294
312
|
};
|
|
295
313
|
```
|
|
296
314
|
|
|
297
|
-
**
|
|
298
|
-
|
|
299
|
-
**value:** Id of selected country.
|
|
300
|
-
|
|
301
|
-
**CardId:** integer
|
|
302
|
-
|
|
303
|
-
**value:** Id of selected card.
|
|
304
|
-
|
|
305
|
-
**CardName:** String
|
|
306
|
-
|
|
307
|
-
**value:** Name of selected card.
|
|
308
|
-
|
|
309
|
-
**CardType:** integer
|
|
310
|
-
|
|
311
|
-
**value:** Type of selected card.
|
|
312
|
-
|
|
313
|
-
**Success:** JSON Response {
|
|
314
|
-
}
|
|
315
|
-
|
|
315
|
+
**Success:** JSON Response
|
|
316
316
|
**Error:** String
|
|
317
317
|
|
|
318
318
|
## 7.Method for scan barcode.
|
|
@@ -339,13 +339,7 @@ onPressBarcode = () => {
|
|
|
339
339
|
};
|
|
340
340
|
```
|
|
341
341
|
|
|
342
|
-
**
|
|
343
|
-
|
|
344
|
-
**value:** Type of barcode documents.
|
|
345
|
-
|
|
346
|
-
**Success:** JSON Response {
|
|
347
|
-
}
|
|
348
|
-
|
|
342
|
+
**Success:** JSON Response
|
|
349
343
|
**Error:** String
|
|
350
344
|
|
|
351
345
|
## 8.Method for scan bankcard.
|
|
@@ -362,9 +356,7 @@ onPressBankcard = () => {
|
|
|
362
356
|
};
|
|
363
357
|
```
|
|
364
358
|
|
|
365
|
-
**Success:** JSON Response
|
|
366
|
-
}
|
|
367
|
-
|
|
359
|
+
**Success:** JSON Response
|
|
368
360
|
**Error:** String
|
|
369
361
|
|
|
370
362
|
## 8.Method for get face match percentages between two face.
|
|
@@ -409,10 +401,6 @@ onPressFaceMatch = () => {
|
|
|
409
401
|
};
|
|
410
402
|
```
|
|
411
403
|
|
|
412
|
-
**accuraConfs:** JSON Object
|
|
413
|
-
|
|
414
|
-
**face_uri:** URI
|
|
415
|
-
|
|
416
404
|
**Success:** JSON Response {
|
|
417
405
|
detect: URI?
|
|
418
406
|
score: Float
|
|
@@ -467,18 +455,10 @@ onPressStartLiveness = () => {
|
|
|
467
455
|
};
|
|
468
456
|
```
|
|
469
457
|
|
|
470
|
-
**accuraConfs:** JSON Object
|
|
471
|
-
|
|
472
|
-
**face_uri:** 'uri of face'
|
|
473
|
-
|
|
474
458
|
**Success:** JSON Response {
|
|
475
|
-
|
|
476
459
|
detect: URI?,
|
|
477
|
-
|
|
478
460
|
Face_score: Float,
|
|
479
|
-
|
|
480
461
|
score: Float,
|
|
481
|
-
|
|
482
462
|
}
|
|
483
463
|
|
|
484
464
|
**Error:** String
|
|
@@ -614,16 +594,12 @@ _For Facematch 2_
|
|
|
614
594
|
```
|
|
615
595
|
|
|
616
596
|
**accuraConfs:** JSON Object
|
|
617
|
-
|
|
618
597
|
**Face1:** 'uri of face1'
|
|
619
|
-
|
|
620
598
|
**Face2:** ’uri of face2’
|
|
621
599
|
|
|
622
600
|
**Success:** JSON Response {
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
**score:** String,
|
|
601
|
+
Image: URI?,
|
|
602
|
+
score: String,
|
|
627
603
|
}
|
|
628
604
|
|
|
629
605
|
**Error:** String
|
package/accurascan-kyc.podspec
CHANGED
|
@@ -20,7 +20,7 @@ Pod::Spec.new do |s|
|
|
|
20
20
|
|
|
21
21
|
s.dependency "React-Core"
|
|
22
22
|
s.static_framework = true
|
|
23
|
-
s.dependency "AccuraKYC_Sim","3.2.
|
|
23
|
+
s.dependency "AccuraKYC_Sim","3.2.6"
|
|
24
24
|
# Don't install the dependencies when we run `pod install` in the old architecture.
|
|
25
25
|
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
|
|
26
26
|
s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
|
package/android/build.gradle
CHANGED
|
@@ -78,8 +78,8 @@ android {
|
|
|
78
78
|
abi {
|
|
79
79
|
reset()
|
|
80
80
|
universalApk false // If true, also generate a universal APK
|
|
81
|
-
|
|
82
|
-
include "armeabi-v7a", "x86"
|
|
81
|
+
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
|
|
82
|
+
// include "armeabi-v7a", "x86"
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
|
|
@@ -96,17 +96,16 @@ dependencies {
|
|
|
96
96
|
// For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
|
|
97
97
|
//noinspection GradleDynamicVersion
|
|
98
98
|
implementation "com.facebook.react:react-native:+"
|
|
99
|
-
|
|
100
99
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
101
|
-
|
|
102
100
|
implementation 'androidx.appcompat:appcompat:1.6.0'
|
|
103
101
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
|
104
102
|
// For Accura OCR SDK
|
|
105
|
-
implementation 'com.github.accurascan:AccuraOCR:5.1.
|
|
103
|
+
implementation 'com.github.accurascan:AccuraOCR:5.1.5'
|
|
106
104
|
// For Accura Face match
|
|
107
105
|
implementation 'com.github.accurascan:AccuraFaceMatch:3.2.0'
|
|
108
106
|
// for liveness
|
|
109
|
-
implementation 'com.github.accurascan:Liveness-Android:3.
|
|
107
|
+
implementation 'com.github.accurascan:Liveness-Android:3.3.0'
|
|
108
|
+
implementation 'com.squareup.picasso:picasso:2.71828'
|
|
110
109
|
}
|
|
111
110
|
|
|
112
111
|
if (isNewArchitectureEnabled()) {
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
package com.accurascankyc;
|
|
2
|
+
|
|
3
|
+
import android.content.Context;
|
|
4
|
+
import android.graphics.Canvas;
|
|
5
|
+
import android.graphics.Paint;
|
|
6
|
+
import android.graphics.Path;
|
|
7
|
+
import android.util.AttributeSet;
|
|
8
|
+
import android.widget.RelativeLayout;
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.NonNull;
|
|
11
|
+
import androidx.annotation.Nullable;
|
|
12
|
+
|
|
13
|
+
public class AccuraCardBorderView extends RelativeLayout {
|
|
14
|
+
|
|
15
|
+
private Paint mBorderPaint;
|
|
16
|
+
private boolean cornerBox = false;
|
|
17
|
+
private int mCornerWidth = 150;
|
|
18
|
+
private int mBorderColor = 0xFFCC0000;
|
|
19
|
+
private int mBorderWidth = 10;
|
|
20
|
+
|
|
21
|
+
public AccuraCardBorderView(@NonNull Context context) {
|
|
22
|
+
super(context);
|
|
23
|
+
init();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
public AccuraCardBorderView(@NonNull Context context, @Nullable AttributeSet attrs) {
|
|
27
|
+
super(context, attrs);
|
|
28
|
+
init();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
public AccuraCardBorderView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
|
32
|
+
super(context, attrs, defStyleAttr);
|
|
33
|
+
init();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
private void init() {
|
|
37
|
+
mBorderPaint = new Paint(Paint.DITHER_FLAG);
|
|
38
|
+
mBorderPaint.setStyle(Paint.Style.STROKE);
|
|
39
|
+
mBorderPaint.setStrokeWidth(mBorderWidth);
|
|
40
|
+
mBorderPaint.setColor(mBorderColor);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
public void setCornerBox(boolean cornerBox) {
|
|
44
|
+
this.cornerBox = cornerBox;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
public void setCornerWidth(int mCornerWidth) {
|
|
48
|
+
this.mCornerWidth = mCornerWidth;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
public void setBorderColor(int mBorderColor) {
|
|
52
|
+
this.mBorderColor = mBorderColor;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
public void setBorderWidth(int mBorderWidth) {
|
|
56
|
+
this.mBorderWidth = mBorderWidth;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@Override
|
|
60
|
+
protected void dispatchDraw(Canvas canvas) {
|
|
61
|
+
int count = canvas.save();
|
|
62
|
+
mBorderPaint.setStrokeWidth(mBorderWidth);
|
|
63
|
+
mBorderPaint.setColor(mBorderColor);
|
|
64
|
+
if (cornerBox) {
|
|
65
|
+
canvas.drawPath(createCornersPath(0, 0, getWidth(), getHeight(), mCornerWidth), mBorderPaint);
|
|
66
|
+
} else {
|
|
67
|
+
canvas.drawPath(createRectanglePath(0, 0, getWidth(), getHeight()), mBorderPaint);
|
|
68
|
+
}
|
|
69
|
+
super.dispatchDraw(canvas);
|
|
70
|
+
canvas.restoreToCount(count);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
private Path createCornersPath(int left, int top, int right, int bottom, int cornerWidth){
|
|
74
|
+
Path path = new Path();
|
|
75
|
+
|
|
76
|
+
path.moveTo(left, top + cornerWidth);
|
|
77
|
+
path.lineTo(left, top);
|
|
78
|
+
path.lineTo(left + cornerWidth, top);
|
|
79
|
+
|
|
80
|
+
path.moveTo(right - cornerWidth, top);
|
|
81
|
+
path.lineTo(right, top);
|
|
82
|
+
path.lineTo(right , top + cornerWidth);
|
|
83
|
+
|
|
84
|
+
path.moveTo(left, bottom - cornerWidth);
|
|
85
|
+
path.lineTo(left, bottom);
|
|
86
|
+
path.lineTo(left + cornerWidth, bottom);
|
|
87
|
+
|
|
88
|
+
path.moveTo(right - cornerWidth, bottom);
|
|
89
|
+
path.lineTo(right, bottom);
|
|
90
|
+
path.lineTo(right, bottom - cornerWidth);
|
|
91
|
+
|
|
92
|
+
return path;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
private Path createRectanglePath(int left, int top, int right, int bottom){
|
|
96
|
+
Path path = new Path();
|
|
97
|
+
path.addRect(left, top, right, bottom, Path.Direction.CW);
|
|
98
|
+
return path;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -3,6 +3,7 @@ package com.accurascankyc;
|
|
|
3
3
|
import androidx.annotation.NonNull;
|
|
4
4
|
import androidx.core.app.ActivityCompat;
|
|
5
5
|
|
|
6
|
+
|
|
6
7
|
import android.os.Build;
|
|
7
8
|
import android.content.Context;
|
|
8
9
|
import com.accurascan.ocr.mrz.model.BarcodeFormat;
|
|
@@ -19,6 +20,8 @@ import com.facebook.react.bridge.ReactMethod;
|
|
|
19
20
|
import com.facebook.react.bridge.ReadableArray;
|
|
20
21
|
import com.facebook.react.module.annotations.ReactModule;
|
|
21
22
|
import com.facebook.react.bridge.Callback;
|
|
23
|
+
import org.json.JSONException;
|
|
24
|
+
import org.json.JSONObject;
|
|
22
25
|
|
|
23
26
|
import android.Manifest;
|
|
24
27
|
import android.content.ContentResolver;
|
|
@@ -40,6 +43,7 @@ import java.io.IOException;
|
|
|
40
43
|
import java.io.InputStream;
|
|
41
44
|
import java.io.OutputStream;
|
|
42
45
|
import java.util.HashMap;
|
|
46
|
+
import java.util.Iterator;
|
|
43
47
|
import java.util.List;
|
|
44
48
|
import java.util.Map;
|
|
45
49
|
import java.util.Objects;
|
|
@@ -55,6 +59,10 @@ public class AccurascanKycModule extends ReactContextBaseJavaModule {
|
|
|
55
59
|
public static JSONObject accuraErrorConfg = new JSONObject();
|
|
56
60
|
public static JSONObject accuraTitleMsg = new JSONObject();
|
|
57
61
|
public static JSONObject accuraConfigs = new JSONObject();
|
|
62
|
+
public static JSONObject actualAccuraConfigs = new JSONObject();
|
|
63
|
+
public static JSONObject actualAccuraTitleMsg = new JSONObject();
|
|
64
|
+
public static JSONObject actualAccuraErrorConfg = new JSONObject();
|
|
65
|
+
|
|
58
66
|
private String bType;
|
|
59
67
|
|
|
60
68
|
public AccurascanKycModule(ReactApplicationContext reactContext) {
|
|
@@ -184,12 +192,99 @@ public class AccurascanKycModule extends ReactContextBaseJavaModule {
|
|
|
184
192
|
@ReactMethod
|
|
185
193
|
public boolean setupAccuraConfig(ReadableArray argsNew, Callback result) throws JSONException {
|
|
186
194
|
|
|
195
|
+
//Configs
|
|
196
|
+
actualAccuraConfigs.put("setFaceBlurPercentage",80);
|
|
197
|
+
actualAccuraConfigs.put("setHologramDetection",true);
|
|
198
|
+
actualAccuraConfigs.put("setLowLightTolerance",10);
|
|
199
|
+
actualAccuraConfigs.put("setMotionThreshold",25);
|
|
200
|
+
actualAccuraConfigs.put("setMinGlarePercentage",6);
|
|
201
|
+
actualAccuraConfigs.put("setMaxGlarePercentage",99);
|
|
202
|
+
actualAccuraConfigs.put("setBlurPercentage",60);
|
|
203
|
+
actualAccuraConfigs.put("setCameraFacing",0);
|
|
204
|
+
|
|
205
|
+
//Title messages
|
|
206
|
+
actualAccuraTitleMsg.put("SCAN_TITLE_OCR_FRONT","Scan Front side of ");
|
|
207
|
+
actualAccuraTitleMsg.put("SCAN_TITLE_OCR_BACK","Scan Back side of ");
|
|
208
|
+
actualAccuraTitleMsg.put("SCAN_TITLE_OCR","Scan ");
|
|
209
|
+
actualAccuraTitleMsg.put("SCAN_TITLE_MRZ_PDF417_FRONT","Scan Front Side of Document");
|
|
210
|
+
actualAccuraTitleMsg.put("SCAN_TITLE_MRZ_PDF417_BACK","Scan Back Side of Document");
|
|
211
|
+
actualAccuraTitleMsg.put("SCAN_TITLE_DLPLATE","Scan Number plate");
|
|
212
|
+
actualAccuraTitleMsg.put("SCAN_TITLE_BARCODE","Scan Barcode");
|
|
213
|
+
actualAccuraTitleMsg.put("SCAN_TITLE_BANKCARD","Scan BankCard");
|
|
214
|
+
|
|
215
|
+
//Error messages, Camera Screen Confige
|
|
216
|
+
actualAccuraErrorConfg.put("Disable_Card_Name",false);
|
|
217
|
+
actualAccuraErrorConfg.put("flipImage","");
|
|
218
|
+
actualAccuraErrorConfg.put("setCameraFacing",0);
|
|
219
|
+
actualAccuraErrorConfg.put("enableLogs",1);
|
|
220
|
+
actualAccuraErrorConfg.put("isShowLogo",1);
|
|
221
|
+
actualAccuraErrorConfg.put("isFlipImg",1);
|
|
222
|
+
actualAccuraErrorConfg.put("CameraScreen_Frame_Color","#D5323F");
|
|
223
|
+
actualAccuraErrorConfg.put("CameraScreen_Text_Color","#FFFFFF");
|
|
224
|
+
actualAccuraErrorConfg.put("CameraScreen_Text_Border_Color","#000000");
|
|
225
|
+
actualAccuraErrorConfg.put("CameraScreen_Color","#80000000");
|
|
226
|
+
actualAccuraErrorConfg.put("CameraScreen_Border_Width",10);
|
|
227
|
+
actualAccuraErrorConfg.put("CameraScreen_CornerBorder_Enable",false);
|
|
228
|
+
actualAccuraErrorConfg.put("CameraScreen_Back_Button",1);
|
|
229
|
+
actualAccuraErrorConfg.put("CameraScreen_Change_Button",1);
|
|
230
|
+
actualAccuraErrorConfg.put("ACCURA_ERROR_CODE_MOTION","Keep Document Steady");
|
|
231
|
+
actualAccuraErrorConfg.put("ACCURA_ERROR_CODE_DOCUMENT_IN_FRAME","Keep document in frame");
|
|
232
|
+
actualAccuraErrorConfg.put("ACCURA_ERROR_CODE_BRING_DOCUMENT_IN_FRAME","Bring card near to frame");
|
|
233
|
+
actualAccuraErrorConfg.put("ACCURA_ERROR_CODE_PROCESSING","Processing...");
|
|
234
|
+
actualAccuraErrorConfg.put("ACCURA_ERROR_CODE_BLUR_DOCUMENT","Blur detect in document");
|
|
235
|
+
actualAccuraErrorConfg.put("ACCURA_ERROR_CODE_FACE_BLUR","Blur detected over face");
|
|
236
|
+
actualAccuraErrorConfg.put("ACCURA_ERROR_CODE_GLARE_DOCUMENT","Glare detect in document");
|
|
237
|
+
actualAccuraErrorConfg.put("ACCURA_ERROR_CODE_HOLOGRAM","Hologram Detected");
|
|
238
|
+
actualAccuraErrorConfg.put("ACCURA_ERROR_CODE_DARK_DOCUMENT","Low lighting detected");
|
|
239
|
+
actualAccuraErrorConfg.put("ACCURA_ERROR_CODE_PHOTO_COPY_DOCUMENT","Can not accept Photo Copy Document");
|
|
240
|
+
actualAccuraErrorConfg.put("ACCURA_ERROR_CODE_FACE","Face not detected");
|
|
241
|
+
actualAccuraErrorConfg.put("ACCURA_ERROR_CODE_MRZ","MRZ not detected");
|
|
242
|
+
actualAccuraErrorConfg.put("ACCURA_ERROR_CODE_PASSPORT_MRZ","Passport MRZ not detected");
|
|
243
|
+
actualAccuraErrorConfg.put("ACCURA_ERROR_CODE_ID_MRZ","ID MRZ not detected");
|
|
244
|
+
actualAccuraErrorConfg.put("ACCURA_ERROR_CODE_VISA_MRZ","Visa MRZ not detected");
|
|
245
|
+
actualAccuraErrorConfg.put("ACCURA_ERROR_CODE_UPSIDE_DOWN_SIDE","Document is upside down. Place it properly");
|
|
246
|
+
actualAccuraErrorConfg.put("ACCURA_ERROR_CODE_WRONG_SIDE","Scanning wrong side of Document");
|
|
247
|
+
|
|
248
|
+
|
|
187
249
|
JSONArray args = ReactNativeJSON.convertArrayToJson(argsNew);
|
|
188
250
|
RecogEngine recogEngine = new RecogEngine();
|
|
189
251
|
|
|
190
|
-
accuraConfigs = args.getJSONObject(0);
|
|
191
|
-
|
|
192
|
-
|
|
252
|
+
// accuraConfigs = args.getJSONObject(0);
|
|
253
|
+
Iterator<String> keys1 = actualAccuraConfigs.keys();
|
|
254
|
+
while(keys1.hasNext()) {
|
|
255
|
+
String key = keys1.next();
|
|
256
|
+
accuraConfigs.put(key, actualAccuraConfigs.get(key));
|
|
257
|
+
}
|
|
258
|
+
Iterator<String> keys2 = args.getJSONObject(0).keys();
|
|
259
|
+
while(keys2.hasNext()) {
|
|
260
|
+
String key = keys2.next();
|
|
261
|
+
accuraConfigs.put(key, args.getJSONObject(0).get(key));
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
// accuraErrorConfg = args.getJSONObject(1);
|
|
265
|
+
Iterator<String> keys3 = actualAccuraErrorConfg.keys();
|
|
266
|
+
while(keys3.hasNext()) {
|
|
267
|
+
String key = keys3.next();
|
|
268
|
+
accuraErrorConfg.put(key, actualAccuraErrorConfg.get(key));
|
|
269
|
+
}
|
|
270
|
+
Iterator<String> keys4 = args.getJSONObject(1).keys();
|
|
271
|
+
while(keys4.hasNext()) {
|
|
272
|
+
String key = keys4.next();
|
|
273
|
+
accuraErrorConfg.put(key, args.getJSONObject(1).get(key));
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
// accuraTitleMsg = args.getJSONObject(2);
|
|
277
|
+
Iterator<String> keys5 = actualAccuraTitleMsg.keys();
|
|
278
|
+
while(keys5.hasNext()) {
|
|
279
|
+
String key = keys5.next();
|
|
280
|
+
accuraTitleMsg.put(key, actualAccuraTitleMsg.get(key));
|
|
281
|
+
}
|
|
282
|
+
Iterator<String> keys6 = args.getJSONObject(2).keys();
|
|
283
|
+
while(keys6.hasNext()) {
|
|
284
|
+
String key = keys6.next();
|
|
285
|
+
accuraTitleMsg.put(key, args.getJSONObject(2).get(key));
|
|
286
|
+
}
|
|
287
|
+
|
|
193
288
|
|
|
194
289
|
OcrActivity.accuraErrorConfg = accuraErrorConfg;
|
|
195
290
|
OcrActivity.accuraTitleMsg = accuraTitleMsg;
|
|
@@ -503,5 +598,5 @@ public class AccurascanKycModule extends ReactContextBaseJavaModule {
|
|
|
503
598
|
}
|
|
504
599
|
return resultOf;
|
|
505
600
|
}
|
|
506
|
-
|
|
601
|
+
|
|
507
602
|
}
|
|
@@ -364,7 +364,13 @@ public class ActivityFaceMatch extends Activity implements FaceCallback {
|
|
|
364
364
|
this.finish();
|
|
365
365
|
return;
|
|
366
366
|
}
|
|
367
|
-
|
|
367
|
+
try {
|
|
368
|
+
Bitmap trying = MediaStore.Images.Media.getBitmap(this.getContentResolver() , uri);
|
|
369
|
+
helper.setInputImage(trying);
|
|
370
|
+
|
|
371
|
+
} catch (IOException e) {
|
|
372
|
+
e.printStackTrace();
|
|
373
|
+
}
|
|
368
374
|
|
|
369
375
|
}else if(ind == 2) {
|
|
370
376
|
try {
|
|
@@ -377,7 +383,14 @@ public class ActivityFaceMatch extends Activity implements FaceCallback {
|
|
|
377
383
|
this.finish();
|
|
378
384
|
return;
|
|
379
385
|
}
|
|
380
|
-
|
|
386
|
+
try {
|
|
387
|
+
Bitmap trying = MediaStore.Images.Media.getBitmap(this.getContentResolver() , uri);
|
|
388
|
+
helper.setMatchImage(trying);
|
|
389
|
+
|
|
390
|
+
} catch (IOException e) {
|
|
391
|
+
e.printStackTrace();
|
|
392
|
+
}
|
|
393
|
+
// helper.setMatchImage(uri);
|
|
381
394
|
|
|
382
395
|
}
|
|
383
396
|
|