Make method_count.py work properly for .apks with multidex enabled
It was counting only classes.dex and not classes2.dex BUG=none Review-Url: https://codereview.chromium.org/1948673002 Cr-Original-Commit-Position: refs/heads/master@{#391344} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: 31f707dbeeb6b5461e146582e22436c12a1369f2
This commit is contained in:
Родитель
653c1f1ab1
Коммит
0115dac01c
|
@ -23,13 +23,14 @@ import perf_tests_results_helper # pylint: disable=import-error
|
|||
_METHOD_IDS_SIZE_RE = re.compile(r'^method_ids_size +: +(\d+)$')
|
||||
|
||||
def ExtractIfZip(dexfile, tmpdir):
|
||||
if not dexfile.endswith('.zip'):
|
||||
if not os.path.splitext(dexfile)[1] in ('.zip', '.apk', '.jar'):
|
||||
return [dexfile]
|
||||
|
||||
with zipfile.ZipFile(dexfile, 'r') as z:
|
||||
z.extractall(tmpdir)
|
||||
dex_files = [n for n in z.namelist() if n.endswith('.dex')]
|
||||
z.extractall(tmpdir, dex_files)
|
||||
|
||||
return [os.path.join(tmpdir, f) for f in os.listdir(tmpdir)]
|
||||
return [os.path.join(tmpdir, f) for f in dex_files]
|
||||
|
||||
def SingleMethodCount(dexfile):
|
||||
for line in dexdump.DexDump(dexfile, file_summary=True):
|
||||
|
|
Загрузка…
Ссылка в новой задаче