xref: /aosp_15_r20/external/angle/build/android/gyp/create_app_bundle_apks.py (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1#!/usr/bin/env python3
2#
3# Copyright 2019 The Chromium Authors
4# Use of this source code is governed by a BSD-style license that can be
5# found in the LICENSE file.
6
7"""Creates an .apks from an .aab."""
8
9import argparse
10import os
11import sys
12
13sys.path.append(
14    os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)))
15from pylib.utils import app_bundle_utils
16
17
18def main():
19  parser = argparse.ArgumentParser(description=__doc__)
20  parser.add_argument(
21      '--bundle', required=True, help='Path to input .aab file.')
22  parser.add_argument(
23      '--output', required=True, help='Path to output .apks file.')
24  parser.add_argument('--aapt2-path', required=True, help='Path to aapt2.')
25  parser.add_argument(
26      '--keystore-path', required=True, help='Path to keystore.')
27  parser.add_argument(
28      '--keystore-password', required=True, help='Keystore password.')
29  parser.add_argument(
30      '--keystore-name', required=True, help='Key name within keystore')
31  parser.add_argument(
32      '--minimal',
33      action='store_true',
34      help='Create APKs archive with minimal language support.')
35  parser.add_argument('--local-testing',
36                      action='store_true',
37                      help='Create APKs archive with local testing support.')
38
39  args = parser.parse_args()
40
41  app_bundle_utils.GenerateBundleApks(args.bundle,
42                                      args.output,
43                                      args.aapt2_path,
44                                      args.keystore_path,
45                                      args.keystore_password,
46                                      args.keystore_name,
47                                      local_testing=args.local_testing,
48                                      minimal=args.minimal,
49                                      check_for_noop=False)
50
51
52if __name__ == '__main__':
53  main()
54