package com.google.android.gms.internal.p002firebaseauthapi; import com.google.android.gms.ads.RequestConfiguration; import com.google.android.gms.measurement.api.AppMeasurementSdk; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.TreeMap; /* loaded from: classes.dex */ final class zzaik { private static final char[] zza; static { char[] cArr = new char[80]; zza = cArr; Arrays.fill(cArr, ' '); } static String zza(zzaii zzaiiVar, String str) { StringBuilder sb = new StringBuilder(); sb.append("# "); sb.append(str); zzd(zzaiiVar, sb, 0); return sb.toString(); } static void zzb(StringBuilder sb, int i10, String str, Object obj) { if (obj instanceof List) { Iterator it = ((List) obj).iterator(); while (it.hasNext()) { zzb(sb, i10, str, it.next()); } return; } if (obj instanceof Map) { Iterator it2 = ((Map) obj).entrySet().iterator(); while (it2.hasNext()) { zzb(sb, i10, str, (Map.Entry) it2.next()); } return; } sb.append('\n'); zzc(i10, sb); if (!str.isEmpty()) { StringBuilder sb2 = new StringBuilder(); sb2.append(Character.toLowerCase(str.charAt(0))); for (int i11 = 1; i11 < str.length(); i11++) { char charAt = str.charAt(i11); if (Character.isUpperCase(charAt)) { sb2.append("_"); } sb2.append(Character.toLowerCase(charAt)); } str = sb2.toString(); } sb.append(str); if (obj instanceof String) { sb.append(": \""); sb.append(zzajj.zza(new zzafv(((String) obj).getBytes(zzahj.zzb)))); sb.append('\"'); return; } if (obj instanceof zzafy) { sb.append(": \""); sb.append(zzajj.zza((zzafy) obj)); sb.append('\"'); return; } if (obj instanceof zzahd) { sb.append(" {"); zzd((zzahd) obj, sb, i10 + 2); sb.append("\n"); zzc(i10, sb); sb.append("}"); return; } if (!(obj instanceof Map.Entry)) { sb.append(": "); sb.append(obj); return; } sb.append(" {"); Map.Entry entry = (Map.Entry) obj; int i12 = i10 + 2; zzb(sb, i12, "key", entry.getKey()); zzb(sb, i12, AppMeasurementSdk.ConditionalUserProperty.VALUE, entry.getValue()); sb.append("\n"); zzc(i10, sb); sb.append("}"); } private static void zzc(int i10, StringBuilder sb) { while (i10 > 0) { int i11 = 80; if (i10 <= 80) { i11 = i10; } sb.append(zza, 0, i11); i10 -= i11; } } private static void zzd(zzaii zzaiiVar, StringBuilder sb, int i10) { int i11; boolean equals; Method method; Method method2; HashSet hashSet = new HashSet(); HashMap hashMap = new HashMap(); TreeMap treeMap = new TreeMap(); Method[] declaredMethods = zzaiiVar.getClass().getDeclaredMethods(); int length = declaredMethods.length; int i12 = 0; while (true) { i11 = 3; if (i12 >= length) { break; } Method method3 = declaredMethods[i12]; if (!Modifier.isStatic(method3.getModifiers()) && method3.getName().length() >= 3) { if (method3.getName().startsWith("set")) { hashSet.add(method3.getName()); } else if (Modifier.isPublic(method3.getModifiers()) && method3.getParameterTypes().length == 0) { if (method3.getName().startsWith("has")) { hashMap.put(method3.getName(), method3); } else if (method3.getName().startsWith("get")) { treeMap.put(method3.getName(), method3); } } } i12++; } for (Map.Entry entry : treeMap.entrySet()) { String substring = ((String) entry.getKey()).substring(i11); if (substring.endsWith("List") && !substring.endsWith("OrBuilderList") && !substring.equals("List") && (method2 = (Method) entry.getValue()) != null && method2.getReturnType().equals(List.class)) { zzb(sb, i10, substring.substring(0, substring.length() - 4), zzahd.zzD(method2, zzaiiVar, new Object[0])); } else if (substring.endsWith("Map") && !substring.equals("Map") && (method = (Method) entry.getValue()) != null && method.getReturnType().equals(Map.class) && !method.isAnnotationPresent(Deprecated.class) && Modifier.isPublic(method.getModifiers())) { zzb(sb, i10, substring.substring(0, substring.length() - 3), zzahd.zzD(method, zzaiiVar, new Object[0])); } else if (hashSet.contains("set".concat(substring)) && (!substring.endsWith("Bytes") || !treeMap.containsKey("get".concat(String.valueOf(substring.substring(0, substring.length() - 5)))))) { Method method4 = (Method) entry.getValue(); Method method5 = (Method) hashMap.get("has".concat(substring)); if (method4 != null) { Object zzD = zzahd.zzD(method4, zzaiiVar, new Object[0]); if (method5 != null) { if (!((Boolean) zzahd.zzD(method5, zzaiiVar, new Object[0])).booleanValue()) { } zzb(sb, i10, substring, zzD); } else if (zzD instanceof Boolean) { if (!((Boolean) zzD).booleanValue()) { } zzb(sb, i10, substring, zzD); } else if (zzD instanceof Integer) { if (((Integer) zzD).intValue() == 0) { } zzb(sb, i10, substring, zzD); } else if (zzD instanceof Float) { if (Float.floatToRawIntBits(((Float) zzD).floatValue()) == 0) { } zzb(sb, i10, substring, zzD); } else if (zzD instanceof Double) { if (Double.doubleToRawLongBits(((Double) zzD).doubleValue()) == 0) { } zzb(sb, i10, substring, zzD); } else { if (zzD instanceof String) { equals = zzD.equals(RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED); } else if (zzD instanceof zzafy) { equals = zzD.equals(zzafy.zzb); } else if (zzD instanceof zzaii) { if (zzD == ((zzaii) zzD).zzM()) { } zzb(sb, i10, substring, zzD); } else { if ((zzD instanceof Enum) && ((Enum) zzD).ordinal() == 0) { } zzb(sb, i10, substring, zzD); } if (equals) { } zzb(sb, i10, substring, zzD); } } } i11 = 3; } if (zzaiiVar instanceof zzaha) { throw null; } zzajp zzajpVar = ((zzahd) zzaiiVar).zzc; if (zzajpVar != null) { zzajpVar.zzi(sb, i10); } } }