feat: add support for kuwo ios ekey db

This commit is contained in:
鲁树人
2023-11-08 20:40:41 +00:00
parent 85ab69d41d
commit ecc34aaf44
17 changed files with 186 additions and 80 deletions

View File

@@ -7,9 +7,11 @@ export interface KuwoHeader {
quality: string;
}
const KUWO_MAGIC_HDRS = new Set(['yeelion-kuwo\x00\x00\x00\x00', 'yeelion-kuwo-tme']);
export function parseKuwoHeader(view: DataView): KuwoHeader | null {
const magic = view.buffer.slice(view.byteOffset, view.byteOffset + 0x10);
if (bytesToUTF8String(magic) !== 'yeelion-kuwo-tme') {
if (!KUWO_MAGIC_HDRS.has(bytesToUTF8String(magic))) {
return null; // not kuwo-encrypted file
}