From ce7cb0f296a5ba9bffae65fb7332b798633b024c Mon Sep 17 00:00:00 2001 From: ACh Sulfate Date: Sat, 12 Aug 2023 19:55:02 +0800 Subject: [PATCH] chore: deps: update MMKV to 1.3.1 --- libs/mmkv/MMKV | 2 +- libs/mmkv/native-bridge.cpp | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libs/mmkv/MMKV b/libs/mmkv/MMKV index 272e5aa1fb..09c165e93f 160000 --- a/libs/mmkv/MMKV +++ b/libs/mmkv/MMKV @@ -1 +1 @@ -Subproject commit 272e5aa1fb57b4ee8cc0ff37e70b7885d99832a7 +Subproject commit 09c165e93fd354cc11b927a947b6465905964850 diff --git a/libs/mmkv/native-bridge.cpp b/libs/mmkv/native-bridge.cpp index adf51c3b82..6662bc241b 100644 --- a/libs/mmkv/native-bridge.cpp +++ b/libs/mmkv/native-bridge.cpp @@ -655,10 +655,10 @@ MMKV_JNI jbyteArray decodeBytes(JNIEnv *env, jobject obj, jlong handle, jstring return nullptr; } -MMKV_JNI jobjectArray allKeys(JNIEnv *env, jobject instance) { - MMKV *kv = getMMKV(env, instance); +MMKV_JNI jobjectArray allKeys(JNIEnv *env, jobject instance, jlong handle, jboolean filterExpire) { + MMKV *kv = reinterpret_cast(handle); if (kv) { - vector keys = kv->allKeys(); + vector keys = kv->allKeys((bool) filterExpire); return vector2jarray(env, keys); } return nullptr; @@ -673,10 +673,10 @@ MMKV_JNI jboolean containsKey(JNIEnv *env, jobject instance, jlong handle, jstri return (jboolean) false; } -MMKV_JNI jlong count(JNIEnv *env, jobject instance, jlong handle) { +MMKV_JNI jlong count(JNIEnv *env, jobject instance, jlong handle, jboolean filterExpire) { MMKV *kv = reinterpret_cast(handle); if (kv) { - jlong size = kv->count(); + jlong size = kv->count((bool) filterExpire); return size; } return 0; @@ -1028,7 +1028,7 @@ static JNINativeMethod g_methods[] = { {"lock", "()V", (void *) mmkv::lock}, {"unlock", "()V", (void *) mmkv::unlock}, {"tryLock", "()Z", (void *) mmkv::tryLock}, - {"allKeys", "()[Ljava/lang/String;", (void *) mmkv::allKeys}, + {"allKeys", "(JZ)[Ljava/lang/String;", (void *) mmkv::allKeys}, {"removeValuesForKeys", "([Ljava/lang/String;)V", (void *) mmkv::removeValuesForKeys}, {"clearAll", "()V", (void *) mmkv::clearAll}, {"trim", "()V", (void *) mmkv::trim}, @@ -1069,7 +1069,7 @@ static JNINativeMethod g_methods[] = { {"encodeBytes_2", "(JLjava/lang/String;[BI)Z", (void *) mmkv::encodeBytes_2}, {"decodeBytes", "(JLjava/lang/String;)[B", (void *) mmkv::decodeBytes}, {"containsKey", "(JLjava/lang/String;)Z", (void *) mmkv::containsKey}, - {"count", "(J)J", (void *) mmkv::count}, + {"count", "(JZ)J", (void *) mmkv::count}, {"totalSize", "(J)J", (void *) mmkv::totalSize}, {"actualSize", "(J)J", (void *) mmkv::actualSize}, {"removeValueForKey", "(JLjava/lang/String;)V", (void *) mmkv::removeValueForKey},