204 lines
8.9 KiB
Java
204 lines
8.9 KiB
Java
package com.google.android.gms.internal.firebase_ml;
|
|
|
|
import com.airbnb.deeplinkdispatch.UrlTreeKt;
|
|
import com.google.android.gms.internal.firebase_ml.zzue;
|
|
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
|
|
import com.google.android.gms.measurement.api.AppMeasurementSdk;
|
|
import java.lang.reflect.Method;
|
|
import java.lang.reflect.Modifier;
|
|
import java.util.HashMap;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.TreeSet;
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
/* loaded from: classes2.dex */
|
|
public final class zzvr {
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static String zza(zzvo zzvoVar, String str) {
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append("# ");
|
|
sb.append(str);
|
|
zza(zzvoVar, sb, 0);
|
|
return sb.toString();
|
|
}
|
|
|
|
private static void zza(zzvo zzvoVar, StringBuilder sb, int i) {
|
|
boolean equals;
|
|
HashMap hashMap = new HashMap();
|
|
HashMap hashMap2 = new HashMap();
|
|
TreeSet<String> treeSet = new TreeSet();
|
|
for (Method method : zzvoVar.getClass().getDeclaredMethods()) {
|
|
hashMap2.put(method.getName(), method);
|
|
if (method.getParameterTypes().length == 0) {
|
|
hashMap.put(method.getName(), method);
|
|
if (method.getName().startsWith("get")) {
|
|
treeSet.add(method.getName());
|
|
}
|
|
}
|
|
}
|
|
for (String str : treeSet) {
|
|
String replaceFirst = str.replaceFirst("get", "");
|
|
if (replaceFirst.endsWith("List") && !replaceFirst.endsWith("OrBuilderList") && !replaceFirst.equals("List")) {
|
|
String valueOf = String.valueOf(replaceFirst.substring(0, 1).toLowerCase());
|
|
String valueOf2 = String.valueOf(replaceFirst.substring(1, replaceFirst.length() - 4));
|
|
String concat = valueOf2.length() != 0 ? valueOf.concat(valueOf2) : new String(valueOf);
|
|
Method method2 = (Method) hashMap.get(str);
|
|
if (method2 != null && method2.getReturnType().equals(List.class)) {
|
|
zza(sb, i, zzcq(concat), zzue.zza(method2, zzvoVar, new Object[0]));
|
|
}
|
|
}
|
|
if (replaceFirst.endsWith("Map") && !replaceFirst.equals("Map")) {
|
|
String valueOf3 = String.valueOf(replaceFirst.substring(0, 1).toLowerCase());
|
|
String valueOf4 = String.valueOf(replaceFirst.substring(1, replaceFirst.length() - 3));
|
|
String concat2 = valueOf4.length() != 0 ? valueOf3.concat(valueOf4) : new String(valueOf3);
|
|
Method method3 = (Method) hashMap.get(str);
|
|
if (method3 != null && method3.getReturnType().equals(Map.class) && !method3.isAnnotationPresent(Deprecated.class) && Modifier.isPublic(method3.getModifiers())) {
|
|
zza(sb, i, zzcq(concat2), zzue.zza(method3, zzvoVar, new Object[0]));
|
|
}
|
|
}
|
|
String valueOf5 = String.valueOf(replaceFirst);
|
|
if (((Method) hashMap2.get(valueOf5.length() != 0 ? "set".concat(valueOf5) : new String("set"))) != null) {
|
|
if (replaceFirst.endsWith("Bytes")) {
|
|
String valueOf6 = String.valueOf(replaceFirst.substring(0, replaceFirst.length() - 5));
|
|
if (!hashMap.containsKey(valueOf6.length() != 0 ? "get".concat(valueOf6) : new String("get"))) {
|
|
}
|
|
}
|
|
String valueOf7 = String.valueOf(replaceFirst.substring(0, 1).toLowerCase());
|
|
String valueOf8 = String.valueOf(replaceFirst.substring(1));
|
|
String concat3 = valueOf8.length() != 0 ? valueOf7.concat(valueOf8) : new String(valueOf7);
|
|
String valueOf9 = String.valueOf(replaceFirst);
|
|
Method method4 = (Method) hashMap.get(valueOf9.length() != 0 ? "get".concat(valueOf9) : new String("get"));
|
|
String valueOf10 = String.valueOf(replaceFirst);
|
|
Method method5 = (Method) hashMap.get(valueOf10.length() != 0 ? "has".concat(valueOf10) : new String("has"));
|
|
if (method4 != null) {
|
|
Object zza = zzue.zza(method4, zzvoVar, new Object[0]);
|
|
if (method5 == null) {
|
|
if (zza instanceof Boolean) {
|
|
if (((Boolean) zza).booleanValue()) {
|
|
zza(sb, i, zzcq(concat3), zza);
|
|
}
|
|
} else if (zza instanceof Integer) {
|
|
if (((Integer) zza).intValue() != 0) {
|
|
zza(sb, i, zzcq(concat3), zza);
|
|
}
|
|
} else if (zza instanceof Float) {
|
|
if (((Float) zza).floatValue() != BitmapDescriptorFactory.HUE_RED) {
|
|
zza(sb, i, zzcq(concat3), zza);
|
|
}
|
|
} else if (!(zza instanceof Double)) {
|
|
if (zza instanceof String) {
|
|
equals = zza.equals("");
|
|
} else if (zza instanceof zzsw) {
|
|
equals = zza.equals(zzsw.zzbkl);
|
|
} else if (zza instanceof zzvo) {
|
|
if (zza != ((zzvo) zza).zzre()) {
|
|
zza(sb, i, zzcq(concat3), zza);
|
|
}
|
|
} else {
|
|
if ((zza instanceof Enum) && ((Enum) zza).ordinal() == 0) {
|
|
}
|
|
zza(sb, i, zzcq(concat3), zza);
|
|
}
|
|
if (!equals) {
|
|
zza(sb, i, zzcq(concat3), zza);
|
|
}
|
|
} else if (((Double) zza).doubleValue() != 0.0d) {
|
|
zza(sb, i, zzcq(concat3), zza);
|
|
}
|
|
} else if (((Boolean) zzue.zza(method5, zzvoVar, new Object[0])).booleanValue()) {
|
|
zza(sb, i, zzcq(concat3), zza);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (zzvoVar instanceof zzue.zzd) {
|
|
Iterator<Map.Entry<Object, Object>> it = ((zzue.zzd) zzvoVar).zzbon.iterator();
|
|
if (it.hasNext()) {
|
|
it.next().getKey();
|
|
throw new NoSuchMethodError();
|
|
}
|
|
}
|
|
zzue zzueVar = (zzue) zzvoVar;
|
|
if (zzueVar.zzboh != null) {
|
|
zzueVar.zzboh.zzb(sb, i);
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static final void zza(StringBuilder sb, int i, String str, Object obj) {
|
|
if (obj instanceof List) {
|
|
Iterator it = ((List) obj).iterator();
|
|
while (it.hasNext()) {
|
|
zza(sb, i, str, it.next());
|
|
}
|
|
return;
|
|
}
|
|
if (obj instanceof Map) {
|
|
Iterator it2 = ((Map) obj).entrySet().iterator();
|
|
while (it2.hasNext()) {
|
|
zza(sb, i, str, (Map.Entry) it2.next());
|
|
}
|
|
return;
|
|
}
|
|
sb.append('\n');
|
|
int i2 = 0;
|
|
for (int i3 = 0; i3 < i; i3++) {
|
|
sb.append(' ');
|
|
}
|
|
sb.append(str);
|
|
if (obj instanceof String) {
|
|
sb.append(": \"");
|
|
sb.append(zzws.zzd(zzsw.zzcn((String) obj)));
|
|
sb.append('\"');
|
|
return;
|
|
}
|
|
if (obj instanceof zzsw) {
|
|
sb.append(": \"");
|
|
sb.append(zzws.zzd((zzsw) obj));
|
|
sb.append('\"');
|
|
return;
|
|
}
|
|
if (obj instanceof zzue) {
|
|
sb.append(" {");
|
|
zza((zzue) obj, sb, i + 2);
|
|
sb.append("\n");
|
|
while (i2 < i) {
|
|
sb.append(' ');
|
|
i2++;
|
|
}
|
|
sb.append(UrlTreeKt.componentParamSuffix);
|
|
return;
|
|
}
|
|
if (obj instanceof Map.Entry) {
|
|
sb.append(" {");
|
|
Map.Entry entry = (Map.Entry) obj;
|
|
int i4 = i + 2;
|
|
zza(sb, i4, "key", entry.getKey());
|
|
zza(sb, i4, AppMeasurementSdk.ConditionalUserProperty.VALUE, entry.getValue());
|
|
sb.append("\n");
|
|
while (i2 < i) {
|
|
sb.append(' ');
|
|
i2++;
|
|
}
|
|
sb.append(UrlTreeKt.componentParamSuffix);
|
|
return;
|
|
}
|
|
sb.append(": ");
|
|
sb.append(obj.toString());
|
|
}
|
|
|
|
private static final String zzcq(String str) {
|
|
StringBuilder sb = new StringBuilder();
|
|
for (int i = 0; i < str.length(); i++) {
|
|
char charAt = str.charAt(i);
|
|
if (Character.isUpperCase(charAt)) {
|
|
sb.append("_");
|
|
}
|
|
sb.append(Character.toLowerCase(charAt));
|
|
}
|
|
return sb.toString();
|
|
}
|
|
}
|