package c.d.a.a; import c.i.a.f.h.n.a; import java.util.Objects; import java.util.concurrent.Callable; /* compiled from: com.android.billingclient:billing@@4.0.0 */ public final /* synthetic */ class m implements Callable { public final /* synthetic */ n i; public /* synthetic */ m(n nVar) { this.i = nVar; } /* JADX WARNING: Removed duplicated region for block: B:67:0x00c6 */ /* JADX WARNING: Removed duplicated region for block: B:68:0x00cc */ @Override // java.util.concurrent.Callable public final Object call() { int i; n nVar = this.i; synchronized (nVar.i) { if (!nVar.j) { int i2 = 3; try { String packageName = nVar.l.e.getPackageName(); int i3 = 16; i = 3; while (true) { if (i3 < 3) { i3 = 0; break; } try { i = nVar.l.f.N(i3, packageName, "subs"); if (i == 0) { break; } i3--; } catch (Exception unused) { i2 = i; a.f("BillingClient", "Exception while checking if billing is supported; try to reconnect"); nVar.l.a = 0; nVar.l.f = null; i = i2; if (i == 0) { } return null; } } Objects.requireNonNull(nVar.l); boolean z2 = true; nVar.l.h = i3 >= 3; if (i3 < 3) { a.e("BillingClient", "In-app billing API does not support subscription on this device."); } int i4 = 16; while (true) { if (i4 < 3) { break; } i = nVar.l.f.N(i4, packageName, "inapp"); if (i == 0) { nVar.l.i = i4; break; } i4--; } a aVar = nVar.l; int i5 = aVar.i; aVar.o = i5 >= 16; aVar.n = i5 >= 15; aVar.m = i5 >= 14; aVar.l = i5 >= 10; aVar.k = i5 >= 9; if (i5 < 6) { z2 = false; } aVar.j = z2; if (i5 < 3) { a.f("BillingClient", "In-app billing API version 3 is not supported on this device."); } if (i == 0) { nVar.l.a = 2; } else { nVar.l.a = 0; nVar.l.f = null; } } catch (Exception unused2) { a.f("BillingClient", "Exception while checking if billing is supported; try to reconnect"); nVar.l.a = 0; nVar.l.f = null; i = i2; if (i == 0) { } return null; } if (i == 0) { nVar.a(p.i); } else { nVar.a(p.a); } } } return null; } }