From 1d4fff83f30feb2fe3880019fce5c73f31875646 Mon Sep 17 00:00:00 2001 From: Xiaocheng Song Date: Thu, 24 Jun 2021 08:23:26 +0800 Subject: [PATCH] fix(mdict-base.js): fix load error for mdx version 2.0 no encryption (#48) --- lib/mdict-base.js | 2 ++ src/mdict-base.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib/mdict-base.js b/lib/mdict-base.js index 3e1345b..1ce2c1c 100644 --- a/lib/mdict-base.js +++ b/lib/mdict-base.js @@ -376,6 +376,8 @@ var MDictBase = /*#__PURE__*/function () { if (this._encrypt === 2) { kbInfoCompBuff = _common["default"].mdxDecrypt(keyBlockInfoBuff); + } else if (this._encrypt === 0) { + kbInfoCompBuff = keyBlockInfoBuff; } // For version 2.0, will compress by zlib, lzo just just for 1.0 // key_block_info_compressed[0:8] => compress_type diff --git a/src/mdict-base.js b/src/mdict-base.js index 6e474f5..e296ff1 100644 --- a/src/mdict-base.js +++ b/src/mdict-base.js @@ -399,6 +399,8 @@ class MDictBase { let kbInfoCompBuff; if (this._encrypt === 2) { kbInfoCompBuff = common.mdxDecrypt(keyBlockInfoBuff); + } else if (this._encrypt === 0) { + kbInfoCompBuff = keyBlockInfoBuff; } // For version 2.0, will compress by zlib, lzo just just for 1.0 // key_block_info_compressed[0:8] => compress_type