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

import android.text.TextUtils;
import androidx.annotation.Nullable;
import org.json.JSONException;
import org.json.JSONObject;

/* JADX INFO: loaded from: classes2.dex */
public final class g71 implements m61 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final nj1 f11545a;

    @Nullable
    private final com.google.android.gms.ads.identifier.a zza;

    @Nullable
    private final String zzb;

    public g71(@Nullable com.google.android.gms.ads.identifier.a aVar, @Nullable String str, nj1 nj1Var) {
        this.zza = aVar;
        this.zzb = str;
        this.f11545a = nj1Var;
    }

    @Override // com.google.android.gms.internal.ads.m61
    public final void zza(Object obj) {
        try {
            JSONObject jSONObjectF = p7.y.f("pii", (JSONObject) obj);
            com.google.android.gms.ads.identifier.a aVar = this.zza;
            if (aVar == null || TextUtils.isEmpty(aVar.getId())) {
                String str = this.zzb;
                if (str != null) {
                    jSONObjectF.put("pdid", str);
                    jSONObjectF.put("pdidtype", "ssaid");
                    return;
                }
                return;
            }
            jSONObjectF.put("rdid", aVar.getId());
            jSONObjectF.put("is_lat", aVar.f7871a);
            jSONObjectF.put("idtype", "adid");
            nj1 nj1Var = this.f11545a;
            if (nj1Var.f14649a != null) {
                long j10 = nj1Var.f14650b;
                if (j10 > 0) {
                    jSONObjectF.put("paidv1_id_android_3p", nj1Var.zza());
                    jSONObjectF.put("paidv1_creation_time_android_3p", j10);
                }
            }
        } catch (JSONException unused) {
            p7.l0.h();
        }
    }
}
