feat: 接入 iOSGuard LLVM 混淆工具链与 IPA 加固门禁,按分支策略兼容旧版本打包
- 新增 toolchain_manager:构建前自愈校验 LLVM opt 工具链,按 Xcode 版本与渠道隔离 obj_cache - readoor31/readoor31OtherPay Archive 透传 IG_DIST_CHANNEL/IG_OBF_MODE/IG_ALL_GUARD_OFF/IG_RELEASE_SEED - Archive 前核对分发渠道编译条件:上架包缺失 IG_APPSTORE_DISTRIBUTION 即阻断,非上架包带该条件仅告警,未接入 anti_tamper 的分支跳过 - 导出后执行 IPA 加固门禁审计,失败阻断上传;持久化 dSYM、混淆映射、诊断事件码与审计报告 - 混淆是否执行改由分支 AutoPacking/build_policy.json 声明:force_obfuscation=true 强制,否则按任务勾选,兼容旧分支/旧 Tag;恢复打包页混淆勾选框 - 分支未自带混淆脚本时回退服务端脚本并告警;同步更新服务端 L1 混淆脚本 - .gitignore 忽略 iosguard_cache 与 artifacts 运行时目录;README 补充分支打包策略说明
This commit is contained in:
@@ -23,7 +23,7 @@ STAMP="$(date +%Y%m%d_%H%M%S)"
|
||||
BACKUP_DIR="${DERIVED_DIR}/rd_obf_backup_${STAMP}"
|
||||
MARKER_FILE="${DERIVED_DIR}/rd_obf_marker_${TARGET_NAME:-app}.env"
|
||||
MAP_DIR="${ROOT}/obfuscation_maps"
|
||||
MAP_PATH="${MAP_DIR}/${TARGET_NAME:-app}_${STAMP}.json"
|
||||
MAP_PATH="${MAP_DIR}/symbol_map_${TARGET_NAME:-app}_${STAMP}.json"
|
||||
METHOD_MAP_PATH="${MAP_DIR}/method_map_${TARGET_NAME:-app}_${STAMP}.json"
|
||||
PRE_SUCCESS=0
|
||||
|
||||
|
||||
@@ -1,14 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Scan repository for residual obfuscated tokens like RdXXXXXX and fail if any found.
|
||||
# Scan repository for residual obfuscated tokens (both legacy Rd/YMH/ymh<hex> and curated natural CamelCase stems)
|
||||
# Exits 0 when clean, non-zero when tokens are present.
|
||||
|
||||
ROOT="${1:-$(cd "$(dirname "$0")/../../.." && pwd)}"
|
||||
|
||||
echo "[obf-check] Scanning for residual obfuscated tokens in ${ROOT}"
|
||||
|
||||
EXCLUDE=("./Pods" "./.git" "./obfuscation_maps" "./build_output" "./DerivedData" "./readoorTests")
|
||||
EXCLUDE=(
|
||||
"./Pods"
|
||||
"./.git"
|
||||
"./obfuscation_maps"
|
||||
"./build_output"
|
||||
"./DerivedData"
|
||||
"./readoorTests"
|
||||
"./iOSGuardIntegration"
|
||||
"./Factorys"
|
||||
"./AutoPacking"
|
||||
)
|
||||
|
||||
GREP_EXCLUDE_ARGS=()
|
||||
for e in "${EXCLUDE[@]}"; do
|
||||
@@ -16,15 +26,23 @@ for e in "${EXCLUDE[@]}"; do
|
||||
done
|
||||
|
||||
FOUND=0
|
||||
TOKEN_SUFFIX_RE='(?:[a-f0-9]{6}|[a-f0-9]{8}|[a-f0-9]{10})'
|
||||
TOKEN_SUFFIX_RE='([a-f0-9]{6}|[a-f0-9]{8}|[a-f0-9]{10})'
|
||||
STEM_GROUP='(Breeze|Birch|Canopy|Cobalt|Harbor|Kestrel|Linden|Lumen|Meadow|Meridian|Osprey|Prism|Solace|Summit|Timber|Zephyr)'
|
||||
NATURAL_TYPE_RE="\\b${STEM_GROUP}[A-Z][a-z]+([A-Z][a-z]+)+\\b"
|
||||
NATURAL_METHOD_RE="\\b[a-z]+${STEM_GROUP}[A-Z][A-Za-z]+\\b"
|
||||
|
||||
echo "[obf-check] Looking for token pattern '\b(?:Rd|YMH)${TOKEN_SUFFIX_RE}\b' in source files..."
|
||||
if grep -R --line-number -E "\\b(?:Rd|YMH)${TOKEN_SUFFIX_RE}\\b" --include='*.swift' --include='*.m' --include='*.mm' --include='*.h' "${ROOT}" "${GREP_EXCLUDE_ARGS[@]}"; then
|
||||
echo "[obf-check] Looking for legacy token pattern '\\b(Rd|YMH|ymh)${TOKEN_SUFFIX_RE}\\b' in source files..."
|
||||
if grep -R --line-number -E "\\b(Rd|YMH|ymh)${TOKEN_SUFFIX_RE}\\b" --include='*.swift' --include='*.m' --include='*.mm' --include='*.h' "${GREP_EXCLUDE_ARGS[@]}" "${ROOT}"; then
|
||||
FOUND=1
|
||||
fi
|
||||
|
||||
echo "[obf-check] Looking for natural CamelCase obfuscated tokens in source files..."
|
||||
if grep -R --line-number -E "${NATURAL_TYPE_RE}|${NATURAL_METHOD_RE}" --include='*.swift' --include='*.m' --include='*.mm' --include='*.h' "${GREP_EXCLUDE_ARGS[@]}" "${ROOT}"; then
|
||||
FOUND=1
|
||||
fi
|
||||
|
||||
echo "[obf-check] Looking for obfuscated header imports like \"(Rd|YMH)XXXXXX.h\"..."
|
||||
if grep -R --line-number -E "#import\\s+\"(?:Rd|YMH)${TOKEN_SUFFIX_RE}\\.h\"" --include='*.pch' --include='*.h' --include='*.m' --include='*.mm' "${ROOT}" "${GREP_EXCLUDE_ARGS[@]}"; then
|
||||
if grep -R --line-number -E "#import\\s+\"(Rd|YMH)${TOKEN_SUFFIX_RE}\\.h\"" --include='*.pch' --include='*.h' --include='*.m' --include='*.mm' "${GREP_EXCLUDE_ARGS[@]}" "${ROOT}"; then
|
||||
FOUND=1
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user