mirror of
https://git.unlock-music.dev/um/um-react.git
synced 2024-11-23 20:02:16 +00:00
fix: support files that were not encrypted (e.g. kgma
), close #36
This commit is contained in:
parent
756225d462
commit
e18e42ae9a
@ -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,
|
||||
];
|
||||
|
14
src/decrypt-worker/crypto/transparent/transparent.ts
Normal file
14
src/decrypt-worker/crypto/transparent/transparent.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import type { CryptoBase } from '../CryptoBase';
|
||||
|
||||
export class TransparentCrypto implements CryptoBase {
|
||||
cryptoName = 'Transparent';
|
||||
checkByDecryptHeader = true;
|
||||
|
||||
async decrypt(buffer: ArrayBuffer): Promise<Blob> {
|
||||
return new Blob([buffer]);
|
||||
}
|
||||
|
||||
public static make() {
|
||||
return new TransparentCrypto();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user