Guest User

core.java.util.zip.ZipFile.smali

a guest
Jul 18th, 2013
51
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .class public Ljava/util/zip/ZipFile;
  2. .super Ljava/lang/Object;
  3. .source "ZipFile.java"
  4.  
  5. # interfaces
  6. .implements Ljava/util/zip/ZipConstants;
  7.  
  8.  
  9. # annotations
  10. .annotation system Ldalvik/annotation/MemberClasses;
  11. value = {
  12. Ljava/util/zip/ZipFile$ZipInflaterInputStream;,
  13. Ljava/util/zip/ZipFile$RAFStream;
  14. }
  15. .end annotation
  16.  
  17.  
  18. # static fields
  19. .field static final GPBF_DATA_DESCRIPTOR_FLAG:I = 0x8
  20.  
  21. .field static final GPBF_UTF8_FLAG:I = 0x800
  22.  
  23. .field public static final OPEN_DELETE:I = 0x4
  24.  
  25. .field public static final OPEN_READ:I = 0x1
  26.  
  27.  
  28. # instance fields
  29. .field private final fileName:Ljava/lang/String;
  30.  
  31. .field private fileToDeleteOnClose:Ljava/io/File;
  32.  
  33. .field private final guard:Ldalvik/system/CloseGuard;
  34.  
  35. .field private final mEntries:Ljava/util/LinkedHashMap;
  36. .annotation system Ldalvik/annotation/Signature;
  37. value = {
  38. "Ljava/util/LinkedHashMap",
  39. "<",
  40. "Ljava/lang/String;",
  41. "Ljava/util/zip/ZipEntry;",
  42. ">;"
  43. }
  44. .end annotation
  45. .end field
  46.  
  47. .field private mRaf:Ljava/io/RandomAccessFile;
  48.  
  49.  
  50. # direct methods
  51. .method public constructor <init>(Ljava/io/File;)V
  52. .locals 1
  53. .parameter "file"
  54. .annotation system Ldalvik/annotation/Throws;
  55. value = {
  56. Ljava/util/zip/ZipException;,
  57. Ljava/io/IOException;
  58. }
  59. .end annotation
  60.  
  61. .prologue
  62. .line 103
  63. const/4 v0, 0x1
  64.  
  65. invoke-direct {p0, p1, v0}, Ljava/util/zip/ZipFile;-><init>(Ljava/io/File;I)V
  66.  
  67. .line 104
  68. return-void
  69. .end method
  70.  
  71. .method public constructor <init>(Ljava/io/File;I)V
  72. .locals 3
  73. .parameter "file"
  74. .parameter "mode"
  75. .annotation system Ldalvik/annotation/Throws;
  76. value = {
  77. Ljava/io/IOException;
  78. }
  79. .end annotation
  80.  
  81. .prologue
  82. .line 118
  83. invoke-direct/range {p0 .. p0}, Ljava/lang/Object;-><init>()V
  84.  
  85. .line 88
  86. new-instance v0, Ljava/util/LinkedHashMap;
  87.  
  88. invoke-direct {v0}, Ljava/util/LinkedHashMap;-><init>()V
  89.  
  90. iput-object v0, p0, Ljava/util/zip/ZipFile;->mEntries:Ljava/util/LinkedHashMap;
  91.  
  92. .line 90
  93. invoke-static {}, Ldalvik/system/CloseGuard;->get()Ldalvik/system/CloseGuard;
  94.  
  95. move-result-object v0
  96.  
  97. iput-object v0, p0, Ljava/util/zip/ZipFile;->guard:Ldalvik/system/CloseGuard;
  98.  
  99. .line 119
  100. invoke-virtual {p1}, Ljava/io/File;->getPath()Ljava/lang/String;
  101.  
  102. move-result-object v0
  103.  
  104. iput-object v0, p0, Ljava/util/zip/ZipFile;->fileName:Ljava/lang/String;
  105.  
  106. .line 120
  107. const/4 v0, 0x1
  108.  
  109. if-eq p2, v0, :cond_0
  110.  
  111. const/4 v0, 0x5
  112.  
  113. if-eq p2, v0, :cond_0
  114.  
  115. .line 121
  116. new-instance v0, Ljava/lang/IllegalArgumentException;
  117.  
  118. invoke-direct {v0}, Ljava/lang/IllegalArgumentException;-><init>()V
  119.  
  120. throw v0
  121.  
  122. .line 124
  123. :cond_0
  124. and-int/lit8 v0, p2, 0x4
  125.  
  126. if-eqz v0, :cond_1
  127.  
  128. .line 125
  129. iput-object p1, p0, Ljava/util/zip/ZipFile;->fileToDeleteOnClose:Ljava/io/File;
  130.  
  131. .line 130
  132. :goto_0
  133. new-instance v0, Ljava/io/RandomAccessFile;
  134.  
  135. iget-object v1, p0, Ljava/util/zip/ZipFile;->fileName:Ljava/lang/String;
  136.  
  137. const-string v2, "r"
  138.  
  139. invoke-direct {v0, v1, v2}, Ljava/io/RandomAccessFile;-><init>(Ljava/lang/String;Ljava/lang/String;)V
  140.  
  141. iput-object v0, p0, Ljava/util/zip/ZipFile;->mRaf:Ljava/io/RandomAccessFile;
  142.  
  143. .line 132
  144. invoke-direct {p0}, Ljava/util/zip/ZipFile;->readCentralDir()V
  145.  
  146. .line 133
  147. iget-object v0, p0, Ljava/util/zip/ZipFile;->guard:Ldalvik/system/CloseGuard;
  148.  
  149. const-string v1, "close"
  150.  
  151. invoke-virtual {v0, v1}, Ldalvik/system/CloseGuard;->open(Ljava/lang/String;)V
  152.  
  153. .line 134
  154. return-void
  155.  
  156. .line 127
  157. :cond_1
  158. const/4 v0, 0x0
  159.  
  160. iput-object v0, p0, Ljava/util/zip/ZipFile;->fileToDeleteOnClose:Ljava/io/File;
  161.  
  162. goto :goto_0
  163. .end method
  164.  
  165. .method public constructor <init>(Ljava/lang/String;)V
  166. .locals 2
  167. .parameter "name"
  168. .annotation system Ldalvik/annotation/Throws;
  169. value = {
  170. Ljava/io/IOException;
  171. }
  172. .end annotation
  173.  
  174. .prologue
  175. .line 145
  176. new-instance v0, Ljava/io/File;
  177.  
  178. invoke-direct {v0, p1}, Ljava/io/File;-><init>(Ljava/lang/String;)V
  179.  
  180. const/4 v1, 0x1
  181.  
  182. invoke-direct {p0, v0, v1}, Ljava/util/zip/ZipFile;-><init>(Ljava/io/File;I)V
  183.  
  184. .line 146
  185. return-void
  186. .end method
  187.  
  188. .method static synthetic access$000(Ljava/util/zip/ZipFile;)V
  189. .locals 0
  190. .parameter "x0"
  191.  
  192. .prologue
  193. .line 50
  194. invoke-direct {p0}, Ljava/util/zip/ZipFile;->checkNotClosed()V
  195.  
  196. return-void
  197. .end method
  198.  
  199. .method private checkNotClosed()V
  200. .locals 2
  201.  
  202. .prologue
  203. .line 185
  204. iget-object v0, p0, Ljava/util/zip/ZipFile;->mRaf:Ljava/io/RandomAccessFile;
  205.  
  206. if-nez v0, :cond_0
  207.  
  208. .line 186
  209. new-instance v0, Ljava/lang/IllegalStateException;
  210.  
  211. const-string v1, "Zip file closed"
  212.  
  213. invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  214.  
  215. throw v0
  216.  
  217. .line 188
  218. :cond_0
  219. return-void
  220. .end method
  221.  
  222. .method private readCentralDir()V
  223. .locals 24
  224. .annotation system Ldalvik/annotation/Throws;
  225. value = {
  226. Ljava/io/IOException;
  227. }
  228. .end annotation
  229.  
  230. .prologue
  231. .line 319
  232. move-object/from16 v0, p0
  233.  
  234. iget-object v0, v0, Ljava/util/zip/ZipFile;->mRaf:Ljava/io/RandomAccessFile;
  235.  
  236. move-object/from16 v20, v0
  237.  
  238. invoke-virtual/range {v20 .. v20}, Ljava/io/RandomAccessFile;->length()J
  239.  
  240. move-result-wide v20
  241.  
  242. const-wide/16 v22, 0x16
  243.  
  244. sub-long v15, v20, v22
  245.  
  246. .line 320
  247. .local v15, scanOffset:J
  248. const-wide/16 v20, 0x0
  249.  
  250. cmp-long v20, v15, v20
  251.  
  252. if-gez v20, :cond_0
  253.  
  254. .line 321
  255. new-instance v20, Ljava/util/zip/ZipException;
  256.  
  257. new-instance v21, Ljava/lang/StringBuilder;
  258.  
  259. invoke-direct/range {v21 .. v21}, Ljava/lang/StringBuilder;-><init>()V
  260.  
  261. const-string v22, "File too short to be a zip file: "
  262.  
  263. invoke-virtual/range {v21 .. v22}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  264.  
  265. move-result-object v21
  266.  
  267. move-object/from16 v0, p0
  268.  
  269. iget-object v0, v0, Ljava/util/zip/ZipFile;->mRaf:Ljava/io/RandomAccessFile;
  270.  
  271. move-object/from16 v22, v0
  272.  
  273. invoke-virtual/range {v22 .. v22}, Ljava/io/RandomAccessFile;->length()J
  274.  
  275. move-result-wide v22
  276.  
  277. invoke-virtual/range {v21 .. v23}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
  278.  
  279. move-result-object v21
  280.  
  281. invoke-virtual/range {v21 .. v21}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  282.  
  283. move-result-object v21
  284.  
  285. invoke-direct/range {v20 .. v21}, Ljava/util/zip/ZipException;-><init>(Ljava/lang/String;)V
  286.  
  287. throw v20
  288.  
  289. .line 324
  290. :cond_0
  291. const-wide/32 v20, 0x10000
  292.  
  293. sub-long v17, v15, v20
  294.  
  295. .line 325
  296. .local v17, stopOffset:J
  297. const-wide/16 v20, 0x0
  298.  
  299. cmp-long v20, v17, v20
  300.  
  301. if-gez v20, :cond_1
  302.  
  303. .line 326
  304. const-wide/16 v17, 0x0
  305.  
  306. .line 329
  307. :cond_1
  308. const v3, 0x6054b50
  309.  
  310. .line 331
  311. .local v3, ENDHEADERMAGIC:I
  312. :cond_2
  313. move-object/from16 v0, p0
  314.  
  315. iget-object v0, v0, Ljava/util/zip/ZipFile;->mRaf:Ljava/io/RandomAccessFile;
  316.  
  317. move-object/from16 v20, v0
  318.  
  319. move-object/from16 v0, v20
  320.  
  321. move-wide v1, v15
  322.  
  323. invoke-virtual {v0, v1, v2}, Ljava/io/RandomAccessFile;->seek(J)V
  324.  
  325. .line 332
  326. move-object/from16 v0, p0
  327.  
  328. iget-object v0, v0, Ljava/util/zip/ZipFile;->mRaf:Ljava/io/RandomAccessFile;
  329.  
  330. move-object/from16 v20, v0
  331.  
  332. invoke-virtual/range {v20 .. v20}, Ljava/io/RandomAccessFile;->readInt()I
  333.  
  334. move-result v20
  335.  
  336. invoke-static/range {v20 .. v20}, Ljava/lang/Integer;->reverseBytes(I)I
  337.  
  338. move-result v20
  339.  
  340. const v21, 0x6054b50
  341.  
  342. move/from16 v0, v20
  343.  
  344. move/from16 v1, v21
  345.  
  346. if-ne v0, v1, :cond_4
  347.  
  348. .line 344
  349. const/16 v20, 0x12
  350.  
  351. move/from16 v0, v20
  352.  
  353. new-array v8, v0, [B
  354.  
  355. .line 345
  356. .local v8, eocd:[B
  357. move-object/from16 v0, p0
  358.  
  359. iget-object v0, v0, Ljava/util/zip/ZipFile;->mRaf:Ljava/io/RandomAccessFile;
  360.  
  361. move-object/from16 v20, v0
  362.  
  363. move-object/from16 v0, v20
  364.  
  365. invoke-virtual {v0, v8}, Ljava/io/RandomAccessFile;->readFully([B)V
  366.  
  367. .line 348
  368. const/16 v20, 0x0
  369.  
  370. array-length v0, v8
  371.  
  372. move/from16 v21, v0
  373.  
  374. sget-object v22, Ljava/nio/ByteOrder;->LITTLE_ENDIAN:Ljava/nio/ByteOrder;
  375.  
  376. move/from16 v0, v20
  377.  
  378. move/from16 v1, v21
  379.  
  380. move-object/from16 v2, v22
  381.  
  382. invoke-static {v8, v0, v1, v2}, Llibcore/io/HeapBufferIterator;->iterator([BIILjava/nio/ByteOrder;)Llibcore/io/BufferIterator;
  383.  
  384. move-result-object v11
  385.  
  386. .line 349
  387. .local v11, it:Llibcore/io/BufferIterator;
  388. invoke-virtual {v11}, Llibcore/io/BufferIterator;->readShort()S
  389.  
  390. move-result v20
  391.  
  392. const v21, 0xffff
  393.  
  394. and-int v6, v20, v21
  395.  
  396. .line 350
  397. .local v6, diskNumber:I
  398. invoke-virtual {v11}, Llibcore/io/BufferIterator;->readShort()S
  399.  
  400. move-result v20
  401.  
  402. const v21, 0xffff
  403.  
  404. and-int v7, v20, v21
  405.  
  406. .line 351
  407. .local v7, diskWithCentralDir:I
  408. invoke-virtual {v11}, Llibcore/io/BufferIterator;->readShort()S
  409.  
  410. move-result v20
  411.  
  412. const v21, 0xffff
  413.  
  414. and-int v13, v20, v21
  415.  
  416. .line 352
  417. .local v13, numEntries:I
  418. invoke-virtual {v11}, Llibcore/io/BufferIterator;->readShort()S
  419.  
  420. move-result v20
  421.  
  422. const v21, 0xffff
  423.  
  424. and-int v19, v20, v21
  425.  
  426. .line 353
  427. .local v19, totalNumEntries:I
  428. const/16 v20, 0x4
  429.  
  430. move/from16 v0, v20
  431.  
  432. invoke-virtual {v11, v0}, Llibcore/io/BufferIterator;->skip(I)V
  433.  
  434. .line 354
  435. invoke-virtual {v11}, Llibcore/io/BufferIterator;->readInt()I
  436.  
  437. move-result v5
  438.  
  439. .line 356
  440. .local v5, centralDirOffset:I
  441. move/from16 v0, v19
  442.  
  443. if-ne v13, v0, :cond_3
  444.  
  445. if-nez v6, :cond_3
  446.  
  447. if-eqz v7, :cond_5
  448.  
  449. .line 357
  450. :cond_3
  451. new-instance v20, Ljava/util/zip/ZipException;
  452.  
  453. const-string v21, "spanned archives not supported"
  454.  
  455. invoke-direct/range {v20 .. v21}, Ljava/util/zip/ZipException;-><init>(Ljava/lang/String;)V
  456.  
  457. throw v20
  458.  
  459. .line 336
  460. .end local v5 #centralDirOffset:I
  461. .end local v6 #diskNumber:I
  462. .end local v7 #diskWithCentralDir:I
  463. .end local v8 #eocd:[B
  464. .end local v11 #it:Llibcore/io/BufferIterator;
  465. .end local v13 #numEntries:I
  466. .end local v19 #totalNumEntries:I
  467. :cond_4
  468. const-wide/16 v20, 0x1
  469.  
  470. sub-long v15, v15, v20
  471.  
  472. .line 337
  473. cmp-long v20, v15, v17
  474.  
  475. if-gez v20, :cond_2
  476.  
  477. .line 338
  478. new-instance v20, Ljava/util/zip/ZipException;
  479.  
  480. const-string v21, "EOCD not found; not a Zip archive?"
  481.  
  482. invoke-direct/range {v20 .. v21}, Ljava/util/zip/ZipException;-><init>(Ljava/lang/String;)V
  483.  
  484. throw v20
  485.  
  486. .line 361
  487. .restart local v5 #centralDirOffset:I
  488. .restart local v6 #diskNumber:I
  489. .restart local v7 #diskWithCentralDir:I
  490. .restart local v8 #eocd:[B
  491. .restart local v11 #it:Llibcore/io/BufferIterator;
  492. .restart local v13 #numEntries:I
  493. .restart local v19 #totalNumEntries:I
  494. :cond_5
  495. new-instance v14, Ljava/util/zip/ZipFile$RAFStream;
  496.  
  497. move-object/from16 v0, p0
  498.  
  499. iget-object v0, v0, Ljava/util/zip/ZipFile;->mRaf:Ljava/io/RandomAccessFile;
  500.  
  501. move-object/from16 v20, v0
  502.  
  503. int-to-long v0, v5
  504.  
  505. move-wide/from16 v21, v0
  506.  
  507. move-object/from16 v0, v20
  508.  
  509. move-wide/from16 v1, v21
  510.  
  511. invoke-direct {v14, v0, v1, v2}, Ljava/util/zip/ZipFile$RAFStream;-><init>(Ljava/io/RandomAccessFile;J)V
  512.  
  513. .line 362
  514. .local v14, rafs:Ljava/util/zip/ZipFile$RAFStream;
  515. new-instance v4, Ljava/io/BufferedInputStream;
  516.  
  517. const/16 v20, 0x1000
  518.  
  519. move/from16 v0, v20
  520.  
  521. invoke-direct {v4, v14, v0}, Ljava/io/BufferedInputStream;-><init>(Ljava/io/InputStream;I)V
  522.  
  523. .line 363
  524. .local v4, bin:Ljava/io/BufferedInputStream;
  525. const/16 v20, 0x2e
  526.  
  527. move/from16 v0, v20
  528.  
  529. new-array v9, v0, [B
  530.  
  531. .line 364
  532. .local v9, hdrBuf:[B
  533. const/4 v10, 0x0
  534.  
  535. .local v10, i:I
  536. :goto_0
  537. if-ge v10, v13, :cond_6
  538.  
  539. .line 365
  540. new-instance v12, Ljava/util/zip/ZipEntry;
  541.  
  542. invoke-direct {v12, v9, v4}, Ljava/util/zip/ZipEntry;-><init>([BLjava/io/InputStream;)V
  543.  
  544. .line 366
  545. .local v12, newEntry:Ljava/util/zip/ZipEntry;
  546. move-object/from16 v0, p0
  547.  
  548. iget-object v0, v0, Ljava/util/zip/ZipFile;->mEntries:Ljava/util/LinkedHashMap;
  549.  
  550. move-object/from16 v20, v0
  551.  
  552. invoke-virtual {v12}, Ljava/util/zip/ZipEntry;->getName()Ljava/lang/String;
  553.  
  554. move-result-object v21
  555.  
  556. move-object/from16 v0, v20
  557.  
  558. move-object/from16 v1, v21
  559.  
  560. invoke-virtual {v0, v1, v12}, Ljava/util/LinkedHashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
  561.  
  562. .line 364
  563. add-int/lit8 v10, v10, 0x1
  564.  
  565. goto :goto_0
  566.  
  567. .line 368
  568. .end local v12 #newEntry:Ljava/util/zip/ZipEntry;
  569. :cond_6
  570. return-void
  571. .end method
  572.  
  573.  
  574. # virtual methods
  575. .method public close()V
  576. .locals 3
  577. .annotation system Ldalvik/annotation/Throws;
  578. value = {
  579. Ljava/io/IOException;
  580. }
  581. .end annotation
  582.  
  583. .prologue
  584. const/4 v2, 0x0
  585.  
  586. .line 169
  587. iget-object v1, p0, Ljava/util/zip/ZipFile;->guard:Ldalvik/system/CloseGuard;
  588.  
  589. invoke-virtual {v1}, Ldalvik/system/CloseGuard;->close()V
  590.  
  591. .line 170
  592. iget-object v0, p0, Ljava/util/zip/ZipFile;->mRaf:Ljava/io/RandomAccessFile;
  593.  
  594. .line 172
  595. .local v0, raf:Ljava/io/RandomAccessFile;
  596. if-eqz v0, :cond_0
  597.  
  598. .line 173
  599. monitor-enter v0
  600.  
  601. .line 174
  602. const/4 v1, 0x0
  603.  
  604. :try_start_0
  605. iput-object v1, p0, Ljava/util/zip/ZipFile;->mRaf:Ljava/io/RandomAccessFile;
  606.  
  607. .line 175
  608. invoke-virtual {v0}, Ljava/io/RandomAccessFile;->close()V
  609.  
  610. .line 176
  611. monitor-exit v0
  612. :try_end_0
  613. .catchall {:try_start_0 .. :try_end_0} :catchall_0
  614.  
  615. .line 177
  616. iget-object v1, p0, Ljava/util/zip/ZipFile;->fileToDeleteOnClose:Ljava/io/File;
  617.  
  618. if-eqz v1, :cond_0
  619.  
  620. .line 178
  621. iget-object v1, p0, Ljava/util/zip/ZipFile;->fileToDeleteOnClose:Ljava/io/File;
  622.  
  623. invoke-virtual {v1}, Ljava/io/File;->delete()Z
  624.  
  625. .line 179
  626. iput-object v2, p0, Ljava/util/zip/ZipFile;->fileToDeleteOnClose:Ljava/io/File;
  627.  
  628. .line 182
  629. :cond_0
  630. return-void
  631.  
  632. .line 176
  633. :catchall_0
  634. move-exception v1
  635.  
  636. :try_start_1
  637. monitor-exit v0
  638. :try_end_1
  639. .catchall {:try_start_1 .. :try_end_1} :catchall_0
  640.  
  641. throw v1
  642. .end method
  643.  
  644. .method public entries()Ljava/util/Enumeration;
  645. .locals 2
  646. .annotation system Ldalvik/annotation/Signature;
  647. value = {
  648. "()",
  649. "Ljava/util/Enumeration",
  650. "<+",
  651. "Ljava/util/zip/ZipEntry;",
  652. ">;"
  653. }
  654. .end annotation
  655.  
  656. .prologue
  657. .line 198
  658. invoke-direct {p0}, Ljava/util/zip/ZipFile;->checkNotClosed()V
  659.  
  660. .line 199
  661. iget-object v1, p0, Ljava/util/zip/ZipFile;->mEntries:Ljava/util/LinkedHashMap;
  662.  
  663. invoke-virtual {v1}, Ljava/util/LinkedHashMap;->values()Ljava/util/Collection;
  664.  
  665. move-result-object v1
  666.  
  667. invoke-interface {v1}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;
  668.  
  669. move-result-object v0
  670.  
  671. .line 201
  672. .local v0, iterator:Ljava/util/Iterator;,"Ljava/util/Iterator<Ljava/util/zip/ZipEntry;>;"
  673. new-instance v1, Ljava/util/zip/ZipFile$1;
  674.  
  675. invoke-direct {v1, p0, v0}, Ljava/util/zip/ZipFile$1;-><init>(Ljava/util/zip/ZipFile;Ljava/util/Iterator;)V
  676.  
  677. return-object v1
  678. .end method
  679.  
  680. .method protected finalize()V
  681. .locals 2
  682. .annotation system Ldalvik/annotation/Throws;
  683. value = {
  684. Ljava/io/IOException;
  685. }
  686. .end annotation
  687.  
  688. .prologue
  689. .line 150
  690. :try_start_0
  691. iget-object v1, p0, Ljava/util/zip/ZipFile;->guard:Ldalvik/system/CloseGuard;
  692.  
  693. if-eqz v1, :cond_0
  694.  
  695. .line 151
  696. iget-object v1, p0, Ljava/util/zip/ZipFile;->guard:Ldalvik/system/CloseGuard;
  697.  
  698. invoke-virtual {v1}, Ldalvik/system/CloseGuard;->warnIfOpen()V
  699. :try_end_0
  700. .catchall {:try_start_0 .. :try_end_0} :catchall_0
  701.  
  702. .line 155
  703. :cond_0
  704. :try_start_1
  705. invoke-super {p0}, Ljava/lang/Object;->finalize()V
  706. :try_end_1
  707. .catch Ljava/lang/Throwable; {:try_start_1 .. :try_end_1} :catch_0
  708.  
  709. .line 160
  710. return-void
  711.  
  712. .line 156
  713. :catch_0
  714. move-exception v0
  715.  
  716. .line 157
  717. .local v0, t:Ljava/lang/Throwable;
  718. new-instance v1, Ljava/lang/AssertionError;
  719.  
  720. invoke-direct {v1, v0}, Ljava/lang/AssertionError;-><init>(Ljava/lang/Object;)V
  721.  
  722. throw v1
  723.  
  724. .line 154
  725. .end local v0 #t:Ljava/lang/Throwable;
  726. :catchall_0
  727. move-exception v1
  728.  
  729. .line 155
  730. :try_start_2
  731. invoke-super {p0}, Ljava/lang/Object;->finalize()V
  732. :try_end_2
  733. .catch Ljava/lang/Throwable; {:try_start_2 .. :try_end_2} :catch_1
  734.  
  735. .line 157
  736. throw v1
  737.  
  738. .line 156
  739. :catch_1
  740. move-exception v0
  741.  
  742. .line 157
  743. .restart local v0 #t:Ljava/lang/Throwable;
  744. new-instance v1, Ljava/lang/AssertionError;
  745.  
  746. invoke-direct {v1, v0}, Ljava/lang/AssertionError;-><init>(Ljava/lang/Object;)V
  747.  
  748. throw v1
  749. .end method
  750.  
  751. .method public getEntry(Ljava/lang/String;)Ljava/util/zip/ZipEntry;
  752. .locals 4
  753. .parameter "entryName"
  754.  
  755. .prologue
  756. .line 224
  757. invoke-direct {p0}, Ljava/util/zip/ZipFile;->checkNotClosed()V
  758.  
  759. .line 225
  760. if-nez p1, :cond_0
  761.  
  762. .line 226
  763. new-instance v1, Ljava/lang/NullPointerException;
  764.  
  765. invoke-direct {v1}, Ljava/lang/NullPointerException;-><init>()V
  766.  
  767. throw v1
  768.  
  769. .line 229
  770. :cond_0
  771. iget-object v1, p0, Ljava/util/zip/ZipFile;->mEntries:Ljava/util/LinkedHashMap;
  772.  
  773. invoke-virtual {v1, p1}, Ljava/util/LinkedHashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
  774.  
  775. move-result-object v0
  776.  
  777. check-cast v0, Ljava/util/zip/ZipEntry;
  778.  
  779. .line 230
  780. .local v0, ze:Ljava/util/zip/ZipEntry;
  781. if-nez v0, :cond_1
  782.  
  783. .line 231
  784. iget-object v1, p0, Ljava/util/zip/ZipFile;->mEntries:Ljava/util/LinkedHashMap;
  785.  
  786. new-instance v2, Ljava/lang/StringBuilder;
  787.  
  788. invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
  789.  
  790. invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  791.  
  792. move-result-object v2
  793.  
  794. const-string v3, "/"
  795.  
  796. invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  797.  
  798. move-result-object v2
  799.  
  800. invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  801.  
  802. move-result-object v2
  803.  
  804. invoke-virtual {v1, v2}, Ljava/util/LinkedHashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
  805.  
  806. move-result-object v0
  807.  
  808. .end local v0 #ze:Ljava/util/zip/ZipEntry;
  809. check-cast v0, Ljava/util/zip/ZipEntry;
  810.  
  811. .line 233
  812. .restart local v0 #ze:Ljava/util/zip/ZipEntry;
  813. :cond_1
  814. return-object v0
  815. .end method
  816.  
  817. .method public getInputStream(Ljava/util/zip/ZipEntry;)Ljava/io/InputStream;
  818. .locals 10
  819. .parameter "entry"
  820. .annotation system Ldalvik/annotation/Throws;
  821. value = {
  822. Ljava/io/IOException;
  823. }
  824. .end annotation
  825.  
  826. .prologue
  827. .line 248
  828. invoke-virtual {p1}, Ljava/util/zip/ZipEntry;->getName()Ljava/lang/String;
  829.  
  830. move-result-object v5
  831.  
  832. invoke-virtual {p0, v5}, Ljava/util/zip/ZipFile;->getEntry(Ljava/lang/String;)Ljava/util/zip/ZipEntry;
  833.  
  834. move-result-object p1
  835.  
  836. .line 249
  837. if-nez p1, :cond_0
  838.  
  839. .line 250
  840. const/4 v4, 0x0
  841.  
  842. .line 272
  843. :goto_0
  844. return-object v4
  845.  
  846. .line 254
  847. :cond_0
  848. iget-object v3, p0, Ljava/util/zip/ZipFile;->mRaf:Ljava/io/RandomAccessFile;
  849.  
  850. .line 255
  851. .local v3, raf:Ljava/io/RandomAccessFile;
  852. monitor-enter v3
  853.  
  854. .line 260
  855. :try_start_0
  856. new-instance v4, Ljava/util/zip/ZipFile$RAFStream;
  857.  
  858. iget-wide v5, p1, Ljava/util/zip/ZipEntry;->mLocalHeaderRelOffset:J
  859.  
  860. const-wide/16 v7, 0x1c
  861.  
  862. add-long/2addr v5, v7
  863.  
  864. invoke-direct {v4, v3, v5, v6}, Ljava/util/zip/ZipFile$RAFStream;-><init>(Ljava/io/RandomAccessFile;J)V
  865.  
  866. .line 261
  867. .local v4, rafstrm:Ljava/util/zip/ZipFile$RAFStream;
  868. new-instance v1, Ljava/io/DataInputStream;
  869.  
  870. invoke-direct {v1, v4}, Ljava/io/DataInputStream;-><init>(Ljava/io/InputStream;)V
  871.  
  872. .line 262
  873. .local v1, is:Ljava/io/DataInputStream;
  874. invoke-virtual {v1}, Ljava/io/DataInputStream;->readShort()S
  875.  
  876. move-result v5
  877.  
  878. invoke-static {v5}, Ljava/lang/Short;->reverseBytes(S)S
  879.  
  880. move-result v2
  881.  
  882. .line 263
  883. .local v2, localExtraLenOrWhatever:I
  884. invoke-virtual {v1}, Ljava/io/DataInputStream;->close()V
  885.  
  886. .line 266
  887. iget v5, p1, Ljava/util/zip/ZipEntry;->nameLength:I
  888.  
  889. add-int/2addr v5, v2
  890.  
  891. int-to-long v5, v5
  892.  
  893. invoke-virtual {v4, v5, v6}, Ljava/util/zip/ZipFile$RAFStream;->skip(J)J
  894.  
  895. .line 267
  896. iget-wide v5, v4, Ljava/util/zip/ZipFile$RAFStream;->mOffset:J
  897.  
  898. iget-wide v7, p1, Ljava/util/zip/ZipEntry;->compressedSize:J
  899.  
  900. add-long/2addr v5, v7
  901.  
  902. iput-wide v5, v4, Ljava/util/zip/ZipFile$RAFStream;->mLength:J
  903.  
  904. .line 268
  905. iget v5, p1, Ljava/util/zip/ZipEntry;->compressionMethod:I
  906.  
  907. const/16 v6, 0x8
  908.  
  909. if-ne v5, v6, :cond_1
  910.  
  911. .line 269
  912. const/16 v5, 0x400
  913.  
  914. invoke-virtual {p1}, Ljava/util/zip/ZipEntry;->getSize()J
  915.  
  916. move-result-wide v6
  917.  
  918. const-wide/32 v8, 0xffff
  919.  
  920. invoke-static {v6, v7, v8, v9}, Ljava/lang/Math;->min(JJ)J
  921.  
  922. move-result-wide v6
  923.  
  924. long-to-int v6, v6
  925.  
  926. invoke-static {v5, v6}, Ljava/lang/Math;->max(II)I
  927.  
  928. move-result v0
  929.  
  930. .line 270
  931. .local v0, bufSize:I
  932. new-instance v5, Ljava/util/zip/ZipFile$ZipInflaterInputStream;
  933.  
  934. new-instance v6, Ljava/util/zip/Inflater;
  935.  
  936. const/4 v7, 0x1
  937.  
  938. invoke-direct {v6, v7}, Ljava/util/zip/Inflater;-><init>(Z)V
  939.  
  940. invoke-direct {v5, v4, v6, v0, p1}, Ljava/util/zip/ZipFile$ZipInflaterInputStream;-><init>(Ljava/io/InputStream;Ljava/util/zip/Inflater;ILjava/util/zip/ZipEntry;)V
  941.  
  942. monitor-exit v3
  943.  
  944. move-object v4, v5
  945.  
  946. goto :goto_0
  947.  
  948. .line 272
  949. .end local v0 #bufSize:I
  950. :cond_1
  951. monitor-exit v3
  952.  
  953. goto :goto_0
  954.  
  955. .line 274
  956. .end local v1 #is:Ljava/io/DataInputStream;
  957. .end local v2 #localExtraLenOrWhatever:I
  958. .end local v4 #rafstrm:Ljava/util/zip/ZipFile$RAFStream;
  959. :catchall_0
  960. move-exception v5
  961.  
  962. monitor-exit v3
  963. :try_end_0
  964. .catchall {:try_start_0 .. :try_end_0} :catchall_0
  965.  
  966. throw v5
  967. .end method
  968.  
  969. .method public getName()Ljava/lang/String;
  970. .locals 1
  971.  
  972. .prologue
  973. .line 283
  974. iget-object v0, p0, Ljava/util/zip/ZipFile;->fileName:Ljava/lang/String;
  975.  
  976. return-object v0
  977. .end method
  978.  
  979. .method public size()I
  980. .locals 1
  981.  
  982. .prologue
  983. .line 293
  984. invoke-direct {p0}, Ljava/util/zip/ZipFile;->checkNotClosed()V
  985.  
  986. .line 294
  987. iget-object v0, p0, Ljava/util/zip/ZipFile;->mEntries:Ljava/util/LinkedHashMap;
  988.  
  989. invoke-virtual {v0}, Ljava/util/LinkedHashMap;->size()I
  990.  
  991. move-result v0
  992.  
  993. return v0
  994. .end method
RAW Paste Data