Huffman.smali
16.6 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
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
.class Lokhttp3/internal/http2/Huffman;
.super Ljava/lang/Object;
.source "Huffman.java"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lokhttp3/internal/http2/Huffman$Node;
}
.end annotation
# static fields
.field private static final CODES:[I
.field private static final CODE_LENGTHS:[B
.field private static final INSTANCE:Lokhttp3/internal/http2/Huffman;
# instance fields
.field private final root:Lokhttp3/internal/http2/Huffman$Node;
# direct methods
.method static constructor <clinit>()V
.locals 2
const/16 v0, 0x100
.line 37
new-array v1, v0, [I
fill-array-data v1, :array_0
sput-object v1, Lokhttp3/internal/http2/Huffman;->CODES:[I
.line 65
new-array v0, v0, [B
fill-array-data v0, :array_1
sput-object v0, Lokhttp3/internal/http2/Huffman;->CODE_LENGTHS:[B
.line 79
new-instance v0, Lokhttp3/internal/http2/Huffman;
invoke-direct {v0}, Lokhttp3/internal/http2/Huffman;-><init>()V
sput-object v0, Lokhttp3/internal/http2/Huffman;->INSTANCE:Lokhttp3/internal/http2/Huffman;
return-void
:array_0
.array-data 4
0x1ff8
0x7fffd8
0xfffffe2
0xfffffe3
0xfffffe4
0xfffffe5
0xfffffe6
0xfffffe7
0xfffffe8
0xffffea
0x3ffffffc # 1.9999995f
0xfffffe9
0xfffffea
0x3ffffffd # 1.9999996f
0xfffffeb
0xfffffec
0xfffffed
0xfffffee
0xfffffef
0xffffff0
0xffffff1
0xffffff2
0x3ffffffe # 1.9999998f
0xffffff3
0xffffff4
0xffffff5
0xffffff6
0xffffff7
0xffffff8
0xffffff9
0xffffffa
0xffffffb
0x14
0x3f8
0x3f9
0xffa
0x1ff9
0x15
0xf8
0x7fa
0x3fa
0x3fb
0xf9
0x7fb
0xfa
0x16
0x17
0x18
0x0
0x1
0x2
0x19
0x1a
0x1b
0x1c
0x1d
0x1e
0x1f
0x5c
0xfb
0x7ffc
0x20
0xffb
0x3fc
0x1ffa
0x21
0x5d
0x5e
0x5f
0x60
0x61
0x62
0x63
0x64
0x65
0x66
0x67
0x68
0x69
0x6a
0x6b
0x6c
0x6d
0x6e
0x6f
0x70
0x71
0x72
0xfc
0x73
0xfd
0x1ffb
0x7fff0
0x1ffc
0x3ffc
0x22
0x7ffd
0x3
0x23
0x4
0x24
0x5
0x25
0x26
0x27
0x6
0x74
0x75
0x28
0x29
0x2a
0x7
0x2b
0x76
0x2c
0x8
0x9
0x2d
0x77
0x78
0x79
0x7a
0x7b
0x7ffe
0x7fc
0x3ffd
0x1ffd
0xffffffc
0xfffe6
0x3fffd2
0xfffe7
0xfffe8
0x3fffd3
0x3fffd4
0x3fffd5
0x7fffd9
0x3fffd6
0x7fffda
0x7fffdb
0x7fffdc
0x7fffdd
0x7fffde
0xffffeb
0x7fffdf
0xffffec
0xffffed
0x3fffd7
0x7fffe0
0xffffee
0x7fffe1
0x7fffe2
0x7fffe3
0x7fffe4
0x1fffdc
0x3fffd8
0x7fffe5
0x3fffd9
0x7fffe6
0x7fffe7
0xffffef
0x3fffda
0x1fffdd
0xfffe9
0x3fffdb
0x3fffdc
0x7fffe8
0x7fffe9
0x1fffde
0x7fffea
0x3fffdd
0x3fffde
0xfffff0
0x1fffdf
0x3fffdf
0x7fffeb
0x7fffec
0x1fffe0
0x1fffe1
0x3fffe0
0x1fffe2
0x7fffed
0x3fffe1
0x7fffee
0x7fffef
0xfffea
0x3fffe2
0x3fffe3
0x3fffe4
0x7ffff0
0x3fffe5
0x3fffe6
0x7ffff1
0x3ffffe0
0x3ffffe1
0xfffeb
0x7fff1
0x3fffe7
0x7ffff2
0x3fffe8
0x1ffffec
0x3ffffe2
0x3ffffe3
0x3ffffe4
0x7ffffde
0x7ffffdf
0x3ffffe5
0xfffff1
0x1ffffed
0x7fff2
0x1fffe3
0x3ffffe6
0x7ffffe0
0x7ffffe1
0x3ffffe7
0x7ffffe2
0xfffff2
0x1fffe4
0x1fffe5
0x3ffffe8
0x3ffffe9
0xffffffd
0x7ffffe3
0x7ffffe4
0x7ffffe5
0xfffec
0xfffff3
0xfffed
0x1fffe6
0x3fffe9
0x1fffe7
0x1fffe8
0x7ffff3
0x3fffea
0x3fffeb
0x1ffffee
0x1ffffef
0xfffff4
0xfffff5
0x3ffffea
0x7ffff4
0x3ffffeb
0x7ffffe6
0x3ffffec
0x3ffffed
0x7ffffe7
0x7ffffe8
0x7ffffe9
0x7ffffea
0x7ffffeb
0xffffffe
0x7ffffec
0x7ffffed
0x7ffffee
0x7ffffef
0x7fffff0
0x3ffffee
.end array-data
:array_1
.array-data 1
0xdt
0x17t
0x1ct
0x1ct
0x1ct
0x1ct
0x1ct
0x1ct
0x1ct
0x18t
0x1et
0x1ct
0x1ct
0x1et
0x1ct
0x1ct
0x1ct
0x1ct
0x1ct
0x1ct
0x1ct
0x1ct
0x1et
0x1ct
0x1ct
0x1ct
0x1ct
0x1ct
0x1ct
0x1ct
0x1ct
0x1ct
0x6t
0xat
0xat
0xct
0xdt
0x6t
0x8t
0xbt
0xat
0xat
0x8t
0xbt
0x8t
0x6t
0x6t
0x6t
0x5t
0x5t
0x5t
0x6t
0x6t
0x6t
0x6t
0x6t
0x6t
0x6t
0x7t
0x8t
0xft
0x6t
0xct
0xat
0xdt
0x6t
0x7t
0x7t
0x7t
0x7t
0x7t
0x7t
0x7t
0x7t
0x7t
0x7t
0x7t
0x7t
0x7t
0x7t
0x7t
0x7t
0x7t
0x7t
0x7t
0x7t
0x7t
0x7t
0x8t
0x7t
0x8t
0xdt
0x13t
0xdt
0xet
0x6t
0xft
0x5t
0x6t
0x5t
0x6t
0x5t
0x6t
0x6t
0x6t
0x5t
0x7t
0x7t
0x6t
0x6t
0x6t
0x5t
0x6t
0x7t
0x6t
0x5t
0x5t
0x6t
0x7t
0x7t
0x7t
0x7t
0x7t
0xft
0xbt
0xet
0xdt
0x1ct
0x14t
0x16t
0x14t
0x14t
0x16t
0x16t
0x16t
0x17t
0x16t
0x17t
0x17t
0x17t
0x17t
0x17t
0x18t
0x17t
0x18t
0x18t
0x16t
0x17t
0x18t
0x17t
0x17t
0x17t
0x17t
0x15t
0x16t
0x17t
0x16t
0x17t
0x17t
0x18t
0x16t
0x15t
0x14t
0x16t
0x16t
0x17t
0x17t
0x15t
0x17t
0x16t
0x16t
0x18t
0x15t
0x16t
0x17t
0x17t
0x15t
0x15t
0x16t
0x15t
0x17t
0x16t
0x17t
0x17t
0x14t
0x16t
0x16t
0x16t
0x17t
0x16t
0x16t
0x17t
0x1at
0x1at
0x14t
0x13t
0x16t
0x17t
0x16t
0x19t
0x1at
0x1at
0x1at
0x1bt
0x1bt
0x1at
0x18t
0x19t
0x13t
0x15t
0x1at
0x1bt
0x1bt
0x1at
0x1bt
0x18t
0x15t
0x15t
0x1at
0x1at
0x1ct
0x1bt
0x1bt
0x1bt
0x14t
0x18t
0x14t
0x15t
0x16t
0x15t
0x15t
0x17t
0x16t
0x16t
0x19t
0x19t
0x18t
0x18t
0x1at
0x17t
0x1at
0x1bt
0x1at
0x1at
0x1bt
0x1bt
0x1bt
0x1bt
0x1bt
0x1ct
0x1bt
0x1bt
0x1bt
0x1bt
0x1bt
0x1at
.end array-data
.end method
.method private constructor <init>()V
.locals 1
.line 87
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 85
new-instance v0, Lokhttp3/internal/http2/Huffman$Node;
invoke-direct {v0}, Lokhttp3/internal/http2/Huffman$Node;-><init>()V
iput-object v0, p0, Lokhttp3/internal/http2/Huffman;->root:Lokhttp3/internal/http2/Huffman$Node;
.line 88
invoke-direct {p0}, Lokhttp3/internal/http2/Huffman;->buildTree()V
return-void
.end method
.method private addCode(IIB)V
.locals 4
.line 173
new-instance v0, Lokhttp3/internal/http2/Huffman$Node;
invoke-direct {v0, p1, p3}, Lokhttp3/internal/http2/Huffman$Node;-><init>(II)V
.line 175
iget-object p1, p0, Lokhttp3/internal/http2/Huffman;->root:Lokhttp3/internal/http2/Huffman$Node;
:goto_0
const/16 v1, 0x8
if-le p3, v1, :cond_2
add-int/lit8 p3, p3, -0x8
int-to-byte p3, p3
ushr-int v1, p2, p3
and-int/lit16 v1, v1, 0xff
.line 179
iget-object v2, p1, Lokhttp3/internal/http2/Huffman$Node;->children:[Lokhttp3/internal/http2/Huffman$Node;
if-eqz v2, :cond_1
.line 182
iget-object v2, p1, Lokhttp3/internal/http2/Huffman$Node;->children:[Lokhttp3/internal/http2/Huffman$Node;
aget-object v2, v2, v1
if-nez v2, :cond_0
.line 183
iget-object v2, p1, Lokhttp3/internal/http2/Huffman$Node;->children:[Lokhttp3/internal/http2/Huffman$Node;
new-instance v3, Lokhttp3/internal/http2/Huffman$Node;
invoke-direct {v3}, Lokhttp3/internal/http2/Huffman$Node;-><init>()V
aput-object v3, v2, v1
.line 185
:cond_0
iget-object p1, p1, Lokhttp3/internal/http2/Huffman$Node;->children:[Lokhttp3/internal/http2/Huffman$Node;
aget-object p1, p1, v1
goto :goto_0
.line 180
:cond_1
new-instance p1, Ljava/lang/IllegalStateException;
const-string p2, "invalid dictionary: prefix not unique"
invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p1
:cond_2
sub-int/2addr v1, p3
shl-int/2addr p2, v1
and-int/lit16 p2, p2, 0xff
const/4 p3, 0x1
shl-int/2addr p3, v1
move v1, p2
:goto_1
add-int v2, p2, p3
if-ge v1, v2, :cond_3
.line 192
iget-object v2, p1, Lokhttp3/internal/http2/Huffman$Node;->children:[Lokhttp3/internal/http2/Huffman$Node;
aput-object v0, v2, v1
add-int/lit8 v1, v1, 0x1
goto :goto_1
:cond_3
return-void
.end method
.method private buildTree()V
.locals 3
const/4 v0, 0x0
.line 167
:goto_0
sget-object v1, Lokhttp3/internal/http2/Huffman;->CODE_LENGTHS:[B
array-length v2, v1
if-ge v0, v2, :cond_0
.line 168
sget-object v2, Lokhttp3/internal/http2/Huffman;->CODES:[I
aget v2, v2, v0
aget-byte v1, v1, v0
invoke-direct {p0, v0, v2, v1}, Lokhttp3/internal/http2/Huffman;->addCode(IIB)V
add-int/lit8 v0, v0, 0x1
goto :goto_0
:cond_0
return-void
.end method
.method public static get()Lokhttp3/internal/http2/Huffman;
.locals 1
.line 82
sget-object v0, Lokhttp3/internal/http2/Huffman;->INSTANCE:Lokhttp3/internal/http2/Huffman;
return-object v0
.end method
# virtual methods
.method decode([B)[B
.locals 7
.line 129
new-instance v0, Ljava/io/ByteArrayOutputStream;
invoke-direct {v0}, Ljava/io/ByteArrayOutputStream;-><init>()V
.line 130
iget-object v1, p0, Lokhttp3/internal/http2/Huffman;->root:Lokhttp3/internal/http2/Huffman$Node;
const/4 v2, 0x0
move-object v4, v1
move v1, v2
move v3, v1
.line 133
:goto_0
array-length v5, p1
const/16 v6, 0x8
if-ge v2, v5, :cond_2
.line 134
aget-byte v5, p1, v2
and-int/lit16 v5, v5, 0xff
shl-int/lit8 v1, v1, 0x8
or-int/2addr v1, v5
add-int/lit8 v3, v3, 0x8
:goto_1
if-lt v3, v6, :cond_1
add-int/lit8 v5, v3, -0x8
ushr-int v5, v1, v5
and-int/lit16 v5, v5, 0xff
.line 139
iget-object v4, v4, Lokhttp3/internal/http2/Huffman$Node;->children:[Lokhttp3/internal/http2/Huffman$Node;
aget-object v4, v4, v5
.line 140
iget-object v5, v4, Lokhttp3/internal/http2/Huffman$Node;->children:[Lokhttp3/internal/http2/Huffman$Node;
if-nez v5, :cond_0
.line 142
iget v5, v4, Lokhttp3/internal/http2/Huffman$Node;->symbol:I
invoke-virtual {v0, v5}, Ljava/io/ByteArrayOutputStream;->write(I)V
.line 143
iget v4, v4, Lokhttp3/internal/http2/Huffman$Node;->terminalBits:I
sub-int/2addr v3, v4
.line 144
iget-object v4, p0, Lokhttp3/internal/http2/Huffman;->root:Lokhttp3/internal/http2/Huffman$Node;
goto :goto_1
:cond_0
add-int/lit8 v3, v3, -0x8
goto :goto_1
:cond_1
add-int/lit8 v2, v2, 0x1
goto :goto_0
:cond_2
:goto_2
if-lez v3, :cond_4
rsub-int/lit8 p1, v3, 0x8
shl-int p1, v1, p1
and-int/lit16 p1, p1, 0xff
.line 154
iget-object v2, v4, Lokhttp3/internal/http2/Huffman$Node;->children:[Lokhttp3/internal/http2/Huffman$Node;
aget-object p1, v2, p1
.line 155
iget-object v2, p1, Lokhttp3/internal/http2/Huffman$Node;->children:[Lokhttp3/internal/http2/Huffman$Node;
if-nez v2, :cond_4
iget v2, p1, Lokhttp3/internal/http2/Huffman$Node;->terminalBits:I
if-le v2, v3, :cond_3
goto :goto_3
.line 158
:cond_3
iget v2, p1, Lokhttp3/internal/http2/Huffman$Node;->symbol:I
invoke-virtual {v0, v2}, Ljava/io/ByteArrayOutputStream;->write(I)V
.line 159
iget p1, p1, Lokhttp3/internal/http2/Huffman$Node;->terminalBits:I
sub-int/2addr v3, p1
.line 160
iget-object v4, p0, Lokhttp3/internal/http2/Huffman;->root:Lokhttp3/internal/http2/Huffman$Node;
goto :goto_2
.line 163
:cond_4
:goto_3
invoke-virtual {v0}, Ljava/io/ByteArrayOutputStream;->toByteArray()[B
move-result-object p1
return-object p1
.end method
.method encode(Lokio/ByteString;Lokio/BufferedSink;)V
.locals 8
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
const/4 v0, 0x0
const-wide/16 v1, 0x0
move-wide v2, v1
move v1, v0
.line 95
:goto_0
invoke-virtual {p1}, Lokio/ByteString;->size()I
move-result v4
const/16 v5, 0x8
const/16 v6, 0xff
if-ge v0, v4, :cond_1
.line 96
invoke-virtual {p1, v0}, Lokio/ByteString;->getByte(I)B
move-result v4
and-int/2addr v4, v6
.line 97
sget-object v6, Lokhttp3/internal/http2/Huffman;->CODES:[I
aget v6, v6, v4
.line 98
sget-object v7, Lokhttp3/internal/http2/Huffman;->CODE_LENGTHS:[B
aget-byte v4, v7, v4
shl-long/2addr v2, v4
int-to-long v6, v6
or-long/2addr v2, v6
add-int/2addr v1, v4
:goto_1
if-lt v1, v5, :cond_0
add-int/lit8 v1, v1, -0x8
shr-long v6, v2, v1
long-to-int v4, v6
.line 106
invoke-interface {p2, v4}, Lokio/BufferedSink;->writeByte(I)Lokio/BufferedSink;
goto :goto_1
:cond_0
add-int/lit8 v0, v0, 0x1
goto :goto_0
:cond_1
if-lez v1, :cond_2
sub-int/2addr v5, v1
shl-long/2addr v2, v5
ushr-int p1, v6, v1
int-to-long v0, p1
or-long/2addr v0, v2
long-to-int p1, v0
.line 113
invoke-interface {p2, p1}, Lokio/BufferedSink;->writeByte(I)Lokio/BufferedSink;
:cond_2
return-void
.end method
.method encodedLength(Lokio/ByteString;)I
.locals 5
const-wide/16 v0, 0x0
const/4 v2, 0x0
.line 120
:goto_0
invoke-virtual {p1}, Lokio/ByteString;->size()I
move-result v3
if-ge v2, v3, :cond_0
.line 121
invoke-virtual {p1, v2}, Lokio/ByteString;->getByte(I)B
move-result v3
and-int/lit16 v3, v3, 0xff
.line 122
sget-object v4, Lokhttp3/internal/http2/Huffman;->CODE_LENGTHS:[B
aget-byte v3, v4, v3
int-to-long v3, v3
add-long/2addr v0, v3
add-int/lit8 v2, v2, 0x1
goto :goto_0
:cond_0
const-wide/16 v2, 0x7
add-long/2addr v0, v2
const/4 p1, 0x3
shr-long/2addr v0, p1
long-to-int p1, v0
return p1
.end method