what-the-bank/sources/com/bumptech/glide/Registry.java

319 lines
11 KiB
Java

package com.bumptech.glide;
import com.bumptech.glide.load.ImageHeaderParser;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import o.Box;
import o.C0780Okt;
import o.C1050UnO;
import o.C1239YsJ;
import o.C15764iRy;
import o.C2582ahN;
import o.C9585dmX;
import o.HuZ;
import o.KFY;
import o.KOW;
import o.Kpr;
import o.QMg;
import o.RDy;
import o.SCe;
import o.Vzp;
import o.gaU;
import o.gya;
import o.iYP;
import o.nuW;
import o.rIx;
import o.raY;
import o.yBU;
/* loaded from: classes.dex */
public final class Registry {
public final C0780Okt a;
private final KFY b;
public final Kpr c;
public final gya d;
public final C15764iRy e;
private final QMg f;
private final C9585dmX g = new C9585dmX();
private final HuZ h = new HuZ();
private final KOW i;
private final RDy.Sts<List<Throwable>> j;
public Registry() {
RDy.Sts<List<Throwable>> a = C1050UnO.a();
this.j = a;
this.f = new QMg(a);
this.d = new gya();
this.b = new KFY();
this.c = new Kpr();
this.e = new C15764iRy();
this.i = new KOW();
this.a = new C0780Okt();
List asList = Arrays.asList("Animation", "Bitmap", "BitmapDrawable");
ArrayList arrayList = new ArrayList(asList.size());
arrayList.add("legacy_prepend_all");
Iterator it = asList.iterator();
while (it.hasNext()) {
arrayList.add((String) it.next());
}
arrayList.add("legacy_append");
KFY kfy = this.b;
synchronized (kfy) {
ArrayList<String> arrayList2 = new ArrayList(kfy.c);
kfy.c.clear();
Iterator it2 = arrayList.iterator();
while (it2.hasNext()) {
kfy.c.add((String) it2.next());
}
for (String str : arrayList2) {
if (!arrayList.contains(str)) {
kfy.c.add(str);
}
}
}
}
public final <Data> Registry d(Class<Data> cls, gaU<Data> gau) {
gya gyaVar = this.d;
synchronized (gyaVar) {
gyaVar.a.add(new gya.Sts<>(cls, gau));
}
return this;
}
public final <Data, TResource> Registry b(String str, Class<Data> cls, Class<TResource> cls2, iYP<Data, TResource> iyp) {
KFY kfy = this.b;
synchronized (kfy) {
kfy.a(str).add(new KFY.IeS<>(cls, cls2, iyp));
}
return this;
}
public final <TResource> Registry e(Class<TResource> cls, nuW<TResource> nuw) {
Kpr kpr = this.c;
synchronized (kpr) {
kpr.e.add(new Kpr.LWm<>(cls, nuw));
}
return this;
}
public final Registry b(Box.HBt<?> hBt) {
C15764iRy c15764iRy = this.e;
synchronized (c15764iRy) {
c15764iRy.d.put(hBt.a(), hBt);
}
return this;
}
public final <TResource, Transcode> Registry a(Class<TResource> cls, Class<Transcode> cls2, yBU<TResource, Transcode> ybu) {
KOW kow = this.i;
synchronized (kow) {
kow.c.add(new KOW.RVV<>(cls, cls2, ybu));
}
return this;
}
public final Registry d(ImageHeaderParser imageHeaderParser) {
C0780Okt c0780Okt = this.a;
synchronized (c0780Okt) {
c0780Okt.b.add(imageHeaderParser);
}
return this;
}
public final <Model, Data> Registry c(Class<Model> cls, Class<Data> cls2, rIx<Model, Data> rix) {
QMg qMg = this.f;
synchronized (qMg) {
Vzp vzp = qMg.c;
synchronized (vzp) {
Vzp.RVV<?, ?> rvv = new Vzp.RVV<>(cls, cls2, rix);
List<Vzp.RVV<?, ?>> list = vzp.d;
list.add(list.size(), rvv);
}
qMg.e.a.clear();
}
return this;
}
public final <Data, TResource, Transcode> C1239YsJ<Data, TResource, Transcode> b(Class<Data> cls, Class<TResource> cls2, Class<Transcode> cls3) {
C1239YsJ<Data, TResource, Transcode> a = this.h.a(cls, cls2, cls3);
if (HuZ.c(a)) {
return null;
}
if (a == null) {
ArrayList arrayList = new ArrayList();
for (Class cls4 : this.b.d(cls, cls2)) {
for (Class cls5 : this.i.e(cls4, cls3)) {
arrayList.add(new C2582ahN(cls, cls4, cls5, this.b.a(cls, cls4), this.i.b(cls4, cls5), this.j));
}
}
a = arrayList.isEmpty() ? null : new C1239YsJ<>(cls, cls2, cls3, arrayList, this.j);
HuZ huZ = this.h;
synchronized (huZ.c) {
huZ.c.put(new raY(cls, cls2, cls3), a == null ? HuZ.e : a);
}
}
return a;
}
public final <Model, TResource, Transcode> List<Class<?>> d(Class<Model> cls, Class<TResource> cls2, Class<Transcode> cls3) {
List<Class<?>> c = this.g.c(cls, cls2, cls3);
if (c == null) {
c = new ArrayList<>();
Iterator<Class<?>> it = this.f.c(cls).iterator();
while (it.hasNext()) {
for (Class<?> cls4 : this.b.d(it.next(), cls2)) {
if (!this.i.e(cls4, cls3).isEmpty() && !c.contains(cls4)) {
c.add(cls4);
}
}
}
C9585dmX c9585dmX = this.g;
List<Class<?>> unmodifiableList = Collections.unmodifiableList(c);
synchronized (c9585dmX.c) {
c9585dmX.c.put(new raY(cls, cls2, cls3), unmodifiableList);
}
}
return c;
}
/* loaded from: classes.dex */
public static class NoModelLoaderAvailableException extends MissingComponentException {
/* JADX WARN: Illegal instructions before constructor call */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public NoModelLoaderAvailableException(java.lang.Object r3) {
/*
r2 = this;
java.lang.StringBuilder r0 = new java.lang.StringBuilder
java.lang.String r1 = "Failed to find any ModelLoaders registered for model class: "
r0.<init>(r1)
java.lang.Class r3 = r3.getClass()
r0.append(r3)
java.lang.String r3 = r0.toString()
r2.<init>(r3)
return
*/
throw new UnsupportedOperationException("Method not decompiled: com.bumptech.glide.Registry.NoModelLoaderAvailableException.<init>(java.lang.Object):void");
}
/* JADX WARN: Illegal instructions before constructor call */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public <M> NoModelLoaderAvailableException(M r3, java.util.List<o.SCe<M, ?>> r4) {
/*
r2 = this;
java.lang.StringBuilder r0 = new java.lang.StringBuilder
java.lang.String r1 = "Found ModelLoaders for model class: "
r0.<init>(r1)
r0.append(r4)
java.lang.String r4 = ", but none that handle this specific model instance: "
r0.append(r4)
r0.append(r3)
java.lang.String r3 = r0.toString()
r2.<init>(r3)
return
*/
throw new UnsupportedOperationException("Method not decompiled: com.bumptech.glide.Registry.NoModelLoaderAvailableException.<init>(java.lang.Object, java.util.List):void");
}
/* JADX WARN: Illegal instructions before constructor call */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public NoModelLoaderAvailableException(java.lang.Class<?> r3, java.lang.Class<?> r4) {
/*
r2 = this;
java.lang.StringBuilder r0 = new java.lang.StringBuilder
java.lang.String r1 = "Failed to find any ModelLoaders for model: "
r0.<init>(r1)
r0.append(r3)
java.lang.String r3 = " and data: "
r0.append(r3)
r0.append(r4)
java.lang.String r3 = r0.toString()
r2.<init>(r3)
return
*/
throw new UnsupportedOperationException("Method not decompiled: com.bumptech.glide.Registry.NoModelLoaderAvailableException.<init>(java.lang.Class, java.lang.Class):void");
}
}
/* loaded from: classes.dex */
public static class NoResultEncoderAvailableException extends MissingComponentException {
/* JADX WARN: Illegal instructions before constructor call */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public NoResultEncoderAvailableException(java.lang.Class<?> r3) {
/*
r2 = this;
java.lang.StringBuilder r0 = new java.lang.StringBuilder
java.lang.String r1 = "Failed to find result encoder for resource class: "
r0.<init>(r1)
r0.append(r3)
java.lang.String r3 = ", you may need to consider registering a new Encoder for the requested type or DiskCacheStrategy.DATA/DiskCacheStrategy.NONE if caching your transformed resource is unnecessary."
r0.append(r3)
java.lang.String r3 = r0.toString()
r2.<init>(r3)
return
*/
throw new UnsupportedOperationException("Method not decompiled: com.bumptech.glide.Registry.NoResultEncoderAvailableException.<init>(java.lang.Class):void");
}
}
/* loaded from: classes.dex */
public static class NoSourceEncoderAvailableException extends MissingComponentException {
public NoSourceEncoderAvailableException(Class<?> cls) {
super("Failed to find source encoder for data class: ".concat(String.valueOf(cls)));
}
}
/* loaded from: classes.dex */
public static class MissingComponentException extends RuntimeException {
public MissingComponentException(String str) {
super(str);
}
}
/* loaded from: classes.dex */
public static final class NoImageHeaderParserException extends MissingComponentException {
public NoImageHeaderParserException() {
super("Failed to find image header parser.");
}
}
public final <Model> List<SCe<Model, ?>> b(Model model) {
List b = this.f.b(model.getClass());
if (b.isEmpty()) {
throw new NoModelLoaderAvailableException(model);
}
int size = b.size();
List<SCe<Model, ?>> emptyList = Collections.emptyList();
boolean z = true;
for (int i = 0; i < size; i++) {
SCe<Model, ?> sCe = (SCe) b.get(i);
if (sCe.d(model)) {
if (z) {
emptyList = new ArrayList<>(size - i);
z = false;
}
emptyList.add(sCe);
}
}
if (emptyList.isEmpty()) {
throw new NoModelLoaderAvailableException(model, (List<SCe<Model, ?>>) b);
}
return emptyList;
}
}