package com.google.android.gms.internal.p002firebaseauthapi; import a4.h; import android.content.Intent; import android.net.Uri; import android.os.AsyncTask; import android.text.TextUtils; import com.google.android.gms.common.internal.Preconditions; import com.google.android.gms.common.logging.Logger; import com.google.firebase.auth.FirebaseAuth; import java.io.ByteArrayOutputStream; import java.io.InputStream; import java.lang.ref.WeakReference; import w3.f; /* loaded from: classes.dex */ public final class zzaau extends AsyncTask { private static final Logger zza = new Logger("FirebaseAuth", "GetAuthDomainTask"); private final String zzb; private final String zzc; private final WeakReference zzd; private final Uri.Builder zze; private final String zzf; private final f zzg; public zzaau(String str, String str2, Intent intent, f fVar, zzaaw zzaawVar) { this.zzb = Preconditions.checkNotEmpty(str); this.zzg = (f) Preconditions.checkNotNull(fVar); Preconditions.checkNotEmpty(str2); Preconditions.checkNotNull(intent); String checkNotEmpty = Preconditions.checkNotEmpty(intent.getStringExtra("com.google.firebase.auth.KEY_API_KEY")); Uri.Builder buildUpon = Uri.parse(zzaawVar.zzc(checkNotEmpty)).buildUpon(); buildUpon.appendPath("getProjectConfig").appendQueryParameter("key", checkNotEmpty).appendQueryParameter("androidPackageName", str).appendQueryParameter("sha1Cert", (String) Preconditions.checkNotNull(str2)); this.zzc = buildUpon.build().toString(); this.zzd = new WeakReference(zzaawVar); this.zze = zzaawVar.zzb(intent, str, str2); this.zzf = intent.getStringExtra("com.google.firebase.auth.KEY_CUSTOM_AUTH_DOMAIN"); } /* JADX INFO: Access modifiers changed from: private */ @Override // android.os.AsyncTask /* renamed from: zza, reason: merged with bridge method [inline-methods] */ public final void onPostExecute(zzaat zzaatVar) { String str; String str2; Uri.Builder builder; zzaaw zzaawVar = (zzaaw) this.zzd.get(); if (zzaatVar != null) { str = zzaatVar.zzc(); str2 = zzaatVar.zzd(); } else { str = null; str2 = null; } if (zzaawVar == null) { zza.e("An error has occurred: the handler reference has returned null.", new Object[0]); } else if (TextUtils.isEmpty(str) || (builder = this.zze) == null) { zzaawVar.zze(this.zzb, h.a(str2)); } else { builder.authority(str); zzaawVar.zzf(this.zze.build(), this.zzb, FirebaseAuth.getInstance(this.zzg).k()); } } private static byte[] zzb(InputStream inputStream, int i10) { ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); try { byte[] bArr = new byte[128]; while (true) { int read = inputStream.read(bArr); if (read == -1) { return byteArrayOutputStream.toByteArray(); } byteArrayOutputStream.write(bArr, 0, read); } } finally { byteArrayOutputStream.close(); } } /* JADX WARN: Code restructure failed: missing block: B:34:0x00dc, code lost: r1 = 0; */ /* JADX WARN: Multi-variable type inference failed */ /* JADX WARN: Type inference failed for: r2v12, types: [java.lang.String] */ /* JADX WARN: Type inference failed for: r2v8, types: [int] */ /* JADX WARN: Type inference failed for: r2v9 */ @Override // android.os.AsyncTask /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct code enable 'Show inconsistent code' option in preferences */ protected final /* bridge */ /* synthetic */ java.lang.Object doInBackground(java.lang.Object[] r8) { /* Method dump skipped, instructions count: 319 To view this dump change 'Code comments level' option to 'DEBUG' */ throw new UnsupportedOperationException("Method not decompiled: com.google.android.gms.internal.p002firebaseauthapi.zzaau.doInBackground(java.lang.Object[]):java.lang.Object"); } @Override // android.os.AsyncTask protected final /* synthetic */ void onCancelled(Object obj) { onPostExecute(null); } }