package p138.p139.p140.p141;

import java.util.concurrent.Callable;
import p138.p139.p140.p141.C2759;
import p138.p139.p140.p142.C2802;

/* JADX INFO: renamed from: ދ.֏.֏.֏.ޓ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public final class CallableC2783 implements Callable<Void> {

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final /* synthetic */ C2759.ServiceConnectionC2760 f8580;

    public CallableC2783(C2759.ServiceConnectionC2760 serviceConnectionC2760) {
        this.f8580 = serviceConnectionC2760;
    }

    @Override // java.util.concurrent.Callable
    public final /* synthetic */ Void call() {
        m4851();
        return null;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final Void m4851() {
        int iMo7901;
        synchronized (this.f8580.f8528) {
            if (this.f8580.f8529) {
                return null;
            }
            int i = 3;
            try {
                String packageName = C2759.this.f8511.getPackageName();
                int i2 = 13;
                iMo7901 = 3;
                while (true) {
                    if (i2 < 3) {
                        i2 = 0;
                        break;
                    }
                    try {
                        iMo7901 = C2759.this.f8514.mo7901(i2, packageName, "subs");
                        if (iMo7901 == 0) {
                            break;
                        }
                        i2--;
                    } catch (Exception unused) {
                        i = iMo7901;
                        C2802.m4859("BillingClient", "Exception while checking if billing is supported; try to reconnect");
                        C2759 c2759 = C2759.this;
                        c2759.f8507 = 0;
                        c2759.f8514 = null;
                        iMo7901 = i;
                    }
                }
                boolean z = true;
                C2759.this.f8517 = i2 >= 5;
                C2759.this.f8516 = i2 >= 3;
                if (i2 < 3) {
                    C2802.m4857("BillingClient", "In-app billing API does not support subscription on this device.");
                }
                int i3 = 13;
                while (true) {
                    if (i3 < 3) {
                        i3 = 0;
                        break;
                    }
                    iMo7901 = C2759.this.f8514.mo7901(i3, packageName, "inapp");
                    if (iMo7901 == 0) {
                        break;
                    }
                    i3--;
                }
                C2759.this.f8523 = i3 >= 13;
                C2759.this.f8522 = i3 >= 12;
                C2759.this.f8521 = i3 >= 10;
                C2759.this.f8520 = i3 >= 9;
                C2759.this.f8519 = i3 >= 8;
                C2759 c27592 = C2759.this;
                if (i3 < 6) {
                    z = false;
                }
                c27592.f8518 = z;
                if (i3 < 3) {
                    C2802.m4859("BillingClient", "In-app billing API version 3 is not supported on this device.");
                }
                if (iMo7901 == 0) {
                    C2759.this.f8507 = 2;
                } else {
                    C2759.this.f8507 = 0;
                    C2759.this.f8514 = null;
                }
            } catch (Exception unused2) {
            }
            if (iMo7901 == 0) {
                C2759.ServiceConnectionC2760 serviceConnectionC2760 = this.f8580;
                C2759.m4833(C2759.this, new RunnableC2781(serviceConnectionC2760, C2785.f8594));
            } else {
                C2759.ServiceConnectionC2760 serviceConnectionC27602 = this.f8580;
                C2759.m4833(C2759.this, new RunnableC2781(serviceConnectionC27602, C2785.f8581));
            }
            return null;
        }
    }
}
