refactor(qs)!: 手机端链路彻底清除——PC 签名成为唯一供给

安卓自签 crypto/ 整目录(11 文件)与 device.ts 设备注册删除,audiodecrypt
上移 qs/ 根,getDeviceIds 并入 passport(_qs_passport_device 持久化);
musicSearch 去指纹搜索(需 PC 签名,匿名搜索下线);mssdk 签名供给改三级:
QS_SIGN_SERVER 显式 → 本机 16689 /healthz 自动探测(qs-signer 的 mssdk-sign)
→ data/qs-sign.json 固定值兜底。
This commit is contained in:
snowy-yang committed 2026-10-04 17:31:33 +08:00
1 parent cec63f864e
commit 6b05fde64b
19 files changed
+111 -1271

No files matched your search

+13 -1
View File
@@ -11,7 +11,6 @@ import os from 'node:os'
import QRCode from 'qrcode'
import { httpFetch } from '../common/request.ts'
import { getCredentials, setCredentials } from '../auth/store.ts'
import { getDeviceIds } from './device.ts'
const PASSPORT_HOST = 'https://api.qishui.com'
const SCAN_LOGIN_URL = 'https://bff-pc.qishui.com/light/invoke/scan_login'
@@ -30,6 +29,19 @@ const PASSPORT_FIXED = {
version_code: '30020100',
}
/**
* PC 设备身份(同步读,首次懒生成并持久化):passport 登录与 PC 签名公共参数共用,
* 持久化于 data/auth.json 的 `_qs_passport_device`,保证同一实例「同一设备」。
*/
export const getDeviceIds = (): { deviceId: string; installId: string } => {
const existing = getCredentials('_qs_passport_device') as { deviceId?: string; installId?: string } | null
if (existing?.deviceId && existing.installId) return { deviceId: String(existing.deviceId), installId: String(existing.installId) }
const now = Date.now()
const ids = { deviceId: String(now), installId: String(now + 1) }
setCredentials('_qs_passport_device', ids)
return ids
}
// 各 passport 请求共用的公共参数(设备身份 + 平台/版本)
const commonParams = (): Record<string, string> => {
const { deviceId, installId } = getDeviceIds()