61 Commits

Author SHA1 Message Date
guoling 2d654ef733 Fix expired-key enumeration 2026-10-15 10:42:33 +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 023914a0c4 Honor expiration when reading and enumerating read-only stores
Read the expiration flag before the read-only metadata return. Filter expired entries in memory for count/allKeys instead of using fullWriteback, which refuses read-only stores. Test each API as the first operation on a fresh instance, for plain and encrypted stores, and verify filtering leaves stored entries intact.
2026-09-07 16:25:11 +08:00
guoling baf36b8695 Refine v2.4.2 hardening fixes 2026-08-20 21:42:19 +08:00
guoling 7b20c03c34 Harden encrypted write and key handling 2026-08-05 13:39:29 +08:00
guoling 5892e0ff3b fix expireDuration overflow bug #1665 2026-06-02 19:06:09 +08:00
guoling 683382f3d8 add getBytes() with string_view key for ObjC++ 2026-02-24 10:56:18 +08:00
guoling f23e95c652 support using MMKVCore at Apple platform in pure C++ code 2025-02-14 19:43:48 +08:00
guoling d26fa06b2e remove guardForBackgroundWriting() for we are iOS 13+ 2025-01-06 15:58:04 +08:00
guoling 6688793f59 check getMMKVWithID result and throw exception #1399 2024-09-09 20:43:06 +08:00
guoling 47d3c0893a add readonly support 2024-09-06 19:44:11 +08:00
Nikita Sigal 270c8a3938 Fixed Checksum.h header path 2024-09-02 16:46:49 +03:00
guoling 912f8a4ccf fix override bug on encrypted mmkv #1351 2024-07-16 18:38:38 +08:00
guoling b990c2bd14 prepare to add vector<T> encode/decode support 2024-04-28 18:49:34 +08:00
guoling 1107f99170 turn-off mlock() protection in background on iOS 13+ 2023-09-19 18:34:08 +08:00
guoling 34411268da add catch(...) for each try-catch 2023-09-19 15:04:23 +08:00
Guo Ling bdf434db96 Merge pull request #1151 from kaitian521/dev
Do not append to file when dic.size()==1 && new key in dict #1150
2023-08-24 10:39:39 +08:00
Lishaokai c962b68934 Do not append to file when dic.size()==1 && new key in dict 2023-08-23 11:23:58 +08:00
guoling b71885713a add back GetAppleMachineInfo() 2023-08-23 11:03:14 +08:00
guoling bcfa406d77 fix NSKeyedArchive error on enable auto key expire #1132 2023-08-10 11:20:20 +08:00
guoling 6fee34fae7 add filterExpire param for count() & allKeys() #1096 2023-06-20 14:29:34 +08:00
guoling 852ea1e6c8 add Expire constant 2023-05-26 17:25:20 +08:00
guoling c9f1d7aa92 support auto key expiration: works on iOS 2023-05-24 17:46:46 +08:00
guoling 3e3bb8f6bb fix warning on some compiler #1077 2023-05-16 10:52:11 +08:00
Guo Ling 298fad27f7 Merge pull request #968 from wakakajp/master
Merge pull request #931 from Tencent/dev
2022-10-24 23:18:37 +08:00
wakakajp acac8931c4 OPTIMIZE:code style optimize 2022-10-24 20:00:45 +08:00
wakakajp ab6969caf5 FIX: replace try catch with @try @catch, so NSException can be caught correctly 2022-10-24 17:56:11 +08:00
Guo Ling 456b218855 Merge pull request #928 from wakakajp/master
FIX: fix MMKV::getObject crash on iOS
2022-08-09 18:18:44 +08:00
wakakajp 2f59a5c7c6 FIX: fix MMKV::getObject crash on iOS
[NSKeyedUnarchiver unarchiveObjectWithData:] This method raises an NSInvalidArgumentException if data is not a valid archive.
2022-08-09 18:02:16 +08:00
guoling e48256ad10 add shared-lock until getxxxForKey() is finished #916 2022-07-08 12:49:09 +08:00
guoling b482b7ce86 clean up aes & crc32 platform macro 2020-10-30 17:06:51 +08:00
guoling 093f9efc2e turn off crc32 optimization for iOS 2020-10-13 17:18:55 +08:00
guoling e30dfded4d wording 2020-09-10 20:27:39 +08:00
guoling 1f1fba899b try Detect CRC Availability By SIGILL 2020-09-10 19:20:23 +08:00
guoling f5f36819c9 NULL -> nullptr 2020-07-23 20:42:59 +08:00
guoling 09ed7f609e use sysctlbyname() to get iOS device type 2020-07-23 20:39:38 +08:00
guoling 61ba357a8f auto clean up for iOS 2020-07-15 18:08:12 +08:00
guoling 859e493e34 fix potencial crash 2020-07-15 11:21:32 +08:00
guoling 74be762dc8 add MMKV_DISABLE_CRYPT preprocess directive 2020-07-01 18:12:00 +08:00
guoling 1d262bb195 hide KeyValueHolder from public header 2020-06-30 18:23:25 +08:00
guoling af1bca6e33 remove useless code 2020-06-29 12:46:15 +08:00
guoling 7c234be908 cleanup iOS backgroud protecting logic 2020-06-28 22:02:04 +08:00
guoling 711e1afaee fix Xcode mysterious build error 2020-06-28 20:02:19 +08:00
guoling 03dd58a3fd tidy iOS stuff 2020-06-19 21:01:18 +08:00
guoling 63cb806a03 tidy 2020-06-19 20:26:27 +08:00
guoling 0ad815fc5c encrypt & decrypt almost done 2020-06-17 20:44:56 +08:00
guoling 70fdd0e355 avoid memory copying when encoding string & buffer 2020-06-11 16:20:23 +08:00
guoling aa59dfb10b opt encode OC objects a little bit 2020-06-10 22:05:05 +08:00
guoling fa741f5186 opt MMBuffer for small size memory 2020-06-10 21:36:28 +08:00
guoling 0f55649e2c write almost done 2020-06-10 12:31:58 +08:00