JsonParser.smali
7.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
.class public final Lcom/google/gson/JsonParser;
.super Ljava/lang/Object;
.source "JsonParser.java"
# direct methods
.method public constructor <init>()V
.registers 1
.prologue
.line 34
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
# virtual methods
.method public parse(Lcom/google/gson/stream/JsonReader;)Lcom/google/gson/JsonElement;
.registers 7
.param p1, "json" # Lcom/google/gson/stream/JsonReader;
.annotation system Ldalvik/annotation/Throws;
value = {
Lcom/google/gson/JsonIOException;,
Lcom/google/gson/JsonSyntaxException;
}
.end annotation
.prologue
.line 81
invoke-virtual {p1}, Lcom/google/gson/stream/JsonReader;->isLenient()Z
move-result v1
.line 82
.local v1, "lenient":Z
const/4 v2, 0x1
invoke-virtual {p1, v2}, Lcom/google/gson/stream/JsonReader;->setLenient(Z)V
.line 84
:try_start_8
invoke-static {p1}, Lcom/google/gson/internal/Streams;->parse(Lcom/google/gson/stream/JsonReader;)Lcom/google/gson/JsonElement;
:try_end_b
.catch Ljava/lang/StackOverflowError; {:try_start_8 .. :try_end_b} :catch_10
.catch Ljava/lang/OutOfMemoryError; {:try_start_8 .. :try_end_b} :catch_35
.catchall {:try_start_8 .. :try_end_b} :catchall_30
move-result-object v2
.line 90
invoke-virtual {p1, v1}, Lcom/google/gson/stream/JsonReader;->setLenient(Z)V
return-object v2
.line 85
:catch_10
move-exception v0
.line 86
.local v0, "e":Ljava/lang/StackOverflowError;
:try_start_11
new-instance v2, Lcom/google/gson/JsonParseException;
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
const-string v4, "Failed parsing JSON source: "
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
move-result-object v3
const-string v4, " to Json"
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v3
invoke-direct {v2, v3, v0}, Lcom/google/gson/JsonParseException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
throw v2
:try_end_30
.catchall {:try_start_11 .. :try_end_30} :catchall_30
.line 90
.end local v0 # "e":Ljava/lang/StackOverflowError;
:catchall_30
move-exception v2
invoke-virtual {p1, v1}, Lcom/google/gson/stream/JsonReader;->setLenient(Z)V
throw v2
.line 87
:catch_35
move-exception v0
.line 88
.local v0, "e":Ljava/lang/OutOfMemoryError;
:try_start_36
new-instance v2, Lcom/google/gson/JsonParseException;
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
const-string v4, "Failed parsing JSON source: "
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
move-result-object v3
const-string v4, " to Json"
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v3
invoke-direct {v2, v3, v0}, Lcom/google/gson/JsonParseException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
throw v2
:try_end_55
.catchall {:try_start_36 .. :try_end_55} :catchall_30
.end method
.method public parse(Ljava/io/Reader;)Lcom/google/gson/JsonElement;
.registers 7
.param p1, "json" # Ljava/io/Reader;
.annotation system Ldalvik/annotation/Throws;
value = {
Lcom/google/gson/JsonIOException;,
Lcom/google/gson/JsonSyntaxException;
}
.end annotation
.prologue
.line 58
:try_start_0
new-instance v2, Lcom/google/gson/stream/JsonReader;
invoke-direct {v2, p1}, Lcom/google/gson/stream/JsonReader;-><init>(Ljava/io/Reader;)V
.line 59
.local v2, "jsonReader":Lcom/google/gson/stream/JsonReader;
invoke-virtual {p0, v2}, Lcom/google/gson/JsonParser;->parse(Lcom/google/gson/stream/JsonReader;)Lcom/google/gson/JsonElement;
move-result-object v1
.line 60
.local v1, "element":Lcom/google/gson/JsonElement;
invoke-virtual {v1}, Lcom/google/gson/JsonElement;->isJsonNull()Z
move-result v3
if-nez v3, :cond_34
invoke-virtual {v2}, Lcom/google/gson/stream/JsonReader;->peek()Lcom/google/gson/stream/JsonToken;
move-result-object v3
sget-object v4, Lcom/google/gson/stream/JsonToken;->END_DOCUMENT:Lcom/google/gson/stream/JsonToken;
if-eq v3, v4, :cond_34
.line 61
new-instance v3, Lcom/google/gson/JsonSyntaxException;
const-string v4, "Did not consume the entire document."
invoke-direct {v3, v4}, Lcom/google/gson/JsonSyntaxException;-><init>(Ljava/lang/String;)V
throw v3
:try_end_1f
.catch Lcom/google/gson/stream/MalformedJsonException; {:try_start_0 .. :try_end_1f} :catch_1f
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_1f} :catch_26
.catch Ljava/lang/NumberFormatException; {:try_start_0 .. :try_end_1f} :catch_2d
.line 64
.end local v1 # "element":Lcom/google/gson/JsonElement;
.end local v2 # "jsonReader":Lcom/google/gson/stream/JsonReader;
:catch_1f
move-exception v0
.line 65
.local v0, "e":Lcom/google/gson/stream/MalformedJsonException;
new-instance v3, Lcom/google/gson/JsonSyntaxException;
invoke-direct {v3, v0}, Lcom/google/gson/JsonSyntaxException;-><init>(Ljava/lang/Throwable;)V
throw v3
.line 66
.end local v0 # "e":Lcom/google/gson/stream/MalformedJsonException;
:catch_26
move-exception v0
.line 67
.local v0, "e":Ljava/io/IOException;
new-instance v3, Lcom/google/gson/JsonIOException;
invoke-direct {v3, v0}, Lcom/google/gson/JsonIOException;-><init>(Ljava/lang/Throwable;)V
throw v3
.line 68
.end local v0 # "e":Ljava/io/IOException;
:catch_2d
move-exception v0
.line 69
.local v0, "e":Ljava/lang/NumberFormatException;
new-instance v3, Lcom/google/gson/JsonSyntaxException;
invoke-direct {v3, v0}, Lcom/google/gson/JsonSyntaxException;-><init>(Ljava/lang/Throwable;)V
throw v3
.line 63
.end local v0 # "e":Ljava/lang/NumberFormatException;
.restart local v1 # "element":Lcom/google/gson/JsonElement;
.restart local v2 # "jsonReader":Lcom/google/gson/stream/JsonReader;
:cond_34
return-object v1
.end method
.method public parse(Ljava/lang/String;)Lcom/google/gson/JsonElement;
.registers 3
.param p1, "json" # Ljava/lang/String;
.annotation system Ldalvik/annotation/Throws;
value = {
Lcom/google/gson/JsonSyntaxException;
}
.end annotation
.prologue
.line 45
new-instance v0, Ljava/io/StringReader;
invoke-direct {v0, p1}, Ljava/io/StringReader;-><init>(Ljava/lang/String;)V
invoke-virtual {p0, v0}, Lcom/google/gson/JsonParser;->parse(Ljava/io/Reader;)Lcom/google/gson/JsonElement;
move-result-object v0
return-object v0
.end method