package com.google.android.gms.internal.p002firebaseauthapi;

import android.text.TextUtils;
import android.util.Log;
import com.ironsource.y8;
import io.invertase.firebase.functions.UniversalFirebaseFunctionsModule;
import org.json.JSONException;
import org.json.JSONObject;
/* compiled from: com.google.firebase:firebase-auth@@23.1.0 */
/* renamed from: com.google.android.gms.internal.firebase-auth-api.zzafj  reason: invalid package */
/* loaded from: classes3.dex */
public class zzafj implements zzadt<zzafj> {
    private static final String zza = "com.google.android.gms.internal.firebase-auth-api.zzafj";
    private String zzb;

    public final String zza() {
        return this.zzb;
    }

    /* JADX INFO: Access modifiers changed from: private */
    @Override // com.google.android.gms.internal.p002firebaseauthapi.zzadt
    /* renamed from: zzb */
    public final zzafj zza(String str) throws zzabg {
        try {
            JSONObject jSONObject = new JSONObject(new JSONObject(str).getString("error"));
            jSONObject.getInt(UniversalFirebaseFunctionsModule.CODE_KEY);
            this.zzb = jSONObject.getString("message");
            return this;
        } catch (NullPointerException | JSONException e) {
            Log.e(zza, "Failed to parse error for string [" + str + "] with exception: " + e.getMessage());
            throw new zzabg("Failed to parse error for string [" + str + y8.i.e, e);
        }
    }

    public final boolean zzb() {
        return !TextUtils.isEmpty(this.zzb);
    }
}
