| OLD | NEW |
| (Empty) |
| 1 #!/bin/sh | |
| 2 | |
| 3 # Copyright (c) 2009 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 | |
| 7 # Using codesign, sign the application. Inner components are signed as needed, | |
| 8 # then the outermost bundle is signed, and everything is verified. | |
| 9 | |
| 10 set -e | |
| 11 | |
| 12 if [ $# -ne 3 ] ; then | |
| 13 echo "usage: ${0} APP_PATH CODESIGN_KEYCHAIN CODESIGN_ID" >& 2 | |
| 14 exit 1 | |
| 15 fi | |
| 16 | |
| 17 APP_PATH="${1}" | |
| 18 CODESIGN_KEYCHAIN="${2}" | |
| 19 CODESIGN_ID="${3}" | |
| 20 | |
| 21 # Use custom resource rules for the browser application. | |
| 22 BROWSER_APP_RULES="$(dirname "${0}")/app_resource_rules.plist" | |
| 23 | |
| 24 # An .app bundle to be signed can be signed directly. Normally, signging a | |
| 25 # framework bundle requires that each version within be signed individually. | |
| 26 # http://developer.apple.com/mac/library/technotes/tn2007/tn2206.html#TNTAG13 | |
| 27 # In Chrome's case, the framework bundle is unversioned, so it too can be | |
| 28 # signed directly. See copy_framework_unversioned. | |
| 29 | |
| 30 BROWSER_APP="${APP_PATH}" | |
| 31 FRAMEWORK="${BROWSER_APP}/Contents/Versions/@VERSION@/@MAC_PRODUCT_NAME@ Framewo
rk.framework" | |
| 32 HELPER_APP="${BROWSER_APP}/Contents/Versions/@VERSION@/@MAC_PRODUCT_NAME@ Helper
.app" | |
| 33 | |
| 34 echo "${0}: signing..." | |
| 35 | |
| 36 # Sign the outer .app last so that its seal includes the signed inner | |
| 37 # components. | |
| 38 | |
| 39 codesign -s "${CODESIGN_ID}" --keychain "${CODESIGN_KEYCHAIN}" "${FRAMEWORK}" | |
| 40 codesign -s "${CODESIGN_ID}" --keychain "${CODESIGN_KEYCHAIN}" "${HELPER_APP}" | |
| 41 codesign -s "${CODESIGN_ID}" --keychain "${CODESIGN_KEYCHAIN}" \ | |
| 42 "${BROWSER_APP}" --resource-rules "${BROWSER_APP_RULES}" | |
| 43 | |
| 44 # Verify everything to ensure that signing the outer bundle didn't break an | |
| 45 # inner bundle. | |
| 46 | |
| 47 echo "${0}: verifying..." | |
| 48 | |
| 49 codesign -v "${FRAMEWORK}" | |
| 50 codesign -v "${HELPER_APP}" | |
| 51 codesign -v "${BROWSER_APP}" | |
| OLD | NEW |