package P2;

import E1.C0104k;
import android.accounts.Account;
import android.os.Binder;
import android.os.Bundle;
import android.os.IBinder;
import android.os.IInterface;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.RemoteException;
import android.util.Log;
import com.google.android.gms.common.api.Scope;

/* JADX INFO: renamed from: P2.g, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C0250g extends Q2.a {
    public static final Parcelable.Creator<C0250g> CREATOR = new C0104k(18);

    /* JADX INFO: renamed from: E, reason: collision with root package name */
    public static final Scope[] f5389E = new Scope[0];

    /* JADX INFO: renamed from: F, reason: collision with root package name */
    public static final M2.d[] f5390F = new M2.d[0];

    /* JADX INFO: renamed from: A, reason: collision with root package name */
    public final boolean f5391A;

    /* JADX INFO: renamed from: B, reason: collision with root package name */
    public final int f5392B;

    /* JADX INFO: renamed from: C, reason: collision with root package name */
    public final boolean f5393C;
    public final String D;

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    public final int f5394q;

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    public final int f5395r;

    /* JADX INFO: renamed from: s, reason: collision with root package name */
    public final int f5396s;

    /* JADX INFO: renamed from: t, reason: collision with root package name */
    public String f5397t;

    /* JADX INFO: renamed from: u, reason: collision with root package name */
    public IBinder f5398u;

    /* JADX INFO: renamed from: v, reason: collision with root package name */
    public Scope[] f5399v;

    /* JADX INFO: renamed from: w, reason: collision with root package name */
    public Bundle f5400w;

    /* JADX INFO: renamed from: x, reason: collision with root package name */
    public Account f5401x;

    /* JADX INFO: renamed from: y, reason: collision with root package name */
    public M2.d[] f5402y;

    /* JADX INFO: renamed from: z, reason: collision with root package name */
    public M2.d[] f5403z;

    public C0250g(int i, int i5, int i8, String str, IBinder iBinder, Scope[] scopeArr, Bundle bundle, Account account, M2.d[] dVarArr, M2.d[] dVarArr2, boolean z8, int i9, boolean z9, String str2) {
        Scope[] scopeArr2 = scopeArr == null ? f5389E : scopeArr;
        Bundle bundle2 = bundle == null ? new Bundle() : bundle;
        M2.d[] dVarArr3 = f5390F;
        M2.d[] dVarArr4 = dVarArr == null ? dVarArr3 : dVarArr;
        dVarArr3 = dVarArr2 != null ? dVarArr2 : dVarArr3;
        this.f5394q = i;
        this.f5395r = i5;
        this.f5396s = i8;
        if ("com.google.android.gms".equals(str)) {
            this.f5397t = "com.google.android.gms";
        } else {
            this.f5397t = str;
        }
        if (i < 2) {
            Account account2 = null;
            if (iBinder != null) {
                int i10 = AbstractBinderC0244a.f5359f;
                IInterface iInterfaceQueryLocalInterface = iBinder.queryLocalInterface("com.google.android.gms.common.internal.IAccountAccessor");
                IInterface j8 = iInterfaceQueryLocalInterface instanceof InterfaceC0251h ? (InterfaceC0251h) iInterfaceQueryLocalInterface : new J(iBinder, "com.google.android.gms.common.internal.IAccountAccessor", 0);
                if (j8 != null) {
                    long jClearCallingIdentity = Binder.clearCallingIdentity();
                    try {
                        try {
                            J j9 = (J) j8;
                            Parcel parcelC = j9.c(j9.d(), 2);
                            Account account3 = (Account) Z2.b.a(parcelC, Account.CREATOR);
                            parcelC.recycle();
                            Binder.restoreCallingIdentity(jClearCallingIdentity);
                            account2 = account3;
                        } catch (RemoteException unused) {
                            Log.w("AccountAccessor", "Remote account accessor probably died");
                            Binder.restoreCallingIdentity(jClearCallingIdentity);
                        }
                    } catch (Throwable th) {
                        Binder.restoreCallingIdentity(jClearCallingIdentity);
                        throw th;
                    }
                }
            }
            this.f5401x = account2;
        } else {
            this.f5398u = iBinder;
            this.f5401x = account;
        }
        this.f5399v = scopeArr2;
        this.f5400w = bundle2;
        this.f5402y = dVarArr4;
        this.f5403z = dVarArr3;
        this.f5391A = z8;
        this.f5392B = i9;
        this.f5393C = z9;
        this.D = str2;
    }

    @Override // android.os.Parcelable
    public final void writeToParcel(Parcel parcel, int i) {
        C0104k.a(this, parcel, i);
    }
}
