Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(543)

Side by Side Diff: chrome/test/data/safe_browsing/dmg/generate_test_data.sh

Issue 2926473002: Mac Archive Type Sniffing (Closed)
Patch Set: avoiding multiple asynchronous calls in tester for mac Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/test/BUILD.gn ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/sh 1 #!/bin/sh
2 2
3 # Copyright 2015 The Chromium Authors. All rights reserved. 3 # Copyright 2015 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 set -eu 7 set -eu
8 8
9 THIS_DIR=$(dirname "$0") 9 THIS_DIR=$(dirname "$0")
10 10
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 touch "${FAKE_APP}/../Info.plist" 77 touch "${FAKE_APP}/../Info.plist"
78 78
79 mkdir "${DMG_SOURCE}/.hidden" 79 mkdir "${DMG_SOURCE}/.hidden"
80 cp "${THIS_DIR}/../mach_o/lib64.dylib" "${DMG_SOURCE}/.hidden/" 80 cp "${THIS_DIR}/../mach_o/lib64.dylib" "${DMG_SOURCE}/.hidden/"
81 81
82 hdiutil create -srcfolder "${DMG_SOURCE}" \ 82 hdiutil create -srcfolder "${DMG_SOURCE}" \
83 -format UDZO -layout SPUD -volname "Mach-O in DMG" -ov \ 83 -format UDZO -layout SPUD -volname "Mach-O in DMG" -ov \
84 "${OUT_DIR}/mach_o_in_dmg" 84 "${OUT_DIR}/mach_o_in_dmg"
85 85
86 rm -rf "${DMG_SOURCE}" 86 rm -rf "${DMG_SOURCE}"
87
88 # Copy of Mach-O DMG with 'koly' signature overwritten #######################
89 cp "${OUT_DIR}/mach_o_in_dmg.dmg" \
90 "${OUT_DIR}/mach_o_in_dmg_no_koly_signature.dmg"
91 # Gets size of Mach-O DMG copy.
92 SIZE=`stat -f%z "${OUT_DIR}/mach_o_in_dmg_no_koly_signature.dmg"`
93 # Overwrites 'koly' with '????'.
94 printf '\xa1\xa1\xa1\xa1' | dd conv=notrunc \
95 of="${OUT_DIR}/mach_o_in_dmg_no_koly_signature.dmg" \
96 bs=1 seek=$(($SIZE - 512))
97
98 # Copy of Mach-O DMG with extension changed to .txt.
99 cp "${OUT_DIR}/mach_o_in_dmg.dmg" "${OUT_DIR}/mach_o_in_dmg.txt"
100
101 # Copy of Mach-O DMG with extension changed to .txt and no 'koly' signature ##
102 cp "${OUT_DIR}/mach_o_in_dmg_no_koly_signature.dmg" \
103 "${OUT_DIR}/mach_o_in_dmg_no_koly_signature.txt"
87 } 104 }
88 105
89 # Silence any stdout, but keep stderr. 106 # Silence any stdout, but keep stderr.
90 generate_test_data > /dev/null 107 generate_test_data > /dev/null
OLDNEW
« no previous file with comments | « chrome/test/BUILD.gn ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698