mirror of
https://git.um-react.app/um/um-react.git
synced 2026-12-04 01:53:59 +00:00
refactor: major package updates
This commit is contained in:
1 parent
2e52c67533
commit
a11caaae92
34 files changed
+373
-240
No files matched your search
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user