Add Linux machine-info GUID management

Add end-to-end support for reading/writing Linux machine-info and computing GUIDs.

Backend: - Introduce MachineInfoUtils (TS) for machine-info path lookup, ROT13 serialization, read/write/delete, backups, and MD5-based GUID computation. - Add a Python utility (guid.py) for CLI inspection, encode/decode, dump, and GUID computation. - Extend QQLogin API with new handlers: GetPlatformInfo, GetLinuxMAC, SetLinuxMAC, GetLinuxMachineId, ComputeLinuxGUID, GetLinuxMachineInfoBackups, CreateLinuxMachineInfoBackup, RestoreLinuxMachineInfoBackup, ResetLinuxDeviceID. Handlers include automatic backup behavior and error handling.

Router: Register new QQLogin routes for platform info and Linux machine-info operations.

Frontend: - Enhance guid_manager UI to detect platform and provide Linux-specific workflow (display machine-id, show/edit MAC, preview computed GUID via MD5, backup/restore/delete machine-info, and restart actions). - Add client-side MD5 (crypto-js) usage and new QQManager API methods to call the new backend endpoints.

This change enables cross-platform GUID management (Windows and Linux), includes CLI tooling for low-level inspection, and adds frontend workflows for Linux device-id management.
This commit is contained in:
手瓜一十雪
2026-02-12 19:00:36 +08:00
parent 2f8569f30c
commit 9887eb8565
5 changed files with 788 additions and 8 deletions

View File

@@ -18,6 +18,15 @@ import {
QQGetGUIDBackupsHandler,
QQRestoreGUIDBackupHandler,
QQCreateGUIDBackupHandler,
QQGetPlatformInfoHandler,
QQGetLinuxMACHandler,
QQSetLinuxMACHandler,
QQGetLinuxMachineIdHandler,
QQComputeLinuxGUIDHandler,
QQGetLinuxMachineInfoBackupsHandler,
QQCreateLinuxMachineInfoBackupHandler,
QQRestoreLinuxMachineInfoBackupHandler,
QQResetLinuxDeviceIDHandler,
} from '@/napcat-webui-backend/src/api/QQLogin';
const router: Router = Router();
@@ -56,4 +65,26 @@ router.post('/RestoreGUIDBackup', QQRestoreGUIDBackupHandler);
// router:创建GUID备份
router.post('/CreateGUIDBackup', QQCreateGUIDBackupHandler);
// ============================================================
// 平台信息 & Linux GUID 管理
// ============================================================
// router:获取平台信息
router.post('/GetPlatformInfo', QQGetPlatformInfoHandler);
// router:获取Linux MAC地址
router.post('/GetLinuxMAC', QQGetLinuxMACHandler);
// router:设置Linux MAC地址
router.post('/SetLinuxMAC', QQSetLinuxMACHandler);
// router:获取Linux machine-id
router.post('/GetLinuxMachineId', QQGetLinuxMachineIdHandler);
// router:计算Linux GUID
router.post('/ComputeLinuxGUID', QQComputeLinuxGUIDHandler);
// router:获取Linux machine-info备份列表
router.post('/GetLinuxMachineInfoBackups', QQGetLinuxMachineInfoBackupsHandler);
// router:创建Linux machine-info备份
router.post('/CreateLinuxMachineInfoBackup', QQCreateLinuxMachineInfoBackupHandler);
// router:恢复Linux machine-info备份
router.post('/RestoreLinuxMachineInfoBackup', QQRestoreLinuxMachineInfoBackupHandler);
// router:重置Linux设备信息
router.post('/ResetLinuxDeviceID', QQResetLinuxDeviceIDHandler);
export { router as QQLoginRouter };