package I2;

import android.content.Context;
import com.google.android.gms.internal.play_billing.zzc;

/* JADX INFO: renamed from: I2.b, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C0318b {

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public volatile Object f2582b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public volatile Object f2583c;

    public /* synthetic */ C0318b(Object obj) {
        this.f2581a = obj;
    }

    public C0320d a() {
        Context context = (Context) this.f2581a;
        if (context == null) {
            throw new IllegalArgumentException("Please provide a valid Context.");
        }
        if (((InterfaceC0339x) this.f2583c) == null) {
            throw new IllegalArgumentException("Please provide a valid listener for purchases updates.");
        }
        if (((C0331o) this.f2582b) == null) {
            throw new IllegalArgumentException("Pending purchases for one-time products must be supported.");
        }
        ((C0331o) this.f2582b).getClass();
        if (((InterfaceC0339x) this.f2583c) == null) {
            C0331o c0331o = (C0331o) this.f2582b;
            return b() ? new S(c0331o, context, this) : new C0320d(c0331o, context, this);
        }
        C0331o c0331o2 = (C0331o) this.f2582b;
        InterfaceC0339x interfaceC0339x = (InterfaceC0339x) this.f2583c;
        return b() ? new S(c0331o2, context, interfaceC0339x, this) : new C0320d(c0331o2, context, interfaceC0339x, this);
    }

    public boolean b() {
        try {
            Context context = (Context) this.f2581a;
            return context.getPackageManager().getApplicationInfo(context.getPackageName(), 128).metaData.getBoolean("com.google.android.play.billingclient.enableBillingOverridesTesting", false);
        } catch (Exception e6) {
            zzc.zzo("BillingClient", "Unable to retrieve metadata value for enableBillingOverridesTesting.", e6);
            return false;
        }
    }
}
