Skip to content

fix(deps): update com.tencent:mmkv to v2 - #118

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/com.tencent-mmkv-2.x
Open

fix(deps): update com.tencent:mmkv to v2#118
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/com.tencent-mmkv-2.x

Conversation

@renovate

@renovate renovate Bot commented Oct 21, 2024

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
com.tencent:mmkv 1.3.162.4.1 age confidence

Warning

Some dependencies could not be looked up. Check the Dependency Dashboard for more information.


Release Notes

Tencent/MMKV (com.tencent:mmkv)

v2.4.1

This is a maintenance release based on v2.4.0. It focuses on data-safety fixes, encrypted-file compatibility, packaging/build cleanup, and experimental Kotlin Multiplatform support for Android and iOS.

Changes for All Platforms
  • Fix: Improved MMKV instance lifecycle handling with safer wrapper ownership, native lock teardown, and clarified destructive close() semantics.
  • Fix: Fixed an oversized-key corruption bug where keys longer than the internal uint16_t holder limit could overflow key/value metadata and corrupt subsequent reads.
  • Fix: Fixed an expireDuration overflow bug (#​1665). Very large expiration durations are now clamped safely instead of wrapping around.
  • Fix: Improved encrypted MMKV random-IV upgrade behavior. Existing encrypted files using the older IV format now trigger a full writeback when possible so they are upgraded to the random-IV format.
  • Fix: Added safer random-IV reset behavior when clearing memory cache for encrypted instances.
  • Fix: Fixed -Wmissing-braces warnings in Android, Win32, and POSIX demo code.
  • Change: Added extra mmap/munmap logging to help diagnose file mapping lifecycle issues.
  • Feature: Added a universal C interface (Core/cbridge) for MMKV Core, with NameSpace support and a pure C demo. The C bridge is also used by the KMP iOS package.
Kotlin Multiplatform
  • Experimental: Added Kotlin Multiplatform support for Android and iOS via the Gradle package com.tencent:mmkv-kmp:2.4.1. The API and artifact layout may change in a future release.
  • Supported targets: Android, iosArm64, iosSimulatorArm64, and iosX64.
  • Android delegates to the native com.tencent:mmkv:2.4.1 AAR. iOS embeds MMKV Core through the C bridge in the published native KLIBs.
  • Fix: Added platform-parity buffer/state APIs, preserved empty byte arrays on iOS, respected handler notification preferences, and added Android device plus Kotlin/Native smoke tests.
  • Fix: Improved MMKV instance lifecycle handling and clarified destructive close() semantics.
Android
  • Fix: Added regression coverage for the expiration overflow issue.
  • Fix: Improved Android CMake header-export detection for builds where ANDROID_ABI is defined, including local Android artifact publication builds.
iOS/macOS
  • Feature: Added the static SwiftPM product MMKVAppExtension-static.
  • Fix: Excluded the standalone C bridge from the Objective-C++ SwiftPM Core target and gave each wrapper target its own privacy manifest resource.
  • Feature: Added +[MMKV unregisterHandler] as the correctly spelled handler-unregistration API. The previous typo'd +unregiserHandler remains available for source/binary compatibility and forwards to the new API.
HarmonyOS NEXT
  • Change: Cleaned up project signing/build configuration and removed checked-in Hvigor dependency archives.
  • Fix: Improved MMKV instance lifecycle handling and clarified destructive close() semantics.
  • Change: Prepared the @tencent/mmkv package metadata and documentation for v2.4.1.
Flutter
  • Feature: Added Swift Package Manager support for the Apple platform implementation and migrated the iOS/macOS examples to SwiftPM. CocoaPods remains available as a fallback.
  • Fix: Improved MMKV instance lifecycle handling and clarified destructive close() semantics.
POSIX
  • Feature: Added a pure C demo for the new C bridge.
  • Fix: Added regression coverage for oversized-key rejection and expiration overflow.
Win32
  • Fix: Fixed -Wmissing-braces warnings in Win32 file handling code.

v2.4.0

This release introduces a unified MMKVHandler callback interface across all platforms, replacing scattered per-callback registration with a single, OO-style handler. It also adds the MMKVConfig all-in-one configuration and several bug fixes.

Changes for All Platforms
  • Feature: Refactored the callback system into a unified MMKVHandler interface. All callbacks (log redirecting, error handling, content change notification, content loaded notification) are now grouped in a single handler registered via registerHandler(). The old per-callback registerLogHandler() / registerErrorHandler() / registerContentChangeHandler() / registerContentLoadedHandler() APIs have been removed.
  • Feature: Added onMMKVContentLoadSuccessfully callback, triggered when an MMKV file is loaded/mapped successfully.
  • Feature: Added MMKVConfig for all-in-one instance configuration, supporting all options (mode, cryptKey, aes256, expectedCapacity, enableKeyExpire, expiredInSeconds, enableCompareBeforeSet, recover, itemSizeLimit) in a single struct/class.
  • Feature: Added defaultMMKV(config) variant for creating the default instance with full configuration.
  • Fix: Robust check on encryption mode (#​1642).
  • Fix: Protect from delete file failure on corrupted files.
  • Fix: Protect from m_file not valid for isDiskOfMMAPFileCorrupted().
  • Fix: Reduce absolutePath() calls as much as possible.
  • Drop old-style actual size downgrade support.
  • MMKV must be compiled with C++17.
Android
  • Change: Merged MMKVContentChangeNotification into MMKVHandler. The old MMKVContentChangeNotification interface is now @Deprecated.
  • Fix: Fix fcntl() OFD lock failure on ashmem (#​1637).
  • Merge ashmem size with expectedCapacity.
  • Correctly collect so-symbols.
iOS/macOS
  • Feature: Added getBytes() with string_view key for ObjC++.
  • Fix: Fixed a memory leak on getting NameSpace instance.
  • Support Swift Package Manager (#​535).
  • Fix compile error on tryAtomicRename().
HarmonyOS NEXT
  • Merge ashmem size with expectedCapacity.
Flutter
  • Updated to use the unified MMKVHandler callback interface.
Win32
  • Fix: Convert log message to UTF-8 for Win32 client.
  • Verify all pages for corrupted file detection.

v2.3.0

This release is a breaking change and introduces AES-256 encryption for enhanced security.

All Platforms
  • Feature: Added AES-256 encryption functionality. To upgrade an existing encrypted MMKV instance to AES-256, first load it using the old key. Then, call the reKey() method with the new key and set the aes256 parameter to true, e.g., reKey(newKey, aes256=true). After this, you should use the new key for all future loads of this instance.
  • Fix: Resolved a crash that occurred when loading an empty file in ReadOnly mode.
  • Fix: Added protection against the weakly_canonical() exception caused by an invalid file path.
  • Fix: Fixed an issue where the file size could change during multi-process loading.
  • Fix: Corrected a bug where a single key could be overridden incorrectly when upgrading from a v1.1.x version.
iOS/macOS/watchOS
  • Change: Dropped support for the armv7k architecture on Apple Watch. To adapt, you should add armv7k to the "Excluded Architectures" setting for your Apple Watch App or Extension target.
  • Important: Do not upgrade to this version if you need to maintain armv7k support.
  • Change: Dropped deprecated methods that use the relativePath: parameter. If you were using these methods, please migrate to those using the rootPath: parameter instead.
POSIX
  • Change: Dropped support for armv7 architecture. Do not upgrade to this version if you need to maintain armv7 support.

v2.2.4

This is a hotfix release mainly for iOS/macOS CocoaPods users.

Changes for All platforms
  • Improve the performance of MMBuffer a little bit in some cases.
iOS/macOS
  • Make MMKV and MMKVCore podspec define modules.

v2.2.3

This is a feature release that brings full desktop support to Flutter. It also includes key bug fixes and enhancements for Android and other platforms.

Flutter
  • Added Full Desktop Support: MMKV for Flutter now officially supports Windows, macOS, and Linux.
  • Example App: The example application has been updated to run on all new desktop platforms.
Android
  • Feature: Added MMKVHandler.getNativeLogHandler() to allow native handling of MMKV logs from C++ code, improving performance.
  • Fix: Corrected an integer overflow bug where a native memory address exceeding Long.MAX_VALUE was misinterpreted as a negative number.
  • Fix: Prevented potential memory overflow by ensuring JNI local references are deleted after use.
  • Fix: Fixed an issue where directories for special relative paths were not being created correctly.
  • Enhancement: Improved the thread-safety of the callback handler to prevent crashes.
iOS/macOS
  • Fix: Resolved a build error on Apple platforms that occurred when the MMKV_APPLE flag was not set.
  • Fix: Addressed a naming conflict in the Swift implementation.
Windows
  • Fix: Corrected character encoding issues in the Win32 demo by converting files to UTF-8.

v2.2.2

This is a hot fix version mainly for Android/Linux platforms. It’s highly recommended for v2.2.0~v2.2.1 users.

Changes for All platforms
  • Improve file lock consistency for Mayfly FD MMKV instances.
Android
  • Fix a potential ANR on multi-process mode MMKV init/creation.
POSIX
  • Fix a potential ANR on multi-process mode MMKV init/creation on Linux.
iOS/macOS
  • Retain the callback handler to prevent a potential short-lived callback handler from crashing.
Win32
  • Improve efficiency on MMKV instance init/creation.

v2.2.1

Changes for All platforms
  • Add importFrom().
Android
  • Fix a bug on initialization.

v2.2.0

We introduce the Mayfly FD (short-lived file descriptor) enhancement, reducing MMKV's fd footprint by half and more. For a single-process mode MMKV instance, the fd footprint is reduced to zero (except Android/OHOS, details below). For a multi-process mode MMKV instance, the fd footprint is reduced by half, for we still need a long-lived fd to inter-process lock the shared memory.

Changes for All platforms
  • Add Mayfly FD (short-lived file descriptor) enhancement.
  • Improve multi-process access efficiency by about 20%.
  • Add checkExist() to check if a MMKV instance exists on disk.
  • Drop deprecated armv7 AES hardware acceleration.
Android
  • Reduce the fd footprint by half. For a single-process mode MMKV instance, we still need a long-lived fd to support the process-mode checker and legacy name upgrading. In the far future, when all legacy names have been upgraded, we might drop the long-lived fd like other platforms.
  • Upgrade Android compileSdk/targetSdk to 35, NDK to 28.1, Java to 11, Gradle to 8.11.1, and AGP to 8.9.2.
HarmonyOS NEXT
  • Reduce the fd footprint by half. For a single-process mode MMKV instance, we still need a long-lived fd to support the legacy name upgrading. In the far future, when all legacy names have been upgraded, we might drop the long-lived fd like other platforms.
  • Drop checkProcessMode(), it’s never been used.
  • Improve obfuscation configuration with relative path.
iOS
  • Add +mmkvGroupPath to get the group folder for MMKV multi-process storage.
Flutter
  • Add isFileValid().
  • Add groupPath() on iOS.
  • Fix checkContentChangedByOuterProcess() not working bug.

v2.1.0

Happy Chinese New Year!
This is a breaking change version for the Android/OHOS platform. Read the change log bellow and upgrade carefully.

Changes for All platforms
  • Add the NameSpace feature that easily supports customizing a root directory.
  • Add protection from bad disk records of MMKV files.
  • Fix FileLock not being unlocked on destruction.
  • Improve directory creation on ReadOnly mode.
Android
  • Breaking change: Migrate legacy MMKV in a custom directory to normal MMKV. Historically Android/OHOS mistakenly use mmapKey as mmapID, which will be problematic with the NameSpace feature. Starting from v2.1.0, MMKV will try to migrate them back to normal when possible.
    It's highly recommended that you upgrade to v2.0.2/v1.3.11 first with forward support of normal MMKV in a custom directory.
  • Supports using MMKV directly in C++ code.
  • Improve inter-process locking by using F_OFD_SETLK instead of F_SETLK.
  • Add experimental protection from bad disk records of MMKV files.
HarmonyOS NEXT
  • Breaking change: Migrate legacy MMKV in a custom directory to normal MMKV. Historically Android/OHOS mistakenly use mmapKey as mmapID, which will be problematic with the NameSpace feature. Starting from v2.1.0, MMKV will try to migrate them back to normal when possible.
    It's highly recommended that you upgrade to v2.0.2/v1.3.11 first with forward support of normal MMKV in a custom directory.
  • Supports using MMKV directly in C++ code.
  • Improve inter-process locking by using F_OFD_SETLK instead of F_SETLK.
  • Add experimental protection from bad disk records of MMKV files.
iOS/macOS
  • Upgrade to iOS 13, macOS 10.15, and watchOS 6 to support the NameSpace functionality.
  • Supports using MMKV directly in C++ code.
  • Drop the background mlock() protection given that we are iOS 13+.
  • Add tested protection from bad disk records of MMKV files.
  • Fix a package error when using MMKV by submodule.
Flutter
  • Remove unused imports and fix deprecated implementations.
  • Support flutter 3.29.
Win32
  • Add tested protection from bad disk records of MMKV files.
POSIX
  • Improve inter-process locking by using F_OFD_SETLK instead of F_SETLK.
  • Add experimental protection from bad disk records of MMKV files.
  • Fix a compile error on the GNU toolchain.
Golang
  • Fix a link error in the armv8 arch.
  • Improve multi-platform building.

v2.0.2

Mary holiday and a happy new year!

Changes for All platforms
  • Fix a bug that MMKV might fail to backup/restore across different filesystems.
  • Add protection from invalid value size of auto-key-expire mmkv.
Android
  • If the running App is 32-bit only, warn about it (by throwing UnsupportedArchitectureException) before trying to load native lib.
  • Add forward support for the correct filename with a custom root path.
HarmonyOS NEXT
  • Obfuscation fully supported.
  • Use atomic file rename on OHOS.
  • Add forward support for the correct filename with a custom root path.
Win32
  • Only mmap() on ftruncate()/zeroFillFile() failure iff we have a valid file mapping before.

v2.0.1

This is a hotfix release.

Changes for All platforms
  • Fix a bug that might cause MMKV to become dead-locked for other threads after decoding container-type values. The affected platforms and value types are listed below. So don't be surprised if you find no update on the unaffected platforms.
HarmonyOS NEXT
  • Fix a bug that MMKV might become dead-locked for other threads after decodeStringSet() / decodeNumberSet / decodeBoolSet or decoding TypedArray.
Flutter
  • Fix the bug on HarmonyOS NEXT listed above. A version named v2.0.1 was added to fix the Android version conflict between the LTS series & v2.0. Thanks to the federated plugins framework, only the underlying mmkv_ohos plugin is upgraded, the mmkv plugin stays the same.
POSIX
  • Fix a bug that MMKV might become dead-locked for other threads after decoding std::vector<T> or std::span<T> values.

v2.0.0

This release is a breaking change release, especially for Android.

Changes for All platforms
  • Add readonly mode support.
  • Fix a compile error when MMKV_DISABLE_CRYPT is defined and MMKV is built by source in DEBUG.
Android
  • Support 16K page size for Android 15.
  • Drop the support of 32-bit ABI.
  • Bump the mini SDK level to API 23.
iOS / macOS
  • Add Mac Catalyst support
Flutter
  • Add add log/error/content-change callback.
HarmonyOS NEXT
  • Add add log/error/content-change callback.
  • Support obfuscation. For the time being, you will have to manually copy the content of MMKV's consumer-rules.txt into your App's obfuscation-rules.txt.
Win32
  • Replace random() with rand() to fix a compile error.

Configuration

📅 Schedule: (in timezone Asia/Shanghai)

  • Branch creation
    • "after 1am and before 8am"
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate
renovate Bot force-pushed the renovate/com.tencent-mmkv-2.x branch 2 times, most recently from 24ab897 to 98cea57 Compare November 12, 2024 20:26
@renovate
renovate Bot force-pushed the renovate/com.tencent-mmkv-2.x branch from 98cea57 to 812bc7c Compare December 2, 2024 11:47
@renovate
renovate Bot force-pushed the renovate/com.tencent-mmkv-2.x branch 2 times, most recently from 9afacef to 9a1bc82 Compare January 2, 2025 21:57
@renovate
renovate Bot force-pushed the renovate/com.tencent-mmkv-2.x branch 2 times, most recently from 847cede to 505cbf1 Compare January 30, 2025 15:03
@renovate
renovate Bot force-pushed the renovate/com.tencent-mmkv-2.x branch from 505cbf1 to b54d4ac Compare February 18, 2025 10:31
@renovate
renovate Bot force-pushed the renovate/com.tencent-mmkv-2.x branch 2 times, most recently from ceb5fdd to ed04171 Compare April 25, 2025 08:50
@renovate
renovate Bot force-pushed the renovate/com.tencent-mmkv-2.x branch 2 times, most recently from b52a5e7 to 288d21c Compare May 14, 2025 23:31
@renovate
renovate Bot force-pushed the renovate/com.tencent-mmkv-2.x branch from 288d21c to b0c9f27 Compare July 8, 2025 14:47
@renovate
renovate Bot force-pushed the renovate/com.tencent-mmkv-2.x branch from b0c9f27 to b23674f Compare August 10, 2025 12:28
@renovate
renovate Bot force-pushed the renovate/com.tencent-mmkv-2.x branch from b23674f to dc6e4b1 Compare August 20, 2025 16:58
@renovate
renovate Bot force-pushed the renovate/com.tencent-mmkv-2.x branch from dc6e4b1 to 6c0d198 Compare September 8, 2025 13:12
@renovate
renovate Bot force-pushed the renovate/com.tencent-mmkv-2.x branch from 6c0d198 to f93c122 Compare September 25, 2025 10:12
@renovate
renovate Bot force-pushed the renovate/com.tencent-mmkv-2.x branch from f93c122 to 4209a2e Compare October 9, 2025 10:44
@renovate
renovate Bot force-pushed the renovate/com.tencent-mmkv-2.x branch from 4209a2e to e2dc32f Compare November 10, 2025 23:45
@renovate
renovate Bot force-pushed the renovate/com.tencent-mmkv-2.x branch from e2dc32f to 1b062d3 Compare November 18, 2025 19:05
@renovate
renovate Bot force-pushed the renovate/com.tencent-mmkv-2.x branch 2 times, most recently from 61495a7 to eb597ba Compare December 3, 2025 21:40
@renovate
renovate Bot force-pushed the renovate/com.tencent-mmkv-2.x branch from eb597ba to aa5d328 Compare December 30, 2025 12:51
@renovate
renovate Bot force-pushed the renovate/com.tencent-mmkv-2.x branch from aa5d328 to e4c0641 Compare February 2, 2026 15:02
@renovate
renovate Bot force-pushed the renovate/com.tencent-mmkv-2.x branch from e4c0641 to f88827c Compare February 12, 2026 18:16
@renovate
renovate Bot force-pushed the renovate/com.tencent-mmkv-2.x branch from f88827c to 828a4c6 Compare February 27, 2026 13:41
@renovate
renovate Bot force-pushed the renovate/com.tencent-mmkv-2.x branch 2 times, most recently from e5da615 to 6996d06 Compare March 19, 2026 08:58
@renovate
renovate Bot force-pushed the renovate/com.tencent-mmkv-2.x branch from 6996d06 to e6faab9 Compare May 22, 2026 04:01
@renovate
renovate Bot force-pushed the renovate/com.tencent-mmkv-2.x branch from e6faab9 to 54dc2fa Compare July 16, 2026 17:02
@renovate
renovate Bot force-pushed the renovate/com.tencent-mmkv-2.x branch from 54dc2fa to b039b18 Compare July 30, 2026 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants