uqudosdk-cordova 3.6.1 → 3.7.0-patch.1
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/CHANGELOG.md +15 -0
- package/package.json +1 -1
- package/plugin.xml +2 -2
- package/src/android/UqudoIdPlugin.java +161 -117
- package/src/android/uqudo-sdk.gradle +1 -1
- package/.idea/caches/deviceStreaming.xml +0 -860
- package/.idea/git_toolbox_blame.xml +0 -6
- package/.idea/git_toolbox_prj.xml +0 -15
- package/.idea/material_theme_project_new.xml +0 -12
- package/.idea/misc.xml +0 -5
- package/.idea/modules.xml +0 -8
- package/.idea/vcs.xml +0 -6
- package/uqudosdk-cordova.iml +0 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
## 3.7.0-patch.1
|
|
2
|
+
|
|
3
|
+
* Resolved possible race condition that triggers a CalledFromWrongThreadException on UI and theme updates
|
|
4
|
+
|
|
5
|
+
## 3.7.0
|
|
6
|
+
|
|
7
|
+
* Introduced a new SDK feature that performs device attestation and returns the result within the SDK result object. The Device Attestation output must be actively parsed and evaluated in your backend as part of your core business logic. Each flag should be assessed based on your specific risk model and use case. While some attributes may require contextual evaluation depending on your fraud strategy and internal policies, others should be treated as immediate high-risk indicators. Please see "Device Attestation" for more details.
|
|
8
|
+
Please note that this feature is automatically enabled for new customers. Existing customers must request activation.
|
|
9
|
+
* Added NFC support for the latest version of the Bahrain ID card.
|
|
10
|
+
|
|
11
|
+
## 3.6.2
|
|
12
|
+
|
|
13
|
+
* Added support for the latest version of the Omani ID for both citizens and residents.
|
|
14
|
+
* Fixed an issue on iOS 26.2 and later where activating the torch could cause the screen to freeze.
|
|
15
|
+
|
|
1
16
|
## 3.6.1
|
|
2
17
|
|
|
3
18
|
* Android SDK
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "uqudosdk-cordova",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.7.0-patch.1",
|
|
4
4
|
"description": "Plugin to link native Android and iOS SDK with the ionic application. Using this plugin, ionic apps can now use the Uqudo SDK for enrollment, account recovery and face recognition",
|
|
5
5
|
"cordova": {
|
|
6
6
|
"id": "uqudosdk-cordova",
|
package/plugin.xml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" id="uqudosdk-cordova" version="3.
|
|
2
|
+
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" id="uqudosdk-cordova" version="3.7.0-patch.1">
|
|
3
3
|
<name>UqudoIdPlugin</name>
|
|
4
4
|
<js-module name="UqudoIdPlugin" src="www/UqudoIdPlugin.js">
|
|
5
5
|
<clobbers target="cordova.plugins.UqudoIdPlugin" />
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
<podspec>
|
|
26
26
|
<config/>
|
|
27
27
|
<pods use-frameworks="true">
|
|
28
|
-
<pod name="UqudoSDK" spec="3.
|
|
28
|
+
<pod name="UqudoSDK" spec="3.7.0" />
|
|
29
29
|
</pods>
|
|
30
30
|
</podspec>
|
|
31
31
|
<podspec>
|
|
@@ -64,6 +64,7 @@ public class UqudoIdPlugin extends CordovaPlugin {
|
|
|
64
64
|
return true;
|
|
65
65
|
case "setLocale":
|
|
66
66
|
setLocale(args.getString(0), context);
|
|
67
|
+
return true;
|
|
67
68
|
case "enroll": {
|
|
68
69
|
callback = callbackContext;
|
|
69
70
|
String message = args.getString(0);
|
|
@@ -159,18 +160,7 @@ public class UqudoIdPlugin extends CordovaPlugin {
|
|
|
159
160
|
}
|
|
160
161
|
|
|
161
162
|
private void setLocale(String locale, Context context) {
|
|
162
|
-
|
|
163
|
-
try {
|
|
164
|
-
if (locale != null) {
|
|
165
|
-
Locale myLocale = new Locale(locale);
|
|
166
|
-
Resources res = context.getResources();
|
|
167
|
-
Configuration conf = res.getConfiguration();
|
|
168
|
-
conf.locale = myLocale;
|
|
169
|
-
res.updateConfiguration(conf, res.getDisplayMetrics());
|
|
170
|
-
}
|
|
171
|
-
} catch (Exception e) {
|
|
172
|
-
Log.e("UqudoPlugin", e.getMessage(), e);
|
|
173
|
-
}
|
|
163
|
+
UqudoSDK.setLocale(context, locale);
|
|
174
164
|
}
|
|
175
165
|
|
|
176
166
|
private void enroll(String message, Context context) {
|
|
@@ -220,12 +210,12 @@ public class UqudoIdPlugin extends CordovaPlugin {
|
|
|
220
210
|
if (faceObject.has("allowClosedEyes") && faceObject.getBoolean("allowClosedEyes")) {
|
|
221
211
|
faceBuilder.allowClosedEyes();
|
|
222
212
|
}
|
|
223
|
-
if (faceObject.has("obfuscationType")){
|
|
224
|
-
if (faceObject.getString("obfuscationType").equals("FILLED")){
|
|
213
|
+
if (faceObject.has("obfuscationType")) {
|
|
214
|
+
if (faceObject.getString("obfuscationType").equals("FILLED")) {
|
|
225
215
|
faceBuilder.enableAuditTrailImageObfuscation(ObfuscationType.FILLED);
|
|
226
|
-
} else if (faceObject.getString("obfuscationType").equals("BLURRED")){
|
|
216
|
+
} else if (faceObject.getString("obfuscationType").equals("BLURRED")) {
|
|
227
217
|
faceBuilder.enableAuditTrailImageObfuscation(ObfuscationType.BLURRED);
|
|
228
|
-
} else if (faceObject.getString("obfuscationType").equals("FILLED_WHITE")){
|
|
218
|
+
} else if (faceObject.getString("obfuscationType").equals("FILLED_WHITE")) {
|
|
229
219
|
faceBuilder.enableAuditTrailImageObfuscation(ObfuscationType.FILLED_WHITE);
|
|
230
220
|
}
|
|
231
221
|
}
|
|
@@ -233,7 +223,7 @@ public class UqudoIdPlugin extends CordovaPlugin {
|
|
|
233
223
|
if (faceObject.has("isOneToNVerificationEnabled") && faceObject.getBoolean("isOneToNVerificationEnabled")) {
|
|
234
224
|
faceBuilder.enableOneToNVerification();
|
|
235
225
|
}
|
|
236
|
-
|
|
226
|
+
|
|
237
227
|
if (faceObject.has("enableActiveLiveness") && faceObject.getBoolean("enableActiveLiveness")) {
|
|
238
228
|
LivenessGesture disableGesture = null;
|
|
239
229
|
if (faceObject.has("disableLivenessGesture")) {
|
|
@@ -345,20 +335,30 @@ public class UqudoIdPlugin extends CordovaPlugin {
|
|
|
345
335
|
Document document = documentBuilder.build();
|
|
346
336
|
enrollment.add(document);
|
|
347
337
|
}
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
338
|
+
this.cordova.getActivity().runOnUiThread(new Runnable() {
|
|
339
|
+
@Override
|
|
340
|
+
public void run() {
|
|
341
|
+
try {
|
|
342
|
+
if (json.has("appearanceMode")) {
|
|
343
|
+
if ("LIGHT".equals(json.getString("appearanceMode"))) {
|
|
344
|
+
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
|
|
345
|
+
} else if ("DARK".equals(json.getString("appearanceMode"))) {
|
|
346
|
+
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
|
347
|
+
} else if ("SYSTEM".equals(json.getString("appearanceMode"))) {
|
|
348
|
+
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
|
|
349
|
+
}
|
|
350
|
+
} else {
|
|
351
|
+
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
|
|
352
|
+
}
|
|
353
|
+
Intent intent = enrollment.build(context);
|
|
354
|
+
UqudoIdPlugin.this.cordova.setActivityResultCallback(UqudoIdPlugin.this);
|
|
355
|
+
UqudoIdPlugin.this.cordova.startActivityForResult(UqudoIdPlugin.this, intent, REQUEST_CODE_ENROLLMENT);
|
|
356
|
+
} catch (Exception e) {
|
|
357
|
+
Log.d("UqudoPlugin", e.getMessage(), e);
|
|
358
|
+
sendError(SessionStatusCode.UNEXPECTED_ERROR.name(), e.getMessage(), null);
|
|
359
|
+
}
|
|
355
360
|
}
|
|
356
|
-
}
|
|
357
|
-
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
|
|
358
|
-
}
|
|
359
|
-
Intent intent = enrollment.build(context);
|
|
360
|
-
cordova.setActivityResultCallback(this);
|
|
361
|
-
cordova.startActivityForResult(this, intent, REQUEST_CODE_ENROLLMENT);
|
|
361
|
+
});
|
|
362
362
|
} catch (Exception e) {
|
|
363
363
|
Log.d("UqudoPlugin", e.getMessage(), e);
|
|
364
364
|
sendError(SessionStatusCode.UNEXPECTED_ERROR.name(), e.getMessage(), null);
|
|
@@ -392,25 +392,35 @@ public class UqudoIdPlugin extends CordovaPlugin {
|
|
|
392
392
|
}
|
|
393
393
|
if (json.has("allowClosedEyes") && json.getBoolean("allowClosedEyes")) {
|
|
394
394
|
recovery.allowClosedEyes();
|
|
395
|
-
|
|
395
|
+
}
|
|
396
396
|
|
|
397
397
|
if (json.has("isReturnDataForIncompleteSession") && json.getBoolean("isReturnDataForIncompleteSession")) {
|
|
398
398
|
recovery.returnDataForIncompleteSession();
|
|
399
399
|
}
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
400
|
+
this.cordova.getActivity().runOnUiThread(new Runnable() {
|
|
401
|
+
@Override
|
|
402
|
+
public void run() {
|
|
403
|
+
try {
|
|
404
|
+
if (json.has("appearanceMode")) {
|
|
405
|
+
if ("LIGHT".equals(json.getString("appearanceMode"))) {
|
|
406
|
+
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
|
|
407
|
+
} else if ("DARK".equals(json.getString("appearanceMode"))) {
|
|
408
|
+
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
|
409
|
+
} else if ("SYSTEM".equals(json.getString("appearanceMode"))) {
|
|
410
|
+
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
|
|
411
|
+
}
|
|
412
|
+
} else {
|
|
413
|
+
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
|
|
414
|
+
}
|
|
415
|
+
Intent intent = recovery.build(context);
|
|
416
|
+
UqudoIdPlugin.this.cordova.setActivityResultCallback(UqudoIdPlugin.this);
|
|
417
|
+
UqudoIdPlugin.this.cordova.startActivityForResult(UqudoIdPlugin.this, intent, REQUEST_CODE_ACCOUNT_RECOVERY);
|
|
418
|
+
} catch (Exception e) {
|
|
419
|
+
Log.d("UqudoPlugin", e.getMessage(), e);
|
|
420
|
+
sendError(SessionStatusCode.UNEXPECTED_ERROR.name(), e.getMessage(), null);
|
|
421
|
+
}
|
|
407
422
|
}
|
|
408
|
-
}
|
|
409
|
-
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
|
|
410
|
-
}
|
|
411
|
-
Intent intent = recovery.build(context);
|
|
412
|
-
cordova.setActivityResultCallback(this);
|
|
413
|
-
cordova.startActivityForResult(this, intent, REQUEST_CODE_ACCOUNT_RECOVERY);
|
|
423
|
+
});
|
|
414
424
|
} catch (Exception e) {
|
|
415
425
|
Log.d("UqudoPlugin", e.getMessage(), e);
|
|
416
426
|
sendError(SessionStatusCode.UNEXPECTED_ERROR.name(), e.getMessage(), null);
|
|
@@ -447,16 +457,16 @@ public class UqudoIdPlugin extends CordovaPlugin {
|
|
|
447
457
|
}
|
|
448
458
|
if (json.has("allowClosedEyes") && json.getBoolean("allowClosedEyes")) {
|
|
449
459
|
faceSessionBuilder.allowClosedEyes();
|
|
450
|
-
|
|
460
|
+
}
|
|
451
461
|
if (json.has("isReturnDataForIncompleteSession") && json.getBoolean("isReturnDataForIncompleteSession")) {
|
|
452
462
|
faceSessionBuilder.returnDataForIncompleteSession();
|
|
453
463
|
}
|
|
454
|
-
if (json.has("obfuscationType")){
|
|
455
|
-
if (json.getString("obfuscationType").equals("FILLED")){
|
|
464
|
+
if (json.has("obfuscationType")) {
|
|
465
|
+
if (json.getString("obfuscationType").equals("FILLED")) {
|
|
456
466
|
faceSessionBuilder.enableAuditTrailImageObfuscation(ObfuscationType.FILLED);
|
|
457
|
-
} else if (json.getString("obfuscationType").equals("BLURRED")){
|
|
467
|
+
} else if (json.getString("obfuscationType").equals("BLURRED")) {
|
|
458
468
|
faceSessionBuilder.enableAuditTrailImageObfuscation(ObfuscationType.BLURRED);
|
|
459
|
-
} else if (json.getString("obfuscationType").equals("FILLED_WHITE")){
|
|
469
|
+
} else if (json.getString("obfuscationType").equals("FILLED_WHITE")) {
|
|
460
470
|
faceSessionBuilder.enableAuditTrailImageObfuscation(ObfuscationType.FILLED_WHITE);
|
|
461
471
|
}
|
|
462
472
|
}
|
|
@@ -469,21 +479,32 @@ public class UqudoIdPlugin extends CordovaPlugin {
|
|
|
469
479
|
}
|
|
470
480
|
}
|
|
471
481
|
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
482
|
+
this.cordova.getActivity().runOnUiThread(new Runnable() {
|
|
483
|
+
@Override
|
|
484
|
+
public void run() {
|
|
485
|
+
try {
|
|
486
|
+
if (json.has("appearanceMode")) {
|
|
487
|
+
if ("LIGHT".equals(json.getString("appearanceMode"))) {
|
|
488
|
+
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
|
|
489
|
+
} else if ("DARK".equals(json.getString("appearanceMode"))) {
|
|
490
|
+
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
|
491
|
+
} else if ("SYSTEM".equals(json.getString("appearanceMode"))) {
|
|
492
|
+
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
|
|
493
|
+
}
|
|
494
|
+
} else {
|
|
495
|
+
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
Intent intent = faceSessionBuilder.build(context);
|
|
499
|
+
UqudoIdPlugin.this.cordova.setActivityResultCallback(UqudoIdPlugin.this);
|
|
500
|
+
UqudoIdPlugin.this.cordova.startActivityForResult(UqudoIdPlugin.this, intent, REQUEST_CODE_FACE_SESSION);
|
|
501
|
+
} catch (Exception e) {
|
|
502
|
+
Log.d("UqudoPlugin", e.getMessage(), e);
|
|
503
|
+
sendError(SessionStatusCode.UNEXPECTED_ERROR.name(), e.getMessage(), null);
|
|
504
|
+
}
|
|
479
505
|
}
|
|
480
|
-
}
|
|
481
|
-
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
|
|
482
|
-
}
|
|
506
|
+
});
|
|
483
507
|
|
|
484
|
-
Intent intent = faceSessionBuilder.build(context);
|
|
485
|
-
cordova.setActivityResultCallback(this);
|
|
486
|
-
cordova.startActivityForResult(this, intent, REQUEST_CODE_FACE_SESSION);
|
|
487
508
|
} catch (Exception e) {
|
|
488
509
|
Log.d("UqudoPlugin", e.getMessage(), e);
|
|
489
510
|
sendError(SessionStatusCode.UNEXPECTED_ERROR.name(), e.getMessage(), null);
|
|
@@ -529,19 +550,19 @@ public class UqudoIdPlugin extends CordovaPlugin {
|
|
|
529
550
|
if (faceObject.has("allowClosedEyes") && faceObject.getBoolean("allowClosedEyes")) {
|
|
530
551
|
faceBuilder.allowClosedEyes();
|
|
531
552
|
}
|
|
532
|
-
if (faceObject.has("obfuscationType")){
|
|
533
|
-
if (faceObject.getString("obfuscationType").equals("FILLED")){
|
|
553
|
+
if (faceObject.has("obfuscationType")) {
|
|
554
|
+
if (faceObject.getString("obfuscationType").equals("FILLED")) {
|
|
534
555
|
faceBuilder.enableAuditTrailImageObfuscation(ObfuscationType.FILLED);
|
|
535
|
-
} else if (faceObject.getString("obfuscationType").equals("BLURRED")){
|
|
556
|
+
} else if (faceObject.getString("obfuscationType").equals("BLURRED")) {
|
|
536
557
|
faceBuilder.enableAuditTrailImageObfuscation(ObfuscationType.BLURRED);
|
|
537
|
-
} else if (faceObject.getString("obfuscationType").equals("FILLED_WHITE")){
|
|
558
|
+
} else if (faceObject.getString("obfuscationType").equals("FILLED_WHITE")) {
|
|
538
559
|
faceBuilder.enableAuditTrailImageObfuscation(ObfuscationType.FILLED_WHITE);
|
|
539
560
|
}
|
|
540
561
|
}
|
|
541
562
|
if (faceObject.has("isOneToNVerificationEnabled") && faceObject.getBoolean("isOneToNVerificationEnabled")) {
|
|
542
563
|
faceBuilder.enableOneToNVerification();
|
|
543
564
|
}
|
|
544
|
-
|
|
565
|
+
|
|
545
566
|
if (faceObject.has("enableActiveLiveness") && faceObject.getBoolean("enableActiveLiveness")) {
|
|
546
567
|
LivenessGesture disableGesture = null;
|
|
547
568
|
if (faceObject.has("disableLivenessGesture")) {
|
|
@@ -582,20 +603,32 @@ public class UqudoIdPlugin extends CordovaPlugin {
|
|
|
582
603
|
}
|
|
583
604
|
lookup.setToken(json.getString("authorizationToken"));
|
|
584
605
|
lookup.setDocumentType(DocumentType.valueOf(json.getString("documentType")));
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
606
|
+
|
|
607
|
+
this.cordova.getActivity().runOnUiThread(new Runnable() {
|
|
608
|
+
@Override
|
|
609
|
+
public void run() {
|
|
610
|
+
try {
|
|
611
|
+
if (json.has("appearanceMode")) {
|
|
612
|
+
if ("LIGHT".equals(json.getString("appearanceMode"))) {
|
|
613
|
+
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
|
|
614
|
+
} else if ("DARK".equals(json.getString("appearanceMode"))) {
|
|
615
|
+
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
|
616
|
+
} else if ("SYSTEM".equals(json.getString("appearanceMode"))) {
|
|
617
|
+
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
|
|
618
|
+
}
|
|
619
|
+
} else {
|
|
620
|
+
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
|
|
621
|
+
}
|
|
622
|
+
Intent intent = lookup.build(context);
|
|
623
|
+
UqudoIdPlugin.this.cordova.setActivityResultCallback(UqudoIdPlugin.this);
|
|
624
|
+
UqudoIdPlugin.this.cordova.startActivityForResult(UqudoIdPlugin.this, intent, REQUEST_CODE_LOOKUP);
|
|
625
|
+
} catch (Exception e) {
|
|
626
|
+
Log.d("UqudoPlugin", e.getMessage(), e);
|
|
627
|
+
sendError(SessionStatusCode.UNEXPECTED_ERROR.name(), e.getMessage(), null);
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
});
|
|
631
|
+
|
|
599
632
|
} catch (Exception e) {
|
|
600
633
|
Log.d("UqudoPlugin", e.getMessage(), e);
|
|
601
634
|
sendError(SessionStatusCode.UNEXPECTED_ERROR.name(), e.getMessage(), null);
|
|
@@ -610,7 +643,7 @@ public class UqudoIdPlugin extends CordovaPlugin {
|
|
|
610
643
|
super.onActivityResult(requestCode, resultCode, data);
|
|
611
644
|
|
|
612
645
|
if (requestCode == REQUEST_CODE_ENROLLMENT || requestCode == REQUEST_CODE_ACCOUNT_RECOVERY
|
|
613
|
-
|
|
646
|
+
|| requestCode == REQUEST_CODE_FACE_SESSION || requestCode == REQUEST_CODE_LOOKUP) {
|
|
614
647
|
if (resultCode == Activity.RESULT_OK) {
|
|
615
648
|
PluginResult result = new PluginResult(PluginResult.Status.OK, data.getStringExtra("data"));
|
|
616
649
|
result.setKeepCallback(true);
|
|
@@ -631,51 +664,51 @@ public class UqudoIdPlugin extends CordovaPlugin {
|
|
|
631
664
|
try {
|
|
632
665
|
JSONObject json = new JSONObject(message);
|
|
633
666
|
UqudoBuilder.Reading readingBuilder = new UqudoBuilder.Reading();
|
|
634
|
-
|
|
667
|
+
|
|
635
668
|
if (json.has("authorizationToken")) {
|
|
636
669
|
readingBuilder.setToken(json.getString("authorizationToken"));
|
|
637
670
|
}
|
|
638
|
-
|
|
671
|
+
|
|
639
672
|
if (json.has("sessionId")) {
|
|
640
673
|
readingBuilder.setSessionId(json.getString("sessionId"));
|
|
641
674
|
}
|
|
642
|
-
|
|
675
|
+
|
|
643
676
|
if (json.has("userIdentifier")) {
|
|
644
677
|
readingBuilder.setUserIdentifier(UUID.fromString(json.getString("userIdentifier")));
|
|
645
678
|
}
|
|
646
|
-
|
|
679
|
+
|
|
647
680
|
if (json.has("nonce")) {
|
|
648
681
|
readingBuilder.setNonce(json.getString("nonce"));
|
|
649
682
|
}
|
|
650
|
-
|
|
683
|
+
|
|
651
684
|
if (json.has("documentType")) {
|
|
652
685
|
readingBuilder.setDocumentType(DocumentType.valueOf(json.getString("documentType")));
|
|
653
686
|
}
|
|
654
|
-
|
|
687
|
+
|
|
655
688
|
if (json.has("documentNumber")) {
|
|
656
689
|
readingBuilder.setDocumentNumber(json.getString("documentNumber"));
|
|
657
690
|
}
|
|
658
|
-
|
|
691
|
+
|
|
659
692
|
if (json.has("dateOfBirth")) {
|
|
660
693
|
readingBuilder.setDateOfBirth(json.getString("dateOfBirth"));
|
|
661
694
|
}
|
|
662
|
-
|
|
695
|
+
|
|
663
696
|
if (json.has("dateOfExpiry")) {
|
|
664
697
|
readingBuilder.setDateOfExpiry(json.getString("dateOfExpiry"));
|
|
665
698
|
}
|
|
666
|
-
|
|
699
|
+
|
|
667
700
|
if (json.has("mrz")) {
|
|
668
701
|
readingBuilder.setMRZ(json.getString("mrz"));
|
|
669
702
|
}
|
|
670
|
-
|
|
703
|
+
|
|
671
704
|
if (json.has("isReturnDataForIncompleteSession") && json.getBoolean("isReturnDataForIncompleteSession")) {
|
|
672
705
|
readingBuilder.returnDataForIncompleteSession();
|
|
673
706
|
}
|
|
674
|
-
|
|
707
|
+
|
|
675
708
|
if (json.has("isSecuredWindowsDisabled") && json.getBoolean("isSecuredWindowsDisabled")) {
|
|
676
709
|
readingBuilder.disableSecureWindow();
|
|
677
710
|
}
|
|
678
|
-
|
|
711
|
+
|
|
679
712
|
if (json.has("facialRecognitionSpecification")) {
|
|
680
713
|
FacialRecognitionConfigurationBuilder faceBuilder = new FacialRecognitionConfigurationBuilder();
|
|
681
714
|
JSONObject faceObject = json.getJSONObject("facialRecognitionSpecification");
|
|
@@ -697,12 +730,12 @@ public class UqudoIdPlugin extends CordovaPlugin {
|
|
|
697
730
|
if (faceObject.has("allowClosedEyes") && faceObject.getBoolean("allowClosedEyes")) {
|
|
698
731
|
faceBuilder.allowClosedEyes();
|
|
699
732
|
}
|
|
700
|
-
if (faceObject.has("obfuscationType")){
|
|
701
|
-
if (faceObject.getString("obfuscationType").equals("FILLED")){
|
|
733
|
+
if (faceObject.has("obfuscationType")) {
|
|
734
|
+
if (faceObject.getString("obfuscationType").equals("FILLED")) {
|
|
702
735
|
faceBuilder.enableAuditTrailImageObfuscation(ObfuscationType.FILLED);
|
|
703
|
-
} else if (faceObject.getString("obfuscationType").equals("BLURRED")){
|
|
736
|
+
} else if (faceObject.getString("obfuscationType").equals("BLURRED")) {
|
|
704
737
|
faceBuilder.enableAuditTrailImageObfuscation(ObfuscationType.BLURRED);
|
|
705
|
-
} else if (faceObject.getString("obfuscationType").equals("FILLED_WHITE")){
|
|
738
|
+
} else if (faceObject.getString("obfuscationType").equals("FILLED_WHITE")) {
|
|
706
739
|
faceBuilder.enableAuditTrailImageObfuscation(ObfuscationType.FILLED_WHITE);
|
|
707
740
|
}
|
|
708
741
|
}
|
|
@@ -710,7 +743,7 @@ public class UqudoIdPlugin extends CordovaPlugin {
|
|
|
710
743
|
if (faceObject.has("isOneToNVerificationEnabled") && faceObject.getBoolean("isOneToNVerificationEnabled")) {
|
|
711
744
|
faceBuilder.enableOneToNVerification();
|
|
712
745
|
}
|
|
713
|
-
|
|
746
|
+
|
|
714
747
|
if (faceObject.has("enableActiveLiveness") && faceObject.getBoolean("enableActiveLiveness")) {
|
|
715
748
|
LivenessGesture disableGesture = null;
|
|
716
749
|
if (faceObject.has("disableLivenessGesture")) {
|
|
@@ -732,7 +765,7 @@ public class UqudoIdPlugin extends CordovaPlugin {
|
|
|
732
765
|
|
|
733
766
|
readingBuilder.enableFacialRecognition(faceBuilder.build());
|
|
734
767
|
}
|
|
735
|
-
|
|
768
|
+
|
|
736
769
|
if (json.has("backgroundCheckConfiguration")) {
|
|
737
770
|
BackgroundCheckConfigurationBuilder backgroundCheckConfigurationBuilder = new BackgroundCheckConfigurationBuilder();
|
|
738
771
|
JSONObject backgroundObject = json.getJSONObject("backgroundCheckConfiguration");
|
|
@@ -750,26 +783,37 @@ public class UqudoIdPlugin extends CordovaPlugin {
|
|
|
750
783
|
}
|
|
751
784
|
readingBuilder.enableBackgroundCheck(backgroundCheckConfigurationBuilder.build());
|
|
752
785
|
}
|
|
753
|
-
|
|
786
|
+
|
|
754
787
|
if (json.has("isLookupEnabled") && json.getBoolean("isLookupEnabled")) {
|
|
755
788
|
readingBuilder.enableLookup();
|
|
756
789
|
}
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
790
|
+
|
|
791
|
+
this.cordova.getActivity().runOnUiThread(new Runnable() {
|
|
792
|
+
@Override
|
|
793
|
+
public void run() {
|
|
794
|
+
try {
|
|
795
|
+
if (json.has("appearanceMode")) {
|
|
796
|
+
if ("LIGHT".equals(json.getString("appearanceMode"))) {
|
|
797
|
+
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
|
|
798
|
+
} else if ("DARK".equals(json.getString("appearanceMode"))) {
|
|
799
|
+
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
|
800
|
+
} else if ("SYSTEM".equals(json.getString("appearanceMode"))) {
|
|
801
|
+
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
|
|
802
|
+
}
|
|
803
|
+
} else {
|
|
804
|
+
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
Intent intent = readingBuilder.build(context);
|
|
808
|
+
UqudoIdPlugin.this.cordova.setActivityResultCallback(UqudoIdPlugin.this);
|
|
809
|
+
UqudoIdPlugin.this.cordova.startActivityForResult(UqudoIdPlugin.this, intent, REQUEST_CODE_READING);
|
|
810
|
+
} catch (Exception e) {
|
|
811
|
+
Log.d("UqudoPlugin", e.getMessage(), e);
|
|
812
|
+
sendError(SessionStatusCode.UNEXPECTED_ERROR.name(), e.getMessage(), null);
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
});
|
|
816
|
+
|
|
773
817
|
} catch (Exception e) {
|
|
774
818
|
Log.e("UqudoIdPlugin", e.getMessage(), e);
|
|
775
819
|
sendError(SessionStatusCode.UNEXPECTED_ERROR.name(), e.getMessage(), null);
|