4 Commits
Author SHA1 Message Date
鲁树人 75d786c747 fix: clamp payload length in MMKVParser to prevent overflow
- Updated the MMKVParser to ensure the calculated length does not exceed the DataView's byte length.
- Added tests to verify behavior at the payload boundary, including cases for oversized payloads and exact matches.
2026-10-27 09:01:42 +09:00
鲁树人 10e857a903 0.6.2 2026-10-22 02:23:47 +09:00
鲁树人 537391ed03 docs: update README and FAQ for QQ Music client key requirements
- Revised README to clarify that QQ Music PC client versions 19.57 to 22.76 require importing a key file extracted using qmpc-mmkv-cli.
- Updated issue template to reflect the same changes regarding key file requirements for Windows clients.
- Modified FAQ to specify that only versions 19.51 or lower do not require a key, while versions 19.57 to 22.76 do.
- Enhanced instructions for obtaining the key file in the PC instructions panel.
2026-10-21 11:40:55 +09:00
鲁树人 881aa5e44c chore: remove unused environment variable from build workflow 2026-10-21 10:55:35 +09:00
8 changed files with 73 additions and 11 deletions

No files matched your search

+3 -1
View File
@@ -7,7 +7,9 @@ body:
value: |
### Windows 客户端
目前 Windows 客户端仅支持 19.51 或更低版本下载的歌曲文件。
目前 Windows 客户端支持 19.57 至 22.76(目前最新版)下载的歌曲文件,但需要导入由 [qmpc-mmkv-cli](https://git.um-react.app/um/qmpc-mmkv/releases) 提取的密钥文件 `qmpc-mmkv-v1.mmkv`。
使用 19.51 或更低版本下载的歌曲文件无需密钥。
* [web.archive.org 镜像](https://web.archive.org/web/2023/https://dldir1v6.qq.com/music/clntupate/QQMusic_Setup_1951.exe)
* [通过 Telegram 下载](https://t.me/um_lsr_ch/24)
-2
View File
@@ -4,8 +4,6 @@ on: [push]
jobs:
build:
runs-on: ubuntu-latest
env:
pnpm_config_registry: https://registry.npmmirror.com
steps:
- name: Check out repository code
uses: actions/checkout@v4
+1 -1
View File
@@ -40,7 +40,7 @@
- [x] 蜻蜓 FM (`.qta`)
- 需要提取设备 ID。
[^qm-key-pc]: QQ 音乐的 PC 客户端仅支持 v19.51 或更低版本。
[^qm-key-pc]: QQ 音乐的 PC 客户端(v19.57 至 v22.76)需要导入由 [qmpc-mmkv-cli](https://git.um-react.app/um/qmpc-mmkv/releases) 提取的密钥文件 `qmpc-mmkv-v1.mmkv`。
[^qm-key-android]: QQ 音乐的安卓客户端支持需要获取超级管理员权限后提取密钥数据库并导入后使用。
+1 -1
View File
@@ -10,7 +10,7 @@
#### 2、检查您的平台。
日前,<mark>仅 Windows 客户端 v19.43 或以下版本</mark>下载的歌曲无需密钥,其余平台的官方正式版本均需要提取密钥。
日前,Windows 客户端 <mark>v19.57 至 v22.76</mark>(目前最新版)下载的歌曲需要导入由 [qmpc-mmkv-cli](https://git.um-react.app/um/qmpc-mmkv/releases) 提取的密钥文件 `qmpc-mmkv-v1.mmkv`;<mark>v19.51 或更低版本</mark>下载的歌曲无需密钥。其余平台的官方正式版本均需要提取密钥。
> iOS 用户提取歌曲困难,建议换用电脑操作;Android 用户提取密钥需要 root,也建议用电脑操作。
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "um-react",
"private": true,
"version": "0.6.1",
"version": "0.6.2",
"type": "module",
"scripts": {
"start": "vite",
@@ -3,6 +3,7 @@ import { HiWord } from '~/components/HelpText/HiWord';
import NoopExecutable from './assets/noop.exe?base64';
import NoopExecutableSource from './assets/noop.asm.txt?base64';
const QMPC_MMKV_RELEASES_URL = 'https://git.um-react.app/um/qmpc-mmkv/releases';
const PC_CLIENT_URL = 'https://web.archive.org/web/2023/https://dldir1v6.qq.com/music/clntupate/QQMusic_Setup_1951.exe';
const PC_CLIENT_TG_URL = 'https://t.me/um_lsr_ch/24';
@@ -10,14 +11,20 @@ export function InstructionsPC() {
return (
<>
<p className="mt-2">
使用 <span className="text-error">19.57 或更高版本</span>下载的歌曲文件
使用 <span className="text-primary">19.57 至 22.76</span>下载的歌曲文件
<HiWord>需要导入密钥</HiWord>。
<br />
目前未公开密钥获取方式,因此不支持。
</p>
<p className="mt-4">
使用 <span className="text-primary">19.51 或更低版本</span>下载的歌曲文件
请从{' '}
<ExtLink className="link-info" href={QMPC_MMKV_RELEASES_URL}>
qmpc-mmkv-cli
</ExtLink>{' '}
获取工具,提取密钥文件 <code>qmpc-mmkv-v1.mmkv</code> 后在本页导入。
</p>
<p className="mt-4">
使用 <span className="text-base-content/70">19.51 或更低版本</span>下载的歌曲文件
<HiWord>无需密钥</HiWord>。
</p>
+1 -1
View File
@@ -7,7 +7,7 @@ export class MMKVParser {
constructor(private view: DataView<ArrayBuffer>) {
const payloadLength = view.getUint32(0, true);
this.length = 4 + payloadLength;
this.length = Math.min(4 + payloadLength, view.byteLength);
// skip unused str
this.readInt();
+55
View File
@@ -26,3 +26,58 @@ test('able to handle empty value', () => {
expect(parser.readKey()).toEqual('1');
expect(parser.readStringValue()).toEqual('2');
});
describe('eof payload boundary', () => {
// Small string records: "a" -> "one" and "b" -> "two".
const firstRecord = Buffer.from([0x01, 0x61, 0x04, 0x03, 0x6f, 0x6e, 0x65]);
const secondRecord = Buffer.from([0x01, 0x62, 0x04, 0x03, 0x74, 0x77, 0x6f]);
const payload = Buffer.concat([Buffer.from([0x7f]), firstRecord, secondRecord]);
const allEntries = [
['a', 'one'],
['b', 'two'],
];
const makeView = (payloadLength: number) => {
const header = Buffer.alloc(4);
header.writeUInt32LE(payloadLength);
return makeViewFromBuffer(Buffer.concat([header, payload]));
};
const readEntries = (parser: MMKVParser) => {
const entries: [string, string | null][] = [];
while (!parser.eof) {
entries.push([parser.readKey(), parser.readStringValue()]);
}
return entries;
};
test.each([payload.byteLength + 4, 0xffffffff])('clamps oversized payload length %i to the view', (payloadLength) => {
const parser = new MMKVParser(makeView(payloadLength));
expect(readEntries(parser)).toEqual(allEntries);
expect(parser.eof).toBe(true);
});
test('reads all records when the payload length is exact', () => {
const parser = new MMKVParser(makeView(payload.byteLength));
expect(readEntries(parser)).toEqual(allEntries);
expect(parser.eof).toBe(true);
});
test('stops at the declared payload boundary with another valid record remaining', () => {
const parser = new MMKVParser(makeView(1 + firstRecord.byteLength));
expect(readEntries(parser)).toEqual([allEntries[0]]);
expect(parser.eof).toBe(true);
});
test('clamps to the DataView length with another valid record outside the view', () => {
const fullView = makeView(payload.byteLength + 4);
const view = new DataView(fullView.buffer, 0, 4 + 1 + firstRecord.byteLength);
const parser = new MMKVParser(view);
expect(readEntries(parser)).toEqual([allEntries[0]]);
expect(parser.eof).toBe(true);
});
});