diff --git a/README.MD b/README.MD index 2d815c7..9db1c46 100644 --- a/README.MD +++ b/README.MD @@ -20,7 +20,7 @@ - [x] 酷我音乐 (.kwm) - [x] 酷狗音乐 (.kgm/.vpr) - [x] 喜马拉雅 Android 端 (.x2m/.x3m) -- [ ] ~~咪咕音乐格式 (.mg3d)~~ +- [x] 咪咕音乐格式 (.mg3d) - [ ] ~~QQ 音乐海外版JOOX Music (.ofl_en)~~ 不支持的格式?请提交样本(加密文件)与客户端信息(或一并上传其安装包)到[仓库的问题追踪区][project-issues]。如果文件太大,请上传到不需要登入下载的网盘,如 [mega.nz](https://mega.nz)、[OneDrive](https://www.onedrive.com/) 等。 diff --git a/package.json b/package.json index 1b1b827..5b276ff 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "@chakra-ui/react": "^2.6.1", "@emotion/react": "^11.11.0", "@emotion/styled": "^11.11.0", - "@jixun/libparakeet": "0.0.0-exp.20", + "@jixun/libparakeet": "0.1.0", "@reduxjs/toolkit": "^1.9.5", "framer-motion": "^10.12.12", "nanoid": "^4.0.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7eee138..779f8bc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,8 +14,8 @@ dependencies: specifier: ^11.11.0 version: 11.11.0(@emotion/react@11.11.0)(@types/react@18.2.6)(react@18.2.0) '@jixun/libparakeet': - specifier: 0.0.0-exp.20 - version: 0.0.0-exp.20 + specifier: 0.1.0 + version: 0.1.0 '@reduxjs/toolkit': specifier: ^1.9.5 version: 1.9.5(react-redux@8.0.5)(react@18.2.0) @@ -3060,9 +3060,9 @@ packages: chalk: 4.1.2 dev: true - /@jixun/libparakeet@0.0.0-exp.20: + /@jixun/libparakeet@0.1.0: resolution: - { integrity: sha512-uax/1lPsui/qOEVI2v6pdX/2BgrWmqIFbKdlOSnEmvaDZHCFFIerA8VYPycl8ASO/0Xp6gPxwtHfDQIi7zDl3A== } + { integrity: sha512-oMdW8Yr+V6GRBoXOFtmXLXMMP16qjlnbR039TdnKQHePXC/0jBGre/Osv412CgzfW0CDsHZsG9N/dMqsSMznMg== } dev: false /@jridgewell/gen-mapping@0.3.3: diff --git a/src/decrypt-worker/crypto/CryptoFactory.ts b/src/decrypt-worker/crypto/CryptoFactory.ts index 27c0345..c6a7bdc 100644 --- a/src/decrypt-worker/crypto/CryptoFactory.ts +++ b/src/decrypt-worker/crypto/CryptoFactory.ts @@ -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. diff --git a/src/decrypt-worker/crypto/migu/migu3d_keyless.ts b/src/decrypt-worker/crypto/migu/migu3d_keyless.ts new file mode 100644 index 0000000..e864987 --- /dev/null +++ b/src/decrypt-worker/crypto/migu/migu3d_keyless.ts @@ -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 { + return transformBlob(buffer, (p) => p.make.Migu3D()); + } + + public static make() { + return new MiguCrypto(); + } +}