what-the-bank/sources/com/google/android/gms/internal/gtm/zzsn.java

204 lines
8.9 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.google.android.gms.internal.gtm;
import com.airbnb.deeplinkdispatch.UrlTreeKt;
import com.google.android.gms.internal.gtm.zzrc;
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 zzsn {
/* JADX INFO: Access modifiers changed from: package-private */
public static String zza(zzsk zzskVar, String str) {
StringBuilder sb = new StringBuilder();
sb.append("# ");
sb.append(str);
zza(zzskVar, sb, 0);
return sb.toString();
}
private static void zza(zzsk zzskVar, StringBuilder sb, int i) {
boolean equals;
HashMap hashMap = new HashMap();
HashMap hashMap2 = new HashMap();
TreeSet<String> treeSet = new TreeSet();
for (Method method : zzskVar.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, zzdd(concat), zzrc.zza(method2, zzskVar, 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, zzdd(concat2), zzrc.zza(method3, zzskVar, 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 = zzrc.zza(method4, zzskVar, new Object[0]);
if (method5 == null) {
if (zza instanceof Boolean) {
if (((Boolean) zza).booleanValue()) {
zza(sb, i, zzdd(concat3), zza);
}
} else if (zza instanceof Integer) {
if (((Integer) zza).intValue() != 0) {
zza(sb, i, zzdd(concat3), zza);
}
} else if (zza instanceof Float) {
if (((Float) zza).floatValue() != BitmapDescriptorFactory.HUE_RED) {
zza(sb, i, zzdd(concat3), zza);
}
} else if (!(zza instanceof Double)) {
if (zza instanceof String) {
equals = zza.equals("");
} else if (zza instanceof zzps) {
equals = zza.equals(zzps.zzavx);
} else if (zza instanceof zzsk) {
if (zza != ((zzsk) zza).zzpi()) {
zza(sb, i, zzdd(concat3), zza);
}
} else {
if ((zza instanceof Enum) && ((Enum) zza).ordinal() == 0) {
}
zza(sb, i, zzdd(concat3), zza);
}
if (!equals) {
zza(sb, i, zzdd(concat3), zza);
}
} else if (((Double) zza).doubleValue() != 0.0d) {
zza(sb, i, zzdd(concat3), zza);
}
} else if (((Boolean) zzrc.zza(method5, zzskVar, new Object[0])).booleanValue()) {
zza(sb, i, zzdd(concat3), zza);
}
}
}
}
if (zzskVar instanceof zzrc.zzc) {
Iterator<Map.Entry<Object, Object>> it = ((zzrc.zzc) zzskVar).zzbaq.iterator();
if (it.hasNext()) {
it.next().getKey();
throw new NoSuchMethodError();
}
}
zzrc zzrcVar = (zzrc) zzskVar;
if (zzrcVar.zzbak != null) {
zzrcVar.zzbak.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(zztn.zzd(zzps.zzcy((String) obj)));
sb.append('\"');
return;
}
if (obj instanceof zzps) {
sb.append(": \"");
sb.append(zztn.zzd((zzps) obj));
sb.append('\"');
return;
}
if (obj instanceof zzrc) {
sb.append(" {");
zza((zzrc) 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 zzdd(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();
}
}