react-native-mmkv 3.2.0 → 4.0.0-beta.0

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 (104) hide show
  1. package/android/CMakeLists.txt +18 -9
  2. package/android/build.gradle +6 -2
  3. package/cpp/{MMKVManagedBuffer.h → ManagedMMBuffer.h} +6 -6
  4. package/cpp/MmkvHostObject.cpp +22 -17
  5. package/cpp/MmkvHostObject.h +1 -2
  6. package/cpp/MmkvTypes.h +50 -0
  7. package/cpp/NativeMmkvModule.cpp +3 -3
  8. package/cpp/NativeMmkvModule.h +1 -8
  9. package/lib/commonjs/MMKV.js.map +1 -1
  10. package/lib/commonjs/Types.js.map +1 -1
  11. package/lib/commonjs/createMMKV.web.js +1 -1
  12. package/lib/commonjs/createMMKV.web.js.map +1 -1
  13. package/lib/module/MMKV.js.map +1 -1
  14. package/lib/module/Types.js.map +1 -1
  15. package/lib/module/createMMKV.web.js +1 -1
  16. package/lib/module/createMMKV.web.js.map +1 -1
  17. package/lib/typescript/src/MMKV.d.ts +1 -1
  18. package/lib/typescript/src/MMKV.d.ts.map +1 -1
  19. package/lib/typescript/src/Types.d.ts +7 -1
  20. package/lib/typescript/src/Types.d.ts.map +1 -1
  21. package/lib/typescript/src/hooks.d.ts +1 -1
  22. package/lib/typescript/src/hooks.d.ts.map +1 -1
  23. package/package.json +22 -27
  24. package/react-native-mmkv.podspec +4 -10
  25. package/react-native.config.js +9 -0
  26. package/src/MMKV.ts +1 -1
  27. package/src/Types.ts +7 -1
  28. package/src/createMMKV.web.ts +1 -1
  29. package/src/hooks.ts +1 -1
  30. package/MMKV/Core/CMakeLists.txt +0 -172
  31. package/MMKV/Core/CodedInputData.cpp +0 -252
  32. package/MMKV/Core/CodedInputData.h +0 -87
  33. package/MMKV/Core/CodedInputDataCrypt.cpp +0 -280
  34. package/MMKV/Core/CodedInputDataCrypt.h +0 -87
  35. package/MMKV/Core/CodedInputDataCrypt_OSX.cpp +0 -62
  36. package/MMKV/Core/CodedInputData_OSX.cpp +0 -92
  37. package/MMKV/Core/CodedOutputData.cpp +0 -186
  38. package/MMKV/Core/CodedOutputData.h +0 -88
  39. package/MMKV/Core/Core.xcodeproj/project.pbxproj +0 -707
  40. package/MMKV/Core/Core.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
  41. package/MMKV/Core/Core.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  42. package/MMKV/Core/Core.xcodeproj/xcshareddata/xcschemes/Core.xcscheme +0 -67
  43. package/MMKV/Core/Core.xcodeproj/xcshareddata/xcschemes/MMKVWatchCore.xcscheme +0 -67
  44. package/MMKV/Core/InterProcessLock.cpp +0 -186
  45. package/MMKV/Core/InterProcessLock.h +0 -119
  46. package/MMKV/Core/InterProcessLock_Android.cpp +0 -103
  47. package/MMKV/Core/InterProcessLock_Win32.cpp +0 -108
  48. package/MMKV/Core/KeyValueHolder.cpp +0 -236
  49. package/MMKV/Core/KeyValueHolder.h +0 -122
  50. package/MMKV/Core/MMBuffer.cpp +0 -210
  51. package/MMKV/Core/MMBuffer.h +0 -111
  52. package/MMKV/Core/MMKV.cpp +0 -1702
  53. package/MMKV/Core/MMKV.h +0 -595
  54. package/MMKV/Core/MMKVLog.cpp +0 -127
  55. package/MMKV/Core/MMKVLog.h +0 -86
  56. package/MMKV/Core/MMKVLog_Android.cpp +0 -134
  57. package/MMKV/Core/MMKVMetaInfo.hpp +0 -99
  58. package/MMKV/Core/MMKVPredef.h +0 -293
  59. package/MMKV/Core/MMKV_Android.cpp +0 -261
  60. package/MMKV/Core/MMKV_IO.cpp +0 -1905
  61. package/MMKV/Core/MMKV_IO.h +0 -57
  62. package/MMKV/Core/MMKV_OSX.cpp +0 -423
  63. package/MMKV/Core/MMKV_OSX.h +0 -57
  64. package/MMKV/Core/MemoryFile.cpp +0 -603
  65. package/MMKV/Core/MemoryFile.h +0 -194
  66. package/MMKV/Core/MemoryFile_Android.cpp +0 -236
  67. package/MMKV/Core/MemoryFile_Linux.cpp +0 -125
  68. package/MMKV/Core/MemoryFile_OSX.cpp +0 -142
  69. package/MMKV/Core/MemoryFile_Win32.cpp +0 -554
  70. package/MMKV/Core/MiniPBCoder.cpp +0 -672
  71. package/MMKV/Core/MiniPBCoder.h +0 -151
  72. package/MMKV/Core/MiniPBCoder_OSX.cpp +0 -237
  73. package/MMKV/Core/PBEncodeItem.hpp +0 -104
  74. package/MMKV/Core/PBUtility.cpp +0 -61
  75. package/MMKV/Core/PBUtility.h +0 -148
  76. package/MMKV/Core/ScopedLock.hpp +0 -69
  77. package/MMKV/Core/ThreadLock.cpp +0 -75
  78. package/MMKV/Core/ThreadLock.h +0 -81
  79. package/MMKV/Core/ThreadLock_Win32.cpp +0 -89
  80. package/MMKV/Core/aes/AESCrypt.cpp +0 -273
  81. package/MMKV/Core/aes/AESCrypt.h +0 -112
  82. package/MMKV/Core/aes/openssl/openssl_aes-armv4.S +0 -1243
  83. package/MMKV/Core/aes/openssl/openssl_aes.h +0 -130
  84. package/MMKV/Core/aes/openssl/openssl_aes_core.cpp +0 -1044
  85. package/MMKV/Core/aes/openssl/openssl_aes_locl.h +0 -38
  86. package/MMKV/Core/aes/openssl/openssl_aesv8-armx.S +0 -308
  87. package/MMKV/Core/aes/openssl/openssl_arm_arch.h +0 -84
  88. package/MMKV/Core/aes/openssl/openssl_cfb128.cpp +0 -97
  89. package/MMKV/Core/aes/openssl/openssl_md32_common.h +0 -254
  90. package/MMKV/Core/aes/openssl/openssl_md5.h +0 -49
  91. package/MMKV/Core/aes/openssl/openssl_md5_dgst.cpp +0 -166
  92. package/MMKV/Core/aes/openssl/openssl_md5_locl.h +0 -75
  93. package/MMKV/Core/aes/openssl/openssl_md5_one.cpp +0 -30
  94. package/MMKV/Core/aes/openssl/openssl_opensslconf.h +0 -271
  95. package/MMKV/Core/core.vcxproj +0 -288
  96. package/MMKV/Core/core.vcxproj.filters +0 -150
  97. package/MMKV/Core/crc32/Checksum.h +0 -75
  98. package/MMKV/Core/crc32/crc32_armv8.cpp +0 -134
  99. package/MMKV/Core/crc32/zlib/CMakeLists.txt +0 -60
  100. package/MMKV/Core/crc32/zlib/crc32.cpp +0 -55
  101. package/MMKV/Core/crc32/zlib/crc32.h +0 -48
  102. package/MMKV/Core/crc32/zlib/zconf.h +0 -380
  103. package/MMKV/Core/crc32/zlib/zutil.h +0 -25
  104. package/MMKV/README.md +0 -354
@@ -1,130 +0,0 @@
1
- /*
2
- * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved.
3
- *
4
- * Licensed under the OpenSSL license (the "License"). You may not use
5
- * this file except in compliance with the License. You can obtain a copy
6
- * in the file LICENSE in the source distribution or at
7
- * https://www.openssl.org/source/license.html
8
- */
9
-
10
- #ifndef HEADER_AES_H
11
- # define HEADER_AES_H
12
- #ifdef __cplusplus
13
-
14
- #include "openssl_opensslconf.h"
15
- #include "openssl_arm_arch.h"
16
- #include <cstdint>
17
- #include <stddef.h>
18
- #include "../../MMKVPredef.h"
19
-
20
- #ifndef MMKV_DISABLE_CRYPT
21
-
22
- namespace openssl {
23
-
24
- /*
25
- * Because array size can't be a const in C, the following two are macros.
26
- * Both sizes are in bytes.
27
- */
28
- # define AES_MAXNR 14
29
- # define AES_BLOCK_SIZE 16
30
-
31
- /* This should be a hidden type, but EVP requires that the size be known */
32
- struct AES_KEY {
33
- # ifdef AES_LONG
34
- unsigned long rd_key[4 * (AES_MAXNR + 1)];
35
- # else
36
- unsigned int rd_key[4 * (AES_MAXNR + 1)];
37
- # endif
38
- int rounds;
39
- };
40
-
41
- void AES_cfb128_encrypt(const uint8_t *in, uint8_t *out, size_t length, const AES_KEY *key, uint8_t *ivec, uint32_t *num);
42
- void AES_cfb128_decrypt(const uint8_t *in, uint8_t *out, size_t length, const AES_KEY *key, uint8_t *ivec, uint32_t *num);
43
-
44
- } // namespace openssl
45
-
46
- #if __ARM_MAX_ARCH__ > 0
47
-
48
- #ifndef __linux__
49
-
50
- extern "C" int openssl_aes_arm_set_encrypt_key(const uint8_t *userKey, const int bits, void *key);
51
- extern "C" int openssl_aes_arm_set_decrypt_key(const uint8_t *userKey, const int bits, void *key);
52
- extern "C" void openssl_aes_arm_encrypt(const uint8_t *in, uint8_t *out, const void *key);
53
- extern "C" void openssl_aes_arm_decrypt(const uint8_t *in, uint8_t *out, const void *key);
54
-
55
- #define AES_set_encrypt_key(userKey, bits, key) openssl_aes_arm_set_encrypt_key(userKey, bits, key)
56
- #define AES_set_decrypt_key(userKey, bits, key) openssl_aes_arm_set_decrypt_key(userKey, bits, key)
57
- #define AES_encrypt(in, out, key) openssl_aes_arm_encrypt(in, out, key)
58
- #define AES_decrypt(in, out, key) openssl_aes_arm_decrypt(in, out, key)
59
-
60
- #else // __linux__
61
-
62
- #if __ARM_MAX_ARCH__ <= 7
63
-
64
- extern "C" int openssl_aes_arm_set_encrypt_key(const uint8_t *userKey, const int bits, void *key);
65
- extern "C" int openssl_aes_arm_set_decrypt_key(const uint8_t *userKey, const int bits, void *key);
66
- extern "C" void openssl_aes_arm_encrypt(const uint8_t *in, uint8_t *out, const void *key);
67
- extern "C" void openssl_aes_arm_decrypt(const uint8_t *in, uint8_t *out, const void *key);
68
-
69
- #define AES_set_encrypt_key(userKey, bits, key) openssl_aes_arm_set_encrypt_key(userKey, bits, key)
70
- #define AES_set_decrypt_key(userKey, bits, key) openssl_aes_arm_set_decrypt_key(userKey, bits, key)
71
- #define AES_encrypt(in, out, key) openssl_aes_arm_encrypt(in, out, key)
72
- #define AES_decrypt(in, out, key) openssl_aes_arm_decrypt(in, out, key)
73
-
74
- #else // __ARM_MAX_ARCH__ > 7
75
-
76
- extern "C" int openssl_aes_armv8_set_encrypt_key(const uint8_t *userKey, const int bits, void *key);
77
- extern "C" int openssl_aes_armv8_set_decrypt_key(const uint8_t *userKey, const int bits, void *key);
78
- extern "C" void openssl_aes_armv8_encrypt(const uint8_t *in, uint8_t *out, const void *key);
79
- extern "C" void openssl_aes_armv8_decrypt(const uint8_t *in, uint8_t *out, const void *key);
80
-
81
- #ifdef MMKV_OHOS
82
-
83
- #define AES_set_encrypt_key(userKey, bits, key) openssl_aes_armv8_set_encrypt_key(userKey, bits, key)
84
- #define AES_set_decrypt_key(userKey, bits, key) openssl_aes_armv8_set_decrypt_key(userKey, bits, key)
85
- #define AES_encrypt(in, out, key) openssl_aes_armv8_encrypt(in, out, key)
86
- #define AES_decrypt(in, out, key) openssl_aes_armv8_decrypt(in, out, key)
87
-
88
- #else
89
-
90
- typedef int (*aes_set_encrypt_t)(const uint8_t *userKey, const int bits, void *key);
91
- typedef int (*aes_set_decrypt_t)(const uint8_t *userKey, const int bits, void *key);
92
- typedef void (*aes_encrypt_t)(const uint8_t *in, uint8_t *out, const void *key);
93
- typedef void (*aes_decrypt_t)(const uint8_t *in, uint8_t *out, const void *key);
94
-
95
- namespace openssl {
96
-
97
- int AES_C_set_encrypt_key(const uint8_t *userKey, const int bits, void *key);
98
- int AES_C_set_decrypt_key(const uint8_t *userKey, const int bits, void *key);
99
- void AES_C_encrypt(const uint8_t *in, uint8_t *out, const void *key);
100
- void AES_C_decrypt(const uint8_t *in, uint8_t *out, const void *key);
101
-
102
- extern aes_set_encrypt_t AES_set_encrypt_key;
103
- extern aes_set_decrypt_t AES_set_decrypt_key;
104
- extern aes_encrypt_t AES_encrypt;
105
- extern aes_decrypt_t AES_decrypt;
106
-
107
- } // namespace openssl
108
-
109
- #endif // !MMKV_OHOS
110
-
111
- #endif // __ARM_MAX_ARCH__ <= 7
112
-
113
- #endif // __linux__
114
-
115
- #else // __ARM_MAX_ARCH__ <= 0
116
-
117
- namespace openssl {
118
-
119
- int AES_set_encrypt_key(const uint8_t *userKey, const int bits, AES_KEY *key);
120
- int AES_set_decrypt_key(const uint8_t *userKey, const int bits, AES_KEY *key);
121
- void AES_encrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key);
122
- void AES_decrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key);
123
-
124
- } // namespace openssl
125
-
126
- #endif // __ARM_MAX_ARCH__ > 0
127
-
128
- #endif // MMKV_DISABLE_CRYPT
129
- #endif // __cplusplus
130
- #endif // HEADER_AES_H