Skip to content

syail/mmkv-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MMKV Parser

A parser of MMKV database.

Warning

This repository is not full implemented yet.
Did not support encrypted storage, multiple storage input, crc load, ... etc

Example

import fs from "node:fs";
import { MMKVParser } from "@syail/mmkv-parser";

const parser = new MMKVParser(fs.readFileSync("bin/mmkv.default"));

const map = parser.load();

for (const key in map) {
  console.log("KEY: ", key);

  const values = map[key];

  for (const value of values) {
    console.log("VALUE: ", MMKVParser.readAsString(value));
  }
}

Data Structure

Header

name offset size
Data Length (int32) 0 4
Unknown (varint) 4 n
Body 4+n -

Body

name
key size (varint)
key (string)
value size (varint)
value