package com.android.billingclient.api; import android.text.TextUtils; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import java.util.List; import org.json.JSONException; import org.json.JSONObject; /* compiled from: com.android.billingclient:billing@@3.0.3 */ public class Purchase { public final String a; public final String b; /* renamed from: c reason: collision with root package name */ public final JSONObject f1544c; /* compiled from: com.android.billingclient:billing@@3.0.3 */ public static class a { @Nullable public final List a; public a(@NonNull BillingResult billingResult, @Nullable List list) { this.a = list; } } public Purchase(@NonNull String str, @NonNull String str2) throws JSONException { this.a = str; this.b = str2; this.f1544c = new JSONObject(str); } @NonNull public String a() { JSONObject jSONObject = this.f1544c; return jSONObject.optString("token", jSONObject.optString("purchaseToken")); } @NonNull public String b() { return this.f1544c.optString("productId"); } public boolean c() { return this.f1544c.optBoolean("acknowledged", true); } public boolean equals(@Nullable Object obj) { if (this == obj) { return true; } if (!(obj instanceof Purchase)) { return false; } Purchase purchase = (Purchase) obj; return TextUtils.equals(this.a, purchase.a) && TextUtils.equals(this.b, purchase.b); } public int hashCode() { return this.a.hashCode(); } @NonNull public String toString() { String valueOf = String.valueOf(this.a); return valueOf.length() != 0 ? "Purchase. Json: ".concat(valueOf) : new String("Purchase. Json: "); } }