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.
8 This script is require only by GYP (not GN).
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.')
29 options
, _
= parser
.parse_args()
30 options
.load_library_from_zip
= 0
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
)
40 raise Exception('Language splits not yet implemented')
43 if __name__
== '__main__':