discord-jadx/app/src/main/java/c/d/a/a/r.java

56 lines
2.1 KiB
Java
Raw Normal View History

package c.d.a.a;
2021-11-08 08:23:34 +00:00
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
2021-11-01 07:19:03 +00:00
import android.os.Bundle;
import c.i.a.f.h.n.a;
import com.android.billingclient.api.BillingResult;
2021-11-08 08:23:34 +00:00
import com.android.billingclient.api.Purchase;
import java.util.ArrayList;
2021-11-01 07:19:03 +00:00
/* compiled from: com.android.billingclient:billing@@4.0.0 */
2021-11-08 08:23:34 +00:00
public final class r extends BroadcastReceiver {
public final g a;
public boolean b;
2021-11-08 08:23:34 +00:00
/* renamed from: c reason: collision with root package name */
public final /* synthetic */ s f352c;
public /* synthetic */ r(s sVar, g gVar) {
this.f352c = sVar;
this.a = gVar;
2021-11-01 07:19:03 +00:00
}
2021-11-08 08:23:34 +00:00
@Override // android.content.BroadcastReceiver
public final void onReceive(Context context, Intent intent) {
BillingResult c2 = a.c(intent, "BillingBroadcastManager");
Bundle extras = intent.getExtras();
ArrayList arrayList = null;
if (extras != null) {
ArrayList<String> stringArrayList = extras.getStringArrayList("INAPP_PURCHASE_DATA_LIST");
ArrayList<String> stringArrayList2 = extras.getStringArrayList("INAPP_DATA_SIGNATURE_LIST");
ArrayList arrayList2 = new ArrayList();
if (stringArrayList == null || stringArrayList2 == null) {
a.f("BillingHelper", "Couldn't find purchase lists, trying to find single data.");
Purchase g = a.g(extras.getString("INAPP_PURCHASE_DATA"), extras.getString("INAPP_DATA_SIGNATURE"));
if (g == null) {
a.f("BillingHelper", "Couldn't find single purchase data as well.");
} else {
arrayList2.add(g);
2021-11-01 07:19:03 +00:00
}
} else {
2021-11-08 08:23:34 +00:00
int i = 0;
while (i < stringArrayList.size() && i < stringArrayList2.size()) {
Purchase g2 = a.g(stringArrayList.get(i), stringArrayList2.get(i));
if (g2 != null) {
arrayList2.add(g2);
}
i++;
}
2021-11-01 07:19:03 +00:00
}
2021-11-08 08:23:34 +00:00
arrayList = arrayList2;
2021-11-01 07:19:03 +00:00
}
2021-11-08 08:23:34 +00:00
this.a.onPurchasesUpdated(c2, arrayList);
}
}