discord-jadx/app/src/main/java/c/f/j/e/l.java

301 lines
9.8 KiB
Java

package c.f.j.e;
import android.content.ContentResolver;
import android.content.Context;
import android.os.Build;
import androidx.core.util.Pools;
import c.f.b.b.h;
import c.f.d.g.g;
import c.f.j.a.b.a;
import c.f.j.c.f;
import c.f.j.c.i;
import c.f.j.c.j;
import c.f.j.c.m;
import c.f.j.c.p;
import c.f.j.c.q;
import c.f.j.c.r;
import c.f.j.c.s;
import c.f.j.c.t;
import c.f.j.c.v;
import c.f.j.c.w;
import c.f.j.c.y;
import c.f.j.c.z;
import c.f.j.e.k;
import c.f.j.h.b;
import c.f.j.j.c;
import c.f.j.l.x;
import c.f.j.n.d;
import c.f.j.p.f1;
import c.f.j.p.g1;
import c.f.j.p.n0;
import c.f.j.s.e;
import com.facebook.cache.common.CacheKey;
import com.facebook.common.internal.Supplier;
import com.facebook.common.memory.PooledByteBuffer;
import com.facebook.common.references.CloseableReference;
import com.facebook.imagepipeline.bitmaps.PlatformBitmapFactory;
import com.facebook.imagepipeline.cache.MemoryCacheParams;
import java.util.Collections;
import java.util.Objects;
import java.util.Set;
/* compiled from: ImagePipelineFactory */
public class l {
public static l a;
public final f1 b;
/* renamed from: c reason: collision with root package name */
public final j f437c;
public final a d;
public m<CacheKey, c> e;
public s<CacheKey, c> f;
public m<CacheKey, PooledByteBuffer> g;
public s<CacheKey, PooledByteBuffer> h;
public f i;
public h j;
public b k;
public h l;
public c.f.j.s.c m;
public o n;
public p o;
public f p;
public h q;
public PlatformBitmapFactory r;
/* renamed from: s reason: collision with root package name */
public d f438s;
public a t;
public l(j jVar) {
c.f.j.r.b.b();
Objects.requireNonNull(jVar);
this.f437c = jVar;
Objects.requireNonNull(jVar.w);
this.b = new g1(jVar.j.b());
Objects.requireNonNull(jVar.w);
CloseableReference.j = 0;
this.d = new a(jVar.f432y);
c.f.j.r.b.b();
}
public static synchronized void j(j jVar) {
synchronized (l.class) {
if (a != null) {
c.f.d.e.a.k(l.class, "ImagePipelineFactory has already been initialized! `ImagePipelineFactory.initialize(...)` should only be called once to avoid unexpected behavior.");
}
a = new l(jVar);
}
}
public final h a() {
b bVar;
if (Build.VERSION.SDK_INT >= 24) {
Objects.requireNonNull(this.f437c.w);
}
if (this.o == null) {
ContentResolver contentResolver = this.f437c.f.getApplicationContext().getContentResolver();
if (this.n == null) {
j jVar = this.f437c;
k.d dVar = jVar.w.b;
Context context = jVar.f;
c.f.d.g.a f = jVar.q.f();
if (this.k == null) {
Objects.requireNonNull(this.f437c);
a b = b();
b bVar2 = null;
if (b != null) {
bVar2 = b.b(this.f437c.b);
bVar = b.c(this.f437c.b);
} else {
bVar = null;
}
Objects.requireNonNull(this.f437c);
this.k = new c.f.j.h.a(bVar2, bVar, h());
}
b bVar3 = this.k;
j jVar2 = this.f437c;
c.f.j.h.c cVar = jVar2.r;
boolean z2 = jVar2.g;
boolean z3 = jVar2.u;
Objects.requireNonNull(jVar2.w);
j jVar3 = this.f437c;
e eVar = jVar3.j;
g d = jVar3.q.d(0);
this.f437c.q.e();
s<CacheKey, c> d2 = d();
s<CacheKey, PooledByteBuffer> e = e();
f f2 = f();
f i = i();
i iVar = this.f437c.e;
PlatformBitmapFactory g = g();
Objects.requireNonNull(this.f437c.w);
Objects.requireNonNull(this.f437c.w);
Objects.requireNonNull(this.f437c.w);
k kVar = this.f437c.w;
int i2 = kVar.a;
a aVar = this.d;
int i3 = kVar.g;
Objects.requireNonNull((k.c) dVar);
this.n = new o(context, f, bVar3, cVar, z2, z3, false, eVar, d, d2, e, f2, i, iVar, g, 0, 0, false, i2, aVar, false, i3);
}
o oVar = this.n;
j jVar4 = this.f437c;
n0 n0Var = jVar4.o;
boolean z4 = jVar4.u;
Objects.requireNonNull(jVar4.w);
f1 f1Var = this.b;
j jVar5 = this.f437c;
boolean z5 = jVar5.g;
Objects.requireNonNull(jVar5.w);
j jVar6 = this.f437c;
boolean z6 = jVar6.f431x;
if (this.m == null) {
Objects.requireNonNull(jVar6.w);
k kVar2 = this.f437c.w;
this.m = new e(kVar2.a, false, null, null, kVar2.f);
}
c.f.j.s.c cVar2 = this.m;
Objects.requireNonNull(this.f437c.w);
Objects.requireNonNull(this.f437c.w);
Objects.requireNonNull(this.f437c.w);
Objects.requireNonNull(this.f437c.w);
this.o = new p(contentResolver, oVar, n0Var, z4, false, f1Var, z5, false, false, z6, cVar2, false, false, false, false);
}
p pVar = this.o;
Set unmodifiableSet = Collections.unmodifiableSet(this.f437c.f430s);
Set unmodifiableSet2 = Collections.unmodifiableSet(this.f437c.t);
Supplier<Boolean> supplier = this.f437c.l;
s<CacheKey, c> d3 = d();
s<CacheKey, PooledByteBuffer> e2 = e();
f f3 = f();
f i4 = i();
j jVar7 = this.f437c;
i iVar2 = jVar7.e;
f1 f1Var2 = this.b;
Supplier<Boolean> supplier2 = jVar7.w.d;
Objects.requireNonNull(jVar7);
return new h(pVar, unmodifiableSet, unmodifiableSet2, supplier, d3, e2, f3, i4, iVar2, f1Var2, supplier2, null, null, this.f437c);
}
public final a b() {
if (this.t == null) {
PlatformBitmapFactory g = g();
e eVar = this.f437c.j;
m<CacheKey, c> c2 = c();
boolean z2 = this.f437c.w.f435c;
if (!c.f.j.a.b.b.a) {
try {
c.f.j.a.b.b.b = (a) Class.forName("com.facebook.fresco.animation.factory.AnimatedFactoryV2Impl").getConstructor(PlatformBitmapFactory.class, e.class, m.class, Boolean.TYPE).newInstance(g, eVar, c2, Boolean.valueOf(z2));
} catch (Throwable unused) {
}
if (c.f.j.a.b.b.b != null) {
c.f.j.a.b.b.a = true;
}
}
this.t = c.f.j.a.b.b.b;
}
return this.t;
}
public m<CacheKey, c> c() {
if (this.e == null) {
j jVar = this.f437c;
c.f.j.c.a aVar = jVar.f433z;
Supplier<MemoryCacheParams> supplier = jVar.f429c;
c.f.d.g.c cVar = jVar.n;
w.a aVar2 = jVar.d;
c.f.j.c.k kVar = (c.f.j.c.k) aVar;
Objects.requireNonNull(kVar);
v vVar = new v(new j(kVar), aVar2, supplier, null);
cVar.a(vVar);
this.e = vVar;
}
return this.e;
}
public s<CacheKey, c> d() {
if (this.f == null) {
m<CacheKey, c> c2 = c();
r rVar = this.f437c.k;
Objects.requireNonNull((z) rVar);
this.f = new s<>(c2, new t(rVar));
}
return this.f;
}
public s<CacheKey, PooledByteBuffer> e() {
if (this.h == null) {
Objects.requireNonNull(this.f437c);
if (this.g == null) {
j jVar = this.f437c;
Supplier<MemoryCacheParams> supplier = jVar.i;
c.f.d.g.c cVar = jVar.n;
v vVar = new v(new p(), new y(), supplier, null);
cVar.a(vVar);
this.g = vVar;
}
m<CacheKey, PooledByteBuffer> mVar = this.g;
r rVar = this.f437c.k;
Objects.requireNonNull((z) rVar);
this.h = new s<>(mVar, new q(rVar));
}
return this.h;
}
public f f() {
if (this.i == null) {
if (this.j == null) {
j jVar = this.f437c;
this.j = ((c) jVar.h).a(jVar.m);
}
h hVar = this.j;
j jVar2 = this.f437c;
x xVar = jVar2.q;
Objects.requireNonNull(jVar2);
this.i = new f(hVar, xVar.d(0), this.f437c.q.e(), this.f437c.j.e(), this.f437c.j.d(), this.f437c.k);
}
return this.i;
}
public PlatformBitmapFactory g() {
if (this.r == null) {
x xVar = this.f437c.q;
h();
this.r = new c.f.j.b.a(xVar.a(), this.d);
}
return this.r;
}
public d h() {
d dVar;
if (this.f438s == null) {
j jVar = this.f437c;
x xVar = jVar.q;
Objects.requireNonNull(jVar.w);
if (Build.VERSION.SDK_INT >= 26) {
int b = xVar.b();
dVar = new c.f.j.n.c(xVar.a(), b, new Pools.SynchronizedPool(b));
} else {
int b2 = xVar.b();
dVar = new c.f.j.n.a(xVar.a(), b2, new Pools.SynchronizedPool(b2));
}
this.f438s = dVar;
}
return this.f438s;
}
public final f i() {
if (this.p == null) {
if (this.q == null) {
j jVar = this.f437c;
this.q = ((c) jVar.h).a(jVar.v);
}
h hVar = this.q;
j jVar2 = this.f437c;
x xVar = jVar2.q;
Objects.requireNonNull(jVar2);
this.p = new f(hVar, xVar.d(0), this.f437c.q.e(), this.f437c.j.e(), this.f437c.j.d(), this.f437c.k);
}
return this.p;
}
}