-
Notifications
You must be signed in to change notification settings - Fork 208
/
Copy pathcreate_patched_sdk.sh
executable file
·44 lines (34 loc) · 1.05 KB
/
create_patched_sdk.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env bash
if [ "${1}" == "-h" ] || [ "${1}" == "--help" ]; then
echo "Usage: ${0} <symbols-path> <sdk-output-path> <base-sdk-path> <tbd-tool>"
exit 0
fi
if [ $# -ne 4 ]; then
exit 1
fi
SYMBOLS_PATH="${1}"
if [ -z "${SYMBOLS_PATH}" ]; then
exit 1
fi
SDK_OUTPUT_PATH="${2}"
if [ -z "${SDK_OUTPUT_PATH}" ]; then
exit 1
fi
BASE_SDK_PATH="${3}"
if [ -z "${BASE_SDK_PATH}" ]; then
exit 1
fi
TBD_TOOL_PATH="${4}"
if [ -z "${TBD_TOOL_PATH}" ]; then
exit 1
fi
# tbd info
TBD_OUTPUT_VERSION="v3"
archs_option=("--replace-archs" armv7 armv7s arm64 arm64e)
tbd_options=("--ignore-clients" "--ignore-undefineds" "--allow-private-objc-symbols" "--ignore-missing-exports")
write_options=("--preserve-subdirs" "--replace-path-extension")
# trailing slash is important since often the BASE_SDK_PATH is a symlink to a real SDK
cp -a "${BASE_SDK_PATH}/" "${SDK_OUTPUT_PATH}"
"${TBD_TOOL_PATH}" \
-p "${tbd_options[@]}" "${archs_option[@]}" -v "${TBD_OUTPUT_VERSION}" -r all "${SYMBOLS_PATH}" \
-o "${write_options[@]}" "${SDK_OUTPUT_PATH}"