Skip to content

Commit dfbaa21

Browse files
author
Jenkins
committed
6.2.0
1 parent 3bb79d1 commit dfbaa21

10 files changed

Lines changed: 2996 additions & 1744 deletions

File tree

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.1.2374'
17+
s.dependency 'DocumentReader', '6.2.2422'
1818
s.dependency 'React'
1919
end

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ dependencies {
4949
//noinspection GradleDynamicVersion
5050
implementation 'com.facebook.react:react-native:+'
5151
//noinspection GradleDependency
52-
implementation('com.regula.documentreader:api:6.1.6564') {
52+
implementation('com.regula.documentreader:api:6.2.6717') {
5353
transitive = true
5454
}
5555
}

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

Lines changed: 81 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
import com.regula.documentreader.api.results.authenticity.DocumentReaderAuthenticityCheck;
4343
import com.regula.documentreader.api.results.authenticity.DocumentReaderAuthenticityElement;
4444
import com.regula.documentreader.api.results.authenticity.DocumentReaderAuthenticityResult;
45+
import com.regula.documentreader.api.results.authenticity.DocumentReaderUvFiberElement;
4546
import com.regula.documentreader.api.results.rfid.AccessControlProcedureType;
4647
import com.regula.documentreader.api.results.rfid.Application;
4748
import com.regula.documentreader.api.results.rfid.Attribute;
@@ -606,9 +607,9 @@ static JSONObject generateDocumentReaderNotification(DocumentReaderNotification
606607
JSONObject result = new JSONObject();
607608
if (input == null) return result;
608609
try {
609-
result.put("code", input.code & 0xFFFF0000);
610-
result.put("number", input.code & 0x0000FFFF);
611-
result.put("value", input.value);
610+
result.put("code", input.getNotificationCode());
611+
result.put("attachment", input.getDataFileType());
612+
result.put("value", input.getProgress());
612613
} catch (JSONException e) {
613614
e.printStackTrace();
614615
}
@@ -1141,6 +1142,28 @@ static JSONObject generateBytesData(BytesData input) {
11411142
return result;
11421143
}
11431144

1145+
static JSONObject generateDocumentReaderUvFiberElement(DocumentReaderUvFiberElement input, Context context) {
1146+
JSONObject result = new JSONObject();
1147+
if (input == null) return result;
1148+
try {
1149+
result.put("rectArray", generateList(input.rectArray, JSONConstructor::generateDocReaderFieldRect));
1150+
result.put("rectCount", input.rectCount);
1151+
result.put("expectedCount", input.expectedCount);
1152+
result.put("width", generateIntArray(input.width));
1153+
result.put("length", generateIntArray(input.length));
1154+
result.put("area", generateIntArray(input.area));
1155+
result.put("colorValues", generateIntArray(input.colorValues));
1156+
result.put("status", input.status);
1157+
result.put("elementType", input.elementType);
1158+
result.put("elementDiagnose", input.elementDiagnose);
1159+
result.put("elementTypeName", input.getElementTypeName(context));
1160+
result.put("elementDiagnoseName", input.getElementDiagnoseName(context));
1161+
} catch (JSONException e) {
1162+
e.printStackTrace();
1163+
}
1164+
return result;
1165+
}
1166+
11441167
static JSONObject generateDocumentReaderResults(DocumentReaderResults input, Context context) {
11451168
JSONObject result = new JSONObject();
11461169
if (input == null) return result;
@@ -2172,6 +2195,61 @@ static TAChallenge TAChallengeFromJSON(JSONObject input) {
21722195
return null;
21732196
}
21742197

2198+
static DocumentReaderUvFiberElement DocumentReaderUvFiberElementFromJSON(JSONObject input) {
2199+
try {
2200+
DocumentReaderUvFiberElement result = new DocumentReaderUvFiberElement();
2201+
if (input.has("rectArray")){
2202+
JSONArray jsonArray_rectArray = input.getJSONArray("rectArray");
2203+
List<DocReaderFieldRect> rectArray = new ArrayList<>();
2204+
for (int i = 0; i < jsonArray_rectArray.length(); i++)
2205+
rectArray.add(DocReaderFieldRectFromJSON(jsonArray_rectArray.getJSONObject(i)));
2206+
result.rectArray = rectArray;
2207+
}
2208+
if (input.has("rectCount"))
2209+
result.rectCount = input.getInt("rectCount");
2210+
if (input.has("expectedCount"))
2211+
result.expectedCount = input.getInt("expectedCount");
2212+
if (input.has("width")){
2213+
JSONArray jsonArray_width = input.getJSONArray("width");
2214+
int[] width = new int[jsonArray_width.length()];
2215+
for (int i = 0; i < jsonArray_width.length(); i++)
2216+
width[i] = jsonArray_width.getInt(i);
2217+
result.width = width;
2218+
}
2219+
if (input.has("length")){
2220+
JSONArray jsonArray_length = input.getJSONArray("length");
2221+
int[] length = new int[jsonArray_length.length()];
2222+
for (int i = 0; i < jsonArray_length.length(); i++)
2223+
length[i] = jsonArray_length.getInt(i);
2224+
result.length = length;
2225+
}
2226+
if (input.has("area")){
2227+
JSONArray jsonArray_area = input.getJSONArray("area");
2228+
int[] area = new int[jsonArray_area.length()];
2229+
for (int i = 0; i < jsonArray_area.length(); i++)
2230+
area[i] = jsonArray_area.getInt(i);
2231+
result.area = area;
2232+
}
2233+
if (input.has("colorValues")){
2234+
JSONArray jsonArray_colorValues = input.getJSONArray("colorValues");
2235+
int[] colorValues = new int[jsonArray_colorValues.length()];
2236+
for (int i = 0; i < jsonArray_colorValues.length(); i++)
2237+
colorValues[i] = jsonArray_colorValues.getInt(i);
2238+
result.colorValues = colorValues;
2239+
}
2240+
if (input.has("status"))
2241+
result.status = input.getInt("status");
2242+
if (input.has("elementType"))
2243+
result.elementType = input.getInt("elementType");
2244+
if (input.has("elementDiagnose"))
2245+
result.elementDiagnose = input.getInt("elementDiagnose");
2246+
return result;
2247+
} catch (JSONException e) {
2248+
e.printStackTrace();
2249+
}
2250+
return null;
2251+
}
2252+
21752253
static DocumentReaderResults DocumentReaderResultsFromJSON(JSONObject input) {
21762254
try {
21772255
DocumentReaderResults result = new DocumentReaderResults();

0 commit comments

Comments
 (0)