51 lines
1.5 KiB
Java
51 lines
1.5 KiB
Java
package com.kofax.mobile.sdk.m;
|
|
|
|
import com.kofax.android.abc.image_classification.ImageClassifier;
|
|
import com.kofax.kmc.kut.utilities.error.ErrorInfo;
|
|
import com.kofax.kmc.kut.utilities.error.KmcRuntimeException;
|
|
import java.io.File;
|
|
import o.InterfaceC13391fZD;
|
|
import o.fZE;
|
|
|
|
/* loaded from: classes3.dex */
|
|
public class a implements com.kofax.mobile.sdk.c.d {
|
|
private final com.kofax.mobile.sdk.b.b Hc;
|
|
private final fZE<ImageClassifier> Hd;
|
|
|
|
@InterfaceC13391fZD
|
|
public a(com.kofax.mobile.sdk.b.b bVar, fZE<ImageClassifier> fze) {
|
|
this.Hc = bVar;
|
|
this.Hd = fze;
|
|
}
|
|
|
|
@Override // com.kofax.mobile.sdk.c.d
|
|
public ImageClassifier N(String str) {
|
|
ImageClassifier imageClassifier = this.Hd.get();
|
|
a(str, imageClassifier);
|
|
return imageClassifier;
|
|
}
|
|
|
|
private void a(String str, ImageClassifier imageClassifier) {
|
|
String ak = ak(str);
|
|
String aj = aj(str);
|
|
imageClassifier.loadConfigurationFile(ak);
|
|
imageClassifier.loadModel(aj);
|
|
}
|
|
|
|
private String aj(String str) {
|
|
File I = this.Hc.I(str);
|
|
if (I == null || !I.exists()) {
|
|
throw new KmcRuntimeException(ErrorInfo.KMC_CL_MODEL_NULL);
|
|
}
|
|
return I.getAbsolutePath();
|
|
}
|
|
|
|
private String ak(String str) {
|
|
File H = this.Hc.H(str);
|
|
if (H == null || !H.exists()) {
|
|
throw new KmcRuntimeException(ErrorInfo.KMC_CL_CONFIG_NULL);
|
|
}
|
|
return H.getAbsolutePath();
|
|
}
|
|
}
|