Index: build/android/pylib/sdk/dexdump.py |
diff --git a/build/android/pylib/sdk/dexdump.py b/build/android/pylib/sdk/dexdump.py |
new file mode 100644 |
index 0000000000000000000000000000000000000000..fde6867a16411aca6ae97fc71358e917ea50708d |
--- /dev/null |
+++ b/build/android/pylib/sdk/dexdump.py |
@@ -0,0 +1,30 @@ |
+# Copyright 2015 The Chromium Authors. All rights reserved. |
+# Use of this source code is governed by a BSD-style license that can be |
+# found in the LICENSE file. |
+ |
+import os |
+ |
+from pylib import cmd_helper |
+from pylib import constants |
+ |
+_DEXDUMP_PATH = os.path.join(constants.ANDROID_SDK_TOOLS, 'dexdump') |
+ |
+def DexDump(dexfiles, file_summary=False): |
+ """A wrapper around the Android SDK's dexdump tool. |
+ |
+ Args: |
+ dexfiles: The dexfile or list of dex files to dump. |
+ file_summary: Display summary information from the file header. (-f) |
+ |
+ Returns: |
+ An iterable over the output lines. |
+ """ |
+ # TODO(jbudorick): Add support for more options as necessary. |
+ if isinstance(dexfiles, basestring): |
+ dexfiles = [dexfiles] |
+ args = [os.path.join(constants.ANDROID_SDK_TOOLS, 'dexdump')] + dexfiles |
mikecase (-- gone --)
2015/06/19 15:45:26
s/os.path.join(constants.ANDROID_SDK_TOOLS, 'dexdu
jbudorick
2015/06/19 16:25:56
hah, I got halfway there.
Done.
|
+ if file_summary: |
+ args.append('-f') |
+ |
+ return cmd_helper.IterCmdOutputLines(args) |
+ |