133 Commits
Author SHA1 Message Date
guoling 2d654ef733 Fix expired-key enumeration 2026-10-15 10:42:33 +08:00
guoling 0aa6e2deb4 Fix removeStorage lock ordering
Close the cached instance before acquiring the deletion flock, matching the instance-mutex-before-file-lock order used by writers. Retain the independent CRC descriptor and cross-process exclusion during deletion.

Document instance lifetime requirements and add deterministic regression coverage for writer ordering, cached and uncached removal, and cross-process exclusion. The test passes under ASan and UBSan and detects the original lock inversion.
2026-10-14 15:56:26 +08:00
guoling a72006d149 Optimize borrowed value storage and reject self-import 2026-10-08 16:17:57 +08:00
guoling 0d85678165 Load expiration state before encoding the first value write
A first set after reopening can encode without the expiration suffix and still report success, leaving an unreadable value. Move the existing write locks and load check ahead of expiry-dependent encoding in each setter path, without adding lock acquisitions or scalar buffers. Route encoded vectors through the existing expiration helper so public templates do not need lock internals.

Keep a minimal set-succeeds/read-fails regression separate from the setter-overload coverage. Both explicitly avoid warming the lazy instance before set.
2026-09-07 16:27:58 +08:00
guoling baf36b8695 Refine v2.4.2 hardening fixes 2026-08-20 21:42:19 +08:00
guoling c79b7a59d5 Harden backup and restore file handling 2026-08-05 13:39:29 +08:00
guoling 7b20c03c34 Harden encrypted write and key handling 2026-08-05 13:39:29 +08:00
guoling fd0b664940 Fix KMP expiration and UTF-8 consistency 2026-08-05 13:39:29 +08:00
guoling 4e3535f2c8 Harden MMKV close lifecycle handling #1669 2026-07-29 14:57:14 +08:00
guoling f3b27766a2 fix MMKV instance lifecycle handling #1669 2026-07-28 19:35:21 +08:00
guoling 5892e0ff3b fix expireDuration overflow bug #1665 2026-06-02 19:06:09 +08:00
guoling 9348a93f26 refactor callback system into unified MMKVHandler across all platforms
Replace 4 separate static function pointers (LogHandler, ErrorHandler,
ContentChangeHandler, ContentLoadedHandler) with a single MMKVHandler
abstract class in Core C++. Update all 6 platform wrappers (iOS, Android,
OHOS, Python, Golang, Flutter) to use adapter classes bridging to the new
unified handler. Add onMMKVContentLoadSuccessfully callback to Android,
OHOS, Flutter, Python and Golang where it was previously missing.
2026-03-18 12:40:05 +08:00
guoling fec30f74c7 robust check on encryption mode #1642 2026-02-24 15:21:51 +08:00
guoling 683382f3d8 add getBytes() with string_view key for ObjC++ 2026-02-24 10:56:18 +08:00
guoling b56ce1004f merge ashmem size with expectedCapacity on Android & OHOS 2026-02-11 12:39:08 +08:00
guoling ffcb07ee9f add default mmkv with config for iOS 2026-02-09 20:06:09 +08:00
guoling ed0cade7e8 add MMKVConfig for Android 2026-02-06 20:28:19 +08:00
guoling 1915d892f1 add MMKVConfig 2026-02-05 17:21:53 +08:00
hossinasaadi 6acdef76d0 fix 2025-12-22 17:56:48 +03:30
hossinasaadi e8dba7762f fix public interface 2025-12-22 15:23:58 +03:30
hossinasaadi df721fa6cd add onMMKVContentLoadSuccessfully to content notify handler 2025-12-21 17:39:57 +03:30
guoling d99404baeb reduce absolutePath() call as much as possible 2025-12-16 18:32:19 +08:00
guoling 0307e43ed7 add aes256 option on Android 2025-11-28 17:26:09 +08:00
guoling 8cb70d1123 add aes256 option on mmkv creation 2025-11-27 16:02:49 +08:00
zhongwuzw a006112fb0 Fixes build error when unset MMKV_APPLE on apple platforms 2025-06-01 10:33:00 +08:00
guoling 9ac9c642ac add importFrom() for iOS 2025-04-25 11:48:31 +08:00
guoling 82c32013ef remove checkProcessMode() from OHOS 2025-04-23 14:24:33 +08:00
guoling 0a5e78b215 add enableDisableProcessMode() for Android 2025-04-23 12:23:41 +08:00
guoling 0e05353b4a add checkExist(), isFileValid() and groupPath() for Flutter, fix checkContentChangedByOuterProcess() not working bug 2025-04-22 18:09:12 +08:00
guoling c2dbd276c2 add checkExist() #1346 2025-04-22 15:15:23 +08:00
guoling 608d775bf6 make data file mayfly fd except ashmem on Android/OHOS 2025-04-18 18:11:42 +08:00
guoling f23e95c652 support using MMKVCore at Apple platform in pure C++ code 2025-02-14 19:43:48 +08:00
guoling ead3e4668f add experimental disk corrupt detech on Android/Linux 2025-01-15 11:55:21 +08:00
guoling aad8e484c0 add iOS/macOS/Win32 disk failure protection 2025-01-13 18:11:22 +08:00
guoling a7d70e187a NameSpace works on POSIX 2025-01-07 20:32:36 +08:00
guoling fbde94c843 export mmkv symbols & headers for Native usage in NDK #1449 #1450 2025-01-06 15:58:03 +08:00
guoling 95809ebf72 export whole symbol of MMKV class for Android/OHOS for C++ usage 2025-01-06 15:58:03 +08:00
guoling d069d7c56a NameSpace for Android complete 2025-01-06 15:58:03 +08:00
guoling 147f89dba7 migrate legacy mmap ID to normal ID 2025-01-06 15:58:01 +08:00
guoling fca2582343 fix tryAtomicRename() with src == dst bug 2025-01-06 15:55:51 +08:00
guoling 89b56922e8 1. NameSpace almost work on iOS
2. Upgrade to iOS 13, watchOS 6
3. Dont mkPath() on ReadOnly mode
2025-01-06 15:54:38 +08:00
guoling 0bd466efe3 support correct filename on custom root path 2024-12-24 19:29:07 +08:00
guoling 3b8c11d944 fix merge error 2024-12-17 17:45:27 +08:00
guoling 20b68dbc71 fix tryAtomicRename() with src == dst bug 2024-12-17 17:28:43 +08:00
guoling 47d3c0893a add readonly support 2024-09-06 19:44:11 +08:00
guoling 38efa640da fix gcc compile error 2024-06-28 14:46:27 +08:00
guoling 01790453fe use std::string_view to represent key type 2024-05-11 14:44:17 +08:00
guoling 9341e03e19 make C++20 optional 2024-05-07 16:43:18 +08:00
guoling e6056f9d4c fix iOS compile error 2024-05-07 12:01:23 +08:00
guoling 9e8c30d7cb also support std::span<> 2024-05-06 17:54:17 +08:00