Commit 39e6228e authored by Matthew Cary's avatar Matthew Cary Committed by Commit Bot

Android: add manifest dump to apk_operations.py.

This is needed by automated tools like third_party/catapult/devil to
examine the application details of a bundle.

Bug: 931269
Change-Id: I000bd53d444390778657e12a4d64ca0e06f38aa5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1477022Reviewed-by: default avatarEgor Pasko <pasko@chromium.org>
Reviewed-by: default avatarDavid Turner <digit@chromium.org>
Commit-Queue: Egor Pasko <pasko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#638568}
parent e245bc2f
...@@ -1471,6 +1471,17 @@ class _BuildBundleApks(_Command): ...@@ -1471,6 +1471,17 @@ class _BuildBundleApks(_Command):
mode=self.args.build_mode) mode=self.args.build_mode)
class _ManifestCommand(_Command):
name = 'dump-manifest'
description = 'Dump the android manifest from this bundle, as XML, to stdout.'
need_device_args = False
def Run(self):
bundletool.RunBundleTool([
'dump', 'manifest', '--bundle', self.bundle_generation_info.bundle_path
])
# Shared commands for regular APKs and app bundles. # Shared commands for regular APKs and app bundles.
_COMMANDS = [ _COMMANDS = [
_DevicesCommand, _DevicesCommand,
...@@ -1494,6 +1505,7 @@ _COMMANDS = [ ...@@ -1494,6 +1505,7 @@ _COMMANDS = [
# Commands specific to app bundles. # Commands specific to app bundles.
_BUNDLE_COMMANDS = [ _BUNDLE_COMMANDS = [
_BuildBundleApks, _BuildBundleApks,
_ManifestCommand,
] ]
......
...@@ -197,3 +197,10 @@ able to look at its content (with `unzip -l`), or install it manually with: ...@@ -197,3 +197,10 @@ able to look at its content (with `unzip -l`), or install it manually with:
--apks=/tmp/BundleFoo.apks \ --apks=/tmp/BundleFoo.apks \
--adb=$(which adb) --adb=$(which adb)
``` ```
The task of examining the manifest is simplified by running the following,
which dumps the application manifest as XML to stdout:
```sh
build/android/gyp/bundletool.py dump-manifest
```
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment