feat: fix mmkv parser, support for ios ekey mmkv

This commit is contained in:
鲁树人
2023-06-15 19:30:33 +01:00
parent f787e1c3f8
commit 8db5b64b38
6 changed files with 36 additions and 10 deletions

View File

@ -52,7 +52,7 @@ export function ImportFileModal({ onClose, show }: ImportFileModalProps) {
alert(`不是支持的 SQLite 数据库文件。\n表名${qmc2Keys}`);
return;
}
} else if (/MMKVStreamEncryptId/i.test(file.name)) {
} else if (/MMKVStreamEncryptId|filenameEkeyMap/i.test(file.name)) {
const fileBuffer = await file.arrayBuffer();
const map = MMKVParser.toStringMap(new DataView(fileBuffer));
qmc2Keys = Array.from(map.entries(), ([name, key]) => ({ name: getFileName(name), key }));