package com.google.ads.interactivemedia.v3.internal;

import android.content.Context;
import android.os.IBinder;
import android.os.IInterface;
import android.os.RemoteException;
import androidx.annotation.VisibleForTesting;
import com.google.android.gms.dynamite.descriptors.com.google.android.gms.ads.dynamite.ModuleDescriptor;
import l8.c;

/* JADX INFO: loaded from: classes2.dex */
public final class zzpj {

    @VisibleForTesting
    final zzpm zza;

    @VisibleForTesting
    final boolean zzb;

    private zzpj(zzpm zzpmVar) {
        this.zza = zzpmVar;
        this.zzb = zzpmVar != null;
    }

    public static zzpj zzb(Context context, String str, String str2) {
        zzpm zzpkVar;
        try {
            try {
                try {
                    IBinder iBinderB = c.c(context, c.f30167b, ModuleDescriptor.MODULE_ID).b("com.google.android.gms.gass.internal.clearcut.GassDynamiteClearcutLogger");
                    if (iBinderB == null) {
                        zzpkVar = null;
                    } else {
                        IInterface iInterfaceQueryLocalInterface = iBinderB.queryLocalInterface("com.google.android.gms.gass.internal.clearcut.IGassClearcut");
                        zzpkVar = iInterfaceQueryLocalInterface instanceof zzpm ? (zzpm) iInterfaceQueryLocalInterface : new zzpk(iBinderB);
                    }
                    zzpkVar.zze(new k8.b(context), str, null);
                    return new zzpj(zzpkVar);
                } catch (RemoteException | zzon | NullPointerException | SecurityException unused) {
                    return new zzpj(new zzpn());
                }
            } catch (Exception e10) {
                throw new zzon(e10);
            }
        } catch (Exception e11) {
            throw new zzon(e11);
        }
    }

    public static zzpj zzc() {
        return new zzpj(new zzpn());
    }

    public final zzpi zza(byte[] bArr) {
        return new zzpi(this, bArr, null);
    }
}
