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

import Z0.o;
import android.util.Log;
import java.util.ArrayList;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import q.AbstractC2761L;

/* JADX INFO: loaded from: classes3.dex */
public final class zzail {
    public static zzabr zza(Exception exc, String str, String str2) {
        String message = exc.getMessage();
        StringBuilder sbI = AbstractC2761L.i("Failed to parse ", str, " for string [", str2, "] with exception: ");
        sbI.append(message);
        Log.e(str, sbI.toString());
        return new zzabr(o.p("Failed to parse ", str, " for string [", str2, "]"), exc);
    }

    public static List<String> zza(JSONArray jSONArray) {
        ArrayList arrayList = new ArrayList();
        if (jSONArray != null && jSONArray.length() != 0) {
            for (int i6 = 0; i6 < jSONArray.length(); i6++) {
                arrayList.add(jSONArray.getString(i6));
            }
        }
        return arrayList;
    }

    public static void zza(JSONObject jSONObject) throws JSONException {
        jSONObject.put("clientType", "CLIENT_TYPE_ANDROID");
    }

    public static void zza(JSONObject jSONObject, String str, String str2) throws JSONException {
        jSONObject.put(str, str2);
        jSONObject.put("recaptchaVersion", "RECAPTCHA_ENTERPRISE");
        jSONObject.put("clientType", "CLIENT_TYPE_ANDROID");
    }
}
