- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
169 lines
4.7 KiB
Java
169 lines
4.7 KiB
Java
package com.amazon.device.iap.internal.b;
|
|
|
|
import android.os.RemoteException;
|
|
import com.amazon.android.Kiwi;
|
|
import com.amazon.android.framework.exception.KiwiException;
|
|
import com.amazon.android.framework.prompt.PromptContent;
|
|
import com.amazon.android.framework.task.command.AbstractCommandTask;
|
|
import com.amazon.android.licensing.LicenseFailurePromptContentMapper;
|
|
import com.amazon.device.iap.PurchasingService;
|
|
import com.amazon.venezia.command.FailureResult;
|
|
import com.amazon.venezia.command.SuccessResult;
|
|
import java.util.HashMap;
|
|
import java.util.Map;
|
|
|
|
/* loaded from: classes.dex */
|
|
public abstract class i extends AbstractCommandTask {
|
|
private static final String a = i.class.getSimpleName();
|
|
private final e b;
|
|
private final String c;
|
|
private final String d;
|
|
private final String e;
|
|
private final Map<String, Object> f;
|
|
private boolean h;
|
|
private i i;
|
|
private i j;
|
|
private final LicenseFailurePromptContentMapper g = new LicenseFailurePromptContentMapper();
|
|
private boolean k = false;
|
|
|
|
public i a(boolean z) {
|
|
this.k = z;
|
|
return this;
|
|
}
|
|
|
|
public void a(i iVar) {
|
|
this.i = iVar;
|
|
}
|
|
|
|
public abstract boolean a(SuccessResult successResult) throws Exception;
|
|
|
|
public e b() {
|
|
return this.b;
|
|
}
|
|
|
|
public void b(i iVar) {
|
|
this.j = iVar;
|
|
}
|
|
|
|
public void b(boolean z) {
|
|
this.h = z;
|
|
}
|
|
|
|
public String c() {
|
|
return this.c;
|
|
}
|
|
|
|
public Map<String, Object> getCommandData() {
|
|
return this.f;
|
|
}
|
|
|
|
public String getCommandName() {
|
|
return this.d;
|
|
}
|
|
|
|
public String getCommandVersion() {
|
|
return this.e;
|
|
}
|
|
|
|
public boolean isExecutionNeeded() {
|
|
return true;
|
|
}
|
|
|
|
public i(e eVar, String str, String str2) {
|
|
this.b = eVar;
|
|
String requestId = eVar.c().toString();
|
|
this.c = requestId;
|
|
this.d = str;
|
|
this.e = str2;
|
|
HashMap hashMap = new HashMap();
|
|
this.f = hashMap;
|
|
hashMap.put("requestId", requestId);
|
|
hashMap.put("sdkVersion", PurchasingService.SDK_VERSION);
|
|
this.h = true;
|
|
this.i = null;
|
|
this.j = null;
|
|
}
|
|
|
|
public void a(String str, Object obj) {
|
|
this.f.put(str, obj);
|
|
}
|
|
|
|
private void a(PromptContent promptContent) {
|
|
if (promptContent == null) {
|
|
return;
|
|
}
|
|
Kiwi.getPromptManager().present(new b(promptContent));
|
|
}
|
|
|
|
public final void onSuccess(SuccessResult successResult) throws RemoteException {
|
|
boolean z;
|
|
i iVar;
|
|
String str = (String) successResult.getData().get("errorMessage");
|
|
com.amazon.device.iap.internal.util.e.a(a, "onSuccess: result = " + successResult + ", errorMessage: " + str);
|
|
if (!com.amazon.device.iap.internal.util.d.a(str)) {
|
|
if (this.k) {
|
|
return;
|
|
}
|
|
this.b.b();
|
|
return;
|
|
}
|
|
try {
|
|
z = a(successResult);
|
|
} catch (Exception e) {
|
|
com.amazon.device.iap.internal.util.e.b(a, "Error calling onResult: " + e);
|
|
z = false;
|
|
}
|
|
if (z && (iVar = this.i) != null) {
|
|
iVar.a_();
|
|
} else {
|
|
if (this.k) {
|
|
return;
|
|
}
|
|
if (z) {
|
|
this.b.a();
|
|
} else {
|
|
this.b.b();
|
|
}
|
|
}
|
|
}
|
|
|
|
public final void onFailure(FailureResult failureResult) throws RemoteException, KiwiException {
|
|
String str;
|
|
i iVar;
|
|
com.amazon.device.iap.internal.util.e.a(a, "onFailure: result = " + failureResult);
|
|
if (failureResult != null && (str = (String) failureResult.getExtensionData().get("maxVersion")) != null && str.equalsIgnoreCase("1.0") && (iVar = this.j) != null) {
|
|
iVar.a(this.k);
|
|
this.j.a_();
|
|
return;
|
|
}
|
|
if (this.h) {
|
|
a(new PromptContent(failureResult.getDisplayableName(), failureResult.getDisplayableMessage(), failureResult.getButtonLabel(), failureResult.show()));
|
|
}
|
|
if (this.k) {
|
|
return;
|
|
}
|
|
this.b.b();
|
|
}
|
|
|
|
public final void onException(KiwiException kiwiException) {
|
|
i iVar;
|
|
com.amazon.device.iap.internal.util.e.a(a, "onException: exception = " + kiwiException.getMessage());
|
|
if ("UNHANDLED_EXCEPTION".equals(kiwiException.getType()) && "2.0".equals(this.e) && (iVar = this.j) != null) {
|
|
iVar.a(this.k);
|
|
this.j.a_();
|
|
return;
|
|
}
|
|
if (this.h) {
|
|
a(this.g.map(kiwiException));
|
|
}
|
|
if (this.k) {
|
|
return;
|
|
}
|
|
this.b.b();
|
|
}
|
|
|
|
public void a_() {
|
|
Kiwi.addCommandToCommandTaskPipeline(this);
|
|
}
|
|
}
|