mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-09-19 03:30:12 +02:00
parent
6a4b7ba4c1
commit
4197455436
@ -136,7 +136,7 @@ def get_embedded_classes(apkfile, depth=0):
|
||||
if depth > 10: # zipbomb protection
|
||||
return {_('Max recursion depth in ZIP file reached: %s') % apkfile}
|
||||
|
||||
apk_regex = re.compile(r'.*\.apk')
|
||||
archive_regex = re.compile(r'.*\.(aab|aar|apk|apks|jar|war|xapk|zip)$')
|
||||
class_regex = re.compile(r'classes.*\.dex')
|
||||
classes = set()
|
||||
|
||||
@ -144,7 +144,7 @@ def get_embedded_classes(apkfile, depth=0):
|
||||
with TemporaryDirectory() as tmp_dir, zipfile.ZipFile(apkfile, 'r') as apk_zip:
|
||||
for info in apk_zip.infolist():
|
||||
# apk files can contain apk files, again
|
||||
if apk_regex.search(info.filename):
|
||||
if archive_regex.search(info.filename):
|
||||
with apk_zip.open(info) as apk_fp:
|
||||
classes = classes.union(get_embedded_classes(apk_fp, depth + 1))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user