accurascan_kyc 1.3.7 → 1.3.8

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.
@@ -23,7 +23,8 @@ Pod::Spec.new do |s|
23
23
  s.static_framework = true
24
24
  # s.dependency "AccuraKYC","4.0.2"
25
25
  # s.dependency "AccuraKYC","4.0.4"
26
- s.dependency 'AccuraKYC_Enc', '4.1.3'
26
+ # s.dependency 'AccuraKYC', '4.1.4'
27
+ s.dependency 'AccuraKYC', '4.2.9'
27
28
  # Don't install the dependencies when we run `pod install` in the old architecture.
28
29
  if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
29
30
  s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
@@ -3,12 +3,12 @@ buildscript {
3
3
  google()
4
4
  mavenLocal()
5
5
  mavenCentral()
6
- // jcenter()
6
+ jcenter()
7
7
  maven { url 'https://jitpack.io' }
8
8
  }
9
9
 
10
10
  dependencies {
11
- classpath "com.android.tools.build:gradle:8.9.1"
11
+ classpath "com.android.tools.build:gradle:7.2.1"
12
12
  }
13
13
  }
14
14
 
@@ -34,7 +34,6 @@ def getExtOrIntegerDefault(name) {
34
34
  }
35
35
 
36
36
  android {
37
- namespace "com.accurascankyc"
38
37
  compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
39
38
 
40
39
  defaultConfig {
@@ -44,11 +43,11 @@ android {
44
43
  }
45
44
  buildTypes {
46
45
  release {
47
- minifyEnabled false
46
+ minifyEnabled true
48
47
  proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
49
48
  }
50
49
  debug {
51
- minifyEnabled false
50
+ minifyEnabled true
52
51
  proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
53
52
  }
54
53
  }
@@ -62,10 +61,6 @@ android {
62
61
  targetCompatibility JavaVersion.VERSION_1_8
63
62
  }
64
63
 
65
- buildFeatures {
66
- buildConfig true
67
- }
68
-
69
64
  packagingOptions {
70
65
  pickFirst 'lib/arm64-v8a/libcrypto.so'
71
66
  pickFirst 'lib/arm64-v8a/libssl.so'
@@ -102,14 +97,14 @@ dependencies {
102
97
  //noinspection GradleDynamicVersion
103
98
  implementation "com.facebook.react:react-native:+"
104
99
  implementation fileTree(dir: 'libs', include: ['*.jar'])
105
- implementation 'androidx.appcompat:appcompat:1.7.1'
106
- implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
100
+ implementation 'androidx.appcompat:appcompat:1.6.0'
101
+ implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
107
102
  // Update OCR
108
- implementation 'com.github.accurascan:AccuraOCR:6.2.4'
103
+ implementation 'com.github.accurascan:AccuraOCR:6.1.14'
109
104
  // FaceMatch has no issue
110
- implementation 'com.github.accurascan:AccuraFaceMatch:4.0.0'
105
+ implementation 'com.github.accurascan:AccuraFaceMatch:3.2.7'
111
106
  // Update Liveness
112
- implementation 'com.github.accurascan:Liveness-Android:3.6.0'
107
+ implementation 'com.github.accurascan:Liveness-Android:3.4.5'
113
108
  implementation 'com.squareup.picasso:picasso:2.71828'
114
109
  }
115
110
 
@@ -1,5 +1,5 @@
1
1
  <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
- >
2
+ package="com.accurascankyc">
3
3
 
4
4
  <application>
5
5
  <activity android:name="com.accurascankyc.ActivityFaceMatch"
@@ -433,27 +433,27 @@ public class AccurascanKycModule extends ReactContextBaseJavaModule {
433
433
  recogEngine.setBlurPercentage(getCurrentActivity(), 62);
434
434
  }
435
435
 
436
- // if (accuraConfigs.has("setIsDocEnable")){
437
- // OcrActivity.isDocLiveness = accuraConfigs.getBoolean("setIsDocEnable");
438
- // };
439
- // if (accuraConfigs.has("setDocUrl")){
440
- // OcrActivity.DocumentLivenessUrl = accuraConfigs.getString("setDocUrl");
441
- // };
442
- // if (accuraConfigs.has("setProgressMessage")){
443
- // OcrActivity.setProgressMessage = accuraConfigs.getString("setProgressMessage");
444
- // };
445
- // if (accuraConfigs.has("setHideProgressDialogue")){
446
- // OcrActivity.setHideProgressDialogue = accuraConfigs.getBoolean("setHideProgressDialogue");
447
- // };
448
- // if (accuraConfigs.has("setHeader")) {
449
- // JSONObject jsonHeader = accuraConfigs.optJSONObject("setHeader");
450
- // if (jsonHeader != null) {
451
- // OcrActivity.DocHeader = jsonToMap(jsonHeader);
452
- // }
453
- // }
454
- // if (accuraConfigs.has("setApiTimer")){
455
- // OcrActivity.setApiTimer = accuraConfigs.getInt("setApiTimer");
456
- // };
436
+ if (accuraConfigs.has("setIsDocEnable")){
437
+ OcrActivity.isDocLiveness = accuraConfigs.getBoolean("setIsDocEnable");
438
+ };
439
+ if (accuraConfigs.has("setDocUrl")){
440
+ OcrActivity.DocumentLivenessUrl = accuraConfigs.getString("setDocUrl");
441
+ };
442
+ if (accuraConfigs.has("setProgressMessage")){
443
+ OcrActivity.setProgressMessage = accuraConfigs.getString("setProgressMessage");
444
+ };
445
+ if (accuraConfigs.has("setHideProgressDialogue")){
446
+ OcrActivity.setHideProgressDialogue = accuraConfigs.getBoolean("setHideProgressDialogue");
447
+ };
448
+ if (accuraConfigs.has("setHeader")) {
449
+ JSONObject jsonHeader = accuraConfigs.optJSONObject("setHeader");
450
+ if (jsonHeader != null) {
451
+ OcrActivity.DocHeader = jsonToMap(jsonHeader);
452
+ }
453
+ }
454
+ if (accuraConfigs.has("setApiTimer")){
455
+ OcrActivity.setApiTimer = accuraConfigs.getInt("setApiTimer");
456
+ };
457
457
 
458
458
 
459
459
  // recogEngine.isCheckPhotoCopy(getCurrentActivity(),accuraConfigs.getBoolean("isCheckPhotoCopy"));
@@ -220,7 +220,6 @@ public class OcrActivity extends SensorsActivity implements OcrCallback {
220
220
  //</editor-fold>
221
221
 
222
222
  RelativeLayout linearLayout = findViewById(R.id.ocr_root); // layout width and height is match_parent
223
- // RelativeLayout linearLayout = findViewById(R("ocr_root", "id"));
224
223
 
225
224
  cameraView = new CameraView(this);
226
225
  if (recogType == RecogType.OCR || recogType == RecogType.DL_PLATE) {
@@ -237,11 +236,11 @@ public class OcrActivity extends SensorsActivity implements OcrCallback {
237
236
  cameraView.setMRZCountryCodeList("all");
238
237
  }
239
238
 
240
- // cameraView
241
- // .enableDocLiveness(isDocLiveness)
242
- // .setServerUrl(DocumentLivenessUrl)
243
- // .setMaxTimeLimitInSeconds(setApiTimer)
244
- // .addApiHeaders(DocHeader);
239
+ cameraView
240
+ .enableDocLiveness(isDocLiveness)
241
+ .setServerUrl(DocumentLivenessUrl)
242
+ .setMaxTimeLimitInSeconds(setApiTimer)
243
+ .addApiHeaders(DocHeader);
245
244
 
246
245
  cameraView.setRecogType(recogType)
247
246
  .setView(linearLayout) // To add camera view
@@ -772,11 +771,11 @@ public class OcrActivity extends SensorsActivity implements OcrCallback {
772
771
  OcrData.MapData backData = data.getBackData();
773
772
  if (frontData != null) {
774
773
  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
- // }
774
+ try {
775
+ frontResult.put("ID Liveness", frontData.IDLivenessScore);
776
+ } catch (JSONException e) {
777
+ e.printStackTrace(); // Handle the exception here (e.g., log the error or notify the user)
778
+ }
780
779
  }
781
780
  List<OcrData.MapData.ScannedData> frontScanData = frontData.getOcr_data();
782
781
  for (int i = 0; i < frontScanData.size(); i++) {
@@ -803,11 +802,11 @@ public class OcrActivity extends SensorsActivity implements OcrCallback {
803
802
  }
804
803
  if (backData != null) {
805
804
  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
- // }
805
+ try {
806
+ backResult.put("ID Liveness", backData.IDLivenessScore);
807
+ } catch (JSONException e) {
808
+ e.printStackTrace(); // Handle the exception here (e.g., log the error or notify the user)
809
+ }
811
810
  }
812
811
  List<OcrData.MapData.ScannedData> backScanData = backData.getOcr_data();
813
812
  for (int i = 0; i < backScanData.size(); i++) {
@@ -1270,44 +1269,44 @@ public class OcrActivity extends SensorsActivity implements OcrCallback {
1270
1269
  }
1271
1270
  }
1272
1271
 
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
- // }
1272
+ @Override
1273
+ public void onAPIUpdate(int i, String s) {
1274
+ Runnable runnable = () -> {
1275
+ if (i == RecogEngine.ACCURA_API_DISPLAY_PROGRESS) {
1276
+ // Display your custom progress dialog
1277
+ if (pd == null) {
1278
+ pd = new ProgressDialog(OcrActivity.this);
1279
+ pd.setCancelable(false);
1280
+ pd.setCanceledOnTouchOutside(false);
1281
+ pd.setMessage(setProgressMessage);
1282
+ }
1283
+ try {
1284
+ // If setHideProgressDialogue is true, hide the progress dialog immediately
1285
+ if (setHideProgressDialogue) {
1286
+ if (pd.isShowing()) {
1287
+ pd.dismiss();
1288
+ }
1289
+ } else {
1290
+ // Otherwise, show or hide based on the value of `s`
1291
+ if (s.equals("Show") && !pd.isShowing()) {
1292
+ Message _message = new Message();
1293
+ _message.what = 1;
1294
+ _message.obj = "Please wait...";
1295
+ handler.sendMessage(_message);
1296
+ pd.show();
1297
+ } else if (s.equals("Hide") && pd.isShowing()) {
1298
+ pd.dismiss();
1299
+ }
1300
+ }
1301
+ } catch (Exception e) {
1302
+ e.printStackTrace();
1303
+ }
1304
+ } else if (i == RecogEngine.ACCURA_API_ERROR) {
1305
+ Toast.makeText(OcrActivity.this, "Api Error is" + s, Toast.LENGTH_LONG).show();
1306
+ }
1307
+ };
1308
+ runOnUiThread(runnable);
1309
+ }
1311
1310
 
1312
1311
  /**
1313
1312
  * Set Barcode selection Dialog to Scan only selected barcode format
@@ -1364,13 +1363,13 @@ public class OcrActivity extends SensorsActivity implements OcrCallback {
1364
1363
  JSONObject frontResult = new JSONObject();
1365
1364
  try {
1366
1365
  frontResult.put("MRZ", recogResult.lines);
1367
-
1366
+
1368
1367
  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
- // }
1368
+ frontResult.put("ID Liveness Front", recogResult.FrontIDLivenessScore);
1369
+
1370
+ if(recogResult.BackIDLivenessScore != null && isBacksideAvail){
1371
+ frontResult.put("ID Liveness Back", recogResult.BackIDLivenessScore);
1372
+ }
1374
1373
  }
1375
1374
 
1376
1375
  frontResult.put("Document Type", recogResult.docType);
@@ -14,6 +14,7 @@ import android.widget.Toast;
14
14
  import androidx.annotation.Nullable;
15
15
 
16
16
  import com.accurascan.facedetection.LivenessCustomization;
17
+ // import com.accurascan.facedetection.LivenessMode;
17
18
  import com.accurascan.facedetection.SelfieCameraActivity;
18
19
  import com.accurascan.facedetection.model.AccuraVerificationResult;
19
20
  import com.accurascan.facematch.util.BitmapHelper;
@@ -102,7 +103,6 @@ public class OcrResultActivity extends Activity implements FaceCallback {
102
103
  finish();
103
104
  }
104
105
  if (result.getLivenessResult().getLivenessStatus()) {
105
- // String lvscore = result.getLivenessResult().getLivenessScore() * 100 + "";
106
106
  String lvscore = result.getLivenessResult().getLivenessScore() + "";
107
107
  try {
108
108
  results.put("score",lvscore);
@@ -126,7 +126,6 @@ public class OcrResultActivity extends Activity implements FaceCallback {
126
126
  finish();
127
127
  }else{
128
128
  if (result.getLivenessResult().getLivenessStatus()) {
129
- // String lvscore = result.getLivenessResult().getLivenessScore() * 100 + "";
130
129
  String lvscore = result.getLivenessResult().getLivenessScore() + "";
131
130
  try {
132
131
  results.put("score",lvscore);
@@ -247,11 +246,37 @@ public class OcrResultActivity extends Activity implements FaceCallback {
247
246
  // private void performClick(boolean isFaceMatch, boolean isLiveness) {
248
247
  // if (isFaceMatch) openCamera();
249
248
  // else if (isLiveness) openLivenessCamera();
250
- // }
249
+ // }setEnableFaceMovement setEnableOralVerification
251
250
 
252
251
  private void openLivenessCamera() {
253
252
  LivenessCustomization livenessCustomization = new LivenessCustomization();
254
253
 
254
+ // System.out.println("livenessConfig3: " );
255
+ // try {
256
+ // boolean enableFaceMovement = false;
257
+ // boolean enableOralVerification = false;
258
+ // if(livenessConfig.has("setEnableFaceMovement") ){
259
+ // enableFaceMovement = livenessConfig.getBoolean("setEnableFaceMovement");
260
+
261
+ // }
262
+ // if(livenessConfig.has("setEnableOralVerification") ){
263
+ // enableOralVerification = livenessConfig.getBoolean("setEnableOralVerification");
264
+
265
+ // }
266
+
267
+ // if(enableFaceMovement && enableOralVerification){
268
+ // livenessCustomization.livenessMode = LivenessMode.ALL;
269
+ // }else if(enableFaceMovement && !enableOralVerification){
270
+ // livenessCustomization.livenessMode = LivenessMode.FACE_3D;
271
+ // }else if(!enableFaceMovement && enableOralVerification){
272
+ // livenessCustomization.livenessMode = LivenessMode.VOICE;
273
+ // }else{
274
+ // livenessCustomization.livenessMode = LivenessMode.DEFAULT;
275
+ // }
276
+ // } catch (JSONException e) {
277
+ // e.printStackTrace();
278
+ // }
279
+
255
280
  try {
256
281
  if(livenessConfig.has("backGroundColor")){
257
282
  livenessCustomization.backGroundColor = Color.parseColor(livenessConfig.getString("backGroundColor"));
@@ -409,15 +434,15 @@ public class OcrResultActivity extends Activity implements FaceCallback {
409
434
  }else {
410
435
  livenessCustomization.setLowLightTolerence(-1/*lowLightTolerence*/);
411
436
  }
412
- // if (livenessConfig.has("setApiKey")){
413
- //// try {
414
- //// livenessCustomization.setApiKey(livenessConfig.getString("setApiKey"));
415
- //// } catch (JSONException e) {
416
- //// e.printStackTrace();
417
- //// }
418
- //// }else {
419
- //// livenessCustomization.setApiKey("");
420
- //// }
437
+ if (livenessConfig.has("setApiKey")){
438
+ try {
439
+ livenessCustomization.setApiKey(livenessConfig.getString("setApiKey"));
440
+ } catch (JSONException e) {
441
+ e.printStackTrace();
442
+ }
443
+ }else {
444
+ livenessCustomization.setApiKey("");
445
+ }
421
446
  if (livenessConfig.has("setfeedbackDialogMessage")){
422
447
  try {
423
448
  livenessCustomization.feedbackDialogMessage = livenessConfig.getString("setfeedbackDialogMessage");
@@ -34,6 +34,21 @@ class LVController: UIViewController,LivenessData,FacematchData
34
34
  super.viewWillAppear(animated)
35
35
 
36
36
  if isLiveness{
37
+
38
+ // if livenessConfig["setEnableFaceMovement"] != nil {
39
+ // let val = (livenessConfig["setEnableFaceMovement"] as? Bool)!
40
+ // liveness.enableFaceMovement(val)
41
+ // }else{
42
+ // liveness.enableFaceMovement(false)
43
+ // }
44
+
45
+ // if livenessConfig["setEnableOralVerification"] != nil {
46
+ // let val = (livenessConfig["setEnableOralVerification"] as? Bool)!
47
+ // liveness.enableOralVerification(val)
48
+ // }else{
49
+ // liveness.enableOralVerification(false)
50
+ // }
51
+
37
52
 
38
53
  if livenessConfig["backGroundColor"] != nil{
39
54
  liveness.setBackGroundColor(livenessConfig["backGroundColor"] as! String)
@@ -143,7 +158,7 @@ class LVController: UIViewController,LivenessData,FacematchData
143
158
  // 0 for clean face and 100 for Blurry face
144
159
 
145
160
  // Set min and max percentage for glare
146
- liveness.evaluateServerTrustWIthSSLPinning(false)
161
+ // liveness.evaluateServerTrustWIthSSLPinning(false)
147
162
 
148
163
  if isLiveness{
149
164
  isLiveness = false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "accurascan_kyc",
3
- "version": "1.3.7",
3
+ "version": "1.3.8",
4
4
  "description": "Accura Scan",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -57,32 +57,32 @@
57
57
  "@react-native-community/bob": "^0.17.1",
58
58
  "@react-native-community/eslint-config": "^3.0.2",
59
59
  "@release-it/conventional-changelog": "^5.0.0",
60
- "@types/jest": "^29.5.12",
61
- "@types/react": "~18.2.64",
62
- "@types/react-native": "0.73.0",
60
+ "@types/jest": "^28.1.2",
61
+ "@types/react": "~17.0.21",
62
+ "@types/react-native": "0.70.0",
63
63
  "commitlint": "^17.0.2",
64
64
  "del-cli": "^5.0.0",
65
- "eslint": "^8.56.0",
66
- "eslint-config-prettier": "^9.1.0",
67
- "eslint-plugin-prettier": "^5.1.3",
68
- "jest": "^29.7.0",
65
+ "eslint": "^8.4.1",
66
+ "eslint-config-prettier": "^8.5.0",
67
+ "eslint-plugin-prettier": "^4.0.0",
68
+ "jest": "^28.1.1",
69
69
  "pod-install": "^0.1.0",
70
- "prettier": "^3.3.3",
70
+ "prettier": "^2.0.5",
71
71
  "react": "18.2.0",
72
- "react-native": "0.76.9",
72
+ "react-native": "0.71.4",
73
73
  "react-native-builder-bob": "^0.20.0",
74
- "release-it": "^17.10.0",
75
- "typescript": "^5.4.5"
74
+ "release-it": "^15.0.0",
75
+ "typescript": "^4.5.2"
76
76
  },
77
77
  "resolutions": {
78
- "@types/react": "18.2.64"
78
+ "@types/react": "17.0.21"
79
79
  },
80
80
  "peerDependencies": {
81
81
  "react": "*",
82
82
  "react-native": "*"
83
83
  },
84
84
  "engines": {
85
- "node": ">= 16"
85
+ "node": ">= 10.0.0"
86
86
  },
87
87
  "jest": {
88
88
  "preset": "react-native",