132 lines
4.9 KiB
Java
132 lines
4.9 KiB
Java
package com.kofax.mobile.sdk.i;
|
|
|
|
import bolts.Capture;
|
|
import com.kofax.kmc.kut.utilities.SdkVersion;
|
|
import com.kofax.kmc.kut.utilities.error.ErrorInfo;
|
|
import com.kofax.kmc.kut.utilities.error.KmcRuntimeException;
|
|
import com.kofax.mobile.sdk.extract.id.ICompletionListener;
|
|
import com.kofax.mobile.sdk.extract.id.IProjectProvider;
|
|
import java.io.File;
|
|
import java.util.concurrent.CountDownLatch;
|
|
|
|
/* loaded from: classes3.dex */
|
|
public class i {
|
|
private final IProjectProvider zx;
|
|
|
|
public i(IProjectProvider iProjectProvider) {
|
|
this.zx = iProjectProvider;
|
|
}
|
|
|
|
public String X(String str) {
|
|
CountDownLatch countDownLatch = new CountDownLatch(1);
|
|
Capture capture = new Capture();
|
|
Capture<Exception> capture2 = new Capture<>();
|
|
try {
|
|
this.zx.getHighestVersion(str, SdkVersion.getSdkVersion(), new ICompletionListener<String>(this, capture, capture2, countDownLatch) { // from class: com.kofax.mobile.sdk.i.i.1
|
|
final CountDownLatch yG;
|
|
final i zA;
|
|
final Capture zy;
|
|
final Capture zz;
|
|
|
|
{
|
|
this.zA = this;
|
|
this.zy = capture;
|
|
this.zz = capture2;
|
|
this.yG = countDownLatch;
|
|
}
|
|
|
|
@Override // com.kofax.mobile.sdk.extract.id.ICompletionListener
|
|
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
|
public void onComplete(String str2, Exception exc) {
|
|
this.zy.set(str2);
|
|
this.zz.set(exc);
|
|
this.yG.countDown();
|
|
}
|
|
});
|
|
countDownLatch.await();
|
|
a(capture2);
|
|
return (String) capture.get();
|
|
} catch (InterruptedException e) {
|
|
throw new KmcRuntimeException(ErrorInfo.KMC_GN_INTERNAL_ERROR, e);
|
|
}
|
|
}
|
|
|
|
public File getVariant(String str, String str2, String str3) {
|
|
CountDownLatch countDownLatch = new CountDownLatch(1);
|
|
Capture capture = new Capture();
|
|
Capture<Exception> capture2 = new Capture<>();
|
|
try {
|
|
this.zx.getVariant(str, str2, str3, new ICompletionListener<File>(this, capture, capture2, countDownLatch) { // from class: com.kofax.mobile.sdk.i.i.2
|
|
final CountDownLatch yG;
|
|
final i zA;
|
|
final Capture zB;
|
|
final Capture zz;
|
|
|
|
{
|
|
this.zA = this;
|
|
this.zB = capture;
|
|
this.zz = capture2;
|
|
this.yG = countDownLatch;
|
|
}
|
|
|
|
@Override // com.kofax.mobile.sdk.extract.id.ICompletionListener
|
|
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
|
public void onComplete(File file, Exception exc) {
|
|
this.zB.set(file);
|
|
this.zz.set(exc);
|
|
this.yG.countDown();
|
|
}
|
|
});
|
|
countDownLatch.await();
|
|
a(capture2);
|
|
return (File) capture.get();
|
|
} catch (InterruptedException e) {
|
|
throw new KmcRuntimeException(ErrorInfo.KMC_GN_INTERNAL_ERROR, e);
|
|
}
|
|
}
|
|
|
|
public File getProject(String str, String str2) {
|
|
CountDownLatch countDownLatch = new CountDownLatch(1);
|
|
Capture capture = new Capture();
|
|
Capture<Exception> capture2 = new Capture<>();
|
|
try {
|
|
this.zx.getProject(str, str2, new ICompletionListener<File>(this, capture, capture2, countDownLatch) { // from class: com.kofax.mobile.sdk.i.i.3
|
|
final CountDownLatch yG;
|
|
final i zA;
|
|
final Capture zC;
|
|
final Capture zz;
|
|
|
|
{
|
|
this.zA = this;
|
|
this.zC = capture;
|
|
this.zz = capture2;
|
|
this.yG = countDownLatch;
|
|
}
|
|
|
|
@Override // com.kofax.mobile.sdk.extract.id.ICompletionListener
|
|
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
|
public void onComplete(File file, Exception exc) {
|
|
this.zC.set(file);
|
|
this.zz.set(exc);
|
|
this.yG.countDown();
|
|
}
|
|
});
|
|
countDownLatch.await();
|
|
a(capture2);
|
|
return (File) capture.get();
|
|
} catch (InterruptedException e) {
|
|
throw new KmcRuntimeException(ErrorInfo.KMC_GN_INTERNAL_ERROR, e);
|
|
}
|
|
}
|
|
|
|
private void a(Capture<Exception> capture) {
|
|
Exception exc = (Exception) capture.get();
|
|
if (exc != null) {
|
|
if (exc instanceof RuntimeException) {
|
|
throw ((RuntimeException) exc);
|
|
}
|
|
throw new RuntimeException(exc);
|
|
}
|
|
}
|
|
}
|