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

133 lines
5.0 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package o;
import java.security.GeneralSecurityException;
import java.util.Collections;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.atomic.AtomicReference;
import java.util.logging.Logger;
/* loaded from: classes2.dex */
public final class Jtp {
private static final ConcurrentMap<String, RyZ> c;
private static final ConcurrentMap<Class<?>, wbW<?, ?>> j;
private static final Logger b = Logger.getLogger(Jtp.class.getName());
private static final AtomicReference<C1128Wem> a = new AtomicReference<>(new C1128Wem());
private static final ConcurrentMap<String, Object> e = new ConcurrentHashMap();
private static final ConcurrentMap<String, Boolean> d = new ConcurrentHashMap();
static {
new ConcurrentHashMap();
j = new ConcurrentHashMap();
c = new ConcurrentHashMap();
}
/* JADX WARN: Removed duplicated region for block: B:25:0x0093 A[EXC_TOP_SPLITTER, SYNTHETIC] */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public static <KeyProtoT extends o.vAr> void b(o.AbstractC16575pTO<KeyProtoT> r12) throws java.security.GeneralSecurityException {
/*
Method dump skipped, instructions count: 541
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: o.Jtp.b(o.pTO):void");
}
public static <B, P> void a(wbW<B, P> wbw) throws GeneralSecurityException {
synchronized (Jtp.class) {
Class<P> c2 = wbw.c();
ConcurrentMap<Class<?>, wbW<?, ?>> concurrentMap = j;
if (concurrentMap.containsKey(c2)) {
wbW<?, ?> wbw2 = concurrentMap.get(c2);
if (!wbw.getClass().getName().equals(wbw2.getClass().getName())) {
Logger logger = b;
StringBuilder sb = new StringBuilder("Attempted overwrite of a registered PrimitiveWrapper for type ");
sb.append(c2);
logger.warning(sb.toString());
throw new GeneralSecurityException(String.format("PrimitiveWrapper for primitive (%s) is already registered to be %s, cannot be re-registered with %s", c2.getName(), wbw2.getClass().getName(), wbw.getClass().getName()));
}
}
concurrentMap.put(c2, wbw);
}
}
public static <P> P a(String str, byte[] bArr, Class<P> cls) throws GeneralSecurityException {
return a.get().c(str, cls).d(jra.e(bArr));
}
public static <B, P> P b(FdT<B> fdT, Class<P> cls) throws GeneralSecurityException {
wbW<?, ?> wbw = j.get(cls);
if (wbw == null) {
StringBuilder sb = new StringBuilder("No wrapper found for ");
sb.append(fdT.d.getName());
throw new GeneralSecurityException(sb.toString());
}
if (!wbw.e().equals(fdT.d)) {
StringBuilder sb2 = new StringBuilder("Wrong input primitive class, expected ");
sb2.append(wbw.e());
sb2.append(", got ");
sb2.append(fdT.d);
throw new GeneralSecurityException(sb2.toString());
}
return (P) wbw.d(fdT);
}
/* JADX INFO: Access modifiers changed from: package-private */
public static Map<String, RyZ> d() {
Map<String, RyZ> unmodifiableMap;
synchronized (Jtp.class) {
unmodifiableMap = Collections.unmodifiableMap(c);
}
return unmodifiableMap;
}
public static Class<?> d(Class<?> cls) {
wbW<?, ?> wbw = j.get(cls);
if (wbw == null) {
return null;
}
return wbw.e();
}
private Jtp() {
}
public static <P> P c(NZO nzo, Class<P> cls) throws GeneralSecurityException {
String str = nzo.typeUrl_;
return a.get().c(str, cls).d(nzo.value_);
}
public static vAr d(Jzs jzs) throws GeneralSecurityException {
vAr c2;
synchronized (Jtp.class) {
RQY<?> e2 = a.get().b(jzs.typeUrl_).e();
if (d.get(jzs.typeUrl_).booleanValue()) {
c2 = e2.c(jzs.value_);
} else {
StringBuilder sb = new StringBuilder("newKey-operation not permitted for key type ");
sb.append(jzs.typeUrl_);
throw new GeneralSecurityException(sb.toString());
}
}
return c2;
}
public static NZO c(Jzs jzs) throws GeneralSecurityException {
NZO e2;
synchronized (Jtp.class) {
RQY<?> e3 = a.get().b(jzs.typeUrl_).e();
if (d.get(jzs.typeUrl_).booleanValue()) {
e2 = e3.e(jzs.value_);
} else {
StringBuilder sb = new StringBuilder("newKey-operation not permitted for key type ");
sb.append(jzs.typeUrl_);
throw new GeneralSecurityException(sb.toString());
}
}
return e2;
}
}