discord-jadx/app/src/main/java/c/c/a/f.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.f340c;
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 P = c.d.b.a.a.P("Cache hit for ", str, " at ");
P.append(file.getAbsolutePath());
c.c.a.b0.c.a(P.toString());
pair = new Pair(aVar2, fileInputStream);
if (pair != null) {
}
}
} catch (FileNotFoundException unused) {
}
}
if (dVar != null) {
return new p<>(dVar);
}
StringBuilder K = c.d.b.a.a.K("Animation for ");
K.append(cVar.b);
K.append(" not found in cache. Fetching from network.");
c.c.a.b0.c.a(K.toString());
try {
return cVar.a();
} catch (IOException e) {
return new p<>(e);
}
}
}