react-native-mmkv-dz 2.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/LICENSE +219 -0
  2. package/MMKV/CHANGELOG.md +553 -0
  3. package/MMKV/Core/CMakeLists.txt +153 -0
  4. package/MMKV/Core/CodedInputData.cpp +228 -0
  5. package/MMKV/Core/CodedInputData.h +83 -0
  6. package/MMKV/Core/CodedInputDataCrypt.cpp +280 -0
  7. package/MMKV/Core/CodedInputDataCrypt.h +87 -0
  8. package/MMKV/Core/CodedInputDataCrypt_OSX.cpp +62 -0
  9. package/MMKV/Core/CodedInputData_OSX.cpp +92 -0
  10. package/MMKV/Core/CodedOutputData.cpp +174 -0
  11. package/MMKV/Core/CodedOutputData.h +82 -0
  12. package/MMKV/Core/Core.xcodeproj/project.pbxproj +702 -0
  13. package/MMKV/Core/Core.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  14. package/MMKV/Core/Core.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  15. package/MMKV/Core/Core.xcodeproj/xcshareddata/xcschemes/Core.xcscheme +67 -0
  16. package/MMKV/Core/Core.xcodeproj/xcshareddata/xcschemes/MMKVWatchCore.xcscheme +67 -0
  17. package/MMKV/Core/InterProcessLock.cpp +186 -0
  18. package/MMKV/Core/InterProcessLock.h +119 -0
  19. package/MMKV/Core/InterProcessLock_Android.cpp +103 -0
  20. package/MMKV/Core/InterProcessLock_Win32.cpp +108 -0
  21. package/MMKV/Core/KeyValueHolder.cpp +236 -0
  22. package/MMKV/Core/KeyValueHolder.h +118 -0
  23. package/MMKV/Core/MMBuffer.cpp +185 -0
  24. package/MMKV/Core/MMBuffer.h +107 -0
  25. package/MMKV/Core/MMKV.cpp +1418 -0
  26. package/MMKV/Core/MMKV.h +386 -0
  27. package/MMKV/Core/MMKVLog.cpp +127 -0
  28. package/MMKV/Core/MMKVLog.h +86 -0
  29. package/MMKV/Core/MMKVLog_Android.cpp +79 -0
  30. package/MMKV/Core/MMKVMetaInfo.hpp +81 -0
  31. package/MMKV/Core/MMKVPredef.h +245 -0
  32. package/MMKV/Core/MMKV_Android.cpp +259 -0
  33. package/MMKV/Core/MMKV_IO.cpp +1119 -0
  34. package/MMKV/Core/MMKV_IO.h +57 -0
  35. package/MMKV/Core/MMKV_OSX.cpp +347 -0
  36. package/MMKV/Core/MMKV_OSX.h +51 -0
  37. package/MMKV/Core/MemoryFile.cpp +537 -0
  38. package/MMKV/Core/MemoryFile.h +182 -0
  39. package/MMKV/Core/MemoryFile_Android.cpp +211 -0
  40. package/MMKV/Core/MemoryFile_Linux.cpp +120 -0
  41. package/MMKV/Core/MemoryFile_OSX.cpp +142 -0
  42. package/MMKV/Core/MemoryFile_Win32.cpp +536 -0
  43. package/MMKV/Core/MiniPBCoder.cpp +366 -0
  44. package/MMKV/Core/MiniPBCoder.h +129 -0
  45. package/MMKV/Core/MiniPBCoder_OSX.cpp +228 -0
  46. package/MMKV/Core/PBEncodeItem.hpp +86 -0
  47. package/MMKV/Core/PBUtility.cpp +61 -0
  48. package/MMKV/Core/PBUtility.h +153 -0
  49. package/MMKV/Core/ScopedLock.hpp +69 -0
  50. package/MMKV/Core/ThreadLock.cpp +68 -0
  51. package/MMKV/Core/ThreadLock.h +78 -0
  52. package/MMKV/Core/ThreadLock_Win32.cpp +89 -0
  53. package/MMKV/Core/aes/AESCrypt.cpp +256 -0
  54. package/MMKV/Core/aes/AESCrypt.h +107 -0
  55. package/MMKV/Core/aes/openssl/openssl_aes-armv4.S +1231 -0
  56. package/MMKV/Core/aes/openssl/openssl_aes.h +118 -0
  57. package/MMKV/Core/aes/openssl/openssl_aes_core.cpp +1044 -0
  58. package/MMKV/Core/aes/openssl/openssl_aes_locl.h +38 -0
  59. package/MMKV/Core/aes/openssl/openssl_aesv8-armx.S +308 -0
  60. package/MMKV/Core/aes/openssl/openssl_arm_arch.h +84 -0
  61. package/MMKV/Core/aes/openssl/openssl_cfb128.cpp +97 -0
  62. package/MMKV/Core/aes/openssl/openssl_md32_common.h +254 -0
  63. package/MMKV/Core/aes/openssl/openssl_md5.h +49 -0
  64. package/MMKV/Core/aes/openssl/openssl_md5_dgst.cpp +166 -0
  65. package/MMKV/Core/aes/openssl/openssl_md5_locl.h +75 -0
  66. package/MMKV/Core/aes/openssl/openssl_md5_one.cpp +30 -0
  67. package/MMKV/Core/aes/openssl/openssl_opensslconf.h +271 -0
  68. package/MMKV/Core/core.vcxproj +186 -0
  69. package/MMKV/Core/core.vcxproj.filters +150 -0
  70. package/MMKV/Core/crc32/Checksum.h +67 -0
  71. package/MMKV/Core/crc32/crc32_armv8.cpp +132 -0
  72. package/MMKV/Core/crc32/zlib/crc32.cpp +55 -0
  73. package/MMKV/Core/crc32/zlib/crc32.h +48 -0
  74. package/MMKV/Core/crc32/zlib/zconf.h +380 -0
  75. package/MMKV/Core/crc32/zlib/zutil.h +25 -0
  76. package/MMKV/LICENSE.TXT +193 -0
  77. package/MMKV/README.md +288 -0
  78. package/README.md +221 -0
  79. package/android/CMakeLists.txt +71 -0
  80. package/android/build.gradle +371 -0
  81. package/android/gradle.properties +4 -0
  82. package/android/src/main/AndroidManifest.xml +4 -0
  83. package/android/src/main/cpp/MmkvHostObject.cpp +302 -0
  84. package/android/src/main/cpp/MmkvHostObject.h +26 -0
  85. package/android/src/main/cpp/cpp-adapter.cpp +65 -0
  86. package/android/src/main/java/com/reactnativemmkv/MmkvModule.java +49 -0
  87. package/android/src/main/java/com/reactnativemmkv/MmkvPackage.java +26 -0
  88. package/cpp/TypedArray.cpp +341 -0
  89. package/cpp/TypedArray.h +175 -0
  90. package/ios/JSIUtils.h +50 -0
  91. package/ios/JSIUtils.mm +194 -0
  92. package/ios/Mmkv.xcodeproj/project.pbxproj +291 -0
  93. package/ios/MmkvHostObject.h +27 -0
  94. package/ios/MmkvHostObject.mm +299 -0
  95. package/ios/MmkvModule.h +5 -0
  96. package/ios/MmkvModule.mm +73 -0
  97. package/lib/commonjs/MMKV.js +146 -0
  98. package/lib/commonjs/MMKV.js.map +1 -0
  99. package/lib/commonjs/PlatformChecker.js +16 -0
  100. package/lib/commonjs/PlatformChecker.js.map +1 -0
  101. package/lib/commonjs/createMMKV.js +66 -0
  102. package/lib/commonjs/createMMKV.js.map +1 -0
  103. package/lib/commonjs/createMMKV.mock.js +40 -0
  104. package/lib/commonjs/createMMKV.mock.js.map +1 -0
  105. package/lib/commonjs/createMMKV.web.js +77 -0
  106. package/lib/commonjs/createMMKV.web.js.map +1 -0
  107. package/lib/commonjs/createTextEncoder.js +24 -0
  108. package/lib/commonjs/createTextEncoder.js.map +1 -0
  109. package/lib/commonjs/hooks.js +200 -0
  110. package/lib/commonjs/hooks.js.map +1 -0
  111. package/lib/commonjs/index.js +32 -0
  112. package/lib/commonjs/index.js.map +1 -0
  113. package/lib/module/MMKV.js +134 -0
  114. package/lib/module/MMKV.js.map +1 -0
  115. package/lib/module/PlatformChecker.js +9 -0
  116. package/lib/module/PlatformChecker.js.map +1 -0
  117. package/lib/module/createMMKV.js +55 -0
  118. package/lib/module/createMMKV.js.map +1 -0
  119. package/lib/module/createMMKV.mock.js +31 -0
  120. package/lib/module/createMMKV.mock.js.map +1 -0
  121. package/lib/module/createMMKV.web.js +67 -0
  122. package/lib/module/createMMKV.web.js.map +1 -0
  123. package/lib/module/createTextEncoder.js +17 -0
  124. package/lib/module/createTextEncoder.js.map +1 -0
  125. package/lib/module/hooks.js +181 -0
  126. package/lib/module/hooks.js.map +1 -0
  127. package/lib/module/index.js +3 -0
  128. package/lib/module/index.js.map +1 -0
  129. package/lib/typescript/MMKV.d.ts +137 -0
  130. package/lib/typescript/PlatformChecker.d.ts +1 -0
  131. package/lib/typescript/createMMKV.d.ts +6 -0
  132. package/lib/typescript/createMMKV.mock.d.ts +2 -0
  133. package/lib/typescript/createMMKV.web.d.ts +2 -0
  134. package/lib/typescript/createTextEncoder.d.ts +1 -0
  135. package/lib/typescript/hooks.d.ts +81 -0
  136. package/lib/typescript/index.d.ts +2 -0
  137. package/package.json +168 -0
  138. package/react-native-mmkv.podspec +32 -0
@@ -0,0 +1,553 @@
1
+ # MMKV Change Log
2
+
3
+ ## v1.2.13 / 2022-03-30
4
+
5
+ ### Android
6
+ * Fix crash on using Ashmem while `MMKV_DISABLE_CRYPT` macro is defined.
7
+
8
+ ### iOS
9
+ * Add ability to retrieve key existece while getting value, aka `-[MMKV getXXX:forKey:hasValue:]` methods.
10
+
11
+ ### POSIX
12
+ * Add ability to retrieve key existece while getting value, aka `MMKV::getXXX(key, defaultValue, hasValue)` methods.
13
+
14
+ ### Win32
15
+ * Add ability to retrieve key existece while getting value, aka `MMKV::getXXX(key, defaultValue, hasValue)` methods.
16
+
17
+ ## v1.2.12 / 2022-01-17
18
+ ### Changes for All platforms
19
+ * Fix a bug that a subsequential `clearAll()` call may fail to take effect in multi-process mode.
20
+ * Hide some OpenSSL symbols to prevent link-time symbol conflict, when an App somehow also static linking OpenSSL.
21
+
22
+ ### Android
23
+ * Upgrade `compileSdkVersion` & `targetSdkVersion` from `30` to `31`.
24
+
25
+ ## v1.2.11 / 2021-10-26
26
+
27
+ ### Android
28
+ * Due to increasing report about crash inside STL, we have decided to make MMKV **static linking** `libc++` **by default**. Starting from v1.2.11, `com.tencent:mmkv-static` is the same as `com.tencent:mmkv`.
29
+ * For those still in need of MMKV with shared linking of `libc++_shared`, you could use `com.tencent:mmkv-shared` instead.
30
+ * Add backup & restore ability.
31
+
32
+ ### iOS / macOS
33
+ * Add backup & restore ability.
34
+ * Support tvOS.
35
+ * Fix a compile error on some old Xcode.
36
+
37
+ ### Flutter (v1.2.12)
38
+ * Add backup & restore ability.
39
+
40
+ ### POSIX / golang / Python
41
+ * Add backup & restore ability.
42
+ * Fix a compile error on Gentoo.
43
+
44
+ ### Win32
45
+ * Add backup & restore ability.
46
+
47
+ ## v1.2.10 / 2021-06-25
48
+ This version is mainly for Android & Flutter.
49
+
50
+ ### Android
51
+ * Complete **JavaDoc documentation** for all public methods, classes, and interfaces. From now on, you can find the [API reference online](https://javadoc.io/doc/com.tencent/mmkv).
52
+ * Drop the support of **armeabi** arch. Due to some local build cache mistake, the last version (v1.2.9) of MMKV still has an unstripped armeabi arch inside. This is fixed.
53
+ * Change `MMKV.mmkvWithID()` from returning `null` to throwing exceptions on any error.
54
+ * Add `MMKV.actualSize()` to get the actual used size of the file.
55
+ * Mark `MMKV.commit()` & `MMKV.apply()` as deprecated, to avoid some misuse after migration from SharedPreferences to MMKV.
56
+
57
+ ### Flutter (v1.2.11)
58
+ * Bug Fixed: When building on iOS, occasionally it will fail on symbol conflict with other libs. We have renamed all public native methods to avoid potential conflict.
59
+ * Keep up with MMKV native lib v1.2.10.
60
+
61
+ ## v1.2.9 / 2021-05-26
62
+ This version is mainly for Android & Flutter.
63
+
64
+ ### Android
65
+ * Drop the support of **armeabi** arch. As has been mention in the last release, to avoid some crashes on the old NDK (r16b), and make the most of a more stable `libc++`, we have decided to upgrade MMKV's building NDK in this release. That means we can't support **armeabi** anymore. Those who still in need of armeabi can **build from sources** by following the [instruction in the wiki](https://github.com/Tencent/MMKV/wiki/android_setup).
66
+
67
+ We really appreciate your understanding.
68
+
69
+ ### Flutter (v1.2.10)
70
+ * Bug Fixed: When calling `MMKV.encodeString()` with an empty string value on Android, `MMKV.decodeString()` will return `null`.
71
+ * Bug Fixed: After **upgrading** from Flutter 1.20+ to 2.0+, calling `MMKV.defaultMMKV()` on Android might fail to load, you can try calling `MMKV.defaultMMKV(cryptKey: '\u{2}U')` with an **encrytion key** '\u{2}U' instead.
72
+ * Keep up with MMKV native lib v1.2.9.
73
+
74
+ ## v1.2.8 / 2021-05-06
75
+ This will be the last version that supports **armeabi arch** on Android. To avoid some crashes on the old NDK (r16b), and make the most of a more stable `libc++`, we have decided to upgrade MMKV's building NDK in the next release. That means we can't support **armeabi** anymore.
76
+
77
+ We really appreciate your understanding.
78
+
79
+ ### Android
80
+ * Migrate MMKV to Maven Central Repository. For versions older than v1.2.7 (including), they are still available on JCenter.
81
+ * Add `MMKV.disableProcessModeChecker()`. There are some native crash reports due to the process mode checker. You can disable it manually.
82
+ * For the same reason described above (native crashed), MMKV will now turn off the process mode checker on a non-debuggable app (aka, a release build).
83
+ * For MMKV to detect whether the app is debuggable or not, when calling `MMKV.initialize()` to customize the root directory, a `context` parameter is required now.
84
+
85
+ ### iOS / macOS
86
+ * Min iOS support has been **upgrade to iOS 9**.
87
+ * Support building by Xcode 12.
88
+
89
+ ### Flutter (v1.2.9)
90
+ * Support null-safety.
91
+ * Upgrade to flutter 2.0.
92
+ * Fix a crash on the iOS when calling `encodeString()` with an empty string value.
93
+
94
+ **Known Issue on Flutter**
95
+
96
+ * When calling `encodeString()` with an empty string value on Android, `decodeString()` will return `null`. This bug will be fixed in the next version of Android Native Lib. iOS does not have such a bug.
97
+
98
+ ### Win32
99
+ * Fix a compile error on Visual Studio 2019.
100
+
101
+ ## v1.2.7 / 2020-12-25
102
+ Happy holidays everyone!
103
+
104
+ ### Changes for All platforms
105
+ * Fix a bug when calling `sync()` with `false ` won't do `msync()` asynchronous and won't return immediately.
106
+
107
+ ### Android
108
+ * Fix an null pointer exception when calling `putStringSet()` with `null`.
109
+ * Complete review of all MMKV methods about Java nullable/nonnull annotation.
110
+ * Add API for `MMKV.initialize()` with both `Context` and `LibLoader` parammeters.
111
+
112
+ ### Flutter (v1.2.8)
113
+ * Fix a crash on the iOS simulator when accessing the default MMKV instance.
114
+ * Fix a bug on iOS when initing the default MMKV instance with a crypt key, the instance is still in plaintext.
115
+
116
+ ### Golang
117
+ Add golang for POSIX platforms. Most things actually work!. Check out the [wiki](https://github.com/Tencent/MMKV/wiki/golang_setup) for information.
118
+
119
+ ## v1.2.6 / 2020-11-27
120
+ ### Changes for All platforms
121
+ * Fix a file corruption when calling `reKey()` after `removeKeys()` has just been called.
122
+
123
+ ### Android
124
+ * Fix compile error when `MMKV_DISABLE_CRYPT` is set.
125
+ * Add a preprocess directive `MMKV_DISABLE_FLUTTER` to disable flutter plugin features. If you integrate MMKV by source code, and if you are pretty sure the flutter plugin is not needed, you can turn that off to save some binary size.
126
+
127
+ ### Flutter (v1.2.7)
128
+ Add MMKV support for **Flutter** on iOS & Android platform. Most things actually work!
129
+ Check out the [wiki](https://github.com/Tencent/MMKV/wiki/flutter_setup) for more info.
130
+
131
+ ## v1.2.5 / 2020-11-13
132
+ This is a pre-version for Flutter. The official Flutter plugin of MMKV will come out soon. Stay Tune!
133
+
134
+ ### iOS / macOS
135
+ * Fix an assert error of encrypted MMKV when encoding some `<NSCoding>` objects.
136
+ * Fix a potential leak when decoding duplicated keys from the file.
137
+ * Add `+[MMKV pageSize]`, `+[MMKV version]` methods.
138
+ * Add `+[MMKV defaultMMKVWithCryptKey:]`, you can encrypt the default MMKV instance now, just like the Android users who already enjoy this for a long time.
139
+ * Rename `-[MMKV getValueSizeForKey:]` to `-[MMKV getValueSizeForKey: actualSize:]` to align with Android interface.
140
+
141
+ ### Android
142
+ * Fix a potential crash when getting MMKV instances in multi-thread at the same time.
143
+ * Add `MMKV.version()` method.
144
+
145
+ ## v1.2.4 / 2020-10-21
146
+ This is a hotfix mainly for iOS.
147
+
148
+ ### iOS / macOS
149
+ * Fix a decode error of encrypted MMKV on some devices.
150
+
151
+ ### Android
152
+ * Fix a potential issue on checking `rootDir` in multi-thread while MMKV initialization is not finished.
153
+
154
+ ## v1.2.3 / 2020-10-16
155
+ ### Changes for All platforms
156
+ * Fix a potential crash on 32-bit devices due to pointer alignment issue.
157
+ * Fix a decode error of encrypted MMKV on some 32-bit devices.
158
+
159
+ ### iOS / macOS
160
+ * Fix a potential `crc32()` crash on some kind of arm64 devices.
161
+ * Fix a potential crash after calling `+[MMKV onAppTerminate]`.
162
+
163
+ ### Android
164
+ * Fix a rare lock conflict on `checkProcessMode()`.
165
+
166
+ ### POSIX
167
+ Add MMKV support for **Python** on POSIX platforms. Most things actually work!
168
+ Check out the [wiki](https://github.com/Tencent/MMKV/wiki/python_setup) for more info.
169
+
170
+ ## v1.2.2 / 2020-07-30
171
+
172
+ ### iOS / macOS
173
+ * Add auto clean up feature. Call `+[MMKV enableAutoCleanUp:]` to enable auto cleanup MMKV instances that not been accessed recently.
174
+ * Fix a potential crash on devices under iPhone X.
175
+
176
+ ### Android
177
+ * Add multi-process mode check. After so many issues had been created due to mistakenly using MMKV in multi-process mode in Android, this check is added. If an MMKV instance is accessed with `SINGLE_PROCESS_MODE` in multi-process, an `IllegalArgumentException` will be thrown.
178
+
179
+ ### POSIX
180
+ * Add support for armv7 & arm64 arch on Linux.
181
+
182
+ ## v1.2.1 / 2020-07-03
183
+ This is a hotfix release. Anyone who has upgraded to v1.2.0 should upgrade to this version **immediately**.
184
+
185
+ * Fix a potential file corruption bug when writing a file that was created in versions older than v1.2.0. This bug was introduced in v1.2.0.
186
+ * Add a preprocess directive `MMKV_DISABLE_CRYPT` to turn off MMKV encryption ability once and for all. If you integrate MMKV by source code, and if you are pretty sure encryption is not needed, you can turn that off to save some binary size.
187
+ * The parameter `relativePath` (customizing a separate folder for an MMKV instance), has been renamed to `rootPath`. Making it clear that an absolute path is expected for that parameter.
188
+
189
+ ### iOS / macOS
190
+ * `-[MMKV mmkvWithID: relativePath:]` is deprecated. Use `-[MMKV mmkvWithID: rootPath:]` instead.
191
+ * Likewise, `-[MMKV mmkvWithID: cryptKey: relativePath:]` is deprecated. Use `-[MMKV mmkvWithID: cryptKey: rootPath:]` instead.
192
+
193
+ ## v1.2.0 / 2020-06-30
194
+ This is the second **major version** of MMKV. Everything you call is the same as the last version, while almost everything underneath has been improved.
195
+
196
+ * **Reduce Memory Footprint**. We used to cache all key-values in a dictionary for efficiency. From now on we store the offset of each key-value inside the mmap-memory instead, **reducing memory footprint by almost half** for (non-encrypt) MMKV. And the accessing efficiency is almost the same as before. As for encrypted MMKV, we can't simply store the offset of each key-value, the relative encrypt info needs to be stored as well. That will be too much for small key-values. We only store such info for large key-values (larger than 256B).
197
+ * **Improve Writeback Efficiency**. Thanks to the optimization above, we now can implement writeback by simply calling **memmove()** multiple times. Efficiency is increased and memory consumption is down.
198
+ * **Optimize Small Key-Values**. Small key-values of encrypted MMKV are still cached in memory, as all the old versions did. From now on, the struct `MMBuffer` will try to **store small values in the stack** instead of in the heap, saving a lot of time from `malloc()` & `free()`. In fact, all primitive types will be store in the stack memory.
199
+
200
+ All of the improvements above are available to all supported platforms. Here are the additional changes for each platform.
201
+
202
+ ### iOS / macOS
203
+ * **Optimize insert & delete**. Especially for inserting new values to **existing keys**, or deleting keys. We now use the UTF-8 encoded keys in the mmap-memory instead of live encoding from keys, cutting the cost of string encoding conversion.
204
+ * Fix Xcode compile error on some projects.
205
+ * Drop the support of iOS 8. `thread_local` is not available on iOS 8. We choose to drop support instead of working around because iOS 8's market share is considerably small.
206
+
207
+ ### POSIX
208
+ * It's known that GCC before 5.0 doesn't support C++17 standard very well. You should upgrade to the latest version of GCC to compile MMKV.
209
+
210
+ ## v1.1.2 / 2020-05-29
211
+
212
+ ### Android / iOS & macOS / Win32 / POSIX
213
+
214
+ * Fix a potential crash after `trim()` a multi-process MMKV instance.
215
+ * Improve `clearAll()` a bit.
216
+
217
+ ## v1.1.1 / 2020-04-13
218
+
219
+ ### iOS / macOS
220
+
221
+ * Support WatchOS.
222
+ * Rename `+[MMKV onExit]` to `+[MMKV onAppTerminate]`, to avoid naming conflict with some other OpenSource projects.
223
+ * Make background write protection much more robust, fix a potential crash when writing meta info in background.
224
+ * Fix a potential data corruption bug when writing a UTF-8 (non-ASCII) key.
225
+
226
+ ### Android
227
+
228
+ * Fix a crash in the demo project when the App is hot reloaded.
229
+ * Improve wiki & readme to recommend users to init & destruct MMKV in the `Application` class instead of the `MainActivity` class.
230
+
231
+ ### POSIX
232
+ * Fix two compile errors with some compilers.
233
+
234
+ ## v1.1.0 / 2020-03-24
235
+ This is the first **major breaking version** ever since MMKV was made public in September 2018, introducing bunches of improvement. Due to the Covid-19, it has been delayed for about a month. Now it's finally here!
236
+
237
+ * **Improved File Recovery Strategic**. We store the CRC checksum & actual file size on each sync operation & full write back, plus storing the actual file size in the same file(aka the .crc meta file) as the CRC checksum. Base on our usage inside WeChat on the iOS platform, it cuts the file **corruption rate down by almost half**.
238
+ * **Unified Core Library**. We refactor the whole MMKV project and unify the cross-platform Core library. From now on, MMKV on iOS/macOS, Android, Win32 all **share the same core logic code**. It brings many benefits such as reducing the work to fix common bugs, improvements on one platform are available to other platforms immediately, and much more.
239
+ * **Supports POSIX Platforms**. Thanks to the unified Core library, we port MMKV to POSIX platforms easily.
240
+ * **Multi-Process Access on iOS/macOS**. Thanks to the unified Core library, we add multi-process access to iOS/macOS platforms easily.
241
+ * **Efficiency Improvement**. We make the most of armv8 ability including the AES & CRC32 instructions to tune **encryption & error checking speed up by one order higher** than before on armv8 devices. There are bunches of other speed tuning all around the whole project.
242
+
243
+ Here are the old-style change logs of each platform.
244
+
245
+ ### iOS / macOS
246
+ * Adds **multi-process access** support. You should initialize MMKV by calling `+[MMKV initializeMMKV: groupDir: logLevel:]`, passing your **app group id**. Then you can get a multi-process instance by calling `+[MMKV mmkvWithID: mode:]` or `+[MMKV mmkvWithID: cryptKey: mode:]`, accessing it cross your app & your app extensions.
247
+ * Add **inter-process content change notification**. You can get MMKV changes notification of other processes by implementing `- onMMKVContentChange:` of `<MMKVHandler>` protocol.
248
+ * **Improved File Recovery Strategic**. Cuts the file corruption rate down by almost half. Details are above.
249
+ * **Efficiency Improvement**. Encryption & error checking speed are up by one order higher on armv8 devices(aka iDevice including iPhone 5S and above). Encryption on armv7 devices is improved as well. Details are ahead.
250
+ * Other speed improvements. Refactor core logic using **MRC**, improve std::vector `push_back()` speed by using **move constructors** & move assignments.
251
+ * `+[MMKV setMMKVBasePath:]` & `+[MMKV setLogLevel:]` are marked **deprecated**. You should use `+[MMKV initializeMMKV:]` or `+[MMKV initializeMMKV: logLevel:]` instead.
252
+ * The `MMKVLogLevel` enum has been improved in Swift. It can be used like `MMKVLogLevel.info` and so on.
253
+
254
+ ### Android
255
+ * **Improved File Recovery Strategic**. Cuts the file corruption rate down by almost half. Details are above.
256
+ * **Efficiency Improvement**. Encryption & error checking speed are up by one order higher on armv8 devices with the `arm64-v8a` abi. Encryption on `armeabi` & `armeabi-v7a` is improved as well. Details are ahead.
257
+ * Add exception inside core encode & decode logic, making MMKV much more robust.
258
+ * Other speed improvements. Improve std::vector `push_back()` speed by using **move constructors** & move assignments.
259
+
260
+ ### Win32
261
+ * **Improved File Recovery Strategic**. Cuts the file corruption rate down by almost half. Details are above.
262
+ * Add exception inside core encode & decode logic, making MMKV much more robust.
263
+ * Other speed improvements. Improve std::vector `push_back()` speed by using **move constructors** & move assignments.
264
+
265
+ ### POSIX
266
+ * Most things actually work! We have tested MMKV on the latest version of Linux(Ubuntu, Arch Linux, CentOS, Gentoo), and Unix(macOS, FreeBSD, OpenBSD) on the time v1.1.0 is released.
267
+
268
+ ## v1.0.24 / 2020-01-16
269
+
270
+ ### iOS / macOS
271
+ What's new
272
+
273
+ * Fix a bug that MMKV will fail to save any key-values after calling `-[MMKV clearMemoryCache]` and then `-[MMKV clearAll]`.
274
+ * Add `+[MMKV initializeMMKV:]` for users to init MMKV in the main thread, to avoid an iOS 13 potential crash when accessing `UIApplicationState` in child threads.
275
+ * Fix a potential crash when writing a uniquely constructed string.
276
+ * Fix a performance slow down when acquiring MMKV instances too often.
277
+ * Make the baseline test in MMKVDemo more robust to NSUserDefaults' caches.
278
+
279
+ ### Android
280
+ What's new
281
+
282
+ * Fix `flock()` bug on ashmem files in Android.
283
+ * Fix a potential crash when writing a uniquely constructed string.
284
+ * Fix a bug that the MMKVDemo might crash when running in a simulator.
285
+
286
+ ### Win32
287
+ * Fix a potential crash when writing a uniquely constructed string or data.
288
+
289
+ ## v1.0.23 / 2019-09-03
290
+
291
+ ### iOS / macOS
292
+ What's new
293
+
294
+ * Fix a potential security leak on encrypted MMKV.
295
+
296
+ ### Android
297
+ What's new
298
+
299
+ * Fix a potential security leak on encrypted MMKV.
300
+ * Fix filename bug when compiled on Win32 environment.
301
+ * Add option for decoding String Set into other `Set<>` classes other than the default `HashSet<String>`, check `decodeStringSet()` for details.
302
+ * Add `putBytes()` & `getBytes()`, to make function names more clear and consistent.
303
+ * Add notification of content changed by other process, check the new `MMKVContentChangeNotification<>` interface & `checkContentChangedByOuterProcess()` for details.
304
+
305
+ ### Win32
306
+ What's new
307
+
308
+ * Fix a potential security leak on encrypted MMKV.
309
+ * Fix `CriticalSection` init bug.
310
+
311
+ ## v1.0.22 / 2019-06-10
312
+
313
+ ### iOS / macOS
314
+ What's new
315
+
316
+ * Fix a bug that MMKV will corrupt while adding just one key-value, and reboot or clear memory cache. This bug was introduced in v1.0.21.
317
+
318
+ ### Android
319
+ What's new
320
+
321
+ * Fix a bug that MMKV will corrupt while adding just one key-value, and reboot or clear memory cache. This bug was introduced in v1.0.21.
322
+
323
+ ### Win32
324
+ What's new
325
+
326
+ * Fix a bug that MMKV will corrupt while adding just one key-value, and reboot or clear memory cache. This bug was introduced in v1.0.21.
327
+
328
+ ## v1.0.21 / 2019-06-06
329
+ ### iOS / macOS
330
+ What's new
331
+
332
+ * Fix a bug that MMKV might corrupt while repeatedly adding & removing key-value with specific length. This bug was introduced in v1.0.20.
333
+
334
+ ### Android
335
+ What's new
336
+
337
+ * Fix a bug that MMKV might corrupt while repeatedly adding & removing key-value with specific length. This bug was introduced in v1.0.20.
338
+
339
+ ### Win32
340
+ What's new
341
+
342
+ * Fix a bug that MMKV might corrupt while repeatedly adding & removing key-value with specific length. This bug was introduced in v1.0.20.
343
+
344
+ ## v1.0.20 / 2019-06-05
345
+ ### iOS / macOS
346
+ What's new
347
+
348
+ * Fix a bug that MMKV might crash while storing key-value with specific length.
349
+ * Fix a bug that `-[MMKV trim]` might not work properly.
350
+
351
+ ### Android
352
+ What's new
353
+
354
+ * Migrate to AndroidX library.
355
+ * Fix a bug that MMKV might crash while storing key-value with specific length.
356
+ * Fix a bug that `trim()` might not work properly.
357
+ * Fix a bug that dead-lock might be reported by Android mistakenly.
358
+ * Using `RegisterNatives()` to simplify native method naming.
359
+
360
+ ### Win32
361
+ * Fix a bug that MMKV might crash while storing key-value with specific length.
362
+ * Fix a bug that `trim()` might not work properly.
363
+ * Fix a bug that `clearAll()` might not work properly.
364
+
365
+ ## v1.0.19 / 2019-04-22
366
+ ### iOS / macOS
367
+ What's new
368
+
369
+ * Support Swift 5.
370
+ * Add method to get all keys `-[MMKV allKeys]`;
371
+ * Add method to synchronize to file asynchronously `-[MMKV async]`.
372
+ * Fix a pod configuration bug that might override target project's C++ setting on `CLANG_CXX_LANGUAGE_STANDARD`.
373
+ * Fix a bug that `DEFAULT_MMAP_SIZE` might not be initialized before getting any MMKV instance.
374
+ * Fix a bug that openssl's header files included inside MMKV might mess with target project's own openssl implementation.
375
+
376
+ ### Android
377
+ What's new
378
+
379
+ * Support Android Q.
380
+ * Add method to synchronize to file asynchronously `void sync()`, or `void apply()` that comes with `SharedPreferences.Editor` interface.
381
+ * Fix a bug that a buffer with length of zero might be returned when the key is not existed.
382
+ * Fix a bug that `DEFAULT_MMAP_SIZE` might not be initialized before getting any MMKV instance.
383
+
384
+
385
+ ## v1.0.18 / 2019-03-14
386
+ ### iOS / macOS
387
+ What's new
388
+
389
+ * Fix a bug that defaultValue was not returned while decoding a `NSCoding` value.
390
+ * Fix a compile error on static linking MMKV while openssl is static linked too.
391
+
392
+ ### Android
393
+ What's new
394
+
395
+ * Introducing **Native Buffer**. Checkout [wiki](https://github.com/Tencent/MMKV/wiki/android_advance#native-buffer) for details.
396
+ * Fix a potential crash when trying to recover data from file length error.
397
+ * Protect from mistakenly passing `Context.MODE_MULTI_PROCESS` to init MMKV.
398
+
399
+
400
+ ### Win32
401
+ * Fix a potential crash when trying to recover data from file length error.
402
+
403
+ ## v1.0.17 / 2019-01-25
404
+ ### iOS / macOS
405
+ What's new
406
+
407
+ * Redirect logging of MMKV is supported now.
408
+ * Dynamically disable logging of MMKV is supported now.
409
+ * Add method `migrateFromUserDefaults ` to import from NSUserDefaults.
410
+
411
+ ### Android
412
+ What's new
413
+
414
+ * Redirect logging of MMKV is supported now.
415
+ * Dynamically disable logging of MMKV is supported now.
416
+ Note: These two are breaking changes for interface `MMKVHandler`, update your implementation with `wantLogRedirecting()` & `mmkvLog()` for v1.0.17. (Interface with default method requires API level 24, sigh...)
417
+ * Add option to use custom library loader `initialize(String rootDir, LibLoader loader)`. If you're facing `System.loadLibrary()` crash on some low API level device, consider using **ReLinker** to load MMKV. Example can be found in **mmkvdemo**.
418
+ * Fix a potential corruption of meta file on multi-process mode.
419
+ * Fix a potential crash when the meta file is not valid on multi-process mode.
420
+
421
+
422
+ ### Win32
423
+ * Redirect logging of MMKV is supported now.
424
+ * Dynamically disable logging of MMKV is supported now.
425
+ * Fix a potential corruption of meta file on multi-process mode.
426
+
427
+ ## v1.0.16 / 2019-01-04
428
+ ### iOS / macOS
429
+ What's new
430
+
431
+ * Customizing root folder of MMKV is supported now.
432
+ * Customizing folder for specific MMKV is supported now.
433
+ * Add method `getValueSizeForKey:` to get value's size of a key.
434
+
435
+ ### Android
436
+ What's new
437
+
438
+ * Customizing root folder of MMKV is supported now.
439
+ * Customizing folder for specific MMKV is supported now.
440
+ * Add method `getValueSizeForKey()` to get value's size of a key.
441
+ * Fix a potential crash when the meta file is not valid.
442
+
443
+
444
+ ### Win32
445
+ MMKV for Windows is released now. Most things actually work!
446
+
447
+ ## v1.0.15 / 2018-12-13
448
+ ### iOS / macOS
449
+ What's new
450
+
451
+ * Storing **NSString/NSData/NSDate** directly by calling `setString`/`getSring`, `setData`/`getData`, `setDate`/`getDate`.
452
+ * Fix a potential crash due to divided by zero.
453
+
454
+
455
+ ### Android
456
+ What's new
457
+
458
+ * Fix a stack overflow crash due to the **callback** feature introduced by v1.0.13.
459
+ * Fix a potential crash due to divided by zero.
460
+
461
+ ### Win32
462
+ MMKV for Win32 in under construction. Hopefully will come out in next release. For those who are interested, check out branch `dev_win32` for the latest development.
463
+
464
+ ## v1.0.14 / 2018-11-30
465
+ ### iOS / macOS
466
+ What's new
467
+
468
+ * Setting `nil` value to reset a key is supported now.
469
+ * Rename `boolValue(forKey:)` to `bool(forKey:)` for Swift.
470
+
471
+
472
+ ### Android
473
+ What's new
474
+
475
+ * `Parcelable` objects can be stored directly into MMKV now.
476
+ * Setting `null` value to reset a key is supported now.
477
+ * Fix an issue that MMKV's file size might expand unexpectly large in some case.
478
+ * Fix an issue that MMKV might crash on multi-thread removing and getting on the same key.
479
+
480
+
481
+ ## v1.0.13 / 2018-11-09
482
+ ### iOS / macOS
483
+ What's new
484
+
485
+ * Special chars like `/` are supported in MMKV now. The file name of MMKV with special mmapID will be encoded with md5 and stored in seperate folder.
486
+ * Add **callback** for MMKV error handling. You can make MMKV to recover instead of discard when crc32 check fail happens.
487
+ * Add `trim` and `close` operation. Generally speaking they are not necessary in daily usage. Use them if you worry about disk / memory / fd usage.
488
+ * Fix an issue that MMKV's file size might expand unexpectly large in some case.
489
+
490
+ Known Issues
491
+
492
+ * Setting `nil` value to reset a key will be ignored. Use `remove` instead.
493
+
494
+ ### Android
495
+ What's new
496
+
497
+ * Add static linked of libc++ to trim AAR size. Use it when there's no other lib in your App embeds `libc++_shared.so`. Or if you already have an older version of `libc++_shared.so` that doesn't agree with MMKV.
498
+ Add `implementation 'com.tencent:mmkv-static:1.0.13'` to your App's gradle setting to integrate.
499
+ * Special chars like `/` are supported in MMKV now. The file name of MMKV with special mmapID will be encoded with md5 and stored in seperate folder.
500
+ * Add **callback** for MMKV error handling. You can make MMKV to recover instead of discard when crc32 check fail happens.
501
+ * Add `trim` and `close` operation. Generally speaking they are not necessary in daily usage. Use them if you worry about disk / memory / fd usage.
502
+
503
+ Known Issues
504
+
505
+ * Setting `null` value to reset a key will be ignored. Use `remove` instead.
506
+ * MMKV's file size might expand unexpectly large in some case.
507
+
508
+ ## v1.0.12 / 2018-10-18
509
+ ### iOS / macOS
510
+ What's new
511
+
512
+ * Fix `mlock` fail on some devices
513
+ * Fix a performance issue caused by mistakenly merge of test code
514
+ * Fix CocoaPods integration error of **macOS**
515
+
516
+ ### Android / 2018-10-24
517
+ What's new
518
+
519
+ * Fix `remove()` causing data inconsistency on `MULTI_PROCESS_MODE`
520
+
521
+
522
+ ## v1.0.11 / 2018-10-12
523
+ ### iOS / macOS
524
+ What's new
525
+
526
+ * Port to **macOS**
527
+ * Support **NSCoding**
528
+ You can store NSArray/NSDictionary or any object what implements `<NSCoding>` protocol.
529
+ * Redesign Swift interface
530
+ * Some performance improvement
531
+
532
+ Known Issues
533
+
534
+ * MMKV use mmapID as its filename, so don't contain any `/` inside mmapID.
535
+ * Storing a value of `type A` and getting by `type B` may not work. MMKV does type erasure while storing values. That means it's hard for MMKV to do value-type-checking, if not impossible.
536
+
537
+ ### Android
538
+ What's new
539
+
540
+ * Some performance improvement
541
+
542
+ Known Issues
543
+
544
+ * Getting an MMKV instance with mmapID that contains `/` may fail.
545
+ MMKV uses mmapID as its filename, so don't contain any `/` inside mmapID.
546
+ * Storing a value of `type A` and getting by `type B` may not work.
547
+ MMKV does type erasure while storing values. That means it's hard for MMKV to do value-type-checking, if not impossible.
548
+ * `registerOnSharedPreferenceChangeListener` not supported.
549
+ This is intended. We believe doing data-change-listener inside a storage framework smells really bad to us. We suggest using something like event-bus to notify any interesting clients.
550
+
551
+ ## v1.0.10 / 2018-09-21
552
+
553
+ * Initial Release