refactor: major package updates

This commit is contained in:
鲁树人 committed 2025-10-16 01:00:38 +09:00
1 parent 2e52c67533
commit a11caaae92
34 files changed
+373 -240

No files matched your search

+11 -8
View File
@@ -6,23 +6,26 @@ export class XiamiDecipher implements DecipherInstance {
cipherName = 'Xiami (XM)';
async decrypt(buffer: Uint8Array): Promise<DecipherResult | DecipherOK> {
const xm = Xiami.from_header(buffer.subarray(0, 0x10));
const { copyPlainLength } = xm;
const audioBuffer = buffer.slice(0x10);
for (const [block] of chunkBuffer(audioBuffer.subarray(copyPlainLength))) {
xm.decrypt(block);
const xm = Xiami.from_header(buffer.subarray(0, 0x10));
try {
const { copyPlainLength } = xm;
for (const [block] of chunkBuffer(audioBuffer.subarray(copyPlainLength))) {
xm.decrypt(block);
}
} finally {
xm.free();
}
xm.free();
return {
return Promise.resolve({
cipherName: this.cipherName,
status: Status.OK,
data: audioBuffer,
};
});
}
public static make() {
public static make(this: void) {
return new XiamiDecipher();
}
}