what-the-bank/sources/o/C15306gmu.java

334 lines
11 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package o;
import com.airbnb.deeplinkdispatch.UrlTreeKt;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.greenrobot.eventbus.EventBusException;
/* JADX INFO: Access modifiers changed from: package-private */
/* renamed from: o.gmu, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C15306gmu {
private static final Map<Class<?>, List<C15308gmw>> a = new ConcurrentHashMap();
private static final LWm[] d = new LWm[4];
private List<InterfaceC15275gmI> b;
private final boolean c;
private final boolean e;
/* JADX INFO: Access modifiers changed from: package-private */
public C15306gmu(List<InterfaceC15275gmI> list, boolean z, boolean z2) {
this.b = list;
this.e = z;
this.c = z2;
}
/* JADX INFO: Access modifiers changed from: package-private */
public final List<C15308gmw> d(Class<?> cls) {
List<C15308gmw> a2;
Map<Class<?>, List<C15308gmw>> map = a;
List<C15308gmw> list = map.get(cls);
if (list != null) {
return list;
}
if (this.c) {
a2 = b(cls);
} else {
a2 = a(cls);
}
if (a2.isEmpty()) {
StringBuilder sb = new StringBuilder("Subscriber ");
sb.append(cls);
sb.append(" and its super classes have no public methods with the @Subscribe annotation");
throw new EventBusException(sb.toString());
}
map.put(cls, a2);
return a2;
}
/* JADX WARN: Code restructure failed: missing block: B:9:0x002a, code lost:
if (r0.a == r2.a()) goto L21;
*/
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
private java.util.List<o.C15308gmw> a(java.lang.Class<?> r9) {
/*
r8 = this;
o.gmu$LWm r0 = c()
r0.a = r9
r0.e = r9
r9 = 0
r0.c = r9
r1 = 0
r0.h = r1
Le:
java.lang.Class<?> r2 = r0.a
if (r2 == 0) goto L77
o.gmA r2 = r0.h
if (r2 == 0) goto L2d
o.gmA r2 = r0.h
o.gmA r2 = r2.d()
if (r2 == 0) goto L2d
o.gmA r2 = r0.h
o.gmA r2 = r2.d()
java.lang.Class<?> r3 = r0.a
java.lang.Class r4 = r2.a()
if (r3 != r4) goto L2d
goto L4c
L2d:
java.util.List<o.gmI> r2 = r8.b
if (r2 == 0) goto L4b
java.util.Iterator r2 = r2.iterator()
L35:
boolean r3 = r2.hasNext()
if (r3 == 0) goto L4b
java.lang.Object r3 = r2.next()
o.gmI r3 = (o.InterfaceC15275gmI) r3
java.lang.Class<?> r4 = r0.a
o.gmA r3 = r3.e()
if (r3 == 0) goto L35
r2 = r3
goto L4c
L4b:
r2 = r1
L4c:
r0.h = r2
o.gmA r2 = r0.h
if (r2 == 0) goto L70
o.gmA r2 = r0.h
o.gmw[] r2 = r2.e()
int r3 = r2.length
r4 = r9
L5a:
if (r4 >= r3) goto L73
r5 = r2[r4]
java.lang.reflect.Method r6 = r5.a
java.lang.Class<?> r7 = r5.e
boolean r6 = r0.e(r6, r7)
if (r6 == 0) goto L6d
java.util.List<o.gmw> r6 = r0.g
r6.add(r5)
L6d:
int r4 = r4 + 1
goto L5a
L70:
r8.b(r0)
L73:
r0.a()
goto Le
L77:
java.util.List r9 = a(r0)
return r9
*/
throw new UnsupportedOperationException("Method not decompiled: o.C15306gmu.a(java.lang.Class):java.util.List");
}
/* JADX WARN: Code restructure failed: missing block: B:10:0x0031, code lost:
r3[r2] = r5;
*/
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
private static java.util.List<o.C15308gmw> a(o.C15306gmu.LWm r5) {
/*
java.util.ArrayList r0 = new java.util.ArrayList
java.util.List<o.gmw> r1 = r5.g
r0.<init>(r1)
java.util.List<o.gmw> r1 = r5.g
r1.clear()
java.util.Map<java.lang.Class, java.lang.Object> r1 = r5.b
r1.clear()
java.util.Map<java.lang.String, java.lang.Class> r1 = r5.j
r1.clear()
java.lang.StringBuilder r1 = r5.d
r2 = 0
r1.setLength(r2)
r1 = 0
r5.e = r1
r5.a = r1
r5.c = r2
r5.h = r1
o.gmu$LWm[] r1 = o.C15306gmu.d
monitor-enter(r1)
L28:
r3 = 4
if (r2 >= r3) goto L3a
o.gmu$LWm[] r3 = o.C15306gmu.d // Catch: java.lang.Throwable -> L37
r4 = r3[r2] // Catch: java.lang.Throwable -> L37
if (r4 != 0) goto L34
r3[r2] = r5 // Catch: java.lang.Throwable -> L37
goto L3a
L34:
int r2 = r2 + 1
goto L28
L37:
r5 = move-exception
monitor-exit(r1)
throw r5
L3a:
monitor-exit(r1)
return r0
*/
throw new UnsupportedOperationException("Method not decompiled: o.C15306gmu.a(o.gmu$LWm):java.util.List");
}
private static LWm c() {
synchronized (d) {
for (int i = 0; i < 4; i++) {
LWm[] lWmArr = d;
LWm lWm = lWmArr[i];
if (lWm != null) {
lWmArr[i] = null;
return lWm;
}
}
return new LWm();
}
}
private List<C15308gmw> b(Class<?> cls) {
LWm c = c();
c.a = cls;
c.e = cls;
c.c = false;
c.h = null;
while (c.a != null) {
b(c);
c.a();
}
return a(c);
}
private void b(LWm lWm) {
String obj;
Method[] methods;
try {
try {
methods = lWm.a.getDeclaredMethods();
} catch (LinkageError e) {
StringBuilder sb = new StringBuilder("Could not inspect methods of ");
sb.append(lWm.a.getName());
String obj2 = sb.toString();
if (this.c) {
StringBuilder sb2 = new StringBuilder();
sb2.append(obj2);
sb2.append(". Please consider using EventBus annotation processor to avoid reflection.");
obj = sb2.toString();
} else {
StringBuilder sb3 = new StringBuilder();
sb3.append(obj2);
sb3.append(". Please make this class visible to EventBus annotation processor to avoid reflection.");
obj = sb3.toString();
}
throw new EventBusException(obj, e);
}
} catch (Throwable unused) {
methods = lWm.a.getMethods();
lWm.c = true;
}
for (Method method : methods) {
int modifiers = method.getModifiers();
if ((modifiers & 1) != 0 && (modifiers & 5192) == 0) {
Class<?>[] parameterTypes = method.getParameterTypes();
if (parameterTypes.length == 1) {
InterfaceC15309gmx interfaceC15309gmx = (InterfaceC15309gmx) method.getAnnotation(InterfaceC15309gmx.class);
if (interfaceC15309gmx != null) {
Class<?> cls = parameterTypes[0];
if (lWm.e(method, cls)) {
lWm.g.add(new C15308gmw(method, cls, interfaceC15309gmx.e(), interfaceC15309gmx.c(), interfaceC15309gmx.b()));
}
}
} else if (this.e && method.isAnnotationPresent(InterfaceC15309gmx.class)) {
StringBuilder sb4 = new StringBuilder();
sb4.append(method.getDeclaringClass().getName());
sb4.append(".");
sb4.append(method.getName());
String obj3 = sb4.toString();
StringBuilder sb5 = new StringBuilder("@Subscribe method ");
sb5.append(obj3);
sb5.append("must have exactly 1 parameter but has ");
sb5.append(parameterTypes.length);
throw new EventBusException(sb5.toString());
}
} else if (this.e && method.isAnnotationPresent(InterfaceC15309gmx.class)) {
StringBuilder sb6 = new StringBuilder();
sb6.append(method.getDeclaringClass().getName());
sb6.append(".");
sb6.append(method.getName());
String obj4 = sb6.toString();
StringBuilder sb7 = new StringBuilder();
sb7.append(obj4);
sb7.append(" is a illegal @Subscribe method: must be public, non-static, and non-abstract");
throw new EventBusException(sb7.toString());
}
}
}
/* JADX INFO: Access modifiers changed from: package-private */
/* renamed from: o.gmu$LWm */
/* loaded from: classes.dex */
public static class LWm {
Class<?> a;
boolean c;
Class<?> e;
gmA h;
final List<C15308gmw> g = new ArrayList();
final Map<Class, Object> b = new HashMap();
final Map<String, Class> j = new HashMap();
final StringBuilder d = new StringBuilder(128);
LWm() {
}
final boolean e(Method method, Class<?> cls) {
Object put = this.b.put(cls, method);
if (put == null) {
return true;
}
if (put instanceof Method) {
if (!b((Method) put, cls)) {
throw new IllegalStateException();
}
this.b.put(cls, this);
}
return b(method, cls);
}
private boolean b(Method method, Class<?> cls) {
this.d.setLength(0);
this.d.append(method.getName());
StringBuilder sb = this.d;
sb.append(UrlTreeKt.configurablePathSegmentSuffixChar);
sb.append(cls.getName());
String obj = this.d.toString();
Class<?> declaringClass = method.getDeclaringClass();
Class put = this.j.put(obj, declaringClass);
if (put == null || put.isAssignableFrom(declaringClass)) {
return true;
}
this.j.put(obj, put);
return false;
}
final void a() {
if (!this.c) {
Class<? super Object> superclass = this.a.getSuperclass();
this.a = superclass;
String name = superclass.getName();
if (!name.startsWith("java.") && !name.startsWith("javax.") && !name.startsWith("android.") && !name.startsWith("androidx.")) {
return;
}
}
this.a = null;
}
}
}