209 lines
9.1 KiB
Java
209 lines
9.1 KiB
Java
|
package com.google.android.gms.internal.vision;
|
||
|
|
||
|
import com.airbnb.deeplinkdispatch.UrlTreeKt;
|
||
|
import com.google.android.gms.internal.vision.zzfy;
|
||
|
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 zzhi {
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
public static String zza(zzhf zzhfVar, String str) {
|
||
|
StringBuilder sb = new StringBuilder();
|
||
|
sb.append("# ");
|
||
|
sb.append(str);
|
||
|
zza(zzhfVar, sb, 0);
|
||
|
return sb.toString();
|
||
|
}
|
||
|
|
||
|
private static void zza(zzhf zzhfVar, StringBuilder sb, int i) {
|
||
|
boolean equals;
|
||
|
HashMap hashMap = new HashMap();
|
||
|
HashMap hashMap2 = new HashMap();
|
||
|
TreeSet<String> treeSet = new TreeSet();
|
||
|
for (Method method : zzhfVar.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, zzq(concat), zzfy.zza(method2, zzhfVar, 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, zzq(concat2), zzfy.zza(method3, zzhfVar, 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 = zzfy.zza(method4, zzhfVar, new Object[0]);
|
||
|
if (method5 == null) {
|
||
|
if (zza instanceof Boolean) {
|
||
|
if (((Boolean) zza).booleanValue()) {
|
||
|
zza(sb, i, zzq(concat3), zza);
|
||
|
}
|
||
|
} else if (zza instanceof Integer) {
|
||
|
if (((Integer) zza).intValue() != 0) {
|
||
|
zza(sb, i, zzq(concat3), zza);
|
||
|
}
|
||
|
} else if (zza instanceof Float) {
|
||
|
if (((Float) zza).floatValue() != BitmapDescriptorFactory.HUE_RED) {
|
||
|
zza(sb, i, zzq(concat3), zza);
|
||
|
}
|
||
|
} else if (!(zza instanceof Double)) {
|
||
|
if (zza instanceof String) {
|
||
|
equals = zza.equals("");
|
||
|
} else if (zza instanceof zzeo) {
|
||
|
equals = zza.equals(zzeo.zzrx);
|
||
|
} else if (zza instanceof zzhf) {
|
||
|
if (zza != ((zzhf) zza).zzfb()) {
|
||
|
zza(sb, i, zzq(concat3), zza);
|
||
|
}
|
||
|
} else {
|
||
|
if ((zza instanceof Enum) && ((Enum) zza).ordinal() == 0) {
|
||
|
}
|
||
|
zza(sb, i, zzq(concat3), zza);
|
||
|
}
|
||
|
if (!equals) {
|
||
|
zza(sb, i, zzq(concat3), zza);
|
||
|
}
|
||
|
} else if (((Double) zza).doubleValue() != 0.0d) {
|
||
|
zza(sb, i, zzq(concat3), zza);
|
||
|
}
|
||
|
} else if (((Boolean) zzfy.zza(method5, zzhfVar, new Object[0])).booleanValue()) {
|
||
|
zza(sb, i, zzq(concat3), zza);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
if (zzhfVar instanceof zzfy.zzd) {
|
||
|
Iterator<Map.Entry<zzfy.zze, Object>> it = ((zzfy.zzd) zzhfVar).zzwp.iterator();
|
||
|
while (it.hasNext()) {
|
||
|
Map.Entry<zzfy.zze, Object> next = it.next();
|
||
|
int i2 = next.getKey().number;
|
||
|
StringBuilder sb2 = new StringBuilder(13);
|
||
|
sb2.append("[");
|
||
|
sb2.append(i2);
|
||
|
sb2.append("]");
|
||
|
zza(sb, i, sb2.toString(), next.getValue());
|
||
|
}
|
||
|
}
|
||
|
zzfy zzfyVar = (zzfy) zzhfVar;
|
||
|
if (zzfyVar.zzwj != null) {
|
||
|
zzfyVar.zzwj.zza(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(zzik.zzd(zzeo.zzl((String) obj)));
|
||
|
sb.append('\"');
|
||
|
return;
|
||
|
}
|
||
|
if (obj instanceof zzeo) {
|
||
|
sb.append(": \"");
|
||
|
sb.append(zzik.zzd((zzeo) obj));
|
||
|
sb.append('\"');
|
||
|
return;
|
||
|
}
|
||
|
if (obj instanceof zzfy) {
|
||
|
sb.append(" {");
|
||
|
zza((zzfy) 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 zzq(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();
|
||
|
}
|
||
|
}
|