Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 #! /usr/bin/env python | |
| 2 # Copyright 2015 The Chromium Authors. All rights reserved. | |
| 3 # Use of this source code is governed by a BSD-style license that can be | |
| 4 # found in the LICENSE file. | |
| 5 | |
| 6 import argparse | |
| 7 import re | |
| 8 import sys | |
| 9 | |
| 10 from pylib.sdk import dexdump | |
| 11 | |
| 12 _METHOD_IDS_SIZE_RE = re.compile(r'^method_ids_size +: +(\d+)$') | |
| 13 | |
| 14 def MethodCount(dexfile): | |
| 15 for line in dexdump.DexDump(dexfile, file_summary=True): | |
| 16 m = _METHOD_IDS_SIZE_RE.match(line) | |
| 17 if m: | |
| 18 return m.group(1) | |
| 19 raise Exception('"method_ids_size" not found in dex dump of %s' % dexfile) | |
| 20 | |
| 21 def main(): | |
| 22 parser = argparse.ArgumentParser() | |
| 23 parser.add_argument('dexfile') | |
| 24 | |
| 25 args = parser.parse_args() | |
| 26 | |
| 27 print MethodCount(args.dexfile) | |
|
mikecase (-- gone --)
2015/06/19 15:45:26
Can you use python logging here? Is something goin
jbudorick
2015/06/19 16:25:56
this actually needs to use build/util/lib/common/p
| |
| 28 return 0 | |
| 29 | |
| 30 if __name__ == '__main__': | |
| 31 sys.exit(main()) | |
| 32 | |
| OLD | NEW |