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.
- package/LICENSE +219 -0
- package/MMKV/CHANGELOG.md +553 -0
- package/MMKV/Core/CMakeLists.txt +153 -0
- package/MMKV/Core/CodedInputData.cpp +228 -0
- package/MMKV/Core/CodedInputData.h +83 -0
- package/MMKV/Core/CodedInputDataCrypt.cpp +280 -0
- package/MMKV/Core/CodedInputDataCrypt.h +87 -0
- package/MMKV/Core/CodedInputDataCrypt_OSX.cpp +62 -0
- package/MMKV/Core/CodedInputData_OSX.cpp +92 -0
- package/MMKV/Core/CodedOutputData.cpp +174 -0
- package/MMKV/Core/CodedOutputData.h +82 -0
- package/MMKV/Core/Core.xcodeproj/project.pbxproj +702 -0
- package/MMKV/Core/Core.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/MMKV/Core/Core.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/MMKV/Core/Core.xcodeproj/xcshareddata/xcschemes/Core.xcscheme +67 -0
- package/MMKV/Core/Core.xcodeproj/xcshareddata/xcschemes/MMKVWatchCore.xcscheme +67 -0
- package/MMKV/Core/InterProcessLock.cpp +186 -0
- package/MMKV/Core/InterProcessLock.h +119 -0
- package/MMKV/Core/InterProcessLock_Android.cpp +103 -0
- package/MMKV/Core/InterProcessLock_Win32.cpp +108 -0
- package/MMKV/Core/KeyValueHolder.cpp +236 -0
- package/MMKV/Core/KeyValueHolder.h +118 -0
- package/MMKV/Core/MMBuffer.cpp +185 -0
- package/MMKV/Core/MMBuffer.h +107 -0
- package/MMKV/Core/MMKV.cpp +1418 -0
- package/MMKV/Core/MMKV.h +386 -0
- package/MMKV/Core/MMKVLog.cpp +127 -0
- package/MMKV/Core/MMKVLog.h +86 -0
- package/MMKV/Core/MMKVLog_Android.cpp +79 -0
- package/MMKV/Core/MMKVMetaInfo.hpp +81 -0
- package/MMKV/Core/MMKVPredef.h +245 -0
- package/MMKV/Core/MMKV_Android.cpp +259 -0
- package/MMKV/Core/MMKV_IO.cpp +1119 -0
- package/MMKV/Core/MMKV_IO.h +57 -0
- package/MMKV/Core/MMKV_OSX.cpp +347 -0
- package/MMKV/Core/MMKV_OSX.h +51 -0
- package/MMKV/Core/MemoryFile.cpp +537 -0
- package/MMKV/Core/MemoryFile.h +182 -0
- package/MMKV/Core/MemoryFile_Android.cpp +211 -0
- package/MMKV/Core/MemoryFile_Linux.cpp +120 -0
- package/MMKV/Core/MemoryFile_OSX.cpp +142 -0
- package/MMKV/Core/MemoryFile_Win32.cpp +536 -0
- package/MMKV/Core/MiniPBCoder.cpp +366 -0
- package/MMKV/Core/MiniPBCoder.h +129 -0
- package/MMKV/Core/MiniPBCoder_OSX.cpp +228 -0
- package/MMKV/Core/PBEncodeItem.hpp +86 -0
- package/MMKV/Core/PBUtility.cpp +61 -0
- package/MMKV/Core/PBUtility.h +153 -0
- package/MMKV/Core/ScopedLock.hpp +69 -0
- package/MMKV/Core/ThreadLock.cpp +68 -0
- package/MMKV/Core/ThreadLock.h +78 -0
- package/MMKV/Core/ThreadLock_Win32.cpp +89 -0
- package/MMKV/Core/aes/AESCrypt.cpp +256 -0
- package/MMKV/Core/aes/AESCrypt.h +107 -0
- package/MMKV/Core/aes/openssl/openssl_aes-armv4.S +1231 -0
- package/MMKV/Core/aes/openssl/openssl_aes.h +118 -0
- package/MMKV/Core/aes/openssl/openssl_aes_core.cpp +1044 -0
- package/MMKV/Core/aes/openssl/openssl_aes_locl.h +38 -0
- package/MMKV/Core/aes/openssl/openssl_aesv8-armx.S +308 -0
- package/MMKV/Core/aes/openssl/openssl_arm_arch.h +84 -0
- package/MMKV/Core/aes/openssl/openssl_cfb128.cpp +97 -0
- package/MMKV/Core/aes/openssl/openssl_md32_common.h +254 -0
- package/MMKV/Core/aes/openssl/openssl_md5.h +49 -0
- package/MMKV/Core/aes/openssl/openssl_md5_dgst.cpp +166 -0
- package/MMKV/Core/aes/openssl/openssl_md5_locl.h +75 -0
- package/MMKV/Core/aes/openssl/openssl_md5_one.cpp +30 -0
- package/MMKV/Core/aes/openssl/openssl_opensslconf.h +271 -0
- package/MMKV/Core/core.vcxproj +186 -0
- package/MMKV/Core/core.vcxproj.filters +150 -0
- package/MMKV/Core/crc32/Checksum.h +67 -0
- package/MMKV/Core/crc32/crc32_armv8.cpp +132 -0
- package/MMKV/Core/crc32/zlib/crc32.cpp +55 -0
- package/MMKV/Core/crc32/zlib/crc32.h +48 -0
- package/MMKV/Core/crc32/zlib/zconf.h +380 -0
- package/MMKV/Core/crc32/zlib/zutil.h +25 -0
- package/MMKV/LICENSE.TXT +193 -0
- package/MMKV/README.md +288 -0
- package/README.md +221 -0
- package/android/CMakeLists.txt +71 -0
- package/android/build.gradle +371 -0
- package/android/gradle.properties +4 -0
- package/android/src/main/AndroidManifest.xml +4 -0
- package/android/src/main/cpp/MmkvHostObject.cpp +302 -0
- package/android/src/main/cpp/MmkvHostObject.h +26 -0
- package/android/src/main/cpp/cpp-adapter.cpp +65 -0
- package/android/src/main/java/com/reactnativemmkv/MmkvModule.java +49 -0
- package/android/src/main/java/com/reactnativemmkv/MmkvPackage.java +26 -0
- package/cpp/TypedArray.cpp +341 -0
- package/cpp/TypedArray.h +175 -0
- package/ios/JSIUtils.h +50 -0
- package/ios/JSIUtils.mm +194 -0
- package/ios/Mmkv.xcodeproj/project.pbxproj +291 -0
- package/ios/MmkvHostObject.h +27 -0
- package/ios/MmkvHostObject.mm +299 -0
- package/ios/MmkvModule.h +5 -0
- package/ios/MmkvModule.mm +73 -0
- package/lib/commonjs/MMKV.js +146 -0
- package/lib/commonjs/MMKV.js.map +1 -0
- package/lib/commonjs/PlatformChecker.js +16 -0
- package/lib/commonjs/PlatformChecker.js.map +1 -0
- package/lib/commonjs/createMMKV.js +66 -0
- package/lib/commonjs/createMMKV.js.map +1 -0
- package/lib/commonjs/createMMKV.mock.js +40 -0
- package/lib/commonjs/createMMKV.mock.js.map +1 -0
- package/lib/commonjs/createMMKV.web.js +77 -0
- package/lib/commonjs/createMMKV.web.js.map +1 -0
- package/lib/commonjs/createTextEncoder.js +24 -0
- package/lib/commonjs/createTextEncoder.js.map +1 -0
- package/lib/commonjs/hooks.js +200 -0
- package/lib/commonjs/hooks.js.map +1 -0
- package/lib/commonjs/index.js +32 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/module/MMKV.js +134 -0
- package/lib/module/MMKV.js.map +1 -0
- package/lib/module/PlatformChecker.js +9 -0
- package/lib/module/PlatformChecker.js.map +1 -0
- package/lib/module/createMMKV.js +55 -0
- package/lib/module/createMMKV.js.map +1 -0
- package/lib/module/createMMKV.mock.js +31 -0
- package/lib/module/createMMKV.mock.js.map +1 -0
- package/lib/module/createMMKV.web.js +67 -0
- package/lib/module/createMMKV.web.js.map +1 -0
- package/lib/module/createTextEncoder.js +17 -0
- package/lib/module/createTextEncoder.js.map +1 -0
- package/lib/module/hooks.js +181 -0
- package/lib/module/hooks.js.map +1 -0
- package/lib/module/index.js +3 -0
- package/lib/module/index.js.map +1 -0
- package/lib/typescript/MMKV.d.ts +137 -0
- package/lib/typescript/PlatformChecker.d.ts +1 -0
- package/lib/typescript/createMMKV.d.ts +6 -0
- package/lib/typescript/createMMKV.mock.d.ts +2 -0
- package/lib/typescript/createMMKV.web.d.ts +2 -0
- package/lib/typescript/createTextEncoder.d.ts +1 -0
- package/lib/typescript/hooks.d.ts +81 -0
- package/lib/typescript/index.d.ts +2 -0
- package/package.json +168 -0
- package/react-native-mmkv.podspec +32 -0
|
@@ -0,0 +1,118 @@
|
|
|
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 <stddef.h>
|
|
17
|
+
#include "../../MMKVPredef.h"
|
|
18
|
+
|
|
19
|
+
#ifndef MMKV_DISABLE_CRYPT
|
|
20
|
+
|
|
21
|
+
namespace openssl {
|
|
22
|
+
|
|
23
|
+
/*
|
|
24
|
+
* Because array size can't be a const in C, the following two are macros.
|
|
25
|
+
* Both sizes are in bytes.
|
|
26
|
+
*/
|
|
27
|
+
# define AES_MAXNR 14
|
|
28
|
+
# define AES_BLOCK_SIZE 16
|
|
29
|
+
|
|
30
|
+
/* This should be a hidden type, but EVP requires that the size be known */
|
|
31
|
+
struct AES_KEY {
|
|
32
|
+
# ifdef AES_LONG
|
|
33
|
+
unsigned long rd_key[4 * (AES_MAXNR + 1)];
|
|
34
|
+
# else
|
|
35
|
+
unsigned int rd_key[4 * (AES_MAXNR + 1)];
|
|
36
|
+
# endif
|
|
37
|
+
int rounds;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
void AES_cfb128_encrypt(const uint8_t *in, uint8_t *out, size_t length, const AES_KEY *key, uint8_t *ivec, uint32_t *num);
|
|
41
|
+
void AES_cfb128_decrypt(const uint8_t *in, uint8_t *out, size_t length, const AES_KEY *key, uint8_t *ivec, uint32_t *num);
|
|
42
|
+
|
|
43
|
+
} // namespace openssl
|
|
44
|
+
|
|
45
|
+
#if __ARM_MAX_ARCH__ > 0
|
|
46
|
+
|
|
47
|
+
#ifndef __linux__
|
|
48
|
+
|
|
49
|
+
extern "C" int openssl_aes_arm_set_encrypt_key(const uint8_t *userKey, const int bits, void *key);
|
|
50
|
+
extern "C" int openssl_aes_arm_set_decrypt_key(const uint8_t *userKey, const int bits, void *key);
|
|
51
|
+
extern "C" void openssl_aes_arm_encrypt(const uint8_t *in, uint8_t *out, const void *key);
|
|
52
|
+
extern "C" void openssl_aes_arm_decrypt(const uint8_t *in, uint8_t *out, const void *key);
|
|
53
|
+
|
|
54
|
+
#define AES_set_encrypt_key(userKey, bits, key) openssl_aes_arm_set_encrypt_key(userKey, bits, key)
|
|
55
|
+
#define AES_set_decrypt_key(userKey, bits, key) openssl_aes_arm_set_decrypt_key(userKey, bits, key)
|
|
56
|
+
#define AES_encrypt(in, out, key) openssl_aes_arm_encrypt(in, out, key)
|
|
57
|
+
#define AES_decrypt(in, out, key) openssl_aes_arm_decrypt(in, out, key)
|
|
58
|
+
|
|
59
|
+
#else // __linux__
|
|
60
|
+
|
|
61
|
+
#if __ARM_MAX_ARCH__ <= 7
|
|
62
|
+
|
|
63
|
+
extern "C" int openssl_aes_arm_set_encrypt_key(const uint8_t *userKey, const int bits, void *key);
|
|
64
|
+
extern "C" int openssl_aes_arm_set_decrypt_key(const uint8_t *userKey, const int bits, void *key);
|
|
65
|
+
extern "C" void openssl_aes_arm_encrypt(const uint8_t *in, uint8_t *out, const void *key);
|
|
66
|
+
extern "C" void openssl_aes_arm_decrypt(const uint8_t *in, uint8_t *out, const void *key);
|
|
67
|
+
|
|
68
|
+
#define AES_set_encrypt_key(userKey, bits, key) openssl_aes_arm_set_encrypt_key(userKey, bits, key)
|
|
69
|
+
#define AES_set_decrypt_key(userKey, bits, key) openssl_aes_arm_set_decrypt_key(userKey, bits, key)
|
|
70
|
+
#define AES_encrypt(in, out, key) openssl_aes_arm_encrypt(in, out, key)
|
|
71
|
+
#define AES_decrypt(in, out, key) openssl_aes_arm_decrypt(in, out, key)
|
|
72
|
+
|
|
73
|
+
#else // __ARM_MAX_ARCH__ > 7
|
|
74
|
+
|
|
75
|
+
extern "C" int openssl_aes_armv8_set_encrypt_key(const uint8_t *userKey, const int bits, void *key);
|
|
76
|
+
extern "C" int openssl_aes_armv8_set_decrypt_key(const uint8_t *userKey, const int bits, void *key);
|
|
77
|
+
extern "C" void openssl_aes_armv8_encrypt(const uint8_t *in, uint8_t *out, const void *key);
|
|
78
|
+
extern "C" void openssl_aes_armv8_decrypt(const uint8_t *in, uint8_t *out, const void *key);
|
|
79
|
+
|
|
80
|
+
typedef int (*aes_set_encrypt_t)(const uint8_t *userKey, const int bits, void *key);
|
|
81
|
+
typedef int (*aes_set_decrypt_t)(const uint8_t *userKey, const int bits, void *key);
|
|
82
|
+
typedef void (*aes_encrypt_t)(const uint8_t *in, uint8_t *out, const void *key);
|
|
83
|
+
typedef void (*aes_decrypt_t)(const uint8_t *in, uint8_t *out, const void *key);
|
|
84
|
+
|
|
85
|
+
namespace openssl {
|
|
86
|
+
|
|
87
|
+
int AES_C_set_encrypt_key(const uint8_t *userKey, const int bits, void *key);
|
|
88
|
+
int AES_C_set_decrypt_key(const uint8_t *userKey, const int bits, void *key);
|
|
89
|
+
void AES_C_encrypt(const uint8_t *in, uint8_t *out, const void *key);
|
|
90
|
+
void AES_C_decrypt(const uint8_t *in, uint8_t *out, const void *key);
|
|
91
|
+
|
|
92
|
+
extern aes_set_encrypt_t AES_set_encrypt_key;
|
|
93
|
+
extern aes_set_decrypt_t AES_set_decrypt_key;
|
|
94
|
+
extern aes_encrypt_t AES_encrypt;
|
|
95
|
+
extern aes_decrypt_t AES_decrypt;
|
|
96
|
+
|
|
97
|
+
} // namespace openssl
|
|
98
|
+
|
|
99
|
+
#endif // __ARM_MAX_ARCH__ <= 7
|
|
100
|
+
|
|
101
|
+
#endif // __linux__
|
|
102
|
+
|
|
103
|
+
#else // __ARM_MAX_ARCH__ <= 0
|
|
104
|
+
|
|
105
|
+
namespace openssl {
|
|
106
|
+
|
|
107
|
+
int AES_set_encrypt_key(const uint8_t *userKey, const int bits, AES_KEY *key);
|
|
108
|
+
int AES_set_decrypt_key(const uint8_t *userKey, const int bits, AES_KEY *key);
|
|
109
|
+
void AES_encrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key);
|
|
110
|
+
void AES_decrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key);
|
|
111
|
+
|
|
112
|
+
} // namespace openssl
|
|
113
|
+
|
|
114
|
+
#endif // __ARM_MAX_ARCH__ > 0
|
|
115
|
+
|
|
116
|
+
#endif // MMKV_DISABLE_CRYPT
|
|
117
|
+
#endif // __cplusplus
|
|
118
|
+
#endif // HEADER_AES_H
|