1 # Copyright 2013 The Chromium Authors. All rights reserved. 2 # Use of this source code is governed by a BSD-style license that can be 3 # found in the LICENSE file. 4 5 # This file is meant to be included into an action to provide an action that 6 # signs and zipaligns an APK. 7 # 8 # To use this, create a gyp action with the following form: 9 # { 10 # 'action_name': 'some descriptive action name', 11 # 'variables': { 12 # 'input_apk_path': 'relative/path/to/input.apk', 13 # 'output_apk_path': 'relative/path/to/output.apk', 14 # }, 15 # 'includes': [ '../../build/android/finalize_apk.gypi' ], 16 # }, 17 # 18 19 { 20 'message': 'Signing/aligning <(_target_name) APK: <(input_apk_path)', 21 'variables': { 22 'keystore_path%': '<(DEPTH)/build/android/ant/chromium-debug.keystore', 23 'keystore_name%': 'chromiumdebugkey', 24 'keystore_password%': 'chromium', 25 'conditions': [ 26 # Webview doesn't use zipalign. 27 ['android_webview_build==0', { 28 'zipalign_path%': ['<!@(find <(android_sdk_root) -name zipalign)'], 29 }, { 30 'zipalign_path%': "", 31 }], 32 ], 33 }, 34 'inputs': [ 35 '<(DEPTH)/build/android/gyp/util/build_utils.py', 36 '<(DEPTH)/build/android/gyp/finalize_apk.py', 37 '<(keystore_path)', 38 '<(input_apk_path)', 39 ], 40 'outputs': [ 41 '<(output_apk_path)', 42 ], 43 'action': [ 44 'python', '<(DEPTH)/build/android/gyp/finalize_apk.py', 45 '--zipalign-path=<(zipalign_path)', 46 '--unsigned-apk-path=<(input_apk_path)', 47 '--final-apk-path=<(output_apk_path)', 48 '--key-path=<(keystore_path)', 49 '--key-name=<(keystore_name)', 50 '--key-passwd=<(keystore_password)', 51 ], 52 } 53