blob: 522be29c273518591321a9a189572a5c6eb5ecae [file] [log] [blame]
Ian Zernydcb172e2022-02-22 15:36:45 +01001#!/usr/bin/env python3
Mathias Ravdd6a6de2018-05-18 10:18:33 +02002# Copyright (c) 2018, the R8 project authors. Please see the AUTHORS file
3# for details. All rights reserved. Use of this source code is governed by a
4# BSD-style license that can be found in the LICENSE file.
5
Christoffer Quist Adamsen4c6d15d2022-09-08 11:30:04 +02006import argparse
Mathias Ravdd6a6de2018-05-18 10:18:33 +02007import sys
8import toolhelper
9
Christoffer Quist Adamsen2434a4d2023-10-16 11:29:03 +020010
Christoffer Quist Adamsen4c6d15d2022-09-08 11:30:04 +020011def extractmarker(apk_or_dex, build=True):
Christoffer Quist Adamsen2434a4d2023-10-16 11:29:03 +020012 stdout = toolhelper.run('extractmarker', [apk_or_dex],
13 build=build,
14 return_stdout=True)
15 return stdout
16
Christoffer Quist Adamsen4c6d15d2022-09-08 11:30:04 +020017
18def parse_options(argv):
Christoffer Quist Adamsen2434a4d2023-10-16 11:29:03 +020019 result = argparse.ArgumentParser(
20 description='Relayout a given APK using a startup profile.')
21 result.add_argument('--no-build',
22 action='store_true',
23 default=False,
24 help='To disable building using gradle')
25 options, args = result.parse_known_args(argv)
26 return options, args
27
Christoffer Quist Adamsen4c6d15d2022-09-08 11:30:04 +020028
29def main(argv):
Christoffer Quist Adamsen2434a4d2023-10-16 11:29:03 +020030 options, args = parse_options(argv)
31 build = not options.no_build
32 for apk_or_dex in args:
33 print(extractmarker(apk_or_dex, build=build))
34 build = False
35
Christoffer Quist Adamsen4c6d15d2022-09-08 11:30:04 +020036
Mathias Ravdd6a6de2018-05-18 10:18:33 +020037if __name__ == '__main__':
Christoffer Quist Adamsen2434a4d2023-10-16 11:29:03 +020038 sys.exit(main(sys.argv[1:]))