Files
rr3-apk/decompiled/sources/com/tapjoy/f0.java
Daniel Elliott f9d20bb3fc Add decompiled APK source code (JADX)
- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-18 14:52:23 -08:00

74 lines
4.1 KiB
Java

package com.tapjoy;
import com.tapjoy.TapjoyErrorMessage;
import com.tapjoy.internal.b3;
import com.tapjoy.internal.c3;
import java.util.Map;
import org.w3c.dom.Document;
/* loaded from: classes4.dex */
public final class f0 implements Runnable {
public final /* synthetic */ Map a;
public final /* synthetic */ TJGetCurrencyBalanceListener b;
public final /* synthetic */ TJCurrency c;
public f0(TJCurrency tJCurrency, Map map, TJGetCurrencyBalanceListener tJGetCurrencyBalanceListener) {
this.c = tJCurrency;
this.a = map;
this.b = tJGetCurrencyBalanceListener;
}
@Override // java.lang.Runnable
public final void run() {
b3 a = c3.a(TapjoyConnectCore.getInstance().getHostURL() + TapjoyConstants.TJC_GET_CURRENCY_BALANCE_URL_PATH, this.a);
TJCurrency tJCurrency = this.c;
TJGetCurrencyBalanceListener tJGetCurrencyBalanceListener = this.b;
synchronized (tJCurrency) {
try {
String str = a.c;
if (str != null) {
Document buildDocument = TapjoyUtil.buildDocument(str);
if (buildDocument != null) {
String nodeTrimValue = TapjoyUtil.getNodeTrimValue(buildDocument.getElementsByTagName("Success"));
if (nodeTrimValue == null || !nodeTrimValue.equals("true")) {
TapjoyLog.e("TJCurrency", new TapjoyErrorMessage(TapjoyErrorMessage.ErrorType.SERVER_ERROR, "getCurrencyBalance response is invalid -- missing <Success> tag."));
} else {
String nodeTrimValue2 = TapjoyUtil.getNodeTrimValue(buildDocument.getElementsByTagName("TapPoints"));
String nodeTrimValue3 = TapjoyUtil.getNodeTrimValue(buildDocument.getElementsByTagName("CurrencyName"));
if (nodeTrimValue2 == null || nodeTrimValue3 == null) {
TapjoyLog.e("TJCurrency", new TapjoyErrorMessage(TapjoyErrorMessage.ErrorType.SERVER_ERROR, "getCurrencyBalance response is invalid -- missing tags."));
} else {
try {
int parseInt = Integer.parseInt(nodeTrimValue2);
int localCurrencyBalance = tJCurrency.getLocalCurrencyBalance();
if (TJCurrency.c != null && localCurrencyBalance != -9999 && parseInt > localCurrencyBalance) {
StringBuilder sb = new StringBuilder("earned: ");
int i = parseInt - localCurrencyBalance;
sb.append(i);
TapjoyLog.i("TJCurrency", sb.toString());
TJCurrency.c.onEarnedCurrency(nodeTrimValue3, i);
}
tJCurrency.saveCurrencyBalance(parseInt);
if (tJGetCurrencyBalanceListener != null) {
tJGetCurrencyBalanceListener.onGetCurrencyBalanceResponse(nodeTrimValue3, parseInt);
}
return;
} catch (Exception e) {
TapjoyLog.e("TJCurrency", new TapjoyErrorMessage(TapjoyErrorMessage.ErrorType.SERVER_ERROR, "Error parsing XML and calling listener: " + e.toString()));
}
}
}
}
} else {
TapjoyLog.e("TJCurrency", new TapjoyErrorMessage(TapjoyErrorMessage.ErrorType.SERVER_ERROR, "getCurrencyBalance response is NULL"));
}
if (tJGetCurrencyBalanceListener != null) {
tJGetCurrencyBalanceListener.onGetCurrencyBalanceResponseFailure("Failed to get currency balance");
}
} catch (Throwable th) {
throw th;
}
}
}
}