208 lines
7.6 KiB
Java
208 lines
7.6 KiB
Java
package com.kofax.kmc.ken.engines.data;
|
|
|
|
import com.airbnb.deeplinkdispatch.UrlTreeKt;
|
|
import com.kofax.BuildConfig;
|
|
import com.kofax.kmc.ken.engines.version.KenVersion;
|
|
import com.kofax.kmc.kut.utilities.SdkVersion;
|
|
import com.kofax.kmc.kut.utilities.error.ErrorInfo;
|
|
import com.kofax.kmc.kut.utilities.error.KmcException;
|
|
import com.kofax.kmc.kut.utilities.error.KmcRuntimeException;
|
|
import java.io.File;
|
|
import java.io.IOException;
|
|
import java.io.ObjectInputStream;
|
|
import java.io.ObjectOutputStream;
|
|
import java.io.Serializable;
|
|
import o.gjJ;
|
|
|
|
@Deprecated
|
|
/* loaded from: classes3.dex */
|
|
public class ImagePerfectionProfile implements Serializable, Cloneable {
|
|
private static final String dY = "3.0.0.4.0.0";
|
|
private static final String dZ = "3.1.0.0.0.0";
|
|
private static final String ea = "3.1.0.1.0.0";
|
|
private static final long serialVersionUID = 1111562310791364351L;
|
|
private transient String name = "";
|
|
private transient String eb = "";
|
|
private transient String ec = "";
|
|
private transient UseMRZPassportDetection ed = UseMRZPassportDetection.OFF;
|
|
private transient UseTargetFrameCrop ee = UseTargetFrameCrop.OFF;
|
|
private transient UseDocumentDetectionBasedCrop ef = UseDocumentDetectionBasedCrop.OFF;
|
|
|
|
/* loaded from: classes3.dex */
|
|
public enum UseDocumentDetectionBasedCrop {
|
|
OFF,
|
|
ON
|
|
}
|
|
|
|
/* loaded from: classes3.dex */
|
|
public enum UseMRZPassportDetection {
|
|
OFF,
|
|
ON
|
|
}
|
|
|
|
/* loaded from: classes3.dex */
|
|
public enum UseTargetFrameCrop {
|
|
OFF,
|
|
ON
|
|
}
|
|
|
|
/* renamed from: clone, reason: merged with bridge method [inline-methods] */
|
|
public ImagePerfectionProfile m269clone() {
|
|
try {
|
|
return (ImagePerfectionProfile) super.clone();
|
|
} catch (CloneNotSupportedException unused) {
|
|
throw new InternalError("ImagePerfectionProfile: unexpected clone not supported exception");
|
|
}
|
|
}
|
|
|
|
public void setName(String str) {
|
|
a(str, "name");
|
|
this.name = str;
|
|
}
|
|
|
|
public void setIpOperations(String str) {
|
|
a(str, "ipOperations");
|
|
this.eb = str;
|
|
}
|
|
|
|
public void setIpOperationsFilePath(String str) {
|
|
a(str, "ipOperationsFilePath");
|
|
this.ec = str;
|
|
}
|
|
|
|
public void setUseMRZPassportDetection(UseMRZPassportDetection useMRZPassportDetection) {
|
|
a(useMRZPassportDetection, "useMRZPassportDetection");
|
|
this.ed = useMRZPassportDetection;
|
|
}
|
|
|
|
public void setUseTargetFrameCrop(UseTargetFrameCrop useTargetFrameCrop) {
|
|
a(useTargetFrameCrop, "useTargetFrameCrop");
|
|
this.ee = useTargetFrameCrop;
|
|
}
|
|
|
|
public void setUseDocumentDetectionBasedCrop(UseDocumentDetectionBasedCrop useDocumentDetectionBasedCrop) {
|
|
a(this.ee, "useDocumentDetectionBasedCrop");
|
|
this.ef = useDocumentDetectionBasedCrop;
|
|
}
|
|
|
|
private void writeObject(ObjectOutputStream objectOutputStream) throws IOException {
|
|
objectOutputStream.defaultWriteObject();
|
|
objectOutputStream.writeObject(ImagePerfectionProfile.class.getName());
|
|
objectOutputStream.writeObject(KenVersion.getPackageVersion());
|
|
objectOutputStream.writeObject(this.name);
|
|
objectOutputStream.writeObject(this.eb);
|
|
objectOutputStream.writeObject(this.ec);
|
|
objectOutputStream.writeObject(this.ed);
|
|
objectOutputStream.writeObject(this.ee);
|
|
objectOutputStream.writeObject(this.ef);
|
|
}
|
|
|
|
private void readObject(ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException, KmcRuntimeException {
|
|
objectInputStream.defaultReadObject();
|
|
if (ImagePerfectionProfile.class.getName().compareToIgnoreCase((String) objectInputStream.readObject()) == 0) {
|
|
String str = (String) objectInputStream.readObject();
|
|
if (SdkVersion.versionCompatible(KenVersion.getPackageVersion(), str).booleanValue()) {
|
|
this.name = (String) objectInputStream.readObject();
|
|
this.eb = (String) objectInputStream.readObject();
|
|
this.ec = (String) objectInputStream.readObject();
|
|
if (SdkVersion.versionCompatible(str, dZ).booleanValue()) {
|
|
this.ed = (UseMRZPassportDetection) objectInputStream.readObject();
|
|
}
|
|
if (SdkVersion.versionCompatible(str, dY).booleanValue()) {
|
|
this.ee = (UseTargetFrameCrop) objectInputStream.readObject();
|
|
}
|
|
if (SdkVersion.versionCompatible(str, ea).booleanValue()) {
|
|
this.ef = (UseDocumentDetectionBasedCrop) objectInputStream.readObject();
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
throw new KmcRuntimeException(ErrorInfo.KMC_GN_DESERIALIZE_VERSION_ERROR);
|
|
}
|
|
throw new KmcRuntimeException(ErrorInfo.KMC_GN_DESERIALIZE_OBJECT_ERROR);
|
|
}
|
|
|
|
/* loaded from: classes3.dex */
|
|
public class FriendIPP {
|
|
final ImagePerfectionProfile eg;
|
|
|
|
public FriendIPP(ImagePerfectionProfile imagePerfectionProfile, String str) throws KmcException {
|
|
this.eg = imagePerfectionProfile;
|
|
if (!gjJ.c((CharSequence) str, (CharSequence) BuildConfig.APPLICATION_ID)) {
|
|
throw new KmcException(ErrorInfo.KMC_GN_UNSUPPORTED_OPERATION);
|
|
}
|
|
}
|
|
|
|
public String toFinalOpString() throws KmcException {
|
|
String str = this.eg.eb;
|
|
String str2 = this.eg.ec;
|
|
if (gjJ.e(str)) {
|
|
if (!gjJ.e(str2)) {
|
|
if (new File(str2).exists()) {
|
|
if (str == null) {
|
|
str = "";
|
|
}
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append(str);
|
|
sb.append("_LoadOperationsStringTokensFromFile_<");
|
|
String obj = sb.toString();
|
|
StringBuilder sb2 = new StringBuilder();
|
|
sb2.append(obj);
|
|
sb2.append(str2);
|
|
String obj2 = sb2.toString();
|
|
StringBuilder sb3 = new StringBuilder();
|
|
sb3.append(obj2);
|
|
sb3.append(UrlTreeKt.configurablePathSegmentSuffix);
|
|
str = sb3.toString();
|
|
} else {
|
|
throw new KmcException(ErrorInfo.KMC_GN_FILE_NOT_FOUND);
|
|
}
|
|
} else {
|
|
throw new KmcRuntimeException(ErrorInfo.KMC_ED_IMAGE_PERFECTION_PROFILE_EMPTY);
|
|
}
|
|
}
|
|
if (this.eg.ed != UseMRZPassportDetection.ON) {
|
|
return str;
|
|
}
|
|
StringBuilder sb4 = new StringBuilder();
|
|
sb4.append(str);
|
|
sb4.append("_ProcessMrzDoc_");
|
|
return sb4.toString();
|
|
}
|
|
}
|
|
|
|
private void a(Object obj, String str) {
|
|
if (obj != null) {
|
|
return;
|
|
}
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append(str);
|
|
sb.append(" parameter is null");
|
|
throw new NullPointerException(sb.toString());
|
|
}
|
|
|
|
public UseTargetFrameCrop getUseTargetFrameCrop() {
|
|
return this.ee;
|
|
}
|
|
|
|
public UseMRZPassportDetection getUseMRZPassportDetection() {
|
|
return this.ed;
|
|
}
|
|
|
|
public UseDocumentDetectionBasedCrop getUseDocumentDetectionBasedCrop() {
|
|
return this.ef;
|
|
}
|
|
|
|
public String getName() {
|
|
return this.name;
|
|
}
|
|
|
|
public String getIpOperationsFilePath() {
|
|
return this.ec;
|
|
}
|
|
|
|
public String getIpOperations() {
|
|
return this.eb;
|
|
}
|
|
}
|