chore: experimental work on bridge libparakeet

This commit is contained in:
鲁树人
2023-05-13 15:55:02 +01:00
parent 24a68fcf59
commit 3c1434b09f
4 changed files with 59 additions and 5 deletions

View File

@@ -3,6 +3,7 @@ import { DECRYPTION_WORKER_ACTION_NAME } from './constants';
import type { CryptoFactory } from './crypto/CryptoBase';
import { XiamiCrypto } from './crypto/xiami/xiami';
import { QMC1Crypto } from './crypto/qmc/qmc_v1';
const bus = new WorkerServerBus();
onmessage = bus.onmessage;
@@ -10,9 +11,11 @@ onmessage = bus.onmessage;
const decryptorFactories: CryptoFactory[] = [
// Xiami (*.xm)
() => new XiamiCrypto(),
() => new QMC1Crypto(),
];
bus.addEventHandler(DECRYPTION_WORKER_ACTION_NAME.DECRYPT, async (blobURI) => {
debugger;
const blob = await fetch(blobURI).then((r) => r.blob());
for (const factory of decryptorFactories) {