Skip to content

Commit

Permalink
修正ZipFile读取逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
qux-bbb committed Feb 9, 2023
1 parent 53958ef commit 5798786
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion xanalyzer/file.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import io
import os
import re
import json
Expand Down Expand Up @@ -34,7 +35,8 @@ def guess_type_and_ext(self, the_content):
the_file_type = magic.from_buffer(the_content)
the_ext = []
if the_file_type.startswith("Zip archive data"):
the_zip = ZipFile(self.file_path)
the_file = io.BytesIO(the_content)
the_zip = ZipFile(the_file)
zip_namelist = the_zip.namelist()
the_zip.close()
if "AndroidManifest.xml" in zip_namelist:
Expand Down

0 comments on commit 5798786

Please sign in to comment.