fix: support files that were not encrypted (e.g. kgma
), close #36
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
ed488ea204
commit
d070332f98
@ -8,6 +8,7 @@ import { NCMCrypto } from './ncm/ncm_pc';
|
|||||||
import { XimalayaAndroidCrypto } from './xmly/xmly_android';
|
import { XimalayaAndroidCrypto } from './xmly/xmly_android';
|
||||||
import { KWMCrypto } from './kwm/kwm';
|
import { KWMCrypto } from './kwm/kwm';
|
||||||
import { MiguCrypto } from './migu/migu3d_keyless';
|
import { MiguCrypto } from './migu/migu3d_keyless';
|
||||||
|
import { TransparentCrypto } from './transparent/transparent';
|
||||||
|
|
||||||
export const allCryptoFactories: CryptoFactory[] = [
|
export const allCryptoFactories: CryptoFactory[] = [
|
||||||
// Xiami (*.xm)
|
// Xiami (*.xm)
|
||||||
@ -38,4 +39,7 @@ export const allCryptoFactories: CryptoFactory[] = [
|
|||||||
// Ximalaya (Android)
|
// Ximalaya (Android)
|
||||||
XimalayaAndroidCrypto.makeX2M,
|
XimalayaAndroidCrypto.makeX2M,
|
||||||
XimalayaAndroidCrypto.makeX3M,
|
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