accurascan_kyc 1.1.2 → 1.1.4

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.
@@ -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.5"
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"
@@ -78,8 +78,8 @@ android {
78
78
  abi {
79
79
  reset()
80
80
  universalApk false // If true, also generate a universal APK
81
- // include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
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
 
@@ -100,7 +100,7 @@ dependencies {
100
100
  implementation 'androidx.appcompat:appcompat:1.6.0'
101
101
  implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
102
102
  // For Accura OCR SDK
103
- implementation 'com.github.accurascan:AccuraOCR:5.1.0'
103
+ implementation 'com.github.accurascan:AccuraOCR:5.1.5'
104
104
  // For Accura Face match
105
105
  implementation 'com.github.accurascan:AccuraFaceMatch:3.2.0'
106
106
  // for liveness
@@ -2,7 +2,6 @@
2
2
  package="com.accurascankyc">
3
3
 
4
4
  <application>
5
-
6
5
  <activity android:name="com.accurascankyc.ActivityFaceMatch"
7
6
  android:theme="@style/FaceMatchTheme"/>
8
7
 
@@ -100,15 +100,15 @@ public class OcrActivity extends SensorsActivity implements OcrCallback {
100
100
  @Override
101
101
  public void handleMessage(Message msg) {
102
102
  OcrActivity activity = mActivity.get();
103
- // try{
104
- // if(accuraErrorConfg.getInt("enableLogs") == 1){
105
- // AccuraLog.enableLogs(true); // make sure to disable logs in release mode
106
- // AccuraLivenessLog.setDEBUG(true);
107
- // AccuraLog.refreshLogfile(activity);
108
- // }
109
- // } catch (JSONException e) {
110
- // e.printStackTrace();
111
- // }
103
+ try{
104
+ if(accuraErrorConfg.getInt("enableLogs") == 1){
105
+ AccuraLog.enableLogs(true); // make sure to disable logs in release mode
106
+ AccuraLivenessLog.setDEBUG(true);
107
+ AccuraLog.refreshLogfile(activity);
108
+ }
109
+ } catch (JSONException e) {
110
+ e.printStackTrace();
111
+ }
112
112
 
113
113
 
114
114
  if (activity != null) {
@@ -140,14 +140,14 @@ public class OcrActivity extends SensorsActivity implements OcrCallback {
140
140
  public void onCreate(Bundle savedInstanceState) {
141
141
  if (cameraView != null) cameraView.startOcrScan(false);
142
142
 
143
- try{
144
- if(accuraErrorConfg.getInt("enableLogs") == 1){
145
- AccuraLog.enableLogs(true); // make sure to disable logs in release mode
146
- AccuraLog.refreshLogfile(appActivity);
147
- }
148
- } catch (JSONException e) {
149
- e.printStackTrace();
150
- }
143
+ // try{
144
+ // if(accuraErrorConfg.getInt("enableLogs") == 1){
145
+ // AccuraLog.enableLogs(true); // make sure to disable logs in release mode
146
+ // AccuraLog.refreshLogfile(appActivity);
147
+ // }
148
+ // } catch (JSONException e) {
149
+ // e.printStackTrace();
150
+ // }
151
151
 
152
152
  int orientation = getResources().getConfiguration().orientation;
153
153
  if (orientation == 1) {
@@ -107,6 +107,31 @@ public class OcrResultActivity extends Activity implements FaceCallback {
107
107
 
108
108
  }
109
109
  }
110
+ }else{
111
+ String fileDir = getFilesDir().getAbsolutePath();
112
+
113
+ if (result.getLivenessResult() == null) {
114
+ AccurascanKycModule.onResult.invoke("101","Retry...", null);
115
+ finish();
116
+ }else{
117
+ if (result.getLivenessResult().getLivenessStatus()) {
118
+ String lvscore = result.getLivenessResult().getLivenessScore() * 100 + "";
119
+ try {
120
+ results.put("score",lvscore);
121
+ results.put("detect", AccurascanKycModule.getImageUri(result.getFaceBiometrics(), "detect", fileDir));
122
+ } catch (JSONException e) {
123
+ e.printStackTrace();
124
+ }
125
+
126
+ AccurascanKycModule.onResult.invoke(null,results.toString());
127
+ finish();
128
+ // Bitmap face2 = sface = result.getFaceBiometrics();
129
+ // Glide.with(OcrResultActivity.this).load(face2).centerCrop().into(ivUserProfile2);
130
+ }else{
131
+ AccurascanKycModule.onResult.invoke("102","Retry...", null);
132
+ finish();
133
+ }
134
+ }
110
135
  }
111
136
  }
112
137
  }
@@ -144,32 +169,32 @@ public class OcrResultActivity extends Activity implements FaceCallback {
144
169
  if (requestCode == 201 && data != null) {
145
170
  AccuraVerificationResult result = data.getParcelableExtra("Accura.liveness");
146
171
  if (result == null) {
147
- AccurascanKycModule.onResult.invoke("101","Retry...", null);
172
+ AccurascanKycModule.onResult.invoke("103","Retry...", null);
148
173
  this.finish();
149
174
  }
150
175
  if (result.getStatus().equals("1")) {
151
176
  handleVerificationSuccessResult(result);
152
177
  } else {
153
178
  Toast.makeText(this, result.getErrorMessage(), Toast.LENGTH_SHORT).show();
154
- AccurascanKycModule.onResult.invoke("101",result.getErrorMessage(), null);
179
+ AccurascanKycModule.onResult.invoke("104",result.getErrorMessage(), null);
155
180
  finish();
156
181
  }
157
182
  } else if (requestCode == 102 && data != null) {
158
183
  AccuraFMCameraModel result = data.getParcelableExtra("Accura.fm");
159
184
  if (result == null) {
160
- AccurascanKycModule.onResult.invoke("101","Retry...", null);
185
+ AccurascanKycModule.onResult.invoke("105","Retry...", null);
161
186
  this.finish();
162
187
  }
163
188
  if (result.getStatus().equals("1")) {
164
189
  handleVerificationSuccessResult(result);
165
190
  } else {
166
191
  Toast.makeText(this,"Retry..." , Toast.LENGTH_SHORT).show();
167
- AccurascanKycModule.onResult.invoke("101","Retry...", null);
192
+ AccurascanKycModule.onResult.invoke("106","Retry...", null);
168
193
  this.finish();
169
194
  }
170
195
  } else{
171
196
  Toast.makeText(this,"Retry..." , Toast.LENGTH_SHORT).show();
172
- AccurascanKycModule.onResult.invoke("101","Retry...", null);
197
+ AccurascanKycModule.onResult.invoke("107","Retry...", null);
173
198
  this.finish();
174
199
  }
175
200
  }
@@ -2,7 +2,8 @@ import UIKit
2
2
  import AccuraOCR
3
3
  import Photos
4
4
  import PhotosUI
5
- import SVProgressHUD
5
+ //import SVProgressHUD
6
+ import ProgressHUD
6
7
 
7
8
  //View controller for face match.
8
9
  class FMController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate,PHPickerViewControllerDelegate, UIAdaptivePresentationControllerDelegate {
@@ -377,7 +378,8 @@ class FMController: UIViewController, UIImagePickerControllerDelegate, UINavigat
377
378
 
378
379
 
379
380
  dismiss(animated: true, completion: nil)
380
- SVProgressHUD.show(withStatus: "Loading...")
381
+ ProgressHUD.show("Loading...")
382
+ // SVProgressHUD.show(withStatus: "Loading...")
381
383
  DispatchQueue.global(qos: .background).async {
382
384
  guard var originalImage = info[convertFromUIImagePickerControllerInfoKey(UIImagePickerController.InfoKey.originalImage)] as? UIImage else { return }
383
385
 
@@ -389,7 +391,8 @@ class FMController: UIViewController, UIImagePickerControllerDelegate, UINavigat
389
391
  // let compressData = UIImage(data: originalImage.jpegData(compressionQuality: 1.0)!)
390
392
  DispatchQueue.main.asyncAfter(deadline: .now(), execute: {
391
393
  // self.setFaceRegion(compressData!)//Set FaceMatch score
392
- SVProgressHUD.dismiss()
394
+ // SVProgressHUD.dismiss()
395
+ ProgressHUD.dismiss()
393
396
  })
394
397
  }
395
398
 
@@ -417,7 +420,9 @@ class FMController: UIViewController, UIImagePickerControllerDelegate, UINavigat
417
420
  lvfm.face1Detect = EngineWrapper.detectSourceFaces(compressData)
418
421
 
419
422
  // self.setFaceRegion(compressData!)//Set FaceMatch score
420
- SVProgressHUD.dismiss()
423
+ // SVProgressHUD.dismiss()
424
+ ProgressHUD.dismiss()
425
+
421
426
  var result:[String:Any] = [:]
422
427
  result["Image"] = compressData
423
428
  if result.index(forKey: "Image") != nil {
@@ -470,7 +475,8 @@ class FMController: UIViewController, UIImagePickerControllerDelegate, UINavigat
470
475
 
471
476
 
472
477
  func facematchData(_ FaceImage: UIImage!) {
473
- SVProgressHUD.show(withStatus: "Loading...")
478
+ // SVProgressHUD.show(withStatus: "Loading...")
479
+ ProgressHUD.show("Loading...")
474
480
  DispatchQueue.global(qos: .background).async { [self] in
475
481
  var originalImage = FaceImage
476
482
 
@@ -482,7 +488,9 @@ class FMController: UIViewController, UIImagePickerControllerDelegate, UINavigat
482
488
  // DispatchQueue.main.asyncAfter(deadline: .now(), execute: { [self] in
483
489
  // self.setFaceRegion(compressData!)//Set FaceMatch score
484
490
  // gl.face1Detect = EngineWrapper.detectSourceFaces(compressData)
485
- SVProgressHUD.dismiss()
491
+ // SVProgressHUD.dismiss()
492
+ ProgressHUD.dismiss()
493
+
486
494
  // })
487
495
  let img1 = AccurascanKyc.getImageUri(img: compressData!, name: nil)
488
496
  result["Image"] = img1
@@ -322,7 +322,10 @@ class LVController: UIViewController,LivenessData,FacematchData
322
322
  closeMe()
323
323
  }
324
324
  }else{
325
- callBack!(["Failed to get liveness. Please try again", NSNull()])
325
+ results["detect"] = AccurascanKyc.getImageUri(img: livenessImage, name: nil)
326
+ results["score"] = stLivenessValue.replacingOccurrences(of: " %", with: "")
327
+ self.callBack!([NSNull(),AccurascanKyc.convertJSONString(results:results)])
328
+ // callBack!(["Failed to get liveness. Please try again", NSNull()])
326
329
  EngineWrapper.faceEngineClose()
327
330
  closeMe()
328
331
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "accurascan_kyc",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "test",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",