fix(android-ui): add device function status and IMEI visibility

This commit is contained in:
Manus AI
2026-07-25 00:15:11 +08:00
parent ebc97439cb
commit 9cc3512d35

View File

@@ -33,6 +33,38 @@ export function DevicePage({ snapshot, bridgeAvailable, busyAction, onAction }:
return source ? { ...fallback, ...source } : fallback;
});
const health = snapshot.device.healthScore;
const imei = snapshot.binding.encryptedImei || snapshot.device.imeiMasked || snapshot.device.serialNumber || snapshot.device.id;
const serial = snapshot.device.serialNumber || snapshot.device.id;
const functionStates = [
{
icon: "wechat" as const,
label: "微信运行",
value: snapshot.wechat.running === true ? "运行中" : snapshot.wechat.running === false ? "未运行" : "不可用",
tone: snapshot.wechat.running === true ? "success" : undefined,
action: "reconnect_wechat",
},
{
icon: "code" as const,
label: "SDK 连接",
value: snapshot.services.sdkConnected === true ? "已连接" : snapshot.services.sdkConnected === false ? "未连接" : "不可用",
tone: snapshot.services.sdkConnected === true ? "success" : undefined,
action: "test_sdk_connection",
},
{
icon: "code" as const,
label: "注入引擎",
value: snapshot.services.fridaRunning === true ? "运行中" : snapshot.services.fridaRunning === false ? "未运行" : "不可用",
tone: snapshot.services.fridaRunning === true ? "success" : undefined,
action: "restart_frida",
},
{
icon: "agent" as const,
label: "平台连接",
value: snapshot.platform.connected === true ? "已连接" : snapshot.platform.connected === false ? "未连接" : "不可用",
tone: snapshot.platform.connected === true ? "success" : undefined,
action: "reconnect_platform",
},
];
return (
<main className="page page-device">
@@ -73,7 +105,8 @@ export function DevicePage({ snapshot, bridgeAvailable, busyAction, onAction }:
<Card className="identity-card">
<div className="identity-data">
<h2></h2>
<DataRow icon="fingerprint" label="MD5 设备编号" value={display(snapshot.device.id)} />
<DataRow icon="fingerprint" label="IMEI / 设备标识" value={display(imei)} />
{serial && <DataRow icon="link" label="设备序列号" value={display(serial)} />}
<DataRow
icon="link"
label="绑定状态"
@@ -93,6 +126,22 @@ export function DevicePage({ snapshot, bridgeAvailable, busyAction, onAction }:
</Card>
<SectionTitle></SectionTitle>
<Card className="identity-card">
<div className="identity-data">
<h2></h2>
{functionStates.map((state) => (
<DataRow
key={state.label}
icon={state.icon}
label={state.label}
value={state.value}
tone={state.tone as "success" | "danger" | "muted"}
action={() => onAction(state.action)}
/>
))}
</div>
</Card>
<Card className="permission-grid">
{permissions.map((permission) => (
<button className="permission-card" key={permission.key} onClick={() => onAction(`open_permission:${permission.key}`)}>
@@ -112,13 +161,6 @@ export function DevicePage({ snapshot, bridgeAvailable, busyAction, onAction }:
<details className="maintenance-details">
<summary><Icon name="settings" size={20} /><span></span><Icon name="chevron" size={18} /></summary>
<Card className="data-list maintenance-list">
<DataRow
icon="cloud"
label="平台连接"
value={snapshot.platform.connected === true ? "已连接" : snapshot.platform.connected === false ? "未连接" : "不可用"}
tone={snapshot.platform.connected === true ? "success" : undefined}
action={() => onAction("reconnect_platform")}
/>
<DataRow
icon="agent"
label="Agent 服务"
@@ -126,20 +168,6 @@ export function DevicePage({ snapshot, bridgeAvailable, busyAction, onAction }:
tone={snapshot.agent.running === true ? "success" : undefined}
action={() => onAction("reconnect_agent")}
/>
<DataRow
icon="code"
label="SDK 连接"
value={snapshot.services.sdkConnected === true ? "已连接" : snapshot.services.sdkConnected === false ? "未连接" : "不可用"}
tone={snapshot.services.sdkConnected === true ? "success" : undefined}
action={() => onAction("test_sdk_connection")}
/>
<DataRow
icon="code"
label="注入引擎服务"
value={snapshot.services.fridaRunning === true ? "运行中" : snapshot.services.fridaRunning === false ? "未运行" : "不可用"}
tone={snapshot.services.fridaRunning === true ? "success" : undefined}
action={() => onAction("restart_frida")}
/>
<DataRow icon="heartbeat" label="运行日志" value="查看状态记录" action={() => onAction("open_logs")} />
<DataRow icon="refresh" label="版本更新" value={`当前版本 ${display(snapshot.version)}`} action={() => onAction("check_update")} />
</Card>