- 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
1092 lines
48 KiB
Java
1092 lines
48 KiB
Java
package androidx.work;
|
|
|
|
import android.annotation.SuppressLint;
|
|
import androidx.annotation.RestrictTo;
|
|
import androidx.annotation.VisibleForTesting;
|
|
import androidx.room.TypeConverter;
|
|
import com.google.android.gms.ads.RequestConfiguration;
|
|
import java.io.ByteArrayInputStream;
|
|
import java.io.ByteArrayOutputStream;
|
|
import java.io.DataInputStream;
|
|
import java.io.DataOutputStream;
|
|
import java.io.IOException;
|
|
import java.io.ObjectInputStream;
|
|
import java.io.ObjectOutputStream;
|
|
import java.util.Arrays;
|
|
import java.util.Collections;
|
|
import java.util.HashMap;
|
|
import java.util.LinkedHashMap;
|
|
import java.util.Map;
|
|
import java.util.Objects;
|
|
import kotlin.Unit;
|
|
import kotlin.collections.ArraysKt__ArraysJVMKt;
|
|
import kotlin.collections.CollectionsKt___CollectionsKt;
|
|
import kotlin.io.CloseableKt;
|
|
import kotlin.jvm.functions.Function1;
|
|
import kotlin.jvm.functions.Function2;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
import kotlin.jvm.internal.Intrinsics;
|
|
import kotlin.jvm.internal.Reflection;
|
|
import kotlin.jvm.internal.SourceDebugExtension;
|
|
import kotlin.reflect.KClass;
|
|
|
|
@SourceDebugExtension({"SMAP\nData_.kt\nKotlin\n*S Kotlin\n*F\n+ 1 Data_.kt\nandroidx/work/Data\n*L\n1#1,841:1\n55#1,2:842\n63#1,4:844\n55#1,2:848\n63#1,4:850\n55#1,2:854\n63#1,4:856\n55#1,2:860\n63#1,4:862\n55#1,2:866\n63#1,4:868\n55#1,2:872\n63#1,4:874\n63#1,4:878\n*S KotlinDebug\n*F\n+ 1 Data_.kt\nandroidx/work/Data\n*L\n76#1:842,2\n84#1:844,4\n93#1:848,2\n101#1:850,4\n110#1:854,2\n118#1:856,4\n127#1:860,2\n135#1:862,4\n144#1:866,2\n152#1:868,4\n161#1:872,2\n169#1:874,4\n185#1:878,4\n*E\n"})
|
|
/* loaded from: classes.dex */
|
|
public final class Data {
|
|
public static final Companion Companion = new Companion(null);
|
|
public static final Data EMPTY = new Builder().build();
|
|
|
|
@SuppressLint({"MinMaxConstant"})
|
|
public static final int MAX_DATA_BYTES = 10240;
|
|
private static final String NULL_STRING_V1 = "androidx.work.Data-95ed6082-b8e9-46e8-a73f-ff56f00f5d9d";
|
|
private static final short STREAM_MAGIC = -21521;
|
|
private static final short STREAM_VERSION = 1;
|
|
private static final byte TYPE_BOOLEAN = 1;
|
|
private static final byte TYPE_BOOLEAN_ARRAY = 8;
|
|
private static final byte TYPE_BYTE = 2;
|
|
private static final byte TYPE_BYTE_ARRAY = 9;
|
|
private static final byte TYPE_DOUBLE = 6;
|
|
private static final byte TYPE_DOUBLE_ARRAY = 13;
|
|
private static final byte TYPE_FLOAT = 5;
|
|
private static final byte TYPE_FLOAT_ARRAY = 12;
|
|
private static final byte TYPE_INTEGER = 3;
|
|
private static final byte TYPE_INTEGER_ARRAY = 10;
|
|
private static final byte TYPE_LONG = 4;
|
|
private static final byte TYPE_LONG_ARRAY = 11;
|
|
private static final byte TYPE_NULL = 0;
|
|
private static final byte TYPE_STRING = 7;
|
|
private static final byte TYPE_STRING_ARRAY = 14;
|
|
private final Map<String, Object> values;
|
|
|
|
@TypeConverter
|
|
public static final Data fromByteArray(byte[] bArr) {
|
|
return Companion.fromByteArray(bArr);
|
|
}
|
|
|
|
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
|
|
public static final byte[] toByteArrayInternalV0(Data data) {
|
|
return Companion.toByteArrayInternalV0(data);
|
|
}
|
|
|
|
@TypeConverter
|
|
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
|
|
public static final byte[] toByteArrayInternalV1(Data data) {
|
|
return Companion.toByteArrayInternalV1(data);
|
|
}
|
|
|
|
public Data(Data other) {
|
|
Intrinsics.checkNotNullParameter(other, "other");
|
|
this.values = new HashMap(other.values);
|
|
}
|
|
|
|
public Data(Map<String, ?> values) {
|
|
Intrinsics.checkNotNullParameter(values, "values");
|
|
this.values = new HashMap(values);
|
|
}
|
|
|
|
private final /* synthetic */ <T> T getOrDefault(String str, T t) {
|
|
T t2 = (T) this.values.get(str);
|
|
Intrinsics.reifiedOperationMarker(3, RequestConfiguration.MAX_AD_CONTENT_RATING_T);
|
|
return t2 instanceof Object ? t2 : t;
|
|
}
|
|
|
|
private final /* synthetic */ <T, TArray> TArray getTypedArray(String str, Function2 function2) {
|
|
final Object obj = this.values.get(str);
|
|
if (obj instanceof Object[]) {
|
|
Object[] objArr = (Object[]) obj;
|
|
if (objArr instanceof Object[]) {
|
|
Integer valueOf = Integer.valueOf(objArr.length);
|
|
Intrinsics.needClassReification();
|
|
return (TArray) function2.invoke(valueOf, new Function1() { // from class: androidx.work.Data$getTypedArray$1
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
|
{
|
|
super(1);
|
|
}
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
public final T invoke(int i) {
|
|
T t = ((Object[]) obj)[i];
|
|
Intrinsics.reifiedOperationMarker(1, RequestConfiguration.MAX_AD_CONTENT_RATING_T);
|
|
return t;
|
|
}
|
|
|
|
@Override // kotlin.jvm.functions.Function1
|
|
public /* bridge */ /* synthetic */ Object invoke(Object obj2) {
|
|
return invoke(((Number) obj2).intValue());
|
|
}
|
|
});
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public final boolean[] getBooleanArray(String key) {
|
|
Intrinsics.checkNotNullParameter(key, "key");
|
|
final Object obj = this.values.get(key);
|
|
if (obj instanceof Object[]) {
|
|
Object[] objArr = (Object[]) obj;
|
|
if (objArr instanceof Object[]) {
|
|
int length = objArr.length;
|
|
Function1 function1 = new Function1() { // from class: androidx.work.Data$getBooleanArray$$inlined$getTypedArray$1
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
|
{
|
|
super(1);
|
|
}
|
|
|
|
public final Boolean invoke(int i) {
|
|
Object obj2 = ((Object[]) obj)[i];
|
|
if (obj2 != null) {
|
|
return (Boolean) obj2;
|
|
}
|
|
throw new NullPointerException("null cannot be cast to non-null type kotlin.Boolean");
|
|
}
|
|
|
|
@Override // kotlin.jvm.functions.Function1
|
|
public /* bridge */ /* synthetic */ Object invoke(Object obj2) {
|
|
return invoke(((Number) obj2).intValue());
|
|
}
|
|
};
|
|
boolean[] zArr = new boolean[length];
|
|
for (int i = 0; i < length; i++) {
|
|
zArr[i] = ((Boolean) function1.invoke(Integer.valueOf(i))).booleanValue();
|
|
}
|
|
return zArr;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public final byte[] getByteArray(String key) {
|
|
Intrinsics.checkNotNullParameter(key, "key");
|
|
final Object obj = this.values.get(key);
|
|
if (obj instanceof Object[]) {
|
|
Object[] objArr = (Object[]) obj;
|
|
if (objArr instanceof Object[]) {
|
|
int length = objArr.length;
|
|
Function1 function1 = new Function1() { // from class: androidx.work.Data$getByteArray$$inlined$getTypedArray$1
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
|
{
|
|
super(1);
|
|
}
|
|
|
|
public final Byte invoke(int i) {
|
|
Object obj2 = ((Object[]) obj)[i];
|
|
if (obj2 != null) {
|
|
return (Byte) obj2;
|
|
}
|
|
throw new NullPointerException("null cannot be cast to non-null type kotlin.Byte");
|
|
}
|
|
|
|
@Override // kotlin.jvm.functions.Function1
|
|
public /* bridge */ /* synthetic */ Object invoke(Object obj2) {
|
|
return invoke(((Number) obj2).intValue());
|
|
}
|
|
};
|
|
byte[] bArr = new byte[length];
|
|
for (int i = 0; i < length; i++) {
|
|
bArr[i] = ((Number) function1.invoke(Integer.valueOf(i))).byteValue();
|
|
}
|
|
return bArr;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public final double[] getDoubleArray(String key) {
|
|
Intrinsics.checkNotNullParameter(key, "key");
|
|
final Object obj = this.values.get(key);
|
|
if (obj instanceof Object[]) {
|
|
Object[] objArr = (Object[]) obj;
|
|
if (objArr instanceof Object[]) {
|
|
int length = objArr.length;
|
|
Function1 function1 = new Function1() { // from class: androidx.work.Data$getDoubleArray$$inlined$getTypedArray$1
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
|
{
|
|
super(1);
|
|
}
|
|
|
|
public final Double invoke(int i) {
|
|
Object obj2 = ((Object[]) obj)[i];
|
|
if (obj2 != null) {
|
|
return (Double) obj2;
|
|
}
|
|
throw new NullPointerException("null cannot be cast to non-null type kotlin.Double");
|
|
}
|
|
|
|
@Override // kotlin.jvm.functions.Function1
|
|
public /* bridge */ /* synthetic */ Object invoke(Object obj2) {
|
|
return invoke(((Number) obj2).intValue());
|
|
}
|
|
};
|
|
double[] dArr = new double[length];
|
|
for (int i = 0; i < length; i++) {
|
|
dArr[i] = ((Number) function1.invoke(Integer.valueOf(i))).doubleValue();
|
|
}
|
|
return dArr;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public final float[] getFloatArray(String key) {
|
|
Intrinsics.checkNotNullParameter(key, "key");
|
|
final Object obj = this.values.get(key);
|
|
if (obj instanceof Object[]) {
|
|
Object[] objArr = (Object[]) obj;
|
|
if (objArr instanceof Object[]) {
|
|
int length = objArr.length;
|
|
Function1 function1 = new Function1() { // from class: androidx.work.Data$getFloatArray$$inlined$getTypedArray$1
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
|
{
|
|
super(1);
|
|
}
|
|
|
|
public final Float invoke(int i) {
|
|
Object obj2 = ((Object[]) obj)[i];
|
|
if (obj2 != null) {
|
|
return (Float) obj2;
|
|
}
|
|
throw new NullPointerException("null cannot be cast to non-null type kotlin.Float");
|
|
}
|
|
|
|
@Override // kotlin.jvm.functions.Function1
|
|
public /* bridge */ /* synthetic */ Object invoke(Object obj2) {
|
|
return invoke(((Number) obj2).intValue());
|
|
}
|
|
};
|
|
float[] fArr = new float[length];
|
|
for (int i = 0; i < length; i++) {
|
|
fArr[i] = ((Number) function1.invoke(Integer.valueOf(i))).floatValue();
|
|
}
|
|
return fArr;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public final int[] getIntArray(String key) {
|
|
Intrinsics.checkNotNullParameter(key, "key");
|
|
final Object obj = this.values.get(key);
|
|
if (obj instanceof Object[]) {
|
|
Object[] objArr = (Object[]) obj;
|
|
if (objArr instanceof Object[]) {
|
|
int length = objArr.length;
|
|
Function1 function1 = new Function1() { // from class: androidx.work.Data$getIntArray$$inlined$getTypedArray$1
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
|
{
|
|
super(1);
|
|
}
|
|
|
|
public final Integer invoke(int i) {
|
|
Object obj2 = ((Object[]) obj)[i];
|
|
if (obj2 != null) {
|
|
return (Integer) obj2;
|
|
}
|
|
throw new NullPointerException("null cannot be cast to non-null type kotlin.Int");
|
|
}
|
|
|
|
@Override // kotlin.jvm.functions.Function1
|
|
public /* bridge */ /* synthetic */ Object invoke(Object obj2) {
|
|
return invoke(((Number) obj2).intValue());
|
|
}
|
|
};
|
|
int[] iArr = new int[length];
|
|
for (int i = 0; i < length; i++) {
|
|
iArr[i] = ((Number) function1.invoke(Integer.valueOf(i))).intValue();
|
|
}
|
|
return iArr;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public final long[] getLongArray(String key) {
|
|
Intrinsics.checkNotNullParameter(key, "key");
|
|
final Object obj = this.values.get(key);
|
|
if (obj instanceof Object[]) {
|
|
Object[] objArr = (Object[]) obj;
|
|
if (objArr instanceof Object[]) {
|
|
int length = objArr.length;
|
|
Function1 function1 = new Function1() { // from class: androidx.work.Data$getLongArray$$inlined$getTypedArray$1
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
|
{
|
|
super(1);
|
|
}
|
|
|
|
public final Long invoke(int i) {
|
|
Object obj2 = ((Object[]) obj)[i];
|
|
if (obj2 != null) {
|
|
return (Long) obj2;
|
|
}
|
|
throw new NullPointerException("null cannot be cast to non-null type kotlin.Long");
|
|
}
|
|
|
|
@Override // kotlin.jvm.functions.Function1
|
|
public /* bridge */ /* synthetic */ Object invoke(Object obj2) {
|
|
return invoke(((Number) obj2).intValue());
|
|
}
|
|
};
|
|
long[] jArr = new long[length];
|
|
for (int i = 0; i < length; i++) {
|
|
jArr[i] = ((Number) function1.invoke(Integer.valueOf(i))).longValue();
|
|
}
|
|
return jArr;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
public final String[] getStringArray(String key) {
|
|
Intrinsics.checkNotNullParameter(key, "key");
|
|
final Object obj = this.values.get(key);
|
|
if (obj instanceof Object[]) {
|
|
Object[] objArr = (Object[]) obj;
|
|
if (objArr instanceof Object[]) {
|
|
int length = objArr.length;
|
|
Function1 function1 = new Function1() { // from class: androidx.work.Data$getStringArray$$inlined$getTypedArray$1
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
|
{
|
|
super(1);
|
|
}
|
|
|
|
public final String invoke(int i) {
|
|
Object obj2 = ((Object[]) obj)[i];
|
|
if (obj2 != null) {
|
|
return (String) obj2;
|
|
}
|
|
throw new NullPointerException("null cannot be cast to non-null type kotlin.String");
|
|
}
|
|
|
|
@Override // kotlin.jvm.functions.Function1
|
|
public /* bridge */ /* synthetic */ Object invoke(Object obj2) {
|
|
return invoke(((Number) obj2).intValue());
|
|
}
|
|
};
|
|
String[] strArr = new String[length];
|
|
for (int i = 0; i < length; i++) {
|
|
strArr[i] = function1.invoke(Integer.valueOf(i));
|
|
}
|
|
return strArr;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public final boolean getBoolean(String key, boolean z) {
|
|
Intrinsics.checkNotNullParameter(key, "key");
|
|
Object valueOf = Boolean.valueOf(z);
|
|
Object obj = this.values.get(key);
|
|
if (obj instanceof Boolean) {
|
|
valueOf = obj;
|
|
}
|
|
return ((Boolean) valueOf).booleanValue();
|
|
}
|
|
|
|
public final byte getByte(String key, byte b) {
|
|
Intrinsics.checkNotNullParameter(key, "key");
|
|
Object valueOf = Byte.valueOf(b);
|
|
Object obj = this.values.get(key);
|
|
if (obj instanceof Byte) {
|
|
valueOf = obj;
|
|
}
|
|
return ((Number) valueOf).byteValue();
|
|
}
|
|
|
|
public final int getInt(String key, int i) {
|
|
Intrinsics.checkNotNullParameter(key, "key");
|
|
Object valueOf = Integer.valueOf(i);
|
|
Object obj = this.values.get(key);
|
|
if (obj instanceof Integer) {
|
|
valueOf = obj;
|
|
}
|
|
return ((Number) valueOf).intValue();
|
|
}
|
|
|
|
public final long getLong(String key, long j) {
|
|
Intrinsics.checkNotNullParameter(key, "key");
|
|
Object valueOf = Long.valueOf(j);
|
|
Object obj = this.values.get(key);
|
|
if (obj instanceof Long) {
|
|
valueOf = obj;
|
|
}
|
|
return ((Number) valueOf).longValue();
|
|
}
|
|
|
|
public final float getFloat(String key, float f) {
|
|
Intrinsics.checkNotNullParameter(key, "key");
|
|
Object valueOf = Float.valueOf(f);
|
|
Object obj = this.values.get(key);
|
|
if (obj instanceof Float) {
|
|
valueOf = obj;
|
|
}
|
|
return ((Number) valueOf).floatValue();
|
|
}
|
|
|
|
public final double getDouble(String key, double d) {
|
|
Intrinsics.checkNotNullParameter(key, "key");
|
|
Object valueOf = Double.valueOf(d);
|
|
Object obj = this.values.get(key);
|
|
if (obj instanceof Double) {
|
|
valueOf = obj;
|
|
}
|
|
return ((Number) valueOf).doubleValue();
|
|
}
|
|
|
|
public final String getString(String key) {
|
|
Intrinsics.checkNotNullParameter(key, "key");
|
|
Object obj = this.values.get(key);
|
|
if (obj instanceof String) {
|
|
return (String) obj;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public final Map<String, Object> getKeyValueMap() {
|
|
Map<String, Object> unmodifiableMap = Collections.unmodifiableMap(this.values);
|
|
Intrinsics.checkNotNullExpressionValue(unmodifiableMap, "unmodifiableMap(values)");
|
|
return unmodifiableMap;
|
|
}
|
|
|
|
public final byte[] toByteArray() {
|
|
return Companion.toByteArrayInternalV1(this);
|
|
}
|
|
|
|
@SourceDebugExtension({"SMAP\nData_.kt\nKotlin\n*S Kotlin\n*F\n+ 1 Data_.kt\nandroidx/work/Data$Builder\n+ 2 _Maps.kt\nkotlin/collections/MapsKt___MapsKt\n*L\n1#1,841:1\n215#2,2:842\n*S KotlinDebug\n*F\n+ 1 Data_.kt\nandroidx/work/Data$Builder\n*L\n469#1:842,2\n*E\n"})
|
|
public static final class Builder {
|
|
private final Map<String, Object> values = new LinkedHashMap();
|
|
|
|
public final Builder putAll(Map<String, ? extends Object> values) {
|
|
Intrinsics.checkNotNullParameter(values, "values");
|
|
for (Map.Entry<String, ? extends Object> entry : values.entrySet()) {
|
|
put(entry.getKey(), entry.getValue());
|
|
}
|
|
return this;
|
|
}
|
|
|
|
private final Builder putDirect(String str, Object obj) {
|
|
this.values.put(str, obj);
|
|
return this;
|
|
}
|
|
|
|
public final Builder putBoolean(String key, boolean z) {
|
|
Intrinsics.checkNotNullParameter(key, "key");
|
|
return putDirect(key, Boolean.valueOf(z));
|
|
}
|
|
|
|
public final Builder putBooleanArray(String key, boolean[] value) {
|
|
Boolean[] convertPrimitiveArray;
|
|
Intrinsics.checkNotNullParameter(key, "key");
|
|
Intrinsics.checkNotNullParameter(value, "value");
|
|
Map<String, Object> map = this.values;
|
|
convertPrimitiveArray = Data_Kt.convertPrimitiveArray(value);
|
|
map.put(key, convertPrimitiveArray);
|
|
return this;
|
|
}
|
|
|
|
public final Builder putByte(String key, byte b) {
|
|
Intrinsics.checkNotNullParameter(key, "key");
|
|
return putDirect(key, Byte.valueOf(b));
|
|
}
|
|
|
|
public final Builder putByteArray(String key, byte[] value) {
|
|
Byte[] convertPrimitiveArray;
|
|
Intrinsics.checkNotNullParameter(key, "key");
|
|
Intrinsics.checkNotNullParameter(value, "value");
|
|
Map<String, Object> map = this.values;
|
|
convertPrimitiveArray = Data_Kt.convertPrimitiveArray(value);
|
|
map.put(key, convertPrimitiveArray);
|
|
return this;
|
|
}
|
|
|
|
public final Builder putInt(String key, int i) {
|
|
Intrinsics.checkNotNullParameter(key, "key");
|
|
return putDirect(key, Integer.valueOf(i));
|
|
}
|
|
|
|
public final Builder putIntArray(String key, int[] value) {
|
|
Integer[] convertPrimitiveArray;
|
|
Intrinsics.checkNotNullParameter(key, "key");
|
|
Intrinsics.checkNotNullParameter(value, "value");
|
|
Map<String, Object> map = this.values;
|
|
convertPrimitiveArray = Data_Kt.convertPrimitiveArray(value);
|
|
map.put(key, convertPrimitiveArray);
|
|
return this;
|
|
}
|
|
|
|
public final Builder putLong(String key, long j) {
|
|
Intrinsics.checkNotNullParameter(key, "key");
|
|
return putDirect(key, Long.valueOf(j));
|
|
}
|
|
|
|
public final Builder putLongArray(String key, long[] value) {
|
|
Long[] convertPrimitiveArray;
|
|
Intrinsics.checkNotNullParameter(key, "key");
|
|
Intrinsics.checkNotNullParameter(value, "value");
|
|
Map<String, Object> map = this.values;
|
|
convertPrimitiveArray = Data_Kt.convertPrimitiveArray(value);
|
|
map.put(key, convertPrimitiveArray);
|
|
return this;
|
|
}
|
|
|
|
public final Builder putFloat(String key, float f) {
|
|
Intrinsics.checkNotNullParameter(key, "key");
|
|
return putDirect(key, Float.valueOf(f));
|
|
}
|
|
|
|
public final Builder putFloatArray(String key, float[] value) {
|
|
Float[] convertPrimitiveArray;
|
|
Intrinsics.checkNotNullParameter(key, "key");
|
|
Intrinsics.checkNotNullParameter(value, "value");
|
|
Map<String, Object> map = this.values;
|
|
convertPrimitiveArray = Data_Kt.convertPrimitiveArray(value);
|
|
map.put(key, convertPrimitiveArray);
|
|
return this;
|
|
}
|
|
|
|
public final Builder putDouble(String key, double d) {
|
|
Intrinsics.checkNotNullParameter(key, "key");
|
|
return putDirect(key, Double.valueOf(d));
|
|
}
|
|
|
|
public final Builder putDoubleArray(String key, double[] value) {
|
|
Double[] convertPrimitiveArray;
|
|
Intrinsics.checkNotNullParameter(key, "key");
|
|
Intrinsics.checkNotNullParameter(value, "value");
|
|
Map<String, Object> map = this.values;
|
|
convertPrimitiveArray = Data_Kt.convertPrimitiveArray(value);
|
|
map.put(key, convertPrimitiveArray);
|
|
return this;
|
|
}
|
|
|
|
public final Builder putString(String key, String str) {
|
|
Intrinsics.checkNotNullParameter(key, "key");
|
|
return putDirect(key, str);
|
|
}
|
|
|
|
public final Builder putStringArray(String key, String[] value) {
|
|
Intrinsics.checkNotNullParameter(key, "key");
|
|
Intrinsics.checkNotNullParameter(value, "value");
|
|
return putDirect(key, value);
|
|
}
|
|
|
|
public final Builder putAll(Data data) {
|
|
Intrinsics.checkNotNullParameter(data, "data");
|
|
putAll(data.values);
|
|
return this;
|
|
}
|
|
|
|
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
|
|
public final Builder put(String key, Object obj) {
|
|
Intrinsics.checkNotNullParameter(key, "key");
|
|
Map<String, Object> map = this.values;
|
|
if (obj == null) {
|
|
obj = null;
|
|
} else {
|
|
KClass orCreateKotlinClass = Reflection.getOrCreateKotlinClass(obj.getClass());
|
|
if (!Intrinsics.areEqual(orCreateKotlinClass, Reflection.getOrCreateKotlinClass(Boolean.TYPE)) && !Intrinsics.areEqual(orCreateKotlinClass, Reflection.getOrCreateKotlinClass(Byte.TYPE)) && !Intrinsics.areEqual(orCreateKotlinClass, Reflection.getOrCreateKotlinClass(Integer.TYPE)) && !Intrinsics.areEqual(orCreateKotlinClass, Reflection.getOrCreateKotlinClass(Long.TYPE)) && !Intrinsics.areEqual(orCreateKotlinClass, Reflection.getOrCreateKotlinClass(Float.TYPE)) && !Intrinsics.areEqual(orCreateKotlinClass, Reflection.getOrCreateKotlinClass(Double.TYPE)) && !Intrinsics.areEqual(orCreateKotlinClass, Reflection.getOrCreateKotlinClass(String.class)) && !Intrinsics.areEqual(orCreateKotlinClass, Reflection.getOrCreateKotlinClass(Boolean[].class)) && !Intrinsics.areEqual(orCreateKotlinClass, Reflection.getOrCreateKotlinClass(Byte[].class)) && !Intrinsics.areEqual(orCreateKotlinClass, Reflection.getOrCreateKotlinClass(Integer[].class)) && !Intrinsics.areEqual(orCreateKotlinClass, Reflection.getOrCreateKotlinClass(Long[].class)) && !Intrinsics.areEqual(orCreateKotlinClass, Reflection.getOrCreateKotlinClass(Float[].class)) && !Intrinsics.areEqual(orCreateKotlinClass, Reflection.getOrCreateKotlinClass(Double[].class)) && !Intrinsics.areEqual(orCreateKotlinClass, Reflection.getOrCreateKotlinClass(String[].class))) {
|
|
if (Intrinsics.areEqual(orCreateKotlinClass, Reflection.getOrCreateKotlinClass(boolean[].class))) {
|
|
obj = Data_Kt.convertPrimitiveArray((boolean[]) obj);
|
|
} else if (Intrinsics.areEqual(orCreateKotlinClass, Reflection.getOrCreateKotlinClass(byte[].class))) {
|
|
obj = Data_Kt.convertPrimitiveArray((byte[]) obj);
|
|
} else if (Intrinsics.areEqual(orCreateKotlinClass, Reflection.getOrCreateKotlinClass(int[].class))) {
|
|
obj = Data_Kt.convertPrimitiveArray((int[]) obj);
|
|
} else if (Intrinsics.areEqual(orCreateKotlinClass, Reflection.getOrCreateKotlinClass(long[].class))) {
|
|
obj = Data_Kt.convertPrimitiveArray((long[]) obj);
|
|
} else if (Intrinsics.areEqual(orCreateKotlinClass, Reflection.getOrCreateKotlinClass(float[].class))) {
|
|
obj = Data_Kt.convertPrimitiveArray((float[]) obj);
|
|
} else if (Intrinsics.areEqual(orCreateKotlinClass, Reflection.getOrCreateKotlinClass(double[].class))) {
|
|
obj = Data_Kt.convertPrimitiveArray((double[]) obj);
|
|
} else {
|
|
throw new IllegalArgumentException("Key " + key + " has invalid type " + orCreateKotlinClass);
|
|
}
|
|
}
|
|
}
|
|
map.put(key, obj);
|
|
return this;
|
|
}
|
|
|
|
public final Data build() {
|
|
Data data = new Data((Map<String, ?>) this.values);
|
|
Data.Companion.toByteArrayInternalV1(data);
|
|
return data;
|
|
}
|
|
}
|
|
|
|
public final <T> boolean hasKeyWithValueOfType(String key, Class<T> klass) {
|
|
Intrinsics.checkNotNullParameter(key, "key");
|
|
Intrinsics.checkNotNullParameter(klass, "klass");
|
|
Object obj = this.values.get(key);
|
|
return obj != null && klass.isAssignableFrom(obj.getClass());
|
|
}
|
|
|
|
public final /* synthetic */ <T> boolean hasKey$work_runtime_release(String key) {
|
|
Intrinsics.checkNotNullParameter(key, "key");
|
|
Intrinsics.reifiedOperationMarker(4, RequestConfiguration.MAX_AD_CONTENT_RATING_T);
|
|
return hasKeyWithValueOfType(key, Object.class);
|
|
}
|
|
|
|
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
|
|
@VisibleForTesting
|
|
public final int size() {
|
|
return this.values.size();
|
|
}
|
|
|
|
/* JADX WARN: Removed duplicated region for block: B:31:0x0066 A[SYNTHETIC] */
|
|
/* JADX WARN: Removed duplicated region for block: B:32:0x002d A[SYNTHETIC] */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
public boolean equals(java.lang.Object r8) {
|
|
/*
|
|
r7 = this;
|
|
r0 = 1
|
|
if (r7 != r8) goto L4
|
|
return r0
|
|
L4:
|
|
r1 = 0
|
|
if (r8 == 0) goto L68
|
|
java.lang.Class r2 = r8.getClass()
|
|
java.lang.Class<androidx.work.Data> r3 = androidx.work.Data.class
|
|
boolean r2 = kotlin.jvm.internal.Intrinsics.areEqual(r3, r2)
|
|
if (r2 != 0) goto L14
|
|
goto L68
|
|
L14:
|
|
androidx.work.Data r8 = (androidx.work.Data) r8
|
|
java.util.Map<java.lang.String, java.lang.Object> r2 = r7.values
|
|
java.util.Set r2 = r2.keySet()
|
|
java.util.Map<java.lang.String, java.lang.Object> r3 = r8.values
|
|
java.util.Set r3 = r3.keySet()
|
|
boolean r3 = kotlin.jvm.internal.Intrinsics.areEqual(r2, r3)
|
|
if (r3 != 0) goto L29
|
|
return r1
|
|
L29:
|
|
java.util.Iterator r2 = r2.iterator()
|
|
L2d:
|
|
boolean r3 = r2.hasNext()
|
|
if (r3 == 0) goto L67
|
|
java.lang.Object r3 = r2.next()
|
|
java.lang.String r3 = (java.lang.String) r3
|
|
java.util.Map<java.lang.String, java.lang.Object> r4 = r7.values
|
|
java.lang.Object r4 = r4.get(r3)
|
|
java.util.Map<java.lang.String, java.lang.Object> r5 = r8.values
|
|
java.lang.Object r3 = r5.get(r3)
|
|
if (r4 == 0) goto L63
|
|
if (r3 != 0) goto L4a
|
|
goto L63
|
|
L4a:
|
|
boolean r5 = r4 instanceof java.lang.Object[]
|
|
if (r5 == 0) goto L5c
|
|
r5 = r4
|
|
java.lang.Object[] r5 = (java.lang.Object[]) r5
|
|
boolean r6 = r3 instanceof java.lang.Object[]
|
|
if (r6 == 0) goto L5c
|
|
java.lang.Object[] r3 = (java.lang.Object[]) r3
|
|
boolean r3 = kotlin.collections.ArraysKt.contentDeepEquals(r5, r3)
|
|
goto L60
|
|
L5c:
|
|
boolean r3 = kotlin.jvm.internal.Intrinsics.areEqual(r4, r3)
|
|
L60:
|
|
if (r3 != 0) goto L2d
|
|
goto L66
|
|
L63:
|
|
if (r4 != r3) goto L66
|
|
goto L2d
|
|
L66:
|
|
return r1
|
|
L67:
|
|
return r0
|
|
L68:
|
|
return r1
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: androidx.work.Data.equals(java.lang.Object):boolean");
|
|
}
|
|
|
|
public int hashCode() {
|
|
int hashCode;
|
|
int contentDeepHashCode;
|
|
int i = 0;
|
|
for (Map.Entry<String, Object> entry : this.values.entrySet()) {
|
|
Object value = entry.getValue();
|
|
if (value instanceof Object[]) {
|
|
int hashCode2 = Objects.hashCode(entry.getKey());
|
|
contentDeepHashCode = ArraysKt__ArraysJVMKt.contentDeepHashCode((Object[]) value);
|
|
hashCode = hashCode2 ^ contentDeepHashCode;
|
|
} else {
|
|
hashCode = entry.hashCode();
|
|
}
|
|
i += hashCode;
|
|
}
|
|
return i * 31;
|
|
}
|
|
|
|
public String toString() {
|
|
String joinToString$default;
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append("Data {");
|
|
joinToString$default = CollectionsKt___CollectionsKt.joinToString$default(this.values.entrySet(), null, null, null, 0, null, new Function1() { // from class: androidx.work.Data$toString$1$content$1
|
|
@Override // kotlin.jvm.functions.Function1
|
|
public final CharSequence invoke(Map.Entry<String, ? extends Object> entry) {
|
|
Intrinsics.checkNotNullParameter(entry, "<name for destructuring parameter 0>");
|
|
String key = entry.getKey();
|
|
Object value = entry.getValue();
|
|
StringBuilder sb2 = new StringBuilder();
|
|
sb2.append(key);
|
|
sb2.append(" : ");
|
|
if (value instanceof Object[]) {
|
|
value = Arrays.toString((Object[]) value);
|
|
Intrinsics.checkNotNullExpressionValue(value, "toString(this)");
|
|
}
|
|
sb2.append(value);
|
|
return sb2.toString();
|
|
}
|
|
}, 31, null);
|
|
sb.append(joinToString$default);
|
|
sb.append("}");
|
|
String sb2 = sb.toString();
|
|
Intrinsics.checkNotNullExpressionValue(sb2, "StringBuilder().apply(builderAction).toString()");
|
|
return sb2;
|
|
}
|
|
|
|
@SourceDebugExtension({"SMAP\nData_.kt\nKotlin\n*S Kotlin\n*F\n+ 1 Data_.kt\nandroidx/work/Data$Companion\n+ 2 LoggerExt.kt\nandroidx/work/LoggerExtKt\n+ 3 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,841:1\n32#2:842\n32#2:843\n32#2:845\n32#2:846\n1#3:844\n*S KotlinDebug\n*F\n+ 1 Data_.kt\nandroidx/work/Data$Companion\n*L\n599#1:842\n710#1:843\n814#1:845\n816#1:846\n*E\n"})
|
|
public static final class Companion {
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
|
|
private Companion() {
|
|
}
|
|
|
|
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
|
|
public final byte[] toByteArrayInternalV0(Data data) {
|
|
String str;
|
|
Intrinsics.checkNotNullParameter(data, "data");
|
|
try {
|
|
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
|
try {
|
|
ObjectOutputStream objectOutputStream = new ObjectOutputStream(byteArrayOutputStream);
|
|
try {
|
|
objectOutputStream.writeInt(data.size());
|
|
for (Map.Entry entry : data.values.entrySet()) {
|
|
String str2 = (String) entry.getKey();
|
|
Object value = entry.getValue();
|
|
objectOutputStream.writeUTF(str2);
|
|
objectOutputStream.writeObject(value);
|
|
}
|
|
Unit unit = Unit.INSTANCE;
|
|
CloseableKt.closeFinally(objectOutputStream, null);
|
|
CloseableKt.closeFinally(byteArrayOutputStream, null);
|
|
if (byteArrayOutputStream.size() > 10240) {
|
|
throw new IllegalStateException("Data cannot occupy more than 10240 bytes when serialized");
|
|
}
|
|
byte[] byteArray = byteArrayOutputStream.toByteArray();
|
|
Intrinsics.checkNotNullExpressionValue(byteArray, "{\n val st…ByteArray()\n }");
|
|
return byteArray;
|
|
} finally {
|
|
}
|
|
} finally {
|
|
}
|
|
} catch (IOException e) {
|
|
str = Data_Kt.TAG;
|
|
Logger.get().error(str, "Error in Data#toByteArray: ", e);
|
|
return new byte[0];
|
|
}
|
|
}
|
|
|
|
private static final void toByteArrayInternalV1$writeHeader(DataOutputStream dataOutputStream) {
|
|
dataOutputStream.writeShort(-21521);
|
|
dataOutputStream.writeShort(1);
|
|
}
|
|
|
|
private static final void toByteArrayInternalV1$writeArray(DataOutputStream dataOutputStream, Object[] objArr) {
|
|
int i;
|
|
KClass orCreateKotlinClass = Reflection.getOrCreateKotlinClass(objArr.getClass());
|
|
if (Intrinsics.areEqual(orCreateKotlinClass, Reflection.getOrCreateKotlinClass(Boolean[].class))) {
|
|
i = 8;
|
|
} else if (Intrinsics.areEqual(orCreateKotlinClass, Reflection.getOrCreateKotlinClass(Byte[].class))) {
|
|
i = 9;
|
|
} else if (Intrinsics.areEqual(orCreateKotlinClass, Reflection.getOrCreateKotlinClass(Integer[].class))) {
|
|
i = 10;
|
|
} else if (Intrinsics.areEqual(orCreateKotlinClass, Reflection.getOrCreateKotlinClass(Long[].class))) {
|
|
i = 11;
|
|
} else if (Intrinsics.areEqual(orCreateKotlinClass, Reflection.getOrCreateKotlinClass(Float[].class))) {
|
|
i = 12;
|
|
} else if (Intrinsics.areEqual(orCreateKotlinClass, Reflection.getOrCreateKotlinClass(Double[].class))) {
|
|
i = 13;
|
|
} else {
|
|
if (!Intrinsics.areEqual(orCreateKotlinClass, Reflection.getOrCreateKotlinClass(String[].class))) {
|
|
throw new IllegalArgumentException("Unsupported value type " + Reflection.getOrCreateKotlinClass(objArr.getClass()).getQualifiedName());
|
|
}
|
|
i = 14;
|
|
}
|
|
dataOutputStream.writeByte(i);
|
|
dataOutputStream.writeInt(objArr.length);
|
|
for (Object obj : objArr) {
|
|
if (i == 8) {
|
|
Boolean bool = obj instanceof Boolean ? (Boolean) obj : null;
|
|
dataOutputStream.writeBoolean(bool != null ? bool.booleanValue() : false);
|
|
} else if (i == 9) {
|
|
Byte b = obj instanceof Byte ? (Byte) obj : null;
|
|
dataOutputStream.writeByte(b != null ? b.byteValue() : (byte) 0);
|
|
} else if (i == 10) {
|
|
Integer num = obj instanceof Integer ? (Integer) obj : null;
|
|
dataOutputStream.writeInt(num != null ? num.intValue() : 0);
|
|
} else if (i == 11) {
|
|
Long l = obj instanceof Long ? (Long) obj : null;
|
|
dataOutputStream.writeLong(l != null ? l.longValue() : 0L);
|
|
} else if (i == 12) {
|
|
Float f = obj instanceof Float ? (Float) obj : null;
|
|
dataOutputStream.writeFloat(f != null ? f.floatValue() : 0.0f);
|
|
} else if (i == 13) {
|
|
Double d = obj instanceof Double ? (Double) obj : null;
|
|
dataOutputStream.writeDouble(d != null ? d.doubleValue() : 0.0d);
|
|
} else if (i == 14) {
|
|
String str = obj instanceof String ? (String) obj : null;
|
|
if (str == null) {
|
|
str = Data.NULL_STRING_V1;
|
|
}
|
|
dataOutputStream.writeUTF(str);
|
|
}
|
|
}
|
|
}
|
|
|
|
private static final void toByteArrayInternalV1$writeEntry(DataOutputStream dataOutputStream, String str, Object obj) {
|
|
if (obj == null) {
|
|
dataOutputStream.writeByte(0);
|
|
} else if (obj instanceof Boolean) {
|
|
dataOutputStream.writeByte(1);
|
|
dataOutputStream.writeBoolean(((Boolean) obj).booleanValue());
|
|
} else if (obj instanceof Byte) {
|
|
dataOutputStream.writeByte(2);
|
|
dataOutputStream.writeByte(((Number) obj).byteValue());
|
|
} else if (obj instanceof Integer) {
|
|
dataOutputStream.writeByte(3);
|
|
dataOutputStream.writeInt(((Number) obj).intValue());
|
|
} else if (obj instanceof Long) {
|
|
dataOutputStream.writeByte(4);
|
|
dataOutputStream.writeLong(((Number) obj).longValue());
|
|
} else if (obj instanceof Float) {
|
|
dataOutputStream.writeByte(5);
|
|
dataOutputStream.writeFloat(((Number) obj).floatValue());
|
|
} else if (obj instanceof Double) {
|
|
dataOutputStream.writeByte(6);
|
|
dataOutputStream.writeDouble(((Number) obj).doubleValue());
|
|
} else if (obj instanceof String) {
|
|
dataOutputStream.writeByte(7);
|
|
dataOutputStream.writeUTF((String) obj);
|
|
} else if (obj instanceof Object[]) {
|
|
toByteArrayInternalV1$writeArray(dataOutputStream, (Object[]) obj);
|
|
} else {
|
|
throw new IllegalArgumentException("Unsupported value type " + Reflection.getOrCreateKotlinClass(obj.getClass()).getSimpleName());
|
|
}
|
|
dataOutputStream.writeUTF(str);
|
|
}
|
|
|
|
@TypeConverter
|
|
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
|
|
public final byte[] toByteArrayInternalV1(Data data) {
|
|
String str;
|
|
Intrinsics.checkNotNullParameter(data, "data");
|
|
try {
|
|
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
|
DataOutputStream dataOutputStream = new DataOutputStream(byteArrayOutputStream);
|
|
try {
|
|
toByteArrayInternalV1$writeHeader(dataOutputStream);
|
|
dataOutputStream.writeInt(data.size());
|
|
for (Map.Entry entry : data.values.entrySet()) {
|
|
toByteArrayInternalV1$writeEntry(dataOutputStream, (String) entry.getKey(), entry.getValue());
|
|
}
|
|
dataOutputStream.flush();
|
|
if (dataOutputStream.size() > 10240) {
|
|
throw new IllegalStateException("Data cannot occupy more than 10240 bytes when serialized".toString());
|
|
}
|
|
byte[] byteArray = byteArrayOutputStream.toByteArray();
|
|
CloseableKt.closeFinally(dataOutputStream, null);
|
|
Intrinsics.checkNotNullExpressionValue(byteArray, "{\n ByteAr… }\n }");
|
|
return byteArray;
|
|
} finally {
|
|
}
|
|
} catch (IOException e) {
|
|
str = Data_Kt.TAG;
|
|
Logger.get().error(str, "Error in Data#toByteArray: ", e);
|
|
return new byte[0];
|
|
}
|
|
}
|
|
|
|
private static final boolean fromByteArray$isObjectStream(ByteArrayInputStream byteArrayInputStream) {
|
|
byte[] bArr = new byte[2];
|
|
byteArrayInputStream.read(bArr);
|
|
byte b = (byte) (-21267);
|
|
boolean z = false;
|
|
if (bArr[0] == ((byte) 16777132) && bArr[1] == b) {
|
|
z = true;
|
|
}
|
|
byteArrayInputStream.reset();
|
|
return z;
|
|
}
|
|
|
|
private static final void fromByteArray$readHeader(DataInputStream dataInputStream) {
|
|
short readShort = dataInputStream.readShort();
|
|
if (readShort != -21521) {
|
|
throw new IllegalStateException(("Magic number doesn't match: " + ((int) readShort)).toString());
|
|
}
|
|
short readShort2 = dataInputStream.readShort();
|
|
if (readShort2 == 1) {
|
|
return;
|
|
}
|
|
throw new IllegalStateException(("Unsupported version number: " + ((int) readShort2)).toString());
|
|
}
|
|
|
|
private static final Object fromByteArray$readValue(DataInputStream dataInputStream, byte b) {
|
|
if (b == 0) {
|
|
return null;
|
|
}
|
|
if (b == 1) {
|
|
return Boolean.valueOf(dataInputStream.readBoolean());
|
|
}
|
|
if (b == 2) {
|
|
return Byte.valueOf(dataInputStream.readByte());
|
|
}
|
|
if (b == 3) {
|
|
return Integer.valueOf(dataInputStream.readInt());
|
|
}
|
|
if (b == 4) {
|
|
return Long.valueOf(dataInputStream.readLong());
|
|
}
|
|
if (b == 5) {
|
|
return Float.valueOf(dataInputStream.readFloat());
|
|
}
|
|
if (b == 6) {
|
|
return Double.valueOf(dataInputStream.readDouble());
|
|
}
|
|
if (b == 7) {
|
|
return dataInputStream.readUTF();
|
|
}
|
|
int i = 0;
|
|
if (b == 8) {
|
|
int readInt = dataInputStream.readInt();
|
|
Boolean[] boolArr = new Boolean[readInt];
|
|
while (i < readInt) {
|
|
boolArr[i] = Boolean.valueOf(dataInputStream.readBoolean());
|
|
i++;
|
|
}
|
|
return boolArr;
|
|
}
|
|
if (b == 9) {
|
|
int readInt2 = dataInputStream.readInt();
|
|
Byte[] bArr = new Byte[readInt2];
|
|
while (i < readInt2) {
|
|
bArr[i] = Byte.valueOf(dataInputStream.readByte());
|
|
i++;
|
|
}
|
|
return bArr;
|
|
}
|
|
if (b == 10) {
|
|
int readInt3 = dataInputStream.readInt();
|
|
Integer[] numArr = new Integer[readInt3];
|
|
while (i < readInt3) {
|
|
numArr[i] = Integer.valueOf(dataInputStream.readInt());
|
|
i++;
|
|
}
|
|
return numArr;
|
|
}
|
|
if (b == 11) {
|
|
int readInt4 = dataInputStream.readInt();
|
|
Long[] lArr = new Long[readInt4];
|
|
while (i < readInt4) {
|
|
lArr[i] = Long.valueOf(dataInputStream.readLong());
|
|
i++;
|
|
}
|
|
return lArr;
|
|
}
|
|
if (b == 12) {
|
|
int readInt5 = dataInputStream.readInt();
|
|
Float[] fArr = new Float[readInt5];
|
|
while (i < readInt5) {
|
|
fArr[i] = Float.valueOf(dataInputStream.readFloat());
|
|
i++;
|
|
}
|
|
return fArr;
|
|
}
|
|
if (b == 13) {
|
|
int readInt6 = dataInputStream.readInt();
|
|
Double[] dArr = new Double[readInt6];
|
|
while (i < readInt6) {
|
|
dArr[i] = Double.valueOf(dataInputStream.readDouble());
|
|
i++;
|
|
}
|
|
return dArr;
|
|
}
|
|
if (b == 14) {
|
|
int readInt7 = dataInputStream.readInt();
|
|
String[] strArr = new String[readInt7];
|
|
while (i < readInt7) {
|
|
String readUTF = dataInputStream.readUTF();
|
|
if (Intrinsics.areEqual(readUTF, Data.NULL_STRING_V1)) {
|
|
readUTF = null;
|
|
}
|
|
strArr[i] = readUTF;
|
|
i++;
|
|
}
|
|
return strArr;
|
|
}
|
|
throw new IllegalStateException("Unsupported type " + ((int) b));
|
|
}
|
|
|
|
@TypeConverter
|
|
public final Data fromByteArray(byte[] bytes) {
|
|
String str;
|
|
String str2;
|
|
Intrinsics.checkNotNullParameter(bytes, "bytes");
|
|
if (bytes.length > 10240) {
|
|
throw new IllegalStateException("Data cannot occupy more than 10240 bytes when serialized".toString());
|
|
}
|
|
if (bytes.length == 0) {
|
|
return Data.EMPTY;
|
|
}
|
|
LinkedHashMap linkedHashMap = new LinkedHashMap();
|
|
try {
|
|
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes);
|
|
int i = 0;
|
|
if (fromByteArray$isObjectStream(byteArrayInputStream)) {
|
|
ObjectInputStream objectInputStream = new ObjectInputStream(byteArrayInputStream);
|
|
try {
|
|
int readInt = objectInputStream.readInt();
|
|
while (i < readInt) {
|
|
String readUTF = objectInputStream.readUTF();
|
|
Intrinsics.checkNotNullExpressionValue(readUTF, "readUTF()");
|
|
linkedHashMap.put(readUTF, objectInputStream.readObject());
|
|
i++;
|
|
}
|
|
CloseableKt.closeFinally(objectInputStream, null);
|
|
} finally {
|
|
}
|
|
} else {
|
|
DataInputStream dataInputStream = new DataInputStream(byteArrayInputStream);
|
|
try {
|
|
fromByteArray$readHeader(dataInputStream);
|
|
int readInt2 = dataInputStream.readInt();
|
|
while (i < readInt2) {
|
|
Object fromByteArray$readValue = fromByteArray$readValue(dataInputStream, dataInputStream.readByte());
|
|
String key = dataInputStream.readUTF();
|
|
Intrinsics.checkNotNullExpressionValue(key, "key");
|
|
linkedHashMap.put(key, fromByteArray$readValue);
|
|
i++;
|
|
}
|
|
CloseableKt.closeFinally(dataInputStream, null);
|
|
} finally {
|
|
}
|
|
}
|
|
} catch (IOException e) {
|
|
str2 = Data_Kt.TAG;
|
|
Logger.get().error(str2, "Error in Data#fromByteArray: ", e);
|
|
} catch (ClassNotFoundException e2) {
|
|
str = Data_Kt.TAG;
|
|
Logger.get().error(str, "Error in Data#fromByteArray: ", e2);
|
|
}
|
|
return new Data(linkedHashMap);
|
|
}
|
|
}
|
|
}
|