feat: add support for migu3d formats

This commit is contained in:
Jixun Wu 2023-05-27 00:47:00 +01:00
parent e9c4fffcdd
commit e1929d7639
5 changed files with 25 additions and 6 deletions

View File

@ -20,7 +20,7 @@
- [x] 酷我音乐 (.kwm)
- [x] 酷狗音乐 (.kgm/.vpr)
- [x] 喜马拉雅 Android 端 (.x2m/.x3m)
- [ ] ~~咪咕音乐格式 (.mg3d)~~
- [x] 咪咕音乐格式 (.mg3d)
- [ ] ~~<ruby>QQ 音乐海外版<rt>JOOX Music</rt></ruby> (.ofl_en)~~
不支持的格式?请提交样本(加密文件)与客户端信息(或一并上传其安装包)到[仓库的问题追踪区][project-issues]。如果文件太大,请上传到不需要登入下载的网盘,如 [mega.nz](https://mega.nz)、[OneDrive](https://www.onedrive.com/) 等。

View File

@ -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",

View File

@ -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:

View File

@ -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.

View File

@ -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<Blob> {
return transformBlob(buffer, (p) => p.make.Migu3D());
}
public static make() {
return new MiguCrypto();
}
}