Skip to content

Double-check the "remove" behavior from the MMKVParser #15

@spak9

Description

@spak9

The decode_into_map() function currently does not indicate whether a key-value pair has been removed, which may be useful for the inclined analyst.

For example, the following Android code simply encodes ('key', 4444) pair, and then removes it right after:

  private void createInt32KeypairWithRemove() {
      deleteMMKVFiles("data_int32_keypair_with_remove");

      MMKV kv = MMKV.mmkvWithID("data_int32_keypair_with_remove");
      kv.encode("key", 4444);
      kv.removeValueForKey("key");

      int value = kv.decodeInt("key"); // default = 0
      Log.d("MMKV", "key after remove = " + value);
  }

The corresponding decode_into_map() call returns [b'\xdc"'], which is correct, but can be argued that it should have an additional element that indicates a removal, such as a None or something of that nature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidThis doesn't seem rightquestionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions