- 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
229 lines
7.8 KiB
Java
229 lines
7.8 KiB
Java
package com.tapjoy.internal;
|
|
|
|
import com.facebook.internal.security.CertificateUtil;
|
|
import com.ironsource.v8;
|
|
import java.io.Closeable;
|
|
import java.io.IOException;
|
|
import java.io.StringWriter;
|
|
import java.text.DateFormat;
|
|
import java.util.ArrayList;
|
|
import java.util.Collection;
|
|
import java.util.Date;
|
|
import java.util.Iterator;
|
|
import java.util.Map;
|
|
|
|
/* loaded from: classes4.dex */
|
|
public final class i0 implements Closeable {
|
|
public final StringWriter a;
|
|
public final ArrayList b;
|
|
public final String c;
|
|
|
|
public i0(StringWriter stringWriter) {
|
|
ArrayList arrayList = new ArrayList();
|
|
this.b = arrayList;
|
|
arrayList.add(f0.f);
|
|
this.c = CertificateUtil.DELIMITER;
|
|
this.a = stringWriter;
|
|
}
|
|
|
|
public final void a(boolean z) {
|
|
ArrayList arrayList = this.b;
|
|
int ordinal = ((f0) arrayList.get(arrayList.size() - 1)).ordinal();
|
|
if (ordinal == 0) {
|
|
f0 f0Var = f0.b;
|
|
ArrayList arrayList2 = this.b;
|
|
arrayList2.set(arrayList2.size() - 1, f0Var);
|
|
return;
|
|
}
|
|
if (ordinal == 1) {
|
|
this.a.append(',');
|
|
return;
|
|
}
|
|
if (ordinal == 3) {
|
|
this.a.append((CharSequence) this.c);
|
|
f0 f0Var2 = f0.e;
|
|
ArrayList arrayList3 = this.b;
|
|
arrayList3.set(arrayList3.size() - 1, f0Var2);
|
|
return;
|
|
}
|
|
if (ordinal != 5) {
|
|
if (ordinal == 6) {
|
|
throw new IllegalStateException("JSON must have only one top-level value.");
|
|
}
|
|
throw new IllegalStateException("Nesting problem: " + this.b);
|
|
}
|
|
if (!z) {
|
|
throw new IllegalStateException("JSON must start with an array or an object.");
|
|
}
|
|
f0 f0Var3 = f0.g;
|
|
ArrayList arrayList4 = this.b;
|
|
arrayList4.set(arrayList4.size() - 1, f0Var3);
|
|
}
|
|
|
|
@Override // java.io.Closeable, java.lang.AutoCloseable
|
|
public final void close() {
|
|
this.a.close();
|
|
if (((f0) this.b.get(r0.size() - 1)) != f0.g) {
|
|
throw new IOException("Incomplete document");
|
|
}
|
|
}
|
|
|
|
public final i0 a(f0 f0Var, f0 f0Var2, String str) {
|
|
f0 f0Var3 = (f0) this.b.get(r0.size() - 1);
|
|
if (f0Var3 != f0Var2 && f0Var3 != f0Var) {
|
|
throw new IllegalStateException("Nesting problem: " + this.b);
|
|
}
|
|
this.b.remove(r3.size() - 1);
|
|
this.a.write(str);
|
|
return this;
|
|
}
|
|
|
|
public final void a(Object obj) {
|
|
if (obj == null) {
|
|
a(false);
|
|
this.a.write("null");
|
|
return;
|
|
}
|
|
if (obj instanceof Boolean) {
|
|
boolean booleanValue = ((Boolean) obj).booleanValue();
|
|
a(false);
|
|
this.a.write(booleanValue ? "true" : "false");
|
|
return;
|
|
}
|
|
if (obj instanceof Number) {
|
|
if (obj instanceof Long) {
|
|
long longValue = ((Number) obj).longValue();
|
|
a(false);
|
|
this.a.write(Long.toString(longValue));
|
|
return;
|
|
}
|
|
if (obj instanceof Double) {
|
|
double doubleValue = ((Number) obj).doubleValue();
|
|
if (!Double.isNaN(doubleValue) && !Double.isInfinite(doubleValue)) {
|
|
a(false);
|
|
this.a.append((CharSequence) Double.toString(doubleValue));
|
|
return;
|
|
}
|
|
throw new IllegalArgumentException("Numeric values must be finite, but was " + doubleValue);
|
|
}
|
|
Number number = (Number) obj;
|
|
String obj2 = number.toString();
|
|
if (!obj2.equals("-Infinity") && !obj2.equals("Infinity") && !obj2.equals("NaN")) {
|
|
a(false);
|
|
this.a.append((CharSequence) obj2);
|
|
return;
|
|
}
|
|
throw new IllegalArgumentException("Numeric values must be finite, but was " + number);
|
|
}
|
|
if (obj instanceof String) {
|
|
a(false);
|
|
a((String) obj);
|
|
return;
|
|
}
|
|
if (!(obj instanceof a0)) {
|
|
if (obj instanceof Collection) {
|
|
f0 f0Var = f0.a;
|
|
a(true);
|
|
this.b.add(f0Var);
|
|
this.a.write(v8.i.d);
|
|
Iterator it = ((Collection) obj).iterator();
|
|
while (it.hasNext()) {
|
|
a(it.next());
|
|
}
|
|
a(f0.a, f0.b, v8.i.e);
|
|
return;
|
|
}
|
|
if (obj instanceof Map) {
|
|
f0 f0Var2 = f0.c;
|
|
a(true);
|
|
this.b.add(f0Var2);
|
|
this.a.write("{");
|
|
for (Map.Entry entry : ((Map) obj).entrySet()) {
|
|
String valueOf = String.valueOf(entry.getKey());
|
|
ArrayList arrayList = this.b;
|
|
f0 f0Var3 = (f0) arrayList.get(arrayList.size() - 1);
|
|
if (f0Var3 == f0.e) {
|
|
this.a.write(44);
|
|
} else if (f0Var3 != f0.c) {
|
|
throw new IllegalStateException("Nesting problem: " + this.b);
|
|
}
|
|
f0 f0Var4 = f0.d;
|
|
ArrayList arrayList2 = this.b;
|
|
arrayList2.set(arrayList2.size() - 1, f0Var4);
|
|
a(valueOf);
|
|
a(entry.getValue());
|
|
}
|
|
a(f0.c, f0.e, "}");
|
|
return;
|
|
}
|
|
if (obj instanceof Date) {
|
|
String format = ((DateFormat) q.a.get()).format((Date) obj);
|
|
if (format == null) {
|
|
a(false);
|
|
this.a.write("null");
|
|
return;
|
|
} else {
|
|
a(false);
|
|
a(format);
|
|
return;
|
|
}
|
|
}
|
|
if (obj instanceof Object[]) {
|
|
f0 f0Var5 = f0.a;
|
|
a(true);
|
|
this.b.add(f0Var5);
|
|
this.a.write(v8.i.d);
|
|
for (Object obj3 : (Object[]) obj) {
|
|
a(obj3);
|
|
}
|
|
a(f0.a, f0.b, v8.i.e);
|
|
return;
|
|
}
|
|
throw new IllegalArgumentException("Unknown type: ".concat(obj.getClass().getName()));
|
|
}
|
|
a(false);
|
|
throw null;
|
|
}
|
|
|
|
public final void a(String str) {
|
|
this.a.write("\"");
|
|
int length = str.length();
|
|
for (int i = 0; i < length; i++) {
|
|
char charAt = str.charAt(i);
|
|
if (charAt == '\f') {
|
|
this.a.write("\\f");
|
|
} else if (charAt == '\r') {
|
|
this.a.write("\\r");
|
|
} else if (charAt != '\"' && charAt != '\\') {
|
|
if (charAt == 8232 || charAt == 8233) {
|
|
this.a.write(String.format("\\u%04x", Integer.valueOf(charAt)));
|
|
} else {
|
|
switch (charAt) {
|
|
case '\b':
|
|
this.a.write("\\b");
|
|
break;
|
|
case '\t':
|
|
this.a.write("\\t");
|
|
break;
|
|
case '\n':
|
|
this.a.write("\\n");
|
|
break;
|
|
default:
|
|
if (charAt <= 31) {
|
|
this.a.write(String.format("\\u%04x", Integer.valueOf(charAt)));
|
|
break;
|
|
} else {
|
|
this.a.write(charAt);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
this.a.write(92);
|
|
this.a.write(charAt);
|
|
}
|
|
}
|
|
this.a.write("\"");
|
|
}
|
|
}
|