diff --git a/src/decrypt-worker/crypto/CryptoFactory.ts b/src/decrypt-worker/crypto/CryptoFactory.ts index 9fa4999..66a9ec4 100644 --- a/src/decrypt-worker/crypto/CryptoFactory.ts +++ b/src/decrypt-worker/crypto/CryptoFactory.ts @@ -8,6 +8,7 @@ import { NCMCrypto } from './ncm/ncm_pc'; import { XimalayaAndroidCrypto } from './xmly/xmly_android'; import { KWMCrypto } from './kwm/kwm'; import { MiguCrypto } from './migu/migu3d_keyless'; +import { TransparentCrypto } from './transparent/transparent'; export const allCryptoFactories: CryptoFactory[] = [ // Xiami (*.xm) @@ -38,4 +39,7 @@ export const allCryptoFactories: CryptoFactory[] = [ // Ximalaya (Android) XimalayaAndroidCrypto.makeX2M, XimalayaAndroidCrypto.makeX3M, + + // Transparent crypto (not encrypted) + TransparentCrypto.make, ]; diff --git a/src/decrypt-worker/crypto/transparent/transparent.ts b/src/decrypt-worker/crypto/transparent/transparent.ts new file mode 100644 index 0000000..78332d3 --- /dev/null +++ b/src/decrypt-worker/crypto/transparent/transparent.ts @@ -0,0 +1,14 @@ +import type { CryptoBase } from '../CryptoBase'; + +export class TransparentCrypto implements CryptoBase { + cryptoName = 'Transparent'; + checkByDecryptHeader = true; + + async decrypt(buffer: ArrayBuffer): Promise { + return new Blob([buffer]); + } + + public static make() { + return new TransparentCrypto(); + } +}