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
+20 -3
View File
@@ -1,5 +1,6 @@
"""FastAPI 主入口"""
from contextlib import asynccontextmanager
import asyncio
from contextlib import asynccontextmanager, suppress
from pathlib import Path
from fastapi import FastAPI, WebSocket, WebSocketDisconnect, Request, status
from fastapi.middleware.cors import CORSMiddleware
@@ -10,7 +11,14 @@ from fastapi.responses import FileResponse
from .database import init_db
from .routers import config, apps, tasks, auth, users, operations
from .services.log_streamer import log_streamer
from .config import BACKEND_PORT, CORS_ALLOWED_ORIGINS, TRUSTED_HOSTS, validate_production_security
from .services.toolchain_manager import midnight_toolchain_scheduler
from .config import (
BACKEND_PORT,
CORS_ALLOWED_ORIGINS,
IG_TOOLCHAIN_DAILY_CHECK_ENABLED,
TRUSTED_HOSTS,
validate_production_security,
)
from .deps import decode_current_user
from .projects import PROJECT_HEADER, current_project_id
@@ -22,7 +30,16 @@ async def lifespan(app: FastAPI):
"""应用生命周期"""
validate_production_security()
init_db()
yield
scheduler_task = None
if IG_TOOLCHAIN_DAILY_CHECK_ENABLED:
scheduler_task = asyncio.create_task(midnight_toolchain_scheduler())
try:
yield
finally:
if scheduler_task is not None:
scheduler_task.cancel()
with suppress(asyncio.CancelledError):
await scheduler_task
app = FastAPI(