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:
@@ -124,3 +124,44 @@ def send_dingtalk_notification(
|
||||
if result.get("errcode", 0) != 0:
|
||||
raise NotificationError(f"钉钉通知发送失败: {result.get('errmsg', '未知错误')}")
|
||||
return True
|
||||
|
||||
|
||||
def send_toolchain_dingtalk_alert(
|
||||
dingtalk_config: dict,
|
||||
title: str,
|
||||
lines: list[str],
|
||||
) -> bool:
|
||||
"""发送 Xcode/opt 工具链状态通知(标题和正文必须保留「打包」关键词)。"""
|
||||
if not (dingtalk_config or {}).get("enabled"):
|
||||
return False
|
||||
|
||||
webhook_url = (dingtalk_config.get("webhook_url") or "").strip()
|
||||
if not webhook_url:
|
||||
raise NotificationError("钉钉通知已启用,但未配置 Webhook URL")
|
||||
|
||||
safe_title = title if "打包" in title else f"【iOS打包服务】{title}"
|
||||
mobiles = normalize_mobiles(dingtalk_config.get("at_mobiles", []))
|
||||
body_lines = [f"## {safe_title}", "", *lines]
|
||||
if mobiles:
|
||||
body_lines.extend(["", " ".join(f"@{m}" for m in mobiles)])
|
||||
|
||||
payload = {
|
||||
"msgtype": "markdown",
|
||||
"markdown": {"title": safe_title, "text": "\n\n".join(body_lines)},
|
||||
"at": {"atMobiles": mobiles, "isAtAll": False},
|
||||
}
|
||||
response = httpx.post(
|
||||
_signed_webhook_url(webhook_url, dingtalk_config.get("secret", "")),
|
||||
json=payload,
|
||||
timeout=15,
|
||||
)
|
||||
if response.status_code // 100 != 2:
|
||||
raise NotificationError(f"钉钉通知发送失败 ({response.status_code})")
|
||||
|
||||
try:
|
||||
result = response.json()
|
||||
except ValueError as exc:
|
||||
raise NotificationError("钉钉通知返回内容无效") from exc
|
||||
if result.get("errcode", 0) != 0:
|
||||
raise NotificationError(f"钉钉通知发送失败: {result.get('errmsg', '未知错误')}")
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user