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:
shenlei
2026-11-24 12:03:54 +09:00
parent d13fcfcdea
commit 83a1db21e5
23 changed files with 3340 additions and 359 deletions
@@ -44,7 +44,12 @@ def build_canonical_symbol_tables(
swift_signatures.update(method_data["swift_signatures"])
canonical = {
"swift_symbols": sorted(swift_symbols),
"swift_symbols": [
name for name in sorted(swift_symbols)
if not already_obfuscated_re.match(name)
and name not in symbol_whitelist
and not name.startswith(symbol_prefix_whitelist)
],
"objc_symbols": [
name for name in sorted(objc_symbols)
if any(name.startswith(prefix) for prefix in objc_symbol_prefixes)
@@ -107,13 +112,24 @@ def build_type_mappings_from_canonical_table(canonical_tables: dict, salt: str,
return mapping_swift, mapping_objc
def build_method_mapping_from_canonical_table(canonical_tables: dict, salt: str, *, build_unique_mapping, method_prefix: str) -> dict:
def build_method_mapping_from_canonical_table(canonical_tables: dict, salt: str, *, build_unique_mapping, method_prefix: str, build_method_entries=None) -> dict:
swift_signature_mapping = canonical_tables.get("swift_signatures", {})
direct_methods = list(canonical_tables.get("direct_methods", []))
objc_selectors = list(canonical_tables.get("objc_selectors", []))
if build_method_entries is not None:
return build_method_entries(
direct_methods=direct_methods,
objc_selectors=objc_selectors,
swift_signatures=swift_signature_mapping,
salt=salt,
)
ordered_names = []
seen = set()
for bucket in (
canonical_tables.get("direct_methods", []),
canonical_tables.get("objc_selectors", []),
direct_methods,
objc_selectors,
sorted(swift_signature_mapping.keys()),
):
for name in bucket:
@@ -125,12 +141,12 @@ def build_method_mapping_from_canonical_table(canonical_tables: dict, salt: str,
combined_tokens = build_unique_mapping(ordered_names, salt, prefix=method_prefix)
method_mapping = {
name: combined_tokens[name]
for name in canonical_tables.get("direct_methods", [])
for name in direct_methods
if name in combined_tokens
}
method_mapping.update({
name: combined_tokens[name]
for name in canonical_tables.get("objc_selectors", [])
for name in objc_selectors
if name in combined_tokens
})
@@ -59,6 +59,8 @@ def _discover_files_via_os_walk(scan_dirs: list, allowed_exts: tuple, exclude_pa
def _discover_files_via_rg(scan_dirs: list, allowed_exts: tuple, exclude_path_fragments, skip_dir_names: tuple = (), basename_prefixes: tuple = ()) -> list:
if not scan_dirs:
return []
rg = shutil.which("rg")
if not rg:
return []
@@ -89,6 +91,8 @@ def _discover_files_via_rg(scan_dirs: list, allowed_exts: tuple, exclude_path_fr
def discover_files(scan_dirs: list, allowed_exts: tuple, exclude_path_fragments, skip_dir_names: tuple = (), basename_prefixes: tuple = ()) -> list:
if not scan_dirs:
return []
files = _discover_files_via_rg(
scan_dirs,
allowed_exts,