@regulaforensics/cordova-plugin-document-reader-api 6.2.2 → 6.4.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/.github/ISSUE_TEMPLATE/bug-report.md +39 -0
- package/.github/ISSUE_TEMPLATE/config.yml +5 -0
- package/.github/ISSUE_TEMPLATE/feature-request.md +20 -0
- package/README.md +2 -3
- package/example/config.xml +1 -0
- package/example/package.json +4 -3
- package/package.json +1 -1
- package/plugin.xml +2 -2
- package/src/android/DocumentReader.java +36 -22
- package/src/android/JSONConstructor.java +74 -0
- package/src/android/RegulaConfig.java +18 -0
- package/src/android/build.gradle +1 -1
- package/src/ios/RGLDocumentReader.m +32 -16
- package/src/ios/RGLWJSONConstructor.h +2 -0
- package/src/ios/RGLWJSONConstructor.m +56 -3
- package/src/ios/RegulaConfig.m +19 -0
- package/www/DocumentReader.js +82 -35
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug Report
|
|
3
|
+
about: Create a report to help us improve
|
|
4
|
+
title: "[BR] "
|
|
5
|
+
labels: bug
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Before Submitting, be sure to**
|
|
11
|
+
- [ ] Update to the latest stable version.
|
|
12
|
+
- [ ] Read and follow the guides described in the [documentation](https://docs.regulaforensics.com?utm_source=github).
|
|
13
|
+
- [ ] Try to reproduce in our demo project.
|
|
14
|
+
- [ ] Search for your issue in the existing GitHub issues.
|
|
15
|
+
|
|
16
|
+
**Bug Description**
|
|
17
|
+
<!--A clear and concise description of what the bug is.-->
|
|
18
|
+
|
|
19
|
+
**Steps To Reproduce**
|
|
20
|
+
<!--
|
|
21
|
+
1. Go to '...'
|
|
22
|
+
2. Click on '....'
|
|
23
|
+
3. Scroll down to '....'
|
|
24
|
+
4. See error
|
|
25
|
+
-->
|
|
26
|
+
|
|
27
|
+
**Expected behavior**
|
|
28
|
+
<!--A clear and concise description of what you expected to happen.-->
|
|
29
|
+
|
|
30
|
+
**Screenshots**
|
|
31
|
+
<!--If applicable, add screenshots to help explain your issue.-->
|
|
32
|
+
|
|
33
|
+
**Environment:**
|
|
34
|
+
- Device: <!--[e.g. iPhone 12]-->
|
|
35
|
+
- OS: <!--[e.g. iOS]-->
|
|
36
|
+
- OS version: <!--[e.g. 10.0]-->
|
|
37
|
+
|
|
38
|
+
**Additional context**
|
|
39
|
+
<!--Add any other context about the problem here.-->
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature Request
|
|
3
|
+
about: Suggest an idea for this product
|
|
4
|
+
title: "[FR] "
|
|
5
|
+
labels: enhancement
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Is your feature request related to a problem? Please describe.**
|
|
11
|
+
<!--A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]-->
|
|
12
|
+
|
|
13
|
+
**Describe the solution you'd like**
|
|
14
|
+
<!--A clear and concise description of what you want to happen.-->
|
|
15
|
+
|
|
16
|
+
**Describe alternatives you've considered**
|
|
17
|
+
<!--A clear and concise description of any alternative solutions or features you've considered.-->
|
|
18
|
+
|
|
19
|
+
**Additional context**
|
|
20
|
+
<!--Add any other context or screenshots about the feature request here.-->
|
package/README.md
CHANGED
|
@@ -12,17 +12,17 @@ This repository contains the source code of the Document Reader API, and the sam
|
|
|
12
12
|
* [Additional information](#additional-information)
|
|
13
13
|
|
|
14
14
|
## How to build the demo application
|
|
15
|
-
1. Visit [
|
|
15
|
+
1. Visit [client.regulaforensics.com](https://client.regulaforensics.com) to get a trial license (`regula.license` file). The license creation wizard will guide you through the necessary steps.
|
|
16
16
|
2. Download or clone current repository using the command `git clone https://github.com/regulaforensics/DocumentReader-Cordova-Plugin.git`.
|
|
17
17
|
3. Run the following commands in Terminal:
|
|
18
18
|
```bash
|
|
19
19
|
$ cd example
|
|
20
20
|
$ npm install
|
|
21
|
+
$ npx jetify
|
|
21
22
|
$ cordova prepare
|
|
22
23
|
```
|
|
23
24
|
|
|
24
25
|
4. Copy the `regula.license` file to the `example/www` folder.
|
|
25
|
-
5. Change the application ID to the one you have specified during the registration at [licensing.regulaforensics.com](https://licensing.regulaforensics.com).
|
|
26
26
|
6. Android:
|
|
27
27
|
* Run `cordova run android` inside `example` folder - this is just one way to run the app. You can also run it directly from within Android Studio.
|
|
28
28
|
|
|
@@ -35,7 +35,6 @@ $ cordova prepare
|
|
|
35
35
|
### Troubleshooting license issues
|
|
36
36
|
If you have issues with license verification when running the application, please verify that next is true:
|
|
37
37
|
1. The OS, which you use, is specified in the license (e.g., Android and/or iOS).
|
|
38
|
-
2. The application (Bundle) ID, which you use, is specified in the license.
|
|
39
38
|
3. The license is valid (not expired).
|
|
40
39
|
4. The date and time on the device, where you run the application, are valid.
|
|
41
40
|
5. You use the latest release version of the Document Reader SDK.
|
package/example/config.xml
CHANGED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
<allow-intent href="mailto:*" />
|
|
18
18
|
<allow-intent href="geo:*" />
|
|
19
19
|
<platform name="android">
|
|
20
|
+
<preference name="AndroidXEnabled" value="true" />
|
|
20
21
|
<allow-intent href="market:*" />
|
|
21
22
|
<config-file parent="/*" target="AndroidManifest.xml">
|
|
22
23
|
<uses-permission android:name="android.permission.NFC" />
|
package/example/package.json
CHANGED
|
@@ -16,12 +16,13 @@
|
|
|
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": "^6.
|
|
20
|
-
"@regulaforensics/cordova-plugin-document-reader-core-fullrfid": "^6.
|
|
19
|
+
"@regulaforensics/cordova-plugin-document-reader-api": "^6.4.0",
|
|
20
|
+
"@regulaforensics/cordova-plugin-document-reader-core-fullrfid": "^6.4.0",
|
|
21
21
|
"cordova-plugin-file": "^6.0.2",
|
|
22
22
|
"cordova-plugin-image-picker": "^1.1.3",
|
|
23
23
|
"cordova-plugin-android-permissions": "1.1.0",
|
|
24
|
-
"cordova-plugin-advanced-http": "3.2.1"
|
|
24
|
+
"cordova-plugin-advanced-http": "3.2.1",
|
|
25
|
+
"jetifier": "^2.0.0"
|
|
25
26
|
},
|
|
26
27
|
"cordova": {
|
|
27
28
|
"plugins": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@regulaforensics/cordova-plugin-document-reader-api",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.4.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="6.
|
|
2
|
+
<plugin id="cordova-plugin-document-reader-api" version="6.4.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="~> 6.
|
|
28
|
+
<pod name="DocumentReader" spec="~> 6.4.2552" />
|
|
29
29
|
</pods>
|
|
30
30
|
</podspec>
|
|
31
31
|
</platform>
|
|
@@ -9,7 +9,7 @@ import android.content.IntentFilter;
|
|
|
9
9
|
import android.graphics.Bitmap;
|
|
10
10
|
import android.nfc.NfcAdapter;
|
|
11
11
|
import android.nfc.tech.IsoDep;
|
|
12
|
-
import
|
|
12
|
+
import androidx.annotation.NonNull;
|
|
13
13
|
import android.os.Bundle;
|
|
14
14
|
import android.util.Base64;
|
|
15
15
|
|
|
@@ -19,10 +19,12 @@ import com.regula.documentreader.api.completions.IDocumentReaderPrepareCompletio
|
|
|
19
19
|
import com.regula.documentreader.api.completions.IRfidPKDCertificateCompletion;
|
|
20
20
|
import com.regula.documentreader.api.completions.IRfidReaderRequest;
|
|
21
21
|
import com.regula.documentreader.api.completions.IRfidTASignatureCompletion;
|
|
22
|
+
import com.regula.documentreader.api.completions.ITccParamsCompletion;
|
|
22
23
|
import com.regula.documentreader.api.enums.DocReaderAction;
|
|
23
24
|
import com.regula.documentreader.api.errors.DocumentReaderException;
|
|
24
25
|
import com.regula.documentreader.api.internal.core.CoreScenarioUtil;
|
|
25
26
|
import com.regula.documentreader.api.params.DocReaderConfig;
|
|
27
|
+
import com.regula.documentreader.api.params.ImageInputData;
|
|
26
28
|
import com.regula.documentreader.api.params.ImageInputParam;
|
|
27
29
|
import com.regula.documentreader.api.params.rfid.PKDCertificate;
|
|
28
30
|
import com.regula.documentreader.api.params.rfid.authorization.PAResourcesIssuer;
|
|
@@ -226,6 +228,9 @@ public class DocumentReader extends CordovaPlugin {
|
|
|
226
228
|
case "stopRFIDReader":
|
|
227
229
|
stopRFIDReader(callback);
|
|
228
230
|
break;
|
|
231
|
+
case "stopRFIDReaderWithErrorMessage":
|
|
232
|
+
stopRFIDReaderWithErrorMessage(callback, args(0));
|
|
233
|
+
break;
|
|
229
234
|
case "stopScanner":
|
|
230
235
|
stopScanner(callback);
|
|
231
236
|
break;
|
|
@@ -325,15 +330,12 @@ public class DocumentReader extends CordovaPlugin {
|
|
|
325
330
|
case "parseCoreResults":
|
|
326
331
|
parseCoreResults(callback, args(0));
|
|
327
332
|
break;
|
|
328
|
-
case "
|
|
329
|
-
|
|
333
|
+
case "setTCCParams":
|
|
334
|
+
setTCCParams(callback, args(0));
|
|
330
335
|
break;
|
|
331
336
|
case "initializeReaderWithDatabase":
|
|
332
337
|
initializeReaderWithDatabase(callback, args(0), args(1));
|
|
333
338
|
break;
|
|
334
|
-
case "recognizeImageFrame":
|
|
335
|
-
recognizeImageFrame(callback, args(0), args(1));
|
|
336
|
-
break;
|
|
337
339
|
case "recognizeImageWithOpts":
|
|
338
340
|
recognizeImageWithOpts(callback, args(0), args(1));
|
|
339
341
|
break;
|
|
@@ -343,12 +345,12 @@ public class DocumentReader extends CordovaPlugin {
|
|
|
343
345
|
case "showScannerWithCameraIDAndOpts":
|
|
344
346
|
showScannerWithCameraIDAndOpts(callback, args(0), args(1));
|
|
345
347
|
break;
|
|
346
|
-
case "recognizeImageWithImageInputParams":
|
|
347
|
-
recognizeImageWithImageInputParams(callback, args(0), args(1));
|
|
348
|
-
break;
|
|
349
348
|
case "recognizeImageWithCameraMode":
|
|
350
349
|
recognizeImageWithCameraMode(callback, args(0), args(1));
|
|
351
350
|
break;
|
|
351
|
+
case "recognizeImagesWithImageInputs":
|
|
352
|
+
recognizeImagesWithImageInputs(callback, args(0));
|
|
353
|
+
break;
|
|
352
354
|
}
|
|
353
355
|
} catch (Exception ignored) {
|
|
354
356
|
}
|
|
@@ -439,6 +441,10 @@ public class DocumentReader extends CordovaPlugin {
|
|
|
439
441
|
callback.success(Instance().version.database.documentsNumber);
|
|
440
442
|
}
|
|
441
443
|
|
|
444
|
+
private void setTCCParams(Callback callback, final JSONObject params) {
|
|
445
|
+
Instance().setTccParams(JSONConstructor.TCCParamsFromJSON(params), getTCCParamsCompletion(callback));
|
|
446
|
+
}
|
|
447
|
+
|
|
442
448
|
private void deinitializeReader(Callback callback) {
|
|
443
449
|
Instance().deinitializeReader();
|
|
444
450
|
callback.success();
|
|
@@ -518,10 +524,6 @@ public class DocumentReader extends CordovaPlugin {
|
|
|
518
524
|
callback.success();
|
|
519
525
|
}
|
|
520
526
|
|
|
521
|
-
private void recognizeImageWithImageInputParams(@SuppressWarnings("unused") Callback callback, String base64Image, final JSONObject params) throws JSONException {
|
|
522
|
-
Instance().recognizeImage(Helpers.bitmapFromBase64(base64Image), new ImageInputParam(params.getInt("width"), params.getInt("height"), params.getInt("type")), getCompletion());
|
|
523
|
-
}
|
|
524
|
-
|
|
525
527
|
private void recognizeImageWithOpts(Callback callback, String base64Image, final JSONObject opts) throws JSONException {
|
|
526
528
|
RegulaConfig.setConfig(Instance(), opts, getContext());
|
|
527
529
|
recognizeImage(callback, base64Image);
|
|
@@ -540,6 +542,14 @@ public class DocumentReader extends CordovaPlugin {
|
|
|
540
542
|
Instance().recognizeImages(images, getCompletion());
|
|
541
543
|
}
|
|
542
544
|
|
|
545
|
+
private void recognizeImagesWithImageInputs(@SuppressWarnings("unused") Callback callback, JSONArray base64Images) throws JSONException {
|
|
546
|
+
stopBackgroundRFID();
|
|
547
|
+
ImageInputData[] images = new ImageInputData[base64Images.length()];
|
|
548
|
+
for (int i = 0; i < images.length; i++)
|
|
549
|
+
images[i] = JSONConstructor.ImageInputDataFromJSON(base64Images.getJSONObject(i));
|
|
550
|
+
Instance().recognizeImages(images, getCompletion());
|
|
551
|
+
}
|
|
552
|
+
|
|
543
553
|
private void removeDatabase(Callback callback) {
|
|
544
554
|
callback.success(Instance().removeDatabase(getContext()));
|
|
545
555
|
}
|
|
@@ -573,10 +583,6 @@ public class DocumentReader extends CordovaPlugin {
|
|
|
573
583
|
callback.success();
|
|
574
584
|
}
|
|
575
585
|
|
|
576
|
-
private void recognizeImageFrame(@SuppressWarnings("unused") Callback callback, String base64Image, final JSONObject opts) throws JSONException {
|
|
577
|
-
Instance().recognizeImageFrame(Helpers.bitmapFromBase64(base64Image), new ImageInputParam(opts.getInt("width"), opts.getInt("height"), opts.getInt("type")), getCompletion());
|
|
578
|
-
}
|
|
579
|
-
|
|
580
586
|
private void recognizeVideoFrame(@SuppressWarnings("unused") Callback callback, String byteString, final JSONObject opts) throws JSONException {
|
|
581
587
|
stopBackgroundRFID();
|
|
582
588
|
Instance().recognizeVideoFrame(byteString.getBytes(), new ImageInputParam(opts.getInt("width"), opts.getInt("height"), opts.getInt("type")), getCompletion());
|
|
@@ -695,14 +701,13 @@ public class DocumentReader extends CordovaPlugin {
|
|
|
695
701
|
callback.error("getCameraSessionIsPaused() is an ios-only method");
|
|
696
702
|
}
|
|
697
703
|
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
callback.error("recognizeImageWithCameraMode() is an ios-only method");
|
|
704
|
+
private void stopRFIDReaderWithErrorMessage(Callback callback, String message) {
|
|
705
|
+
callback.error("stopRFIDReaderWithErrorMessage() is an ios-only method");
|
|
701
706
|
}
|
|
702
707
|
|
|
703
708
|
@SuppressWarnings("unused")
|
|
704
|
-
private void
|
|
705
|
-
callback.error("
|
|
709
|
+
private void recognizeImageWithCameraMode(Callback callback, String base64, boolean mode) {
|
|
710
|
+
callback.error("recognizeImageWithCameraMode() is an ios-only method");
|
|
706
711
|
}
|
|
707
712
|
|
|
708
713
|
@SuppressWarnings("unused")
|
|
@@ -752,6 +757,15 @@ public class DocumentReader extends CordovaPlugin {
|
|
|
752
757
|
};
|
|
753
758
|
}
|
|
754
759
|
|
|
760
|
+
private ITccParamsCompletion getTCCParamsCompletion(Callback callback) {
|
|
761
|
+
return (success, error) -> {
|
|
762
|
+
if (success)
|
|
763
|
+
callback.success("success");
|
|
764
|
+
else
|
|
765
|
+
callback.error("failed: " + error.getMessage());
|
|
766
|
+
};
|
|
767
|
+
}
|
|
768
|
+
|
|
755
769
|
private IRfidReaderRequest getIRfidReaderRequest() {
|
|
756
770
|
return new IRfidReaderRequest() {
|
|
757
771
|
@Override
|
|
@@ -16,6 +16,8 @@ import com.regula.documentreader.api.enums.eRPRM_Lights;
|
|
|
16
16
|
import com.regula.documentreader.api.errors.DocumentReaderException;
|
|
17
17
|
import com.regula.documentreader.api.internal.core.CoreDetailedScenario;
|
|
18
18
|
import com.regula.documentreader.api.params.FaceMetaData;
|
|
19
|
+
import com.regula.documentreader.api.params.ImageInputData;
|
|
20
|
+
import com.regula.documentreader.api.params.rfid.TccParams;
|
|
19
21
|
import com.regula.documentreader.api.params.rfid.authorization.PAAttribute;
|
|
20
22
|
import com.regula.documentreader.api.params.rfid.authorization.PAResourcesIssuer;
|
|
21
23
|
import com.regula.documentreader.api.params.rfid.authorization.TAChallenge;
|
|
@@ -340,6 +342,61 @@ class JSONConstructor {
|
|
|
340
342
|
return result;
|
|
341
343
|
}
|
|
342
344
|
|
|
345
|
+
static TccParams TCCParamsFromJSON(JSONObject input) {
|
|
346
|
+
TccParams result = new TccParams();
|
|
347
|
+
try {
|
|
348
|
+
if (input.has("serviceUrlTA"))
|
|
349
|
+
result.setServiceUrlTA(input.getString("serviceUrlTA"));
|
|
350
|
+
if (input.has("serviceUrlPA"))
|
|
351
|
+
result.setServiceUrlPA(input.getString("serviceUrlPA"));
|
|
352
|
+
if (input.has("pfxCertUrl"))
|
|
353
|
+
result.setPfxCertUrl(input.getString("pfxCertUrl"));
|
|
354
|
+
if (input.has("pfxPassPhrase"))
|
|
355
|
+
result.setPfxPassPhrase(input.getString("pfxPassPhrase"));
|
|
356
|
+
if (input.has("pfxCert"))
|
|
357
|
+
result.setPfxCert(Base64.decode(input.getString("pfxCert"), Base64.DEFAULT));
|
|
358
|
+
} catch (JSONException e) {
|
|
359
|
+
e.printStackTrace();
|
|
360
|
+
}
|
|
361
|
+
return result;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
static ImageInputData ImageInputDataFromJSON(JSONObject input) {
|
|
365
|
+
ImageInputData result = new ImageInputData(null);
|
|
366
|
+
int pageIndex = 0;
|
|
367
|
+
int light = 6;
|
|
368
|
+
int type = 254;
|
|
369
|
+
int width = 0;
|
|
370
|
+
int height = 0;
|
|
371
|
+
Bitmap bitmap;
|
|
372
|
+
byte[] imgBytes;
|
|
373
|
+
|
|
374
|
+
try {
|
|
375
|
+
if(input.has("pageIndex"))
|
|
376
|
+
pageIndex = input.optInt("pageIndex");
|
|
377
|
+
if(input.has("light"))
|
|
378
|
+
pageIndex = input.optInt("light");
|
|
379
|
+
if(input.has("type"))
|
|
380
|
+
pageIndex = input.optInt("type");
|
|
381
|
+
if (input.has("bitmap")) {
|
|
382
|
+
bitmap = Helpers.bitmapFromBase64(input.getString("bitmap"));
|
|
383
|
+
result = new ImageInputData(bitmap, light, pageIndex);
|
|
384
|
+
}
|
|
385
|
+
if (input.has("imgBytes")) {
|
|
386
|
+
JSONArray jsonArray_data = input.getJSONArray("data");
|
|
387
|
+
byte[] data = new byte[jsonArray_data.length()];
|
|
388
|
+
for (int i = 0; i < jsonArray_data.length(); i++)
|
|
389
|
+
data[i] = (byte) jsonArray_data.get(i);
|
|
390
|
+
imgBytes = data;
|
|
391
|
+
result = new ImageInputData(imgBytes, width, height, light, pageIndex);
|
|
392
|
+
}
|
|
393
|
+
} catch (JSONException e) {
|
|
394
|
+
e.printStackTrace();
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
return result;
|
|
398
|
+
}
|
|
399
|
+
|
|
343
400
|
static Throwable ThrowableFromJSON(JSONObject jsonObject) {
|
|
344
401
|
return new Throwable();
|
|
345
402
|
}
|
|
@@ -1164,6 +1221,23 @@ class JSONConstructor {
|
|
|
1164
1221
|
return result;
|
|
1165
1222
|
}
|
|
1166
1223
|
|
|
1224
|
+
static JSONObject generateImageInputData(ImageInputData input) {
|
|
1225
|
+
JSONObject result = new JSONObject();
|
|
1226
|
+
if (input == null) return result;
|
|
1227
|
+
try {
|
|
1228
|
+
result.put("pageIndex", input.getPageIndex());
|
|
1229
|
+
result.put("light", input.getLight());
|
|
1230
|
+
result.put("type", input.getType());
|
|
1231
|
+
result.put("width", input.getWidth());
|
|
1232
|
+
result.put("height", input.getHeight());
|
|
1233
|
+
result.put("bitmap", generateBitmap(input.getBitmap()));
|
|
1234
|
+
result.put("imgBytes", generateByteArray(input.getImgBytes()));
|
|
1235
|
+
} catch (JSONException e) {
|
|
1236
|
+
e.printStackTrace();
|
|
1237
|
+
}
|
|
1238
|
+
return result;
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1167
1241
|
static JSONObject generateDocumentReaderResults(DocumentReaderResults input, Context context) {
|
|
1168
1242
|
JSONObject result = new JSONObject();
|
|
1169
1243
|
if (input == null) return result;
|
|
@@ -103,6 +103,8 @@ class RegulaConfig {
|
|
|
103
103
|
editor.setManualMultipageMode(opts.getBoolean("manualMultipageMode"));
|
|
104
104
|
if (opts.has("exposure"))
|
|
105
105
|
editor.setExposure(BigDecimal.valueOf(opts.getDouble("exposure")).floatValue());
|
|
106
|
+
if (opts.has("rfidTimeout"))
|
|
107
|
+
editor.setRfidTimeout(opts.getInt("rfidTimeout"));
|
|
106
108
|
|
|
107
109
|
editor.apply();
|
|
108
110
|
}
|
|
@@ -323,6 +325,16 @@ class RegulaConfig {
|
|
|
323
325
|
editor.setToolbarSize(BigDecimal.valueOf(opts.getDouble("toolbarSize")).floatValue());
|
|
324
326
|
if (opts.has("statusBackgroundColor"))
|
|
325
327
|
editor.setStatusBackgroundColor(opts.getString("statusBackgroundColor"));
|
|
328
|
+
if (opts.has("hologramAnimationImage"))
|
|
329
|
+
editor.setHologramAnimationImage(drawableFromBase64(opts.getString("hologramAnimationImage"), context));
|
|
330
|
+
if (opts.has("hologramAnimationPositionMultiplier"))
|
|
331
|
+
editor.setHologramAnimationPositionMultiplier((float) opts.getDouble("hologramAnimationPositionMultiplier"));
|
|
332
|
+
if (opts.has("hologramAnimationImageMatrix"))
|
|
333
|
+
editor.setHologramAnimationImageMatrix(matrixFromFloatArray(floatArrayFromJson(opts.getJSONArray("hologramAnimationImageMatrix"))));
|
|
334
|
+
if (opts.has("hologramAnimationImageScaleType"))
|
|
335
|
+
editor.setHologramAnimationImageScaleType(ScaleType.valueOf(opts.getString("hologramAnimationImageScaleType")));
|
|
336
|
+
if (opts.has("uiCustomizationLayer"))
|
|
337
|
+
editor.setUiCustomizationLayer(opts.getJSONObject("uiCustomizationLayer"));
|
|
326
338
|
|
|
327
339
|
editor.applyImmediately(context);
|
|
328
340
|
}
|
|
@@ -363,6 +375,7 @@ class RegulaConfig {
|
|
|
363
375
|
object.put("recordScanningProcess", functionality.doRecordProcessingVideo());
|
|
364
376
|
object.put("manualMultipageMode", functionality.isManualMultipageMode());
|
|
365
377
|
object.put("exposure", functionality.getExposure());
|
|
378
|
+
object.put("rfidTimeout", functionality.getRfidTimeout());
|
|
366
379
|
|
|
367
380
|
return object;
|
|
368
381
|
}
|
|
@@ -423,6 +436,11 @@ class RegulaConfig {
|
|
|
423
436
|
object.put("changeFrameButtonCollapseImage", bitmapToBase64String(bitmapFromDrawable(customization.getChangeFrameCollapseButtonDrawable())));
|
|
424
437
|
object.put("toolbarSize", customization.getToolbarSize());
|
|
425
438
|
object.put("statusBackgroundColor", customization.getStatusBackgroundColor());
|
|
439
|
+
object.put("hologramAnimationImage", bitmapToBase64String(bitmapFromDrawable(customization.getHologramAnimationImage())));
|
|
440
|
+
object.put("hologramAnimationPositionMultiplier", customization.getHologramAnimationPositionMultiplier());
|
|
441
|
+
object.put("hologramAnimationImageMatrix", customization.getHologramAnimationImageMatrix());
|
|
442
|
+
object.put("hologramAnimationImageScaleType", customization.getHologramAnimationImageScaleType());
|
|
443
|
+
object.put("uiCustomizationLayer", customization.getUiCustomizationLayer());
|
|
426
444
|
|
|
427
445
|
return object;
|
|
428
446
|
}
|
package/src/android/build.gradle
CHANGED
|
@@ -178,6 +178,8 @@ typedef void (^Callback)(NSString* response);
|
|
|
178
178
|
[self startRFIDReader :successCallback :errorCallback];
|
|
179
179
|
else if([action isEqualToString:@"stopRFIDReader"])
|
|
180
180
|
[self stopRFIDReader :successCallback :errorCallback];
|
|
181
|
+
else if([action isEqualToString:@"stopRFIDReaderWithErrorMessage"])
|
|
182
|
+
[self stopRFIDReaderWithErrorMessage :[args objectAtIndex:0] :successCallback :errorCallback];
|
|
181
183
|
else if([action isEqualToString:@"stopScanner"])
|
|
182
184
|
[self stopScanner :successCallback :errorCallback];
|
|
183
185
|
else if([action isEqualToString:@"deinitializeReader"])
|
|
@@ -244,22 +246,20 @@ typedef void (^Callback)(NSString* response);
|
|
|
244
246
|
[self provideTASignature :[args objectAtIndex:0] :successCallback :errorCallback];
|
|
245
247
|
else if([action isEqualToString:@"parseCoreResults"])
|
|
246
248
|
[self parseCoreResults :[args objectAtIndex:0] :successCallback :errorCallback];
|
|
247
|
-
else if([action isEqualToString:@"
|
|
248
|
-
[self
|
|
249
|
+
else if([action isEqualToString:@"setTCCParams"])
|
|
250
|
+
[self setTCCParams :[args objectAtIndex:0] :successCallback :errorCallback];
|
|
249
251
|
else if([action isEqualToString:@"initializeReaderWithDatabase"])
|
|
250
252
|
[self initializeReaderWithDatabase :[args objectAtIndex:0] :[args objectAtIndex:1] :successCallback :errorCallback];
|
|
251
|
-
else if([action isEqualToString:@"recognizeImageFrame"])
|
|
252
|
-
[self recognizeImageFrame :[args objectAtIndex:0] :[args objectAtIndex:1] :successCallback :errorCallback];
|
|
253
253
|
else if([action isEqualToString:@"recognizeImageWithOpts"])
|
|
254
254
|
[self recognizeImageWithOpts :[args objectAtIndex:0] :[args objectAtIndex:1] :successCallback :errorCallback];
|
|
255
255
|
else if([action isEqualToString:@"recognizeVideoFrame"])
|
|
256
256
|
[self recognizeVideoFrame :[args objectAtIndex:0] :[args objectAtIndex:1] :successCallback :errorCallback];
|
|
257
257
|
else if([action isEqualToString:@"showScannerWithCameraIDAndOpts"])
|
|
258
258
|
[self showScannerWithCameraIDAndOpts :[args objectAtIndex:0] :[args objectAtIndex:1] :successCallback :errorCallback];
|
|
259
|
-
else if([action isEqualToString:@"recognizeImageWithImageInputParams"])
|
|
260
|
-
[self recognizeImageWithImageInputParams :[args objectAtIndex:0] :[args objectAtIndex:1] :successCallback :errorCallback];
|
|
261
259
|
else if([action isEqualToString:@"recognizeImageWithCameraMode"])
|
|
262
260
|
[self recognizeImageWithCameraMode :[args objectAtIndex:0] :[args objectAtIndex:1] :successCallback :errorCallback];
|
|
261
|
+
else if([action isEqualToString:@"recognizeImagesWithImageInputs"])
|
|
262
|
+
[self recognizeImagesWithImageInputs :[args objectAtIndex:0] :successCallback :errorCallback];
|
|
263
263
|
else
|
|
264
264
|
[self result:[NSString stringWithFormat:@"%@/%@", @"method not implemented: ", action] :errorCallback];
|
|
265
265
|
}
|
|
@@ -282,8 +282,10 @@ typedef void (^Callback)(NSString* response);
|
|
|
282
282
|
[self result:@"showScannerWithCameraID() is an android-only method" :errorCallback];
|
|
283
283
|
}
|
|
284
284
|
|
|
285
|
-
- (void)
|
|
286
|
-
[
|
|
285
|
+
- (void) stopRFIDReaderWithErrorMessage:(NSMutableString*)message :(Callback)successCallback :(Callback)errorCallback{
|
|
286
|
+
[RGLDocReader.shared stopRFIDReaderWithErrorMessage:message completion:^() {
|
|
287
|
+
[self result:@"" :successCallback];
|
|
288
|
+
}];
|
|
287
289
|
}
|
|
288
290
|
|
|
289
291
|
- (void) recognizeImageWithOpts:(NSString*)base64 :(NSDictionary*)opts :(Callback)successCallback :(Callback)errorCallback{
|
|
@@ -298,10 +300,6 @@ typedef void (^Callback)(NSString* response);
|
|
|
298
300
|
[self result:@"showScannerWithCameraIDAndOpts() is an android-only method" :errorCallback];
|
|
299
301
|
}
|
|
300
302
|
|
|
301
|
-
- (void) recognizeImageWithImageInputParams:(NSString*)base64 :(NSDictionary*)params :(Callback)successCallback :(Callback)errorCallback{
|
|
302
|
-
[self result:@"recognizeImageWithImageInputParams() is an android-only method" :errorCallback];
|
|
303
|
-
}
|
|
304
|
-
|
|
305
303
|
- (void) getLicenseMessage:(Callback)successCallback :(Callback)errorCallback{
|
|
306
304
|
[self result:@"getLicenseMessage() is an android-only method" :successCallback];
|
|
307
305
|
}
|
|
@@ -324,10 +322,6 @@ typedef void (^Callback)(NSString* response);
|
|
|
324
322
|
});
|
|
325
323
|
}
|
|
326
324
|
|
|
327
|
-
- (void) initializeReaderWithDatabasePath:(NSString*)licenseString :(NSString*)databasePath :(Callback)successCallback :(Callback)errorCallback{
|
|
328
|
-
[RGLDocReader.shared initializeReaderWithConfig:[RGLConfig configWithLicenseData:[[NSData alloc] initWithBase64EncodedString:licenseString options:0] licenseUpdateCheck:true databasePath:databasePath delayedNNLoadEnabled:false] completion:[self getInitCompletion :successCallback :errorCallback]];
|
|
329
|
-
}
|
|
330
|
-
|
|
331
325
|
- (void) prepareDatabase:(NSString*)dbID :(Callback)successCallback :(Callback)errorCallback{
|
|
332
326
|
[RGLDocReader.shared prepareDatabase:dbID progressHandler:[self getProgressHandler :successCallback :errorCallback] completion:[self getPrepareCompletion :successCallback :errorCallback]];
|
|
333
327
|
}
|
|
@@ -371,6 +365,15 @@ typedef void (^Callback)(NSString* response);
|
|
|
371
365
|
});
|
|
372
366
|
}
|
|
373
367
|
|
|
368
|
+
- (void) recognizeImagesWithImageInputs:(NSArray*)input :(Callback)successCallback :(Callback)errorCallback{
|
|
369
|
+
NSMutableArray<RGLImageInput*>* images = [[NSMutableArray alloc] init];
|
|
370
|
+
for(__strong NSDictionary* image in input)
|
|
371
|
+
[images addObject:[RGLWJSONConstructor RGLImageInputFromJson: image]];
|
|
372
|
+
dispatch_async(dispatch_get_main_queue(), ^{
|
|
373
|
+
[RGLDocReader.shared recognizeImagesWithImageInputs:images completion:[self getCompletion]];
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
|
|
374
377
|
- (void) recognizeImageWithCameraMode:(NSMutableString*)base64 :(BOOL)cameraMode :(Callback)successCallback :(Callback)errorCallback{
|
|
375
378
|
[self recognizeImageWith :base64 :cameraMode :successCallback :errorCallback];
|
|
376
379
|
}
|
|
@@ -510,6 +513,10 @@ typedef void (^Callback)(NSString* response);
|
|
|
510
513
|
[self result:RGLDocReader.shared.documentReaderStatus :successCallback];
|
|
511
514
|
}
|
|
512
515
|
|
|
516
|
+
- (void) setTCCParams:(NSDictionary*)params :(Callback)successCallback :(Callback)errorCallback{
|
|
517
|
+
[RGLDocReader.shared setTCCParams:[RGLWJSONConstructor RGLTCCParamsFromJson:params] completion:[self getTCCParamsCompletion:successCallback :errorCallback]];
|
|
518
|
+
}
|
|
519
|
+
|
|
513
520
|
- (void) getRfidSessionStatus:(Callback)successCallback :(Callback)errorCallback{
|
|
514
521
|
[self result:RGLDocReader.shared.rfidSessionStatus :successCallback];
|
|
515
522
|
}
|
|
@@ -636,4 +643,13 @@ typedef void (^Callback)(NSString* response);
|
|
|
636
643
|
};
|
|
637
644
|
}
|
|
638
645
|
|
|
646
|
+
-(void (^_Nullable)(BOOL success, NSError * _Nullable error))getTCCParamsCompletion:(Callback)successCallback :(Callback)errorCallback{
|
|
647
|
+
return ^(BOOL success, NSError * _Nullable error) {
|
|
648
|
+
if (success)
|
|
649
|
+
[self result:@"success" :successCallback];
|
|
650
|
+
else
|
|
651
|
+
[self result:[NSString stringWithFormat:@"%@/%@", @"failed: ", error.description] :errorCallback];
|
|
652
|
+
};
|
|
653
|
+
}
|
|
654
|
+
|
|
639
655
|
@end
|
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
+(NSMutableDictionary* _Nonnull)generateRfidNotificationCompletionWithError:(NSInteger)notification : (NSInteger)value;
|
|
12
12
|
+(NSMutableDictionary* _Nonnull)generateNSDictionary:(NSDictionary<NSNumber*, NSNumber*>* _Nullable)input;
|
|
13
13
|
+(RGLPKDCertificate* _Nullable)RGLPKDCertificateFromJson:(NSDictionary* _Nullable) dict;
|
|
14
|
+
+(RGLTCCParams* _Nonnull)RGLTCCParamsFromJson:(NSDictionary* _Nonnull)input;
|
|
15
|
+
+(RGLImageInput* _Nonnull)RGLImageInputFromJson:(NSDictionary* _Nonnull)input;
|
|
14
16
|
+(NSInteger)generateDocReaderAction:(RGLDocReaderAction)action;
|
|
15
17
|
+(NSInteger)generateRFIDCompleteAction:(RGLRFIDCompleteAction)action;
|
|
16
18
|
+(NSInteger)generateRFIDNotificationAction:(RGLRFIDNotificationAction)action;
|
|
@@ -25,6 +25,30 @@
|
|
|
25
25
|
return [[RGLPKDCertificate alloc] initWithBinaryData:binaryData resourceType:type privateKey:privateKey];
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
+(RGLTCCParams*)RGLTCCParamsFromJson:(NSDictionary*)input {
|
|
29
|
+
NSString* serviceTAURLString = [input valueForKey:@"serviceUrlTA"];
|
|
30
|
+
NSString* servicePAURLString = [input valueForKey:@"serviceUrlPA"];
|
|
31
|
+
NSString* pfxCertURLString = [input valueForKey:@"pfxCertUrl"];
|
|
32
|
+
NSString* pfxPassPhrase = [input valueForKey:@"pfxPassPhrase"];
|
|
33
|
+
NSData* pfxCertData = [input objectForKey:@"pfxCert"] != nil ? [[NSData alloc] initWithBase64EncodedString:[input objectForKey:@"pfxCert"] options:0] : nil;
|
|
34
|
+
|
|
35
|
+
return [[RGLTCCParams alloc] initWithServiceTAURLString:serviceTAURLString servicePAURLString:servicePAURLString pfxCertURLString:pfxCertURLString pfxCertData: pfxCertData pfxPassPhrase:pfxPassPhrase];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
+(RGLImageInput*)RGLImageInputFromJson:(NSDictionary*)input {
|
|
39
|
+
NSInteger pageIndex = 0;
|
|
40
|
+
if([input valueForKey:@"pageIndex"] != nil)
|
|
41
|
+
pageIndex = [[input valueForKey:@"pageIndex"] integerValue];
|
|
42
|
+
NSInteger light = 6;
|
|
43
|
+
if([input valueForKey:@"light"] != nil)
|
|
44
|
+
pageIndex = [[input valueForKey:@"light"] integerValue];
|
|
45
|
+
if([input valueForKey:@"bitmap"] != nil){
|
|
46
|
+
UIImage* image = [UIImage imageWithData:[[NSData alloc]initWithBase64EncodedString:[input valueForKey:@"bitmap"] options:NSDataBase64DecodingIgnoreUnknownCharacters]];
|
|
47
|
+
return [[RGLImageInput alloc] initWithImage:image light:light pageIndex:pageIndex];
|
|
48
|
+
}
|
|
49
|
+
return nil;
|
|
50
|
+
}
|
|
51
|
+
|
|
28
52
|
+(NSMutableDictionary*)generateCGPoint:(CGPoint)input {
|
|
29
53
|
NSMutableDictionary *result = [NSMutableDictionary new];
|
|
30
54
|
|
|
@@ -97,6 +121,9 @@
|
|
|
97
121
|
case RGLDocReaderActionError:
|
|
98
122
|
result = 3;
|
|
99
123
|
break;
|
|
124
|
+
case RGLDocReaderActionProcessTimeout:
|
|
125
|
+
result = 10;
|
|
126
|
+
break;
|
|
100
127
|
default:
|
|
101
128
|
break;
|
|
102
129
|
}
|
|
@@ -108,7 +135,7 @@
|
|
|
108
135
|
NSInteger result = 0;
|
|
109
136
|
switch (input) {
|
|
110
137
|
case RGLRFIDCompleteActionComplete:
|
|
111
|
-
result =
|
|
138
|
+
result = 999;
|
|
112
139
|
break;
|
|
113
140
|
case RGLRFIDCompleteActionError:
|
|
114
141
|
result = 3;
|
|
@@ -126,6 +153,29 @@
|
|
|
126
153
|
return result;
|
|
127
154
|
}
|
|
128
155
|
|
|
156
|
+
+(NSNumber*)generateRGLImageQualityCheckType:(RGLImageQualityCheckType)value {
|
|
157
|
+
if(value == RGLImageQualityCheckTypeImageGlares)
|
|
158
|
+
return @0;
|
|
159
|
+
else if(value == RGLImageQualityCheckTypeImageFocus)
|
|
160
|
+
return @1;
|
|
161
|
+
else if(value == RGLImageQualityCheckTypeImageResolution)
|
|
162
|
+
return @2;
|
|
163
|
+
else if(value == RGLImageQualityCheckTypeImageColorness)
|
|
164
|
+
return @3;
|
|
165
|
+
else if(value == RGLImageQualityCheckTypeImagePerspective)
|
|
166
|
+
return @4;
|
|
167
|
+
else if(value == RGLImageQualityCheckTypeImageBounds)
|
|
168
|
+
return @5;
|
|
169
|
+
else if(value == RGLImageQualityCheckTypeScreenCapture)
|
|
170
|
+
return @6;
|
|
171
|
+
else if(value == RGLImageQualityCheckTypePortrait)
|
|
172
|
+
return @7;
|
|
173
|
+
else if(value == RGLImageQualityCheckTypeHandwritten)
|
|
174
|
+
return @8;
|
|
175
|
+
else
|
|
176
|
+
return @0;
|
|
177
|
+
}
|
|
178
|
+
|
|
129
179
|
+(NSInteger)generateRFIDNotificationAction:(RGLRFIDNotificationAction)input {
|
|
130
180
|
return 5;
|
|
131
181
|
}
|
|
@@ -145,6 +195,9 @@
|
|
|
145
195
|
case 3:
|
|
146
196
|
result[@"results"] = [self generateRGLDocumentReaderResults:results];
|
|
147
197
|
break;
|
|
198
|
+
case 10:
|
|
199
|
+
result[@"results"] = [self generateRGLDocumentReaderResults:results];
|
|
200
|
+
break;
|
|
148
201
|
case 5:
|
|
149
202
|
result[@"results"] = [self generateResultsWithNotification:[self generateRGLRFIDNotify:notify]];
|
|
150
203
|
break;
|
|
@@ -154,7 +207,7 @@
|
|
|
154
207
|
case 8:
|
|
155
208
|
result[@"results"] = [self generateRGLDocumentReaderResults:results];
|
|
156
209
|
break;
|
|
157
|
-
case
|
|
210
|
+
case 999:
|
|
158
211
|
result[@"results"] = [self generateResultsWithRFID :results :1];
|
|
159
212
|
action = 1;
|
|
160
213
|
break;
|
|
@@ -390,7 +443,7 @@
|
|
|
390
443
|
NSMutableDictionary *result = [NSMutableDictionary new];
|
|
391
444
|
if(input == nil) return result;
|
|
392
445
|
|
|
393
|
-
result[@"type"] =
|
|
446
|
+
result[@"type"] = [self generateRGLImageQualityCheckType:input.type];
|
|
394
447
|
result[@"result"] = @(input.result);
|
|
395
448
|
result[@"featureType"] = @(input.featureType);
|
|
396
449
|
result[@"boundRects"] = [self generateNSArrayCGRect:input.boundRects];
|
package/src/ios/RegulaConfig.m
CHANGED
|
@@ -299,6 +299,12 @@
|
|
|
299
299
|
image.colornessCheck = [dict valueForKey:@"colornessCheck"];
|
|
300
300
|
if([dict valueForKey:@"moireCheck"] != nil)
|
|
301
301
|
image.moireCheck = [dict valueForKey:@"moireCheck"];
|
|
302
|
+
if([dict valueForKey:@"expectedPass"] != nil){
|
|
303
|
+
NSMutableArray<RGLImageQualityCheckType> *expectedPass = [NSMutableArray new];
|
|
304
|
+
for(NSString* str in [dict valueForKey:@"expectedPass"])
|
|
305
|
+
[expectedPass addObject:str];
|
|
306
|
+
image.expectedPass = expectedPass;
|
|
307
|
+
}
|
|
302
308
|
|
|
303
309
|
return image;
|
|
304
310
|
}
|
|
@@ -313,6 +319,7 @@
|
|
|
313
319
|
result[@"glaresCheck"] = input.glaresCheck;
|
|
314
320
|
result[@"colornessCheck"] = input.colornessCheck;
|
|
315
321
|
result[@"moireCheck"] = input.moireCheck;
|
|
322
|
+
result[@"expectedPass"] = input.expectedPass;
|
|
316
323
|
|
|
317
324
|
return result;
|
|
318
325
|
}
|
|
@@ -537,6 +544,14 @@
|
|
|
537
544
|
customization.toolbarSize = [[options valueForKey:@"toolbarSize"] floatValue];
|
|
538
545
|
if([options valueForKey:@"statusBackgroundColor"] != nil)
|
|
539
546
|
customization.statusBackgroundColor = [self getUIColorObjectFromHexString:[options valueForKey:@"statusBackgroundColor"] alpha:1];
|
|
547
|
+
if([options valueForKey:@"hologramAnimationImageContentMode"] != nil)
|
|
548
|
+
customization.hologramAnimationImageContentMode = [self UIViewContentModeWithNSInteger:[[options valueForKey:@"hologramAnimationImageContentMode"] integerValue]];
|
|
549
|
+
if([options valueForKey:@"hologramAnimationPositionMultiplier"] != nil)
|
|
550
|
+
customization.hologramAnimationPositionMultiplier = [[options valueForKey:@"hologramAnimationPositionMultiplier"] floatValue];
|
|
551
|
+
if([options valueForKey:@"hologramAnimationImage"] != nil)
|
|
552
|
+
customization.hologramAnimationImage = [self imageFromBase64:[options valueForKey:@"hologramAnimationImage"]];
|
|
553
|
+
if([options valueForKey:@"uiCustomizationLayer"] != nil)
|
|
554
|
+
customization.customUILayerJSON = [options valueForKey:@"uiCustomizationLayer"];
|
|
540
555
|
}
|
|
541
556
|
|
|
542
557
|
+(void)setFunctionality:(NSDictionary*)options :(RGLFunctionality*)functionality {
|
|
@@ -740,6 +755,10 @@
|
|
|
740
755
|
result[@"cameraFramePortraitAspectRatio"] = [NSNumber numberWithFloat:customization.cameraFramePortraitAspectRatio];
|
|
741
756
|
result[@"cameraFrameLandscapeAspectRatio"] = [NSNumber numberWithFloat:customization.cameraFrameLandscapeAspectRatio];
|
|
742
757
|
result[@"toolbarSize"] = [NSNumber numberWithFloat:customization.toolbarSize];
|
|
758
|
+
result[@"hologramAnimationImageContentMode"] = [NSNumber numberWithInteger:[self NSIntegerWithUIViewContentMode:customization.hologramAnimationImageContentMode]];
|
|
759
|
+
result[@"hologramAnimationPositionMultiplier"] = [NSNumber numberWithFloat:customization.hologramAnimationPositionMultiplier];
|
|
760
|
+
result[@"uiCustomizationLayer"] = customization.customUILayerJSON;
|
|
761
|
+
result[@"hologramAnimationImage"] = [UIImageJPEGRepresentation(customization.hologramAnimationImage, 1.0) base64EncodedStringWithOptions:0];
|
|
743
762
|
if(customization.customLabelStatus != nil)
|
|
744
763
|
result[@"customLabelStatus"] = customization.customLabelStatus.string;
|
|
745
764
|
if(customization.activityIndicatorColor != nil)
|
package/www/DocumentReader.js
CHANGED
|
@@ -983,6 +983,26 @@ class DocumentReaderUvFiberElement {
|
|
|
983
983
|
}
|
|
984
984
|
}
|
|
985
985
|
|
|
986
|
+
class ImageInputData {
|
|
987
|
+
static fromJson(jsonObject) {
|
|
988
|
+
if (jsonObject == null) return null
|
|
989
|
+
const result = new ImageInputData()
|
|
990
|
+
|
|
991
|
+
result.pageIndex = jsonObject["pageIndex"]
|
|
992
|
+
result.light = jsonObject["light"]
|
|
993
|
+
result.type = jsonObject["type"]
|
|
994
|
+
result.width = jsonObject["width"]
|
|
995
|
+
result.height = jsonObject["height"]
|
|
996
|
+
result.bitmap = jsonObject["bitmap"]
|
|
997
|
+
result.imgBytes = []
|
|
998
|
+
if (jsonObject["imgBytes"] != null)
|
|
999
|
+
for (const i in jsonObject["imgBytes"])
|
|
1000
|
+
result.imgBytes.push(jsonObject["imgBytes"][i])
|
|
1001
|
+
|
|
1002
|
+
return result
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
|
|
986
1006
|
class DocumentReaderResults {
|
|
987
1007
|
getTextFieldValueByType({ fieldType, lcid = 0, source = -1, original = false }) {
|
|
988
1008
|
if (this.textResult == null) return null
|
|
@@ -1219,13 +1239,13 @@ const diDocType = {
|
|
|
1219
1239
|
dtIdentityCard: 12,
|
|
1220
1240
|
dtDiplomaticPassport: 13,
|
|
1221
1241
|
dtServicePassport: 14,
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1242
|
+
dtSeamanIdentityDocument: 15,
|
|
1243
|
+
dtIdentityCardForResidence: 16,
|
|
1244
|
+
dtTravelDocument: 17,
|
|
1225
1245
|
dtOther: 99,
|
|
1226
1246
|
dtVisaID2: 29,
|
|
1227
1247
|
dtVisaID3: 30,
|
|
1228
|
-
dtRegistrationCertificate:
|
|
1248
|
+
dtRegistrationCertificate: 206,
|
|
1229
1249
|
dtNationalIdentityCard: 20,
|
|
1230
1250
|
dtSocialIdentityCard: 21,
|
|
1231
1251
|
dtAliensIdentityCard: 22,
|
|
@@ -1242,10 +1262,10 @@ const diDocType = {
|
|
|
1242
1262
|
dtChauffeurLicenseUnder18: 36,
|
|
1243
1263
|
dtChauffeurLicenseUnder21: 37,
|
|
1244
1264
|
dtCommercialDrivingLicense: 38,
|
|
1245
|
-
|
|
1265
|
+
dtCommercialDrivingLicenseInstructionalPermit: 39,
|
|
1246
1266
|
dtCommercialDrivingLicenseUnder18: 40,
|
|
1247
1267
|
dtCommercialDrivingLicenseUnder21: 41,
|
|
1248
|
-
|
|
1268
|
+
dtCommercialInstructionPermit: 42,
|
|
1249
1269
|
dtCommercialNewPermit: 43,
|
|
1250
1270
|
dtConcealedCarryLicense: 44,
|
|
1251
1271
|
dtConcealedFirearmPermit: 45,
|
|
@@ -1253,9 +1273,9 @@ const diDocType = {
|
|
|
1253
1273
|
dtDepartmentOfVeteransAffairsIdentityCard: 47,
|
|
1254
1274
|
dtDiplomaticDrivingLicense: 48,
|
|
1255
1275
|
dtDrivingLicense: 49,
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1276
|
+
dtDrivingLicenseInstructionalPermit: 50,
|
|
1277
|
+
dtDrivingLicenseInstructionalPermitUnder18: 51,
|
|
1278
|
+
dtDrivingLicenseInstructionalPermitUnder21: 52,
|
|
1259
1279
|
dtDrivingLicenseLearnersPermit: 53,
|
|
1260
1280
|
dtDrivingLicenseLearnersPermitUnder18: 54,
|
|
1261
1281
|
dtDrivingLicenseLearnersPermitUnder21: 55,
|
|
@@ -1263,8 +1283,8 @@ const diDocType = {
|
|
|
1263
1283
|
dtDrivingLicenseNoviceUnder18: 57,
|
|
1264
1284
|
dtDrivingLicenseNoviceUnder21: 58,
|
|
1265
1285
|
dtDrivingLicenseRegisteredOffender: 59,
|
|
1266
|
-
|
|
1267
|
-
|
|
1286
|
+
dtDrivingLicenseRestrictedUnder18: 60,
|
|
1287
|
+
dtDrivingLicenseRestrictedUnder21: 61,
|
|
1268
1288
|
dtDrivingLicenseTemporaryVisitor: 62,
|
|
1269
1289
|
dtDrivingLicenseTemporaryVisitorUnder18: 63,
|
|
1270
1290
|
dtDrivingLicenseTemporaryVisitorUnder21: 64,
|
|
@@ -1289,8 +1309,8 @@ const diDocType = {
|
|
|
1289
1309
|
dtGenevaConventionsIdentityCard: 83,
|
|
1290
1310
|
dtGraduatedDrivingLicenseUnder18: 84,
|
|
1291
1311
|
dtGraduatedDrivingLicenseUnder21: 85,
|
|
1292
|
-
|
|
1293
|
-
|
|
1312
|
+
dtGraduatedInstructionPermitUnder18: 86,
|
|
1313
|
+
dtGraduatedInstructionPermitUnder21: 87,
|
|
1294
1314
|
dtGraduatedLicenseUnder18: 88,
|
|
1295
1315
|
dtGraduatedLicenseUnder21: 89,
|
|
1296
1316
|
dtHandgunCarryPermit: 90,
|
|
@@ -1304,16 +1324,16 @@ const diDocType = {
|
|
|
1304
1324
|
dtIdentityCardUnder21: 98,
|
|
1305
1325
|
dtIgnitionInterlockPermit: 100,
|
|
1306
1326
|
dtImmigrantVisa: 101,
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1327
|
+
dtInstructionPermit: 102,
|
|
1328
|
+
dtInstructionPermitUnder18: 103,
|
|
1329
|
+
dtInstructionPermitUnder21: 104,
|
|
1310
1330
|
dtInterimDrivingLicense: 105,
|
|
1311
1331
|
dtInterimIdentityCard: 106,
|
|
1312
1332
|
dtIntermediateDrivingLicense: 107,
|
|
1313
1333
|
dtIntermediateDrivingLicenseUnder18: 108,
|
|
1314
1334
|
dtIntermediateDrivingLicenseUnder21: 109,
|
|
1315
1335
|
dtJuniorDrivingLicense: 110,
|
|
1316
|
-
|
|
1336
|
+
dtLearnerInstructionalPermit: 111,
|
|
1317
1337
|
dtLearnerLicense: 112,
|
|
1318
1338
|
dtLearnerLicenseUnder18: 113,
|
|
1319
1339
|
dtLearnerLicenseUnder21: 114,
|
|
@@ -1350,9 +1370,9 @@ const diDocType = {
|
|
|
1350
1370
|
dtRacingAndGamingComissionCard: 145,
|
|
1351
1371
|
dtRefugeeTravelDocument: 146,
|
|
1352
1372
|
dtRenewalPermit: 147,
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1373
|
+
dtRestrictedCommercialDrivingLicense: 148,
|
|
1374
|
+
dtRestrictedDrivingLicense: 149,
|
|
1375
|
+
dtRestrictedPermit: 150,
|
|
1356
1376
|
dtSeasonalPermit: 151,
|
|
1357
1377
|
dtSeasonalResidentIdentityCard: 152,
|
|
1358
1378
|
dtSeniorCitizenIdentityCard: 153,
|
|
@@ -1362,9 +1382,9 @@ const diDocType = {
|
|
|
1362
1382
|
dtTemporaryDrivingLicenseUnder18: 157,
|
|
1363
1383
|
dtTemporaryDrivingLicenseUnder21: 158,
|
|
1364
1384
|
dtTemporaryIdentityCard: 159,
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1385
|
+
dtTemporaryInstructionPermitIdentityCard: 160,
|
|
1386
|
+
dtTemporaryInstructionPermitIdentityCardUnder18: 161,
|
|
1387
|
+
dtTemporaryInstructionPermitIdentityCardUnder21: 162,
|
|
1368
1388
|
dtTemporaryVisitorDrivingLicense: 163,
|
|
1369
1389
|
dtTemporaryVisitorDrivingLicenseUnder18: 164,
|
|
1370
1390
|
dtTemporaryVisitorDrivingLicenseUnder21: 165,
|
|
@@ -1387,15 +1407,15 @@ const diDocType = {
|
|
|
1387
1407
|
dtCertificateOfCitizenship: 182,
|
|
1388
1408
|
dtAddressCard: 183,
|
|
1389
1409
|
dtAirportImmigrationCard: 184,
|
|
1390
|
-
|
|
1410
|
+
dtAlienRegistrationCard: 185,
|
|
1391
1411
|
dtAPEHCard: 186,
|
|
1392
|
-
|
|
1412
|
+
dtCouponToDrivingLicense: 187,
|
|
1393
1413
|
dtCrewMemberCertificate: 188,
|
|
1394
1414
|
dtDocumentForReturn: 189,
|
|
1395
1415
|
dtECard: 190,
|
|
1396
1416
|
dtEmploymentCard: 191,
|
|
1397
1417
|
dtHKSARImmigrationForm: 192,
|
|
1398
|
-
|
|
1418
|
+
dtImmigrantCard: 193,
|
|
1399
1419
|
dtLabourCard: 194,
|
|
1400
1420
|
dtLaissezPasser: 195,
|
|
1401
1421
|
dtLawyerIdentityCertificate: 196,
|
|
@@ -1407,7 +1427,7 @@ const diDocType = {
|
|
|
1407
1427
|
dtPassportOfficial: 202,
|
|
1408
1428
|
dtPassportProvisional: 203,
|
|
1409
1429
|
dtPassportSpecial: 204,
|
|
1410
|
-
|
|
1430
|
+
dtPermissionToTheLocalBorderTraffic: 205,
|
|
1411
1431
|
dtSEDESOLCard: 207,
|
|
1412
1432
|
dtSocialCard: 208,
|
|
1413
1433
|
dtTBCard: 209,
|
|
@@ -1440,6 +1460,10 @@ const diDocType = {
|
|
|
1440
1460
|
dtInterimInstructionalPermit: 236,
|
|
1441
1461
|
dtCertificateOfCompetency: 237,
|
|
1442
1462
|
dtCertificateOfProficiency: 238,
|
|
1463
|
+
dtTradeLicense: 239,
|
|
1464
|
+
dtPassportPage: 240,
|
|
1465
|
+
dtInvoice: 241,
|
|
1466
|
+
dtPassengerLocatorForm: 242,
|
|
1443
1467
|
}
|
|
1444
1468
|
|
|
1445
1469
|
const DocFormat = {
|
|
@@ -1458,7 +1482,10 @@ const DocReaderAction = {
|
|
|
1458
1482
|
ERROR: 3,
|
|
1459
1483
|
NOTIFICATION: 5,
|
|
1460
1484
|
PROCESS_WHITE_UV_IMAGES: 6,
|
|
1485
|
+
PROCESS_WHITE_FLASHLIGHT: 7,
|
|
1461
1486
|
MORE_PAGES_AVAILABLE: 8,
|
|
1487
|
+
PROCESS_IR_FRAME: 9,
|
|
1488
|
+
TIMEOUT: 10,
|
|
1462
1489
|
}
|
|
1463
1490
|
|
|
1464
1491
|
const DocReaderFrame = {
|
|
@@ -1682,6 +1709,7 @@ const eImageQualityCheckType = {
|
|
|
1682
1709
|
IQC_BOUNDS: 5,
|
|
1683
1710
|
IQC_SCREEN_CAPTURE: 6,
|
|
1684
1711
|
IQC_PORTRAIT: 7,
|
|
1712
|
+
IQC_HANDWRITTEN: 8,
|
|
1685
1713
|
}
|
|
1686
1714
|
|
|
1687
1715
|
const eLDS_ParsingErrorCodes = {
|
|
@@ -3363,7 +3391,7 @@ const eRFID_ErrorCodes = {
|
|
|
3363
3391
|
case -2046820094:
|
|
3364
3392
|
return "LAYER6: ISO7816_B_03 \"Mutual authentication failure\""
|
|
3365
3393
|
case -2046820093:
|
|
3366
|
-
return "
|
|
3394
|
+
return "LAYER6: ISO7816_B_03 \"Mutual authentication failure data\""
|
|
3367
3395
|
case -2046819840:
|
|
3368
3396
|
return "LAYER6: SM failure – MAC missing"
|
|
3369
3397
|
case -2046819839:
|
|
@@ -3499,13 +3527,20 @@ const eRPRM_Lights = {
|
|
|
3499
3527
|
NONE: 0,
|
|
3500
3528
|
RPRM_LIGHT_UV: 128,
|
|
3501
3529
|
RPRM_LIGHT_WHITE_FULL: 6,
|
|
3530
|
+
RPRM_LIGHT_IR: 16777216,
|
|
3531
|
+
RPRM_Light_IR_TOP: 8,
|
|
3532
|
+
RPRM_Light_IR_SIDE: 16,
|
|
3533
|
+
RPRM_Light_IR_Full: 24,
|
|
3534
|
+
RPRM_LIGHT_OVD: 67108864,
|
|
3502
3535
|
|
|
3503
3536
|
getTranslation: function (value) {
|
|
3504
3537
|
switch (value) {
|
|
3505
|
-
case
|
|
3506
|
-
return "UV"
|
|
3507
|
-
case this.RPRM_LIGHT_WHITE_FULL:
|
|
3538
|
+
case 6:
|
|
3508
3539
|
return "Visible light"
|
|
3540
|
+
case 24:
|
|
3541
|
+
return "IR"
|
|
3542
|
+
case 128:
|
|
3543
|
+
return "UV"
|
|
3509
3544
|
default:
|
|
3510
3545
|
return value
|
|
3511
3546
|
}
|
|
@@ -4193,6 +4228,10 @@ const eVisualFieldType = {
|
|
|
4193
4228
|
FT_VACCINATION_CERTIFICATE_IDENTIFIER: 644,
|
|
4194
4229
|
FT_FIRST_NAME: 645,
|
|
4195
4230
|
FT_DATE_OF_ARRIVAL: 646,
|
|
4231
|
+
FT_SECOND_NAME: 647,
|
|
4232
|
+
FT_THIRD_NAME: 648,
|
|
4233
|
+
FT_FOURTH_NAME: 649,
|
|
4234
|
+
FT_LAST_NAME: 650,
|
|
4196
4235
|
|
|
4197
4236
|
getTranslation: function (value) {
|
|
4198
4237
|
switch (value) {
|
|
@@ -5387,7 +5426,15 @@ const eVisualFieldType = {
|
|
|
5387
5426
|
case 645:
|
|
5388
5427
|
return "First name"
|
|
5389
5428
|
case 646:
|
|
5390
|
-
return "
|
|
5429
|
+
return "Date of arrival"
|
|
5430
|
+
case 647:
|
|
5431
|
+
return "Second name"
|
|
5432
|
+
case 648:
|
|
5433
|
+
return "Third name"
|
|
5434
|
+
case 649:
|
|
5435
|
+
return "Fourth name"
|
|
5436
|
+
case 650:
|
|
5437
|
+
return "Last name"
|
|
5391
5438
|
default:
|
|
5392
5439
|
return value
|
|
5393
5440
|
}
|
|
@@ -6048,6 +6095,7 @@ DocumentReader.startNewPage = (successCallback, errorCallback) => cordova.exec(s
|
|
|
6048
6095
|
DocumentReader.startNewSession = (successCallback, errorCallback) => cordova.exec(successCallback, errorCallback, "DocumentReader", "exec", ["startNewSession"])
|
|
6049
6096
|
DocumentReader.startRFIDReader = (successCallback, errorCallback) => cordova.exec(successCallback, errorCallback, "DocumentReader", "exec", ["startRFIDReader"])
|
|
6050
6097
|
DocumentReader.stopRFIDReader = (successCallback, errorCallback) => cordova.exec(successCallback, errorCallback, "DocumentReader", "exec", ["stopRFIDReader"])
|
|
6098
|
+
DocumentReader.stopRFIDReaderWithErrorMessage = (message, successCallback, errorCallback) => cordova.exec(successCallback, errorCallback, "DocumentReader", "exec", ["stopRFIDReaderWithErrorMessage", message])
|
|
6051
6099
|
DocumentReader.stopScanner = (successCallback, errorCallback) => cordova.exec(successCallback, errorCallback, "DocumentReader", "exec", ["stopScanner"])
|
|
6052
6100
|
DocumentReader.deinitializeReader = (successCallback, errorCallback) => cordova.exec(successCallback, errorCallback, "DocumentReader", "exec", ["deinitializeReader"])
|
|
6053
6101
|
DocumentReader.isAuthenticatorAvailableForUse = (successCallback, errorCallback) => cordova.exec(successCallback, errorCallback, "DocumentReader", "exec", ["isAuthenticatorAvailableForUse"])
|
|
@@ -6081,14 +6129,13 @@ DocumentReader.providePACertificates = (certificates, successCallback, errorCall
|
|
|
6081
6129
|
DocumentReader.provideTACertificates = (certificates, successCallback, errorCallback) => cordova.exec(successCallback, errorCallback, "DocumentReader", "exec", ["provideTACertificates", certificates])
|
|
6082
6130
|
DocumentReader.provideTASignature = (certificates, successCallback, errorCallback) => cordova.exec(successCallback, errorCallback, "DocumentReader", "exec", ["provideTASignature", certificates])
|
|
6083
6131
|
DocumentReader.parseCoreResults = (json, successCallback, errorCallback) => cordova.exec(successCallback, errorCallback, "DocumentReader", "exec", ["parseCoreResults", json])
|
|
6084
|
-
DocumentReader.
|
|
6132
|
+
DocumentReader.setTCCParams = (params, successCallback, errorCallback) => cordova.exec(successCallback, errorCallback, "DocumentReader", "exec", ["setTCCParams", params])
|
|
6085
6133
|
DocumentReader.initializeReaderWithDatabase = (license, db, successCallback, errorCallback) => cordova.exec(successCallback, errorCallback, "DocumentReader", "exec", ["initializeReaderWithDatabase", license, db])
|
|
6086
|
-
DocumentReader.recognizeImageFrame = (image, params, successCallback, errorCallback) => cordova.exec(successCallback, errorCallback, "DocumentReader", "exec", ["recognizeImageFrame", image, params])
|
|
6087
6134
|
DocumentReader.recognizeImageWithOpts = (image, options, successCallback, errorCallback) => cordova.exec(successCallback, errorCallback, "DocumentReader", "exec", ["recognizeImageWithOpts", image, options])
|
|
6088
6135
|
DocumentReader.recognizeVideoFrame = (byteString, params, successCallback, errorCallback) => cordova.exec(successCallback, errorCallback, "DocumentReader", "exec", ["recognizeVideoFrame", byteString, params])
|
|
6089
6136
|
DocumentReader.showScannerWithCameraIDAndOpts = (cameraID, options, successCallback, errorCallback) => cordova.exec(successCallback, errorCallback, "DocumentReader", "exec", ["showScannerWithCameraIDAndOpts", cameraID, options])
|
|
6090
|
-
DocumentReader.recognizeImageWithImageInputParams = (image, params, successCallback, errorCallback) => cordova.exec(successCallback, errorCallback, "DocumentReader", "exec", ["recognizeImageWithImageInputParams", image, params])
|
|
6091
6137
|
DocumentReader.recognizeImageWithCameraMode = (image, mode, successCallback, errorCallback) => cordova.exec(successCallback, errorCallback, "DocumentReader", "exec", ["recognizeImageWithCameraMode", image, mode])
|
|
6138
|
+
DocumentReader.recognizeImagesWithImageInputs = (images, successCallback, errorCallback) => cordova.exec(successCallback, errorCallback, "DocumentReader", "exec", ["recognizeImagesWithImageInputs", images])
|
|
6092
6139
|
|
|
6093
6140
|
DocumentReader.DocumentReaderResults = DocumentReaderResults
|
|
6094
6141
|
DocumentReader.Enum = Enum
|