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.
@@ -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 => "12.0" }
15
- s.ios.deployment_target = '12.0'
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.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++20"
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>
@@ -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.7.0'
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
- // 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
- // };
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
- protected void onPostExecute(File fontFile) {
50
- if (fontFile != null && textView != null) {
51
- Typeface typeface = Typeface.createFromFile(fontFile);
52
- textView.setTypeface(typeface);
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
- // cameraView
241
- // .enableDocLiveness(isDocLiveness)
242
- // .setServerUrl(DocumentLivenessUrl)
243
- // .setMaxTimeLimitInSeconds(setApiTimer)
244
- // .addApiHeaders(DocHeader);
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
- // try {
776
- // frontResult.put("Document Liveness", frontData.docLiveness);
777
- // } catch (JSONException e) {
778
- // e.printStackTrace(); // Handle the exception here (e.g., log the error or notify the user)
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
- // try {
807
- // backResult.put("Document Liveness", backData.docLiveness);
808
- // } catch (JSONException e) {
809
- // e.printStackTrace(); // Handle the exception here (e.g., log the error or notify the user)
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
- // @Override
1274
- // public void onAPIUpdate(int i, String s) {
1275
- // Runnable runnable = () -> {
1276
- // if (i == RecogEngine.ACCURA_API_DISPLAY_PROGRESS) {
1277
- // // Display your custom progress dialog
1278
- // if (pd == null) {
1279
- // pd = new ProgressDialog(OcrActivity.this);
1280
- // pd.setCancelable(false);
1281
- // pd.setCanceledOnTouchOutside(false);
1282
- // pd.setMessage(setProgressMessage);
1283
- // }
1284
- // try {
1285
- // // If setHideProgressDialogue is true, hide the progress dialog immediately
1286
- // if (setHideProgressDialogue) {
1287
- // if (pd.isShowing()) {
1288
- // pd.dismiss();
1289
- // }
1290
- // } else {
1291
- // // Otherwise, show or hide based on the value of `s`
1292
- // if (s.equals("Show") && !pd.isShowing()) {
1293
- // Message _message = new Message();
1294
- // _message.what = 1;
1295
- // _message.obj = "Please wait...";
1296
- // handler.sendMessage(_message);
1297
- // pd.show();
1298
- // } else if (s.equals("Hide") && pd.isShowing()) {
1299
- // pd.dismiss();
1300
- // }
1301
- // }
1302
- // } catch (Exception e) {
1303
- // e.printStackTrace();
1304
- // }
1305
- // } else if (i == RecogEngine.ACCURA_API_ERROR) {
1306
- // Toast.makeText(OcrActivity.this, "Api Error is" + s, Toast.LENGTH_LONG).show();
1307
- // }
1308
- // };
1309
- // runOnUiThread(runnable);
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
- // frontResult.put("Document Liveness Front", recogResult.docfrontliveness);
1370
- //
1371
- // if(recogResult.docbackliveness != null && isBacksideAvail){
1372
- // frontResult.put("Document Liveness Back", recogResult.docbackliveness);
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "accurascan_kyc",
3
- "version": "1.4.5",
3
+ "version": "1.4.7",
4
4
  "description": "Accura Scan",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",