Rico Wind | 0ed24cc | 2018-03-23 07:16:35 +0100 | [diff] [blame] | 1 | #!/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 | |
| 6 | import subprocess |
| 7 | import utils |
| 8 | |
| 9 | def 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) |