Skip to content

Commit 27f8a21

Browse files
author
Jenkins
committed
6.8.0
1 parent 28a6352 commit 27f8a21

17 files changed

Lines changed: 394 additions & 183 deletions

RNDocumentReaderApi.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ Pod::Spec.new do |s|
1414
s.source = { :http => 'file:' + __dir__ }
1515
s.ios.deployment_target = '11.0'
1616
s.source_files = "ios/*.{h,m}"
17-
s.dependency 'DocumentReader', '6.7.2863'
17+
s.dependency 'DocumentReader', '6.8.2981'
1818
s.dependency 'React'
1919
end

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ dependencies {
2424
//noinspection GradleDynamicVersion
2525
implementation 'com.facebook.react:react-native:+'
2626
//noinspection GradleDependency
27-
implementation('com.regula.documentreader:api:6.7.8311') {
27+
implementation('com.regula.documentreader:api:6.8.8742') {
2828
transitive = true
2929
}
3030
}

android/src/main/java/com/regula/documentreader/JSONConstructor.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,7 @@ static JSONObject generateDocumentReaderGraphicField(DocumentReaderGraphicField
423423
result.put("fieldType", input.fieldType);
424424
result.put("lightType", input.light);
425425
result.put("pageIndex", input.pageIndex);
426+
result.put("originalPageIndex", input.originalPageIndex);
426427
result.put("fieldName", eGraphicFieldType.getTranslation(context, input.fieldType));
427428
result.put("lightName", eRPRM_Lights.getTranslation(context, input.light));
428429
result.put("value", input.imageBase64());
@@ -575,6 +576,7 @@ static JSONObject generateDocumentReaderDocumentType(DocumentReaderDocumentType
575576
result.put("dType", input.dType);
576577
result.put("dFormat", input.dFormat);
577578
result.put("dMRZ", input.dMRZ);
579+
result.put("isDeprecated", input.isDeprecated);
578580
result.put("name", input.name);
579581
result.put("ICAOCode", input.ICAOCode);
580582
result.put("dDescription", input.dDescription);

android/src/main/java/com/regula/documentreader/RNRegulaDocumentReaderModule.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import android.content.Context;
77
import android.content.Intent;
88
import android.content.IntentFilter;
9+
import android.content.res.Configuration;
10+
import android.content.res.Resources;
911
import android.graphics.Bitmap;
1012
import android.nfc.NfcAdapter;
1113
import android.nfc.tech.IsoDep;
@@ -55,6 +57,7 @@
5557
import java.io.InputStream;
5658
import java.util.ArrayList;
5759
import java.util.List;
60+
import java.util.Locale;
5861

5962
import static com.regula.documentreader.api.DocumentReader.Instance;
6063

@@ -75,6 +78,8 @@ public class RNRegulaDocumentReaderModule extends ReactContextBaseJavaModule imp
7578
private final static String bleOnServiceDisconnectedEvent = "bleOnServiceDisconnectedEvent";
7679
private final static String bleOnDeviceReadyEvent = "bleOnDeviceReadyEvent";
7780

81+
private final static String onCustomButtonTappedEvent = "onCustomButtonTappedEvent";
82+
7883
private static int databaseDownloadProgress = 0;
7984
JSONArray data;
8085
private final ReactContext reactContext;
@@ -191,6 +196,10 @@ private void sendBleOnDeviceReadyEvent() {
191196
send(reactContext, bleOnDeviceReadyEvent, "");
192197
}
193198

199+
private void sendOnCustomButtonTappedEvent(int tag) {
200+
send(reactContext, onCustomButtonTappedEvent, tag + "");
201+
}
202+
194203
private interface Callback {
195204
void success(Object o);
196205

@@ -427,6 +436,12 @@ public void error(String s) {
427436
case "recognizeImagesWithImageInputs":
428437
recognizeImagesWithImageInputs(callback, args(0));
429438
break;
439+
case "setOnCustomButtonTappedListener":
440+
setOnCustomButtonTappedListener(callback);
441+
break;
442+
case "setLanguage":
443+
setLanguage(callback, args(0));
444+
break;
430445
case "textFieldValueByType":
431446
textFieldValueByType(callback, args(0), args(1));
432447
break;
@@ -821,6 +836,21 @@ private void readRFID(@SuppressWarnings("unused") Callback callback) {
821836
startForegroundDispatch(getActivity());
822837
}
823838

839+
private void setOnCustomButtonTappedListener(Callback callback) {
840+
Instance().setOnClickListener(view -> sendOnCustomButtonTappedEvent((int) view.getTag()));
841+
callback.success();
842+
}
843+
844+
private void setLanguage(Callback callback, String language) {
845+
Locale locale = new Locale(language);
846+
Locale.setDefault(locale);
847+
Resources resources = getContext().getResources();
848+
Configuration config = resources.getConfiguration();
849+
config.setLocale(locale);
850+
resources.updateConfiguration(config, resources.getDisplayMetrics());
851+
callback.success();
852+
}
853+
824854
private void providePACertificates(Callback callback, JSONArray certificatesJSON) throws JSONException {
825855
if (paCertificateCompletion == null) {
826856
callback.error("paCertificateCompletion is null");

android/src/main/java/com/regula/documentreader/RegulaConfig.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import com.regula.documentreader.api.params.ParamsCustomization;
1111
import com.regula.documentreader.api.params.Functionality;
1212
import com.regula.documentreader.api.params.ProcessParam;
13+
import com.regula.documentreader.api.params.rfid.RFIDParams;
1314
import com.regula.documentreader.api.params.rfid.ReprocParams;
1415
import com.regula.documentreader.api.params.rfid.dg.DataGroups;
1516

@@ -229,6 +230,10 @@ private static void setProcessParams(ProcessParam processParams, JSONObject opts
229230
processParams.splitNames = opts.getBoolean("splitNames");
230231
if (opts.has("convertCase"))
231232
processParams.convertCase = opts.getInt("convertCase");
233+
if (opts.has("doFlipYAxis"))
234+
processParams.doFlipYAxis = opts.getBoolean("doFlipYAxis");
235+
if (opts.has("rfidParams"))
236+
processParams.rfidParams = RFIDParamsFromJSON(opts.getJSONObject("rfidParams"));
232237
}
233238

234239
private static void setCustomization(ParamsCustomization customization, JSONObject opts, Context context) throws JSONException {
@@ -251,6 +256,8 @@ private static void setCustomization(ParamsCustomization customization, JSONObje
251256
editor.setMultipageButtonBackgroundColor(opts.getString("multipageButtonBackgroundColor"));
252257
if (opts.has("tintColor"))
253258
editor.setTintColor(opts.getString("tintColor"));
259+
if (opts.has("cameraPreviewBackgroundColor"))
260+
editor.setCameraPreviewBackgroundColor(opts.getString("cameraPreviewBackgroundColor"));
254261
if (opts.has("activityIndicatorColor"))
255262
editor.setActivityIndicatorColor(opts.getString("activityIndicatorColor"));
256263
if (opts.has("showStatusMessages"))
@@ -351,6 +358,8 @@ private static void setCustomization(ParamsCustomization customization, JSONObje
351358
editor.setHologramAnimationImageScaleType(ScaleType.valueOf(opts.getString("hologramAnimationImageScaleType")));
352359
if (opts.has("uiCustomizationLayer"))
353360
editor.setUiCustomizationLayer(opts.getJSONObject("uiCustomizationLayer"));
361+
if (opts.has("activityIndicatorSize"))
362+
editor.setActivityIndicatorSize(opts.getInt("activityIndicatorSize"));
354363

355364
editor.applyImmediately(context);
356365
}
@@ -400,6 +409,7 @@ private static JSONObject getCustomization(ParamsCustomization customization) th
400409
object.put("resultStatus", customization.getResultStatus());
401410
object.put("cameraFrameDefaultColor", customization.getCameraFrameDefaultColor());
402411
object.put("cameraFrameActiveColor", customization.getCameraFrameActiveColor());
412+
object.put("cameraPreviewBackgroundColor", customization.getCameraPreviewBackgroundColor());
403413
object.put("statusTextColor", customization.getStatusTextColor());
404414
object.put("resultStatusTextColor", customization.getResultStatusTextColor());
405415
object.put("resultStatusBackgroundColor", customization.getResultStatusBackgroundColor());
@@ -455,6 +465,7 @@ private static JSONObject getCustomization(ParamsCustomization customization) th
455465
object.put("hologramAnimationImageMatrix", customization.getHologramAnimationImageMatrix());
456466
object.put("hologramAnimationImageScaleType", customization.getHologramAnimationImageScaleType());
457467
object.put("uiCustomizationLayer", customization.getUiCustomizationLayer());
468+
object.put("activityIndicatorSize", customization.getActivityIndicatorSize());
458469

459470
return object;
460471
}
@@ -519,6 +530,7 @@ private static JSONObject getProcessParams(ProcessParam processParams) throws JS
519530
object.put("respectImageQuality", processParams.respectImageQuality);
520531
object.put("splitNames", processParams.splitNames);
521532
object.put("convertCase", processParams.convertCase);
533+
object.put("doFlipYAxis", processParams.doFlipYAxis);
522534

523535
return object;
524536
}
@@ -713,4 +725,18 @@ private static OnlineProcessingConfig OnlineProcessingConfigFromJSON(JSONObject
713725
}
714726
return null;
715727
}
728+
729+
private static RFIDParams RFIDParamsFromJSON(JSONObject input) {
730+
try {
731+
RFIDParams result = new RFIDParams();
732+
733+
if (input.has("paIgnoreNotificationCodes"))
734+
result.setPaIgnoreNotificationCodes(JSONConstructor.intArrayFromJSON(input.getJSONArray("paIgnoreNotificationCodes")));
735+
736+
return result;
737+
} catch (JSONException e) {
738+
e.printStackTrace();
739+
}
740+
return null;
741+
}
716742
}

example/App.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export default class App extends Component {
4949
eventManager.addListener('completionEvent', e => this.handleCompletion(DocumentReaderCompletion.fromJson(JSON.parse(e["msg"]))))
5050
eventManager.addListener('rfidNotificationCompletionEvent', e => console.log("rfidNotificationCompletionEvent: " + e["msg"]))
5151
eventManager.addListener('paCertificateCompletionEvent', e => console.log("paCertificateCompletionEvent: " + e["msg"]))
52+
eventManager.addListener('onCustomButtonTappedEvent', e => console.log("onCustomButtonTappedEvent: " + e["msg"]))
5253
DocumentReader.prepareDatabase("Full", (respond) => {
5354
console.log(respond)
5455
readFile(licPath, 'base64').then((res) => {

example/ios/DocumentReader.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@
502502
"-ObjC",
503503
"-lc++",
504504
);
505-
PRODUCT_BUNDLE_IDENTIFIER = com.regula.dr.fullrfid;
505+
PRODUCT_BUNDLE_IDENTIFIER = regula.DocumentReader;
506506
PRODUCT_NAME = DocumentReader;
507507
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
508508
SWIFT_VERSION = 5.0;
@@ -528,7 +528,7 @@
528528
"-ObjC",
529529
"-lc++",
530530
);
531-
PRODUCT_BUNDLE_IDENTIFIER = com.regula.dr.fullrfid;
531+
PRODUCT_BUNDLE_IDENTIFIER = regula.DocumentReader;
532532
PRODUCT_NAME = DocumentReader;
533533
SWIFT_VERSION = 5.0;
534534
VERSIONING_SYSTEM = "apple-generic";

example/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"lint": "eslint ."
1111
},
1212
"dependencies": {
13-
"@regulaforensics/react-native-document-reader-api": "6.7.4",
14-
"@regulaforensics/react-native-document-reader-core-fullrfid": "6.7.0",
13+
"@regulaforensics/react-native-document-reader-api": "6.8.0",
14+
"@regulaforensics/react-native-document-reader-core-fullrfid": "6.8.0",
1515
"react": "17.0.2",
1616
"react-native": "^0.67.0",
1717
"react-native-check-box": "^2.1.7",

index.d.ts

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ export class DocumentReaderGraphicField {
134134
fieldType?: number
135135
lightType?: number
136136
pageIndex?: number
137+
originalPageIndex?: number
137138
fieldName?: string
138139
lightName?: string
139140
value?: string
@@ -147,6 +148,7 @@ export class DocumentReaderGraphicField {
147148
result.fieldType = jsonObject["fieldType"]
148149
result.lightType = jsonObject["lightType"]
149150
result.pageIndex = jsonObject["pageIndex"]
151+
result.originalPageIndex = jsonObject["originalPageIndex"]
150152
result.fieldName = jsonObject["fieldName"]
151153
result.lightName = jsonObject["lightName"]
152154
result.value = jsonObject["value"]
@@ -417,6 +419,7 @@ export class DocumentReaderDocumentType {
417419
dType?: number
418420
dFormat?: number
419421
dMRZ?: boolean
422+
isDeprecated?: boolean
420423
name?: string
421424
ICAOCode?: string
422425
dDescription?: string
@@ -433,6 +436,7 @@ export class DocumentReaderDocumentType {
433436
result.dType = jsonObject["dType"]
434437
result.dFormat = jsonObject["dFormat"]
435438
result.dMRZ = jsonObject["dMRZ"]
439+
result.isDeprecated = jsonObject["isDeprecated"]
436440
result.name = jsonObject["name"]
437441
result.ICAOCode = jsonObject["ICAOCode"]
438442
result.dDescription = jsonObject["dDescription"]
@@ -1143,6 +1147,8 @@ export class ImageInputParam {
11431147
width?: number
11441148
height?: number
11451149
type?: number
1150+
disableFrameShiftIR?: boolean
1151+
doFlipYAxis?: boolean
11461152

11471153
static fromJson(jsonObject?: any): ImageInputParam | undefined {
11481154
if (jsonObject == null || jsonObject == undefined) return undefined
@@ -1151,6 +1157,8 @@ export class ImageInputParam {
11511157
result.width = jsonObject["width"]
11521158
result.height = jsonObject["height"]
11531159
result.type = jsonObject["type"]
1160+
result.disableFrameShiftIR = jsonObject["disableFrameShiftIR"]
1161+
result.doFlipYAxis = jsonObject["doFlipYAxis"]
11541162

11551163
return result
11561164
}
@@ -1813,6 +1821,11 @@ export const eRPRM_Authenticity = {
18131821
KINEGRAM: 131072,
18141822
HOLOGRAMS_DETECTION: 524288,
18151823
MRZ: 8388608,
1824+
STATUS_ONLY: 0x80000000,
1825+
OVI: 0x00000400,
1826+
LIVENESS: 0x00200000,
1827+
OCR: 0x00400000,
1828+
UV: 1 | 4 | 16,
18161829
}
18171830

18181831
export const eRFID_ErrorCodes = {
@@ -2734,6 +2747,7 @@ export const ScenarioIdentifier = {
27342747
SCENARIO_OCR_FREE: "OcrFree",
27352748
SCENARIO_CREDIT_CARD: "CreditCard",
27362749
SCENARIO_CAPTURE: "Capture",
2750+
SCENARIO_BARCODE_AND_LOCATE: "BarcodeAndLocate",
27372751
}
27382752

27392753
export const eRFID_AccessControl_ProcedureType = {
@@ -2936,9 +2950,18 @@ export const eCheckDiagnose = {
29362950
FINISHED_BY_TIMEOUT: 186,
29372951
HOLO_PHOTO_DOCUMENT_OUTSIDE_FRAME: 187,
29382952
LIVENESS_DEPTH_CHECK_FAILED: 190,
2939-
MRZ_QUALITY_WRONG_MRZ_DPI: 200,
2953+
MRZ_QUALITY_WRONG_SYMBOL_POSITION: 200,
29402954
MRZ_QUALITY_WRONG_BACKGROUND: 201,
2941-
LAST_DIAGNOSE_VALUE: 210,
2955+
MRZ_QUALITY_WRONG_MRZ_WIDTH: 202,
2956+
MRZ_QUALITY_WRONG_MRZ_HEIGHT: 203,
2957+
MRZ_QUALITY_WRONG_LINE_POSITION: 204,
2958+
MRZ_QUALITY_WRONG_FONT_TYPE: 205,
2959+
OCR_QUALITY_TEXT_POSITION: 220,
2960+
OCR_QUALITY_INVALID_FONT: 221,
2961+
OCR_QUALITY_INVALID_BACKGROUND: 222,
2962+
LAS_INK_INVALID_LINES_FREQUENCY: 230,
2963+
LAST_DIAGNOSE_VALUE: 250,
2964+
DOC_LIVENESS_ELECTRONIC_DEVICE_DETECTED: 240,
29422965
}
29432966

29442967
export const RFIDDelegate = {
@@ -3712,7 +3735,7 @@ export const BarcodeType = {
37123735
}
37133736

37143737
export const eRPRM_SecurityFeatureType = {
3715-
NONE: -1,
3738+
SECURITY_FEATURE_TYPE_NONE: -1,
37163739
SECURITY_FEATURE_TYPE_BLANK: 0,
37173740
SECURITY_FEATURE_TYPE_FILL: 1,
37183741
SECURITY_FEATURE_TYPE_PHOTO: 2,
@@ -3741,7 +3764,22 @@ export const eRPRM_SecurityFeatureType = {
37413764
SECURITY_FEATURE_TYPE_PHOTO_COLOR: 25,
37423765
SECURITY_FEATURE_TYPE_PHOTO_SHAPE: 26,
37433766
SECURITY_FEATURE_TYPE_PHOTO_CORNERS: 27,
3744-
DOCUMENT_CANCELLING_DETECTOR: 28,
3767+
SECURITY_FEATURE_TYPE_OCR: 28,
3768+
SECURITY_FEATURE_TYPE_PORTRAIT_COMPARISON_EXTVS_VISUAL: 29,
3769+
SECURITY_FEATURE_TYPE_PORTRAIT_COMPARISON_EXTVS_RFID: 30,
3770+
SECURITY_FEATURE_TYPE_PORTRAIT_COMPARISON_EXTVS_LIVE: 31,
3771+
SECURITY_FEATURE_TYPE_LIVENESS_DEPTH: 32,
3772+
SECURITY_FEATURE_TYPE_MICROTEXT: 33,
3773+
SECURITY_FEATURE_TYPE_FLUORESCENT_OBJECT: 34,
3774+
SECURITY_FEATURE_TYPE_LANDMARKS_CHECK: 35,
3775+
SECURITY_FEATURE_TYPE_FACE_PRESENCE: 36,
3776+
SECURITY_FEATURE_TYPE_FACE_ABSENCE: 38,
3777+
SECURITY_FEATURE_TYPE_LIVENESS_SCREEN_CAPTURE: 39,
3778+
SECURITY_FEATURE_TYPE_LIVENESS_ELECTRONIC_DEVICE: 40,
3779+
SECURITY_FEATURE_TYPE_LIVENESS_OVI: 41,
3780+
SECURITY_FEATURE_TYPE_BARCODE_SIZE_CHECK: 42,
3781+
SECURITY_FEATURE_TYPE_LAS_INK: 43,
3782+
SECURITY_FEATURE_TYPE_LIVENESS_MLI: 44,
37453783
}
37463784

37473785
export const OnlineMode = {
@@ -6697,6 +6735,7 @@ export const eRPRM_Lights = {
66976735
RPRM_Light_IR_SIDE: 16,
66986736
RPRM_Light_IR_Full: (8 | 16),
66996737
RPRM_LIGHT_OVD: 67108864,
6738+
RPRM_LIGHT_WHITE_FULL_OVD: (6 | 67108864),
67006739

67016740
getTranslation(value: number) {
67026741
switch (value) {
@@ -6893,4 +6932,6 @@ export default class DocumentReader {
68936932
static showScannerWithCameraIDAndOpts(cameraID: number, options: object, successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
68946933
static recognizeImageWithCameraMode(image: string, mode: boolean, successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
68956934
static recognizeImagesWithImageInputs(images: ImageInputData[], successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
6935+
static setOnCustomButtonTappedListener(successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
6936+
static setLanguage(language: string, successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
68966937
}

0 commit comments

Comments
 (0)