@regulaforensics/cordova-plugin-document-reader-api 5.7.0 → 5.8.0
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/example/package.json +6 -4
- package/example/www/index.html +6 -1
- package/example/www/js/index.js +40 -6
- package/package.json +1 -1
- package/plugin.xml +2 -2
- package/src/android/DocumentReader.java +49 -14
- package/src/android/Helpers.java +7 -0
- package/src/android/RegulaConfig.java +69 -9
- package/src/android/build.gradle +11 -11
- package/src/ios/RGLDocumentReader.m +17 -3
- package/src/ios/RegulaConfig.h +2 -0
- package/src/ios/RegulaConfig.m +116 -31
- package/www/DocumentReader.js +11 -0
package/example/package.json
CHANGED
|
@@ -16,11 +16,12 @@
|
|
|
16
16
|
"cordova-android": "^9.0.0",
|
|
17
17
|
"cordova-ios": "^6.1.1",
|
|
18
18
|
"cordova-plugin-add-swift-support": "^2.0.2",
|
|
19
|
-
"@regulaforensics/cordova-plugin-document-reader-api": "^5.
|
|
20
|
-
"@regulaforensics/cordova-plugin-document-reader-core-fullrfid": "^5.
|
|
19
|
+
"@regulaforensics/cordova-plugin-document-reader-api": "^5.8.0",
|
|
20
|
+
"@regulaforensics/cordova-plugin-document-reader-core-fullrfid": "^5.8.0",
|
|
21
21
|
"cordova-plugin-file": "^6.0.2",
|
|
22
22
|
"cordova-plugin-image-picker": "^1.1.3",
|
|
23
|
-
"cordova-plugin-android-permissions": "1.1.0"
|
|
23
|
+
"cordova-plugin-android-permissions": "1.1.0",
|
|
24
|
+
"cordova-plugin-advanced-http": "3.2.1"
|
|
24
25
|
},
|
|
25
26
|
"cordova": {
|
|
26
27
|
"plugins": {
|
|
@@ -34,7 +35,8 @@
|
|
|
34
35
|
"PHOTO_LIBRARY_USAGE_DESCRIPTION": " "
|
|
35
36
|
},
|
|
36
37
|
"cordova-plugin-whitelist": {},
|
|
37
|
-
"cordova-plugin-android-permissions": {}
|
|
38
|
+
"cordova-plugin-android-permissions": {},
|
|
39
|
+
"cordova-plugin-advanced-http": {}
|
|
38
40
|
},
|
|
39
41
|
"platforms": [
|
|
40
42
|
"android",
|
package/example/www/index.html
CHANGED
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
|
|
44
44
|
<div>
|
|
45
45
|
<div id="scenariosRadioGroup"
|
|
46
|
-
style="position: absolute; bottom:
|
|
46
|
+
style="position: absolute; bottom: 140px; top: 225px; left: 75px; width:225px; padding: 5px; text-align:left; overflow: auto"/>
|
|
47
47
|
</div>
|
|
48
48
|
|
|
49
49
|
<div style="position: absolute; bottom: 10px; width: 100%; text-align: center; align-items: center">
|
|
@@ -52,6 +52,11 @@
|
|
|
52
52
|
id="rfidCheckboxText"
|
|
53
53
|
style="color: lightgrey"> Process rfid reading(unavailable)</span><br>
|
|
54
54
|
</div>
|
|
55
|
+
<div id="encryptionDiv" style="flex-direction: row; padding: 5px">
|
|
56
|
+
<input id="encryptionCheckbox" type="checkbox" name="rfid" disabled><span
|
|
57
|
+
id="encryptionCheckboxText"
|
|
58
|
+
style="color: lightgrey"> Data encryption(unavailable)</span><br>
|
|
59
|
+
</div>
|
|
55
60
|
<div style="flex-direction: row; padding: 10px">
|
|
56
61
|
<button id="showScannerButton" style="margin-right: 20px">scan doc</button>
|
|
57
62
|
<button id="showImagePicker" style="margin-left: 20px">scan image</button>
|
package/example/www/js/index.js
CHANGED
|
@@ -7,10 +7,13 @@ var app = {
|
|
|
7
7
|
this.receivedEvent('deviceready')
|
|
8
8
|
document.getElementById("status").innerHTML = "loading......"
|
|
9
9
|
document.getElementById("status").style.backgroundColor = "grey"
|
|
10
|
+
var http = cordova.plugin.http
|
|
10
11
|
var DocumentReaderResults = DocumentReader.DocumentReaderResults
|
|
11
12
|
var DocumentReaderScenario = DocumentReader.DocumentReaderScenario
|
|
12
13
|
var Enum = DocumentReader.Enum
|
|
13
14
|
var doRfid = false
|
|
15
|
+
var encryption = false
|
|
16
|
+
const ENCRYPTED_RESULT_SERVICE = "https://api.regulaforensics.com/api/process"
|
|
14
17
|
var isReadingRfid = false
|
|
15
18
|
var rfidUIHeader = "Reading RFID"
|
|
16
19
|
var rfidUIHeaderColor = "black"
|
|
@@ -47,10 +50,15 @@ var app = {
|
|
|
47
50
|
if (canRfid) {
|
|
48
51
|
document.getElementById("rfidCheckbox").disabled = false
|
|
49
52
|
document.getElementById("rfidCheckboxText").style.color = "black"
|
|
50
|
-
document.getElementById("rfidCheckboxText").innerHTML = "Process rfid reading"
|
|
53
|
+
document.getElementById("rfidCheckboxText").innerHTML = " Process rfid reading"
|
|
51
54
|
document.getElementById("rfidCheckboxText").onclick = function () { document.getElementById("rfidCheckbox").click() }
|
|
52
55
|
document.getElementById("rfidCheckbox").onchange = function () { doRfid = this.checked }
|
|
53
56
|
}
|
|
57
|
+
document.getElementById("encryptionCheckbox").disabled = false
|
|
58
|
+
document.getElementById("encryptionCheckboxText").style.color = "black"
|
|
59
|
+
document.getElementById("encryptionCheckboxText").innerHTML = " Data encryption"
|
|
60
|
+
document.getElementById("encryptionCheckboxText").onclick = function () { document.getElementById("encryptionCheckbox").click() }
|
|
61
|
+
document.getElementById("encryptionCheckbox").onchange = function () { encryption = this.checked }
|
|
54
62
|
}
|
|
55
63
|
|
|
56
64
|
function scan() {
|
|
@@ -173,16 +181,16 @@ var app = {
|
|
|
173
181
|
var taCert = "taCertificateCompletionEvent"
|
|
174
182
|
var taSig = "taSignatureCompletionEvent"
|
|
175
183
|
DocumentReader.startRFIDReader(function (m) {
|
|
176
|
-
if(m.substring(0, notification.length) === notification) {
|
|
184
|
+
if (m.substring(0, notification.length) === notification) {
|
|
177
185
|
m = m.substring(notification.length, m.length)
|
|
178
186
|
console.log(notification + ": " + m)
|
|
179
|
-
} else if(m.substring(0, paCert.length) === paCert) {
|
|
187
|
+
} else if (m.substring(0, paCert.length) === paCert) {
|
|
180
188
|
m = m.substring(paCert.length, m.length)
|
|
181
189
|
console.log(paCert + ": " + m)
|
|
182
|
-
} else if(m.substring(0, taCert.length) === taCert) {
|
|
190
|
+
} else if (m.substring(0, taCert.length) === taCert) {
|
|
183
191
|
m = m.substring(taCert.length, m.length)
|
|
184
192
|
console.log(taCert + ": " + m)
|
|
185
|
-
} else if(m.substring(0, taSig.length) === taSig) {
|
|
193
|
+
} else if (m.substring(0, taSig.length) === taSig) {
|
|
186
194
|
m = m.substring(taSig.length, m.length)
|
|
187
195
|
console.log(taSig + ": " + m)
|
|
188
196
|
} else
|
|
@@ -205,7 +213,33 @@ var app = {
|
|
|
205
213
|
//customRFID()
|
|
206
214
|
usualRFID()
|
|
207
215
|
} else
|
|
208
|
-
|
|
216
|
+
if (encryption) {
|
|
217
|
+
var input = JSON.parse(results.rawResult)
|
|
218
|
+
var processParam = {
|
|
219
|
+
alreadyCropped: true,
|
|
220
|
+
scenario: "FullProcess"
|
|
221
|
+
}
|
|
222
|
+
var body = {
|
|
223
|
+
List: input["ContainerList"]["List"],
|
|
224
|
+
processParam: processParam
|
|
225
|
+
}
|
|
226
|
+
postRequest(body)
|
|
227
|
+
} else
|
|
228
|
+
displayResults(results)
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
function postRequest(body) {
|
|
232
|
+
document.getElementById("status").innerHTML = "Getting results from server......"
|
|
233
|
+
document.getElementById("status").style.backgroundColor = "grey"
|
|
234
|
+
http.setDataSerializer('utf8')
|
|
235
|
+
http.post(ENCRYPTED_RESULT_SERVICE, JSON.stringify(body), { "content-type": "application/json; utf-8" }, function (response) {
|
|
236
|
+
DocumentReader.parseCoreResults(response.data, function (m) {
|
|
237
|
+
displayResults(DocumentReader.DocumentReaderResults.fromJson(JSON.parse(m))) }, function (e) { })
|
|
238
|
+
}, function (response) {
|
|
239
|
+
console.error(response.error)
|
|
240
|
+
document.getElementById("status").innerHTML = "Something went wrong!"
|
|
241
|
+
document.getElementById("status").style.backgroundColor = "red"
|
|
242
|
+
})
|
|
209
243
|
}
|
|
210
244
|
|
|
211
245
|
function displayResults(results) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@regulaforensics/cordova-plugin-document-reader-api",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.8.0",
|
|
4
4
|
"description": "Cordova plugin for reading and validation of identification documents (API framework)",
|
|
5
5
|
"cordova": {
|
|
6
6
|
"id": "@regulaforensics/cordova-plugin-document-reader-api",
|
package/plugin.xml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<?xml version='1.0' encoding='utf-8'?>
|
|
2
|
-
<plugin id="cordova-plugin-document-reader-api" version="5.
|
|
2
|
+
<plugin id="cordova-plugin-document-reader-api" version="5.8.0"
|
|
3
3
|
xmlns="http://apache.org/cordova/ns/plugins/1.0">
|
|
4
4
|
<name>DocumentReaderApi</name>
|
|
5
5
|
<description>Cordova plugin Document reader api</description>
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
<podspec>
|
|
26
26
|
<config/>
|
|
27
27
|
<pods>
|
|
28
|
-
<pod name="DocumentReader" spec="~> 5.
|
|
28
|
+
<pod name="DocumentReader" spec="~> 5.8.2215" />
|
|
29
29
|
</pods>
|
|
30
30
|
</podspec>
|
|
31
31
|
</platform>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
package cordova.plugin.documentreader;
|
|
2
2
|
|
|
3
|
+
import android.annotation.SuppressLint;
|
|
3
4
|
import android.app.Activity;
|
|
4
5
|
import android.app.PendingIntent;
|
|
5
6
|
import android.content.Context;
|
|
@@ -8,6 +9,7 @@ import android.content.IntentFilter;
|
|
|
8
9
|
import android.graphics.Bitmap;
|
|
9
10
|
import android.nfc.NfcAdapter;
|
|
10
11
|
import android.nfc.tech.IsoDep;
|
|
12
|
+
import android.support.annotation.NonNull;
|
|
11
13
|
import android.util.Base64;
|
|
12
14
|
|
|
13
15
|
import com.regula.documentreader.api.completions.IDocumentReaderCompletion;
|
|
@@ -19,11 +21,13 @@ import com.regula.documentreader.api.completions.IRfidReaderRequest;
|
|
|
19
21
|
import com.regula.documentreader.api.completions.IRfidTASignatureCompletion;
|
|
20
22
|
import com.regula.documentreader.api.enums.DocReaderAction;
|
|
21
23
|
import com.regula.documentreader.api.errors.DocumentReaderException;
|
|
24
|
+
import com.regula.documentreader.api.params.DocReaderConfig;
|
|
22
25
|
import com.regula.documentreader.api.params.ImageInputParam;
|
|
23
26
|
import com.regula.documentreader.api.params.rfid.PKDCertificate;
|
|
24
27
|
import com.regula.documentreader.api.params.rfid.authorization.PAResourcesIssuer;
|
|
25
28
|
import com.regula.documentreader.api.params.rfid.authorization.TAChallenge;
|
|
26
29
|
import com.regula.documentreader.api.results.DocumentReaderResults;
|
|
30
|
+
import com.regula.documentreader.api.parser.DocReaderResultsJsonParser;
|
|
27
31
|
|
|
28
32
|
import org.apache.cordova.CallbackContext;
|
|
29
33
|
import org.apache.cordova.CordovaPlugin;
|
|
@@ -33,6 +37,8 @@ import org.json.JSONObject;
|
|
|
33
37
|
import org.json.JSONException;
|
|
34
38
|
|
|
35
39
|
import java.io.File;
|
|
40
|
+
import java.io.IOException;
|
|
41
|
+
import java.io.InputStream;
|
|
36
42
|
import java.util.ArrayList;
|
|
37
43
|
import java.util.List;
|
|
38
44
|
|
|
@@ -156,6 +162,9 @@ public class DocumentReader extends CordovaPlugin {
|
|
|
156
162
|
};
|
|
157
163
|
try {
|
|
158
164
|
switch (action) {
|
|
165
|
+
case "initializeReaderAutomatically":
|
|
166
|
+
initializeReaderAutomatically(callback);
|
|
167
|
+
break;
|
|
159
168
|
case "getAPIVersion":
|
|
160
169
|
getAPIVersion(callback);
|
|
161
170
|
break;
|
|
@@ -312,6 +321,9 @@ public class DocumentReader extends CordovaPlugin {
|
|
|
312
321
|
case "provideTASignature":
|
|
313
322
|
provideTASignature(callback, args(0));
|
|
314
323
|
break;
|
|
324
|
+
case "parseCoreResults":
|
|
325
|
+
parseCoreResults(callback, args(0));
|
|
326
|
+
break;
|
|
315
327
|
case "initializeReaderWithDatabasePath":
|
|
316
328
|
initializeReaderWithDatabasePath(callback, args(0), args(1));
|
|
317
329
|
break;
|
|
@@ -352,6 +364,7 @@ public class DocumentReader extends CordovaPlugin {
|
|
|
352
364
|
};
|
|
353
365
|
Intent intent = new Intent(activity.getApplicationContext(), activity.getClass());
|
|
354
366
|
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
|
367
|
+
@SuppressLint("UnspecifiedImmutableFlag")
|
|
355
368
|
PendingIntent pendingIntent = PendingIntent.getActivity(activity.getApplicationContext(), 0, intent, 0);
|
|
356
369
|
NfcAdapter.getDefaultAdapter(getActivity()).enableForegroundDispatch(activity, pendingIntent, filters, techList);
|
|
357
370
|
}
|
|
@@ -363,10 +376,32 @@ public class DocumentReader extends CordovaPlugin {
|
|
|
363
376
|
backgroundRFIDEnabled = false;
|
|
364
377
|
}
|
|
365
378
|
|
|
379
|
+
private void initializeReaderAutomatically(Callback callback) {
|
|
380
|
+
if (!Instance().isReady())
|
|
381
|
+
try {
|
|
382
|
+
InputStream is = getContext().getAssets().open("regula.license");
|
|
383
|
+
byte[] license = new byte[is.available()];
|
|
384
|
+
//noinspection ResultOfMethodCallIgnored
|
|
385
|
+
is.read(license);
|
|
386
|
+
Instance().initializeReader(getContext(), new DocReaderConfig(license), getInitCompletion(callback));
|
|
387
|
+
is.close();
|
|
388
|
+
} catch (IOException e) {
|
|
389
|
+
e.printStackTrace();
|
|
390
|
+
callback.error("problem reading license(see logs)");
|
|
391
|
+
}
|
|
392
|
+
else
|
|
393
|
+
callback.success("already initialized");
|
|
394
|
+
}
|
|
395
|
+
|
|
366
396
|
private void getAvailableScenarios(Callback callback) throws JSONException {
|
|
367
397
|
callback.success(JSONConstructor.generateList(Instance().availableScenarios, JSONConstructor::generateDocumentReaderScenario).toString());
|
|
368
398
|
}
|
|
369
399
|
|
|
400
|
+
private void parseCoreResults(Callback callback, String json) {
|
|
401
|
+
DocumentReaderResults results = (DocumentReaderResults) DocReaderResultsJsonParser.parseCoreResults(json).get("docReaderResults");
|
|
402
|
+
callback.success(JSONConstructor.generateDocumentReaderResults(results, getContext()).toString());
|
|
403
|
+
}
|
|
404
|
+
|
|
370
405
|
private void getAPIVersion(Callback callback) {
|
|
371
406
|
callback.success(Instance().version.api);
|
|
372
407
|
}
|
|
@@ -447,11 +482,11 @@ public class DocumentReader extends CordovaPlugin {
|
|
|
447
482
|
}
|
|
448
483
|
|
|
449
484
|
private void getDocumentReaderIsReady(Callback callback) {
|
|
450
|
-
callback.success(Instance().
|
|
485
|
+
callback.success(Instance().isReady());
|
|
451
486
|
}
|
|
452
487
|
|
|
453
488
|
private void getDocumentReaderStatus(Callback callback) {
|
|
454
|
-
callback.success(Instance().
|
|
489
|
+
callback.success(Instance().isReady());
|
|
455
490
|
}
|
|
456
491
|
|
|
457
492
|
private void isRFIDAvailableForUse(Callback callback) {
|
|
@@ -459,15 +494,15 @@ public class DocumentReader extends CordovaPlugin {
|
|
|
459
494
|
}
|
|
460
495
|
|
|
461
496
|
private void initializeReader(Callback callback, Object license) {
|
|
462
|
-
if (!Instance().
|
|
463
|
-
Instance().initializeReader(getContext(), Base64.decode(license.toString(), Base64.DEFAULT), getInitCompletion(callback));
|
|
497
|
+
if (!Instance().isReady())
|
|
498
|
+
Instance().initializeReader(getContext(), new DocReaderConfig(Base64.decode(license.toString(), Base64.DEFAULT)), getInitCompletion(callback));
|
|
464
499
|
else
|
|
465
500
|
callback.success("already initialized");
|
|
466
501
|
}
|
|
467
502
|
|
|
468
503
|
private void initializeReaderWithDatabase(Callback callback, Object license, Object db) {
|
|
469
|
-
if (!Instance().
|
|
470
|
-
Instance().initializeReader(getContext(), Base64.decode(license.toString(), Base64.DEFAULT), Base64.decode(db.toString(), Base64.DEFAULT), getInitCompletion(callback));
|
|
504
|
+
if (!Instance().isReady())
|
|
505
|
+
Instance().initializeReader(getContext(), new DocReaderConfig(Base64.decode(license.toString(), Base64.DEFAULT), Base64.decode(db.toString(), Base64.DEFAULT)), getInitCompletion(callback));
|
|
471
506
|
else
|
|
472
507
|
callback.success("already initialized");
|
|
473
508
|
}
|
|
@@ -569,9 +604,9 @@ public class DocumentReader extends CordovaPlugin {
|
|
|
569
604
|
private void startRFIDReader(@SuppressWarnings("unused") Callback callback) {
|
|
570
605
|
stopBackgroundRFID();
|
|
571
606
|
IRfidReaderRequest delegate = null;
|
|
572
|
-
if(rfidDelegate == RFIDDelegate.NO_PA)
|
|
607
|
+
if (rfidDelegate == RFIDDelegate.NO_PA)
|
|
573
608
|
delegate = getIRfidReaderRequestNoPA();
|
|
574
|
-
if(rfidDelegate == RFIDDelegate.FULL)
|
|
609
|
+
if (rfidDelegate == RFIDDelegate.FULL)
|
|
575
610
|
delegate = getIRfidReaderRequest();
|
|
576
611
|
Instance().startRFIDReader(getContext(), getCompletion(), delegate, getIRfidNotificationCompletion());
|
|
577
612
|
}
|
|
@@ -719,20 +754,20 @@ public class DocumentReader extends CordovaPlugin {
|
|
|
719
754
|
private IRfidReaderRequest getIRfidReaderRequest() {
|
|
720
755
|
return new IRfidReaderRequest() {
|
|
721
756
|
@Override
|
|
722
|
-
public void onRequestPACertificates(byte[] serialNumber, PAResourcesIssuer issuer, IRfidPKDCertificateCompletion completion) {
|
|
757
|
+
public void onRequestPACertificates(byte[] serialNumber, PAResourcesIssuer issuer, @NonNull IRfidPKDCertificateCompletion completion) {
|
|
723
758
|
paCertificateCompletion = completion;
|
|
724
759
|
completion.onCertificatesReceived(new PKDCertificate[0]);
|
|
725
760
|
sendPACertificateCompletion(serialNumber, issuer);
|
|
726
761
|
}
|
|
727
762
|
|
|
728
763
|
@Override
|
|
729
|
-
public void onRequestTACertificates(String keyCAR, IRfidPKDCertificateCompletion completion) {
|
|
764
|
+
public void onRequestTACertificates(String keyCAR, @NonNull IRfidPKDCertificateCompletion completion) {
|
|
730
765
|
taCertificateCompletion = completion;
|
|
731
766
|
sendTACertificateCompletion(keyCAR);
|
|
732
767
|
}
|
|
733
768
|
|
|
734
769
|
@Override
|
|
735
|
-
public void onRequestTASignature(TAChallenge challenge, IRfidTASignatureCompletion completion) {
|
|
770
|
+
public void onRequestTASignature(TAChallenge challenge, @NonNull IRfidTASignatureCompletion completion) {
|
|
736
771
|
taSignatureCompletion = completion;
|
|
737
772
|
sendTASignatureCompletion(challenge);
|
|
738
773
|
}
|
|
@@ -742,19 +777,19 @@ public class DocumentReader extends CordovaPlugin {
|
|
|
742
777
|
private IRfidReaderRequest getIRfidReaderRequestNoPA() {
|
|
743
778
|
return new IRfidReaderRequest() {
|
|
744
779
|
@Override
|
|
745
|
-
public void onRequestPACertificates(byte[] serialNumber, PAResourcesIssuer issuer, IRfidPKDCertificateCompletion completion) {
|
|
780
|
+
public void onRequestPACertificates(byte[] serialNumber, PAResourcesIssuer issuer, @NonNull IRfidPKDCertificateCompletion completion) {
|
|
746
781
|
paCertificateCompletion = null;
|
|
747
782
|
completion.onCertificatesReceived(new PKDCertificate[0]);
|
|
748
783
|
}
|
|
749
784
|
|
|
750
785
|
@Override
|
|
751
|
-
public void onRequestTACertificates(String keyCAR, IRfidPKDCertificateCompletion completion) {
|
|
786
|
+
public void onRequestTACertificates(String keyCAR, @NonNull IRfidPKDCertificateCompletion completion) {
|
|
752
787
|
taCertificateCompletion = completion;
|
|
753
788
|
sendTACertificateCompletion(keyCAR);
|
|
754
789
|
}
|
|
755
790
|
|
|
756
791
|
@Override
|
|
757
|
-
public void onRequestTASignature(TAChallenge challenge, IRfidTASignatureCompletion completion) {
|
|
792
|
+
public void onRequestTASignature(TAChallenge challenge, @NonNull IRfidTASignatureCompletion completion) {
|
|
758
793
|
taSignatureCompletion = completion;
|
|
759
794
|
sendTASignatureCompletion(challenge);
|
|
760
795
|
}
|
package/src/android/Helpers.java
CHANGED
|
@@ -136,4 +136,11 @@ class Helpers {
|
|
|
136
136
|
result.add(jsonArray.optString(i));
|
|
137
137
|
return result;
|
|
138
138
|
}
|
|
139
|
+
|
|
140
|
+
static String[] stringArrayFromJson(JSONArray jsonArray) {
|
|
141
|
+
String[] result = new String[jsonArray.length()];
|
|
142
|
+
for (int i = 0; i < jsonArray.length(); i++)
|
|
143
|
+
result[i] = jsonArray.optString(i);
|
|
144
|
+
return result;
|
|
145
|
+
}
|
|
139
146
|
}
|
|
@@ -5,6 +5,7 @@ import org.json.JSONObject;
|
|
|
5
5
|
import org.json.JSONException;
|
|
6
6
|
|
|
7
7
|
import com.regula.documentreader.api.DocumentReader;
|
|
8
|
+
import com.regula.documentreader.api.params.ImageQA;
|
|
8
9
|
import com.regula.documentreader.api.params.ParamsCustomization;
|
|
9
10
|
import com.regula.documentreader.api.params.Functionality;
|
|
10
11
|
import com.regula.documentreader.api.params.ProcessParam;
|
|
@@ -100,6 +101,8 @@ class RegulaConfig {
|
|
|
100
101
|
editor.setDoRecordProcessingVideo(opts.getBoolean("recordScanningProcess"));
|
|
101
102
|
if (opts.has("manualMultipageMode"))
|
|
102
103
|
editor.setManualMultipageMode(opts.getBoolean("manualMultipageMode"));
|
|
104
|
+
if (opts.has("exposure"))
|
|
105
|
+
editor.setExposure(BigDecimal.valueOf(opts.getDouble("exposure")).floatValue());
|
|
103
106
|
|
|
104
107
|
editor.apply();
|
|
105
108
|
}
|
|
@@ -165,6 +168,47 @@ class RegulaConfig {
|
|
|
165
168
|
processParams.checkHologram = opts.getBoolean("checkHologram");
|
|
166
169
|
if (opts.has("checkRequiredTextFields"))
|
|
167
170
|
processParams.checkRequiredTextFields = opts.getBoolean("checkRequiredTextFields");
|
|
171
|
+
if (opts.has("depersonalizeLog"))
|
|
172
|
+
processParams.depersonalizeLog = opts.getBoolean("depersonalizeLog");
|
|
173
|
+
if (opts.has("resultTypeOutput"))
|
|
174
|
+
processParams.resultTypeOutput = intArrayFromJson(opts.getJSONArray("resultTypeOutput"));
|
|
175
|
+
if (opts.has("generateDoublePageSpreadImage"))
|
|
176
|
+
processParams.generateDoublePageSpreadImage = opts.getBoolean("generateDoublePageSpreadImage");
|
|
177
|
+
if (opts.has("imageDpiOutMax"))
|
|
178
|
+
processParams.imageDpiOutMax = opts.getInt("imageDpiOutMax");
|
|
179
|
+
if (opts.has("alreadyCropped"))
|
|
180
|
+
processParams.alreadyCropped = opts.getBoolean("alreadyCropped");
|
|
181
|
+
if (opts.has("forceDocID"))
|
|
182
|
+
processParams.forceDocID = opts.getInt("forceDocID");
|
|
183
|
+
if (opts.has("matchTextFieldMask"))
|
|
184
|
+
processParams.matchTextFieldMask = opts.getBoolean("matchTextFieldMask");
|
|
185
|
+
if (opts.has("fastDocDetect"))
|
|
186
|
+
processParams.fastDocDetect = opts.getBoolean("fastDocDetect");
|
|
187
|
+
if (opts.has("updateOCRValidityByGlare"))
|
|
188
|
+
processParams.updateOCRValidityByGlare = opts.getBoolean("updateOCRValidityByGlare");
|
|
189
|
+
if (opts.has("imageQA")) {
|
|
190
|
+
ImageQA img = new ImageQA();
|
|
191
|
+
img.fromJson(opts.getJSONObject("imageQA"));
|
|
192
|
+
processParams.imageQA = img;
|
|
193
|
+
}
|
|
194
|
+
if (opts.has("forceDocFormat"))
|
|
195
|
+
processParams.forceDocFormat = opts.getInt("forceDocFormat");
|
|
196
|
+
if (opts.has("noGraphics"))
|
|
197
|
+
processParams.noGraphics = opts.getBoolean("noGraphics");
|
|
198
|
+
if (opts.has("documentAreaMin"))
|
|
199
|
+
processParams.documentAreaMin = opts.getDouble("documentAreaMin");
|
|
200
|
+
if (opts.has("multiDocOnImage"))
|
|
201
|
+
processParams.multiDocOnImage = opts.getBoolean("multiDocOnImage");
|
|
202
|
+
if (opts.has("shiftExpiryDate"))
|
|
203
|
+
processParams.shiftExpiryDate = opts.getInt("shiftExpiryDate");
|
|
204
|
+
if (opts.has("minimalHolderAge"))
|
|
205
|
+
processParams.minimalHolderAge = opts.getInt("minimalHolderAge");
|
|
206
|
+
if (opts.has("mrzFormatsFilter"))
|
|
207
|
+
processParams.mrzFormatsFilter = stringArrayFromJson(opts.getJSONArray("mrzFormatsFilter"));
|
|
208
|
+
if (opts.has("forceReadMrzBeforeLocate"))
|
|
209
|
+
processParams.forceReadMrzBeforeLocate = opts.getBoolean("forceReadMrzBeforeLocate");
|
|
210
|
+
if (opts.has("parseBarcodes"))
|
|
211
|
+
processParams.parseBarcodes = opts.getBoolean("parseBarcodes");
|
|
168
212
|
}
|
|
169
213
|
|
|
170
214
|
private static void setCustomization(ParamsCustomization customization, JSONObject opts, Context context) throws JSONException {
|
|
@@ -278,7 +322,7 @@ class RegulaConfig {
|
|
|
278
322
|
if (opts.has("statusBackgroundColor"))
|
|
279
323
|
editor.setStatusBackgroundColor(opts.getString("statusBackgroundColor"));
|
|
280
324
|
|
|
281
|
-
editor.
|
|
325
|
+
editor.applyImmediately(context);
|
|
282
326
|
}
|
|
283
327
|
|
|
284
328
|
private static JSONObject getFunctionality(Functionality functionality) throws JSONException {
|
|
@@ -316,6 +360,7 @@ class RegulaConfig {
|
|
|
316
360
|
object.put("isCameraTorchCheckDisabled", functionality.isCameraTorchCheckDisabled());
|
|
317
361
|
object.put("recordScanningProcess", functionality.doRecordProcessingVideo());
|
|
318
362
|
object.put("manualMultipageMode", functionality.isManualMultipageMode());
|
|
363
|
+
object.put("exposure", functionality.getExposure());
|
|
319
364
|
|
|
320
365
|
return object;
|
|
321
366
|
}
|
|
@@ -382,6 +427,10 @@ class RegulaConfig {
|
|
|
382
427
|
|
|
383
428
|
private static JSONObject getProcessParams(ProcessParam processParams) throws JSONException {
|
|
384
429
|
JSONObject object = new JSONObject();
|
|
430
|
+
object.put("documentIDList", processParams.documentIDList != null ? generateIntArray(processParams.documentIDList) : null);
|
|
431
|
+
object.put("barcodeTypes", processParams.doBarcodes != null ? generateArray(processParams.doBarcodes) : null);
|
|
432
|
+
object.put("fieldTypesFilter", processParams.fieldTypesFilter != null ? generateIntArray(processParams.fieldTypesFilter) : null);
|
|
433
|
+
object.put("faceMetaData", processParams.faceMetaData != null ? generateArray(processParams.faceMetaData, JSONConstructor::generateFaceMetaData) : null);
|
|
385
434
|
object.put("scenario", processParams.scenario);
|
|
386
435
|
object.put("measureSystem", processParams.measureSystem);
|
|
387
436
|
object.put("uvTorchEnabled", processParams.uvTorchEnabled);
|
|
@@ -409,14 +458,25 @@ class RegulaConfig {
|
|
|
409
458
|
object.put("returnCroppedBarcode", processParams.returnCroppedBarcode);
|
|
410
459
|
object.put("checkHologram", processParams.checkHologram);
|
|
411
460
|
object.put("checkRequiredTextFields", processParams.checkRequiredTextFields);
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
461
|
+
object.put("depersonalizeLog", processParams.depersonalizeLog);
|
|
462
|
+
object.put("resultTypeOutput", processParams.resultTypeOutput);
|
|
463
|
+
object.put("generateDoublePageSpreadImage", processParams.generateDoublePageSpreadImage);
|
|
464
|
+
object.put("imageDpiOutMax", processParams.imageDpiOutMax);
|
|
465
|
+
object.put("alreadyCropped", processParams.alreadyCropped);
|
|
466
|
+
object.put("forceDocID", processParams.forceDocID);
|
|
467
|
+
object.put("matchTextFieldMask", processParams.matchTextFieldMask);
|
|
468
|
+
object.put("fastDocDetect", processParams.fastDocDetect);
|
|
469
|
+
object.put("updateOCRValidityByGlare", processParams.updateOCRValidityByGlare);
|
|
470
|
+
object.put("imageQA", processParams.imageQA != null ? processParams.imageQA.toJsonObject() : null);
|
|
471
|
+
object.put("forceDocFormat", processParams.forceDocFormat);
|
|
472
|
+
object.put("noGraphics", processParams.noGraphics);
|
|
473
|
+
object.put("documentAreaMin", processParams.documentAreaMin);
|
|
474
|
+
object.put("multiDocOnImage", processParams.multiDocOnImage);
|
|
475
|
+
object.put("shiftExpiryDate", processParams.shiftExpiryDate);
|
|
476
|
+
object.put("minimalHolderAge", processParams.minimalHolderAge);
|
|
477
|
+
object.put("mrzFormatsFilter", processParams.mrzFormatsFilter != null ? generateArray(processParams.mrzFormatsFilter) : null);
|
|
478
|
+
object.put("forceReadMrzBeforeLocate", processParams.forceReadMrzBeforeLocate);
|
|
479
|
+
object.put("parseBarcodes", processParams.parseBarcodes);
|
|
420
480
|
|
|
421
481
|
return object;
|
|
422
482
|
}
|
package/src/android/build.gradle
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
repositories {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
maven{
|
|
7
|
-
url "http://maven.regulaforensics.com/RegulaDocumentReader"
|
|
8
|
-
}
|
|
9
|
-
maven {
|
|
10
|
-
url "http://maven.regulaforensics.com/RegulaDocumentReader/Beta"
|
|
11
|
-
}
|
|
2
|
+
jcenter()
|
|
3
|
+
maven{
|
|
4
|
+
url "https://maven.google.com"
|
|
12
5
|
}
|
|
6
|
+
maven{
|
|
7
|
+
url "https://maven.regulaforensics.com/RegulaDocumentReader"
|
|
8
|
+
}
|
|
9
|
+
maven {
|
|
10
|
+
url "https://maven.regulaforensics.com/RegulaDocumentReader/Beta"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
13
|
|
|
14
14
|
dependencies {
|
|
15
|
-
implementation ('com.regula.documentreader:api:5.
|
|
15
|
+
implementation ('com.regula.documentreader:api:5.8.5196'){
|
|
16
16
|
transitive = true
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -136,7 +136,9 @@ typedef void (^Callback)(NSString* response);
|
|
|
136
136
|
[self.commandDelegate sendPluginResult:[CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:response] callbackId:command.callbackId];
|
|
137
137
|
};
|
|
138
138
|
|
|
139
|
-
if([action isEqualToString:@"
|
|
139
|
+
if([action isEqualToString:@"initializeReaderAutomatically"])
|
|
140
|
+
[self initializeReaderAutomatically :successCallback :errorCallback];
|
|
141
|
+
else if([action isEqualToString:@"getAPIVersion"])
|
|
140
142
|
[self getAPIVersion :successCallback :errorCallback];
|
|
141
143
|
else if([action isEqualToString:@"getAvailableScenarios"])
|
|
142
144
|
[self getAvailableScenarios :successCallback :errorCallback];
|
|
@@ -240,6 +242,8 @@ typedef void (^Callback)(NSString* response);
|
|
|
240
242
|
[self provideTACertificates :[args objectAtIndex:0] :successCallback :errorCallback];
|
|
241
243
|
else if([action isEqualToString:@"provideTASignature"])
|
|
242
244
|
[self provideTASignature :[args objectAtIndex:0] :successCallback :errorCallback];
|
|
245
|
+
else if([action isEqualToString:@"parseCoreResults"])
|
|
246
|
+
[self parseCoreResults :[args objectAtIndex:0] :successCallback :errorCallback];
|
|
243
247
|
else if([action isEqualToString:@"initializeReaderWithDatabasePath"])
|
|
244
248
|
[self initializeReaderWithDatabasePath :[args objectAtIndex:0] :[args objectAtIndex:1] :successCallback :errorCallback];
|
|
245
249
|
else if([action isEqualToString:@"initializeReaderWithDatabase"])
|
|
@@ -260,6 +264,12 @@ typedef void (^Callback)(NSString* response);
|
|
|
260
264
|
[self result:[NSString stringWithFormat:@"%@/%@", @"method not implemented: ", action] :errorCallback];
|
|
261
265
|
}
|
|
262
266
|
|
|
267
|
+
- (void) initializeReaderAutomatically:(Callback)successCallback :(Callback)errorCallback{
|
|
268
|
+
NSString *dataPath = [[NSBundle mainBundle] pathForResource:@"regula.license" ofType:nil];
|
|
269
|
+
NSData *licenseData = [NSData dataWithContentsOfFile:dataPath];
|
|
270
|
+
[RGLDocReader.shared initializeReaderWithConfig:[RGLConfig configWithLicenseData:licenseData] completion:[self getInitCompletion :successCallback :errorCallback]];
|
|
271
|
+
}
|
|
272
|
+
|
|
263
273
|
- (void) resetConfiguration:(Callback)successCallback :(Callback)errorCallback{
|
|
264
274
|
[self result:@"resetConfiguration() is an android-only method" :errorCallback];
|
|
265
275
|
}
|
|
@@ -301,7 +311,11 @@ typedef void (^Callback)(NSString* response);
|
|
|
301
311
|
}
|
|
302
312
|
|
|
303
313
|
- (void) initializeReader:(NSString*)licenseString :(Callback)successCallback :(Callback)errorCallback{
|
|
304
|
-
[RGLDocReader.shared
|
|
314
|
+
[RGLDocReader.shared initializeReaderWithConfig:[RGLConfig configWithLicenseData:[[NSData alloc] initWithBase64EncodedString:licenseString options:0]] completion:[self getInitCompletion :successCallback :errorCallback]];
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
- (void) parseCoreResults:(NSString*)json :(Callback)successCallback :(Callback)errorCallback{
|
|
318
|
+
[self result:[RGLWJSONConstructor dictToString:[RGLWJSONConstructor generateRGLDocumentReaderResults:[RGLDocumentReaderResults initWithRawString: json]]] :successCallback];
|
|
305
319
|
}
|
|
306
320
|
|
|
307
321
|
- (void) startRFIDReader:(Callback)successCallback :(Callback)errorCallback{
|
|
@@ -311,7 +325,7 @@ typedef void (^Callback)(NSString* response);
|
|
|
311
325
|
}
|
|
312
326
|
|
|
313
327
|
- (void) initializeReaderWithDatabasePath:(NSString*)licenseString :(NSString*)databasePath :(Callback)successCallback :(Callback)errorCallback{
|
|
314
|
-
[RGLDocReader.shared
|
|
328
|
+
[RGLDocReader.shared initializeReaderWithConfig:[RGLConfig configWithLicenseData:[[NSData alloc] initWithBase64EncodedString:licenseString options:0] licenseUpdateCheck:true databasePath:databasePath] completion:[self getInitCompletion :successCallback :errorCallback]];
|
|
315
329
|
}
|
|
316
330
|
|
|
317
331
|
- (void) prepareDatabase:(NSString*)dbID :(Callback)successCallback :(Callback)errorCallback{
|
package/src/ios/RegulaConfig.h
CHANGED
|
@@ -19,5 +19,7 @@
|
|
|
19
19
|
+(RGLePassportDataGroup*)RGLePassportDataGroupFromJson:(NSDictionary *) dict;
|
|
20
20
|
+(RGLeIDDataGroup*)RGLeIDDataGroupFromJson:(NSDictionary*) dict;
|
|
21
21
|
+(RGLeDLDataGroup*)RGLeDLDataGroupFromJson:(NSDictionary*) dict;
|
|
22
|
+
+(RGLImageQA*)ImageQAFromJson:(NSDictionary*) dict;
|
|
23
|
+
+(NSDictionary*)ImageQAToJson:(RGLImageQA*) input;
|
|
22
24
|
@end
|
|
23
25
|
#endif
|
package/src/ios/RegulaConfig.m
CHANGED
|
@@ -284,6 +284,39 @@
|
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
286
|
|
|
287
|
+
+(RGLImageQA*)ImageQAFromJson:(NSDictionary*)dict {
|
|
288
|
+
RGLImageQA *image = [RGLImageQA new];
|
|
289
|
+
|
|
290
|
+
if([dict valueForKey:@"dpiThreshold"] != nil)
|
|
291
|
+
image.dpiThreshold = [dict valueForKey:@"dpiThreshold"];
|
|
292
|
+
if([dict valueForKey:@"angleThreshold"] != nil)
|
|
293
|
+
image.angleThreshold = [dict valueForKey:@"angleThreshold"];
|
|
294
|
+
if([dict valueForKey:@"focusCheck"] != nil)
|
|
295
|
+
image.focusCheck = [dict valueForKey:@"focusCheck"];
|
|
296
|
+
if([dict valueForKey:@"glaresCheck"] != nil)
|
|
297
|
+
image.glaresCheck = [dict valueForKey:@"glaresCheck"];
|
|
298
|
+
if([dict valueForKey:@"colornessCheck"] != nil)
|
|
299
|
+
image.colornessCheck = [dict valueForKey:@"colornessCheck"];
|
|
300
|
+
if([dict valueForKey:@"moireCheck"] != nil)
|
|
301
|
+
image.moireCheck = [dict valueForKey:@"moireCheck"];
|
|
302
|
+
|
|
303
|
+
return image;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
+(NSDictionary*)ImageQAToJson:(RGLImageQA*)input {
|
|
307
|
+
NSMutableDictionary *result = [NSMutableDictionary new];
|
|
308
|
+
if(input == nil) return result;
|
|
309
|
+
|
|
310
|
+
result[@"dpiThreshold"] = input.dpiThreshold;
|
|
311
|
+
result[@"angleThreshold"] = input.angleThreshold;
|
|
312
|
+
result[@"focusCheck"] = input.focusCheck;
|
|
313
|
+
result[@"glaresCheck"] = input.glaresCheck;
|
|
314
|
+
result[@"colornessCheck"] = input.colornessCheck;
|
|
315
|
+
result[@"moireCheck"] = input.moireCheck;
|
|
316
|
+
|
|
317
|
+
return result;
|
|
318
|
+
}
|
|
319
|
+
|
|
287
320
|
+(RGLePassportDataGroup*)RGLePassportDataGroupFromJson:(NSDictionary*)dict {
|
|
288
321
|
RGLePassportDataGroup *group = [[RGLePassportDataGroup alloc] init];
|
|
289
322
|
|
|
@@ -570,17 +603,17 @@
|
|
|
570
603
|
|
|
571
604
|
+(void)setProcessParams:(NSDictionary*)options :(RGLProcessParams*)processParams {
|
|
572
605
|
if([options valueForKey:@"multipageProcessing"] != nil)
|
|
573
|
-
processParams.multipageProcessing = [[options valueForKey:@"multipageProcessing"] boolValue];
|
|
606
|
+
processParams.multipageProcessing = [NSNumber numberWithBool:[[options valueForKey:@"multipageProcessing"] boolValue]];
|
|
574
607
|
if([options valueForKey:@"dateFormat"] != nil)
|
|
575
608
|
processParams.dateFormat = [options valueForKey:@"dateFormat"];
|
|
576
609
|
if([options valueForKey:@"logs"] != nil)
|
|
577
|
-
processParams.logs = [[options valueForKey:@"logs"] boolValue];
|
|
610
|
+
processParams.logs = [NSNumber numberWithBool:[[options valueForKey:@"logs"] boolValue]];
|
|
578
611
|
if([options valueForKey:@"debugSaveImages"] != nil)
|
|
579
|
-
processParams.debugSaveImages = [[options valueForKey:@"debugSaveImages"] boolValue];
|
|
612
|
+
processParams.debugSaveImages = [NSNumber numberWithBool:[[options valueForKey:@"debugSaveImages"] boolValue]];
|
|
580
613
|
if([options valueForKey:@"debugSaveCroppedImages"] != nil)
|
|
581
|
-
processParams.debugSaveCroppedImages = [[options valueForKey:@"debugSaveCroppedImages"] boolValue];
|
|
614
|
+
processParams.debugSaveCroppedImages = [NSNumber numberWithBool:[[options valueForKey:@"debugSaveCroppedImages"] boolValue]];
|
|
582
615
|
if([options valueForKey:@"debugSaveLogs"] != nil)
|
|
583
|
-
processParams.debugSaveLogs = [[options valueForKey:@"debugSaveLogs"] boolValue];
|
|
616
|
+
processParams.debugSaveLogs = [NSNumber numberWithBool:[[options valueForKey:@"debugSaveLogs"] boolValue]];
|
|
584
617
|
if([options valueForKey:@"scenario"] != nil)
|
|
585
618
|
processParams.scenario = [options valueForKey:@"scenario"];
|
|
586
619
|
if([options valueForKey:@"barcodeTypes"] != nil)
|
|
@@ -590,43 +623,79 @@
|
|
|
590
623
|
if([options valueForKey:@"fieldTypesFilter"] != nil)
|
|
591
624
|
processParams.fieldTypesFilter = [options valueForKey:@"fieldTypesFilter"];
|
|
592
625
|
if([options valueForKey:@"disableFocusingCheck"] != nil)
|
|
593
|
-
processParams.disableFocusingCheck = [[options valueForKey:@"disableFocusingCheck"] boolValue];
|
|
626
|
+
processParams.disableFocusingCheck = [NSNumber numberWithBool:[[options valueForKey:@"disableFocusingCheck"] boolValue]];
|
|
594
627
|
if([options valueForKey:@"captureButtonScenario"] != nil)
|
|
595
628
|
processParams.captureButtonScenario = [options valueForKey:@"captureButtonScenario"];
|
|
596
|
-
if([options valueForKey:@"sessionLogFolder"] != nil)
|
|
597
|
-
[processParams setSessionLogFolder:[[options valueForKey:@"sessionLogFolder"] stringValue]];
|
|
598
629
|
if([options valueForKey:@"measureSystem"] != nil)
|
|
599
630
|
processParams.measureSystem = [[options valueForKey:@"measureSystem"] integerValue];
|
|
600
631
|
if([options valueForKey:@"returnUncroppedImage"] != nil)
|
|
601
|
-
processParams.returnUncroppedImage = [[options valueForKey:@"returnUncroppedImage"] boolValue];
|
|
632
|
+
processParams.returnUncroppedImage = [NSNumber numberWithBool:[[options valueForKey:@"returnUncroppedImage"] boolValue]];
|
|
602
633
|
if([options valueForKey:@"customParams"] != nil)
|
|
603
634
|
processParams.customParams = [options objectForKey:@"customParams"];
|
|
604
635
|
if([options valueForKey:@"debugSaveRFIDSession"] != nil)
|
|
605
|
-
processParams.debugSaveRFIDSession = [[options valueForKey:@"debugSaveRFIDSession"] boolValue];
|
|
636
|
+
processParams.debugSaveRFIDSession = [NSNumber numberWithBool:[[options valueForKey:@"debugSaveRFIDSession"] boolValue]];
|
|
606
637
|
if([options valueForKey:@"doublePageSpread"] != nil)
|
|
607
|
-
processParams.doublePageSpread = [[options valueForKey:@"doublePageSpread"] boolValue];
|
|
638
|
+
processParams.doublePageSpread = [NSNumber numberWithBool:[[options valueForKey:@"doublePageSpread"] boolValue]];
|
|
608
639
|
if([options valueForKey:@"barcodeParserType"] != nil)
|
|
609
|
-
processParams.barcodeParserType = [[options valueForKey:@"barcodeParserType"] integerValue];
|
|
640
|
+
processParams.barcodeParserType = [NSNumber numberWithInteger:[[options valueForKey:@"barcodeParserType"] integerValue]];
|
|
610
641
|
if([options valueForKey:@"timeout"] != nil)
|
|
611
|
-
processParams.timeout = [[options valueForKey:@"timeout"] doubleValue];
|
|
642
|
+
processParams.timeout = [NSNumber numberWithDouble:[[options valueForKey:@"timeout"] doubleValue]];
|
|
612
643
|
if([options valueForKey:@"timeoutFromFirstDetect"] != nil)
|
|
613
|
-
processParams.timeoutFromFirstDetect = [[options valueForKey:@"timeoutFromFirstDetect"] doubleValue];
|
|
644
|
+
processParams.timeoutFromFirstDetect = [NSNumber numberWithDouble:[[options valueForKey:@"timeoutFromFirstDetect"] doubleValue]];
|
|
614
645
|
if([options valueForKey:@"timeoutFromFirstDocType"] != nil)
|
|
615
|
-
processParams.timeoutFromFirstDocType = [[options valueForKey:@"timeoutFromFirstDocType"] doubleValue];
|
|
646
|
+
processParams.timeoutFromFirstDocType = [NSNumber numberWithDouble:[[options valueForKey:@"timeoutFromFirstDocType"] doubleValue]];
|
|
616
647
|
if([options valueForKey:@"manualCrop"] != nil)
|
|
617
|
-
processParams.manualCrop = [[options valueForKey:@"manualCrop"] boolValue];
|
|
648
|
+
processParams.manualCrop = [NSNumber numberWithBool:[[options valueForKey:@"manualCrop"] boolValue]];
|
|
618
649
|
if([options valueForKey:@"perspectiveAngle"] != nil)
|
|
619
|
-
processParams.perspectiveAngle = [[options valueForKey:@"perspectiveAngle"] integerValue];
|
|
650
|
+
processParams.perspectiveAngle = [NSNumber numberWithInteger:[[options valueForKey:@"perspectiveAngle"] integerValue]];
|
|
620
651
|
if([options valueForKey:@"minDPI"] != nil)
|
|
621
|
-
processParams.minDPI = [[options valueForKey:@"minDPI"] integerValue];
|
|
652
|
+
processParams.minDPI = [NSNumber numberWithInteger:[[options valueForKey:@"minDPI"] integerValue]];
|
|
622
653
|
if([options valueForKey:@"integralImage"] != nil)
|
|
623
|
-
processParams.integralImage = [[options valueForKey:@"integralImage"] boolValue];
|
|
654
|
+
processParams.integralImage = [NSNumber numberWithBool:[[options valueForKey:@"integralImage"] boolValue]];
|
|
624
655
|
if([options valueForKey:@"returnCroppedBarcode"] != nil)
|
|
625
|
-
processParams.returnCroppedBarcode = [[options valueForKey:@"returnCroppedBarcode"] boolValue];
|
|
656
|
+
processParams.returnCroppedBarcode = [NSNumber numberWithBool:[[options valueForKey:@"returnCroppedBarcode"] boolValue]];
|
|
626
657
|
if([options valueForKey:@"checkHologram"] != nil)
|
|
627
|
-
processParams.checkHologram = [[options valueForKey:@"checkHologram"] boolValue];
|
|
658
|
+
processParams.checkHologram = [NSNumber numberWithBool:[[options valueForKey:@"checkHologram"] boolValue]];
|
|
628
659
|
if([options valueForKey:@"checkRequiredTextFields"] != nil)
|
|
629
|
-
processParams.checkRequiredTextFields = [[options valueForKey:@"checkRequiredTextFields"] boolValue];
|
|
660
|
+
processParams.checkRequiredTextFields = [NSNumber numberWithBool:[[options valueForKey:@"checkRequiredTextFields"] boolValue]];
|
|
661
|
+
if([options valueForKey:@"depersonalizeLog"] != nil)
|
|
662
|
+
processParams.depersonalizeLog = [options valueForKey:@"depersonalizeLog"];
|
|
663
|
+
if([options valueForKey:@"resultTypeOutput"] != nil)
|
|
664
|
+
processParams.resultTypeOutput = [options valueForKey:@"resultTypeOutput"];
|
|
665
|
+
if([options valueForKey:@"generateDoublePageSpreadImage"] != nil)
|
|
666
|
+
processParams.generateDoublePageSpreadImage = [options valueForKey:@"generateDoublePageSpreadImage"];
|
|
667
|
+
if([options valueForKey:@"imageDpiOutMax"] != nil)
|
|
668
|
+
processParams.imageDpiOutMax = [options valueForKey:@"imageDpiOutMax"];
|
|
669
|
+
if([options valueForKey:@"alreadyCropped"] != nil)
|
|
670
|
+
processParams.alreadyCropped = [options valueForKey:@"alreadyCropped"];
|
|
671
|
+
if([options valueForKey:@"forceDocID"] != nil)
|
|
672
|
+
processParams.forceDocID = [options valueForKey:@"forceDocID"];
|
|
673
|
+
if([options valueForKey:@"matchTextFieldMask"] != nil)
|
|
674
|
+
processParams.matchTextFieldMask = [options valueForKey:@"matchTextFieldMask"];
|
|
675
|
+
if([options valueForKey:@"fastDocDetect"] != nil)
|
|
676
|
+
processParams.fastDocDetect = [options valueForKey:@"fastDocDetect"];
|
|
677
|
+
if([options valueForKey:@"updateOCRValidityByGlare"] != nil)
|
|
678
|
+
processParams.updateOCRValidityByGlare = [options valueForKey:@"updateOCRValidityByGlare"];
|
|
679
|
+
if([options valueForKey:@"imageQA"] != nil)
|
|
680
|
+
processParams.imageQA = [RegulaConfig ImageQAFromJson:[options valueForKey:@"imageQA"]];
|
|
681
|
+
if([options valueForKey:@"forceDocFormat"] != nil)
|
|
682
|
+
processParams.forceDocFormat = [options valueForKey:@"forceDocFormat"];
|
|
683
|
+
if([options valueForKey:@"noGraphics"] != nil)
|
|
684
|
+
processParams.noGraphics = [options valueForKey:@"noGraphics"];
|
|
685
|
+
if([options valueForKey:@"documentAreaMin"] != nil)
|
|
686
|
+
processParams.documentAreaMin = [options valueForKey:@"documentAreaMin"];
|
|
687
|
+
if([options valueForKey:@"multiDocOnImage"] != nil)
|
|
688
|
+
processParams.multiDocOnImage = [options valueForKey:@"multiDocOnImage"];
|
|
689
|
+
if([options valueForKey:@"shiftExpiryDate"] != nil)
|
|
690
|
+
processParams.shiftExpiryDate = [options valueForKey:@"shiftExpiryDate"];
|
|
691
|
+
if([options valueForKey:@"minimalHolderAge"] != nil)
|
|
692
|
+
processParams.minimalHolderAge = [options valueForKey:@"minimalHolderAge"];
|
|
693
|
+
if([options valueForKey:@"mrzFormatsFilter"] != nil)
|
|
694
|
+
processParams.mrzFormatsFilter = [options valueForKey:@"mrzFormatsFilter"];
|
|
695
|
+
if([options valueForKey:@"forceReadMrzBeforeLocate"] != nil)
|
|
696
|
+
processParams.forceReadMrzBeforeLocate = [options valueForKey:@"forceReadMrzBeforeLocate"];
|
|
697
|
+
if([options valueForKey:@"parseBarcodes"] != nil)
|
|
698
|
+
processParams.parseBarcodes = [options valueForKey:@"parseBarcodes"];
|
|
630
699
|
}
|
|
631
700
|
|
|
632
701
|
+(NSMutableDictionary *)getCustomization:(RGLCustomization*)customization {
|
|
@@ -745,20 +814,36 @@
|
|
|
745
814
|
result[@"customParams"] = processParams.customParams;
|
|
746
815
|
result[@"debugSaveRFIDSession"] = [NSNumber numberWithBool:processParams.debugSaveRFIDSession];
|
|
747
816
|
result[@"doublePageSpread"] = [NSNumber numberWithBool:processParams.doublePageSpread];
|
|
748
|
-
result[@"barcodeParserType"] =
|
|
749
|
-
result[@"
|
|
750
|
-
result[@"
|
|
751
|
-
result[@"
|
|
752
|
-
result[@"timeout"] = [NSNumber numberWithDouble:processParams.timeout];
|
|
753
|
-
result[@"timeoutFromFirstDetect"] = [NSNumber numberWithDouble:processParams.timeoutFromFirstDetect];
|
|
754
|
-
result[@"timeoutFromFirstDocType"] = [NSNumber numberWithDouble:processParams.timeoutFromFirstDocType];
|
|
817
|
+
result[@"barcodeParserType"] = processParams.barcodeParserType;
|
|
818
|
+
result[@"timeout"] = processParams.timeout;
|
|
819
|
+
result[@"timeoutFromFirstDetect"] = processParams.timeoutFromFirstDetect;
|
|
820
|
+
result[@"timeoutFromFirstDocType"] = processParams.timeoutFromFirstDocType;
|
|
755
821
|
result[@"manualCrop"] = [NSNumber numberWithBool:processParams.manualCrop];
|
|
756
|
-
result[@"perspectiveAngle"] =
|
|
757
|
-
result[@"minDPI"] =
|
|
822
|
+
result[@"perspectiveAngle"] = processParams.perspectiveAngle;
|
|
823
|
+
result[@"minDPI"] = processParams.minDPI;
|
|
758
824
|
result[@"integralImage"] = [NSNumber numberWithBool:processParams.integralImage];
|
|
759
825
|
result[@"returnCroppedBarcode"] = [NSNumber numberWithBool:processParams.returnCroppedBarcode];
|
|
760
826
|
result[@"checkHologram"] = [NSNumber numberWithBool:processParams.checkHologram];
|
|
761
827
|
result[@"checkRequiredTextFields"] = [NSNumber numberWithBool:processParams.checkRequiredTextFields];
|
|
828
|
+
result[@"depersonalizeLog"] = processParams.depersonalizeLog;
|
|
829
|
+
result[@"resultTypeOutput"] = processParams.resultTypeOutput;
|
|
830
|
+
result[@"generateDoublePageSpreadImage"] = processParams.generateDoublePageSpreadImage;
|
|
831
|
+
result[@"imageDpiOutMax"] = processParams.imageDpiOutMax;
|
|
832
|
+
result[@"alreadyCropped"] = processParams.alreadyCropped;
|
|
833
|
+
result[@"forceDocID"] = processParams.forceDocID;
|
|
834
|
+
result[@"matchTextFieldMask"] = processParams.matchTextFieldMask;
|
|
835
|
+
result[@"fastDocDetect"] = processParams.fastDocDetect;
|
|
836
|
+
result[@"updateOCRValidityByGlare"] = processParams.updateOCRValidityByGlare;
|
|
837
|
+
result[@"imageQA"] = [RegulaConfig ImageQAToJson:processParams.imageQA];
|
|
838
|
+
result[@"forceDocFormat"] = processParams.forceDocFormat;
|
|
839
|
+
result[@"noGraphics"] = processParams.noGraphics;
|
|
840
|
+
result[@"documentAreaMin"] = processParams.documentAreaMin;
|
|
841
|
+
result[@"multiDocOnImage"] = processParams.multiDocOnImage;
|
|
842
|
+
result[@"shiftExpiryDate"] = processParams.shiftExpiryDate;
|
|
843
|
+
result[@"minimalHolderAge"] = processParams.minimalHolderAge;
|
|
844
|
+
result[@"mrzFormatsFilter"] = processParams.mrzFormatsFilter;
|
|
845
|
+
result[@"forceReadMrzBeforeLocate"] = processParams.forceReadMrzBeforeLocate;
|
|
846
|
+
result[@"parseBarcodes"] = processParams.parseBarcodes;
|
|
762
847
|
|
|
763
848
|
return result;
|
|
764
849
|
}
|
package/www/DocumentReader.js
CHANGED
|
@@ -3515,6 +3515,9 @@ const eVisualFieldType = {
|
|
|
3515
3515
|
FT_DLCLASSCODE_D3_TO: 635,
|
|
3516
3516
|
FT_DLCLASSCODE_D3_NOTES: 636,
|
|
3517
3517
|
FT_ALT_DATE_OF_EXPIRY: 637,
|
|
3518
|
+
FT_DLCLASSCODE_CD_FROM: 638,
|
|
3519
|
+
FT_DLCLASSCODE_CD_TO: 639,
|
|
3520
|
+
FT_DLCLASSCODE_CD_NOTES: 640,
|
|
3518
3521
|
|
|
3519
3522
|
getTranslation: function (value) {
|
|
3520
3523
|
switch (value) {
|
|
@@ -4692,6 +4695,12 @@ const eVisualFieldType = {
|
|
|
4692
4695
|
return "DL category D3 codes"
|
|
4693
4696
|
case 637:
|
|
4694
4697
|
return "Alternative date of expiry"
|
|
4698
|
+
case 638:
|
|
4699
|
+
return "DL category CD valid from"
|
|
4700
|
+
case 639:
|
|
4701
|
+
return "DL category CD valid to"
|
|
4702
|
+
case 640:
|
|
4703
|
+
return "DL category CD codes"
|
|
4695
4704
|
default:
|
|
4696
4705
|
return value
|
|
4697
4706
|
}
|
|
@@ -5328,6 +5337,7 @@ const Enum = {
|
|
|
5328
5337
|
|
|
5329
5338
|
const DocumentReader = {}
|
|
5330
5339
|
|
|
5340
|
+
DocumentReader.initializeReaderAutomatically = (successCallback, errorCallback) => cordova.exec(successCallback, errorCallback, "DocumentReader", "exec", ["initializeReaderAutomatically"])
|
|
5331
5341
|
DocumentReader.getAPIVersion = (successCallback, errorCallback) => cordova.exec(successCallback, errorCallback, "DocumentReader", "exec", ["getAPIVersion"])
|
|
5332
5342
|
DocumentReader.getAvailableScenarios = (successCallback, errorCallback) => cordova.exec(successCallback, errorCallback, "DocumentReader", "exec", ["getAvailableScenarios"])
|
|
5333
5343
|
DocumentReader.isRFIDAvailableForUse = (successCallback, errorCallback) => cordova.exec(successCallback, errorCallback, "DocumentReader", "exec", ["isRFIDAvailableForUse"])
|
|
@@ -5380,6 +5390,7 @@ DocumentReader.setRfidSessionStatus = (status, successCallback, errorCallback) =
|
|
|
5380
5390
|
DocumentReader.providePACertificates = (certificates, successCallback, errorCallback) => cordova.exec(successCallback, errorCallback, "DocumentReader", "exec", ["providePACertificates", certificates])
|
|
5381
5391
|
DocumentReader.provideTACertificates = (certificates, successCallback, errorCallback) => cordova.exec(successCallback, errorCallback, "DocumentReader", "exec", ["provideTACertificates", certificates])
|
|
5382
5392
|
DocumentReader.provideTASignature = (certificates, successCallback, errorCallback) => cordova.exec(successCallback, errorCallback, "DocumentReader", "exec", ["provideTASignature", certificates])
|
|
5393
|
+
DocumentReader.parseCoreResults = (json, successCallback, errorCallback) => cordova.exec(successCallback, errorCallback, "DocumentReader", "exec", ["parseCoreResults", json])
|
|
5383
5394
|
DocumentReader.initializeReaderWithDatabasePath = (license, path, successCallback, errorCallback) => cordova.exec(successCallback, errorCallback, "DocumentReader", "exec", ["initializeReaderWithDatabasePath", license, path])
|
|
5384
5395
|
DocumentReader.initializeReaderWithDatabase = (license, db, successCallback, errorCallback) => cordova.exec(successCallback, errorCallback, "DocumentReader", "exec", ["initializeReaderWithDatabase", license, db])
|
|
5385
5396
|
DocumentReader.recognizeImageFrame = (image, params, successCallback, errorCallback) => cordova.exec(successCallback, errorCallback, "DocumentReader", "exec", ["recognizeImageFrame", image, params])
|