feat: qrc file support

This commit is contained in:
鲁树人
2024-10-06 19:55:41 +01:00
parent fdc867bbc3
commit 051805a019
25 changed files with 495 additions and 15 deletions

View File

@@ -29,6 +29,7 @@ umc_kuwo = { path = "../um_crypto/kuwo" }
umc_mg3d = { path = "../um_crypto/mg3d" }
umc_ncm = { path = "../um_crypto/ncm" }
umc_qmc = { path = "../um_crypto/qmc" }
umc_qrc = { path = "../um_crypto/qrc" }
umc_qtfm = { path = "../um_crypto/qtfm" }
umc_xiami = { path = "../um_crypto/xiami" }
umc_xmly = { path = "../um_crypto/xmly" }

View File

@@ -5,6 +5,7 @@ pub mod kuwo;
pub mod mg3d;
pub mod ncm;
pub mod qmc;
mod qrc;
pub mod qtfm;
pub mod xiami;
pub mod xmly;

View File

@@ -0,0 +1,14 @@
use wasm_bindgen::prelude::wasm_bindgen;
use wasm_bindgen::JsError;
/// QRC Decrypt ("*.qrc" cache file)
#[wasm_bindgen(js_name=decryptQRCFile)]
pub fn js_decrypt_qrc(buffer: &mut [u8]) -> Result<Vec<u8>, JsError> {
umc_qrc::decrypt_qrc_file(buffer).map_err(JsError::from)
}
/// QRC Decrypt (network response)
#[wasm_bindgen(js_name=decryptQRCNetwork)]
pub fn js_decrypt_qrc_network(buffer: &str) -> Result<Vec<u8>, JsError> {
umc_qrc::decrypt_qrc_network(buffer).map_err(JsError::from)
}