1282 lines
42 KiB
Java
1282 lines
42 KiB
Java
package com.google.gson.stream;
|
|
|
|
import c.i.d.q.p;
|
|
import java.io.Closeable;
|
|
import java.io.EOFException;
|
|
import java.io.IOException;
|
|
import java.io.Reader;
|
|
import java.util.Arrays;
|
|
import java.util.Objects;
|
|
public class JsonReader implements Closeable {
|
|
public static final char[] i = ")]}'\n".toCharArray();
|
|
public final Reader j;
|
|
public boolean k = false;
|
|
public final char[] l = new char[1024];
|
|
public int m = 0;
|
|
public int n = 0;
|
|
public int o = 0;
|
|
public int p = 0;
|
|
public int q = 0;
|
|
public long r;
|
|
|
|
/* renamed from: s reason: collision with root package name */
|
|
public int f2381s;
|
|
public String t;
|
|
public int[] u;
|
|
public int v;
|
|
public String[] w;
|
|
|
|
/* renamed from: x reason: collision with root package name */
|
|
public int[] f2382x;
|
|
|
|
public class a extends p {
|
|
}
|
|
|
|
static {
|
|
p.a = new a();
|
|
}
|
|
|
|
public JsonReader(Reader reader) {
|
|
int[] iArr = new int[32];
|
|
this.u = iArr;
|
|
this.v = 0;
|
|
this.v = 0 + 1;
|
|
iArr[0] = 6;
|
|
this.w = new String[32];
|
|
this.f2382x = new int[32];
|
|
Objects.requireNonNull(reader, "in == null");
|
|
this.j = reader;
|
|
}
|
|
|
|
public long B() throws IOException {
|
|
int i2 = this.q;
|
|
if (i2 == 0) {
|
|
i2 = d();
|
|
}
|
|
if (i2 == 15) {
|
|
this.q = 0;
|
|
int[] iArr = this.f2382x;
|
|
int i3 = this.v - 1;
|
|
iArr[i3] = iArr[i3] + 1;
|
|
return this.r;
|
|
}
|
|
if (i2 == 16) {
|
|
this.t = new String(this.l, this.m, this.f2381s);
|
|
this.m += this.f2381s;
|
|
} else if (i2 == 8 || i2 == 9 || i2 == 10) {
|
|
if (i2 == 10) {
|
|
this.t = M();
|
|
} else {
|
|
this.t = I(i2 == 8 ? '\'' : '\"');
|
|
}
|
|
try {
|
|
long parseLong = Long.parseLong(this.t);
|
|
this.q = 0;
|
|
int[] iArr2 = this.f2382x;
|
|
int i4 = this.v - 1;
|
|
iArr2[i4] = iArr2[i4] + 1;
|
|
return parseLong;
|
|
} catch (NumberFormatException unused) {
|
|
}
|
|
} else {
|
|
StringBuilder L = c.d.b.a.a.L("Expected a long but was ");
|
|
L.append(N());
|
|
L.append(t());
|
|
throw new IllegalStateException(L.toString());
|
|
}
|
|
this.q = 11;
|
|
double parseDouble = Double.parseDouble(this.t);
|
|
long j = (long) parseDouble;
|
|
if (((double) j) == parseDouble) {
|
|
this.t = null;
|
|
this.q = 0;
|
|
int[] iArr3 = this.f2382x;
|
|
int i5 = this.v - 1;
|
|
iArr3[i5] = iArr3[i5] + 1;
|
|
return j;
|
|
}
|
|
StringBuilder L2 = c.d.b.a.a.L("Expected a long but was ");
|
|
L2.append(this.t);
|
|
L2.append(t());
|
|
throw new NumberFormatException(L2.toString());
|
|
}
|
|
|
|
public String C() throws IOException {
|
|
String str;
|
|
int i2 = this.q;
|
|
if (i2 == 0) {
|
|
i2 = d();
|
|
}
|
|
if (i2 == 14) {
|
|
str = M();
|
|
} else if (i2 == 12) {
|
|
str = I('\'');
|
|
} else if (i2 == 13) {
|
|
str = I('\"');
|
|
} else {
|
|
StringBuilder L = c.d.b.a.a.L("Expected a name but was ");
|
|
L.append(N());
|
|
L.append(t());
|
|
throw new IllegalStateException(L.toString());
|
|
}
|
|
this.q = 0;
|
|
this.w[this.v - 1] = str;
|
|
return str;
|
|
}
|
|
|
|
public final int G(boolean z2) throws IOException {
|
|
char[] cArr = this.l;
|
|
int i2 = this.m;
|
|
int i3 = this.n;
|
|
while (true) {
|
|
boolean z3 = true;
|
|
if (i2 == i3) {
|
|
this.m = i2;
|
|
if (p(1)) {
|
|
i2 = this.m;
|
|
i3 = this.n;
|
|
} else if (!z2) {
|
|
return -1;
|
|
} else {
|
|
StringBuilder L = c.d.b.a.a.L("End of input");
|
|
L.append(t());
|
|
throw new EOFException(L.toString());
|
|
}
|
|
}
|
|
int i4 = i2 + 1;
|
|
char c2 = cArr[i2];
|
|
if (c2 == '\n') {
|
|
this.o++;
|
|
this.p = i4;
|
|
} else if (!(c2 == ' ' || c2 == '\r' || c2 == '\t')) {
|
|
if (c2 == '/') {
|
|
this.m = i4;
|
|
if (i4 == i3) {
|
|
this.m = i4 - 1;
|
|
boolean p = p(2);
|
|
this.m++;
|
|
if (!p) {
|
|
return c2;
|
|
}
|
|
}
|
|
c();
|
|
int i5 = this.m;
|
|
char c3 = cArr[i5];
|
|
if (c3 == '*') {
|
|
this.m = i5 + 1;
|
|
while (true) {
|
|
if (this.m + 2 > this.n && !p(2)) {
|
|
z3 = false;
|
|
break;
|
|
}
|
|
char[] cArr2 = this.l;
|
|
int i6 = this.m;
|
|
if (cArr2[i6] != '\n') {
|
|
for (int i7 = 0; i7 < 2; i7++) {
|
|
if (this.l[this.m + i7] == "*/".charAt(i7)) {
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
this.o++;
|
|
this.p = i6 + 1;
|
|
this.m++;
|
|
}
|
|
if (z3) {
|
|
i2 = this.m + 2;
|
|
i3 = this.n;
|
|
} else {
|
|
V("Unterminated comment");
|
|
throw null;
|
|
}
|
|
} else if (c3 != '/') {
|
|
return c2;
|
|
} else {
|
|
this.m = i5 + 1;
|
|
T();
|
|
i2 = this.m;
|
|
i3 = this.n;
|
|
}
|
|
} else if (c2 == '#') {
|
|
this.m = i4;
|
|
c();
|
|
T();
|
|
i2 = this.m;
|
|
i3 = this.n;
|
|
} else {
|
|
this.m = i4;
|
|
return c2;
|
|
}
|
|
}
|
|
i2 = i4;
|
|
}
|
|
}
|
|
|
|
public void H() throws IOException {
|
|
int i2 = this.q;
|
|
if (i2 == 0) {
|
|
i2 = d();
|
|
}
|
|
if (i2 == 7) {
|
|
this.q = 0;
|
|
int[] iArr = this.f2382x;
|
|
int i3 = this.v - 1;
|
|
iArr[i3] = iArr[i3] + 1;
|
|
return;
|
|
}
|
|
StringBuilder L = c.d.b.a.a.L("Expected null but was ");
|
|
L.append(N());
|
|
L.append(t());
|
|
throw new IllegalStateException(L.toString());
|
|
}
|
|
|
|
/* JADX WARNING: Code restructure failed: missing block: B:23:0x005d, code lost:
|
|
if (r2 != null) goto L_0x006d;
|
|
*/
|
|
/* JADX WARNING: Code restructure failed: missing block: B:24:0x005f, code lost:
|
|
r2 = new java.lang.StringBuilder(java.lang.Math.max((r3 - r3) * 2, 16));
|
|
*/
|
|
/* JADX WARNING: Code restructure failed: missing block: B:25:0x006d, code lost:
|
|
r2.append(r0, r3, r3 - r3);
|
|
r10.m = r3;
|
|
*/
|
|
public final String I(char c2) throws IOException {
|
|
char[] cArr = this.l;
|
|
StringBuilder sb = null;
|
|
do {
|
|
int i2 = this.m;
|
|
int i3 = this.n;
|
|
while (true) {
|
|
while (i2 < i3) {
|
|
int i4 = i2 + 1;
|
|
char c3 = cArr[i2];
|
|
if (c3 == c2) {
|
|
this.m = i4;
|
|
int i5 = (i4 - i2) - 1;
|
|
if (sb == null) {
|
|
return new String(cArr, i2, i5);
|
|
}
|
|
sb.append(cArr, i2, i5);
|
|
return sb.toString();
|
|
} else if (c3 == '\\') {
|
|
this.m = i4;
|
|
int i6 = (i4 - i2) - 1;
|
|
if (sb == null) {
|
|
sb = new StringBuilder(Math.max((i6 + 1) * 2, 16));
|
|
}
|
|
sb.append(cArr, i2, i6);
|
|
sb.append(R());
|
|
i2 = this.m;
|
|
i3 = this.n;
|
|
} else {
|
|
if (c3 == '\n') {
|
|
this.o++;
|
|
this.p = i4;
|
|
}
|
|
i2 = i4;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
} while (p(1));
|
|
V("Unterminated string");
|
|
throw null;
|
|
}
|
|
|
|
public String K() throws IOException {
|
|
String str;
|
|
int i2 = this.q;
|
|
if (i2 == 0) {
|
|
i2 = d();
|
|
}
|
|
if (i2 == 10) {
|
|
str = M();
|
|
} else if (i2 == 8) {
|
|
str = I('\'');
|
|
} else if (i2 == 9) {
|
|
str = I('\"');
|
|
} else if (i2 == 11) {
|
|
str = this.t;
|
|
this.t = null;
|
|
} else if (i2 == 15) {
|
|
str = Long.toString(this.r);
|
|
} else if (i2 == 16) {
|
|
str = new String(this.l, this.m, this.f2381s);
|
|
this.m += this.f2381s;
|
|
} else {
|
|
StringBuilder L = c.d.b.a.a.L("Expected a string but was ");
|
|
L.append(N());
|
|
L.append(t());
|
|
throw new IllegalStateException(L.toString());
|
|
}
|
|
this.q = 0;
|
|
int[] iArr = this.f2382x;
|
|
int i3 = this.v - 1;
|
|
iArr[i3] = iArr[i3] + 1;
|
|
return str;
|
|
}
|
|
|
|
/* JADX WARNING: Code restructure failed: missing block: B:32:0x004a, code lost:
|
|
c();
|
|
*/
|
|
public final String M() throws IOException {
|
|
int i2;
|
|
String str;
|
|
int i3 = 0;
|
|
StringBuilder sb = null;
|
|
while (true) {
|
|
i2 = 0;
|
|
while (true) {
|
|
int i4 = this.m;
|
|
if (i4 + i2 < this.n) {
|
|
char c2 = this.l[i4 + i2];
|
|
if (!(c2 == '\t' || c2 == '\n' || c2 == '\f' || c2 == '\r' || c2 == ' ')) {
|
|
if (c2 != '#') {
|
|
if (c2 != ',') {
|
|
if (!(c2 == '/' || c2 == '=')) {
|
|
if (!(c2 == '{' || c2 == '}' || c2 == ':')) {
|
|
if (c2 != ';') {
|
|
switch (c2) {
|
|
case '[':
|
|
case ']':
|
|
break;
|
|
case '\\':
|
|
break;
|
|
default:
|
|
i2++;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else if (i2 >= this.l.length) {
|
|
if (sb == null) {
|
|
sb = new StringBuilder(Math.max(i2, 16));
|
|
}
|
|
sb.append(this.l, this.m, i2);
|
|
this.m += i2;
|
|
if (!p(1)) {
|
|
}
|
|
} else if (p(i2 + 1)) {
|
|
}
|
|
}
|
|
}
|
|
i3 = i2;
|
|
if (sb == null) {
|
|
str = new String(this.l, this.m, i3);
|
|
} else {
|
|
sb.append(this.l, this.m, i3);
|
|
str = sb.toString();
|
|
}
|
|
this.m += i3;
|
|
return str;
|
|
}
|
|
|
|
public JsonToken N() throws IOException {
|
|
int i2 = this.q;
|
|
if (i2 == 0) {
|
|
i2 = d();
|
|
}
|
|
switch (i2) {
|
|
case 1:
|
|
return JsonToken.BEGIN_OBJECT;
|
|
case 2:
|
|
return JsonToken.END_OBJECT;
|
|
case 3:
|
|
return JsonToken.BEGIN_ARRAY;
|
|
case 4:
|
|
return JsonToken.END_ARRAY;
|
|
case 5:
|
|
case 6:
|
|
return JsonToken.BOOLEAN;
|
|
case 7:
|
|
return JsonToken.NULL;
|
|
case 8:
|
|
case 9:
|
|
case 10:
|
|
case 11:
|
|
return JsonToken.STRING;
|
|
case 12:
|
|
case 13:
|
|
case 14:
|
|
return JsonToken.NAME;
|
|
case 15:
|
|
case 16:
|
|
return JsonToken.NUMBER;
|
|
case 17:
|
|
return JsonToken.END_DOCUMENT;
|
|
default:
|
|
throw new AssertionError();
|
|
}
|
|
}
|
|
|
|
public final void Q(int i2) {
|
|
int i3 = this.v;
|
|
int[] iArr = this.u;
|
|
if (i3 == iArr.length) {
|
|
int i4 = i3 * 2;
|
|
this.u = Arrays.copyOf(iArr, i4);
|
|
this.f2382x = Arrays.copyOf(this.f2382x, i4);
|
|
this.w = (String[]) Arrays.copyOf(this.w, i4);
|
|
}
|
|
int[] iArr2 = this.u;
|
|
int i5 = this.v;
|
|
this.v = i5 + 1;
|
|
iArr2[i5] = i2;
|
|
}
|
|
|
|
public final char R() throws IOException {
|
|
int i2;
|
|
int i3;
|
|
if (this.m != this.n || p(1)) {
|
|
char[] cArr = this.l;
|
|
int i4 = this.m;
|
|
int i5 = i4 + 1;
|
|
this.m = i5;
|
|
char c2 = cArr[i4];
|
|
if (c2 == '\n') {
|
|
this.o++;
|
|
this.p = i5;
|
|
} else if (!(c2 == '\"' || c2 == '\'' || c2 == '/' || c2 == '\\')) {
|
|
if (c2 == 'b') {
|
|
return '\b';
|
|
}
|
|
if (c2 == 'f') {
|
|
return '\f';
|
|
}
|
|
if (c2 == 'n') {
|
|
return '\n';
|
|
}
|
|
if (c2 == 'r') {
|
|
return '\r';
|
|
}
|
|
if (c2 == 't') {
|
|
return '\t';
|
|
}
|
|
if (c2 != 'u') {
|
|
V("Invalid escape sequence");
|
|
throw null;
|
|
} else if (i5 + 4 <= this.n || p(4)) {
|
|
char c3 = 0;
|
|
int i6 = this.m;
|
|
int i7 = i6 + 4;
|
|
while (i6 < i7) {
|
|
char c4 = this.l[i6];
|
|
char c5 = (char) (c3 << 4);
|
|
if (c4 < '0' || c4 > '9') {
|
|
if (c4 >= 'a' && c4 <= 'f') {
|
|
i3 = c4 - 'a';
|
|
} else if (c4 < 'A' || c4 > 'F') {
|
|
StringBuilder L = c.d.b.a.a.L("\\u");
|
|
L.append(new String(this.l, this.m, 4));
|
|
throw new NumberFormatException(L.toString());
|
|
} else {
|
|
i3 = c4 - 'A';
|
|
}
|
|
i2 = i3 + 10;
|
|
} else {
|
|
i2 = c4 - '0';
|
|
}
|
|
c3 = (char) (i2 + c5);
|
|
i6++;
|
|
}
|
|
this.m += 4;
|
|
return c3;
|
|
} else {
|
|
V("Unterminated escape sequence");
|
|
throw null;
|
|
}
|
|
}
|
|
return c2;
|
|
}
|
|
V("Unterminated escape sequence");
|
|
throw null;
|
|
}
|
|
|
|
public final void S(char c2) throws IOException {
|
|
char[] cArr = this.l;
|
|
do {
|
|
int i2 = this.m;
|
|
int i3 = this.n;
|
|
while (i2 < i3) {
|
|
int i4 = i2 + 1;
|
|
char c3 = cArr[i2];
|
|
if (c3 == c2) {
|
|
this.m = i4;
|
|
return;
|
|
} else if (c3 == '\\') {
|
|
this.m = i4;
|
|
R();
|
|
i2 = this.m;
|
|
i3 = this.n;
|
|
} else {
|
|
if (c3 == '\n') {
|
|
this.o++;
|
|
this.p = i4;
|
|
}
|
|
i2 = i4;
|
|
}
|
|
}
|
|
this.m = i2;
|
|
} while (p(1));
|
|
V("Unterminated string");
|
|
throw null;
|
|
}
|
|
|
|
public final void T() throws IOException {
|
|
char c2;
|
|
do {
|
|
if (this.m < this.n || p(1)) {
|
|
char[] cArr = this.l;
|
|
int i2 = this.m;
|
|
int i3 = i2 + 1;
|
|
this.m = i3;
|
|
c2 = cArr[i2];
|
|
if (c2 == '\n') {
|
|
this.o++;
|
|
this.p = i3;
|
|
return;
|
|
}
|
|
} else {
|
|
return;
|
|
}
|
|
} while (c2 != '\r');
|
|
}
|
|
|
|
public void U() throws IOException {
|
|
int i2;
|
|
int i3 = 0;
|
|
do {
|
|
int i4 = this.q;
|
|
if (i4 == 0) {
|
|
i4 = d();
|
|
}
|
|
if (i4 == 3) {
|
|
Q(1);
|
|
} else if (i4 == 1) {
|
|
Q(3);
|
|
} else {
|
|
if (i4 == 4) {
|
|
this.v--;
|
|
} else if (i4 == 2) {
|
|
this.v--;
|
|
} else if (i4 == 14 || i4 == 10) {
|
|
while (true) {
|
|
i2 = 0;
|
|
while (true) {
|
|
int i5 = this.m + i2;
|
|
if (i5 < this.n) {
|
|
char c2 = this.l[i5];
|
|
if (!(c2 == '\t' || c2 == '\n' || c2 == '\f' || c2 == '\r' || c2 == ' ')) {
|
|
if (c2 != '#') {
|
|
if (c2 != ',') {
|
|
if (!(c2 == '/' || c2 == '=')) {
|
|
if (!(c2 == '{' || c2 == '}' || c2 == ':')) {
|
|
if (c2 != ';') {
|
|
switch (c2) {
|
|
case '[':
|
|
case ']':
|
|
break;
|
|
case '\\':
|
|
break;
|
|
default:
|
|
i2++;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
this.m = i5;
|
|
if (!p(1)) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
c();
|
|
this.m += i2;
|
|
this.q = 0;
|
|
} else if (i4 == 8 || i4 == 12) {
|
|
S('\'');
|
|
this.q = 0;
|
|
} else if (i4 == 9 || i4 == 13) {
|
|
S('\"');
|
|
this.q = 0;
|
|
} else {
|
|
if (i4 == 16) {
|
|
this.m += this.f2381s;
|
|
}
|
|
this.q = 0;
|
|
}
|
|
i3--;
|
|
this.q = 0;
|
|
}
|
|
i3++;
|
|
this.q = 0;
|
|
} while (i3 != 0);
|
|
int[] iArr = this.f2382x;
|
|
int i6 = this.v;
|
|
int i7 = i6 - 1;
|
|
iArr[i7] = iArr[i7] + 1;
|
|
this.w[i6 - 1] = "null";
|
|
}
|
|
|
|
public final IOException V(String str) throws IOException {
|
|
StringBuilder L = c.d.b.a.a.L(str);
|
|
L.append(t());
|
|
throw new MalformedJsonException(L.toString());
|
|
}
|
|
|
|
public void a() throws IOException {
|
|
int i2 = this.q;
|
|
if (i2 == 0) {
|
|
i2 = d();
|
|
}
|
|
if (i2 == 3) {
|
|
Q(1);
|
|
this.f2382x[this.v - 1] = 0;
|
|
this.q = 0;
|
|
return;
|
|
}
|
|
StringBuilder L = c.d.b.a.a.L("Expected BEGIN_ARRAY but was ");
|
|
L.append(N());
|
|
L.append(t());
|
|
throw new IllegalStateException(L.toString());
|
|
}
|
|
|
|
public void b() throws IOException {
|
|
int i2 = this.q;
|
|
if (i2 == 0) {
|
|
i2 = d();
|
|
}
|
|
if (i2 == 1) {
|
|
Q(3);
|
|
this.q = 0;
|
|
return;
|
|
}
|
|
StringBuilder L = c.d.b.a.a.L("Expected BEGIN_OBJECT but was ");
|
|
L.append(N());
|
|
L.append(t());
|
|
throw new IllegalStateException(L.toString());
|
|
}
|
|
|
|
public final void c() throws IOException {
|
|
if (!this.k) {
|
|
V("Use JsonReader.setLenient(true) to accept malformed JSON");
|
|
throw null;
|
|
}
|
|
}
|
|
|
|
@Override // java.io.Closeable, java.lang.AutoCloseable
|
|
public void close() throws IOException {
|
|
this.q = 0;
|
|
this.u[0] = 8;
|
|
this.v = 1;
|
|
this.j.close();
|
|
}
|
|
|
|
/* JADX WARNING: Code restructure failed: missing block: B:144:0x0203, code lost:
|
|
if (s(r6) != false) goto L_0x018a;
|
|
*/
|
|
/* JADX WARNING: Code restructure failed: missing block: B:145:0x0205, code lost:
|
|
if (r13 != 2) goto L_0x0229;
|
|
*/
|
|
/* JADX WARNING: Code restructure failed: missing block: B:146:0x0207, code lost:
|
|
if (r15 == false) goto L_0x0229;
|
|
*/
|
|
/* JADX WARNING: Code restructure failed: missing block: B:148:0x020d, code lost:
|
|
if (r10 != Long.MIN_VALUE) goto L_0x0211;
|
|
*/
|
|
/* JADX WARNING: Code restructure failed: missing block: B:149:0x020f, code lost:
|
|
if (r16 == false) goto L_0x0229;
|
|
*/
|
|
/* JADX WARNING: Code restructure failed: missing block: B:151:0x0215, code lost:
|
|
if (r10 != 0) goto L_0x0219;
|
|
*/
|
|
/* JADX WARNING: Code restructure failed: missing block: B:152:0x0217, code lost:
|
|
if (r16 != false) goto L_0x0229;
|
|
*/
|
|
/* JADX WARNING: Code restructure failed: missing block: B:153:0x0219, code lost:
|
|
if (r16 == false) goto L_0x021c;
|
|
*/
|
|
/* JADX WARNING: Code restructure failed: missing block: B:154:0x021c, code lost:
|
|
r10 = -r10;
|
|
*/
|
|
/* JADX WARNING: Code restructure failed: missing block: B:155:0x021d, code lost:
|
|
r19.r = r10;
|
|
r19.m += r9;
|
|
r6 = 15;
|
|
r19.q = 15;
|
|
*/
|
|
/* JADX WARNING: Code restructure failed: missing block: B:156:0x0229, code lost:
|
|
if (r13 == 2) goto L_0x0231;
|
|
*/
|
|
/* JADX WARNING: Code restructure failed: missing block: B:158:0x022c, code lost:
|
|
if (r13 == 4) goto L_0x0231;
|
|
*/
|
|
/* JADX WARNING: Code restructure failed: missing block: B:160:0x022f, code lost:
|
|
if (r13 != 7) goto L_0x018a;
|
|
*/
|
|
/* JADX WARNING: Code restructure failed: missing block: B:161:0x0231, code lost:
|
|
r19.f2381s = r9;
|
|
r6 = 16;
|
|
r19.q = 16;
|
|
*/
|
|
/* JADX WARNING: Removed duplicated region for block: B:98:0x0174 A[RETURN] */
|
|
/* JADX WARNING: Removed duplicated region for block: B:99:0x0175 */
|
|
public int d() throws IOException {
|
|
int i2;
|
|
long j;
|
|
String str;
|
|
String str2;
|
|
char c2;
|
|
int G;
|
|
int[] iArr = this.u;
|
|
int i3 = this.v;
|
|
int i4 = iArr[i3 - 1];
|
|
if (i4 == 1) {
|
|
iArr[i3 - 1] = 2;
|
|
} else if (i4 == 2) {
|
|
int G2 = G(true);
|
|
if (G2 != 44) {
|
|
if (G2 == 59) {
|
|
c();
|
|
} else if (G2 == 93) {
|
|
this.q = 4;
|
|
return 4;
|
|
} else {
|
|
V("Unterminated array");
|
|
throw null;
|
|
}
|
|
}
|
|
} else if (i4 == 3 || i4 == 5) {
|
|
iArr[i3 - 1] = 4;
|
|
if (i4 == 5 && (G = G(true)) != 44) {
|
|
if (G == 59) {
|
|
c();
|
|
} else if (G == 125) {
|
|
this.q = 2;
|
|
return 2;
|
|
} else {
|
|
V("Unterminated object");
|
|
throw null;
|
|
}
|
|
}
|
|
int G3 = G(true);
|
|
if (G3 == 34) {
|
|
this.q = 13;
|
|
return 13;
|
|
} else if (G3 == 39) {
|
|
c();
|
|
this.q = 12;
|
|
return 12;
|
|
} else if (G3 != 125) {
|
|
c();
|
|
this.m--;
|
|
if (s((char) G3)) {
|
|
this.q = 14;
|
|
return 14;
|
|
}
|
|
V("Expected name");
|
|
throw null;
|
|
} else if (i4 != 5) {
|
|
this.q = 2;
|
|
return 2;
|
|
} else {
|
|
V("Expected name");
|
|
throw null;
|
|
}
|
|
} else if (i4 == 4) {
|
|
iArr[i3 - 1] = 5;
|
|
int G4 = G(true);
|
|
if (G4 != 58) {
|
|
if (G4 == 61) {
|
|
c();
|
|
if (this.m < this.n || p(1)) {
|
|
char[] cArr = this.l;
|
|
int i5 = this.m;
|
|
if (cArr[i5] == '>') {
|
|
this.m = i5 + 1;
|
|
}
|
|
}
|
|
} else {
|
|
V("Expected ':'");
|
|
throw null;
|
|
}
|
|
}
|
|
} else if (i4 == 6) {
|
|
if (this.k) {
|
|
G(true);
|
|
int i6 = this.m - 1;
|
|
this.m = i6;
|
|
char[] cArr2 = i;
|
|
if (i6 + cArr2.length <= this.n || p(cArr2.length)) {
|
|
int i7 = 0;
|
|
while (true) {
|
|
char[] cArr3 = i;
|
|
if (i7 >= cArr3.length) {
|
|
this.m += cArr3.length;
|
|
break;
|
|
} else if (this.l[this.m + i7] != cArr3[i7]) {
|
|
break;
|
|
} else {
|
|
i7++;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
this.u[this.v - 1] = 7;
|
|
} else if (i4 == 7) {
|
|
if (G(false) == -1) {
|
|
this.q = 17;
|
|
return 17;
|
|
}
|
|
c();
|
|
this.m--;
|
|
} else if (i4 == 8) {
|
|
throw new IllegalStateException("JsonReader is closed");
|
|
}
|
|
int G5 = G(true);
|
|
if (G5 == 34) {
|
|
this.q = 9;
|
|
return 9;
|
|
} else if (G5 != 39) {
|
|
if (!(G5 == 44 || G5 == 59)) {
|
|
if (G5 == 91) {
|
|
this.q = 3;
|
|
return 3;
|
|
} else if (G5 != 93) {
|
|
if (G5 != 123) {
|
|
int i8 = this.m - 1;
|
|
this.m = i8;
|
|
char c3 = this.l[i8];
|
|
if (c3 == 't' || c3 == 'T') {
|
|
str2 = "true";
|
|
str = "TRUE";
|
|
i2 = 5;
|
|
} else if (c3 == 'f' || c3 == 'F') {
|
|
str2 = "false";
|
|
str = "FALSE";
|
|
i2 = 6;
|
|
} else {
|
|
if (c3 == 'n' || c3 == 'N') {
|
|
str2 = "null";
|
|
str = "NULL";
|
|
i2 = 7;
|
|
}
|
|
i2 = 0;
|
|
if (i2 == 0) {
|
|
return i2;
|
|
}
|
|
char[] cArr4 = this.l;
|
|
int i9 = this.m;
|
|
int i10 = this.n;
|
|
long j2 = 0;
|
|
long j3 = 0;
|
|
int i11 = 0;
|
|
char c4 = 0;
|
|
boolean z2 = true;
|
|
boolean z3 = false;
|
|
while (true) {
|
|
if (i9 + i11 == i10) {
|
|
if (i11 == cArr4.length) {
|
|
break;
|
|
} else if (!p(i11 + 1)) {
|
|
break;
|
|
} else {
|
|
i9 = this.m;
|
|
i10 = this.n;
|
|
}
|
|
}
|
|
char c5 = cArr4[i9 + i11];
|
|
if (c5 != '+') {
|
|
if (c5 != 'E' && c5 != 'e') {
|
|
if (c5 != '-') {
|
|
if (c5 == '.') {
|
|
j = j2;
|
|
if (c4 != 2) {
|
|
break;
|
|
}
|
|
c4 = 3;
|
|
i11++;
|
|
j2 = j;
|
|
} else if (c5 < '0' || c5 > '9') {
|
|
break;
|
|
} else {
|
|
if (c4 == 1 || c4 == 0) {
|
|
j3 = (long) (-(c5 - '0'));
|
|
c4 = 2;
|
|
} else if (c4 == 2) {
|
|
if (j3 == j2) {
|
|
break;
|
|
}
|
|
long j4 = (10 * j3) - ((long) (c5 - '0'));
|
|
int i12 = (j3 > -922337203685477580L ? 1 : (j3 == -922337203685477580L ? 0 : -1));
|
|
z2 &= i12 > 0 || (i12 == 0 && j4 < j3);
|
|
j3 = j4;
|
|
} else if (c4 == 3) {
|
|
c4 = 4;
|
|
} else if (c4 == 5 || c4 == 6) {
|
|
c4 = 7;
|
|
}
|
|
j = 0;
|
|
i11++;
|
|
j2 = j;
|
|
}
|
|
} else {
|
|
j = j2;
|
|
if (c4 != 0) {
|
|
if (c4 != 5) {
|
|
break;
|
|
}
|
|
} else {
|
|
c4 = 1;
|
|
z3 = true;
|
|
i11++;
|
|
j2 = j;
|
|
}
|
|
}
|
|
} else {
|
|
j = j2;
|
|
if (c4 != 2 && c4 != 4) {
|
|
break;
|
|
}
|
|
c4 = 5;
|
|
i11++;
|
|
j2 = j;
|
|
}
|
|
} else {
|
|
j = j2;
|
|
if (c4 != 5) {
|
|
break;
|
|
}
|
|
}
|
|
c4 = 6;
|
|
i11++;
|
|
j2 = j;
|
|
}
|
|
int i13 = 0;
|
|
if (i13 != 0) {
|
|
return i13;
|
|
}
|
|
if (s(this.l[this.m])) {
|
|
c();
|
|
this.q = 10;
|
|
return 10;
|
|
}
|
|
V("Expected value");
|
|
throw null;
|
|
}
|
|
int length = str2.length();
|
|
int i14 = 1;
|
|
while (true) {
|
|
if (i14 < length) {
|
|
if ((this.m + i14 >= this.n && !p(i14 + 1)) || ((c2 = this.l[this.m + i14]) != str2.charAt(i14) && c2 != str.charAt(i14))) {
|
|
break;
|
|
}
|
|
i14++;
|
|
} else if ((this.m + length >= this.n && !p(length + 1)) || !s(this.l[this.m + length])) {
|
|
this.m += length;
|
|
this.q = i2;
|
|
}
|
|
}
|
|
i2 = 0;
|
|
if (i2 == 0) {
|
|
}
|
|
} else {
|
|
this.q = 1;
|
|
return 1;
|
|
}
|
|
} else if (i4 == 1) {
|
|
this.q = 4;
|
|
return 4;
|
|
}
|
|
}
|
|
if (i4 == 1 || i4 == 2) {
|
|
c();
|
|
this.m--;
|
|
this.q = 7;
|
|
return 7;
|
|
}
|
|
V("Unexpected value");
|
|
throw null;
|
|
} else {
|
|
c();
|
|
this.q = 8;
|
|
return 8;
|
|
}
|
|
}
|
|
|
|
public void e() throws IOException {
|
|
int i2 = this.q;
|
|
if (i2 == 0) {
|
|
i2 = d();
|
|
}
|
|
if (i2 == 4) {
|
|
int i3 = this.v - 1;
|
|
this.v = i3;
|
|
int[] iArr = this.f2382x;
|
|
int i4 = i3 - 1;
|
|
iArr[i4] = iArr[i4] + 1;
|
|
this.q = 0;
|
|
return;
|
|
}
|
|
StringBuilder L = c.d.b.a.a.L("Expected END_ARRAY but was ");
|
|
L.append(N());
|
|
L.append(t());
|
|
throw new IllegalStateException(L.toString());
|
|
}
|
|
|
|
public void f() throws IOException {
|
|
int i2 = this.q;
|
|
if (i2 == 0) {
|
|
i2 = d();
|
|
}
|
|
if (i2 == 2) {
|
|
int i3 = this.v - 1;
|
|
this.v = i3;
|
|
this.w[i3] = null;
|
|
int[] iArr = this.f2382x;
|
|
int i4 = i3 - 1;
|
|
iArr[i4] = iArr[i4] + 1;
|
|
this.q = 0;
|
|
return;
|
|
}
|
|
StringBuilder L = c.d.b.a.a.L("Expected END_OBJECT but was ");
|
|
L.append(N());
|
|
L.append(t());
|
|
throw new IllegalStateException(L.toString());
|
|
}
|
|
|
|
public String getPath() {
|
|
StringBuilder J = c.d.b.a.a.J('$');
|
|
int i2 = this.v;
|
|
for (int i3 = 0; i3 < i2; i3++) {
|
|
int i4 = this.u[i3];
|
|
if (i4 == 1 || i4 == 2) {
|
|
J.append('[');
|
|
J.append(this.f2382x[i3]);
|
|
J.append(']');
|
|
} else if (i4 == 3 || i4 == 4 || i4 == 5) {
|
|
J.append('.');
|
|
String[] strArr = this.w;
|
|
if (strArr[i3] != null) {
|
|
J.append(strArr[i3]);
|
|
}
|
|
}
|
|
}
|
|
return J.toString();
|
|
}
|
|
|
|
public final boolean p(int i2) throws IOException {
|
|
int i3;
|
|
int i4;
|
|
char[] cArr = this.l;
|
|
int i5 = this.p;
|
|
int i6 = this.m;
|
|
this.p = i5 - i6;
|
|
int i7 = this.n;
|
|
if (i7 != i6) {
|
|
int i8 = i7 - i6;
|
|
this.n = i8;
|
|
System.arraycopy(cArr, i6, cArr, 0, i8);
|
|
} else {
|
|
this.n = 0;
|
|
}
|
|
this.m = 0;
|
|
do {
|
|
Reader reader = this.j;
|
|
int i9 = this.n;
|
|
int read = reader.read(cArr, i9, cArr.length - i9);
|
|
if (read == -1) {
|
|
return false;
|
|
}
|
|
i3 = this.n + read;
|
|
this.n = i3;
|
|
if (this.o == 0 && (i4 = this.p) == 0 && i3 > 0 && cArr[0] == 65279) {
|
|
this.m++;
|
|
this.p = i4 + 1;
|
|
i2++;
|
|
continue;
|
|
}
|
|
} while (i3 < i2);
|
|
return true;
|
|
}
|
|
|
|
public boolean r() throws IOException {
|
|
int i2 = this.q;
|
|
if (i2 == 0) {
|
|
i2 = d();
|
|
}
|
|
return (i2 == 2 || i2 == 4) ? false : true;
|
|
}
|
|
|
|
public final boolean s(char c2) throws IOException {
|
|
if (c2 == '\t' || c2 == '\n' || c2 == '\f' || c2 == '\r' || c2 == ' ') {
|
|
return false;
|
|
}
|
|
if (c2 != '#') {
|
|
if (c2 == ',') {
|
|
return false;
|
|
}
|
|
if (!(c2 == '/' || c2 == '=')) {
|
|
if (c2 == '{' || c2 == '}' || c2 == ':') {
|
|
return false;
|
|
}
|
|
if (c2 != ';') {
|
|
switch (c2) {
|
|
case '[':
|
|
case ']':
|
|
return false;
|
|
case '\\':
|
|
break;
|
|
default:
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
c();
|
|
return false;
|
|
}
|
|
|
|
public String t() {
|
|
StringBuilder N = c.d.b.a.a.N(" at line ", this.o + 1, " column ", (this.m - this.p) + 1, " path ");
|
|
N.append(getPath());
|
|
return N.toString();
|
|
}
|
|
|
|
@Override // java.lang.Object
|
|
public String toString() {
|
|
return getClass().getSimpleName() + t();
|
|
}
|
|
|
|
public boolean w() throws IOException {
|
|
int i2 = this.q;
|
|
if (i2 == 0) {
|
|
i2 = d();
|
|
}
|
|
if (i2 == 5) {
|
|
this.q = 0;
|
|
int[] iArr = this.f2382x;
|
|
int i3 = this.v - 1;
|
|
iArr[i3] = iArr[i3] + 1;
|
|
return true;
|
|
} else if (i2 == 6) {
|
|
this.q = 0;
|
|
int[] iArr2 = this.f2382x;
|
|
int i4 = this.v - 1;
|
|
iArr2[i4] = iArr2[i4] + 1;
|
|
return false;
|
|
} else {
|
|
StringBuilder L = c.d.b.a.a.L("Expected a boolean but was ");
|
|
L.append(N());
|
|
L.append(t());
|
|
throw new IllegalStateException(L.toString());
|
|
}
|
|
}
|
|
|
|
public double x() throws IOException {
|
|
int i2 = this.q;
|
|
if (i2 == 0) {
|
|
i2 = d();
|
|
}
|
|
if (i2 == 15) {
|
|
this.q = 0;
|
|
int[] iArr = this.f2382x;
|
|
int i3 = this.v - 1;
|
|
iArr[i3] = iArr[i3] + 1;
|
|
return (double) this.r;
|
|
}
|
|
if (i2 == 16) {
|
|
this.t = new String(this.l, this.m, this.f2381s);
|
|
this.m += this.f2381s;
|
|
} else if (i2 == 8 || i2 == 9) {
|
|
this.t = I(i2 == 8 ? '\'' : '\"');
|
|
} else if (i2 == 10) {
|
|
this.t = M();
|
|
} else if (i2 != 11) {
|
|
StringBuilder L = c.d.b.a.a.L("Expected a double but was ");
|
|
L.append(N());
|
|
L.append(t());
|
|
throw new IllegalStateException(L.toString());
|
|
}
|
|
this.q = 11;
|
|
double parseDouble = Double.parseDouble(this.t);
|
|
if (this.k || (!Double.isNaN(parseDouble) && !Double.isInfinite(parseDouble))) {
|
|
this.t = null;
|
|
this.q = 0;
|
|
int[] iArr2 = this.f2382x;
|
|
int i4 = this.v - 1;
|
|
iArr2[i4] = iArr2[i4] + 1;
|
|
return parseDouble;
|
|
}
|
|
throw new MalformedJsonException("JSON forbids NaN and infinities: " + parseDouble + t());
|
|
}
|
|
|
|
public int z() throws IOException {
|
|
int i2 = this.q;
|
|
if (i2 == 0) {
|
|
i2 = d();
|
|
}
|
|
if (i2 == 15) {
|
|
long j = this.r;
|
|
int i3 = (int) j;
|
|
if (j == ((long) i3)) {
|
|
this.q = 0;
|
|
int[] iArr = this.f2382x;
|
|
int i4 = this.v - 1;
|
|
iArr[i4] = iArr[i4] + 1;
|
|
return i3;
|
|
}
|
|
StringBuilder L = c.d.b.a.a.L("Expected an int but was ");
|
|
L.append(this.r);
|
|
L.append(t());
|
|
throw new NumberFormatException(L.toString());
|
|
}
|
|
if (i2 == 16) {
|
|
this.t = new String(this.l, this.m, this.f2381s);
|
|
this.m += this.f2381s;
|
|
} else if (i2 == 8 || i2 == 9 || i2 == 10) {
|
|
if (i2 == 10) {
|
|
this.t = M();
|
|
} else {
|
|
this.t = I(i2 == 8 ? '\'' : '\"');
|
|
}
|
|
try {
|
|
int parseInt = Integer.parseInt(this.t);
|
|
this.q = 0;
|
|
int[] iArr2 = this.f2382x;
|
|
int i5 = this.v - 1;
|
|
iArr2[i5] = iArr2[i5] + 1;
|
|
return parseInt;
|
|
} catch (NumberFormatException unused) {
|
|
}
|
|
} else {
|
|
StringBuilder L2 = c.d.b.a.a.L("Expected an int but was ");
|
|
L2.append(N());
|
|
L2.append(t());
|
|
throw new IllegalStateException(L2.toString());
|
|
}
|
|
this.q = 11;
|
|
double parseDouble = Double.parseDouble(this.t);
|
|
int i6 = (int) parseDouble;
|
|
if (((double) i6) == parseDouble) {
|
|
this.t = null;
|
|
this.q = 0;
|
|
int[] iArr3 = this.f2382x;
|
|
int i7 = this.v - 1;
|
|
iArr3[i7] = iArr3[i7] + 1;
|
|
return i6;
|
|
}
|
|
StringBuilder L3 = c.d.b.a.a.L("Expected an int but was ");
|
|
L3.append(this.t);
|
|
L3.append(t());
|
|
throw new NumberFormatException(L3.toString());
|
|
}
|
|
}
|