OLD | NEW |
(Empty) | |
| 1 #!/usr/bin/env python |
| 2 # |
| 3 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. |
| 6 """Signs and zipaligns split APKs. |
| 7 |
| 8 This script is require only by GYP (not GN). |
| 9 """ |
| 10 |
| 11 import optparse |
| 12 import sys |
| 13 |
| 14 import finalize_apk |
| 15 |
| 16 def main(): |
| 17 parser = optparse.OptionParser() |
| 18 parser.add_option('--zipalign-path', help='Path to the zipalign tool.') |
| 19 parser.add_option('--resource-packaged-apk-path', |
| 20 help='Base path to input .ap_s.') |
| 21 parser.add_option('--base-output-path', |
| 22 help='Path to output .apk, minus extension.') |
| 23 parser.add_option('--key-path', help='Path to keystore for signing.') |
| 24 parser.add_option('--key-passwd', help='Keystore password') |
| 25 parser.add_option('--key-name', help='Keystore name') |
| 26 parser.add_option('--densities', |
| 27 help='Comma separated list of densities finalize.') |
| 28 |
| 29 options, _ = parser.parse_args() |
| 30 options.load_library_from_zip = 0 |
| 31 |
| 32 if options.densities: |
| 33 for density in options.densities.split(','): |
| 34 options.unsigned_apk_path = ("%s-%s" % |
| 35 (options.resource_packaged_apk_path, density)) |
| 36 options.final_apk_path = ("%s-density-%s.apk" % |
| 37 (options.base_output_path, density)) |
| 38 finalize_apk.FinalizeApk(options) |
| 39 else: |
| 40 raise Exception('Language splits not yet implemented') |
| 41 |
| 42 |
| 43 if __name__ == '__main__': |
| 44 sys.exit(main()) |
OLD | NEW |