Browse Source

Add Tips for .kgm while using "file:" protocol

20230320
MengYX 4 years ago
parent
commit
ad47a713ad
No known key found for this signature in database GPG Key ID: E63F9C7303E8F604
  1. 2
      src/App.vue
  2. 7
      src/decrypt/kgm.js

2
src/App.vue

@ -100,7 +100,7 @@
} catch (e) { } catch (e) {
} }
if ((!!updateInfo && process.env.NODE_ENV === 'production') && (!!updateInfo.HttpsFound || if ((!!updateInfo && process.env.NODE_ENV === 'production') && (!!updateInfo.HttpsFound ||
(!!updateInfo.Found && window.location.protocol !== "https:"))) { (!!updateInfo.Found && document.location.protocol !== "https:"))) {
this.$notify.warning({ this.$notify.warning({
title: '发现更新', title: '发现更新',
message: '发现新版本 v' + updateInfo.Version + message: '发现新版本 v' + updateInfo.Version +

7
src/decrypt/kgm.js

@ -10,9 +10,14 @@ const KgmHeader = [
const VprMaskDiff = [0x25, 0xDF, 0xE8, 0xA6, 0x75, 0x1E, 0x75, 0x0E, const VprMaskDiff = [0x25, 0xDF, 0xE8, 0xA6, 0x75, 0x1E, 0x75, 0x0E,
0x2F, 0x80, 0xF3, 0x2D, 0xB8, 0xB6, 0xE3, 0x11, 0x2F, 0x80, 0xF3, 0x2D, 0xB8, 0xB6, 0xE3, 0x11,
0x00] 0x00]
const PreDefinedKey = "MoOtOiTvINGwd2E6n0E1i7L5t2IoOoNk"
export async function Decrypt(file, raw_filename, raw_ext) { export async function Decrypt(file, raw_filename, raw_ext) {
if (document.location.protocol === "file:") {
return {
status: false,
message: "请使用<a target='_blank' href='https://github.com/ix64/unlock-music/wiki/其他音乐格式工具'>CLI版本</a>进行解锁"
}
}
const oriData = new Uint8Array(await GetArrayBuffer(file)); const oriData = new Uint8Array(await GetArrayBuffer(file));
if (raw_ext === "vpr") { if (raw_ext === "vpr") {
if (!IsBytesEqual(VprHeader, oriData.slice(0, 0x10))) if (!IsBytesEqual(VprHeader, oriData.slice(0, 0x10)))

Loading…
Cancel
Save