accurascan_kyc 1.4.5 → 1.4.7
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/accurascan-kyc.podspec +4 -4
- package/android/android.iml +11 -0
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/accurascankyc/AccuraUploadOcrActivity.java +41 -0
- package/android/src/main/java/com/accurascankyc/AccurascanKycModule.java +21 -21
- package/android/src/main/java/com/accurascankyc/DownloadFontTask.java +29 -5
- package/android/src/main/java/com/accurascankyc/OcrActivity.java +63 -59
- package/package.json +1 -1
package/accurascan-kyc.podspec
CHANGED
|
@@ -11,8 +11,8 @@ Pod::Spec.new do |s|
|
|
|
11
11
|
s.license = package["license"]
|
|
12
12
|
s.authors = package["author"]
|
|
13
13
|
|
|
14
|
-
s.platforms = { :ios => "
|
|
15
|
-
s.ios.deployment_target = '
|
|
14
|
+
s.platforms = { :ios => "16.0" }
|
|
15
|
+
s.ios.deployment_target = '16.0'
|
|
16
16
|
s.source = {
|
|
17
17
|
:git => "https://git.accurascan.com/mahdi/hybrid-react-kyc.git",
|
|
18
18
|
:tag => "#{s.version}"
|
|
@@ -23,7 +23,7 @@ Pod::Spec.new do |s|
|
|
|
23
23
|
|
|
24
24
|
s.dependency "React-Core"
|
|
25
25
|
s.static_framework = true
|
|
26
|
-
s.dependency "AccuraKYC","4.4.
|
|
26
|
+
s.dependency "AccuraKYC","4.4.5"
|
|
27
27
|
|
|
28
28
|
# s.dependency "AccuraKYC","4.2.9"
|
|
29
29
|
|
|
@@ -36,7 +36,7 @@ Pod::Spec.new do |s|
|
|
|
36
36
|
s.pod_target_xcconfig = {
|
|
37
37
|
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
|
|
38
38
|
"OTHER_CPLUSPLUSFLAGS" => folly_compiler_flags,
|
|
39
|
-
"CLANG_CXX_LANGUAGE_STANDARD" => "c++
|
|
39
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
s.dependency "React-Codegen"
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="JAVA_MODULE" version="4">
|
|
3
|
+
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
4
|
+
<exclude-output />
|
|
5
|
+
<content url="file://$MODULE_DIR$">
|
|
6
|
+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" />
|
|
7
|
+
</content>
|
|
8
|
+
<orderEntry type="inheritedJdk" />
|
|
9
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
10
|
+
</component>
|
|
11
|
+
</module>
|
package/android/build.gradle
CHANGED
|
@@ -106,7 +106,7 @@ dependencies {
|
|
|
106
106
|
implementation 'androidx.appcompat:appcompat:1.7.1'
|
|
107
107
|
implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
|
|
108
108
|
// Update OCR
|
|
109
|
-
implementation 'com.github.accurascan:AccuraOCR:6.
|
|
109
|
+
implementation 'com.github.accurascan:AccuraOCR:6.1.16'
|
|
110
110
|
// FaceMatch has no issue
|
|
111
111
|
implementation 'com.github.accurascan:AccuraFaceMatch:4.0.1'
|
|
112
112
|
// Update Liveness
|
|
@@ -243,4 +243,45 @@ public class AccuraUploadOcrActivity implements OcrCallback {
|
|
|
243
243
|
// System.out.println("onError called ");
|
|
244
244
|
sendOnce(errorMessage, null);
|
|
245
245
|
}
|
|
246
|
+
|
|
247
|
+
@Override
|
|
248
|
+
public void onAPIUpdate(int i, String s) {
|
|
249
|
+
// Runnable runnable = () -> {
|
|
250
|
+
// if (i == RecogEngine.ACCURA_API_DISPLAY_PROGRESS) {
|
|
251
|
+
// // Display your custom progress dialog
|
|
252
|
+
// if (pd == null) {
|
|
253
|
+
// pd = new ProgressDialog(OcrActivity.this);
|
|
254
|
+
// pd.setCancelable(false);
|
|
255
|
+
// pd.setCanceledOnTouchOutside(false);
|
|
256
|
+
// pd.setMessage(setProgressMessage);
|
|
257
|
+
// }
|
|
258
|
+
// try {
|
|
259
|
+
// // If setHideProgressDialogue is true, hide the progress dialog immediately
|
|
260
|
+
// if (setHideProgressDialogue) {
|
|
261
|
+
// if (pd.isShowing()) {
|
|
262
|
+
// pd.dismiss();
|
|
263
|
+
// }
|
|
264
|
+
// } else {
|
|
265
|
+
// // Otherwise, show or hide based on the value of `s`
|
|
266
|
+
// if (s.equals("Show") && !pd.isShowing()) {
|
|
267
|
+
// Message _message = new Message();
|
|
268
|
+
// _message.what = 1;
|
|
269
|
+
// _message.obj = "Please wait...";
|
|
270
|
+
// handler.sendMessage(_message);
|
|
271
|
+
// pd.show();
|
|
272
|
+
// } else if (s.equals("Hide") && pd.isShowing()) {
|
|
273
|
+
// pd.dismiss();
|
|
274
|
+
// }
|
|
275
|
+
// }
|
|
276
|
+
// } catch (Exception e) {
|
|
277
|
+
// e.printStackTrace();
|
|
278
|
+
// }
|
|
279
|
+
// } else if (i == RecogEngine.ACCURA_API_ERROR) {
|
|
280
|
+
// Toast.makeText(OcrActivity.this, "Api Error is" + s, Toast.LENGTH_LONG).show();
|
|
281
|
+
// }
|
|
282
|
+
// };
|
|
283
|
+
// runOnUiThread(runnable);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
|
|
246
287
|
}
|
|
@@ -435,27 +435,27 @@ public class AccurascanKycModule extends ReactContextBaseJavaModule {
|
|
|
435
435
|
recogEngine.setBlurPercentage(getCurrentActivity(), 62);
|
|
436
436
|
}
|
|
437
437
|
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
438
|
+
if (accuraConfigs.has("setIsDocEnable")){
|
|
439
|
+
OcrActivity.isDocLiveness = accuraConfigs.getBoolean("setIsDocEnable");
|
|
440
|
+
};
|
|
441
|
+
if (accuraConfigs.has("setDocUrl")){
|
|
442
|
+
OcrActivity.DocumentLivenessUrl = accuraConfigs.getString("setDocUrl");
|
|
443
|
+
};
|
|
444
|
+
if (accuraConfigs.has("setProgressMessage")){
|
|
445
|
+
OcrActivity.setProgressMessage = accuraConfigs.getString("setProgressMessage");
|
|
446
|
+
};
|
|
447
|
+
if (accuraConfigs.has("setHideProgressDialogue")){
|
|
448
|
+
OcrActivity.setHideProgressDialogue = accuraConfigs.getBoolean("setHideProgressDialogue");
|
|
449
|
+
};
|
|
450
|
+
if (accuraConfigs.has("setHeader")) {
|
|
451
|
+
JSONObject jsonHeader = accuraConfigs.optJSONObject("setHeader");
|
|
452
|
+
if (jsonHeader != null) {
|
|
453
|
+
OcrActivity.DocHeader = jsonToMap(jsonHeader);
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
if (accuraConfigs.has("setApiTimer")){
|
|
457
|
+
OcrActivity.setApiTimer = accuraConfigs.getInt("setApiTimer");
|
|
458
|
+
};
|
|
459
459
|
|
|
460
460
|
|
|
461
461
|
// recogEngine.isCheckPhotoCopy(getCurrentActivity(),accuraConfigs.getBoolean("isCheckPhotoCopy"));
|
|
@@ -45,12 +45,36 @@ public class DownloadFontTask extends AsyncTask<String, Void, File> {
|
|
|
45
45
|
return fontFile;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
// @Override
|
|
49
|
+
// protected void onPostExecute(File fontFile) {
|
|
50
|
+
// if (fontFile != null && textView != null) {
|
|
51
|
+
// Typeface typeface = Typeface.createFromFile(fontFile);
|
|
52
|
+
// textView.setTypeface(typeface);
|
|
53
|
+
// }
|
|
54
|
+
// }
|
|
55
|
+
|
|
48
56
|
@Override
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
57
|
+
protected void onPostExecute(File fontFile) {
|
|
58
|
+
if (textView == null || fontFile == null || !fontFile.exists()) {
|
|
59
|
+
// System.out.println("Font unavailable. Keeping the default.");
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
try {
|
|
64
|
+
Typeface typeface = Typeface.createFromFile(fontFile);
|
|
65
|
+
|
|
66
|
+
if (typeface != null) {
|
|
67
|
+
textView.setTypeface(typeface);
|
|
68
|
+
// System.out.println("Font applied successfully");
|
|
69
|
+
} else {
|
|
70
|
+
// System.out.println("Typeface creation returned null");
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
} catch (RuntimeException e) {
|
|
74
|
+
// System.out.println("Downloaded file could not be loaded as a font: "+ e);
|
|
75
|
+
fontFile.delete();
|
|
76
|
+
}
|
|
53
77
|
}
|
|
54
|
-
|
|
78
|
+
|
|
55
79
|
}
|
|
56
80
|
|
|
@@ -236,12 +236,12 @@ public class OcrActivity extends SensorsActivity implements OcrCallback {
|
|
|
236
236
|
// or you can pass respective country codes of countries whose MRZ you want to accept. Eg:- IND, USA, TUN, etc.
|
|
237
237
|
cameraView.setMRZCountryCodeList("all");
|
|
238
238
|
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
239
|
+
//Document Liveness
|
|
240
|
+
cameraView
|
|
241
|
+
.enableDocLiveness(isDocLiveness)
|
|
242
|
+
.setServerUrl(DocumentLivenessUrl)
|
|
243
|
+
.setMaxTimeLimitInSeconds(setApiTimer)
|
|
244
|
+
.addApiHeaders(DocHeader);
|
|
245
245
|
|
|
246
246
|
cameraView.setRecogType(recogType)
|
|
247
247
|
.setView(linearLayout) // To add camera view
|
|
@@ -489,6 +489,10 @@ public class OcrActivity extends SensorsActivity implements OcrCallback {
|
|
|
489
489
|
viewLeft.setLayoutParams(lpLeft);
|
|
490
490
|
|
|
491
491
|
findViewById(R.id.ocr_frame).setVisibility(View.VISIBLE);
|
|
492
|
+
|
|
493
|
+
if (cameraView != null) {
|
|
494
|
+
cameraView.setBoxView(borderFrame);
|
|
495
|
+
}
|
|
492
496
|
//</editor-fold>
|
|
493
497
|
//<editor-fold desc="Barcode Selection only add for RecogType.BARCODE">
|
|
494
498
|
// if (recogType == RecogType.BARCODE) cameraView.setBarcodeFormat(BarcodeFormat.BARCODE_AZTEC);
|
|
@@ -772,11 +776,11 @@ public class OcrActivity extends SensorsActivity implements OcrCallback {
|
|
|
772
776
|
OcrData.MapData backData = data.getBackData();
|
|
773
777
|
if (frontData != null) {
|
|
774
778
|
if(isDocLiveness){
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
779
|
+
try {
|
|
780
|
+
frontResult.put("Document Liveness", frontData.IDLivenessScore);
|
|
781
|
+
} catch (JSONException e) {
|
|
782
|
+
e.printStackTrace(); // Handle the exception here (e.g., log the error or notify the user)
|
|
783
|
+
}
|
|
780
784
|
}
|
|
781
785
|
List<OcrData.MapData.ScannedData> frontScanData = frontData.getOcr_data();
|
|
782
786
|
for (int i = 0; i < frontScanData.size(); i++) {
|
|
@@ -803,11 +807,11 @@ public class OcrActivity extends SensorsActivity implements OcrCallback {
|
|
|
803
807
|
}
|
|
804
808
|
if (backData != null) {
|
|
805
809
|
if(isDocLiveness){
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
810
|
+
try {
|
|
811
|
+
backResult.put("Document Liveness", backData.IDLivenessScore);
|
|
812
|
+
} catch (JSONException e) {
|
|
813
|
+
e.printStackTrace(); // Handle the exception here (e.g., log the error or notify the user)
|
|
814
|
+
}
|
|
811
815
|
}
|
|
812
816
|
List<OcrData.MapData.ScannedData> backScanData = backData.getOcr_data();
|
|
813
817
|
for (int i = 0; i < backScanData.size(); i++) {
|
|
@@ -1270,44 +1274,44 @@ public class OcrActivity extends SensorsActivity implements OcrCallback {
|
|
|
1270
1274
|
}
|
|
1271
1275
|
}
|
|
1272
1276
|
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
//
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
//
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
//
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1277
|
+
@Override
|
|
1278
|
+
public void onAPIUpdate(int i, String s) {
|
|
1279
|
+
Runnable runnable = () -> {
|
|
1280
|
+
if (i == RecogEngine.ACCURA_API_DISPLAY_PROGRESS) {
|
|
1281
|
+
// Display your custom progress dialog
|
|
1282
|
+
if (pd == null) {
|
|
1283
|
+
pd = new ProgressDialog(OcrActivity.this);
|
|
1284
|
+
pd.setCancelable(false);
|
|
1285
|
+
pd.setCanceledOnTouchOutside(false);
|
|
1286
|
+
pd.setMessage(setProgressMessage);
|
|
1287
|
+
}
|
|
1288
|
+
try {
|
|
1289
|
+
// If setHideProgressDialogue is true, hide the progress dialog immediately
|
|
1290
|
+
if (setHideProgressDialogue) {
|
|
1291
|
+
if (pd.isShowing()) {
|
|
1292
|
+
pd.dismiss();
|
|
1293
|
+
}
|
|
1294
|
+
} else {
|
|
1295
|
+
// Otherwise, show or hide based on the value of `s`
|
|
1296
|
+
if (s.equals("Show") && !pd.isShowing()) {
|
|
1297
|
+
Message _message = new Message();
|
|
1298
|
+
_message.what = 1;
|
|
1299
|
+
_message.obj = "Please wait...";
|
|
1300
|
+
handler.sendMessage(_message);
|
|
1301
|
+
pd.show();
|
|
1302
|
+
} else if (s.equals("Hide") && pd.isShowing()) {
|
|
1303
|
+
pd.dismiss();
|
|
1304
|
+
}
|
|
1305
|
+
}
|
|
1306
|
+
} catch (Exception e) {
|
|
1307
|
+
e.printStackTrace();
|
|
1308
|
+
}
|
|
1309
|
+
} else if (i == RecogEngine.ACCURA_API_ERROR) {
|
|
1310
|
+
Toast.makeText(OcrActivity.this, "Api Error is" + s, Toast.LENGTH_LONG).show();
|
|
1311
|
+
}
|
|
1312
|
+
};
|
|
1313
|
+
runOnUiThread(runnable);
|
|
1314
|
+
}
|
|
1311
1315
|
|
|
1312
1316
|
/**
|
|
1313
1317
|
* Set Barcode selection Dialog to Scan only selected barcode format
|
|
@@ -1366,11 +1370,11 @@ public class OcrActivity extends SensorsActivity implements OcrCallback {
|
|
|
1366
1370
|
frontResult.put("MRZ", recogResult.lines);
|
|
1367
1371
|
|
|
1368
1372
|
if(isDocLiveness && recogType == RecogType.MRZ){
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1373
|
+
frontResult.put("Document Liveness Front", recogResult.FrontIDLivenessScore);
|
|
1374
|
+
|
|
1375
|
+
if(recogResult.BackIDLivenessScore != null && isBacksideAvail){
|
|
1376
|
+
frontResult.put("Document Liveness Back", recogResult.BackIDLivenessScore);
|
|
1377
|
+
}
|
|
1374
1378
|
}
|
|
1375
1379
|
|
|
1376
1380
|
frontResult.put("Document Type", recogResult.docType);
|