2019-01-19 04:37:51 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# script/update_headers
|
|
|
|
# mas
|
|
|
|
#
|
|
|
|
# Runs class-dump to generate headers for Apple private frameworks.
|
|
|
|
#
|
2015-09-14 08:02:40 +00:00
|
|
|
|
2024-11-16 04:21:37 +00:00
|
|
|
mas_dir="$(readlink -fn "$(dirname "${BASH_SOURCE:-"${0}"}")/..")"
|
|
|
|
|
|
|
|
if ! cd -- "${mas_dir}"; then
|
|
|
|
printf $'Error: Could not cd into mas directory: %s\n' "${mas_dir}" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2024-11-16 05:59:43 +00:00
|
|
|
if ! command -v class-dump >/dev/null; then
|
2024-11-16 05:56:52 +00:00
|
|
|
echo 'class-dump is not installed.' >&2
|
|
|
|
echo 'Download from http://stevenygard.com/projects/class-dump/' >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
2015-09-14 08:02:40 +00:00
|
|
|
|
|
|
|
extract_private_framework_headers() {
|
2024-11-16 02:46:11 +00:00
|
|
|
local framework_name="${1}"
|
2021-04-26 22:10:17 +00:00
|
|
|
local directory="Sources/PrivateFrameworks/${framework_name}"
|
2024-11-16 02:46:11 +00:00
|
|
|
mkdir -p "${directory}"
|
|
|
|
class-dump -Ho "${directory}" "/System/Library/PrivateFrameworks/${framework_name}.framework"
|
2015-09-14 08:02:40 +00:00
|
|
|
}
|
|
|
|
|
2024-11-16 05:56:52 +00:00
|
|
|
extract_private_framework_headers CommerceKit
|
|
|
|
extract_private_framework_headers StoreFoundation
|