package defpackage;

import android.os.BadParcelableException;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.Log;
import j$.util.Objects;
import java.util.Arrays;

/* renamed from: ˑᵔ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class BinderC2066 extends AbstractBinderC3673 {

    /* renamed from: ˎˏʜʾ, reason: contains not printable characters */
    public final ServiceConnectionC2349 f8233;

    /* renamed from: ᵝᵵᵺ, reason: contains not printable characters */
    public final int f8234;

    /* renamed from: ᵶᵷᵕ, reason: contains not printable characters */
    public final /* synthetic */ C3768 f8235;

    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    public final Boolean f8236;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public BinderC2066(C3768 c3768, ServiceConnectionC2349 serviceConnectionC2349, Boolean bool, int i) {
        super(1, "com.android.vending.billing.IInAppBillingInitializeCallback");
        Objects.requireNonNull(c3768);
        this.f8235 = c3768;
        this.f8233 = serviceConnectionC2349;
        this.f8236 = bool;
        this.f8234 = i;
    }

    /* renamed from: ˁˑᵰ, reason: contains not printable characters */
    public final void m5659(ServiceConnectionC2349 serviceConnectionC2349, C3297 c3297, int i, boolean z, String str, int i2) {
        this.f8235.m8414(0);
        serviceConnectionC2349.m6099(c3297, i, str, z, i2);
        serviceConnectionC2349.m6096(c3297);
    }

    @Override // defpackage.AbstractBinderC3673
    /* renamed from: ᐧﾞ, reason: contains not printable characters */
    public final boolean mo5660(Parcel parcel, int i) {
        AbstractC1447 c2438;
        if (i != 1) {
            return false;
        }
        Parcelable.Creator creator = Bundle.CREATOR;
        Bundle bundle = (Bundle) AbstractC1474.m4383(parcel);
        int iDataAvail = parcel.dataAvail();
        if (iDataAvail > 0) {
            throw new BadParcelableException(AbstractC2990.m7313(iDataAvail, "Parcel data not fully consumed, unread size: "));
        }
        if (bundle == null) {
            int i2 = AbstractC1845.f7462;
            Log.isLoggable("BillingClient", 5);
            m5659(this.f8233, AbstractC5497.f20625, 122, this.f8236.booleanValue(), null, this.f8234);
            return true;
        }
        if (!bundle.containsKey("RESPONSE_CODE")) {
            int i3 = AbstractC1845.f7462;
            Log.isLoggable("BillingClient", 5);
            m5659(this.f8233, AbstractC5497.f20625, 129, this.f8236.booleanValue(), null, this.f8234);
            return true;
        }
        if (bundle.getInt("RESPONSE_CODE") != 0) {
            m5659(this.f8233, AbstractC5497.m11122(bundle.getInt("RESPONSE_CODE"), bundle.getString("DEBUG_MESSAGE", "")), 130, this.f8236.booleanValue(), AbstractC2990.m7313(bundle.getInt("RESPONSE_CODE"), "Response code from Phonesky: "), this.f8234);
            return true;
        }
        if (!bundle.containsKey("BILLING_API_VERSION_KEY")) {
            int i4 = AbstractC1845.f7462;
            Log.isLoggable("BillingClient", 5);
            m5659(this.f8233, AbstractC5497.f20625, 128, this.f8236.booleanValue(), null, this.f8234);
            return true;
        }
        int i5 = bundle.getInt("BILLING_API_VERSION_KEY");
        C3768 c3768 = this.f8235;
        C3768.m8392(c3768, i5);
        c3768.f14078 = i5 >= 3;
        Bundle bundle2 = bundle.getBundle("EXPERIMENT_VALUES_KEY");
        if (bundle2 != null) {
            try {
                bundle2.getBoolean("DELEGATION_API_ENABLED_KEY");
            } catch (Throwable unused) {
                "Error reading EnableDelegationApi experiment flag: ".concat(bundle2.toString());
                AbstractC1845.m5213("BillingClient");
            }
            try {
                ᵱᵞᵪ.ᵧـˌᵎ = bundle2.getLong("AUTO_SERVICE_RECONNECTION_SYNCHRONOUS_TIMEOUT_MS_KEY");
            } catch (Throwable unused2) {
                "Error reading AutoServiceReconnectionSynchronousTimeoutMs experiment flag: ".concat(bundle2.toString());
                AbstractC1845.m5213("BillingClient");
            }
            try {
                ᵱᵞᵪ.ᵺʙ = bundle2.getLong("AUTO_SERVICE_RECONNECTION_ASYNCHRONOUS_TIMEOUT_MS_KEY");
            } catch (Throwable unused3) {
                "Error reading AutoServiceReconnectionAsynchronousTimeoutMs experiment flag: ".concat(bundle2.toString());
                AbstractC1845.m5213("BillingClient");
            }
            try {
                ᵱᵞᵪ.ᐧﾞ = bundle2.getInt("AUTO_SERVICE_RECONNECTION_MAX_NUM_RETRIES_KEY");
            } catch (Throwable unused4) {
                "Error reading AutoServiceReconnectionMaxNumRetries experiment flag: ".concat(bundle2.toString());
                AbstractC1845.m5213("BillingClient");
            }
        }
        Bundle bundle3 = bundle.getBundle("ENABLED_SUBSCRIPTION_CLIENT_ACTIONS_KEY");
        if (bundle3 != null) {
            Object[] objArrCopyOf = new Object[4];
            int i6 = 0;
            for (EnumC4229 enumC4229 : EnumC4229.values()) {
                if (bundle3.getBoolean(enumC4229.name(), false)) {
                    int length = objArrCopyOf.length;
                    int i7 = i6 + 1;
                    int i8 = ˋˌ.ᵡˎ(length, i7);
                    if (i8 > length) {
                        objArrCopyOf = Arrays.copyOf(objArrCopyOf, i8);
                    }
                    objArrCopyOf[i6] = enumC4229;
                    i6 = i7;
                }
            }
            C3768 c37682 = this.f8235;
            if (i6 == 0) {
                c2438 = C2799.f10801;
            } else if (i6 != 1) {
                c2438 = AbstractC1447.m4352(i6, objArrCopyOf);
                c2438.size();
            } else {
                Object obj = objArrCopyOf[0];
                Objects.requireNonNull(obj);
                c2438 = new C2438(obj);
            }
            c37682.f14060 = c2438;
            if (c37682.f14074 != null) {
                c37682.f14074.ˎˏʜʾ = c37682.f14060;
            }
        }
        C3768 c37683 = this.f8235;
        if (c37683.f14063 < 3) {
            int i9 = AbstractC1845.f7462;
            Log.isLoggable("BillingClient", 5);
            m5659(this.f8233, AbstractC5497.f20621, 36, this.f8236.booleanValue(), null, this.f8234);
        } else {
            ServiceConnectionC2349 serviceConnectionC2349 = this.f8233;
            Boolean bool = this.f8236;
            int i10 = this.f8234;
            boolean zBooleanValue = bool.booleanValue();
            C3768.m8396(c37683, 0);
            synchronized (c37683.f14080) {
                try {
                    if (c37683.f14062 != 3) {
                        serviceConnectionC2349.m6102(i10, zBooleanValue);
                        serviceConnectionC2349.m6096(AbstractC5497.f20614);
                    }
                } finally {
                }
            }
        }
        return true;
    }
}
