Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3422)

Unified Diff: build/android/pylib/sdk/aapt.py

Issue 1200543002: [Android] Add support for installing split apks with adb_install_apk. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/adb_install_apk.py ('k') | build/android/pylib/sdk/split_select.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/sdk/aapt.py
diff --git a/build/android/pylib/sdk/aapt.py b/build/android/pylib/sdk/aapt.py
new file mode 100644
index 0000000000000000000000000000000000000000..3d317ff2c59a85e1182a805a718917103fffce0d
--- /dev/null
+++ b/build/android/pylib/sdk/aapt.py
@@ -0,0 +1,42 @@
+# 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.
+
+"""This module wraps the Android Asset Packaging Tool."""
+
+import os
+
+from pylib import cmd_helper
+from pylib import constants
+from pylib.utils import timeout_retry
+
+_AAPT_PATH = os.path.join(constants.ANDROID_SDK_TOOLS, 'aapt')
+
+def _RunAaptCmd(args):
+ """Runs an aapt command.
+
+ Args:
+ args: A list of arguments for aapt.
+
+ Returns:
+ The output of the command.
+ """
+ cmd = [_AAPT_PATH] + args
+ status, output = cmd_helper.GetCmdStatusAndOutput(cmd)
+ if status != 0:
+ raise Exception('Failed running aapt command: "%s" with output "%s".' %
+ (' '.join(cmd), output))
+ return output
+
+def Dump(what, apk, assets=None):
+ """Returns the output of the aapt dump command.
+
+ Args:
+ what: What you want to dump.
+ apk: Path to apk you want to dump information for.
+ assets: List of assets in apk you want to dump information for.
+ """
+ assets = assets or []
+ if isinstance(assets, basestring):
+ assets = [assets]
+ return _RunAaptCmd(['dump', what, apk] + assets).splitlines()
« no previous file with comments | « build/android/adb_install_apk.py ('k') | build/android/pylib/sdk/split_select.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698