87 lines
3.0 KiB
Java
87 lines
3.0 KiB
Java
package c.c.a;
|
|
|
|
import android.content.Context;
|
|
import androidx.core.util.Pair;
|
|
import c.c.a.z.a;
|
|
import c.c.a.z.b;
|
|
import c.c.a.z.c;
|
|
import java.io.File;
|
|
import java.io.FileInputStream;
|
|
import java.io.FileNotFoundException;
|
|
import java.io.IOException;
|
|
import java.io.InputStream;
|
|
import java.util.concurrent.Callable;
|
|
import java.util.zip.ZipInputStream;
|
|
/* compiled from: LottieCompositionFactory */
|
|
public class f implements Callable<p<d>> {
|
|
public final /* synthetic */ Context i;
|
|
public final /* synthetic */ String j;
|
|
public final /* synthetic */ String k;
|
|
|
|
public f(Context context, String str, String str2) {
|
|
this.i = context;
|
|
this.j = str;
|
|
this.k = str2;
|
|
}
|
|
|
|
/* Return type fixed from 'java.lang.Object' to match base method */
|
|
/* JADX WARNING: Removed duplicated region for block: B:21:0x0077 */
|
|
@Override // java.util.concurrent.Callable
|
|
public p<d> call() throws Exception {
|
|
Pair pair;
|
|
c cVar = new c(this.i, this.j, this.k);
|
|
a aVar = a.ZIP;
|
|
b bVar = cVar.f338c;
|
|
d dVar = null;
|
|
if (bVar != null) {
|
|
String str = cVar.b;
|
|
try {
|
|
File b = bVar.b();
|
|
a aVar2 = a.JSON;
|
|
File file = new File(b, b.a(str, aVar2, false));
|
|
if (!file.exists()) {
|
|
file = new File(bVar.b(), b.a(str, aVar, false));
|
|
if (!file.exists()) {
|
|
file = null;
|
|
}
|
|
}
|
|
if (file == null) {
|
|
pair = null;
|
|
if (pair != null) {
|
|
a aVar3 = pair.first;
|
|
InputStream inputStream = pair.second;
|
|
d dVar2 = (aVar3 == aVar ? e.d(new ZipInputStream(inputStream), cVar.b) : e.b(inputStream, cVar.b)).a;
|
|
if (dVar2 != null) {
|
|
dVar = dVar2;
|
|
}
|
|
}
|
|
} else {
|
|
FileInputStream fileInputStream = new FileInputStream(file);
|
|
if (file.getAbsolutePath().endsWith(".zip")) {
|
|
aVar2 = aVar;
|
|
}
|
|
StringBuilder Q = c.d.b.a.a.Q("Cache hit for ", str, " at ");
|
|
Q.append(file.getAbsolutePath());
|
|
c.c.a.b0.c.a(Q.toString());
|
|
pair = new Pair(aVar2, fileInputStream);
|
|
if (pair != null) {
|
|
}
|
|
}
|
|
} catch (FileNotFoundException unused) {
|
|
}
|
|
}
|
|
if (dVar != null) {
|
|
return new p<>(dVar);
|
|
}
|
|
StringBuilder L = c.d.b.a.a.L("Animation for ");
|
|
L.append(cVar.b);
|
|
L.append(" not found in cache. Fetching from network.");
|
|
c.c.a.b0.c.a(L.toString());
|
|
try {
|
|
return cVar.a();
|
|
} catch (IOException e) {
|
|
return new p<>(e);
|
|
}
|
|
}
|
|
}
|