blob: a4c0471650c340ec0deda4811f12ef06aaf40592 [file] [log] [blame]
Rico Wind0ed24cc2018-03-23 07:16:35 +01001#!/usr/bin/env python
2# 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
6import subprocess
7import utils
8
9def sign(unsigned_apk, signed_apk, keystore):
10 print 'Signing (ignore the warnings)'
11 cmd = ['zip', '-d', unsigned_apk, 'META-INF/*']
12 utils.PrintCmd(cmd)
13 subprocess.call(cmd)
14 cmd = [
15 'jarsigner',
16 '-sigalg', 'SHA1withRSA',
17 '-digestalg', 'SHA1',
18 '-keystore', keystore,
19 '-storepass', 'android',
20 '-signedjar', signed_apk,
21 unsigned_apk,
22 'androiddebugkey'
23 ]
24 utils.PrintCmd(cmd)
25 subprocess.check_call(cmd)