291 lines
12 KiB
Java
291 lines
12 KiB
Java
package com.kofax.mobile.sdk.capture.id;
|
|
|
|
import android.content.Context;
|
|
import com.google.gson.ExclusionStrategy;
|
|
import com.google.gson.FieldAttributes;
|
|
import com.google.gson.GsonBuilder;
|
|
import com.kofax.mobile.sdk._internal.dagger.Injector;
|
|
import com.kofax.mobile.sdk._internal.extraction.IExceptionResponseDeserializer;
|
|
import com.kofax.mobile.sdk._internal.extraction.IJsonExactionHelper;
|
|
import com.kofax.mobile.sdk._internal.impl.IBase64ImageDecoder;
|
|
import com.kofax.mobile.sdk._internal.impl.extraction.kta.KtaJsonExactionHelper;
|
|
import com.kofax.mobile.sdk._internal.impl.extraction.kta.g;
|
|
import com.kofax.mobile.sdk._internal.impl.extraction.onDevice.OnDeviceExtractionServer;
|
|
import com.kofax.mobile.sdk._internal.impl.extraction.onDevice.ee;
|
|
import com.kofax.mobile.sdk._internal.impl.extraction.rtti.RttiJsonExactionHelper;
|
|
import com.kofax.mobile.sdk._internal.impl.extraction.rtti.f;
|
|
import com.kofax.mobile.sdk.capture.extraction.ExceptionResponse;
|
|
import com.kofax.mobile.sdk.capture.model.Id;
|
|
import com.kofax.mobile.sdk.capture.parameter.ExtractionParameters;
|
|
import com.kofax.mobile.sdk.capture.parameter.IParameters;
|
|
import com.kofax.mobile.sdk.capture.parameter.LookAndFeelParameters;
|
|
import com.kofax.mobile.sdk.capture.parameter.ProcessingParameters;
|
|
import com.kofax.mobile.sdk.extract.id.AggregateException;
|
|
import java.io.Serializable;
|
|
import o.InterfaceC13390fZB;
|
|
import o.InterfaceC13391fZD;
|
|
|
|
/* loaded from: classes3.dex */
|
|
public class IdCaptureModule {
|
|
public static final String DEFAULT_PROCESS_STRING = "_DeviceType_2_Do90DegreeRotation_4_DoCropCorrection__DoScaleImageToDPI_500_DoSkewCorrectionPage__DocDimLarge_3.375_DocDimSmall_2.125_LoadSetting_<Property Name=\"CSkewDetect.correct_illumination.Bool\" Value=\"0\" />";
|
|
private static final String Zq = "";
|
|
private static final String Zr = "";
|
|
|
|
@InterfaceC13390fZB(a = IdWorkflowActivity.ID_PARAMETERS)
|
|
public ExtractionParameters getExtractionParameters(ExtractionParameters extractionParameters) {
|
|
return extractionParameters;
|
|
}
|
|
|
|
@InterfaceC13390fZB(a = IdExtractor.ID_EXTRACT_KTA)
|
|
public IExceptionResponseDeserializer getIExceptionResponseDeserializerKta(KtaExceptionResponseDeserializer ktaExceptionResponseDeserializer) {
|
|
return ktaExceptionResponseDeserializer;
|
|
}
|
|
|
|
@InterfaceC13390fZB(a = IdExtractor.ID_EXTRACT_ON_DEVICE)
|
|
public IExceptionResponseDeserializer getIExceptionResponseDeserializerOnDevice(OnDeviceExceptionResponseDeserializer onDeviceExceptionResponseDeserializer) {
|
|
return onDeviceExceptionResponseDeserializer;
|
|
}
|
|
|
|
@InterfaceC13390fZB(a = IdExtractor.ID_EXTRACT_RTTI)
|
|
public IExceptionResponseDeserializer getIExceptionResponseDeserializerRtti(RttiExceptionResponseDeserializer rttiExceptionResponseDeserializer) {
|
|
return rttiExceptionResponseDeserializer;
|
|
}
|
|
|
|
@InterfaceC13390fZB(a = IdExtractor.ID_EXTRACT_KTA)
|
|
public IIdExtractionServer getIIdExtractionServerKta(KtaIdExtractor ktaIdExtractor) {
|
|
return ktaIdExtractor;
|
|
}
|
|
|
|
@InterfaceC13390fZB(a = IdExtractor.ID_EXTRACT_ON_DEVICE)
|
|
public IIdExtractionServer getIIdExtractionServerOnDevice(OnDeviceExtractionServer onDeviceExtractionServer) {
|
|
return onDeviceExtractionServer;
|
|
}
|
|
|
|
@InterfaceC13390fZB(a = IdExtractor.ID_EXTRACT_RTTI)
|
|
public IIdExtractionServer getIIdExtractionServerRtti(RttiIdExtractor rttiIdExtractor) {
|
|
return rttiIdExtractor;
|
|
}
|
|
|
|
@InterfaceC13390fZB(a = IdExtractor.ID_EXTRACT_KTA)
|
|
public IJsonExactionHelper getIJsonExactionHelperKta(KtaJsonExactionHelper ktaJsonExactionHelper) {
|
|
return ktaJsonExactionHelper;
|
|
}
|
|
|
|
@InterfaceC13390fZB(a = IdExtractor.ID_EXTRACT_RTTI)
|
|
public IJsonExactionHelper getIJsonExactionHelperRtti(RttiJsonExactionHelper rttiJsonExactionHelper) {
|
|
return rttiJsonExactionHelper;
|
|
}
|
|
|
|
@InterfaceC13390fZB(a = IdWorkflowActivity.ID_PARAMETERS)
|
|
public IParameters getIParameters(IdParameters idParameters) {
|
|
return idParameters;
|
|
}
|
|
|
|
@InterfaceC13390fZB(a = IdWorkflowActivity.ID_PARAMETERS)
|
|
public LookAndFeelParameters getLookAndFeelParameters(LookAndFeelParameters lookAndFeelParameters) {
|
|
return lookAndFeelParameters;
|
|
}
|
|
|
|
@InterfaceC13390fZB(a = IdExtractor.ID_EXTRACT_ON_DEVICE)
|
|
public IIdDeserializer getIIdDeserializerOnDevice(Context context) {
|
|
return new b(this, context);
|
|
}
|
|
|
|
@InterfaceC13390fZB(a = IdExtractor.ID_EXTRACT_KTA)
|
|
public IIdDeserializer getIIdDeserializerKta(Context context) {
|
|
return new a(this, context);
|
|
}
|
|
|
|
@InterfaceC13390fZB(a = IdExtractor.ID_EXTRACT_RTTI)
|
|
public IIdDeserializer getIIdDeserializerRtti(Context context) {
|
|
return new c(this, context);
|
|
}
|
|
|
|
@InterfaceC13390fZB(a = IdWorkflowActivity.ID_PARAMETERS)
|
|
public ProcessingParameters getProcessingParameters(ProcessingParameters processingParameters) {
|
|
processingParameters.useTargetFrameCrop = true;
|
|
return processingParameters;
|
|
}
|
|
|
|
/* loaded from: classes3.dex */
|
|
class c implements IIdDeserializer {
|
|
private Context V;
|
|
final IdCaptureModule acr;
|
|
|
|
public c(IdCaptureModule idCaptureModule, Context context) {
|
|
this.acr = idCaptureModule;
|
|
this.V = context;
|
|
}
|
|
|
|
@Override // com.kofax.mobile.sdk._internal.extraction.IDeserializer
|
|
/* renamed from: aK, reason: merged with bridge method [inline-methods] */
|
|
public Id deserialize(String str) {
|
|
IBase64ImageDecoder iBase64ImageDecoder = Injector.getInjector(this.V).getIBase64ImageDecoder();
|
|
return new ConventionBasedJsonIdDeserializer(Injector.getInjector(this.V).getIIdFieldNameConvention(), new RttiJsonExactionHelper(), iBase64ImageDecoder, str);
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
/* loaded from: classes3.dex */
|
|
public static class RttiExceptionResponseDeserializer implements IExceptionResponseDeserializer {
|
|
@InterfaceC13391fZD
|
|
public RttiExceptionResponseDeserializer() {
|
|
}
|
|
|
|
/* JADX WARN: Can't rename method to resolve collision */
|
|
@Override // com.kofax.mobile.sdk._internal.extraction.IDeserializer
|
|
public ExceptionResponse deserialize(String str) {
|
|
return new f(str);
|
|
}
|
|
}
|
|
|
|
/* loaded from: classes3.dex */
|
|
class a implements IIdDeserializer {
|
|
private Context V;
|
|
final IdCaptureModule acr;
|
|
|
|
public a(IdCaptureModule idCaptureModule, Context context) {
|
|
this.acr = idCaptureModule;
|
|
this.V = context;
|
|
}
|
|
|
|
@Override // com.kofax.mobile.sdk._internal.extraction.IDeserializer
|
|
/* renamed from: aK, reason: merged with bridge method [inline-methods] */
|
|
public Id deserialize(String str) {
|
|
return new ConventionBasedJsonIdDeserializer(Injector.getInjector(this.V).getIIdFieldNameConvention(), new KtaJsonExactionHelper(), Injector.getInjector(this.V).getIBase64ImageDecoder(), str);
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
/* loaded from: classes3.dex */
|
|
public static class KtaExceptionResponseDeserializer implements IExceptionResponseDeserializer {
|
|
@InterfaceC13391fZD
|
|
public KtaExceptionResponseDeserializer() {
|
|
}
|
|
|
|
/* JADX WARN: Can't rename method to resolve collision */
|
|
@Override // com.kofax.mobile.sdk._internal.extraction.IDeserializer
|
|
public ExceptionResponse deserialize(String str) {
|
|
return new g(str);
|
|
}
|
|
}
|
|
|
|
/* loaded from: classes3.dex */
|
|
class b implements IIdDeserializer {
|
|
private Context V;
|
|
final IdCaptureModule acr;
|
|
|
|
public b(IdCaptureModule idCaptureModule, Context context) {
|
|
this.acr = idCaptureModule;
|
|
this.V = context;
|
|
}
|
|
|
|
@Override // com.kofax.mobile.sdk._internal.extraction.IDeserializer
|
|
/* renamed from: aK, reason: merged with bridge method [inline-methods] */
|
|
public Id deserialize(String str) {
|
|
try {
|
|
return new ConventionBasedJsonIdDeserializer(Injector.getInjector(this.V).getIIdFieldNameConvention(), new ee(), Injector.getInjector(this.V).getIBase64ImageDecoder(), str);
|
|
} catch (Exception e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
|
|
/* loaded from: classes3.dex */
|
|
public static class OnDeviceExceptionResponseDeserializer implements IExceptionResponseDeserializer {
|
|
@InterfaceC13391fZD
|
|
public OnDeviceExceptionResponseDeserializer() {
|
|
}
|
|
|
|
/* JADX WARN: Can't rename method to resolve collision */
|
|
@Override // com.kofax.mobile.sdk._internal.extraction.IDeserializer
|
|
public ExceptionResponse deserialize(String str) {
|
|
return new a((AggregateException) new GsonBuilder().setExclusionStrategies(new ExclusionStrategy(this) { // from class: com.kofax.mobile.sdk.capture.id.IdCaptureModule.OnDeviceExceptionResponseDeserializer.1
|
|
final OnDeviceExceptionResponseDeserializer acs;
|
|
|
|
@Override // com.google.gson.ExclusionStrategy
|
|
public boolean shouldSkipClass(Class<?> cls) {
|
|
return false;
|
|
}
|
|
|
|
{
|
|
this.acs = this;
|
|
}
|
|
|
|
@Override // com.google.gson.ExclusionStrategy
|
|
public boolean shouldSkipField(FieldAttributes fieldAttributes) {
|
|
return fieldAttributes.getName().equalsIgnoreCase("stackState");
|
|
}
|
|
}).create().fromJson(str, AggregateException.class));
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
/* loaded from: classes3.dex */
|
|
public static class a implements ExceptionResponse, Serializable {
|
|
private final AggregateException act;
|
|
|
|
@Override // com.kofax.mobile.sdk.capture.extraction.ExceptionResponse
|
|
public ExceptionResponse innerException() {
|
|
return null;
|
|
}
|
|
|
|
public a(AggregateException aggregateException) {
|
|
this.act = aggregateException;
|
|
}
|
|
|
|
@Override // com.kofax.mobile.sdk.capture.extraction.ExceptionResponse
|
|
public String exceptionMessage() {
|
|
Exception exception = getException();
|
|
if (exception != null) {
|
|
return exception.getMessage();
|
|
}
|
|
return null;
|
|
}
|
|
|
|
@Override // com.kofax.mobile.sdk.capture.extraction.ExceptionResponse
|
|
public String exceptionType() {
|
|
Exception exception = getException();
|
|
if (exception != null) {
|
|
return exception.toString();
|
|
}
|
|
return null;
|
|
}
|
|
|
|
@Override // com.kofax.mobile.sdk.capture.extraction.ExceptionResponse
|
|
public String message() {
|
|
return exceptionMessage();
|
|
}
|
|
|
|
@Override // com.kofax.mobile.sdk.capture.extraction.ExceptionResponse
|
|
public String stackTrace() {
|
|
Exception exception = getException();
|
|
if (exception == null) {
|
|
return null;
|
|
}
|
|
StringBuilder sb = new StringBuilder();
|
|
for (StackTraceElement stackTraceElement : exception.getStackTrace()) {
|
|
sb.append(stackTraceElement.toString());
|
|
}
|
|
return sb.toString();
|
|
}
|
|
|
|
private Exception getException() {
|
|
if (this.act.getFrontException() != null) {
|
|
return this.act.getFrontException();
|
|
}
|
|
return this.act.getBackException();
|
|
}
|
|
}
|
|
}
|
|
|
|
@InterfaceC13390fZB(a = IdExtractor.ID_EXTRACT_RTTI)
|
|
public String getUriRtti() {
|
|
return "";
|
|
}
|
|
|
|
@InterfaceC13390fZB(a = IdExtractor.ID_EXTRACT_KTA)
|
|
public String getUriKta() {
|
|
return "";
|
|
}
|
|
}
|