mirror of
https://git.um-react.app/um/um-react.git
synced 2025-11-28 11:33:02 +00:00
feat: add support for migu3d formats
This commit is contained in:
@@ -7,6 +7,7 @@ import { KGMCrypto } from './kgm/kgm_pc';
|
||||
import { NCMCrypto } from './ncm/ncm_pc';
|
||||
import { XimalayaAndroidCrypto } from './xmly/xmly_android';
|
||||
import { KWMCrypto } from './kwm/kwm';
|
||||
import { MiguCrypto } from './migu/migu3d_keyless';
|
||||
|
||||
export const allCryptoFactories: CryptoFactory[] = [
|
||||
// Xiami (*.xm)
|
||||
@@ -24,6 +25,9 @@ export const allCryptoFactories: CryptoFactory[] = [
|
||||
// KWMv1 (*.kwm)
|
||||
KWMCrypto.make,
|
||||
|
||||
// Migu3D/Keyless (*.wav; *.m4a)
|
||||
MiguCrypto.make,
|
||||
|
||||
// Crypto that does not implement "checkBySignature" or need to decrypt the entire file and then check audio type,
|
||||
// should be moved to the bottom of the list for performance reasons.
|
||||
|
||||
|
||||
15
src/decrypt-worker/crypto/migu/migu3d_keyless.ts
Normal file
15
src/decrypt-worker/crypto/migu/migu3d_keyless.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { transformBlob } from '~/decrypt-worker/util/transformBlob';
|
||||
import type { CryptoBase } from '../CryptoBase';
|
||||
|
||||
export class MiguCrypto implements CryptoBase {
|
||||
cryptoName = 'Migu3D/Keyless';
|
||||
checkByDecryptHeader = true;
|
||||
|
||||
async decrypt(buffer: ArrayBuffer): Promise<Blob> {
|
||||
return transformBlob(buffer, (p) => p.make.Migu3D());
|
||||
}
|
||||
|
||||
public static make() {
|
||||
return new MiguCrypto();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user