react-native-mmkv 3.3.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 (87) 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 +13 -8
  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/package.json +22 -23
  10. package/react-native-mmkv.podspec +3 -9
  11. package/react-native.config.js +9 -0
  12. package/MMKV/Core/CMakeLists.txt +0 -172
  13. package/MMKV/Core/CodedInputData.cpp +0 -252
  14. package/MMKV/Core/CodedInputData.h +0 -87
  15. package/MMKV/Core/CodedInputDataCrypt.cpp +0 -280
  16. package/MMKV/Core/CodedInputDataCrypt.h +0 -87
  17. package/MMKV/Core/CodedInputDataCrypt_OSX.cpp +0 -62
  18. package/MMKV/Core/CodedInputData_OSX.cpp +0 -92
  19. package/MMKV/Core/CodedOutputData.cpp +0 -186
  20. package/MMKV/Core/CodedOutputData.h +0 -88
  21. package/MMKV/Core/Core.xcodeproj/project.pbxproj +0 -707
  22. package/MMKV/Core/Core.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
  23. package/MMKV/Core/Core.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  24. package/MMKV/Core/Core.xcodeproj/xcshareddata/xcschemes/Core.xcscheme +0 -67
  25. package/MMKV/Core/Core.xcodeproj/xcshareddata/xcschemes/MMKVWatchCore.xcscheme +0 -67
  26. package/MMKV/Core/InterProcessLock.cpp +0 -186
  27. package/MMKV/Core/InterProcessLock.h +0 -119
  28. package/MMKV/Core/InterProcessLock_Android.cpp +0 -103
  29. package/MMKV/Core/InterProcessLock_Win32.cpp +0 -108
  30. package/MMKV/Core/KeyValueHolder.cpp +0 -236
  31. package/MMKV/Core/KeyValueHolder.h +0 -122
  32. package/MMKV/Core/MMBuffer.cpp +0 -210
  33. package/MMKV/Core/MMBuffer.h +0 -111
  34. package/MMKV/Core/MMKV.cpp +0 -1702
  35. package/MMKV/Core/MMKV.h +0 -595
  36. package/MMKV/Core/MMKVLog.cpp +0 -127
  37. package/MMKV/Core/MMKVLog.h +0 -86
  38. package/MMKV/Core/MMKVLog_Android.cpp +0 -134
  39. package/MMKV/Core/MMKVMetaInfo.hpp +0 -99
  40. package/MMKV/Core/MMKVPredef.h +0 -293
  41. package/MMKV/Core/MMKV_Android.cpp +0 -261
  42. package/MMKV/Core/MMKV_IO.cpp +0 -1905
  43. package/MMKV/Core/MMKV_IO.h +0 -57
  44. package/MMKV/Core/MMKV_OSX.cpp +0 -423
  45. package/MMKV/Core/MMKV_OSX.h +0 -57
  46. package/MMKV/Core/MemoryFile.cpp +0 -603
  47. package/MMKV/Core/MemoryFile.h +0 -194
  48. package/MMKV/Core/MemoryFile_Android.cpp +0 -236
  49. package/MMKV/Core/MemoryFile_Linux.cpp +0 -125
  50. package/MMKV/Core/MemoryFile_OSX.cpp +0 -142
  51. package/MMKV/Core/MemoryFile_Win32.cpp +0 -554
  52. package/MMKV/Core/MiniPBCoder.cpp +0 -672
  53. package/MMKV/Core/MiniPBCoder.h +0 -151
  54. package/MMKV/Core/MiniPBCoder_OSX.cpp +0 -237
  55. package/MMKV/Core/PBEncodeItem.hpp +0 -104
  56. package/MMKV/Core/PBUtility.cpp +0 -61
  57. package/MMKV/Core/PBUtility.h +0 -148
  58. package/MMKV/Core/ScopedLock.hpp +0 -69
  59. package/MMKV/Core/ThreadLock.cpp +0 -75
  60. package/MMKV/Core/ThreadLock.h +0 -81
  61. package/MMKV/Core/ThreadLock_Win32.cpp +0 -89
  62. package/MMKV/Core/aes/AESCrypt.cpp +0 -273
  63. package/MMKV/Core/aes/AESCrypt.h +0 -112
  64. package/MMKV/Core/aes/openssl/openssl_aes-armv4.S +0 -1243
  65. package/MMKV/Core/aes/openssl/openssl_aes.h +0 -130
  66. package/MMKV/Core/aes/openssl/openssl_aes_core.cpp +0 -1044
  67. package/MMKV/Core/aes/openssl/openssl_aes_locl.h +0 -38
  68. package/MMKV/Core/aes/openssl/openssl_aesv8-armx.S +0 -308
  69. package/MMKV/Core/aes/openssl/openssl_arm_arch.h +0 -84
  70. package/MMKV/Core/aes/openssl/openssl_cfb128.cpp +0 -97
  71. package/MMKV/Core/aes/openssl/openssl_md32_common.h +0 -254
  72. package/MMKV/Core/aes/openssl/openssl_md5.h +0 -49
  73. package/MMKV/Core/aes/openssl/openssl_md5_dgst.cpp +0 -166
  74. package/MMKV/Core/aes/openssl/openssl_md5_locl.h +0 -75
  75. package/MMKV/Core/aes/openssl/openssl_md5_one.cpp +0 -30
  76. package/MMKV/Core/aes/openssl/openssl_opensslconf.h +0 -271
  77. package/MMKV/Core/core.vcxproj +0 -288
  78. package/MMKV/Core/core.vcxproj.filters +0 -150
  79. package/MMKV/Core/crc32/Checksum.h +0 -75
  80. package/MMKV/Core/crc32/crc32_armv8.cpp +0 -134
  81. package/MMKV/Core/crc32/zlib/CMakeLists.txt +0 -60
  82. package/MMKV/Core/crc32/zlib/crc32.cpp +0 -55
  83. package/MMKV/Core/crc32/zlib/crc32.h +0 -48
  84. package/MMKV/Core/crc32/zlib/zconf.h +0 -380
  85. package/MMKV/Core/crc32/zlib/zutil.h +0 -25
  86. package/MMKV/LICENSE.TXT +0 -193
  87. 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