package com.google.android.gms.common;

import X.AnonymousClass89V;
import X.C156489b;
import X.C156789e;
import X.C157489l;
import X.C157989q;
import X.C158089r;
import X.C16008Al;
import X.C36088vf;
import android.os.IBinder;
import android.os.IInterface;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.RemoteException;
import com.bytedance.covode.number.Covode;
import com.bytedance.frameworks.apm.trace.MethodCollector;
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;

public final class zzj extends AbstractSafeParcelable {
    public static final Parcelable.Creator<zzj> CREATOR = new C16008Al();
    public final String LIZ;
    public final C156489b LIZIZ;
    public final boolean LIZJ;
    public final boolean LIZLLL;

    static {
        Covode.recordClassIndex(42890);
    }

    public static C156489b LIZ(IBinder iBinder) {
        C156789e r1;
        byte[] bArr;
        if (iBinder == null) {
            return null;
        }
        try {
            IInterface queryLocalInterface = iBinder.queryLocalInterface("com.google.android.gms.common.internal.ICertData");
            if (queryLocalInterface instanceof C156789e) {
                r1 = (C156789e) queryLocalInterface;
            } else {
                r1 = new C157489l(iBinder);
            }
            C157989q LIZ2 = r1.LIZ();
            if (LIZ2 == null || (bArr = (byte[]) C158089r.LIZ(LIZ2)) == null) {
                return null;
            }
            return new AnonymousClass89V(bArr);
        } catch (RemoteException unused) {
            return null;
        }
    }

    public final void writeToParcel(Parcel parcel, int i) {
        MethodCollector.i(18838);
        int LIZ2 = C36088vf.LIZ(parcel, 20293);
        C36088vf.LIZ(parcel, 1, this.LIZ);
        C156489b r1 = this.LIZIZ;
        if (r1 == null) {
            r1 = null;
        } else {
            r1.asBinder();
        }
        C36088vf.LIZ(parcel, 2, (IBinder) r1);
        C36088vf.LIZ(parcel, 3, this.LIZJ);
        C36088vf.LIZ(parcel, 4, this.LIZLLL);
        C36088vf.LIZIZ(parcel, LIZ2);
        MethodCollector.o(18838);
    }

    public zzj(String str, C156489b r2, boolean z, boolean z2) {
        this.LIZ = str;
        this.LIZIZ = r2;
        this.LIZJ = z;
        this.LIZLLL = z2;
    }

    public zzj(String str, IBinder iBinder, boolean z, boolean z2) {
        this.LIZ = str;
        this.LIZIZ = LIZ(iBinder);
        this.LIZJ = z;
        this.LIZLLL = z2;
    }
}
