- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
291 lines
12 KiB
Java
291 lines
12 KiB
Java
package com.vungle.ads.internal.model;
|
|
|
|
import android.util.Base64;
|
|
import java.io.ByteArrayInputStream;
|
|
import java.io.ByteArrayOutputStream;
|
|
import java.util.List;
|
|
import java.util.zip.GZIPInputStream;
|
|
import kotlin.Unit;
|
|
import kotlin.io.CloseableKt;
|
|
import kotlin.jvm.functions.Function1;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
import kotlin.jvm.internal.Intrinsics;
|
|
import kotlin.jvm.internal.Reflection;
|
|
import kotlinx.serialization.DeserializationStrategy;
|
|
import kotlinx.serialization.KSerializer;
|
|
import kotlinx.serialization.Serializable;
|
|
import kotlinx.serialization.SerializersKt;
|
|
import kotlinx.serialization.StringFormat;
|
|
import kotlinx.serialization.Transient;
|
|
import kotlinx.serialization.descriptors.SerialDescriptor;
|
|
import kotlinx.serialization.encoding.CompositeEncoder;
|
|
import kotlinx.serialization.internal.ArrayListSerializer;
|
|
import kotlinx.serialization.internal.IntSerializer;
|
|
import kotlinx.serialization.internal.SerializationConstructorMarker;
|
|
import kotlinx.serialization.internal.StringSerializer;
|
|
import kotlinx.serialization.json.Json;
|
|
import kotlinx.serialization.json.JsonBuilder;
|
|
import kotlinx.serialization.json.JsonKt;
|
|
|
|
@Serializable
|
|
/* loaded from: classes4.dex */
|
|
public final class BidPayload {
|
|
public static final Companion Companion = new Companion(null);
|
|
private final AdPayload ad;
|
|
private final String adunit;
|
|
private final List<String> impression;
|
|
private final Json json;
|
|
private final Integer version;
|
|
|
|
public BidPayload() {
|
|
this(null, null, null, 7, null);
|
|
}
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
public static /* synthetic */ BidPayload copy$default(BidPayload bidPayload, Integer num, String str, List list, int i, Object obj) {
|
|
if ((i & 1) != 0) {
|
|
num = bidPayload.version;
|
|
}
|
|
if ((i & 2) != 0) {
|
|
str = bidPayload.adunit;
|
|
}
|
|
if ((i & 4) != 0) {
|
|
list = bidPayload.impression;
|
|
}
|
|
return bidPayload.copy(num, str, list);
|
|
}
|
|
|
|
@Transient
|
|
private static /* synthetic */ void getJson$annotations() {
|
|
}
|
|
|
|
public final Integer component1() {
|
|
return this.version;
|
|
}
|
|
|
|
public final String component2() {
|
|
return this.adunit;
|
|
}
|
|
|
|
public final List<String> component3() {
|
|
return this.impression;
|
|
}
|
|
|
|
public final BidPayload copy(Integer num, String str, List<String> list) {
|
|
return new BidPayload(num, str, list);
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
if (!(obj instanceof BidPayload)) {
|
|
return false;
|
|
}
|
|
BidPayload bidPayload = (BidPayload) obj;
|
|
return Intrinsics.areEqual(this.version, bidPayload.version) && Intrinsics.areEqual(this.adunit, bidPayload.adunit) && Intrinsics.areEqual(this.impression, bidPayload.impression);
|
|
}
|
|
|
|
public final AdPayload getAdPayload() {
|
|
return this.ad;
|
|
}
|
|
|
|
public final String getAdunit() {
|
|
return this.adunit;
|
|
}
|
|
|
|
public final List<String> getImpression() {
|
|
return this.impression;
|
|
}
|
|
|
|
public final Integer getVersion() {
|
|
return this.version;
|
|
}
|
|
|
|
public int hashCode() {
|
|
Integer num = this.version;
|
|
int hashCode = (num == null ? 0 : num.hashCode()) * 31;
|
|
String str = this.adunit;
|
|
int hashCode2 = (hashCode + (str == null ? 0 : str.hashCode())) * 31;
|
|
List<String> list = this.impression;
|
|
return hashCode2 + (list != null ? list.hashCode() : 0);
|
|
}
|
|
|
|
public String toString() {
|
|
return "BidPayload(version=" + this.version + ", adunit=" + this.adunit + ", impression=" + this.impression + ')';
|
|
}
|
|
|
|
public static final class Companion {
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
|
|
private Companion() {
|
|
}
|
|
|
|
public final KSerializer<BidPayload> serializer() {
|
|
return BidPayload$$serializer.INSTANCE;
|
|
}
|
|
}
|
|
|
|
public /* synthetic */ BidPayload(int i, Integer num, String str, List list, AdPayload adPayload, SerializationConstructorMarker serializationConstructorMarker) {
|
|
String decodedAdsResponse;
|
|
AdPayload adPayload2 = null;
|
|
if ((i & 1) == 0) {
|
|
this.version = null;
|
|
} else {
|
|
this.version = num;
|
|
}
|
|
if ((i & 2) == 0) {
|
|
this.adunit = null;
|
|
} else {
|
|
this.adunit = str;
|
|
}
|
|
if ((i & 4) == 0) {
|
|
this.impression = null;
|
|
} else {
|
|
this.impression = list;
|
|
}
|
|
StringFormat Json$default = JsonKt.Json$default((Json) null, new Function1() { // from class: com.vungle.ads.internal.model.BidPayload.1
|
|
@Override // kotlin.jvm.functions.Function1
|
|
public /* bridge */ /* synthetic */ Object invoke(Object obj) {
|
|
invoke((JsonBuilder) obj);
|
|
return Unit.INSTANCE;
|
|
}
|
|
|
|
public final void invoke(JsonBuilder Json) {
|
|
Intrinsics.checkNotNullParameter(Json, "$this$Json");
|
|
Json.setIgnoreUnknownKeys(true);
|
|
Json.setEncodeDefaults(true);
|
|
Json.setExplicitNulls(false);
|
|
}
|
|
}, 1, (Object) null);
|
|
this.json = Json$default;
|
|
if ((i & 8) != 0) {
|
|
this.ad = adPayload;
|
|
return;
|
|
}
|
|
if (this.adunit != null && (decodedAdsResponse = getDecodedAdsResponse()) != null) {
|
|
StringFormat stringFormat = Json$default;
|
|
DeserializationStrategy serializer = SerializersKt.serializer(stringFormat.getSerializersModule(), Reflection.typeOf(AdPayload.class));
|
|
Intrinsics.checkNotNull(serializer, "null cannot be cast to non-null type kotlinx.serialization.KSerializer<T of kotlinx.serialization.internal.Platform_commonKt.cast>");
|
|
adPayload2 = (AdPayload) stringFormat.decodeFromString(serializer, decodedAdsResponse);
|
|
}
|
|
this.ad = adPayload2;
|
|
}
|
|
|
|
public BidPayload(Integer num, String str, List<String> list) {
|
|
String decodedAdsResponse;
|
|
this.version = num;
|
|
this.adunit = str;
|
|
this.impression = list;
|
|
AdPayload adPayload = null;
|
|
StringFormat Json$default = JsonKt.Json$default((Json) null, new Function1() { // from class: com.vungle.ads.internal.model.BidPayload$json$1
|
|
@Override // kotlin.jvm.functions.Function1
|
|
public /* bridge */ /* synthetic */ Object invoke(Object obj) {
|
|
invoke((JsonBuilder) obj);
|
|
return Unit.INSTANCE;
|
|
}
|
|
|
|
public final void invoke(JsonBuilder Json) {
|
|
Intrinsics.checkNotNullParameter(Json, "$this$Json");
|
|
Json.setIgnoreUnknownKeys(true);
|
|
Json.setEncodeDefaults(true);
|
|
Json.setExplicitNulls(false);
|
|
}
|
|
}, 1, (Object) null);
|
|
this.json = Json$default;
|
|
if (str != null && (decodedAdsResponse = getDecodedAdsResponse()) != null) {
|
|
StringFormat stringFormat = Json$default;
|
|
DeserializationStrategy serializer = SerializersKt.serializer(stringFormat.getSerializersModule(), Reflection.typeOf(AdPayload.class));
|
|
Intrinsics.checkNotNull(serializer, "null cannot be cast to non-null type kotlinx.serialization.KSerializer<T of kotlinx.serialization.internal.Platform_commonKt.cast>");
|
|
adPayload = (AdPayload) stringFormat.decodeFromString(serializer, decodedAdsResponse);
|
|
}
|
|
this.ad = adPayload;
|
|
}
|
|
|
|
public static final void write$Self(BidPayload self, CompositeEncoder output, SerialDescriptor serialDesc) {
|
|
String decodedAdsResponse;
|
|
Intrinsics.checkNotNullParameter(self, "self");
|
|
Intrinsics.checkNotNullParameter(output, "output");
|
|
Intrinsics.checkNotNullParameter(serialDesc, "serialDesc");
|
|
if (output.shouldEncodeElementDefault(serialDesc, 0) || self.version != null) {
|
|
output.encodeNullableSerializableElement(serialDesc, 0, IntSerializer.INSTANCE, self.version);
|
|
}
|
|
if (output.shouldEncodeElementDefault(serialDesc, 1) || self.adunit != null) {
|
|
output.encodeNullableSerializableElement(serialDesc, 1, StringSerializer.INSTANCE, self.adunit);
|
|
}
|
|
if (output.shouldEncodeElementDefault(serialDesc, 2) || self.impression != null) {
|
|
output.encodeNullableSerializableElement(serialDesc, 2, new ArrayListSerializer(StringSerializer.INSTANCE), self.impression);
|
|
}
|
|
if (!output.shouldEncodeElementDefault(serialDesc, 3)) {
|
|
AdPayload adPayload = self.ad;
|
|
AdPayload adPayload2 = null;
|
|
if (self.adunit != null && (decodedAdsResponse = self.getDecodedAdsResponse()) != null) {
|
|
StringFormat stringFormat = self.json;
|
|
DeserializationStrategy serializer = SerializersKt.serializer(stringFormat.getSerializersModule(), Reflection.typeOf(AdPayload.class));
|
|
Intrinsics.checkNotNull(serializer, "null cannot be cast to non-null type kotlinx.serialization.KSerializer<T of kotlinx.serialization.internal.Platform_commonKt.cast>");
|
|
adPayload2 = (AdPayload) stringFormat.decodeFromString(serializer, decodedAdsResponse);
|
|
}
|
|
if (Intrinsics.areEqual(adPayload, adPayload2)) {
|
|
return;
|
|
}
|
|
}
|
|
output.encodeNullableSerializableElement(serialDesc, 3, AdPayload$$serializer.INSTANCE, self.ad);
|
|
}
|
|
|
|
public /* synthetic */ BidPayload(Integer num, String str, List list, int i, DefaultConstructorMarker defaultConstructorMarker) {
|
|
this((i & 1) != 0 ? null : num, (i & 2) != 0 ? null : str, (i & 4) != 0 ? null : list);
|
|
}
|
|
|
|
public final String getPlacementId() {
|
|
AdPayload adPayload = this.ad;
|
|
if (adPayload != null) {
|
|
return adPayload.placementId();
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public final String getEventId() {
|
|
AdPayload adPayload = this.ad;
|
|
if (adPayload != null) {
|
|
return adPayload.eventId();
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public final String getDecodedAdsResponse() throws Throwable {
|
|
byte[] decode = Base64.decode(this.adunit, 0);
|
|
if (decode != null) {
|
|
return gzipDecode(decode);
|
|
}
|
|
return null;
|
|
}
|
|
|
|
private final String gzipDecode(byte[] bArr) throws Throwable {
|
|
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
|
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bArr);
|
|
try {
|
|
GZIPInputStream gZIPInputStream = new GZIPInputStream(byteArrayInputStream, 1024);
|
|
try {
|
|
byte[] bArr2 = new byte[1024];
|
|
while (true) {
|
|
int read = gZIPInputStream.read(bArr2);
|
|
if (read != -1) {
|
|
byteArrayOutputStream.write(bArr2, 0, read);
|
|
} else {
|
|
Unit unit = Unit.INSTANCE;
|
|
CloseableKt.closeFinally(gZIPInputStream, null);
|
|
CloseableKt.closeFinally(byteArrayInputStream, null);
|
|
String byteArrayOutputStream2 = byteArrayOutputStream.toString();
|
|
Intrinsics.checkNotNullExpressionValue(byteArrayOutputStream2, "result.toString()");
|
|
return byteArrayOutputStream2;
|
|
}
|
|
}
|
|
} finally {
|
|
}
|
|
} finally {
|
|
}
|
|
}
|
|
}
|