fix
This commit is contained in:
parent
9027220508
commit
096e38ec12
2 changed files with 10 additions and 9 deletions
|
|
@ -158,9 +158,10 @@ def main():
|
|||
for sha256 in sha256s:
|
||||
if args.output_dir and (args.output_dir / sha256).exists():
|
||||
continue
|
||||
with zipfile.ZipFile(
|
||||
io.BytesIO(download_apk(sha256, api_key, logfile=logfile))
|
||||
) as apk:
|
||||
apk_bin = download_apk(sha256, api_key, logfile=logfile)
|
||||
if apk_bin is None:
|
||||
continue
|
||||
with zipfile.ZipFile(io.BytesIO(apk_bin)) as apk:
|
||||
entry = analyze(apk, sha256, verbose=args.pprint)
|
||||
if args.pprint:
|
||||
pprint.pprint(entry)
|
||||
|
|
|
|||
|
|
@ -38,10 +38,10 @@ def download_apk(
|
|||
else:
|
||||
print(log)
|
||||
time.sleep(delay)
|
||||
log = f"[{datetime.today().strftime('%Y-%m-%d %H:%M:%S')}] Failed to download {sha256}, abort"
|
||||
if logfile:
|
||||
with logfile.open("a") as file:
|
||||
file.write(f"{log}\n")
|
||||
else:
|
||||
print(log)
|
||||
log = f"[{datetime.today().strftime('%Y-%m-%d %H:%M:%S')}] Failed to download {sha256}, abort"
|
||||
if logfile:
|
||||
with logfile.open("a") as file:
|
||||
file.write(f"{log}\n")
|
||||
else:
|
||||
print(log)
|
||||
return None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue