TrafficManager 是一个 Android 应用 + LSPosed 模块,用于根据 Wi-Fi SSID/BSSID 规则自动切换默认数据卡(SIM1/SIM2)。
本项目由 Codex + GPT-5.3-Codex 全程协助开发 本项目不包含任何联网能力,可放心使用
SSID / BSSID 匹配规则priority)cooldownSec)leaveDelaySec、leaveMissThreshold、revertOnLeave)app/libs/api-82.jar.\gradlew.bat :app:assembleDebug
输出 APK:
app/build/outputs/apk/debug/app-debug.apkcom.android.phonecom.xiaomi.phonecom.qti.phonecom.qualcomm.qti.telephonyservicecom.android.services.telephonycom.android.telephonyandroid 作用域尝试兼容{
"enabled": true,
"powerSaveMode": true,
"screenOnIntervalSec": 20,
"screenOffIntervalSec": 90,
"cooldownSec": 90,
"leaveDelaySec": 180,
"leaveMissThreshold": 3,
"revertOnLeave": true,
"fixedLeaveSlot": null,
"noWifiSlot": 0,
"noWifiImmediate": true,
"logRetentionDays": 7,
"logMaxMb": 10,
"rootCommandTemplates": [
"cmd phone set-default-data-subscription {subId}",
"cmd phone set-data-subscription {subId}",
"settings put global multi_sim_data_call {slot}"
],
"rules": [
{
"id": "home_wifi",
"priority": 100,
"ssid": "MyHomeWiFi",
"bssid": null,
"targetSlot": 0
}
]
}
enabled: 是否开启自动切卡。powerSaveMode: true 表示更依赖系统广播触发的省电策略,false 则常驻服务更稳定。screenOnIntervalSec / screenOffIntervalSec: 屏幕亮/灭时触发检查的频率。cooldownSec: 同一规则命中后的冷却时长,防止抖动。leaveDelaySec / leaveMissThreshold: 离开 Wi-Fi 后经过多少时间、漏报次数才认为脱离。revertOnLeave: 离开 Wi-Fi 后是否还原原先使用的数据卡。fixedLeaveSlot: 离开 Wi-Fi 时强制切到的卡(null 表示按逻辑决定)。noWifiSlot / noWifiImmediate: 无 Wi-Fi 时的目标卡与是否立即切换。logRetentionDays / logMaxMb: 日志保留天数与单日志大小上限。rootCommandTemplates: root 兜底时使用的系统命令模板(可保留多条)。rules: Wi-Fi 规则列表,priority 越大优先级越高,targetSlot 0/1 表示 SIM1/SIM2。Android/data/com.laros.lsp.traffics/files/logs/rootCommandTemplates 包含 accelerometer_rotation / user_rotation,会被安全拦截以避免误改方向锁定noWifiSlot 可在 未连接任何 Wi‑Fi 时自动切换到指定卡槽leaveDelaySec 与 leaveMissThreshold 影响(避免频繁抖动)noWifiImmediate: true(不受 cooldownSec 限制)MIT,详见 LICENSE
com.laros.lsp.traffics
Release Type: Stable
3/7/2026, 12:26:24 PM