- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
611 lines
29 KiB
Java
611 lines
29 KiB
Java
package com.android.billingclient.api;
|
|
|
|
import android.content.ComponentName;
|
|
import android.content.Context;
|
|
import android.content.Intent;
|
|
import android.content.pm.ResolveInfo;
|
|
import android.content.pm.ServiceInfo;
|
|
import android.os.Bundle;
|
|
import android.os.Handler;
|
|
import android.os.Looper;
|
|
import android.text.TextUtils;
|
|
import androidx.work.WorkRequest;
|
|
import com.android.billingclient.api.BillingResult;
|
|
import com.firemonkeys.cloudcellapi.Consts;
|
|
import com.google.android.gms.internal.play_billing.zze;
|
|
import com.google.android.gms.internal.play_billing.zzfl;
|
|
import com.google.android.gms.internal.play_billing.zzfm;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.concurrent.Callable;
|
|
import java.util.concurrent.ExecutorService;
|
|
import java.util.concurrent.Executors;
|
|
import java.util.concurrent.Future;
|
|
import org.json.JSONException;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class BillingClientImpl extends BillingClient {
|
|
public volatile int zza;
|
|
public final String zzb;
|
|
public final Handler zzc;
|
|
public volatile zzh zzd;
|
|
public Context zze;
|
|
public zzar zzf;
|
|
public volatile zze zzg;
|
|
public volatile zzaf zzh;
|
|
public boolean zzi;
|
|
public boolean zzj;
|
|
public int zzk;
|
|
public boolean zzl;
|
|
public boolean zzm;
|
|
public boolean zzn;
|
|
public boolean zzo;
|
|
public boolean zzp;
|
|
public boolean zzq;
|
|
public boolean zzr;
|
|
public boolean zzs;
|
|
public boolean zzt;
|
|
public boolean zzu;
|
|
public boolean zzv;
|
|
public boolean zzw;
|
|
public zzbe zzx;
|
|
public boolean zzy;
|
|
public ExecutorService zzz;
|
|
|
|
public static /* synthetic */ zzbj zzN(BillingClientImpl billingClientImpl, String str, int i) {
|
|
Bundle zzi;
|
|
com.google.android.gms.internal.play_billing.zzb.zzi("BillingClient", "Querying owned items, item type: ".concat(String.valueOf(str)));
|
|
ArrayList arrayList = new ArrayList();
|
|
boolean z = true;
|
|
int i2 = 0;
|
|
Bundle zzc = com.google.android.gms.internal.play_billing.zzb.zzc(billingClientImpl.zzn, billingClientImpl.zzv, true, false, billingClientImpl.zzb);
|
|
List list = null;
|
|
String str2 = null;
|
|
while (true) {
|
|
try {
|
|
if (billingClientImpl.zzn) {
|
|
zzi = billingClientImpl.zzg.zzj(z != billingClientImpl.zzv ? 9 : 19, billingClientImpl.zze.getPackageName(), str, str2, zzc);
|
|
} else {
|
|
zzi = billingClientImpl.zzg.zzi(3, billingClientImpl.zze.getPackageName(), str, str2);
|
|
}
|
|
zzbk zza = zzbl.zza(zzi, "BillingClient", "getPurchase()");
|
|
BillingResult zza2 = zza.zza();
|
|
if (zza2 != zzat.zzl) {
|
|
billingClientImpl.zzf.zza(zzaq.zza(zza.zzb(), 9, zza2));
|
|
return new zzbj(zza2, list);
|
|
}
|
|
ArrayList<String> stringArrayList = zzi.getStringArrayList(Consts.RESPONSE_INAPP_ITEM_LIST);
|
|
ArrayList<String> stringArrayList2 = zzi.getStringArrayList(Consts.RESPONSE_INAPP_PURCHASE_DATA_LIST);
|
|
ArrayList<String> stringArrayList3 = zzi.getStringArrayList(Consts.RESPONSE_INAPP_SIGNATURE_LIST);
|
|
int i3 = i2;
|
|
int i4 = i3;
|
|
while (i3 < stringArrayList2.size()) {
|
|
String str3 = stringArrayList2.get(i3);
|
|
String str4 = stringArrayList3.get(i3);
|
|
com.google.android.gms.internal.play_billing.zzb.zzi("BillingClient", "Sku is owned: ".concat(String.valueOf(stringArrayList.get(i3))));
|
|
try {
|
|
Purchase purchase = new Purchase(str3, str4);
|
|
if (TextUtils.isEmpty(purchase.getPurchaseToken())) {
|
|
com.google.android.gms.internal.play_billing.zzb.zzj("BillingClient", "BUG: empty/null token!");
|
|
i4 = 1;
|
|
}
|
|
arrayList.add(purchase);
|
|
i3++;
|
|
} catch (JSONException e) {
|
|
com.google.android.gms.internal.play_billing.zzb.zzk("BillingClient", "Got an exception trying to decode the purchase!", e);
|
|
zzar zzarVar = billingClientImpl.zzf;
|
|
BillingResult billingResult = zzat.zzj;
|
|
zzarVar.zza(zzaq.zza(51, 9, billingResult));
|
|
return new zzbj(billingResult, null);
|
|
}
|
|
}
|
|
if (i4 != 0) {
|
|
billingClientImpl.zzf.zza(zzaq.zza(26, 9, zzat.zzj));
|
|
}
|
|
str2 = zzi.getString(Consts.INAPP_CONTINUATION_TOKEN);
|
|
com.google.android.gms.internal.play_billing.zzb.zzi("BillingClient", "Continuation token: ".concat(String.valueOf(str2)));
|
|
if (TextUtils.isEmpty(str2)) {
|
|
return new zzbj(zzat.zzl, arrayList);
|
|
}
|
|
list = null;
|
|
z = true;
|
|
i2 = 0;
|
|
} catch (Exception e2) {
|
|
zzar zzarVar2 = billingClientImpl.zzf;
|
|
BillingResult billingResult2 = zzat.zzm;
|
|
zzarVar2.zza(zzaq.zza(52, 9, billingResult2));
|
|
com.google.android.gms.internal.play_billing.zzb.zzk("BillingClient", "Got exception trying to get purchasesm try to reconnect", e2);
|
|
return new zzbj(billingResult2, null);
|
|
}
|
|
}
|
|
}
|
|
|
|
public static String zzR() {
|
|
try {
|
|
return (String) Class.forName("com.android.billingclient.ktx.BuildConfig").getField("VERSION_NAME").get(null);
|
|
} catch (Exception unused) {
|
|
return "6.0.1";
|
|
}
|
|
}
|
|
|
|
@Override // com.android.billingclient.api.BillingClient
|
|
public final void acknowledgePurchase(final AcknowledgePurchaseParams acknowledgePurchaseParams, final AcknowledgePurchaseResponseListener acknowledgePurchaseResponseListener) {
|
|
if (!isReady()) {
|
|
zzar zzarVar = this.zzf;
|
|
BillingResult billingResult = zzat.zzm;
|
|
zzarVar.zza(zzaq.zza(2, 3, billingResult));
|
|
acknowledgePurchaseResponseListener.onAcknowledgePurchaseResponse(billingResult);
|
|
return;
|
|
}
|
|
if (TextUtils.isEmpty(acknowledgePurchaseParams.getPurchaseToken())) {
|
|
com.google.android.gms.internal.play_billing.zzb.zzj("BillingClient", "Please provide a valid purchase token.");
|
|
zzar zzarVar2 = this.zzf;
|
|
BillingResult billingResult2 = zzat.zzi;
|
|
zzarVar2.zza(zzaq.zza(26, 3, billingResult2));
|
|
acknowledgePurchaseResponseListener.onAcknowledgePurchaseResponse(billingResult2);
|
|
return;
|
|
}
|
|
if (!this.zzn) {
|
|
zzar zzarVar3 = this.zzf;
|
|
BillingResult billingResult3 = zzat.zzb;
|
|
zzarVar3.zza(zzaq.zza(27, 3, billingResult3));
|
|
acknowledgePurchaseResponseListener.onAcknowledgePurchaseResponse(billingResult3);
|
|
return;
|
|
}
|
|
if (zzS(new Callable() { // from class: com.android.billingclient.api.zzp
|
|
@Override // java.util.concurrent.Callable
|
|
public final Object call() {
|
|
BillingClientImpl.this.zzj(acknowledgePurchaseParams, acknowledgePurchaseResponseListener);
|
|
return null;
|
|
}
|
|
}, WorkRequest.DEFAULT_BACKOFF_DELAY_MILLIS, new Runnable() { // from class: com.android.billingclient.api.zzq
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
BillingClientImpl.this.zzG(acknowledgePurchaseResponseListener);
|
|
}
|
|
}, zzO()) == null) {
|
|
BillingResult zzQ = zzQ();
|
|
this.zzf.zza(zzaq.zza(25, 3, zzQ));
|
|
acknowledgePurchaseResponseListener.onAcknowledgePurchaseResponse(zzQ);
|
|
}
|
|
}
|
|
|
|
@Override // com.android.billingclient.api.BillingClient
|
|
public final void consumeAsync(final ConsumeParams consumeParams, final ConsumeResponseListener consumeResponseListener) {
|
|
if (!isReady()) {
|
|
zzar zzarVar = this.zzf;
|
|
BillingResult billingResult = zzat.zzm;
|
|
zzarVar.zza(zzaq.zza(2, 4, billingResult));
|
|
consumeResponseListener.onConsumeResponse(billingResult, consumeParams.getPurchaseToken());
|
|
return;
|
|
}
|
|
if (zzS(new Callable() { // from class: com.android.billingclient.api.zzm
|
|
@Override // java.util.concurrent.Callable
|
|
public final Object call() {
|
|
BillingClientImpl.this.zzk(consumeParams, consumeResponseListener);
|
|
return null;
|
|
}
|
|
}, WorkRequest.DEFAULT_BACKOFF_DELAY_MILLIS, new Runnable() { // from class: com.android.billingclient.api.zzn
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
BillingClientImpl.this.zzI(consumeResponseListener, consumeParams);
|
|
}
|
|
}, zzO()) == null) {
|
|
BillingResult zzQ = zzQ();
|
|
this.zzf.zza(zzaq.zza(25, 4, zzQ));
|
|
consumeResponseListener.onConsumeResponse(zzQ, consumeParams.getPurchaseToken());
|
|
}
|
|
}
|
|
|
|
@Override // com.android.billingclient.api.BillingClient
|
|
public final void endConnection() {
|
|
this.zzf.zzb(zzaq.zzb(12));
|
|
try {
|
|
try {
|
|
this.zzd.zzd();
|
|
if (this.zzh != null) {
|
|
this.zzh.zzc();
|
|
}
|
|
if (this.zzh != null && this.zzg != null) {
|
|
com.google.android.gms.internal.play_billing.zzb.zzi("BillingClient", "Unbinding from service.");
|
|
this.zze.unbindService(this.zzh);
|
|
this.zzh = null;
|
|
}
|
|
this.zzg = null;
|
|
ExecutorService executorService = this.zzz;
|
|
if (executorService != null) {
|
|
executorService.shutdownNow();
|
|
this.zzz = null;
|
|
}
|
|
this.zza = 3;
|
|
} catch (Exception e) {
|
|
com.google.android.gms.internal.play_billing.zzb.zzk("BillingClient", "There was an exception while ending connection!", e);
|
|
this.zza = 3;
|
|
}
|
|
} catch (Throwable th) {
|
|
this.zza = 3;
|
|
throw th;
|
|
}
|
|
}
|
|
|
|
public final void initialize(Context context, PurchasesUpdatedListener purchasesUpdatedListener, zzbe zzbeVar, AlternativeBillingListener alternativeBillingListener, String str, zzar zzarVar) {
|
|
this.zze = context.getApplicationContext();
|
|
zzfl zzv = zzfm.zzv();
|
|
zzv.zzj(str);
|
|
zzv.zzi(this.zze.getPackageName());
|
|
if (zzarVar != null) {
|
|
this.zzf = zzarVar;
|
|
} else {
|
|
this.zzf = new zzaw(this.zze, (zzfm) zzv.zzc());
|
|
}
|
|
if (purchasesUpdatedListener == null) {
|
|
com.google.android.gms.internal.play_billing.zzb.zzj("BillingClient", "Billing client should have a valid listener but the provided is null.");
|
|
}
|
|
this.zzd = new zzh(this.zze, purchasesUpdatedListener, alternativeBillingListener, this.zzf);
|
|
this.zzx = zzbeVar;
|
|
this.zzy = alternativeBillingListener != null;
|
|
}
|
|
|
|
@Override // com.android.billingclient.api.BillingClient
|
|
public final boolean isReady() {
|
|
return (this.zza != 2 || this.zzg == null || this.zzh == null) ? false : true;
|
|
}
|
|
|
|
/* JADX WARN: Removed duplicated region for block: B:125:0x0375 */
|
|
/* JADX WARN: Removed duplicated region for block: B:126:0x0378 */
|
|
@Override // com.android.billingclient.api.BillingClient
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
public final com.android.billingclient.api.BillingResult launchBillingFlow(android.app.Activity r25, final com.android.billingclient.api.BillingFlowParams r26) {
|
|
/*
|
|
Method dump skipped, instructions count: 1090
|
|
To view this dump add '--comments-level debug' option
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: com.android.billingclient.api.BillingClientImpl.launchBillingFlow(android.app.Activity, com.android.billingclient.api.BillingFlowParams):com.android.billingclient.api.BillingResult");
|
|
}
|
|
|
|
@Override // com.android.billingclient.api.BillingClient
|
|
public final void queryProductDetailsAsync(final QueryProductDetailsParams queryProductDetailsParams, final ProductDetailsResponseListener productDetailsResponseListener) {
|
|
if (!isReady()) {
|
|
zzar zzarVar = this.zzf;
|
|
BillingResult billingResult = zzat.zzm;
|
|
zzarVar.zza(zzaq.zza(2, 7, billingResult));
|
|
productDetailsResponseListener.onProductDetailsResponse(billingResult, new ArrayList());
|
|
return;
|
|
}
|
|
if (this.zzt) {
|
|
if (zzS(new Callable() { // from class: com.android.billingclient.api.zzk
|
|
@Override // java.util.concurrent.Callable
|
|
public final Object call() {
|
|
BillingClientImpl.this.zzl(queryProductDetailsParams, productDetailsResponseListener);
|
|
return null;
|
|
}
|
|
}, WorkRequest.DEFAULT_BACKOFF_DELAY_MILLIS, new Runnable() { // from class: com.android.billingclient.api.zzl
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
BillingClientImpl.this.zzJ(productDetailsResponseListener);
|
|
}
|
|
}, zzO()) == null) {
|
|
BillingResult zzQ = zzQ();
|
|
this.zzf.zza(zzaq.zza(25, 7, zzQ));
|
|
productDetailsResponseListener.onProductDetailsResponse(zzQ, new ArrayList());
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
com.google.android.gms.internal.play_billing.zzb.zzj("BillingClient", "Querying product details is not supported.");
|
|
zzar zzarVar2 = this.zzf;
|
|
BillingResult billingResult2 = zzat.zzv;
|
|
zzarVar2.zza(zzaq.zza(20, 7, billingResult2));
|
|
productDetailsResponseListener.onProductDetailsResponse(billingResult2, new ArrayList());
|
|
}
|
|
|
|
@Override // com.android.billingclient.api.BillingClient
|
|
public final void queryPurchasesAsync(QueryPurchasesParams queryPurchasesParams, PurchasesResponseListener purchasesResponseListener) {
|
|
zzU(queryPurchasesParams.zza(), purchasesResponseListener);
|
|
}
|
|
|
|
public final /* synthetic */ void zzG(AcknowledgePurchaseResponseListener acknowledgePurchaseResponseListener) {
|
|
zzar zzarVar = this.zzf;
|
|
BillingResult billingResult = zzat.zzn;
|
|
zzarVar.zza(zzaq.zza(24, 3, billingResult));
|
|
acknowledgePurchaseResponseListener.onAcknowledgePurchaseResponse(billingResult);
|
|
}
|
|
|
|
public final /* synthetic */ void zzH(BillingResult billingResult) {
|
|
if (this.zzd.zzc() != null) {
|
|
this.zzd.zzc().onPurchasesUpdated(billingResult, null);
|
|
} else {
|
|
this.zzd.zzb();
|
|
com.google.android.gms.internal.play_billing.zzb.zzj("BillingClient", "No valid listener is set in BroadcastManager");
|
|
}
|
|
}
|
|
|
|
public final /* synthetic */ void zzI(ConsumeResponseListener consumeResponseListener, ConsumeParams consumeParams) {
|
|
zzar zzarVar = this.zzf;
|
|
BillingResult billingResult = zzat.zzn;
|
|
zzarVar.zza(zzaq.zza(24, 4, billingResult));
|
|
consumeResponseListener.onConsumeResponse(billingResult, consumeParams.getPurchaseToken());
|
|
}
|
|
|
|
public final /* synthetic */ void zzJ(ProductDetailsResponseListener productDetailsResponseListener) {
|
|
zzar zzarVar = this.zzf;
|
|
BillingResult billingResult = zzat.zzn;
|
|
zzarVar.zza(zzaq.zza(24, 7, billingResult));
|
|
productDetailsResponseListener.onProductDetailsResponse(billingResult, new ArrayList());
|
|
}
|
|
|
|
public final /* synthetic */ void zzL(PurchasesResponseListener purchasesResponseListener) {
|
|
zzar zzarVar = this.zzf;
|
|
BillingResult billingResult = zzat.zzn;
|
|
zzarVar.zza(zzaq.zza(24, 9, billingResult));
|
|
purchasesResponseListener.onQueryPurchasesResponse(billingResult, com.google.android.gms.internal.play_billing.zzu.zzk());
|
|
}
|
|
|
|
public final Handler zzO() {
|
|
return Looper.myLooper() == null ? this.zzc : new Handler(Looper.myLooper());
|
|
}
|
|
|
|
public final BillingResult zzP(final BillingResult billingResult) {
|
|
if (Thread.interrupted()) {
|
|
return billingResult;
|
|
}
|
|
this.zzc.post(new Runnable() { // from class: com.android.billingclient.api.zzx
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
BillingClientImpl.this.zzH(billingResult);
|
|
}
|
|
});
|
|
return billingResult;
|
|
}
|
|
|
|
public final Future zzS(Callable callable, long j, final Runnable runnable, Handler handler) {
|
|
if (this.zzz == null) {
|
|
this.zzz = Executors.newFixedThreadPool(com.google.android.gms.internal.play_billing.zzb.zza, new zzab(this));
|
|
}
|
|
try {
|
|
final Future submit = this.zzz.submit(callable);
|
|
handler.postDelayed(new Runnable() { // from class: com.android.billingclient.api.zzw
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
Future future = submit;
|
|
Runnable runnable2 = runnable;
|
|
if (future.isDone() || future.isCancelled()) {
|
|
return;
|
|
}
|
|
future.cancel(true);
|
|
com.google.android.gms.internal.play_billing.zzb.zzj("BillingClient", "Async task is taking too long, cancel it!");
|
|
if (runnable2 != null) {
|
|
runnable2.run();
|
|
}
|
|
}
|
|
}, (long) (j * 0.95d));
|
|
return submit;
|
|
} catch (Exception e) {
|
|
com.google.android.gms.internal.play_billing.zzb.zzk("BillingClient", "Async task throws exception!", e);
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public final void zzU(String str, final PurchasesResponseListener purchasesResponseListener) {
|
|
if (!isReady()) {
|
|
zzar zzarVar = this.zzf;
|
|
BillingResult billingResult = zzat.zzm;
|
|
zzarVar.zza(zzaq.zza(2, 9, billingResult));
|
|
purchasesResponseListener.onQueryPurchasesResponse(billingResult, com.google.android.gms.internal.play_billing.zzu.zzk());
|
|
return;
|
|
}
|
|
if (TextUtils.isEmpty(str)) {
|
|
com.google.android.gms.internal.play_billing.zzb.zzj("BillingClient", "Please provide a valid product type.");
|
|
zzar zzarVar2 = this.zzf;
|
|
BillingResult billingResult2 = zzat.zzg;
|
|
zzarVar2.zza(zzaq.zza(50, 9, billingResult2));
|
|
purchasesResponseListener.onQueryPurchasesResponse(billingResult2, com.google.android.gms.internal.play_billing.zzu.zzk());
|
|
return;
|
|
}
|
|
if (zzS(new zzy(this, str, purchasesResponseListener), WorkRequest.DEFAULT_BACKOFF_DELAY_MILLIS, new Runnable() { // from class: com.android.billingclient.api.zzu
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
BillingClientImpl.this.zzL(purchasesResponseListener);
|
|
}
|
|
}, zzO()) == null) {
|
|
BillingResult zzQ = zzQ();
|
|
this.zzf.zza(zzaq.zza(25, 9, zzQ));
|
|
purchasesResponseListener.onQueryPurchasesResponse(zzQ, com.google.android.gms.internal.play_billing.zzu.zzk());
|
|
}
|
|
}
|
|
|
|
public final /* synthetic */ Bundle zzc(int i, String str, String str2, BillingFlowParams billingFlowParams, Bundle bundle) {
|
|
return this.zzg.zzg(i, this.zze.getPackageName(), str, str2, null, bundle);
|
|
}
|
|
|
|
public final /* synthetic */ Bundle zzd(String str, String str2) {
|
|
return this.zzg.zzf(3, this.zze.getPackageName(), str, str2, null);
|
|
}
|
|
|
|
public final /* synthetic */ Object zzj(AcknowledgePurchaseParams acknowledgePurchaseParams, AcknowledgePurchaseResponseListener acknowledgePurchaseResponseListener) {
|
|
try {
|
|
zze zzeVar = this.zzg;
|
|
String packageName = this.zze.getPackageName();
|
|
String purchaseToken = acknowledgePurchaseParams.getPurchaseToken();
|
|
String str = this.zzb;
|
|
Bundle bundle = new Bundle();
|
|
bundle.putString("playBillingLibraryVersion", str);
|
|
Bundle zzd = zzeVar.zzd(9, packageName, purchaseToken, bundle);
|
|
int zzb = com.google.android.gms.internal.play_billing.zzb.zzb(zzd, "BillingClient");
|
|
String zzf = com.google.android.gms.internal.play_billing.zzb.zzf(zzd, "BillingClient");
|
|
BillingResult.Builder newBuilder = BillingResult.newBuilder();
|
|
newBuilder.setResponseCode(zzb);
|
|
newBuilder.setDebugMessage(zzf);
|
|
acknowledgePurchaseResponseListener.onAcknowledgePurchaseResponse(newBuilder.build());
|
|
return null;
|
|
} catch (Exception e) {
|
|
com.google.android.gms.internal.play_billing.zzb.zzk("BillingClient", "Error acknowledge purchase!", e);
|
|
zzar zzarVar = this.zzf;
|
|
BillingResult billingResult = zzat.zzm;
|
|
zzarVar.zza(zzaq.zza(28, 3, billingResult));
|
|
acknowledgePurchaseResponseListener.onAcknowledgePurchaseResponse(billingResult);
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public final /* synthetic */ Object zzk(ConsumeParams consumeParams, ConsumeResponseListener consumeResponseListener) {
|
|
int zza;
|
|
String str;
|
|
String purchaseToken = consumeParams.getPurchaseToken();
|
|
try {
|
|
com.google.android.gms.internal.play_billing.zzb.zzi("BillingClient", "Consuming purchase with token: " + purchaseToken);
|
|
if (this.zzn) {
|
|
zze zzeVar = this.zzg;
|
|
String packageName = this.zze.getPackageName();
|
|
boolean z = this.zzn;
|
|
String str2 = this.zzb;
|
|
Bundle bundle = new Bundle();
|
|
if (z) {
|
|
bundle.putString("playBillingLibraryVersion", str2);
|
|
}
|
|
Bundle zze = zzeVar.zze(9, packageName, purchaseToken, bundle);
|
|
zza = zze.getInt("RESPONSE_CODE");
|
|
str = com.google.android.gms.internal.play_billing.zzb.zzf(zze, "BillingClient");
|
|
} else {
|
|
zza = this.zzg.zza(3, this.zze.getPackageName(), purchaseToken);
|
|
str = "";
|
|
}
|
|
BillingResult.Builder newBuilder = BillingResult.newBuilder();
|
|
newBuilder.setResponseCode(zza);
|
|
newBuilder.setDebugMessage(str);
|
|
BillingResult build = newBuilder.build();
|
|
if (zza == 0) {
|
|
com.google.android.gms.internal.play_billing.zzb.zzi("BillingClient", "Successfully consumed purchase.");
|
|
consumeResponseListener.onConsumeResponse(build, purchaseToken);
|
|
return null;
|
|
}
|
|
com.google.android.gms.internal.play_billing.zzb.zzj("BillingClient", "Error consuming purchase with token. Response code: " + zza);
|
|
this.zzf.zza(zzaq.zza(23, 4, build));
|
|
consumeResponseListener.onConsumeResponse(build, purchaseToken);
|
|
return null;
|
|
} catch (Exception e) {
|
|
com.google.android.gms.internal.play_billing.zzb.zzk("BillingClient", "Error consuming purchase!", e);
|
|
zzar zzarVar = this.zzf;
|
|
BillingResult billingResult = zzat.zzm;
|
|
zzarVar.zza(zzaq.zza(29, 4, billingResult));
|
|
consumeResponseListener.onConsumeResponse(billingResult, purchaseToken);
|
|
return null;
|
|
}
|
|
}
|
|
|
|
/* JADX WARN: Code restructure failed: missing block: B:64:0x0127, code lost:
|
|
|
|
r12 = 4;
|
|
*/
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
public final /* synthetic */ java.lang.Object zzl(com.android.billingclient.api.QueryProductDetailsParams r25, com.android.billingclient.api.ProductDetailsResponseListener r26) {
|
|
/*
|
|
Method dump skipped, instructions count: 537
|
|
To view this dump add '--comments-level debug' option
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: com.android.billingclient.api.BillingClientImpl.zzl(com.android.billingclient.api.QueryProductDetailsParams, com.android.billingclient.api.ProductDetailsResponseListener):java.lang.Object");
|
|
}
|
|
|
|
public final BillingResult zzQ() {
|
|
return (this.zza == 0 || this.zza == 3) ? zzat.zzm : zzat.zzj;
|
|
}
|
|
|
|
public BillingClientImpl(Context context, zzbe zzbeVar, PurchasesUpdatedListener purchasesUpdatedListener, String str, String str2, AlternativeBillingListener alternativeBillingListener, zzar zzarVar) {
|
|
this.zza = 0;
|
|
this.zzc = new Handler(Looper.getMainLooper());
|
|
this.zzk = 0;
|
|
this.zzb = str;
|
|
initialize(context, purchasesUpdatedListener, zzbeVar, alternativeBillingListener, str, null);
|
|
}
|
|
|
|
public BillingClientImpl(String str, zzbe zzbeVar, Context context, zzaz zzazVar, zzar zzarVar) {
|
|
this.zza = 0;
|
|
this.zzc = new Handler(Looper.getMainLooper());
|
|
this.zzk = 0;
|
|
this.zzb = zzR();
|
|
this.zze = context.getApplicationContext();
|
|
zzfl zzv = zzfm.zzv();
|
|
zzv.zzj(zzR());
|
|
zzv.zzi(this.zze.getPackageName());
|
|
this.zzf = new zzaw(this.zze, (zzfm) zzv.zzc());
|
|
com.google.android.gms.internal.play_billing.zzb.zzj("BillingClient", "Billing client should have a valid listener but the provided is null.");
|
|
this.zzd = new zzh(this.zze, null, this.zzf);
|
|
this.zzx = zzbeVar;
|
|
}
|
|
|
|
public BillingClientImpl(String str, zzbe zzbeVar, Context context, PurchasesUpdatedListener purchasesUpdatedListener, AlternativeBillingListener alternativeBillingListener, zzar zzarVar) {
|
|
this(context, zzbeVar, purchasesUpdatedListener, zzR(), null, alternativeBillingListener, null);
|
|
}
|
|
|
|
@Override // com.android.billingclient.api.BillingClient
|
|
public final void startConnection(BillingClientStateListener billingClientStateListener) {
|
|
if (isReady()) {
|
|
com.google.android.gms.internal.play_billing.zzb.zzi("BillingClient", "Service connection is valid. No need to re-initialize.");
|
|
this.zzf.zzb(zzaq.zzb(6));
|
|
billingClientStateListener.onBillingSetupFinished(zzat.zzl);
|
|
return;
|
|
}
|
|
int i = 1;
|
|
if (this.zza == 1) {
|
|
com.google.android.gms.internal.play_billing.zzb.zzj("BillingClient", "Client is already in the process of connecting to billing service.");
|
|
zzar zzarVar = this.zzf;
|
|
BillingResult billingResult = zzat.zzd;
|
|
zzarVar.zza(zzaq.zza(37, 6, billingResult));
|
|
billingClientStateListener.onBillingSetupFinished(billingResult);
|
|
return;
|
|
}
|
|
if (this.zza == 3) {
|
|
com.google.android.gms.internal.play_billing.zzb.zzj("BillingClient", "Client was already closed and can't be reused. Please create another instance.");
|
|
zzar zzarVar2 = this.zzf;
|
|
BillingResult billingResult2 = zzat.zzm;
|
|
zzarVar2.zza(zzaq.zza(38, 6, billingResult2));
|
|
billingClientStateListener.onBillingSetupFinished(billingResult2);
|
|
return;
|
|
}
|
|
this.zza = 1;
|
|
this.zzd.zze();
|
|
com.google.android.gms.internal.play_billing.zzb.zzi("BillingClient", "Starting in-app billing setup.");
|
|
this.zzh = new zzaf(this, billingClientStateListener, null);
|
|
Intent intent = new Intent("com.android.vending.billing.InAppBillingService.BIND");
|
|
intent.setPackage("com.android.vending");
|
|
List<ResolveInfo> queryIntentServices = this.zze.getPackageManager().queryIntentServices(intent, 0);
|
|
if (queryIntentServices == null || queryIntentServices.isEmpty()) {
|
|
i = 41;
|
|
} else {
|
|
ServiceInfo serviceInfo = queryIntentServices.get(0).serviceInfo;
|
|
if (serviceInfo != null) {
|
|
String str = serviceInfo.packageName;
|
|
String str2 = serviceInfo.name;
|
|
if (!"com.android.vending".equals(str) || str2 == null) {
|
|
com.google.android.gms.internal.play_billing.zzb.zzj("BillingClient", "The device doesn't have valid Play Store.");
|
|
i = 40;
|
|
} else {
|
|
ComponentName componentName = new ComponentName(str, str2);
|
|
Intent intent2 = new Intent(intent);
|
|
intent2.setComponent(componentName);
|
|
intent2.putExtra("playBillingLibraryVersion", this.zzb);
|
|
if (this.zze.bindService(intent2, this.zzh, 1)) {
|
|
com.google.android.gms.internal.play_billing.zzb.zzi("BillingClient", "Service was bonded successfully.");
|
|
return;
|
|
} else {
|
|
com.google.android.gms.internal.play_billing.zzb.zzj("BillingClient", "Connection to Billing service is blocked.");
|
|
i = 39;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
this.zza = 0;
|
|
com.google.android.gms.internal.play_billing.zzb.zzi("BillingClient", "Billing service unavailable on device.");
|
|
zzar zzarVar3 = this.zzf;
|
|
BillingResult billingResult3 = zzat.zzc;
|
|
zzarVar3.zza(zzaq.zza(i, 6, billingResult3));
|
|
billingClientStateListener.onBillingSetupFinished(billingResult3);
|
|
}
|
|
}
|