| OLD | NEW |
| 1 #!/bin/bash -p | 1 #!/bin/bash -p |
| 2 | 2 |
| 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 # Using codesign, sign the contents of the versioned directory. Namely, this | 7 # Using codesign, sign the contents of the versioned directory. Namely, this |
| 8 # includes the framework and helper app. After signing, the signatures are | 8 # includes the framework and helper app. After signing, the signatures are |
| 9 # verified. | 9 # verified. |
| 10 | 10 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 app_mode_loader_tmp="$(mktemp -t app_mode_loader)" | 105 app_mode_loader_tmp="$(mktemp -t app_mode_loader)" |
| 106 cp "${app_mode_loader}" "${app_mode_loader_tmp}" | 106 cp "${app_mode_loader}" "${app_mode_loader_tmp}" |
| 107 | 107 |
| 108 codesign_with_options "${app_mode_loader_tmp}" \ | 108 codesign_with_options "${app_mode_loader_tmp}" \ |
| 109 "${enforcement_flags_helpers}" \ | 109 "${enforcement_flags_helpers}" \ |
| 110 "app_mode_loader" | 110 "app_mode_loader" |
| 111 | 111 |
| 112 cp "${app_mode_loader_tmp}" "${app_mode_loader}" | 112 cp "${app_mode_loader_tmp}" "${app_mode_loader}" |
| 113 rm -f "${app_mode_loader_tmp}" | 113 rm -f "${app_mode_loader_tmp}" |
| 114 | 114 |
| 115 xpc_plist="${notification_service}/Contents/Info" |
| 116 xpc_bundle_id="$(__CFPREFERENCES_AVOID_DAEMON=1 defaults read \ |
| 117 "${xpc_plist}" "CFBundleIdentifier")" |
| 118 |
| 115 codesign_with_options "${notification_service}" \ | 119 codesign_with_options "${notification_service}" \ |
| 116 "${enforcement_flags_helpers}" \ | 120 "${enforcement_flags_helpers}" \ |
| 117 "com.google.Chrome.framework.AlertNotificationService" | 121 "${xpc_bundle_id}" |
| 118 | 122 |
| 119 # Only sign widevine plugin if it is present in the bundle. | 123 # Only sign widevine plugin if it is present in the bundle. |
| 120 # ${enforcement_flags*} are meaningless for dynamic libraries. | 124 # ${enforcement_flags*} are meaningless for dynamic libraries. |
| 121 if [[ -f "${widevine_plugin}" ]]; then | 125 if [[ -f "${widevine_plugin}" ]]; then |
| 122 codesign_with_options "${widevine_plugin}" "" "widevinecdmadapter" | 126 codesign_with_options "${widevine_plugin}" "" "widevinecdmadapter" |
| 123 fi | 127 fi |
| 124 | 128 |
| 125 # The framework is a dylib, so ${enforcement_flags_helpers} are meaningless. | 129 # The framework is a dylib, so ${enforcement_flags_helpers} are meaningless. |
| 126 codesign_with_options "${framework}" "" "com.google.Chrome.framework" | 130 codesign_with_options "${framework}" "" "com.google.Chrome.framework" |
| 127 | 131 |
| 128 codesign_with_options "${helper_app}" \ | 132 codesign_with_options "${helper_app}" \ |
| 129 "${enforcement_flags_app}" \ | 133 "${enforcement_flags_app}" \ |
| 130 "com.google.Chrome.helper" | 134 "com.google.Chrome.helper" |
| 131 | 135 |
| 132 if [[ -f "${widevine_plugin}" ]]; then | 136 if [[ -f "${widevine_plugin}" ]]; then |
| 133 codesign_display_and_verify "${widevine_plugin}" | 137 codesign_display_and_verify "${widevine_plugin}" |
| 134 fi | 138 fi |
| 135 | 139 |
| 136 codesign_display_and_verify "${crashpad_handler}" --deep | 140 codesign_display_and_verify "${crashpad_handler}" --deep |
| 137 codesign_display_and_verify "${app_mode_loader}" --ignore-resources | 141 codesign_display_and_verify "${app_mode_loader}" --ignore-resources |
| 138 codesign_display_and_verify "${notification_service}" --deep | 142 codesign_display_and_verify "${notification_service}" --deep |
| 139 # The framework contains KeystoneRegistration.framework, which uses | 143 # The framework contains KeystoneRegistration.framework, which uses |
| 140 # custom resource rules, so use --no-strict to verify. | 144 # custom resource rules, so use --no-strict to verify. |
| 141 codesign_display_and_verify "${framework}" --deep --no-strict | 145 codesign_display_and_verify "${framework}" --deep --no-strict |
| 142 codesign_display_and_verify "${framework}" --strict | 146 codesign_display_and_verify "${framework}" --strict |
| 143 codesign_display_and_verify "${helper_app}" --deep | 147 codesign_display_and_verify "${helper_app}" --deep |
| OLD | NEW |