mirror of
https://github.com/ARM-software/devlib.git
synced 2025-02-07 13:40:48 +00:00
ApkInfo: Improve error for bad .apk files
Provide a more specific error, including the output from aapt.
This commit is contained in:
parent
7e073c1fce
commit
99aca25438
@ -135,7 +135,11 @@ class ApkInfo(object):
|
|||||||
_check_env()
|
_check_env()
|
||||||
command = [aapt, 'dump', 'badging', apk_path]
|
command = [aapt, 'dump', 'badging', apk_path]
|
||||||
logger.debug(' '.join(command))
|
logger.debug(' '.join(command))
|
||||||
output = subprocess.check_output(command)
|
try:
|
||||||
|
output = subprocess.check_output(command, stderr=subprocess.STDOUT)
|
||||||
|
except subprocess.CalledProcessError as e:
|
||||||
|
raise HostError('Error parsing APK file {}. `aapt` says:\n{}'
|
||||||
|
.format(apk_path, e.output))
|
||||||
for line in output.split('\n'):
|
for line in output.split('\n'):
|
||||||
if line.startswith('application-label:'):
|
if line.startswith('application-label:'):
|
||||||
self.label = line.split(':')[1].strip().replace('\'', '')
|
self.label = line.split(':')[1].strip().replace('\'', '')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user