From 81136dd4f89b5651b380a73ed354159f7698ead3 Mon Sep 17 00:00:00 2001 From: xhacker-zzz <959220793@qq.com> Date: Mon, 21 Nov 2022 01:48:24 +0800 Subject: [PATCH] Add GitHub Actions for wasm & chores --- .github/workflows/build.yml | 4 ++++ .github/workflows/release-build.yml | 4 ++++ src/decrypt/qmc.ts | 2 +- src/decrypt/qmc_key.ts | 2 -- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1d3bcf9..deb1377 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -63,6 +63,10 @@ jobs: - name: Install Dependencies run: npm ci + - name: Build Wasm + run: bash ./src/QmcWasm/build-wasm + bash ./src/KgmWasm/build-wasm + - name: Build run: npm run build ${{ matrix.BUILD_ARGS }} diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 01d8479..fb20713 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -19,6 +19,10 @@ jobs: - name: Install Dependencies run: npm ci + - name: Build Wasm + run: bash ./src/QmcWasm/build-wasm + bash ./src/KgmWasm/build-wasm + - name: Build Legacy env: GZIP: "--best" diff --git a/src/decrypt/qmc.ts b/src/decrypt/qmc.ts index 87998ba..db3e2fe 100644 --- a/src/decrypt/qmc.ts +++ b/src/decrypt/qmc.ts @@ -56,7 +56,7 @@ export async function Decrypt(file: Blob, raw_filename: string, raw_ext: string) musicID = v2Decrypted.songId; console.log('qmc wasm decoder suceeded'); } else { - console.warn('QmcWasm failed with error %s', v2Decrypted.error || '(no error)'); + console.warn('QmcWasm failed with error %s', v2Decrypted.error || '(unknown error)'); } } diff --git a/src/decrypt/qmc_key.ts b/src/decrypt/qmc_key.ts index 022e357..b23b15f 100644 --- a/src/decrypt/qmc_key.ts +++ b/src/decrypt/qmc_key.ts @@ -37,8 +37,6 @@ export function simpleMakeKey(salt: number, length: number): number[] { const mixKey1: Uint8Array = new Uint8Array([ 0x33, 0x38, 0x36, 0x5A, 0x4A, 0x59, 0x21, 0x40, 0x23, 0x2A, 0x24, 0x25, 0x5E, 0x26, 0x29, 0x28 ]) const mixKey2: Uint8Array = new Uint8Array([ 0x2A, 0x2A, 0x23, 0x21, 0x28, 0x23, 0x24, 0x25, 0x26, 0x5E, 0x61, 0x31, 0x63, 0x5A, 0x2C, 0x54 ]) -const v2KeyPrefix: Uint8Array = new Uint8Array([ 0x51, 0x51, 0x4D, 0x75, 0x73, 0x69, 0x63, 0x20, 0x45, 0x6E, 0x63, 0x56, 0x32, 0x2C, 0x4B, 0x65, 0x79, 0x3A ]) - function decryptV2Key(key: Buffer): Buffer { const textEnc = new TextDecoder();