134 lines
5.5 KiB
Java
134 lines
5.5 KiB
Java
package c.d.a.a;
|
|
|
|
import android.os.Bundle;
|
|
import c.i.a.f.h.n.a;
|
|
import com.android.billingclient.api.BillingResult;
|
|
import com.android.billingclient.api.SkuDetails;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.Objects;
|
|
import java.util.concurrent.Callable;
|
|
import org.json.JSONException;
|
|
/* compiled from: com.android.billingclient:billing@@4.0.0 */
|
|
public final /* synthetic */ class v implements Callable {
|
|
public final /* synthetic */ a i;
|
|
public final /* synthetic */ String j;
|
|
public final /* synthetic */ List k;
|
|
public final /* synthetic */ i l;
|
|
|
|
public /* synthetic */ v(a aVar, String str, List list, i iVar) {
|
|
this.i = aVar;
|
|
this.j = str;
|
|
this.k = list;
|
|
this.l = iVar;
|
|
}
|
|
|
|
/* JADX WARNING: Code restructure failed: missing block: B:26:0x00cd, code lost:
|
|
r14 = 4;
|
|
r0 = "Item is unavailable for purchase.";
|
|
*/
|
|
@Override // java.util.concurrent.Callable
|
|
public final Object call() {
|
|
String str;
|
|
int i;
|
|
Bundle bundle;
|
|
int i2;
|
|
a aVar = this.i;
|
|
String str2 = this.j;
|
|
List list = this.k;
|
|
i iVar = this.l;
|
|
Objects.requireNonNull(aVar);
|
|
ArrayList arrayList = new ArrayList();
|
|
int size = list.size();
|
|
int i3 = 0;
|
|
while (true) {
|
|
if (i3 >= size) {
|
|
str = "";
|
|
i = 0;
|
|
break;
|
|
}
|
|
int i4 = i3 + 20;
|
|
ArrayList arrayList2 = new ArrayList(list.subList(i3, i4 > size ? size : i4));
|
|
ArrayList<String> arrayList3 = new ArrayList<>();
|
|
int size2 = arrayList2.size();
|
|
for (int i5 = 0; i5 < size2; i5++) {
|
|
arrayList3.add(((q) arrayList2.get(i5)).a);
|
|
}
|
|
Bundle bundle2 = new Bundle();
|
|
bundle2.putStringArrayList("ITEM_ID_LIST", arrayList3);
|
|
bundle2.putString("playBillingLibraryVersion", aVar.b);
|
|
try {
|
|
if (aVar.l) {
|
|
i2 = i4;
|
|
bundle = aVar.f.n(10, aVar.e.getPackageName(), str2, bundle2, a.b(aVar.i, aVar.p, aVar.b, null, arrayList2));
|
|
} else {
|
|
i2 = i4;
|
|
bundle = aVar.f.g0(3, aVar.e.getPackageName(), str2, bundle2);
|
|
}
|
|
if (bundle == null) {
|
|
a.f("BillingClient", "querySkuDetailsAsync got null sku details list");
|
|
break;
|
|
} else if (!bundle.containsKey("DETAILS_LIST")) {
|
|
i = a.a(bundle, "BillingClient");
|
|
str = a.d(bundle, "BillingClient");
|
|
if (i != 0) {
|
|
StringBuilder sb = new StringBuilder(50);
|
|
sb.append("getSkuDetails() failed. Response code: ");
|
|
sb.append(i);
|
|
a.f("BillingClient", sb.toString());
|
|
} else {
|
|
a.f("BillingClient", "getSkuDetails() returned a bundle with neither an error nor a detail list.");
|
|
}
|
|
} else {
|
|
ArrayList<String> stringArrayList = bundle.getStringArrayList("DETAILS_LIST");
|
|
if (stringArrayList == null) {
|
|
a.f("BillingClient", "querySkuDetailsAsync got null response list");
|
|
break;
|
|
}
|
|
for (int i6 = 0; i6 < stringArrayList.size(); i6++) {
|
|
try {
|
|
SkuDetails skuDetails = new SkuDetails(stringArrayList.get(i6));
|
|
String valueOf = String.valueOf(skuDetails);
|
|
StringBuilder sb2 = new StringBuilder(valueOf.length() + 17);
|
|
sb2.append("Got sku details: ");
|
|
sb2.append(valueOf);
|
|
a.e("BillingClient", sb2.toString());
|
|
arrayList.add(skuDetails);
|
|
} catch (JSONException unused) {
|
|
a.f("BillingClient", "Got a JSON exception trying to decode SkuDetails.");
|
|
str = "Error trying to decode SkuDetails.";
|
|
arrayList = null;
|
|
i = 6;
|
|
BillingResult billingResult = new BillingResult();
|
|
billingResult.a = i;
|
|
billingResult.b = str;
|
|
iVar.onSkuDetailsResponse(billingResult, arrayList);
|
|
return null;
|
|
}
|
|
}
|
|
i3 = i2;
|
|
}
|
|
} catch (Exception e) {
|
|
String valueOf2 = String.valueOf(e);
|
|
StringBuilder sb3 = new StringBuilder(valueOf2.length() + 63);
|
|
sb3.append("querySkuDetailsAsync got a remote exception (try to reconnect).");
|
|
sb3.append(valueOf2);
|
|
a.f("BillingClient", sb3.toString());
|
|
i = -1;
|
|
str = "Service connection is disconnected.";
|
|
}
|
|
}
|
|
BillingResult billingResult = new BillingResult();
|
|
billingResult.a = i;
|
|
billingResult.b = str;
|
|
iVar.onSkuDetailsResponse(billingResult, arrayList);
|
|
return null;
|
|
arrayList = null;
|
|
BillingResult billingResult = new BillingResult();
|
|
billingResult.a = i;
|
|
billingResult.b = str;
|
|
iVar.onSkuDetailsResponse(billingResult, arrayList);
|
|
return null;
|
|
}
|
|
}
|