| 404 | } |
| 405 | |
| 406 | MMKV_EXPORT void *cryptKey(void *handle, uint64_t *lengthPtr) { |
| 407 | MMKV *kv = static_cast<MMKV *>(handle); |
| 408 | if (kv && lengthPtr) { |
| 409 | auto cryptKey = kv->cryptKey(); |
| 410 | if (cryptKey.length() > 0) { |
| 411 | auto ptr = malloc(cryptKey.length()); |
| 412 | if (ptr) { |
| 413 | memcpy(ptr, cryptKey.data(), cryptKey.length()); |
| 414 | *lengthPtr = cryptKey.length(); |
| 415 | return ptr; |
| 416 | } |
| 417 | } |
| 418 | } |
| 419 | return nullptr; |
| 420 | } |
| 421 | |
| 422 | MMKV_EXPORT void checkReSetCryptKey(void *handle, char *oKey, uint64_t length, bool aes256) { |
| 423 | MMKV *kv = static_cast<MMKV *>(handle); |