Skip to main content

Module phase2

Module phase2 

Source
Expand description

v1.4.110 Layer 3 A: startup Phase 2 — bridge 构造 + 登录 / SMS / setup-only / dev-flag 注入. 抽自原 mod.rs::run_daemon 220..475 行段.

Phase 2 主要副作用 (按顺序):

  1. GatewayBridge::new(), push_receiver=None
  2. resolve_login_password 7-tier 解析
  3. (account, password) 同时存在:
    • --reset-device 交互式确认 + reset_device_state
    • read_or_generate_device_id
    • 构造 GatewayConfig + verify_cb (优先 --verify-code)
    • bridge.initialize().await
    • Ok → setup_only 早退分支; Err → hints::print_auth_error_hint
  4. 无凭据 → 跑 offline mode (WARN)
  5. Arc::new(bridge)
  6. dev-flag --inject-auth-failure-every 注入 (cfg feature)

Structs§

Phase2Out 🔒
Phase 2 output — bridge (Arc-wrap 完成) + push_receiver (Some 时 表示登录成功并需要后续 push dispatcher) + setup_only_done (true 时 orchestrator 应早退 Ok(())).

Functions§

run_phase2 🔒