mirror of
https://git.um-react.app/um/um-react.git
synced 2025-11-28 03:23:02 +00:00
feat: added support for QMCv2 (#11)
This commit is contained in:
17
src/decrypt-worker/crypto/qmc/qmc_v2.ts
Normal file
17
src/decrypt-worker/crypto/qmc/qmc_v2.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { transformBlob } from '~/decrypt-worker/util/transformBlob';
|
||||
import type { CryptoBase } from '../CryptoBase';
|
||||
import { SEED, ENC_V2_KEY_1, ENC_V2_KEY_2 } from './qmc_v2.key.ts';
|
||||
|
||||
export class QMC2Crypto implements CryptoBase {
|
||||
hasSignature(): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
async isSupported(): Promise<boolean> {
|
||||
return true;
|
||||
}
|
||||
|
||||
async decrypt(blob: Blob): Promise<Blob> {
|
||||
return transformBlob(blob, (p) => p.make.QMCv2(p.make.QMCv2FooterParser(SEED, ENC_V2_KEY_1, ENC_V2_KEY_2)));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user