d.smali
6.5 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
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
.class public final Lcom/bytedance/hume/readapk/d;
.super Ljava/lang/Object;
# direct methods
.method private constructor <init>()V
.locals 0
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method private static a(Ljava/io/File;)Ljava/util/Map;
.locals 3
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/io/File;",
")",
"Ljava/util/Map<",
"Ljava/lang/Integer;",
"Ljava/nio/ByteBuffer;",
">;"
}
.end annotation
const/4 v0, 0x0
:try_start_0
new-instance v1, Ljava/io/RandomAccessFile;
const-string v2, "r"
invoke-direct {v1, p0, v2}, Ljava/io/RandomAccessFile;-><init>(Ljava/io/File;Ljava/lang/String;)V
:try_end_0
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_4
.catchall {:try_start_0 .. :try_end_0} :catchall_2
:try_start_1
invoke-virtual {v1}, Ljava/io/RandomAccessFile;->getChannel()Ljava/nio/channels/FileChannel;
move-result-object p0
:try_end_1
.catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_1
.catchall {:try_start_1 .. :try_end_1} :catchall_1
:try_start_2
invoke-static {p0}, Lcom/bytedance/hume/readapk/a;->c(Ljava/nio/channels/FileChannel;)Lcom/bytedance/hume/readapk/c;
move-result-object v2
invoke-virtual {v2}, Lcom/bytedance/hume/readapk/c;->a()Ljava/lang/Object;
move-result-object v2
check-cast v2, Ljava/nio/ByteBuffer;
invoke-static {v2}, Lcom/bytedance/hume/readapk/a;->a(Ljava/nio/ByteBuffer;)Ljava/util/Map;
move-result-object v0
:try_end_2
.catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_5
.catchall {:try_start_2 .. :try_end_2} :catchall_0
if-eqz p0, :cond_0
:try_start_3
invoke-virtual {p0}, Ljava/nio/channels/FileChannel;->close()V
:try_end_3
.catch Ljava/io/IOException; {:try_start_3 .. :try_end_3} :catch_0
.catch Lcom/bytedance/hume/readapk/e; {:try_start_3 .. :try_end_3} :catch_7
:catch_0
:cond_0
:goto_0
:try_start_4
invoke-virtual {v1}, Ljava/io/RandomAccessFile;->close()V
:try_end_4
.catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_7
.catch Lcom/bytedance/hume/readapk/e; {:try_start_4 .. :try_end_4} :catch_7
goto :goto_3
:catchall_0
move-exception v2
goto :goto_1
:catchall_1
move-exception v2
move-object p0, v0
goto :goto_1
:catch_1
move-object p0, v0
goto :goto_2
:catchall_2
move-exception v2
move-object p0, v0
move-object v1, p0
:goto_1
if-eqz p0, :cond_1
:try_start_5
invoke-virtual {p0}, Ljava/nio/channels/FileChannel;->close()V
:try_end_5
.catch Ljava/io/IOException; {:try_start_5 .. :try_end_5} :catch_2
.catch Lcom/bytedance/hume/readapk/e; {:try_start_5 .. :try_end_5} :catch_7
:catch_2
:cond_1
if-eqz v1, :cond_2
:try_start_6
invoke-virtual {v1}, Ljava/io/RandomAccessFile;->close()V
:try_end_6
.catch Ljava/io/IOException; {:try_start_6 .. :try_end_6} :catch_3
.catch Lcom/bytedance/hume/readapk/e; {:try_start_6 .. :try_end_6} :catch_7
:catch_3
:cond_2
:try_start_7
throw v2
:try_end_7
.catch Lcom/bytedance/hume/readapk/e; {:try_start_7 .. :try_end_7} :catch_7
:catch_4
move-object p0, v0
move-object v1, p0
:catch_5
:goto_2
if-eqz p0, :cond_3
:try_start_8
invoke-virtual {p0}, Ljava/nio/channels/FileChannel;->close()V
:try_end_8
.catch Ljava/io/IOException; {:try_start_8 .. :try_end_8} :catch_6
.catch Lcom/bytedance/hume/readapk/e; {:try_start_8 .. :try_end_8} :catch_7
:catch_6
:cond_3
if-eqz v1, :cond_4
goto :goto_0
:catch_7
:cond_4
:goto_3
return-object v0
.end method
.method private static a(Ljava/nio/ByteBuffer;)[B
.locals 3
invoke-virtual {p0}, Ljava/nio/ByteBuffer;->array()[B
move-result-object v0
invoke-virtual {p0}, Ljava/nio/ByteBuffer;->arrayOffset()I
move-result v1
invoke-virtual {p0}, Ljava/nio/ByteBuffer;->position()I
move-result v2
add-int/2addr v2, v1
invoke-virtual {p0}, Ljava/nio/ByteBuffer;->limit()I
move-result p0
add-int/2addr v1, p0
invoke-static {v0, v2, v1}, Ljava/util/Arrays;->copyOfRange([BII)[B
move-result-object p0
return-object p0
.end method
.method public static a(Ljava/io/File;[I)[Ljava/lang/String;
.locals 5
invoke-static {p0, p1}, Lcom/bytedance/hume/readapk/d;->b(Ljava/io/File;[I)[[B
move-result-object p0
if-nez p0, :cond_0
const/4 p0, 0x0
return-object p0
:cond_0
array-length v0, p1
new-array v0, v0, [Ljava/lang/String;
const/4 v1, 0x0
:goto_0
:try_start_0
array-length v2, p1
if-ge v1, v2, :cond_2
aget-object v2, p0, v1
if-eqz v2, :cond_1
new-instance v2, Ljava/lang/String;
aget-object v3, p0, v1
const-string v4, "UTF-8"
invoke-direct {v2, v3, v4}, Ljava/lang/String;-><init>([BLjava/lang/String;)V
aput-object v2, v0, v1
goto :goto_1
:cond_1
const-string v2, ""
aput-object v2, v0, v1
:try_end_0
.catch Ljava/io/UnsupportedEncodingException; {:try_start_0 .. :try_end_0} :catch_0
:goto_1
add-int/lit8 v1, v1, 0x1
goto :goto_0
:catch_0
move-exception p0
invoke-virtual {p0}, Ljava/io/UnsupportedEncodingException;->printStackTrace()V
:cond_2
return-object v0
.end method
.method public static b(Ljava/io/File;[I)[[B
.locals 3
invoke-static {p0}, Lcom/bytedance/hume/readapk/d;->a(Ljava/io/File;)Ljava/util/Map;
move-result-object p0
if-eqz p0, :cond_3
array-length v0, p1
if-gtz v0, :cond_0
goto :goto_1
:cond_0
array-length v0, p1
new-array v0, v0, [[B
const/4 v1, 0x0
:goto_0
array-length v2, p1
if-ge v1, v2, :cond_2
aget v2, p1, v1
invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v2
invoke-interface {p0, v2}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v2
check-cast v2, Ljava/nio/ByteBuffer;
if-eqz v2, :cond_1
invoke-static {v2}, Lcom/bytedance/hume/readapk/d;->a(Ljava/nio/ByteBuffer;)[B
move-result-object v2
aput-object v2, v0, v1
:cond_1
add-int/lit8 v1, v1, 0x1
goto :goto_0
:cond_2
return-object v0
:cond_3
:goto_1
const/4 p0, 0x0
check-cast p0, [[B
return-object p0
.end method