- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
98 lines
3.4 KiB
Java
98 lines
3.4 KiB
Java
package com.amazon.device.iap.internal.b;
|
|
|
|
import android.content.Context;
|
|
import android.os.Handler;
|
|
import com.amazon.device.iap.PurchasingListener;
|
|
import com.amazon.device.iap.model.ProductDataResponse;
|
|
import com.amazon.device.iap.model.PurchaseResponse;
|
|
import com.amazon.device.iap.model.PurchaseUpdatesResponse;
|
|
import com.amazon.device.iap.model.RequestId;
|
|
import com.amazon.device.iap.model.UserDataResponse;
|
|
import com.ironsource.cr;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class e {
|
|
private static final String a = "e";
|
|
private final RequestId b;
|
|
private final h c = new h();
|
|
private i d = null;
|
|
|
|
public void a() {
|
|
}
|
|
|
|
public void a(i iVar) {
|
|
this.d = iVar;
|
|
}
|
|
|
|
public void b() {
|
|
}
|
|
|
|
public RequestId c() {
|
|
return this.b;
|
|
}
|
|
|
|
public h d() {
|
|
return this.c;
|
|
}
|
|
|
|
public e(RequestId requestId) {
|
|
this.b = requestId;
|
|
}
|
|
|
|
public void a(Object obj) {
|
|
a(obj, null);
|
|
}
|
|
|
|
public void a(final Object obj, final i iVar) {
|
|
com.amazon.device.iap.internal.util.d.a(obj, cr.n);
|
|
Context b = com.amazon.device.iap.internal.d.d().b();
|
|
final PurchasingListener a2 = com.amazon.device.iap.internal.d.d().a();
|
|
if (b == null || a2 == null) {
|
|
com.amazon.device.iap.internal.util.e.a(a, "PurchasingListener is not set. Dropping response: " + obj);
|
|
return;
|
|
}
|
|
new Handler(b.getMainLooper()).post(new Runnable() { // from class: com.amazon.device.iap.internal.b.e.1
|
|
@Override // java.lang.Runnable
|
|
public void run() {
|
|
e.this.d().a("notifyListenerResult", Boolean.FALSE);
|
|
try {
|
|
Object obj2 = obj;
|
|
if (obj2 instanceof ProductDataResponse) {
|
|
a2.onProductDataResponse((ProductDataResponse) obj2);
|
|
} else if (obj2 instanceof UserDataResponse) {
|
|
a2.onUserDataResponse((UserDataResponse) obj2);
|
|
} else if (obj2 instanceof PurchaseUpdatesResponse) {
|
|
PurchaseUpdatesResponse purchaseUpdatesResponse = (PurchaseUpdatesResponse) obj2;
|
|
a2.onPurchaseUpdatesResponse(purchaseUpdatesResponse);
|
|
Object a3 = e.this.d().a("newCursor");
|
|
if (a3 != null && (a3 instanceof String)) {
|
|
com.amazon.device.iap.internal.util.b.a(purchaseUpdatesResponse.getUserData().getUserId(), a3.toString());
|
|
}
|
|
} else if (obj2 instanceof PurchaseResponse) {
|
|
a2.onPurchaseResponse((PurchaseResponse) obj2);
|
|
} else {
|
|
com.amazon.device.iap.internal.util.e.b(e.a, "Unknown response type:" + obj.getClass().getName());
|
|
}
|
|
e.this.d().a("notifyListenerResult", Boolean.TRUE);
|
|
} catch (Throwable th) {
|
|
com.amazon.device.iap.internal.util.e.b(e.a, "Error in sendResponse: " + th);
|
|
}
|
|
i iVar2 = iVar;
|
|
if (iVar2 != null) {
|
|
iVar2.a(true);
|
|
iVar.a_();
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
public void e() {
|
|
i iVar = this.d;
|
|
if (iVar != null) {
|
|
iVar.a_();
|
|
} else {
|
|
a();
|
|
}
|
|
}
|
|
}
|