372 lines
13 KiB
Java
372 lines
13 KiB
Java
|
package com.google.android.gms.internal.firebase_ml;
|
||
|
|
||
|
import com.google.android.gms.internal.firebase_ml.zzue;
|
||
|
import com.google.android.gms.internal.firebase_ml.zzue.zza;
|
||
|
import java.io.IOException;
|
||
|
import java.lang.reflect.InvocationTargetException;
|
||
|
import java.lang.reflect.Method;
|
||
|
import java.util.Map;
|
||
|
import java.util.concurrent.ConcurrentHashMap;
|
||
|
|
||
|
/* loaded from: classes2.dex */
|
||
|
public abstract class zzue<MessageType extends zzue<MessageType, BuilderType>, BuilderType extends zza<MessageType, BuilderType>> extends zzsn<MessageType, BuilderType> {
|
||
|
private static Map<Object, zzue<?, ?>> zzboj = new ConcurrentHashMap();
|
||
|
protected zzwx zzboh = zzwx.zztg();
|
||
|
private int zzboi = -1;
|
||
|
|
||
|
/* loaded from: classes2.dex */
|
||
|
public static final class zzb<T extends zzue<T, ?>> extends zzsp<T> {
|
||
|
private final T zzbok;
|
||
|
|
||
|
public zzb(T t) {
|
||
|
this.zzbok = t;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* loaded from: classes2.dex */
|
||
|
public static final class zze<ContainingType extends zzvo, Type> extends zztp<ContainingType, Type> {
|
||
|
}
|
||
|
|
||
|
/* loaded from: classes2.dex */
|
||
|
public enum zzf {
|
||
|
public static final int zzboo = 1;
|
||
|
public static final int zzbop = 2;
|
||
|
public static final int zzboq = 3;
|
||
|
public static final int zzbor = 4;
|
||
|
public static final int zzbos = 5;
|
||
|
public static final int zzbot = 6;
|
||
|
public static final int zzbou = 7;
|
||
|
public static final int zzbow = 1;
|
||
|
public static final int zzbox = 2;
|
||
|
private static final int[] zzbov = {1, 2, 3, 4, 5, 6, 7};
|
||
|
private static final int[] zzboy = {1, 2};
|
||
|
public static final int zzboz = 1;
|
||
|
public static final int zzbpa = 2;
|
||
|
private static final int[] zzbpb = {1, 2};
|
||
|
|
||
|
public static int[] values$50KLMJ33DTMIUPRFDTJMOP9FE1P6UT3FC9QMCBQ7CLN6ASJ1EHIM8JB5EDPM2PR59HKN8P949LIN8Q3FCHA6UIBEEPNMMP9R0() {
|
||
|
return (int[]) zzbov.clone();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: protected */
|
||
|
public abstract Object zza(int i, Object obj, Object obj2);
|
||
|
|
||
|
/* loaded from: classes2.dex */
|
||
|
public static class zzc<MessageType extends zzd<MessageType, BuilderType>, BuilderType extends zzc<MessageType, BuilderType>> extends zza<MessageType, BuilderType> implements zzvq {
|
||
|
protected zzc(MessageType messagetype) {
|
||
|
super(messagetype);
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: protected */
|
||
|
@Override // com.google.android.gms.internal.firebase_ml.zzue.zza
|
||
|
public final void zzrf() {
|
||
|
if (this.zzbom) {
|
||
|
super.zzrf();
|
||
|
((zzd) this.zzbol).zzbon = (zztw) ((zzd) this.zzbol).zzbon.clone();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // com.google.android.gms.internal.firebase_ml.zzue.zza
|
||
|
/* renamed from: zzrg */
|
||
|
public /* synthetic */ zzue zzri() {
|
||
|
return (zzd) zzri();
|
||
|
}
|
||
|
|
||
|
@Override // com.google.android.gms.internal.firebase_ml.zzue.zza, com.google.android.gms.internal.firebase_ml.zzvp
|
||
|
public /* synthetic */ zzvo zzri() {
|
||
|
if (this.zzbom) {
|
||
|
return (zzd) this.zzbol;
|
||
|
}
|
||
|
((zzd) this.zzbol).zzbon.zzpt();
|
||
|
return (zzd) super.zzri();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* loaded from: classes2.dex */
|
||
|
public static abstract class zzd<MessageType extends zzd<MessageType, BuilderType>, BuilderType extends zzc<MessageType, BuilderType>> extends zzue<MessageType, BuilderType> implements zzvq {
|
||
|
protected zztw<Object> zzbon = zztw.zzqp();
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
public final zztw<Object> zzrk() {
|
||
|
if (this.zzbon.isImmutable()) {
|
||
|
this.zzbon = (zztw) this.zzbon.clone();
|
||
|
}
|
||
|
return this.zzbon;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public String toString() {
|
||
|
return zzvr.zza(this, super.toString());
|
||
|
}
|
||
|
|
||
|
public int hashCode() {
|
||
|
if (this.zzbka != 0) {
|
||
|
return this.zzbka;
|
||
|
}
|
||
|
this.zzbka = zzwb.zzso().zzad(this).hashCode(this);
|
||
|
return this.zzbka;
|
||
|
}
|
||
|
|
||
|
/* loaded from: classes2.dex */
|
||
|
public static class zza<MessageType extends zzue<MessageType, BuilderType>, BuilderType extends zza<MessageType, BuilderType>> extends zzso<MessageType, BuilderType> {
|
||
|
private final MessageType zzbok;
|
||
|
protected MessageType zzbol;
|
||
|
protected boolean zzbom = false;
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: protected */
|
||
|
public zza(MessageType messagetype) {
|
||
|
this.zzbok = messagetype;
|
||
|
this.zzbol = (MessageType) messagetype.zza(zzf.zzbor, null, null);
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: protected */
|
||
|
public void zzrf() {
|
||
|
if (this.zzbom) {
|
||
|
MessageType messagetype = (MessageType) this.zzbol.zza(zzf.zzbor, null, null);
|
||
|
zza(messagetype, this.zzbol);
|
||
|
this.zzbol = messagetype;
|
||
|
this.zzbom = false;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // com.google.android.gms.internal.firebase_ml.zzvq
|
||
|
public final boolean isInitialized() {
|
||
|
return zzue.zza(this.zzbol, false);
|
||
|
}
|
||
|
|
||
|
@Override // com.google.android.gms.internal.firebase_ml.zzvp
|
||
|
/* renamed from: zzrg, reason: merged with bridge method [inline-methods] */
|
||
|
public MessageType zzri() {
|
||
|
if (this.zzbom) {
|
||
|
return this.zzbol;
|
||
|
}
|
||
|
this.zzbol.zzpt();
|
||
|
this.zzbom = true;
|
||
|
return this.zzbol;
|
||
|
}
|
||
|
|
||
|
@Override // com.google.android.gms.internal.firebase_ml.zzvp
|
||
|
/* renamed from: zzrh, reason: merged with bridge method [inline-methods] */
|
||
|
public final MessageType zzrj() {
|
||
|
MessageType messagetype = (MessageType) zzri();
|
||
|
if (messagetype.isInitialized()) {
|
||
|
return messagetype;
|
||
|
}
|
||
|
throw new zzwv(messagetype);
|
||
|
}
|
||
|
|
||
|
@Override // com.google.android.gms.internal.firebase_ml.zzso
|
||
|
public final BuilderType zza(MessageType messagetype) {
|
||
|
zzrf();
|
||
|
zza(this.zzbol, messagetype);
|
||
|
return this;
|
||
|
}
|
||
|
|
||
|
private static void zza(MessageType messagetype, MessageType messagetype2) {
|
||
|
zzwb.zzso().zzad(messagetype).zzg(messagetype, messagetype2);
|
||
|
}
|
||
|
|
||
|
@Override // com.google.android.gms.internal.firebase_ml.zzso
|
||
|
/* renamed from: zzpr */
|
||
|
public final /* synthetic */ zzso clone() {
|
||
|
return (zza) clone();
|
||
|
}
|
||
|
|
||
|
/* JADX WARN: Multi-variable type inference failed */
|
||
|
@Override // com.google.android.gms.internal.firebase_ml.zzso
|
||
|
public /* synthetic */ Object clone() throws CloneNotSupportedException {
|
||
|
zza zzaVar = (zza) this.zzbok.zza(zzf.zzbos, null, null);
|
||
|
zzaVar.zza((zza) zzri());
|
||
|
return zzaVar;
|
||
|
}
|
||
|
|
||
|
@Override // com.google.android.gms.internal.firebase_ml.zzvq
|
||
|
public final /* synthetic */ zzvo zzre() {
|
||
|
return this.zzbok;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public boolean equals(Object obj) {
|
||
|
if (this == obj) {
|
||
|
return true;
|
||
|
}
|
||
|
if (((zzue) zza(zzf.zzbot, (Object) null, (Object) null)).getClass().isInstance(obj)) {
|
||
|
return zzwb.zzso().zzad(this).equals(this, (zzue) obj);
|
||
|
}
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
protected final void zzpt() {
|
||
|
zzwb.zzso().zzad(this).zzq(this);
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: protected */
|
||
|
public final <MessageType extends zzue<MessageType, BuilderType>, BuilderType extends zza<MessageType, BuilderType>> BuilderType zzqx() {
|
||
|
return (BuilderType) zza(zzf.zzbos, (Object) null, (Object) null);
|
||
|
}
|
||
|
|
||
|
@Override // com.google.android.gms.internal.firebase_ml.zzvq
|
||
|
public final boolean isInitialized() {
|
||
|
return zza(this, Boolean.TRUE.booleanValue());
|
||
|
}
|
||
|
|
||
|
@Override // com.google.android.gms.internal.firebase_ml.zzvo
|
||
|
public final void zzb(zztl zztlVar) throws IOException {
|
||
|
zzwb.zzso().zzk(getClass()).zza(this, zztn.zza(zztlVar));
|
||
|
}
|
||
|
|
||
|
@Override // com.google.android.gms.internal.firebase_ml.zzvo
|
||
|
public final int zzqy() {
|
||
|
if (this.zzboi == -1) {
|
||
|
this.zzboi = zzwb.zzso().zzad(this).zzaa(this);
|
||
|
}
|
||
|
return this.zzboi;
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
public static <T extends zzue<?, ?>> T zzi(Class<T> cls) {
|
||
|
zzue<?, ?> zzueVar = zzboj.get(cls);
|
||
|
if (zzueVar == null) {
|
||
|
try {
|
||
|
Class.forName(cls.getName(), true, cls.getClassLoader());
|
||
|
zzueVar = zzboj.get(cls);
|
||
|
} catch (ClassNotFoundException e) {
|
||
|
throw new IllegalStateException("Class initialization cannot fail.", e);
|
||
|
}
|
||
|
}
|
||
|
if (zzueVar == null) {
|
||
|
zzueVar = (T) ((zzue) zzxc.zzm(cls)).zza(zzf.zzbot, (Object) null, (Object) null);
|
||
|
if (zzueVar == null) {
|
||
|
throw new IllegalStateException();
|
||
|
}
|
||
|
zzboj.put(cls, zzueVar);
|
||
|
}
|
||
|
return (T) zzueVar;
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: protected */
|
||
|
public static <T extends zzue<?, ?>> void zza(Class<T> cls, T t) {
|
||
|
zzboj.put(cls, t);
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: protected */
|
||
|
public static Object zza(zzvo zzvoVar, String str, Object[] objArr) {
|
||
|
return new zzwd(zzvoVar, str, objArr);
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
public static Object zza(Method method, Object obj, Object... objArr) {
|
||
|
try {
|
||
|
return method.invoke(obj, objArr);
|
||
|
} catch (IllegalAccessException e) {
|
||
|
throw new RuntimeException("Couldn't use Java reflection to implement protocol message reflection.", e);
|
||
|
} catch (InvocationTargetException e2) {
|
||
|
Throwable cause = e2.getCause();
|
||
|
if (cause instanceof RuntimeException) {
|
||
|
throw ((RuntimeException) cause);
|
||
|
}
|
||
|
if (cause instanceof Error) {
|
||
|
throw ((Error) cause);
|
||
|
}
|
||
|
throw new RuntimeException("Unexpected exception thrown by generated accessor method.", cause);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
protected static final <T extends zzue<T, ?>> boolean zza(T t, boolean z) {
|
||
|
byte byteValue = ((Byte) t.zza(zzf.zzboo, null, null)).byteValue();
|
||
|
if (byteValue == 1) {
|
||
|
return true;
|
||
|
}
|
||
|
if (byteValue == 0) {
|
||
|
return false;
|
||
|
}
|
||
|
boolean zzac = zzwb.zzso().zzad(t).zzac(t);
|
||
|
if (z) {
|
||
|
t.zza(zzf.zzbop, zzac ? t : null, null);
|
||
|
}
|
||
|
return zzac;
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: protected */
|
||
|
public static zzul zzqz() {
|
||
|
return zzuf.zzrl();
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: protected */
|
||
|
public static zzul zza(zzul zzulVar) {
|
||
|
int size = zzulVar.size();
|
||
|
return zzulVar.zzck(size == 0 ? 10 : size << 1);
|
||
|
}
|
||
|
|
||
|
/* JADX WARN: Type inference failed for: r0v0, types: [com.google.android.gms.internal.firebase_ml.zzuc, com.google.android.gms.internal.firebase_ml.zzuk] */
|
||
|
protected static zzuk zzra() {
|
||
|
return zzuc.zzqv();
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: protected */
|
||
|
public static <E> zzun<E> zzrb() {
|
||
|
return zzwc.zzsp();
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: protected */
|
||
|
public static <E> zzun<E> zza(zzun<E> zzunVar) {
|
||
|
int size = zzunVar.size();
|
||
|
return zzunVar.zzck(size == 0 ? 10 : size << 1);
|
||
|
}
|
||
|
|
||
|
private static <T extends zzue<T, ?>> T zza(T t, byte[] bArr, int i, int i2, zztr zztrVar) throws zzuo {
|
||
|
T t2 = (T) t.zza(zzf.zzbor, null, null);
|
||
|
try {
|
||
|
zzwb.zzso().zzad(t2).zza(t2, bArr, 0, i2, new zzst(zztrVar));
|
||
|
t2.zzpt();
|
||
|
if (t2.zzbka == 0) {
|
||
|
return t2;
|
||
|
}
|
||
|
throw new RuntimeException();
|
||
|
} catch (IOException e) {
|
||
|
if (e.getCause() instanceof zzuo) {
|
||
|
throw ((zzuo) e.getCause());
|
||
|
}
|
||
|
throw new zzuo(e.getMessage()).zzg(t2);
|
||
|
} catch (IndexOutOfBoundsException unused) {
|
||
|
throw zzuo.zzrm().zzg(t2);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
protected static <T extends zzue<T, ?>> T zza(T t, byte[] bArr, zztr zztrVar) throws zzuo {
|
||
|
T t2 = (T) zza(t, bArr, 0, bArr.length, zztrVar);
|
||
|
if (t2 == null || t2.isInitialized()) {
|
||
|
return t2;
|
||
|
}
|
||
|
throw new zzuo(new zzwv(t2).getMessage()).zzg(t2);
|
||
|
}
|
||
|
|
||
|
@Override // com.google.android.gms.internal.firebase_ml.zzvo
|
||
|
public final /* synthetic */ zzvp zzrc() {
|
||
|
zza zzaVar = (zza) zza(zzf.zzbos, (Object) null, (Object) null);
|
||
|
zzaVar.zza((zza) this);
|
||
|
return zzaVar;
|
||
|
}
|
||
|
|
||
|
@Override // com.google.android.gms.internal.firebase_ml.zzvo
|
||
|
public final /* synthetic */ zzvp zzrd() {
|
||
|
return (zza) zza(zzf.zzbos, (Object) null, (Object) null);
|
||
|
}
|
||
|
|
||
|
@Override // com.google.android.gms.internal.firebase_ml.zzvq
|
||
|
public final /* synthetic */ zzvo zzre() {
|
||
|
return (zzue) zza(zzf.zzbot, (Object) null, (Object) null);
|
||
|
}
|
||
|
|
||
|
@Override // com.google.android.gms.internal.firebase_ml.zzsn
|
||
|
final int zzpq() {
|
||
|
return this.zzboi;
|
||
|
}
|
||
|
|
||
|
@Override // com.google.android.gms.internal.firebase_ml.zzsn
|
||
|
final void zzch(int i) {
|
||
|
this.zzboi = i;
|
||
|
}
|
||
|
}
|