@react-native-ohos/react-native-mmkv 3.3.1-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/MMKV/Core/CMakeLists.txt +172 -0
- package/MMKV/Core/CodedInputData.cpp +252 -0
- package/MMKV/Core/CodedInputData.h +87 -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 +186 -0
- package/MMKV/Core/CodedOutputData.h +88 -0
- package/MMKV/Core/Core.xcodeproj/project.pbxproj +707 -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 +122 -0
- package/MMKV/Core/MMBuffer.cpp +210 -0
- package/MMKV/Core/MMBuffer.h +111 -0
- package/MMKV/Core/MMKV.cpp +1702 -0
- package/MMKV/Core/MMKV.h +595 -0
- package/MMKV/Core/MMKVLog.cpp +127 -0
- package/MMKV/Core/MMKVLog.h +86 -0
- package/MMKV/Core/MMKVLog_Android.cpp +134 -0
- package/MMKV/Core/MMKVMetaInfo.hpp +99 -0
- package/MMKV/Core/MMKVPredef.h +293 -0
- package/MMKV/Core/MMKV_Android.cpp +261 -0
- package/MMKV/Core/MMKV_IO.cpp +1905 -0
- package/MMKV/Core/MMKV_IO.h +57 -0
- package/MMKV/Core/MMKV_OSX.cpp +423 -0
- package/MMKV/Core/MMKV_OSX.h +57 -0
- package/MMKV/Core/MemoryFile.cpp +603 -0
- package/MMKV/Core/MemoryFile.h +194 -0
- package/MMKV/Core/MemoryFile_Android.cpp +236 -0
- package/MMKV/Core/MemoryFile_Linux.cpp +125 -0
- package/MMKV/Core/MemoryFile_OSX.cpp +142 -0
- package/MMKV/Core/MemoryFile_Win32.cpp +554 -0
- package/MMKV/Core/MiniPBCoder.cpp +672 -0
- package/MMKV/Core/MiniPBCoder.h +151 -0
- package/MMKV/Core/MiniPBCoder_OSX.cpp +237 -0
- package/MMKV/Core/PBEncodeItem.hpp +104 -0
- package/MMKV/Core/PBUtility.cpp +61 -0
- package/MMKV/Core/PBUtility.h +148 -0
- package/MMKV/Core/ScopedLock.hpp +69 -0
- package/MMKV/Core/ThreadLock.cpp +75 -0
- package/MMKV/Core/ThreadLock.h +81 -0
- package/MMKV/Core/ThreadLock_Win32.cpp +89 -0
- package/MMKV/Core/aes/AESCrypt.cpp +273 -0
- package/MMKV/Core/aes/AESCrypt.h +112 -0
- package/MMKV/Core/aes/openssl/openssl_aes-armv4.S +1243 -0
- package/MMKV/Core/aes/openssl/openssl_aes.h +130 -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 +288 -0
- package/MMKV/Core/core.vcxproj.filters +150 -0
- package/MMKV/Core/crc32/Checksum.h +75 -0
- package/MMKV/Core/crc32/crc32_armv8.cpp +134 -0
- package/MMKV/Core/crc32/zlib/CMakeLists.txt +60 -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 +354 -0
- package/README.md +5 -0
- package/cpp/MMKVManagedBuffer.h +32 -0
- package/cpp/MmkvHostObject.cpp +355 -0
- package/cpp/MmkvHostObject.h +32 -0
- package/cpp/MmkvLogger.h +35 -0
- package/cpp/NativeMmkvModule.cpp +43 -0
- package/cpp/NativeMmkvModule.h +38 -0
- package/harmony/reactNativeMMKV/BuildProfile.ets +17 -0
- package/harmony/reactNativeMMKV/LICENSE +20 -0
- package/harmony/reactNativeMMKV/NOTICE +34 -0
- package/harmony/reactNativeMMKV/README.OpenSource +11 -0
- package/harmony/reactNativeMMKV/build-profile.json5 +9 -0
- package/harmony/reactNativeMMKV/hvigorfile.ts +6 -0
- package/harmony/reactNativeMMKV/index.ets +24 -0
- package/harmony/reactNativeMMKV/oh-package.json5 +15 -0
- package/harmony/reactNativeMMKV/src/main/cpp/CMakeLists.txt +15 -0
- package/harmony/reactNativeMMKV/src/main/cpp/ComponentDescriptors.h +39 -0
- package/harmony/reactNativeMMKV/src/main/cpp/EventEmitters.cpp +41 -0
- package/harmony/reactNativeMMKV/src/main/cpp/EventEmitters.h +182 -0
- package/harmony/reactNativeMMKV/src/main/cpp/HarmonyLogger.cpp +32 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/.clang-format +36 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/.dockerignore +2 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/.github/FUNDING.yml +14 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/.github/ISSUE_TEMPLATE/bug_report.md +45 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/.gitmodules +3 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/build.gradle +54 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/checkstyle.xml +156 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/debug.keystore +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/gradle/android-publish-private.gradle +207 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/gradle/android-publish.gradle +276 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/gradle/build_library.gradle +62 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/gradle/check.gradle +76 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/gradle/wrapper/gradle-wrapper.properties +6 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/gradle.properties +25 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/gradlew +172 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/gradlew.bat +84 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/CMakeLists.txt +56 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/build.gradle +238 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/gradle.properties +2 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/proguard-rules.pro +9 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/androidTest/AndroidManifest.xml +11 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/androidTest/java/com/tencent/mmkv/MMKVTest.java +270 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/androidTest/java/com/tencent/mmkv/MMKVTestService.java +79 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/AndroidManifest.xml +3 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/aidl/com/tencent/mmkv/ParcelableMMKV.aidl +4 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/cpp/flutter-bridge.cpp +706 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/cpp/native-bridge.cpp +1244 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/java/com/tencent/mmkv/MMKV.java +2024 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/java/com/tencent/mmkv/MMKVContentChangeNotification.java +34 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/java/com/tencent/mmkv/MMKVContentProvider.java +174 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/java/com/tencent/mmkv/MMKVHandler.java +63 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/java/com/tencent/mmkv/MMKVLogLevel.java +52 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/java/com/tencent/mmkv/MMKVProcessUtil.java +100 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/java/com/tencent/mmkv/MMKVRecoverStrategic.java +36 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/java/com/tencent/mmkv/NameSpace.java +214 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/java/com/tencent/mmkv/NativeBuffer.java +36 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/java/com/tencent/mmkv/ParcelableMMKV.java +108 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/java/com/tencent/mmkv/UnsupportedArchitectureException.java +27 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvannotation/build.gradle +34 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvannotation/src/main/AndroidManifest.xml +3 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvannotation/src/main/java/dalvik/annotation/optimization/FastNative.java +104 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/build.gradle +116 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/proguard-rules.pro +24 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/AndroidManifest.xml +54 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/aidl/com/tencent/mmkvdemo/IAshmemMMKV.aidl +8 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/cpp/CMakeLists.txt +50 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/cpp/mmkvdemo.cpp +245 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/java/com/tencent/mmkvdemo/Baseline.java +297 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/java/com/tencent/mmkvdemo/BenchMarkBaseService.java +363 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/java/com/tencent/mmkvdemo/FakeInfo.java +67 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/java/com/tencent/mmkvdemo/Info.java +69 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/java/com/tencent/mmkvdemo/MainActivity.java +1029 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/java/com/tencent/mmkvdemo/MultiProcessSharedPreferences.java +710 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/java/com/tencent/mmkvdemo/MyApplication.java +130 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/java/com/tencent/mmkvdemo/MyService.java +105 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/java/com/tencent/mmkvdemo/MyService_1.java +92 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/java/com/tencent/mmkvdemo/SQLiteKV.java +143 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/java/com/tencent/mmkvdemo/TestParcelable.java +70 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/kotlin/KotlinUsecase.kt +67 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/drawable/ic_launcher_background.xml +170 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/drawable-v24/ic_launcher_foreground.xml +34 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/layout/activity_main.xml +76 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +5 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +5 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/values/colors.xml +6 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/values/strings.xml +3 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/values/styles.xml +11 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/pmd-ruleset.xml +44 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/proguard-rules/proguard-rules-android-lib.pro +54 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/proguard-rules/proguard-rules-test.pro +6 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/settings.gradle +3 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/CHANGELOG.md +979 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/CODE_OF_CONDUCT.md +76 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/CONTRIBUTING.md +61 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/CMakeLists.txt +207 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/CodedInputData.cpp +248 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/CodedInputData.h +86 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/CodedInputDataCrypt.cpp +276 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/CodedInputDataCrypt.h +86 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/CodedInputDataCrypt_OSX.cpp +62 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/CodedInputData_OSX.cpp +92 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/CodedOutputData.cpp +182 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/CodedOutputData.h +86 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/Core.xcodeproj/project.pbxproj +703 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/Core.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/Core.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/Core.xcodeproj/xcshareddata/xcschemes/Core.xcscheme +67 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/Core.xcodeproj/xcshareddata/xcschemes/MMKVWatchCore.xcscheme +67 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/InterProcessLock.cpp +211 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/InterProcessLock.h +124 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/InterProcessLock_Android.cpp +104 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/InterProcessLock_Win32.cpp +108 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/KeyValueHolder.cpp +237 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/KeyValueHolder.h +122 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MMBuffer.cpp +207 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MMBuffer.h +119 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MMKV.cpp +1791 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MMKV.h +781 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MMKVLog.cpp +127 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MMKVLog.h +86 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MMKVLog_Android.cpp +134 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MMKVMetaInfo.hpp +99 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MMKVPredef.h +310 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MMKV_Android.cpp +365 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MMKV_IO.cpp +2049 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MMKV_IO.h +85 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MMKV_OSX.cpp +589 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MMKV_OSX.h +30 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MemoryFile.cpp +716 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MemoryFile.h +212 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MemoryFile_Android.cpp +247 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MemoryFile_Linux.cpp +126 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MemoryFile_OSX.cpp +173 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MemoryFile_Win32.cpp +655 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MiniPBCoder.cpp +668 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MiniPBCoder.h +150 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MiniPBCoder_OSX.cpp +237 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/PBEncodeItem.hpp +102 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/PBUtility.cpp +61 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/PBUtility.h +148 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/ScopedLock.hpp +69 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/ThreadLock.cpp +75 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/ThreadLock.h +81 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/ThreadLock_Win32.cpp +89 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/aes/AESCrypt.cpp +293 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/aes/AESCrypt.h +117 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/aes/openssl/openssl_aes.h +98 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/aes/openssl/openssl_aes_core.cpp +1044 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/aes/openssl/openssl_aes_locl.h +38 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/aes/openssl/openssl_aesv8-armx.S +308 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/aes/openssl/openssl_arm_arch.h +84 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/aes/openssl/openssl_cfb128.cpp +97 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/aes/openssl/openssl_md32_common.h +254 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/aes/openssl/openssl_md5.h +49 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/aes/openssl/openssl_md5_dgst.cpp +166 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/aes/openssl/openssl_md5_locl.h +75 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/aes/openssl/openssl_md5_one.cpp +30 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/aes/openssl/openssl_opensslconf.h +271 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/core.vcxproj +288 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/core.vcxproj.filters +150 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/crc32/CMakeLists.txt +60 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/crc32/Checksum.h +76 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/crc32/crc32_armv8.cpp +134 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/crc32/zlib/crc32.cpp +55 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/crc32/zlib/crc32.h +48 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/crc32/zlib/zconf.h +380 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/crc32/zlib/zutil.h +25 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Dockerfile +25 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/LICENSE.TXT +193 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/MMKV.podspec +40 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/MMKV.xcworkspace/contents.xcworkspacedata +10 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/MMKV.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/MMKVAppExtension.podspec +37 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/MMKVCore.podspec +47 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/MMKVWatchExtension.podspec +38 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Makefile +10 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/AppScope/app.json5 +10 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/AppScope/resources/base/element/string.json +8 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/AppScope/resources/base/media/app_icon.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/BuildProfile.ets +17 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/CHANGELOG.md +75 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/Index.ets +4 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/LICENSE +193 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/README.md +208 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/build-profile.json5 +40 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/consumer-rules.txt +61 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/example/Index.ets +686 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/example/Util.ets +31 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/hvigorfile.ts +6 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/obfuscation-rules.txt +18 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/oh-package.json5 +22 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/src/main/cpp/CMakeLists.txt +43 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/src/main/cpp/flutter-bridge.cpp +703 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/src/main/cpp/native_bridge.cpp +1840 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/src/main/cpp/types/libmmkv/index.d.ts +80 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/src/main/cpp/types/libmmkv/oh-package.json5 +6 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/src/main/ets/utils/MMKV.ets +1073 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/src/main/ets/utils/MMKVHandler.ets +111 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/src/main/ets/utils/MMKVLogLevel.ets +50 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/src/main/ets/utils/NativeBuffer.ets +34 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/src/main/ets/utils/Util.ts +24 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/src/main/module.json5 +12 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/build-profile.json5 +62 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/dependencies/hvigor-4.3.0.tgz +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/dependencies/hvigor-ohos-plugin-4.3.0.tgz +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/build-profile.json5 +39 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/hvigorfile.ts +6 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/obfuscation-rules.txt +25 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/oh-package.json5 +13 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/cpp/CMakeLists.txt +54 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/cpp/napi_init.cpp +233 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/cpp/types/libentry/index.d.ts +1 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/cpp/types/libentry/oh-package.json5 +6 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/ets/Util/Baseline.ets +188 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/ets/Util/MyMMKVHandler.ets +76 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/ets/Util/Util.ets +220 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/ets/entryability/EntryAbility.ets +107 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/ets/pages/Index.ets +766 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/ets/process/DemoProcess.ets +31 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/module.json5 +38 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/resources/base/element/color.json +8 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/resources/base/element/string.json +16 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/resources/base/media/background.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/resources/base/media/foreground.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/resources/base/media/layered_image.json +7 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/resources/base/media/startIcon.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/resources/base/profile/main_pages.json +5 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/resources/en_US/element/string.json +16 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/resources/zh_CN/element/string.json +16 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/mock/mock-config.json5 +2 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/ohosTest/ets/test/Ability.test.ets +55 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/ohosTest/ets/test/List.test.ets +25 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/ohosTest/ets/testability/TestAbility.ets +67 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/ohosTest/ets/testability/pages/Index.ets +37 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ets +110 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/ohosTest/module.json5 +38 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/ohosTest/resources/base/element/color.json +8 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/ohosTest/resources/base/element/string.json +16 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/ohosTest/resources/base/media/icon.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/ohosTest/resources/base/profile/test_pages.json +5 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/test/List.test.ets +25 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/test/LocalUnit.test.ets +53 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/hvigor/hvigor-config.json5 +21 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/hvigorfile.ts +6 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/oh-package.json5 +15 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/CMakeLists.txt +27 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/demo/CMakeLists.txt +65 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/demo/TestInterProcessLock.cpp +130 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/demo/UnitTest.cpp +272 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/demo/demo.cpp +1431 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/demo/process.cpp +78 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/golang/CMakeLists.txt +87 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/golang/callback.go +121 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/golang/go.mod +3 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/golang/golang-bridge.cpp +731 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/golang/golang-bridge.h +131 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/golang/mmkv.go +817 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/golang/mmkv_test.go +33 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/golang/test/go.mod +7 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/golang/test/main.go +455 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/src/CMakeLists.txt +83 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/src/libmmkv.cpp +21 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/CMakeLists.txt +62 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/README.md +6 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/demo.py +368 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/libmmkv_python.cpp +454 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.appveyor.yml +35 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.clang-format +38 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.clang-tidy +77 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.cmake-format.yaml +73 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.codespell-ignore-lines +24 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.gitattributes +1 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/CODEOWNERS +9 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/CONTRIBUTING.md +388 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/ISSUE_TEMPLATE/bug-report.yml +61 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/ISSUE_TEMPLATE/config.yml +8 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/dependabot.yml +15 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/labeler.yml +13 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/labeler_merged.yml +8 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/matchers/pylint.json +32 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/pull_request_template.md +19 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/workflows/ci.yml +1233 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/workflows/configure.yml +92 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/workflows/format.yml +60 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/workflows/labeler.yml +25 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/workflows/pip.yml +117 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/workflows/upstream.yml +116 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.pre-commit-config.yaml +156 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.readthedocs.yml +20 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/CMakeLists.txt +375 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/LICENSE +29 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/MANIFEST.in +6 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/README.rst +181 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/SECURITY.md +13 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/Doxyfile +21 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/_static/css/custom.css +3 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/cast/chrono.rst +81 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/cast/custom.rst +93 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/cast/eigen.rst +310 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/cast/functional.rst +109 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/cast/index.rst +43 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/cast/overview.rst +170 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/cast/stl.rst +249 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/cast/strings.rst +296 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/classes.rst +1335 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/embedding.rst +262 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/exceptions.rst +401 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/functions.rst +614 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/misc.rst +429 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/pycpp/index.rst +13 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/pycpp/numpy.rst +453 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/pycpp/object.rst +286 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/pycpp/utilities.rst +155 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/smart_ptrs.rst +174 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/basics.rst +307 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/benchmark.py +89 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/benchmark.rst +95 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/changelog.rst +3121 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/classes.rst +555 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/cmake/index.rst +8 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/compiling.rst +726 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/conf.py +369 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/faq.rst +308 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/index.rst +48 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/installing.rst +105 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/limitations.rst +72 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/pybind11-logo.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/pybind11_vs_boost_python1.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/pybind11_vs_boost_python1.svg +427 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/pybind11_vs_boost_python2.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/pybind11_vs_boost_python2.svg +427 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/reference.rst +130 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/release.rst +143 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/requirements.in +6 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/requirements.txt +275 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/upgrade.rst +594 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/attr.h +690 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/buffer_info.h +208 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/cast.h +1848 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/chrono.h +225 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/common.h +2 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/complex.h +74 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/detail/class.h +754 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/detail/common.h +1268 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/detail/descr.h +172 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/detail/init.h +434 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/detail/internals.h +749 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/detail/type_caster_base.h +1214 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/detail/typeid.h +65 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/eigen/common.h +9 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/eigen/matrix.h +714 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/eigen/tensor.h +517 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/eigen.h +12 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/embed.h +313 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/eval.h +156 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/functional.h +138 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/gil.h +219 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/gil_safe_call_once.h +91 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/iostream.h +265 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/numpy.h +2135 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/operators.h +202 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/options.h +92 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/pybind11.h +3026 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/pytypes.h +2604 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/stl/filesystem.h +115 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/stl.h +448 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/stl_bind.h +822 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/type_caster_pyobject_ptr.h +61 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/typing.h +239 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/noxfile.py +107 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/pybind11/__init__.py +19 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/pybind11/__main__.py +63 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/pybind11/_version.py +12 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/pybind11/commands.py +39 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/pybind11/py.typed +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/pybind11/setup_helpers.py +500 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/pyproject.toml +87 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/setup.cfg +43 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/setup.py +149 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/CMakeLists.txt +589 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/conftest.py +224 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/constructor_stats.h +322 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/cross_module_gil_utils.cpp +111 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/cross_module_interleaved_error_already_set.cpp +54 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/eigen_tensor_avoid_stl_array.cpp +16 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/env.py +31 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/extra_python_package/pytest.ini +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/extra_python_package/test_files.py +296 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/extra_setuptools/pytest.ini +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/extra_setuptools/test_setuphelper.py +153 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/local_bindings.h +92 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/object.h +205 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/pybind11_cross_module_tests.cpp +149 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/pybind11_tests.cpp +131 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/pybind11_tests.h +98 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/pytest.ini +23 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/requirements.txt +13 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_async.cpp +25 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_async.py +26 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_buffers.cpp +259 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_buffers.py +230 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_builtin_casters.cpp +387 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_builtin_casters.py +530 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_call_policies.cpp +113 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_call_policies.py +249 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_callbacks.cpp +280 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_callbacks.py +227 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_chrono.cpp +81 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_chrono.py +207 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_class.cpp +656 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_class.py +503 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_cmake_build/CMakeLists.txt +80 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_cmake_build/embed.cpp +23 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_cmake_build/installed_embed/CMakeLists.txt +28 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_cmake_build/installed_function/CMakeLists.txt +39 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_cmake_build/installed_target/CMakeLists.txt +46 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_cmake_build/main.cpp +6 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_cmake_build/subdirectory_embed/CMakeLists.txt +47 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_cmake_build/subdirectory_function/CMakeLists.txt +41 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_cmake_build/subdirectory_target/CMakeLists.txt +47 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_cmake_build/test.py +10 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_const_name.cpp +55 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_const_name.py +31 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_constants_and_functions.cpp +158 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_constants_and_functions.py +58 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_copy_move.cpp +544 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_copy_move.py +140 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_custom_type_casters.cpp +217 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_custom_type_casters.py +124 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_custom_type_setup.cpp +41 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_custom_type_setup.py +50 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_docstring_options.cpp +129 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_docstring_options.py +66 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_eigen_matrix.cpp +443 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_eigen_matrix.py +816 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_eigen_tensor.cpp +18 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_eigen_tensor.inl +332 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_eigen_tensor.py +290 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_embed/CMakeLists.txt +54 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_embed/catch.cpp +43 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_embed/external_module.cpp +20 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_embed/test_interpreter.cpp +488 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_embed/test_interpreter.py +16 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_embed/test_trampoline.py +18 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_enum.cpp +133 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_enum.py +270 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_eval.cpp +118 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_eval.py +52 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_eval_call.py +5 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_exceptions.cpp +388 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_exceptions.h +13 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_exceptions.py +434 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_factory_constructors.cpp +430 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_factory_constructors.py +518 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_gil_scoped.cpp +144 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_gil_scoped.py +244 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_iostream.cpp +126 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_iostream.py +293 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_kwargs_and_defaults.cpp +325 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_kwargs_and_defaults.py +428 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_local_bindings.cpp +106 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_local_bindings.py +259 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_methods_and_attributes.cpp +492 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_methods_and_attributes.py +539 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_modules.cpp +125 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_modules.py +118 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_multiple_inheritance.cpp +341 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_multiple_inheritance.py +495 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_numpy_array.cpp +547 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_numpy_array.py +672 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_numpy_dtypes.cpp +639 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_numpy_dtypes.py +448 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_numpy_vectorize.cpp +107 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_numpy_vectorize.py +268 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_opaque_types.cpp +77 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_opaque_types.py +60 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_operator_overloading.cpp +281 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_operator_overloading.py +153 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_pickling.cpp +194 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_pickling.py +95 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_python_multiple_inheritance.cpp +45 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_python_multiple_inheritance.py +36 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_pytypes.cpp +926 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_pytypes.py +1050 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_sequences_and_iterators.cpp +600 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_sequences_and_iterators.py +267 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_smart_ptr.cpp +473 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_smart_ptr.py +317 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_stl.cpp +549 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_stl.py +383 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_stl_binders.cpp +275 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_stl_binders.py +395 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_tagbased_polymorphic.cpp +147 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_tagbased_polymorphic.py +30 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_thread.cpp +66 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_thread.py +44 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_type_caster_pyobject_ptr.cpp +167 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_type_caster_pyobject_ptr.py +122 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_union.cpp +22 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_union.py +10 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_unnamed_namespace_a.cpp +38 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_unnamed_namespace_a.py +36 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_unnamed_namespace_b.cpp +13 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_unnamed_namespace_b.py +7 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_vector_unique_ptr_member.cpp +54 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_vector_unique_ptr_member.py +16 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_virtual_functions.cpp +592 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_virtual_functions.py +460 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/valgrind-numpy-scipy.supp +140 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/valgrind-python.supp +117 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/FindCatch.cmake +76 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/FindEigen3.cmake +86 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/FindPythonLibsNew.cmake +310 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/JoinPaths.cmake +23 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/check-style.sh +44 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/cmake_uninstall.cmake.in +23 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/codespell_ignore_lines_from_errors.py +40 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/libsize.py +38 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/make_changelog.py +92 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/pybind11.pc.in +7 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/pybind11Common.cmake +429 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/pybind11Config.cmake.in +233 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/pybind11GuessPythonExtSuffix.cmake +86 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/pybind11NewTools.cmake +341 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/pybind11Tools.cmake +239 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/pyproject.toml +3 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/setup_global.py.in +63 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/setup_main.py.in +44 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/test-pybind11GuessPythonExtSuffix.cmake +161 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/setup.py +76 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/unit_test.py +209 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/README.md +357 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/README_CN.md +301 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/SECURITY.md +15 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Script/dumpJavaSignature.py +144 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Script/formatCode.py +17 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Win32/.clang-format +35 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Win32/Win32.sln +58 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Win32/Win32Demo/Win32Demo.cpp +548 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Win32/Win32Demo/Win32Demo.vcxproj +190 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Win32/Win32Demo/Win32Demo.vcxproj.filters +30 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Win32/Win32Demo/pch.cpp +23 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Win32/Win32Demo/pch.h +28 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Win32/Win32DemoProcess/Win32DemoProcess.cpp +88 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Win32/Win32DemoProcess/Win32DemoProcess.vcxproj +188 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Win32/Win32DemoProcess/Win32DemoProcess.vcxproj.filters +30 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Win32/Win32DemoProcess/pch.cpp +21 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Win32/Win32DemoProcess/pch.h +24 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/.metadata +10 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/.vscode/launch.json +162 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/.vscode/settings.json +12 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/CHANGELOG.md +196 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/LICENSE +193 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/README.md +217 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/analysis_options.yaml +49 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/README.md +16 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/app/build.gradle +79 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/app/src/main/AndroidManifest.xml +41 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/app/src/main/java/com/tencent/mmkv_example/MainActivity.java +25 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/app/src/main/res/drawable/launch_background.xml +12 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/app/src/main/res/values/styles.xml +18 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/app/src/profile/AndroidManifest.xml +7 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/build.gradle +29 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/gradle/wrapper/gradle-wrapper.properties +6 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/gradle.properties +4 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/settings.gradle +25 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/settings_aar.gradle +1 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Flutter/AppFrameworkInfo.plist +26 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Flutter/Debug.xcconfig +2 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Flutter/Release.xcconfig +2 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Flutter/ephemeral/flutter_lldb_helper.py +32 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Flutter/ephemeral/flutter_lldbinit +5 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Podfile +49 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/AppDelegate.h +26 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/AppDelegate.m +33 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +122 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json +23 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md +5 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Base.lproj/LaunchScreen.storyboard +37 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Base.lproj/Main.storyboard +29 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Info.plist +49 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Runner.entitlements +10 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/main.m +29 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner.xcodeproj/project.pbxproj +612 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +8 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +90 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner.xcworkspace/contents.xcworkspacedata +10 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +8 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/lib/main.dart +565 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/linux/CMakeLists.txt +128 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/linux/flutter/CMakeLists.txt +88 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/linux/flutter/generated_plugin_registrant.cc +15 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/linux/flutter/generated_plugin_registrant.h +15 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/linux/flutter/generated_plugins.cmake +24 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/linux/runner/CMakeLists.txt +26 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/linux/runner/main.cc +6 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/linux/runner/my_application.cc +130 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/linux/runner/my_application.h +18 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Flutter/Flutter-Debug.xcconfig +2 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Flutter/Flutter-Release.xcconfig +2 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Flutter/GeneratedPluginRegistrant.swift +14 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Podfile +47 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/AppDelegate.swift +13 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +68 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Base.lproj/MainMenu.xib +343 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Configs/AppInfo.xcconfig +14 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Configs/Debug.xcconfig +2 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Configs/Release.xcconfig +2 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Configs/Warnings.xcconfig +13 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/DebugProfile.entitlements +12 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Info.plist +32 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/MainFlutterWindow.swift +15 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Release.entitlements +8 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner.xcodeproj/project.pbxproj +800 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +99 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner.xcworkspace/contents.xcworkspacedata +10 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +5 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/RunnerTests/RunnerTests.swift +12 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/AppScope/app.json5 +10 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/AppScope/resources/base/element/string.json +8 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/AppScope/resources/base/media/app_icon.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/build-profile.json5 +41 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/build-profile.json5 +34 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/hvigorfile.ts +17 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/oh-package.json5 +13 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/main/ets/entryability/EntryAbility.ets +36 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/main/ets/pages/Index.ets +38 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/main/ets/plugins/GeneratedPluginRegistrant.ets +28 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/main/module.json5 +53 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/main/resources/base/element/color.json +8 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/main/resources/base/element/string.json +16 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/main/resources/base/media/icon.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/main/resources/base/profile/main_pages.json +5 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/main/resources/en_US/element/string.json +16 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/main/resources/zh_CN/element/string.json +16 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/ohosTest/ets/test/Ability.test.ets +50 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/ohosTest/ets/test/List.test.ets +20 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/ohosTest/ets/testability/TestAbility.ets +63 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/ohosTest/ets/testability/pages/Index.ets +49 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts +64 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/ohosTest/module.json5 +51 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/ohosTest/resources/base/element/color.json +8 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/ohosTest/resources/base/element/string.json +16 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/ohosTest/resources/base/media/icon.png +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/ohosTest/resources/base/profile/test_pages.json +5 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/hvigor/hvigor-config.json5 +20 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/hvigorfile.ts +21 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/oh-package.json5 +21 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/pubspec.yaml +75 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/CMakeLists.txt +108 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/flutter/CMakeLists.txt +109 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/flutter/generated_plugin_registrant.cc +14 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/flutter/generated_plugin_registrant.h +15 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/flutter/generated_plugins.cmake +24 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/runner/CMakeLists.txt +40 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/runner/Runner.rc +121 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/runner/flutter_window.cpp +71 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/runner/flutter_window.h +33 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/runner/main.cpp +43 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/runner/resource.h +16 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/runner/resources/app_icon.ico +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/runner/runner.exe.manifest +14 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/runner/utils.cpp +65 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/runner/utils.h +19 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/runner/win32_window.cpp +288 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/runner/win32_window.h +102 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/lib/mmkv.dart +1052 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/mmkv.iml +17 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/pubspec.yaml +62 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/test/mmkv_test.dart +48 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/tool/fix_mmkv_plugin_name.rb +4 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/tool/mmkvpodhelper.rb +23 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv.iml +25 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_android/CHANGELOG.md +48 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_android/LICENSE +193 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_android/README.md +17 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_android/android/build.gradle +39 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_android/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_android/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_android/android/gradle.properties +4 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_android/android/gradlew +160 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_android/android/gradlew.bat +90 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_android/android/settings.gradle +1 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_android/android/src/main/AndroidManifest.xml +1 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_android/android/src/main/java/com/tencent/mmkv/MMKVPlugin.java +82 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_android/lib/mmkv_android.dart +76 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_android/pubspec.yaml +40 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ios/.metadata +33 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ios/CHANGELOG.md +52 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ios/LICENSE +193 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ios/README.md +17 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ios/darwin/Classes/MMKVPlugin.h +28 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ios/darwin/Classes/MMKVPlugin.mm +39 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ios/darwin/Classes/flutter-bridge.h +32 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ios/darwin/Classes/flutter-bridge.mm +693 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ios/darwin/mmkv_ios.podspec +35 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ios/lib/mmkv_ios.dart +78 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ios/pubspec.yaml +44 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_linux/.metadata +30 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_linux/CHANGELOG.md +9 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_linux/LICENSE +193 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_linux/README.md +17 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_linux/analysis_options.yaml +4 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_linux/lib/mmkv_linux.dart +69 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_linux/linux/CMakeLists.txt +63 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_linux/linux/flutter-bridge.cpp +694 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_linux/linux/include/mmkv_linux/mmkv_linux_plugin.h +46 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_linux/linux/mmkv_linux_plugin.cc +97 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_linux/pubspec.yaml +47 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ohos/.metadata +30 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ohos/CHANGELOG.md +42 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ohos/LICENSE +193 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ohos/README.md +17 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ohos/analysis_options.yaml +4 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ohos/lib/mmkv_ohos.dart +84 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ohos/ohos/build-profile.json5 +10 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ohos/ohos/hvigorfile.ts +2 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ohos/ohos/index.ets +17 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ohos/ohos/oh-package.json5 +15 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ohos/ohos/src/main/ets/components/plugin/MMKVPlugin.ets +78 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ohos/ohos/src/main/module.json5 +10 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ohos/pubspec.yaml +50 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_platform_interface/CHANGELOG.md +38 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_platform_interface/LICENSE +193 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_platform_interface/README.md +30 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_platform_interface/lib/mmkv_platform_ffi.dart +363 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_platform_interface/lib/mmkv_platform_interface.dart +363 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_platform_interface/pubspec.yaml +23 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_win32/.metadata +30 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_win32/CHANGELOG.md +9 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_win32/LICENSE +193 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_win32/README.md +17 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_win32/analysis_options.yaml +4 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_win32/lib/mmkv_win32.dart +69 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_win32/pubspec.yaml +47 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_win32/windows/CMakeLists.txt +71 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_win32/windows/flutter-bridge.cpp +721 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_win32/windows/include/mmkv_win32/mmkv_win32_plugin.h +43 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_win32/windows/mmkv_win32_plugin.cpp +88 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKV/MMKV/AutoCleanInfo.hpp +65 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKV/MMKV/MMKV.h +552 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKV/MMKV/MMKVHandler.h +60 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKV/MMKV/Resources/Info.plist +24 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKV/MMKV/libMMKV.mm +1361 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKV/MMKV.xcodeproj/project.pbxproj +967 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKV/MMKV.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKV/MMKV.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKV/MMKV.xcodeproj/xcshareddata/xcschemes/MMKV For App Extension.xcscheme +67 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKV/MMKV.xcodeproj/xcshareddata/xcschemes/MMKV Static.xcscheme +76 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKV/MMKV.xcodeproj/xcshareddata/xcschemes/MMKV.xcscheme +76 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKV/MMKV.xcodeproj/xcshareddata/xcschemes/MMKVWatchExtension.xcscheme +67 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/Config.xcconfig +10 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVCatalystDemo/AppDelegate.h +15 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVCatalystDemo/AppDelegate.m +43 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVCatalystDemo/Assets.xcassets/AccentColor.colorset/Contents.json +11 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVCatalystDemo/Assets.xcassets/AppIcon.appiconset/Contents.json +13 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVCatalystDemo/Assets.xcassets/Contents.json +6 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVCatalystDemo/Base.lproj/LaunchScreen.storyboard +25 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVCatalystDemo/Base.lproj/Main.storyboard +42 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVCatalystDemo/Info.plist +25 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVCatalystDemo/MMKVCatalystDemo.entitlements +12 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVCatalystDemo/SceneDelegate.h +16 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVCatalystDemo/SceneDelegate.m +58 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVCatalystDemo/ViewController.h +15 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVCatalystDemo/ViewController.mm +85 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVCatalystDemo/main.m +19 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/AppDelegate.h +27 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/AppDelegate.m +135 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/DemoSwiftUsage.swift +82 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/MMKVDemo-Bridging-Header.h +22 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json +98 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/Resources/Base.lproj/LaunchScreen.storyboard +25 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/Resources/Base.lproj/Main.storyboard +48 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/Resources/Info.plist +49 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/Resources/MMKVDemo.entitlements +10 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/Resources/testReadOnly +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/Resources/testReadOnly.crc +0 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/TestMMKVCpp.cpp +204 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/TestMMKVCpp.hpp +18 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/ViewController+TestCaseBad.h +39 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/ViewController+TestCaseBad.mm +200 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/ViewController.h +32 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/ViewController.mm +1245 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/main.m +28 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo.xcodeproj/project.pbxproj +1944 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +8 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo.xcodeproj/xcshareddata/xcschemes/MMKVDemo.xcscheme +88 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo.xcodeproj/xcshareddata/xcschemes/MMKVMacDemo.xcscheme +78 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo.xcodeproj/xcshareddata/xcschemes/MMKVTodayExtensionDemo.xcscheme +116 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo.xcodeproj/xcshareddata/xcschemes/WatchApp (Notification).xcscheme +106 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo.xcodeproj/xcshareddata/xcschemes/WatchApp.xcscheme +102 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo.xcodeproj/xcshareddata/xcschemes/kvdemo.xcscheme +78 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemoTests/Info.plist +22 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemoTests/MMKVDemoTests.mm +554 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemoTests/MMKVPerformanceTest.mm +118 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVMacDemo/AppDelegate.h +13 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVMacDemo/AppDelegate.m +27 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVMacDemo/Assets.xcassets/AppIcon.appiconset/Contents.json +58 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVMacDemo/Assets.xcassets/Contents.json +6 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVMacDemo/Base.lproj/Main.storyboard +718 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVMacDemo/Info.plist +32 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVMacDemo/MMKVMacDemo.entitlements +10 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVMacDemo/ViewController.h +13 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVMacDemo/ViewController.mm +352 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVMacDemo/main.m +15 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVTodayExtensionDemo/Base.lproj/MainInterface.storyboard +45 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVTodayExtensionDemo/Info.plist +31 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVTodayExtensionDemo/MMKVTodayExtensionDemo.entitlements +10 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVTodayExtensionDemo/TodayViewController.h +25 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVTodayExtensionDemo/TodayViewController.m +106 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Content.imageset/Contents.json +12 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Contents.json +6 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Contents.json +17 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Content.imageset/Contents.json +12 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Contents.json +6 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Middle.solidimagestacklayer/Content.imageset/Contents.json +12 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Middle.solidimagestacklayer/Contents.json +6 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVVisionDemo/Assets.xcassets/Contents.json +6 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVVisionDemo/ContentView.swift +71 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVVisionDemo/Info.plist +15 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVVisionDemo/MMKVVisionDemoApp.swift +22 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVVisionDemo/Preview Content/Preview Assets.xcassets/Contents.json +6 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp/Assets.xcassets/AppIcon.appiconset/Contents.json +81 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp/Assets.xcassets/Contents.json +6 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp/Base.lproj/Interface.storyboard +47 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp/Info.plist +33 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/Assets.xcassets/Complication.complicationset/Circular.imageset/Contents.json +28 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/Assets.xcassets/Complication.complicationset/Contents.json +48 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/Assets.xcassets/Complication.complicationset/Extra Large.imageset/Contents.json +28 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/Assets.xcassets/Complication.complicationset/Graphic Bezel.imageset/Contents.json +28 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/Assets.xcassets/Complication.complicationset/Graphic Circular.imageset/Contents.json +28 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/Assets.xcassets/Complication.complicationset/Graphic Corner.imageset/Contents.json +28 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/Assets.xcassets/Complication.complicationset/Graphic Large Rectangular.imageset/Contents.json +28 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/Assets.xcassets/Complication.complicationset/Modular.imageset/Contents.json +28 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/Assets.xcassets/Complication.complicationset/Utilitarian.imageset/Contents.json +28 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/Assets.xcassets/Contents.json +6 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/ExtensionDelegate.h +25 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/ExtensionDelegate.mm +135 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/Info.plist +36 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/InterfaceController.h +26 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/InterfaceController.m +50 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/NotificationController.h +26 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/NotificationController.m +60 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/PushNotificationPayload.apns +20 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/kvdemo/AppDelegate.h +15 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/kvdemo/AppDelegate.m +49 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/kvdemo/Assets.xcassets/AccentColor.colorset/Contents.json +11 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/kvdemo/Assets.xcassets/AppIcon.appiconset/Contents.json +13 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/kvdemo/Assets.xcassets/Contents.json +6 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/kvdemo/Base.lproj/LaunchScreen.storyboard +25 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/kvdemo/Base.lproj/Main.storyboard +45 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/kvdemo/Info.plist +25 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/kvdemo/SceneDelegate.h +16 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/kvdemo/SceneDelegate.m +58 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/kvdemo/ViewController.h +15 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/kvdemo/ViewController.m +38 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/kvdemo/kvdemo.entitlements +10 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/kvdemo/main.m +19 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MMKVManagedBuffer.h +49 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MmkvCxx.cpp +152 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MmkvCxx.h +36 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MmkvHostObject.cpp +357 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MmkvHostObject.h +66 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MmkvLogger.h +52 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MmkvPlatformContext.cpp +37 -0
- package/harmony/reactNativeMMKV/src/main/cpp/MmkvPlatformContext.h +36 -0
- package/harmony/reactNativeMMKV/src/main/cpp/NativeMMKVComponentDescriptor.h +65 -0
- package/harmony/reactNativeMMKV/src/main/cpp/NativeMMKVJSIBinder.h +55 -0
- package/harmony/reactNativeMMKV/src/main/cpp/NativeMMKVPackage.h +67 -0
- package/harmony/reactNativeMMKV/src/main/cpp/Props.cpp +37 -0
- package/harmony/reactNativeMMKV/src/main/cpp/Props.h +42 -0
- package/harmony/reactNativeMMKV/src/main/cpp/ShadowNodes.cpp +39 -0
- package/harmony/reactNativeMMKV/src/main/cpp/ShadowNodes.h +41 -0
- package/harmony/reactNativeMMKV/src/main/cpp/States.cpp +40 -0
- package/harmony/reactNativeMMKV/src/main/cpp/States.h +45 -0
- package/harmony/reactNativeMMKV/src/main/ets/Logger.ts +65 -0
- package/harmony/reactNativeMMKV/src/main/ets/MmkvCxxPackage.ts +46 -0
- package/harmony/reactNativeMMKV/src/main/ets/MmkvCxxTurboModule.ts +60 -0
- package/harmony/reactNativeMMKV/src/main/ets/MmkvPlatformContextPackage.ts +46 -0
- package/harmony/reactNativeMMKV/src/main/ets/MmkvPlatformContextTurboModule.ts +48 -0
- package/harmony/reactNativeMMKV/src/main/module.json5 +7 -0
- package/harmony/reactNativeMMKV/src/main/resources/base/element/string.json +8 -0
- package/harmony/reactNativeMMKV/src/main/resources/en_US/element/string.json +8 -0
- package/harmony/reactNativeMMKV/src/main/resources/zh_CN/element/string.json +8 -0
- package/harmony/reactNativeMMKV/ts.ts +27 -0
- package/harmony/reactNativeMMKV.har +0 -0
- package/lib/commonjs/MMKV.js +124 -0
- package/lib/commonjs/MMKV.js.map +1 -0
- package/lib/commonjs/MemoryWarningListener.js +31 -0
- package/lib/commonjs/MemoryWarningListener.js.map +1 -0
- package/lib/commonjs/MemoryWarningListener.web.js +11 -0
- package/lib/commonjs/MemoryWarningListener.web.js.map +1 -0
- package/lib/commonjs/ModuleNotFoundError.js +75 -0
- package/lib/commonjs/ModuleNotFoundError.js.map +1 -0
- package/lib/commonjs/NativeMmkv.js +53 -0
- package/lib/commonjs/NativeMmkv.js.map +1 -0
- package/lib/commonjs/NativeMmkvPlatformContext.js +22 -0
- package/lib/commonjs/NativeMmkvPlatformContext.js.map +1 -0
- package/lib/commonjs/PlatformChecker.js +14 -0
- package/lib/commonjs/PlatformChecker.js.map +1 -0
- package/lib/commonjs/Types.js +32 -0
- package/lib/commonjs/Types.js.map +1 -0
- package/lib/commonjs/createMMKV.js +43 -0
- package/lib/commonjs/createMMKV.js.map +1 -0
- package/lib/commonjs/createMMKV.mock.js +43 -0
- package/lib/commonjs/createMMKV.mock.js.map +1 -0
- package/lib/commonjs/createMMKV.web.js +110 -0
- package/lib/commonjs/createMMKV.web.js.map +1 -0
- package/lib/commonjs/createTextEncoder.js +23 -0
- package/lib/commonjs/createTextEncoder.js.map +1 -0
- package/lib/commonjs/hooks.js +198 -0
- package/lib/commonjs/hooks.js.map +1 -0
- package/lib/commonjs/index.js +40 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/module/MMKV.js +119 -0
- package/lib/module/MMKV.js.map +1 -0
- package/lib/module/MemoryWarningListener.js +27 -0
- package/lib/module/MemoryWarningListener.js.map +1 -0
- package/lib/module/MemoryWarningListener.web.js +6 -0
- package/lib/module/MemoryWarningListener.web.js.map +1 -0
- package/lib/module/ModuleNotFoundError.js +70 -0
- package/lib/module/ModuleNotFoundError.js.map +1 -0
- package/lib/module/NativeMmkv.js +51 -0
- package/lib/module/NativeMmkv.js.map +1 -0
- package/lib/module/NativeMmkvPlatformContext.js +18 -0
- package/lib/module/NativeMmkvPlatformContext.js.map +1 -0
- package/lib/module/PlatformChecker.js +10 -0
- package/lib/module/PlatformChecker.js.map +1 -0
- package/lib/module/Types.js +31 -0
- package/lib/module/Types.js.map +1 -0
- package/lib/module/createMMKV.js +38 -0
- package/lib/module/createMMKV.js.map +1 -0
- package/lib/module/createMMKV.mock.js +38 -0
- package/lib/module/createMMKV.mock.js.map +1 -0
- package/lib/module/createMMKV.web.js +105 -0
- package/lib/module/createMMKV.web.js.map +1 -0
- package/lib/module/createTextEncoder.js +19 -0
- package/lib/module/createTextEncoder.js.map +1 -0
- package/lib/module/hooks.js +189 -0
- package/lib/module/hooks.js.map +1 -0
- package/lib/module/index.js +6 -0
- package/lib/module/index.js.map +1 -0
- package/lib/typescript/src/MMKV.d.ts +34 -0
- package/lib/typescript/src/MMKV.d.ts.map +1 -0
- package/lib/typescript/src/MemoryWarningListener.d.ts +3 -0
- package/lib/typescript/src/MemoryWarningListener.d.ts.map +1 -0
- package/lib/typescript/src/MemoryWarningListener.web.d.ts +3 -0
- package/lib/typescript/src/MemoryWarningListener.web.d.ts.map +1 -0
- package/lib/typescript/src/ModuleNotFoundError.d.ts +7 -0
- package/lib/typescript/src/ModuleNotFoundError.d.ts.map +1 -0
- package/lib/typescript/src/NativeMmkv.d.ts +91 -0
- package/lib/typescript/src/NativeMmkv.d.ts.map +1 -0
- package/lib/typescript/src/NativeMmkvPlatformContext.d.ts +20 -0
- package/lib/typescript/src/NativeMmkvPlatformContext.d.ts.map +1 -0
- package/lib/typescript/src/PlatformChecker.d.ts +2 -0
- package/lib/typescript/src/PlatformChecker.d.ts.map +1 -0
- package/lib/typescript/src/Types.d.ts +172 -0
- package/lib/typescript/src/Types.d.ts.map +1 -0
- package/lib/typescript/src/__tests__/hooks.test.d.ts +2 -0
- package/lib/typescript/src/__tests__/hooks.test.d.ts.map +1 -0
- package/lib/typescript/src/createMMKV.d.ts +3 -0
- package/lib/typescript/src/createMMKV.d.ts.map +1 -0
- package/lib/typescript/src/createMMKV.mock.d.ts +3 -0
- package/lib/typescript/src/createMMKV.mock.d.ts.map +1 -0
- package/lib/typescript/src/createMMKV.web.d.ts +3 -0
- package/lib/typescript/src/createMMKV.web.d.ts.map +1 -0
- package/lib/typescript/src/createTextEncoder.d.ts +2 -0
- package/lib/typescript/src/createTextEncoder.d.ts.map +1 -0
- package/lib/typescript/src/hooks.d.ts +86 -0
- package/lib/typescript/src/hooks.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +4 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/package.json +187 -0
- package/react-native-mmkv.podspec +38 -0
- package/react-native.config.js +20 -0
- package/src/MMKV.ts +142 -0
- package/src/MemoryWarningListener.ts +29 -0
- package/src/MemoryWarningListener.web.ts +5 -0
- package/src/ModuleNotFoundError.ts +95 -0
- package/src/NativeMmkv.ts +118 -0
- package/src/NativeMmkvPlatformContext.ts +38 -0
- package/src/PlatformChecker.ts +9 -0
- package/src/Types.ts +178 -0
- package/src/__tests__/hooks.test.tsx +89 -0
- package/src/createMMKV.mock.ts +38 -0
- package/src/createMMKV.ts +42 -0
- package/src/createMMKV.web.ts +127 -0
- package/src/createTextEncoder.ts +16 -0
- package/src/hooks.ts +247 -0
- package/src/index.ts +4 -0
|
@@ -0,0 +1,2024 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Tencent is pleased to support the open source community by making
|
|
3
|
+
* MMKV available.
|
|
4
|
+
*
|
|
5
|
+
* Copyright (C) 2018 THL A29 Limited, a Tencent company.
|
|
6
|
+
* All rights reserved.
|
|
7
|
+
*
|
|
8
|
+
* Licensed under the BSD 3-Clause License (the "License"); you may not use
|
|
9
|
+
* this file except in compliance with the License. You may obtain a copy of
|
|
10
|
+
* the License at
|
|
11
|
+
*
|
|
12
|
+
* https://opensource.org/licenses/BSD-3-Clause
|
|
13
|
+
*
|
|
14
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
* See the License for the specific language governing permissions and
|
|
18
|
+
* limitations under the License.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
package com.tencent.mmkv;
|
|
22
|
+
|
|
23
|
+
import android.content.ContentResolver;
|
|
24
|
+
import android.content.Context;
|
|
25
|
+
import android.content.SharedPreferences;
|
|
26
|
+
import android.content.pm.ApplicationInfo;
|
|
27
|
+
import android.net.Uri;
|
|
28
|
+
import android.os.Bundle;
|
|
29
|
+
import android.os.Parcel;
|
|
30
|
+
import android.os.Parcelable;
|
|
31
|
+
import android.os.Process;
|
|
32
|
+
import android.util.Log;
|
|
33
|
+
|
|
34
|
+
import androidx.annotation.NonNull;
|
|
35
|
+
import androidx.annotation.Nullable;
|
|
36
|
+
|
|
37
|
+
import org.jetbrains.annotations.Contract;
|
|
38
|
+
|
|
39
|
+
import dalvik.annotation.optimization.FastNative;
|
|
40
|
+
|
|
41
|
+
import java.lang.reflect.Field;
|
|
42
|
+
import java.util.Arrays;
|
|
43
|
+
import java.util.EnumMap;
|
|
44
|
+
import java.util.HashMap;
|
|
45
|
+
import java.util.HashSet;
|
|
46
|
+
import java.util.Map;
|
|
47
|
+
import java.util.Set;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* An highly efficient, reliable, multi-process key-value storage framework.
|
|
51
|
+
* THE PERFECT drop-in replacement for SharedPreferences and MultiProcessSharedPreferences.
|
|
52
|
+
*/
|
|
53
|
+
public class MMKV implements SharedPreferences, SharedPreferences.Editor {
|
|
54
|
+
|
|
55
|
+
private static final EnumMap<MMKVRecoverStrategic, Integer> recoverIndex;
|
|
56
|
+
private static final EnumMap<MMKVLogLevel, Integer> logLevel2Index;
|
|
57
|
+
private static final MMKVLogLevel[] index2LogLevel;
|
|
58
|
+
private static final Set<Long> checkedHandleSet;
|
|
59
|
+
|
|
60
|
+
static {
|
|
61
|
+
recoverIndex = new EnumMap<>(MMKVRecoverStrategic.class);
|
|
62
|
+
recoverIndex.put(MMKVRecoverStrategic.OnErrorDiscard, 0);
|
|
63
|
+
recoverIndex.put(MMKVRecoverStrategic.OnErrorRecover, 1);
|
|
64
|
+
|
|
65
|
+
logLevel2Index = new EnumMap<>(MMKVLogLevel.class);
|
|
66
|
+
logLevel2Index.put(MMKVLogLevel.LevelDebug, 0);
|
|
67
|
+
logLevel2Index.put(MMKVLogLevel.LevelInfo, 1);
|
|
68
|
+
logLevel2Index.put(MMKVLogLevel.LevelWarning, 2);
|
|
69
|
+
logLevel2Index.put(MMKVLogLevel.LevelError, 3);
|
|
70
|
+
logLevel2Index.put(MMKVLogLevel.LevelNone, 4);
|
|
71
|
+
|
|
72
|
+
index2LogLevel = new MMKVLogLevel[]{MMKVLogLevel.LevelDebug, MMKVLogLevel.LevelInfo, MMKVLogLevel.LevelWarning,
|
|
73
|
+
MMKVLogLevel.LevelError, MMKVLogLevel.LevelNone};
|
|
74
|
+
|
|
75
|
+
checkedHandleSet = new HashSet<Long>();
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* The interface for providing a 3rd library loader (the ReLinker https://github.com/KeepSafe/ReLinker, etc).
|
|
80
|
+
*/
|
|
81
|
+
public interface LibLoader {
|
|
82
|
+
void loadLibrary(String libName);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Initialize MMKV with default configuration.
|
|
87
|
+
* You must call one of the initialize() methods on App startup process before using MMKV.
|
|
88
|
+
*
|
|
89
|
+
* @param context The context of Android App, usually from Application.
|
|
90
|
+
* @return The root folder of MMKV, defaults to $(FilesDir)/mmkv.
|
|
91
|
+
*/
|
|
92
|
+
public static String initialize(@NonNull Context context) {
|
|
93
|
+
String root = context.getFilesDir().getAbsolutePath() + "/mmkv";
|
|
94
|
+
MMKVLogLevel logLevel = BuildConfig.DEBUG ? MMKVLogLevel.LevelDebug : MMKVLogLevel.LevelInfo;
|
|
95
|
+
return initialize(context, root, null, logLevel, null);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Initialize MMKV with customize log level.
|
|
100
|
+
* You must call one of the initialize() methods on App startup process before using MMKV.
|
|
101
|
+
*
|
|
102
|
+
* @param context The context of Android App, usually from Application.
|
|
103
|
+
* @param logLevel The log level of MMKV, defaults to {@link MMKVLogLevel#LevelInfo}.
|
|
104
|
+
* @return The root folder of MMKV, defaults to $(FilesDir)/mmkv.
|
|
105
|
+
*/
|
|
106
|
+
public static String initialize(@NonNull Context context, MMKVLogLevel logLevel) {
|
|
107
|
+
String root = context.getFilesDir().getAbsolutePath() + "/mmkv";
|
|
108
|
+
return initialize(context, root, null, logLevel, null);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Initialize MMKV with a 3rd library loader.
|
|
113
|
+
* You must call one of the initialize() methods on App startup process before using MMKV.
|
|
114
|
+
*
|
|
115
|
+
* @param context The context of Android App, usually from Application.
|
|
116
|
+
* @param loader The 3rd library loader (for example, the <a href="https://github.com/KeepSafe/ReLinker">ReLinker</a> .
|
|
117
|
+
* @return The root folder of MMKV, defaults to $(FilesDir)/mmkv.
|
|
118
|
+
*/
|
|
119
|
+
public static String initialize(@NonNull Context context, LibLoader loader) {
|
|
120
|
+
String root = context.getFilesDir().getAbsolutePath() + "/mmkv";
|
|
121
|
+
MMKVLogLevel logLevel = BuildConfig.DEBUG ? MMKVLogLevel.LevelDebug : MMKVLogLevel.LevelInfo;
|
|
122
|
+
return initialize(context, root, loader, logLevel, null);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Initialize MMKV with a 3rd library loader, and customize log level.
|
|
127
|
+
* You must call one of the initialize() methods on App startup process before using MMKV.
|
|
128
|
+
*
|
|
129
|
+
* @param context The context of Android App, usually from Application.
|
|
130
|
+
* @param loader The 3rd library loader (for example, the <a href="https://github.com/KeepSafe/ReLinker">ReLinker</a> .
|
|
131
|
+
* @param logLevel The log level of MMKV, defaults to {@link MMKVLogLevel#LevelInfo}.
|
|
132
|
+
* @return The root folder of MMKV, defaults to $(FilesDir)/mmkv.
|
|
133
|
+
*/
|
|
134
|
+
public static String initialize(@NonNull Context context, LibLoader loader, MMKVLogLevel logLevel) {
|
|
135
|
+
String root = context.getFilesDir().getAbsolutePath() + "/mmkv";
|
|
136
|
+
return initialize(context, root, loader, logLevel, null);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Initialize MMKV with customize root folder.
|
|
141
|
+
* You must call one of the initialize() methods on App startup process before using MMKV.
|
|
142
|
+
*
|
|
143
|
+
* @param context The context of Android App, usually from Application.
|
|
144
|
+
* @param rootDir The root folder of MMKV, defaults to $(FilesDir)/mmkv.
|
|
145
|
+
* @return The root folder of MMKV.
|
|
146
|
+
*/
|
|
147
|
+
public static String initialize(Context context, String rootDir) {
|
|
148
|
+
MMKVLogLevel logLevel = BuildConfig.DEBUG ? MMKVLogLevel.LevelDebug : MMKVLogLevel.LevelInfo;
|
|
149
|
+
return initialize(context, rootDir, null, logLevel, null);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Initialize MMKV with customize root folder, and log level.
|
|
154
|
+
* You must call one of the initialize() methods on App startup process before using MMKV.
|
|
155
|
+
*
|
|
156
|
+
* @param context The context of Android App, usually from Application.
|
|
157
|
+
* @param rootDir The root folder of MMKV, defaults to $(FilesDir)/mmkv.
|
|
158
|
+
* @param logLevel The log level of MMKV, defaults to {@link MMKVLogLevel#LevelInfo}.
|
|
159
|
+
* @return The root folder of MMKV.
|
|
160
|
+
*/
|
|
161
|
+
public static String initialize(Context context, String rootDir, MMKVLogLevel logLevel) {
|
|
162
|
+
return initialize(context, rootDir, null, logLevel, null);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Initialize MMKV with customize root folder, and a 3rd library loader.
|
|
167
|
+
* You must call one of the initialize() methods on App startup process before using MMKV.
|
|
168
|
+
*
|
|
169
|
+
* @param context The context of Android App, usually from Application.
|
|
170
|
+
* @param rootDir The root folder of MMKV, defaults to $(FilesDir)/mmkv.
|
|
171
|
+
* @param loader The 3rd library loader (for example, the <a href="https://github.com/KeepSafe/ReLinker">ReLinker</a> .
|
|
172
|
+
* @return The root folder of MMKV.
|
|
173
|
+
*/
|
|
174
|
+
public static String initialize(Context context, String rootDir, LibLoader loader) {
|
|
175
|
+
MMKVLogLevel logLevel = BuildConfig.DEBUG ? MMKVLogLevel.LevelDebug : MMKVLogLevel.LevelInfo;
|
|
176
|
+
return initialize(context, rootDir, loader, logLevel, null);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Initialize MMKV with customize settings.
|
|
181
|
+
* You must call one of the initialize() methods on App startup process before using MMKV.
|
|
182
|
+
*
|
|
183
|
+
* @param context The context of Android App, usually from Application.
|
|
184
|
+
* @param rootDir The root folder of MMKV, defaults to $(FilesDir)/mmkv.
|
|
185
|
+
* @param loader The 3rd library loader (for example, the <a href="https://github.com/KeepSafe/ReLinker">ReLinker</a> .
|
|
186
|
+
* @param logLevel The log level of MMKV, defaults to {@link MMKVLogLevel#LevelInfo}.
|
|
187
|
+
* @return The root folder of MMKV.
|
|
188
|
+
*/
|
|
189
|
+
public static String initialize(Context context, String rootDir, LibLoader loader, MMKVLogLevel logLevel) {
|
|
190
|
+
return initialize(context, rootDir, loader, logLevel, null);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
public static String initialize(@NonNull Context context, String rootDir, LibLoader loader, MMKVLogLevel logLevel, MMKVHandler handler) {
|
|
194
|
+
if (!Process.is64Bit()) {
|
|
195
|
+
throw new UnsupportedArchitectureException("MMKV 2.0+ requires 64-bit App, use 1.3.x instead.");
|
|
196
|
+
}
|
|
197
|
+
String cacheDir = context.getCacheDir().getAbsolutePath();
|
|
198
|
+
|
|
199
|
+
gCallbackHandler = handler;
|
|
200
|
+
boolean hasCallback = false;
|
|
201
|
+
long nativeLogHandler = 0;
|
|
202
|
+
if (handler != null) {
|
|
203
|
+
hasCallback = true;
|
|
204
|
+
if (handler.wantLogRedirecting()) {
|
|
205
|
+
gWantLogReDirecting = true;
|
|
206
|
+
nativeLogHandler = handler.getNativeLogHandler();
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
String ret = doInitialize(rootDir, cacheDir, loader, logLevel, gWantLogReDirecting, hasCallback, nativeLogHandler);
|
|
211
|
+
|
|
212
|
+
// disable process mode in release build
|
|
213
|
+
// FIXME: Find a better way to getApplicationInfo() without using context.
|
|
214
|
+
// If any one knows how, you're welcome to make a contribution.
|
|
215
|
+
if ((context.getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE) == 0) {
|
|
216
|
+
disableProcessModeChecker();
|
|
217
|
+
} else {
|
|
218
|
+
enableProcessModeChecker();
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
return ret;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
private static String doInitialize(String rootDir, String cacheDir, LibLoader loader, MMKVLogLevel logLevel, boolean wantLogReDirecting, boolean hasCallback, long nativeHandler) {
|
|
225
|
+
tryLoadNativeLib(loader);
|
|
226
|
+
jniInitialize(rootDir, cacheDir, logLevel2Int(logLevel), wantLogReDirecting, hasCallback, nativeHandler);
|
|
227
|
+
MMKV.rootDir = rootDir;
|
|
228
|
+
return MMKV.rootDir;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
private static boolean isNativeLibLoaded = false;
|
|
232
|
+
|
|
233
|
+
private static void tryLoadNativeLib(@Nullable LibLoader loader) {
|
|
234
|
+
if (isNativeLibLoaded) {
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
if (loader != null) {
|
|
238
|
+
if (BuildConfig.FLAVOR.equals("SharedCpp")) {
|
|
239
|
+
loader.loadLibrary("c++_shared");
|
|
240
|
+
}
|
|
241
|
+
loader.loadLibrary("mmkv");
|
|
242
|
+
} else {
|
|
243
|
+
if (BuildConfig.FLAVOR.equals("SharedCpp")) {
|
|
244
|
+
System.loadLibrary("c++_shared");
|
|
245
|
+
}
|
|
246
|
+
System.loadLibrary("mmkv");
|
|
247
|
+
}
|
|
248
|
+
isNativeLibLoaded = true;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* @deprecated This method is deprecated due to failing to automatically disable checkProcessMode() without Context.
|
|
253
|
+
* Use the {@link #initialize(Context, String)} method instead.
|
|
254
|
+
*/
|
|
255
|
+
@Deprecated
|
|
256
|
+
public static String initialize(String rootDir) {
|
|
257
|
+
MMKVLogLevel logLevel = BuildConfig.DEBUG ? MMKVLogLevel.LevelDebug : MMKVLogLevel.LevelInfo;
|
|
258
|
+
return doInitialize(rootDir, rootDir + "/.tmp", null, logLevel, false, false, 0);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* @deprecated This method is deprecated due to failing to automatically disable checkProcessMode() without Context.
|
|
263
|
+
* Use the {@link #initialize(Context, String, MMKVLogLevel)} method instead.
|
|
264
|
+
*/
|
|
265
|
+
@Deprecated
|
|
266
|
+
public static String initialize(String rootDir, MMKVLogLevel logLevel) {
|
|
267
|
+
return doInitialize(rootDir, rootDir + "/.tmp", null, logLevel, false, false, 0);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* @deprecated This method is deprecated due to failing to automatically disable checkProcessMode() without Context.
|
|
272
|
+
* Use the {@link #initialize(Context, String, LibLoader)} method instead.
|
|
273
|
+
*/
|
|
274
|
+
@Deprecated
|
|
275
|
+
public static String initialize(String rootDir, LibLoader loader) {
|
|
276
|
+
MMKVLogLevel logLevel = BuildConfig.DEBUG ? MMKVLogLevel.LevelDebug : MMKVLogLevel.LevelInfo;
|
|
277
|
+
return doInitialize(rootDir, rootDir + "/.tmp", loader, logLevel, false, false, 0);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* @deprecated This method is deprecated due to failing to automatically disable checkProcessMode() without Context.
|
|
282
|
+
* Use the {@link #initialize(Context, String, LibLoader, MMKVLogLevel)} method instead.
|
|
283
|
+
*/
|
|
284
|
+
@Deprecated
|
|
285
|
+
public static String initialize(String rootDir, LibLoader loader, MMKVLogLevel logLevel) {
|
|
286
|
+
return doInitialize(rootDir, rootDir + "/.tmp", loader, logLevel, false, false, 0);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* @param dir the customize root directory of a NameSpace
|
|
291
|
+
* @return a NameSpace with custom root dir
|
|
292
|
+
* @throws RuntimeException if there's an runtime error.
|
|
293
|
+
*/
|
|
294
|
+
public static NameSpace nameSpace(String dir) throws RuntimeException {
|
|
295
|
+
tryLoadNativeLib(null);
|
|
296
|
+
if (getNameSpace(dir)) {
|
|
297
|
+
return new NameSpace(dir);
|
|
298
|
+
}
|
|
299
|
+
throw new RuntimeException("Fail to get NameSpace[" + dir + "] in JNI.");
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* identical with the original MMKV with the global root dir
|
|
304
|
+
* @throws RuntimeException if there's an runtime error.
|
|
305
|
+
*/
|
|
306
|
+
public static NameSpace defaultNameSpace() throws RuntimeException {
|
|
307
|
+
if (rootDir == null) {
|
|
308
|
+
throw new IllegalStateException("You should Call MMKV.initialize() first.");
|
|
309
|
+
}
|
|
310
|
+
return new NameSpace(rootDir);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
static private String rootDir = null;
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* @return The root folder of MMKV, defaults to $(FilesDir)/mmkv.
|
|
317
|
+
*/
|
|
318
|
+
public static String getRootDir() {
|
|
319
|
+
return rootDir;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
@Contract(pure = true)
|
|
323
|
+
private static int logLevel2Int(@NonNull MMKVLogLevel level) {
|
|
324
|
+
int realLevel;
|
|
325
|
+
switch (level) {
|
|
326
|
+
case LevelDebug:
|
|
327
|
+
realLevel = 0;
|
|
328
|
+
break;
|
|
329
|
+
case LevelWarning:
|
|
330
|
+
realLevel = 2;
|
|
331
|
+
break;
|
|
332
|
+
case LevelError:
|
|
333
|
+
realLevel = 3;
|
|
334
|
+
break;
|
|
335
|
+
case LevelNone:
|
|
336
|
+
realLevel = 4;
|
|
337
|
+
break;
|
|
338
|
+
case LevelInfo:
|
|
339
|
+
default:
|
|
340
|
+
realLevel = 1;
|
|
341
|
+
break;
|
|
342
|
+
}
|
|
343
|
+
return realLevel;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Set the log level of MMKV.
|
|
348
|
+
*
|
|
349
|
+
* @param level Defaults to {@link MMKVLogLevel#LevelInfo}.
|
|
350
|
+
*/
|
|
351
|
+
public static void setLogLevel(MMKVLogLevel level) {
|
|
352
|
+
int realLevel = logLevel2Int(level);
|
|
353
|
+
setLogLevel(realLevel);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Notify MMKV that App is about to exit. It's totally fine not calling it at all.
|
|
358
|
+
*/
|
|
359
|
+
public static native void onExit();
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* Single-process mode. The default mode on an MMKV instance.
|
|
363
|
+
*/
|
|
364
|
+
static public final int SINGLE_PROCESS_MODE = 1 << 0;
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* Multi-process mode.
|
|
368
|
+
* To enable multi-process accessing of an MMKV instance, you must set this mode whenever you getting that instance.
|
|
369
|
+
*/
|
|
370
|
+
static public final int MULTI_PROCESS_MODE = 1 << 1;
|
|
371
|
+
|
|
372
|
+
// in case someone mistakenly pass Context.MODE_MULTI_PROCESS
|
|
373
|
+
static private final int CONTEXT_MODE_MULTI_PROCESS = 1 << 2;
|
|
374
|
+
|
|
375
|
+
static private final int ASHMEM_MODE = 1 << 3;
|
|
376
|
+
|
|
377
|
+
static private final int BACKUP_MODE = 1 << 4;
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* Read-only mode.
|
|
381
|
+
*/
|
|
382
|
+
static public final int READ_ONLY_MODE = 1 << 5;
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* Create an MMKV instance with an unique ID (in single-process mode).
|
|
386
|
+
*
|
|
387
|
+
* @param mmapID The unique ID of the MMKV instance.
|
|
388
|
+
* @throws RuntimeException if there's an runtime error.
|
|
389
|
+
*/
|
|
390
|
+
@NonNull
|
|
391
|
+
public static MMKV mmkvWithID(String mmapID) throws RuntimeException {
|
|
392
|
+
if (rootDir == null) {
|
|
393
|
+
throw new IllegalStateException("You should Call MMKV.initialize() first.");
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
long handle = getMMKVWithID(mmapID, SINGLE_PROCESS_MODE, null, null, 0, false);
|
|
397
|
+
return checkProcessMode(handle, mmapID, SINGLE_PROCESS_MODE);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
/**
|
|
401
|
+
* Create an MMKV instance in single-process or multi-process mode.
|
|
402
|
+
*
|
|
403
|
+
* @param mmapID The unique ID of the MMKV instance.
|
|
404
|
+
* @param mode The process mode of the MMKV instance, defaults to {@link #SINGLE_PROCESS_MODE}.
|
|
405
|
+
* @throws RuntimeException if there's an runtime error.
|
|
406
|
+
*/
|
|
407
|
+
@NonNull
|
|
408
|
+
public static MMKV mmkvWithID(String mmapID, int mode) throws RuntimeException {
|
|
409
|
+
if (rootDir == null) {
|
|
410
|
+
throw new IllegalStateException("You should Call MMKV.initialize() first.");
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
long handle = getMMKVWithID(mmapID, mode, null, null, 0, false);
|
|
414
|
+
return checkProcessMode(handle, mmapID, mode);
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* Create an MMKV instance in single-process or multi-process mode.
|
|
419
|
+
*
|
|
420
|
+
* @param mmapID The unique ID of the MMKV instance.
|
|
421
|
+
* @param mode The process mode of the MMKV instance, defaults to {@link #SINGLE_PROCESS_MODE}.
|
|
422
|
+
* @param expectedCapacity The file size you expected when opening or creating file
|
|
423
|
+
* @throws RuntimeException if there's an runtime error.
|
|
424
|
+
*/
|
|
425
|
+
@NonNull
|
|
426
|
+
public static MMKV mmkvWithID(String mmapID, int mode, long expectedCapacity) throws RuntimeException {
|
|
427
|
+
if (rootDir == null) {
|
|
428
|
+
throw new IllegalStateException("You should Call MMKV.initialize() first.");
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
long handle = getMMKVWithID(mmapID, mode, null, null, expectedCapacity, false);
|
|
432
|
+
return checkProcessMode(handle, mmapID, mode);
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
/**
|
|
436
|
+
* Create an MMKV instance in customize process mode, with an encryption key.
|
|
437
|
+
*
|
|
438
|
+
* @param mmapID The unique ID of the MMKV instance.
|
|
439
|
+
* @param mode The process mode of the MMKV instance, defaults to {@link #SINGLE_PROCESS_MODE}.
|
|
440
|
+
* @param cryptKey The encryption key of the MMKV instance (no more than 16 bytes).
|
|
441
|
+
* @throws RuntimeException if there's an runtime error.
|
|
442
|
+
*/
|
|
443
|
+
@NonNull
|
|
444
|
+
public static MMKV mmkvWithID(String mmapID, int mode, @Nullable String cryptKey) throws RuntimeException {
|
|
445
|
+
if (rootDir == null) {
|
|
446
|
+
throw new IllegalStateException("You should Call MMKV.initialize() first.");
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
long handle = getMMKVWithID(mmapID, mode, cryptKey, null, 0, false);
|
|
450
|
+
return checkProcessMode(handle, mmapID, mode);
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
* Create an MMKV instance in customize process mode, with an encryption key.
|
|
455
|
+
*
|
|
456
|
+
* @param mmapID The unique ID of the MMKV instance.
|
|
457
|
+
* @param mode The process mode of the MMKV instance, defaults to {@link #SINGLE_PROCESS_MODE}.
|
|
458
|
+
* @param cryptKey The encryption key of the MMKV instance (no more than 32 bytes).
|
|
459
|
+
* @param aes256 Use AES 256 key length
|
|
460
|
+
* @throws RuntimeException if there's an runtime error.
|
|
461
|
+
*/
|
|
462
|
+
@NonNull
|
|
463
|
+
public static MMKV mmkvWithID(String mmapID, int mode, @Nullable String cryptKey, boolean aes256) throws RuntimeException {
|
|
464
|
+
if (rootDir == null) {
|
|
465
|
+
throw new IllegalStateException("You should Call MMKV.initialize() first.");
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
long handle = getMMKVWithID(mmapID, mode, cryptKey, null, 0, aes256);
|
|
469
|
+
return checkProcessMode(handle, mmapID, mode);
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
/**
|
|
473
|
+
* Create an MMKV instance in customize folder.
|
|
474
|
+
*
|
|
475
|
+
* @param mmapID The unique ID of the MMKV instance.
|
|
476
|
+
* @param rootPath The folder of the MMKV instance, defaults to $(FilesDir)/mmkv.
|
|
477
|
+
* @throws RuntimeException if there's an runtime error.
|
|
478
|
+
*/
|
|
479
|
+
@NonNull
|
|
480
|
+
public static MMKV mmkvWithID(String mmapID, String rootPath) throws RuntimeException {
|
|
481
|
+
if (rootDir == null) {
|
|
482
|
+
throw new IllegalStateException("You should Call MMKV.initialize() first.");
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
long handle = getMMKVWithID(mmapID, SINGLE_PROCESS_MODE, null, rootPath, 0, false);
|
|
486
|
+
return checkProcessMode(handle, mmapID, SINGLE_PROCESS_MODE);
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
/**
|
|
490
|
+
* Create an MMKV instance in customize folder.
|
|
491
|
+
*
|
|
492
|
+
* @param mmapID The unique ID of the MMKV instance.
|
|
493
|
+
* @param rootPath The folder of the MMKV instance, defaults to $(FilesDir)/mmkv.
|
|
494
|
+
* @param expectedCapacity The file size you expected when opening or creating file
|
|
495
|
+
* @throws RuntimeException if there's an runtime error.
|
|
496
|
+
*/
|
|
497
|
+
@NonNull
|
|
498
|
+
public static MMKV mmkvWithID(String mmapID, String rootPath, long expectedCapacity) throws RuntimeException {
|
|
499
|
+
if (rootDir == null) {
|
|
500
|
+
throw new IllegalStateException("You should Call MMKV.initialize() first.");
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
long handle = getMMKVWithID(mmapID, SINGLE_PROCESS_MODE, null, rootPath, expectedCapacity, false);
|
|
504
|
+
return checkProcessMode(handle, mmapID, SINGLE_PROCESS_MODE);
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
/**
|
|
508
|
+
* Create an MMKV instance with customize settings all in one.
|
|
509
|
+
*
|
|
510
|
+
* @param mmapID The unique ID of the MMKV instance.
|
|
511
|
+
* @param mode The process mode of the MMKV instance, defaults to {@link #SINGLE_PROCESS_MODE}.
|
|
512
|
+
* @param cryptKey The encryption key of the MMKV instance (no more than 16 bytes).
|
|
513
|
+
* @param rootPath The folder of the MMKV instance, defaults to $(FilesDir)/mmkv.
|
|
514
|
+
* @param expectedCapacity The file size you expected when opening or creating file
|
|
515
|
+
* @throws RuntimeException if there's an runtime error.
|
|
516
|
+
*/
|
|
517
|
+
@NonNull
|
|
518
|
+
public static MMKV mmkvWithID(String mmapID, int mode, @Nullable String cryptKey, String rootPath, long expectedCapacity)
|
|
519
|
+
throws RuntimeException {
|
|
520
|
+
if (rootDir == null) {
|
|
521
|
+
throw new IllegalStateException("You should Call MMKV.initialize() first.");
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
long handle = getMMKVWithID(mmapID, mode, cryptKey, rootPath, expectedCapacity, false);
|
|
525
|
+
return checkProcessMode(handle, mmapID, mode);
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
/**
|
|
529
|
+
* Create an MMKV instance with customize settings all in one.
|
|
530
|
+
*
|
|
531
|
+
* @param mmapID The unique ID of the MMKV instance.
|
|
532
|
+
* @param mode The process mode of the MMKV instance, defaults to {@link #SINGLE_PROCESS_MODE}.
|
|
533
|
+
* @param cryptKey The encryption key of the MMKV instance (no more than 32 bytes).
|
|
534
|
+
* @param aes256 Use AES 256 key length
|
|
535
|
+
* @param rootPath The folder of the MMKV instance, defaults to $(FilesDir)/mmkv.
|
|
536
|
+
* @param expectedCapacity The file size you expected when opening or creating file
|
|
537
|
+
* @throws RuntimeException if there's an runtime error.
|
|
538
|
+
*/
|
|
539
|
+
@NonNull
|
|
540
|
+
public static MMKV mmkvWithID(String mmapID, int mode, @Nullable String cryptKey, boolean aes256, String rootPath,
|
|
541
|
+
long expectedCapacity) throws RuntimeException {
|
|
542
|
+
if (rootDir == null) {
|
|
543
|
+
throw new IllegalStateException("You should Call MMKV.initialize() first.");
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
long handle = getMMKVWithID(mmapID, mode, cryptKey, rootPath, expectedCapacity, aes256);
|
|
547
|
+
return checkProcessMode(handle, mmapID, mode);
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
/**
|
|
551
|
+
* Create an MMKV instance with customize settings all in one.
|
|
552
|
+
*
|
|
553
|
+
* @param mmapID The unique ID of the MMKV instance.
|
|
554
|
+
* @param mode The process mode of the MMKV instance, defaults to {@link #SINGLE_PROCESS_MODE}.
|
|
555
|
+
* @param cryptKey The encryption key of the MMKV instance (no more than 16 bytes).
|
|
556
|
+
* @param rootPath The folder of the MMKV instance, defaults to $(FilesDir)/mmkv.
|
|
557
|
+
* @throws RuntimeException if there's an runtime error.
|
|
558
|
+
*/
|
|
559
|
+
@NonNull
|
|
560
|
+
public static MMKV mmkvWithID(String mmapID, int mode, @Nullable String cryptKey, String rootPath)
|
|
561
|
+
throws RuntimeException {
|
|
562
|
+
if (rootDir == null) {
|
|
563
|
+
throw new IllegalStateException("You should Call MMKV.initialize() first.");
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
long handle = getMMKVWithID(mmapID, mode, cryptKey, rootPath, 0, false);
|
|
567
|
+
return checkProcessMode(handle, mmapID, mode);
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
/**
|
|
571
|
+
* Create an MMKV instance with customize settings all in one.
|
|
572
|
+
*
|
|
573
|
+
* @param mmapID The unique ID of the MMKV instance.
|
|
574
|
+
* @param mode The process mode of the MMKV instance, defaults to {@link #SINGLE_PROCESS_MODE}.
|
|
575
|
+
* @param cryptKey The encryption key of the MMKV instance (no more than 32 bytes).
|
|
576
|
+
* @param aes256 Use AES 256 key length.
|
|
577
|
+
* @param rootPath The folder of the MMKV instance, defaults to $(FilesDir)/mmkv.
|
|
578
|
+
* @throws RuntimeException if there's an runtime error.
|
|
579
|
+
*/
|
|
580
|
+
@NonNull
|
|
581
|
+
public static MMKV mmkvWithID(String mmapID, int mode, @Nullable String cryptKey, boolean aes256, String rootPath)
|
|
582
|
+
throws RuntimeException {
|
|
583
|
+
if (rootDir == null) {
|
|
584
|
+
throw new IllegalStateException("You should Call MMKV.initialize() first.");
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
long handle = getMMKVWithID(mmapID, mode, cryptKey, rootPath, 0, aes256);
|
|
588
|
+
return checkProcessMode(handle, mmapID, mode);
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
/**
|
|
592
|
+
* Get an backed-up MMKV instance with customize settings all in one.
|
|
593
|
+
*
|
|
594
|
+
* @param mmapID The unique ID of the MMKV instance.
|
|
595
|
+
* @param mode The process mode of the MMKV instance, defaults to {@link #SINGLE_PROCESS_MODE}.
|
|
596
|
+
* @param cryptKey The encryption key of the MMKV instance (no more than 16 bytes).
|
|
597
|
+
* @param rootPath The backup folder of the MMKV instance.
|
|
598
|
+
* @throws RuntimeException if there's an runtime error.
|
|
599
|
+
*/
|
|
600
|
+
@NonNull
|
|
601
|
+
public static MMKV backedUpMMKVWithID(String mmapID, int mode, @Nullable String cryptKey, String rootPath)
|
|
602
|
+
throws RuntimeException {
|
|
603
|
+
if (rootDir == null) {
|
|
604
|
+
throw new IllegalStateException("You should Call MMKV.initialize() first.");
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
mode |= BACKUP_MODE;
|
|
608
|
+
long handle = getMMKVWithID(mmapID, mode, cryptKey, rootPath, 0, false);
|
|
609
|
+
return checkProcessMode(handle, mmapID, mode);
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
/**
|
|
613
|
+
* Get an backed-up MMKV instance with customize settings all in one.
|
|
614
|
+
*
|
|
615
|
+
* @param mmapID The unique ID of the MMKV instance.
|
|
616
|
+
* @param mode The process mode of the MMKV instance, defaults to {@link #SINGLE_PROCESS_MODE}.
|
|
617
|
+
* @param cryptKey The encryption key of the MMKV instance (no more than 32 bytes).
|
|
618
|
+
* @param aes256 Use AES 256 key length.
|
|
619
|
+
* @param rootPath The backup folder of the MMKV instance.
|
|
620
|
+
* @throws RuntimeException if there's an runtime error.
|
|
621
|
+
*/
|
|
622
|
+
@NonNull
|
|
623
|
+
public static MMKV backedUpMMKVWithID(String mmapID, int mode, @Nullable String cryptKey, boolean aes256, String rootPath)
|
|
624
|
+
throws RuntimeException {
|
|
625
|
+
if (rootDir == null) {
|
|
626
|
+
throw new IllegalStateException("You should Call MMKV.initialize() first.");
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
mode |= BACKUP_MODE;
|
|
630
|
+
long handle = getMMKVWithID(mmapID, mode, cryptKey, rootPath, 0, aes256);
|
|
631
|
+
return checkProcessMode(handle, mmapID, mode);
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
/**
|
|
635
|
+
* Create an MMKV instance base on Anonymous Shared Memory, aka not synced to any disk files.
|
|
636
|
+
*
|
|
637
|
+
* @param context The context of Android App, usually from Application.
|
|
638
|
+
* @param mmapID The unique ID of the MMKV instance.
|
|
639
|
+
* @param size The maximum size of the underlying Anonymous Shared Memory.
|
|
640
|
+
* Anonymous Shared Memory on Android can't grow dynamically, must set an appropriate size on creation.
|
|
641
|
+
* @param mode The process mode of the MMKV instance, defaults to {@link #SINGLE_PROCESS_MODE}.
|
|
642
|
+
* @param cryptKey The encryption key of the MMKV instance (no more than 16 bytes).
|
|
643
|
+
* @throws RuntimeException if there's an runtime error.
|
|
644
|
+
*/
|
|
645
|
+
@NonNull
|
|
646
|
+
public static MMKV mmkvWithAshmemID(Context context, String mmapID, int size, int mode, @Nullable String cryptKey)
|
|
647
|
+
throws RuntimeException {
|
|
648
|
+
return mmkvWithAshmemID(context, mmapID, size, mode, cryptKey, false);
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
/**
|
|
652
|
+
* Create an MMKV instance base on Anonymous Shared Memory, aka not synced to any disk files.
|
|
653
|
+
*
|
|
654
|
+
* @param context The context of Android App, usually from Application.
|
|
655
|
+
* @param mmapID The unique ID of the MMKV instance.
|
|
656
|
+
* @param size The maximum size of the underlying Anonymous Shared Memory.
|
|
657
|
+
* Anonymous Shared Memory on Android can't grow dynamically, must set an appropriate size on creation.
|
|
658
|
+
* @param mode The process mode of the MMKV instance, defaults to {@link #SINGLE_PROCESS_MODE}.
|
|
659
|
+
* @param cryptKey The encryption key of the MMKV instance (no more than 32 bytes).
|
|
660
|
+
* @param aes256 Use AES 256 key length.
|
|
661
|
+
* @throws RuntimeException if there's an runtime error.
|
|
662
|
+
*/
|
|
663
|
+
@NonNull
|
|
664
|
+
public static MMKV mmkvWithAshmemID(Context context, String mmapID, int size, int mode, @Nullable String cryptKey,
|
|
665
|
+
boolean aes256) throws RuntimeException {
|
|
666
|
+
if (rootDir == null) {
|
|
667
|
+
throw new IllegalStateException("You should Call MMKV.initialize() first.");
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
String processName = MMKVContentProvider.getProcessNameByPID(context, Process.myPid());
|
|
671
|
+
if (processName == null || processName.isEmpty()) {
|
|
672
|
+
String message = "process name detect fail, try again later";
|
|
673
|
+
simpleLog(MMKVLogLevel.LevelError, message);
|
|
674
|
+
throw new IllegalStateException(message);
|
|
675
|
+
}
|
|
676
|
+
if (processName.contains(":")) {
|
|
677
|
+
Uri uri = MMKVContentProvider.contentUri(context);
|
|
678
|
+
if (uri == null) {
|
|
679
|
+
String message = "MMKVContentProvider has invalid authority";
|
|
680
|
+
simpleLog(MMKVLogLevel.LevelError, message);
|
|
681
|
+
throw new IllegalStateException(message);
|
|
682
|
+
}
|
|
683
|
+
simpleLog(MMKVLogLevel.LevelInfo, "getting parcelable mmkv in process, Uri = " + uri);
|
|
684
|
+
|
|
685
|
+
Bundle extras = new Bundle();
|
|
686
|
+
extras.putInt(MMKVContentProvider.KEY_SIZE, size);
|
|
687
|
+
extras.putInt(MMKVContentProvider.KEY_MODE, mode);
|
|
688
|
+
if (cryptKey != null) {
|
|
689
|
+
extras.putString(MMKVContentProvider.KEY_CRYPT, cryptKey);
|
|
690
|
+
}
|
|
691
|
+
ContentResolver resolver = context.getContentResolver();
|
|
692
|
+
Bundle result = resolver.call(uri, MMKVContentProvider.FUNCTION_NAME, mmapID, extras);
|
|
693
|
+
if (result != null) {
|
|
694
|
+
result.setClassLoader(ParcelableMMKV.class.getClassLoader());
|
|
695
|
+
ParcelableMMKV parcelableMMKV = result.getParcelable(MMKVContentProvider.KEY);
|
|
696
|
+
if (parcelableMMKV != null) {
|
|
697
|
+
MMKV mmkv = parcelableMMKV.toMMKV();
|
|
698
|
+
if (mmkv != null) {
|
|
699
|
+
simpleLog(MMKVLogLevel.LevelInfo,
|
|
700
|
+
mmkv.mmapID() + " fd = " + mmkv.ashmemFD() + ", meta fd = " + mmkv.ashmemMetaFD());
|
|
701
|
+
return mmkv;
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
simpleLog(MMKVLogLevel.LevelInfo, "getting mmkv in main process");
|
|
707
|
+
|
|
708
|
+
mode = mode | ASHMEM_MODE;
|
|
709
|
+
long handle = getMMKVWithIDAndSize(mmapID, size, mode, cryptKey, aes256);
|
|
710
|
+
if (handle != 0) {
|
|
711
|
+
return new MMKV(handle);
|
|
712
|
+
}
|
|
713
|
+
throw new IllegalStateException("Fail to create an Ashmem MMKV instance [" + mmapID + "]");
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
/**
|
|
717
|
+
* Create the default MMKV instance in single-process mode.
|
|
718
|
+
*
|
|
719
|
+
* @throws RuntimeException if there's an runtime error.
|
|
720
|
+
*/
|
|
721
|
+
@NonNull
|
|
722
|
+
public static MMKV defaultMMKV() throws RuntimeException {
|
|
723
|
+
if (rootDir == null) {
|
|
724
|
+
throw new IllegalStateException("You should Call MMKV.initialize() first.");
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
long handle = getDefaultMMKV(SINGLE_PROCESS_MODE, null, false);
|
|
728
|
+
return checkProcessMode(handle, "DefaultMMKV", SINGLE_PROCESS_MODE);
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
/**
|
|
732
|
+
* Create the default MMKV instance in customize process mode, with an encryption key.
|
|
733
|
+
*
|
|
734
|
+
* @param mode The process mode of the MMKV instance, defaults to {@link #SINGLE_PROCESS_MODE}.
|
|
735
|
+
* @param cryptKey The encryption key of the MMKV instance (no more than 16 bytes).
|
|
736
|
+
* @throws RuntimeException if there's an runtime error.
|
|
737
|
+
*/
|
|
738
|
+
@NonNull
|
|
739
|
+
public static MMKV defaultMMKV(int mode, @Nullable String cryptKey) throws RuntimeException {
|
|
740
|
+
return defaultMMKV(mode, cryptKey, false);
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
/**
|
|
744
|
+
* Create the default MMKV instance in customize process mode, with an encryption key.
|
|
745
|
+
*
|
|
746
|
+
* @param mode The process mode of the MMKV instance, defaults to {@link #SINGLE_PROCESS_MODE}.
|
|
747
|
+
* @param cryptKey The encryption key of the MMKV instance (no more than 32 bytes).
|
|
748
|
+
* @param aes256 Use AES 256 key length.
|
|
749
|
+
* @throws RuntimeException if there's an runtime error.
|
|
750
|
+
*/
|
|
751
|
+
@NonNull
|
|
752
|
+
public static MMKV defaultMMKV(int mode, @Nullable String cryptKey, boolean aes256) throws RuntimeException {
|
|
753
|
+
if (rootDir == null) {
|
|
754
|
+
throw new IllegalStateException("You should Call MMKV.initialize() first.");
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
long handle = getDefaultMMKV(mode, cryptKey, aes256);
|
|
758
|
+
return checkProcessMode(handle, "DefaultMMKV", mode);
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
@NonNull
|
|
762
|
+
@Contract("_, _, _ -> new")
|
|
763
|
+
static MMKV checkProcessMode(long handle, String mmapID, int mode) throws RuntimeException {
|
|
764
|
+
if (handle == 0) {
|
|
765
|
+
throw new RuntimeException("Fail to create an MMKV instance [" + mmapID + "] in JNI");
|
|
766
|
+
}
|
|
767
|
+
if (!isProcessModeCheckerEnabled) {
|
|
768
|
+
return new MMKV(handle);
|
|
769
|
+
}
|
|
770
|
+
synchronized (checkedHandleSet) {
|
|
771
|
+
if (!checkedHandleSet.contains(handle)) {
|
|
772
|
+
if (!checkProcessMode(handle)) {
|
|
773
|
+
String message;
|
|
774
|
+
if (mode == SINGLE_PROCESS_MODE) {
|
|
775
|
+
message = "Opening a multi-process MMKV instance [" + mmapID + "] with SINGLE_PROCESS_MODE!";
|
|
776
|
+
} else {
|
|
777
|
+
message = "Opening an MMKV instance [" + mmapID + "] with MULTI_PROCESS_MODE, ";
|
|
778
|
+
message += "while it's already been opened with SINGLE_PROCESS_MODE by someone somewhere else!";
|
|
779
|
+
}
|
|
780
|
+
throw new IllegalArgumentException(message);
|
|
781
|
+
}
|
|
782
|
+
checkedHandleSet.add(handle);
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
return new MMKV(handle);
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
// Enable checkProcessMode() when initializing an MMKV instance, it's automatically enabled on debug build.
|
|
789
|
+
private static boolean isProcessModeCheckerEnabled = true;
|
|
790
|
+
|
|
791
|
+
/**
|
|
792
|
+
* Manually enable the process mode checker.
|
|
793
|
+
* By default, it's automatically enabled in DEBUG build, and disabled in RELEASE build.
|
|
794
|
+
* If it's enabled, MMKV will throw exceptions when an MMKV instance is created with mismatch process mode.
|
|
795
|
+
*/
|
|
796
|
+
public static void enableProcessModeChecker() {
|
|
797
|
+
synchronized (checkedHandleSet) {
|
|
798
|
+
isProcessModeCheckerEnabled = true;
|
|
799
|
+
}
|
|
800
|
+
enableDisableProcessMode(true);
|
|
801
|
+
Log.i("MMKV", "Enable checkProcessMode()");
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
/**
|
|
805
|
+
* Manually disable the process mode checker.
|
|
806
|
+
* By default, it's automatically enabled in DEBUG build, and disabled in RELEASE build.
|
|
807
|
+
* If it's enabled, MMKV will throw exceptions when an MMKV instance is created with mismatch process mode.
|
|
808
|
+
*/
|
|
809
|
+
public static void disableProcessModeChecker() {
|
|
810
|
+
synchronized (checkedHandleSet) {
|
|
811
|
+
isProcessModeCheckerEnabled = false;
|
|
812
|
+
}
|
|
813
|
+
enableDisableProcessMode(false);
|
|
814
|
+
Log.i("MMKV", "Disable checkProcessMode()");
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
/**
|
|
818
|
+
* @return The encryption key (no more than 16 bytes).
|
|
819
|
+
*/
|
|
820
|
+
@Nullable
|
|
821
|
+
public native String cryptKey();
|
|
822
|
+
|
|
823
|
+
/**
|
|
824
|
+
* Transform plain text into encrypted text, or vice versa by passing a null encryption key.
|
|
825
|
+
* You can also change existing crypt key with a different cryptKey.
|
|
826
|
+
*
|
|
827
|
+
* @param cryptKey The new encryption key (no more than 16 bytes).
|
|
828
|
+
* @return True if success, otherwise False.
|
|
829
|
+
*/
|
|
830
|
+
public boolean reKey(@Nullable String cryptKey) {
|
|
831
|
+
return doReKey(cryptKey, false);
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
/**
|
|
835
|
+
* Transform plain text into encrypted text, or vice versa by passing a null encryption key.
|
|
836
|
+
* You can also change existing crypt key with a different cryptKey.
|
|
837
|
+
*
|
|
838
|
+
* @param cryptKey The new encryption key (no more than 32 bytes).
|
|
839
|
+
* @param aes256 Use AES 256 key length
|
|
840
|
+
* @return True if success, otherwise False.
|
|
841
|
+
*/
|
|
842
|
+
public boolean reKey(@Nullable String cryptKey, boolean aes256) {
|
|
843
|
+
return doReKey(cryptKey, aes256);
|
|
844
|
+
}
|
|
845
|
+
private native boolean doReKey(@Nullable String cryptKey, boolean aes256);
|
|
846
|
+
|
|
847
|
+
/**
|
|
848
|
+
* Just reset the encryption key (will not encrypt or decrypt anything).
|
|
849
|
+
* Usually you should call this method after another process has {@link #reKey(String)} the multi-process MMKV instance.
|
|
850
|
+
*
|
|
851
|
+
* @param cryptKey The new encryption key (no more than 16 bytes).
|
|
852
|
+
*/
|
|
853
|
+
public void checkReSetCryptKey(@Nullable String cryptKey) {
|
|
854
|
+
doCheckReSetCryptKey(cryptKey, false);
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
/**
|
|
858
|
+
* Just reset the encryption key (will not encrypt or decrypt anything).
|
|
859
|
+
* Usually you should call this method after another process has {@link #reKey(String)} the multi-process MMKV instance.
|
|
860
|
+
*
|
|
861
|
+
* @param cryptKey The new encryption key (no more than 16 bytes).
|
|
862
|
+
* @param aes256 Use AES 256 key length
|
|
863
|
+
*/
|
|
864
|
+
public void checkReSetCryptKey(@Nullable String cryptKey, boolean aes256) {
|
|
865
|
+
doCheckReSetCryptKey(cryptKey, aes256);
|
|
866
|
+
}
|
|
867
|
+
private native void doCheckReSetCryptKey(@Nullable String cryptKey, boolean aes256);
|
|
868
|
+
|
|
869
|
+
/**
|
|
870
|
+
* @return The device's memory page size.
|
|
871
|
+
*/
|
|
872
|
+
public static native int pageSize();
|
|
873
|
+
|
|
874
|
+
/**
|
|
875
|
+
* @return The version of MMKV.
|
|
876
|
+
*/
|
|
877
|
+
public static native String version();
|
|
878
|
+
|
|
879
|
+
/**
|
|
880
|
+
* @return The unique ID of the MMKV instance.
|
|
881
|
+
*/
|
|
882
|
+
public native String mmapID();
|
|
883
|
+
|
|
884
|
+
/**
|
|
885
|
+
* Exclusively inter-process lock the MMKV instance.
|
|
886
|
+
* It will block and wait until it successfully locks the file.
|
|
887
|
+
* It will make no effect if the MMKV instance is created with {@link #SINGLE_PROCESS_MODE}.
|
|
888
|
+
*/
|
|
889
|
+
public native void lock();
|
|
890
|
+
|
|
891
|
+
/**
|
|
892
|
+
* Exclusively inter-process unlock the MMKV instance.
|
|
893
|
+
* It will make no effect if the MMKV instance is created with {@link #SINGLE_PROCESS_MODE}.
|
|
894
|
+
*/
|
|
895
|
+
public native void unlock();
|
|
896
|
+
|
|
897
|
+
/**
|
|
898
|
+
* Try exclusively inter-process lock the MMKV instance.
|
|
899
|
+
* It will not block if the file has already been locked by another process.
|
|
900
|
+
* It will make no effect if the MMKV instance is created with {@link #SINGLE_PROCESS_MODE}.
|
|
901
|
+
*
|
|
902
|
+
* @return True if successfully locked, otherwise return immediately with False.
|
|
903
|
+
*/
|
|
904
|
+
public native boolean tryLock();
|
|
905
|
+
|
|
906
|
+
public boolean encode(String key, boolean value) {
|
|
907
|
+
return encodeBool(nativeHandle, key, value);
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
/**
|
|
911
|
+
* Set value with customize expiration in seconds.
|
|
912
|
+
*
|
|
913
|
+
* @param expireDurationInSecond override the default duration, {@link #ExpireNever} (0) means never expire.
|
|
914
|
+
*/
|
|
915
|
+
public boolean encode(String key, boolean value, int expireDurationInSecond) {
|
|
916
|
+
return encodeBool_2(nativeHandle, key, value, expireDurationInSecond);
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
public boolean decodeBool(String key) {
|
|
920
|
+
return decodeBool(nativeHandle, key, false);
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
public boolean decodeBool(String key, boolean defaultValue) {
|
|
924
|
+
return decodeBool(nativeHandle, key, defaultValue);
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
public boolean encode(String key, int value) {
|
|
928
|
+
return encodeInt(nativeHandle, key, value);
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
/**
|
|
932
|
+
* Set value with customize expiration in seconds.
|
|
933
|
+
*
|
|
934
|
+
* @param expireDurationInSecond override the default duration, {@link #ExpireNever} (0) means never expire.
|
|
935
|
+
*/
|
|
936
|
+
public boolean encode(String key, int value, int expireDurationInSecond) {
|
|
937
|
+
return encodeInt_2(nativeHandle, key, value, expireDurationInSecond);
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
public int decodeInt(String key) {
|
|
941
|
+
return decodeInt(nativeHandle, key, 0);
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
public int decodeInt(String key, int defaultValue) {
|
|
945
|
+
return decodeInt(nativeHandle, key, defaultValue);
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
public boolean encode(String key, long value) {
|
|
949
|
+
return encodeLong(nativeHandle, key, value);
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
/**
|
|
953
|
+
* Set value with customize expiration in seconds.
|
|
954
|
+
*
|
|
955
|
+
* @param expireDurationInSecond override the default duration, {@link #ExpireNever} (0) means never expire.
|
|
956
|
+
*/
|
|
957
|
+
public boolean encode(String key, long value, int expireDurationInSecond) {
|
|
958
|
+
return encodeLong_2(nativeHandle, key, value, expireDurationInSecond);
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
public long decodeLong(String key) {
|
|
962
|
+
return decodeLong(nativeHandle, key, 0);
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
public long decodeLong(String key, long defaultValue) {
|
|
966
|
+
return decodeLong(nativeHandle, key, defaultValue);
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
public boolean encode(String key, float value) {
|
|
970
|
+
return encodeFloat(nativeHandle, key, value);
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
/**
|
|
974
|
+
* Set value with customize expiration in seconds.
|
|
975
|
+
*
|
|
976
|
+
* @param expireDurationInSecond override the default duration, {@link #ExpireNever} (0) means never expire.
|
|
977
|
+
*/
|
|
978
|
+
public boolean encode(String key, float value, int expireDurationInSecond) {
|
|
979
|
+
return encodeFloat_2(nativeHandle, key, value, expireDurationInSecond);
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
public float decodeFloat(String key) {
|
|
983
|
+
return decodeFloat(nativeHandle, key, 0);
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
public float decodeFloat(String key, float defaultValue) {
|
|
987
|
+
return decodeFloat(nativeHandle, key, defaultValue);
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
public boolean encode(String key, double value) {
|
|
991
|
+
return encodeDouble(nativeHandle, key, value);
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
/**
|
|
995
|
+
* Set value with customize expiration in seconds.
|
|
996
|
+
*
|
|
997
|
+
* @param expireDurationInSecond override the default duration, {@link #ExpireNever} (0) means never expire.
|
|
998
|
+
*/
|
|
999
|
+
public boolean encode(String key, double value, int expireDurationInSecond) {
|
|
1000
|
+
return encodeDouble_2(nativeHandle, key, value, expireDurationInSecond);
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
public double decodeDouble(String key) {
|
|
1004
|
+
return decodeDouble(nativeHandle, key, 0);
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
public double decodeDouble(String key, double defaultValue) {
|
|
1008
|
+
return decodeDouble(nativeHandle, key, defaultValue);
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
public boolean encode(String key, @Nullable String value) {
|
|
1012
|
+
return encodeString(nativeHandle, key, value);
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
/**
|
|
1016
|
+
* Set value with customize expiration in seconds.
|
|
1017
|
+
*
|
|
1018
|
+
* @param expireDurationInSecond override the default duration, {@link #ExpireNever} (0) means never expire.
|
|
1019
|
+
*/
|
|
1020
|
+
public boolean encode(String key, @Nullable String value, int expireDurationInSecond) {
|
|
1021
|
+
return encodeString_2(nativeHandle, key, value, expireDurationInSecond);
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
@Nullable
|
|
1025
|
+
public String decodeString(String key) {
|
|
1026
|
+
return decodeString(nativeHandle, key, null);
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
@Nullable
|
|
1030
|
+
public String decodeString(String key, @Nullable String defaultValue) {
|
|
1031
|
+
return decodeString(nativeHandle, key, defaultValue);
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
public boolean encode(String key, @Nullable Set<String> value) {
|
|
1035
|
+
return encodeSet(nativeHandle, key, (value == null) ? null : value.toArray(new String[0]));
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
/**
|
|
1039
|
+
* Set value with customize expiration in seconds.
|
|
1040
|
+
*
|
|
1041
|
+
* @param expireDurationInSecond override the default duration, {@link #ExpireNever} (0) means never expire.
|
|
1042
|
+
*/
|
|
1043
|
+
public boolean encode(String key, @Nullable Set<String> value, int expireDurationInSecond) {
|
|
1044
|
+
return encodeSet_2(nativeHandle, key, (value == null) ? null : value.toArray(new String[0]), expireDurationInSecond);
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
@Nullable
|
|
1048
|
+
public Set<String> decodeStringSet(String key) {
|
|
1049
|
+
return decodeStringSet(key, null);
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
@Nullable
|
|
1053
|
+
public Set<String> decodeStringSet(String key, @Nullable Set<String> defaultValue) {
|
|
1054
|
+
return decodeStringSet(key, defaultValue, HashSet.class);
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
@SuppressWarnings("unchecked")
|
|
1058
|
+
@Nullable
|
|
1059
|
+
public Set<String> decodeStringSet(String key, @Nullable Set<String> defaultValue, Class<? extends Set> cls) {
|
|
1060
|
+
String[] result = decodeStringSet(nativeHandle, key);
|
|
1061
|
+
if (result == null) {
|
|
1062
|
+
return defaultValue;
|
|
1063
|
+
}
|
|
1064
|
+
Set<String> a;
|
|
1065
|
+
try {
|
|
1066
|
+
a = cls.newInstance();
|
|
1067
|
+
} catch (IllegalAccessException | InstantiationException e) {
|
|
1068
|
+
return defaultValue;
|
|
1069
|
+
}
|
|
1070
|
+
a.addAll(Arrays.asList(result));
|
|
1071
|
+
return a;
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
public boolean encode(String key, @Nullable byte[] value) {
|
|
1075
|
+
return encodeBytes(nativeHandle, key, value);
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
/**
|
|
1079
|
+
* Set value with customize expiration in seconds.
|
|
1080
|
+
*
|
|
1081
|
+
* @param expireDurationInSecond override the default duration, {@link #ExpireNever} (0) means never expire.
|
|
1082
|
+
*/
|
|
1083
|
+
public boolean encode(String key, @Nullable byte[] value, int expireDurationInSecond) {
|
|
1084
|
+
return encodeBytes_2(nativeHandle, key, value, expireDurationInSecond);
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
@Nullable
|
|
1088
|
+
public byte[] decodeBytes(String key) {
|
|
1089
|
+
return decodeBytes(key, null);
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
@Nullable
|
|
1093
|
+
public byte[] decodeBytes(String key, @Nullable byte[] defaultValue) {
|
|
1094
|
+
byte[] ret = decodeBytes(nativeHandle, key);
|
|
1095
|
+
return (ret != null) ? ret : defaultValue;
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
private static final HashMap<String, Parcelable.Creator<?>> mCreators = new HashMap<>();
|
|
1099
|
+
|
|
1100
|
+
private byte[] getParcelableByte(@NonNull Parcelable value) {
|
|
1101
|
+
Parcel source = Parcel.obtain();
|
|
1102
|
+
value.writeToParcel(source, 0);
|
|
1103
|
+
byte[] bytes = source.marshall();
|
|
1104
|
+
source.recycle();
|
|
1105
|
+
return bytes;
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
public boolean encode(String key, @Nullable Parcelable value) {
|
|
1109
|
+
if (value == null) {
|
|
1110
|
+
return encodeBytes(nativeHandle, key, null);
|
|
1111
|
+
}
|
|
1112
|
+
byte[] bytes = getParcelableByte(value);
|
|
1113
|
+
return encodeBytes(nativeHandle, key, bytes);
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
/**
|
|
1117
|
+
* Set value with customize expiration in seconds.
|
|
1118
|
+
*
|
|
1119
|
+
* @param expireDurationInSecond override the default duration, {@link #ExpireNever} (0) means never expire.
|
|
1120
|
+
*/
|
|
1121
|
+
public boolean encode(String key, @Nullable Parcelable value, int expireDurationInSecond) {
|
|
1122
|
+
if (value == null) {
|
|
1123
|
+
return encodeBytes_2(nativeHandle, key, null, expireDurationInSecond);
|
|
1124
|
+
}
|
|
1125
|
+
byte[] bytes = getParcelableByte(value);
|
|
1126
|
+
return encodeBytes_2(nativeHandle, key, bytes, expireDurationInSecond);
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
@Nullable
|
|
1130
|
+
public <T extends Parcelable> T decodeParcelable(String key, Class<T> tClass) {
|
|
1131
|
+
return decodeParcelable(key, tClass, null);
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
@SuppressWarnings("unchecked")
|
|
1135
|
+
@Nullable
|
|
1136
|
+
public <T extends Parcelable> T decodeParcelable(String key, Class<T> tClass, @Nullable T defaultValue) {
|
|
1137
|
+
if (tClass == null) {
|
|
1138
|
+
return defaultValue;
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
byte[] bytes = decodeBytes(nativeHandle, key);
|
|
1142
|
+
if (bytes == null) {
|
|
1143
|
+
return defaultValue;
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1146
|
+
Parcel source = Parcel.obtain();
|
|
1147
|
+
source.unmarshall(bytes, 0, bytes.length);
|
|
1148
|
+
source.setDataPosition(0);
|
|
1149
|
+
|
|
1150
|
+
try {
|
|
1151
|
+
String name = tClass.toString();
|
|
1152
|
+
Parcelable.Creator<T> creator;
|
|
1153
|
+
synchronized (mCreators) {
|
|
1154
|
+
creator = (Parcelable.Creator<T>) mCreators.get(name);
|
|
1155
|
+
if (creator == null) {
|
|
1156
|
+
Field f = tClass.getField("CREATOR");
|
|
1157
|
+
creator = (Parcelable.Creator<T>) f.get(null);
|
|
1158
|
+
if (creator != null) {
|
|
1159
|
+
mCreators.put(name, creator);
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
if (creator != null) {
|
|
1164
|
+
return creator.createFromParcel(source);
|
|
1165
|
+
} else {
|
|
1166
|
+
throw new Exception("Parcelable protocol requires a "
|
|
1167
|
+
+ "non-null static Parcelable.Creator object called "
|
|
1168
|
+
+ "CREATOR on class " + name);
|
|
1169
|
+
}
|
|
1170
|
+
} catch (Exception e) {
|
|
1171
|
+
simpleLog(MMKVLogLevel.LevelError, e.toString());
|
|
1172
|
+
} finally {
|
|
1173
|
+
source.recycle();
|
|
1174
|
+
}
|
|
1175
|
+
return defaultValue;
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
/**
|
|
1179
|
+
* Get the actual size consumption of the key's value.
|
|
1180
|
+
* Note: might be a little bigger than value's length.
|
|
1181
|
+
*
|
|
1182
|
+
* @param key The key of the value.
|
|
1183
|
+
*/
|
|
1184
|
+
public int getValueSize(String key) {
|
|
1185
|
+
return valueSize(nativeHandle, key, false);
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
/**
|
|
1189
|
+
* Get the actual size of the key's value. String's length or byte[]'s length, etc.
|
|
1190
|
+
*
|
|
1191
|
+
* @param key The key of the value.
|
|
1192
|
+
*/
|
|
1193
|
+
public int getValueActualSize(String key) {
|
|
1194
|
+
return valueSize(nativeHandle, key, true);
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
/**
|
|
1198
|
+
* Check whether or not MMKV contains the key.
|
|
1199
|
+
*
|
|
1200
|
+
* @param key The key of the value.
|
|
1201
|
+
*/
|
|
1202
|
+
public boolean containsKey(String key) {
|
|
1203
|
+
return containsKey(nativeHandle, key);
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1206
|
+
/**
|
|
1207
|
+
* @return All the keys.
|
|
1208
|
+
*/
|
|
1209
|
+
@Nullable
|
|
1210
|
+
public String[] allKeys() {
|
|
1211
|
+
return allKeys(nativeHandle, false);
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
/**
|
|
1215
|
+
* @return All non-expired keys. Note that this call has costs.
|
|
1216
|
+
*/
|
|
1217
|
+
@Nullable
|
|
1218
|
+
public String[] allNonExpireKeys() {
|
|
1219
|
+
return allKeys(nativeHandle, true);
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
/**
|
|
1223
|
+
* @return The total count of all the keys.
|
|
1224
|
+
*/
|
|
1225
|
+
public long count() {
|
|
1226
|
+
return count(nativeHandle, false);
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
/**
|
|
1230
|
+
* @return The total count of all non-expired keys. Note that this call has costs.
|
|
1231
|
+
*/
|
|
1232
|
+
public long countNonExpiredKeys() {
|
|
1233
|
+
return count(nativeHandle, true);
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
/**
|
|
1237
|
+
* Get the size of the underlying file. Align to the disk block size, typically 4K for an Android device.
|
|
1238
|
+
*/
|
|
1239
|
+
public long totalSize() {
|
|
1240
|
+
return totalSize(nativeHandle);
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
/**
|
|
1244
|
+
* Get the actual used size of the MMKV instance.
|
|
1245
|
+
* This size might increase and decrease as MMKV doing insertion and full write back.
|
|
1246
|
+
*/
|
|
1247
|
+
public long actualSize() {
|
|
1248
|
+
return actualSize(nativeHandle);
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
public void removeValueForKey(String key) {
|
|
1252
|
+
removeValueForKey(nativeHandle, key);
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1255
|
+
/**
|
|
1256
|
+
* Batch remove some keys from the MMKV instance.
|
|
1257
|
+
*
|
|
1258
|
+
* @param arrKeys The keys to be removed.
|
|
1259
|
+
*/
|
|
1260
|
+
public native void removeValuesForKeys(String[] arrKeys);
|
|
1261
|
+
|
|
1262
|
+
/**
|
|
1263
|
+
* Clear all the key-values inside the MMKV instance.
|
|
1264
|
+
* The data file will be trimmed down to `pageSize`, and some sync operations will be called
|
|
1265
|
+
* If you do not want to trim the file, use {@link #clearAllWithKeepingSpace()} instead for better performance
|
|
1266
|
+
*/
|
|
1267
|
+
public native void clearAll();
|
|
1268
|
+
|
|
1269
|
+
/**
|
|
1270
|
+
* Faster {@link #clearAll()} implementation
|
|
1271
|
+
* The file size is kept as previous for later use
|
|
1272
|
+
*/
|
|
1273
|
+
public native void clearAllWithKeepingSpace();
|
|
1274
|
+
|
|
1275
|
+
/**
|
|
1276
|
+
* The {@link #totalSize()} of an MMKV instance won't reduce after deleting key-values,
|
|
1277
|
+
* call this method after lots of deleting if you care about disk usage.
|
|
1278
|
+
* Note that {@link #clearAll()} has a similar effect.
|
|
1279
|
+
*/
|
|
1280
|
+
public native void trim();
|
|
1281
|
+
|
|
1282
|
+
/**
|
|
1283
|
+
* import all key-value items from src
|
|
1284
|
+
* @return count of items imported
|
|
1285
|
+
*/
|
|
1286
|
+
public long importFrom(MMKV src) {
|
|
1287
|
+
return importFrom(nativeHandle, src.nativeHandle);
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
/**
|
|
1291
|
+
* Call this method if the MMKV instance is no longer needed in the near future.
|
|
1292
|
+
* Any subsequent call to any MMKV instances with the same ID is undefined behavior.
|
|
1293
|
+
*/
|
|
1294
|
+
public native void close();
|
|
1295
|
+
|
|
1296
|
+
/**
|
|
1297
|
+
* Clear memory cache of the MMKV instance.
|
|
1298
|
+
* You can call it on memory warning.
|
|
1299
|
+
* Any subsequent call to the MMKV instance will trigger all key-values loading from the file again.
|
|
1300
|
+
*/
|
|
1301
|
+
public native void clearMemoryCache();
|
|
1302
|
+
|
|
1303
|
+
/**
|
|
1304
|
+
* Save all mmap memory to file synchronously.
|
|
1305
|
+
* You don't need to call this, really, I mean it.
|
|
1306
|
+
* Unless you worry about the device running out of battery.
|
|
1307
|
+
*/
|
|
1308
|
+
public void sync() {
|
|
1309
|
+
sync(true);
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
/**
|
|
1313
|
+
* Save all mmap memory to file asynchronously.
|
|
1314
|
+
* No need to call this unless you worry about the device running out of battery.
|
|
1315
|
+
*/
|
|
1316
|
+
public void async() {
|
|
1317
|
+
sync(false);
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1320
|
+
private native void sync(boolean sync);
|
|
1321
|
+
|
|
1322
|
+
/**
|
|
1323
|
+
* Check whether the MMKV file is valid or not.
|
|
1324
|
+
* Note: Don't use this to check the existence of the instance, the result is undefined on nonexistent files.
|
|
1325
|
+
*/
|
|
1326
|
+
public static boolean isFileValid(String mmapID) {
|
|
1327
|
+
return isFileValid(mmapID, null);
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
/**
|
|
1331
|
+
* Check whether the MMKV file is valid or not on customize folder.
|
|
1332
|
+
*
|
|
1333
|
+
* @param mmapID The unique ID of the MMKV instance.
|
|
1334
|
+
* @param rootPath The folder of the MMKV instance, defaults to $(FilesDir)/mmkv.
|
|
1335
|
+
*/
|
|
1336
|
+
public static native boolean isFileValid(String mmapID, @Nullable String rootPath);
|
|
1337
|
+
|
|
1338
|
+
/**
|
|
1339
|
+
* remove the storage of the MMKV, including the data file & meta file (.crc)
|
|
1340
|
+
* Note: the existing instance (if any) will be closed & destroyed
|
|
1341
|
+
*
|
|
1342
|
+
* @param mmapID The unique ID of the MMKV instance.
|
|
1343
|
+
*/
|
|
1344
|
+
public static boolean removeStorage(String mmapID) {
|
|
1345
|
+
return removeStorage(mmapID, null);
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
/**
|
|
1349
|
+
* remove the storage of the MMKV, including the data file & meta file (.crc)
|
|
1350
|
+
* Note: the existing instance (if any) will be closed & destroyed
|
|
1351
|
+
*
|
|
1352
|
+
* @param mmapID The unique ID of the MMKV instance.
|
|
1353
|
+
* @param rootPath The folder of the MMKV instance, defaults to $(FilesDir)/mmkv.
|
|
1354
|
+
*/
|
|
1355
|
+
public static native boolean removeStorage(String mmapID, @Nullable String rootPath);
|
|
1356
|
+
|
|
1357
|
+
/**
|
|
1358
|
+
* check existence of the MMKV file
|
|
1359
|
+
* @param mmapID The unique ID of the MMKV instance.
|
|
1360
|
+
*/
|
|
1361
|
+
public static boolean checkExist(String mmapID) {
|
|
1362
|
+
return checkExist(mmapID, null);
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
/**
|
|
1366
|
+
* check existence of the MMKV file
|
|
1367
|
+
* @param mmapID The unique ID of the MMKV instance.
|
|
1368
|
+
* @param rootPath The folder of the MMKV instance, defaults to $(FilesDir)/mmkv.
|
|
1369
|
+
*/
|
|
1370
|
+
public static native boolean checkExist(String mmapID, @Nullable String rootPath);
|
|
1371
|
+
|
|
1372
|
+
/**
|
|
1373
|
+
* Atomically migrate all key-values from an existent SharedPreferences to the MMKV instance.
|
|
1374
|
+
*
|
|
1375
|
+
* @param preferences The SharedPreferences to import from.
|
|
1376
|
+
* @return The total count of key-values imported.
|
|
1377
|
+
*/
|
|
1378
|
+
@SuppressWarnings("unchecked")
|
|
1379
|
+
public int importFromSharedPreferences(@NonNull SharedPreferences preferences) {
|
|
1380
|
+
Map<String, ?> kvs = preferences.getAll();
|
|
1381
|
+
if (kvs == null || kvs.size() <= 0) {
|
|
1382
|
+
return 0;
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
for (Map.Entry<String, ?> entry : kvs.entrySet()) {
|
|
1386
|
+
String key = entry.getKey();
|
|
1387
|
+
Object value = entry.getValue();
|
|
1388
|
+
if (key == null || value == null) {
|
|
1389
|
+
continue;
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1392
|
+
if (value instanceof Boolean) {
|
|
1393
|
+
encodeBool(nativeHandle, key, (boolean) value);
|
|
1394
|
+
} else if (value instanceof Integer) {
|
|
1395
|
+
encodeInt(nativeHandle, key, (int) value);
|
|
1396
|
+
} else if (value instanceof Long) {
|
|
1397
|
+
encodeLong(nativeHandle, key, (long) value);
|
|
1398
|
+
} else if (value instanceof Float) {
|
|
1399
|
+
encodeFloat(nativeHandle, key, (float) value);
|
|
1400
|
+
} else if (value instanceof Double) {
|
|
1401
|
+
encodeDouble(nativeHandle, key, (double) value);
|
|
1402
|
+
} else if (value instanceof String) {
|
|
1403
|
+
encodeString(nativeHandle, key, (String) value);
|
|
1404
|
+
} else if (value instanceof Set) {
|
|
1405
|
+
encode(key, (Set<String>) value);
|
|
1406
|
+
} else {
|
|
1407
|
+
simpleLog(MMKVLogLevel.LevelError, "unknown type: " + value.getClass());
|
|
1408
|
+
}
|
|
1409
|
+
}
|
|
1410
|
+
return kvs.size();
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
/**
|
|
1414
|
+
* backup one MMKV instance to dstDir
|
|
1415
|
+
*
|
|
1416
|
+
* @param mmapID the MMKV ID to backup
|
|
1417
|
+
* @param rootPath the customize root path of the MMKV, if null then backup from the root dir of MMKV
|
|
1418
|
+
* @param dstDir the backup destination directory
|
|
1419
|
+
*/
|
|
1420
|
+
public static native boolean backupOneToDirectory(String mmapID, String dstDir, @Nullable String rootPath);
|
|
1421
|
+
|
|
1422
|
+
/**
|
|
1423
|
+
* restore one MMKV instance from srcDir
|
|
1424
|
+
*
|
|
1425
|
+
* @param mmapID the MMKV ID to restore
|
|
1426
|
+
* @param srcDir the restore source directory
|
|
1427
|
+
* @param rootPath the customize root path of the MMKV, if null then restore to the root dir of MMKV
|
|
1428
|
+
*/
|
|
1429
|
+
public static native boolean restoreOneMMKVFromDirectory(String mmapID, String srcDir, @Nullable String rootPath);
|
|
1430
|
+
|
|
1431
|
+
/**
|
|
1432
|
+
* backup all MMKV instance from default root dir to dstDir
|
|
1433
|
+
*
|
|
1434
|
+
* @param dstDir the backup destination directory
|
|
1435
|
+
* @return count of MMKV successfully backuped
|
|
1436
|
+
*/
|
|
1437
|
+
public static native long backupAllToDirectory(String dstDir);
|
|
1438
|
+
|
|
1439
|
+
/**
|
|
1440
|
+
* restore all MMKV instance from srcDir to default root dir
|
|
1441
|
+
*
|
|
1442
|
+
* @param srcDir the restore source directory
|
|
1443
|
+
* @return count of MMKV successfully restored
|
|
1444
|
+
*/
|
|
1445
|
+
public static native long restoreAllFromDirectory(String srcDir);
|
|
1446
|
+
|
|
1447
|
+
// TODO: we can't have these functionality because we can't know for sure
|
|
1448
|
+
// that each instance inside NameSpace has been upgraded successfully or not.
|
|
1449
|
+
// The workaround is to manually call backup/restore on each instance of NameSpace.
|
|
1450
|
+
// /**
|
|
1451
|
+
// * backup all MMKV instance from srcDir to dstDir
|
|
1452
|
+
// *
|
|
1453
|
+
// * @param dstDir the backup destination directory
|
|
1454
|
+
// * @param srcDir the backup source directory
|
|
1455
|
+
// * @return count of MMKV successfully backuped
|
|
1456
|
+
// */
|
|
1457
|
+
// public static native long backupAllToDirectory(String dstDir, String srcDir);
|
|
1458
|
+
//
|
|
1459
|
+
// /**
|
|
1460
|
+
// * restore all MMKV instance from srcDir to dstDir
|
|
1461
|
+
// *
|
|
1462
|
+
// * @param srcDir the restore source directory
|
|
1463
|
+
// * @param dstDir the restore destination directory
|
|
1464
|
+
// * @return count of MMKV successfully restored
|
|
1465
|
+
// */
|
|
1466
|
+
// public static native long restoreAllFromDirectory(String srcDir, String dstDir);
|
|
1467
|
+
|
|
1468
|
+
public static final int ExpireNever = 0;
|
|
1469
|
+
public static final int ExpireInMinute = 60;
|
|
1470
|
+
public static final int ExpireInHour = 60 * 60;
|
|
1471
|
+
public static final int ExpireInDay = 24 * 60 * 60;
|
|
1472
|
+
public static final int ExpireInMonth = 30 * 24 * 60 * 60;
|
|
1473
|
+
public static final int ExpireInYear = 365 * 30 * 24 * 60 * 60;
|
|
1474
|
+
|
|
1475
|
+
/**
|
|
1476
|
+
* Enable auto key expiration. This is a upgrade operation, the file format will change.
|
|
1477
|
+
* And the file won't be accessed correctly by older version (v1.2.16) of MMKV.
|
|
1478
|
+
* NOTICE: enableCompareBeforeSet will be invalid when Expiration is on
|
|
1479
|
+
* @param expireDurationInSecond the expire duration for all keys, {@link #ExpireNever} (0) means no default duration (aka each key will have it's own expire date)
|
|
1480
|
+
*/
|
|
1481
|
+
public native boolean enableAutoKeyExpire(int expireDurationInSecond);
|
|
1482
|
+
|
|
1483
|
+
/**
|
|
1484
|
+
* Disable auto key expiration. This is a downgrade operation.
|
|
1485
|
+
*/
|
|
1486
|
+
public native boolean disableAutoKeyExpire();
|
|
1487
|
+
|
|
1488
|
+
/**
|
|
1489
|
+
* Enable data compare before set, for better performance.
|
|
1490
|
+
* If data for key seldom changes, use it.
|
|
1491
|
+
* When encryption or expiration is on, compare-before-set will be invalid.
|
|
1492
|
+
* For encryption, compare operation must decrypt data which is time consuming.
|
|
1493
|
+
* For expiration, compare is useless because in most cases the expiration time changes every time.
|
|
1494
|
+
*/
|
|
1495
|
+
public void enableCompareBeforeSet() {
|
|
1496
|
+
if (isExpirationEnabled()) {
|
|
1497
|
+
Log.e("MMKV", "enableCompareBeforeSet is invalid when Expiration is on");
|
|
1498
|
+
if (BuildConfig.DEBUG) {
|
|
1499
|
+
throw new RuntimeException("enableCompareBeforeSet is invalid when Expiration is on");
|
|
1500
|
+
}
|
|
1501
|
+
}
|
|
1502
|
+
if (isEncryptionEnabled()) {
|
|
1503
|
+
Log.e("MMKV", "enableCompareBeforeSet is invalid when key encryption is on");
|
|
1504
|
+
if (BuildConfig.DEBUG) {
|
|
1505
|
+
throw new RuntimeException("enableCompareBeforeSet is invalid when Expiration is on");
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
nativeEnableCompareBeforeSet();
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
@FastNative
|
|
1512
|
+
private native void nativeEnableCompareBeforeSet();
|
|
1513
|
+
|
|
1514
|
+
/**
|
|
1515
|
+
* Disable data compare before set
|
|
1516
|
+
* disabled at default
|
|
1517
|
+
*/
|
|
1518
|
+
public native void disableCompareBeforeSet();
|
|
1519
|
+
|
|
1520
|
+
/**
|
|
1521
|
+
* Intentionally Not Supported. Because MMKV does type-eraser inside to get better performance.
|
|
1522
|
+
*/
|
|
1523
|
+
@Override
|
|
1524
|
+
public Map<String, ?> getAll() {
|
|
1525
|
+
throw new UnsupportedOperationException(
|
|
1526
|
+
"Intentionally Not Supported. Use allKeys() instead, getAll() not implement because type-erasure inside mmkv");
|
|
1527
|
+
}
|
|
1528
|
+
|
|
1529
|
+
@Nullable
|
|
1530
|
+
@Override
|
|
1531
|
+
public String getString(String key, @Nullable String defValue) {
|
|
1532
|
+
return decodeString(nativeHandle, key, defValue);
|
|
1533
|
+
}
|
|
1534
|
+
|
|
1535
|
+
@Override
|
|
1536
|
+
public Editor putString(String key, @Nullable String value) {
|
|
1537
|
+
encodeString(nativeHandle, key, value);
|
|
1538
|
+
return this;
|
|
1539
|
+
}
|
|
1540
|
+
|
|
1541
|
+
public Editor putString(String key, @Nullable String value, int expireDurationInSecond) {
|
|
1542
|
+
encodeString_2(nativeHandle, key, value, expireDurationInSecond);
|
|
1543
|
+
return this;
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
@Nullable
|
|
1547
|
+
@Override
|
|
1548
|
+
public Set<String> getStringSet(String key, @Nullable Set<String> defValues) {
|
|
1549
|
+
return decodeStringSet(key, defValues);
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
@Override
|
|
1553
|
+
public Editor putStringSet(String key, @Nullable Set<String> values) {
|
|
1554
|
+
encode(key, values);
|
|
1555
|
+
return this;
|
|
1556
|
+
}
|
|
1557
|
+
|
|
1558
|
+
public Editor putStringSet(String key, @Nullable Set<String> values, int expireDurationInSecond) {
|
|
1559
|
+
encode(key, values, expireDurationInSecond);
|
|
1560
|
+
return this;
|
|
1561
|
+
}
|
|
1562
|
+
|
|
1563
|
+
public Editor putBytes(String key, @Nullable byte[] bytes) {
|
|
1564
|
+
encode(key, bytes);
|
|
1565
|
+
return this;
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1568
|
+
public Editor putBytes(String key, @Nullable byte[] bytes, int expireDurationInSecond) {
|
|
1569
|
+
encode(key, bytes, expireDurationInSecond);
|
|
1570
|
+
return this;
|
|
1571
|
+
}
|
|
1572
|
+
|
|
1573
|
+
public byte[] getBytes(String key, @Nullable byte[] defValue) {
|
|
1574
|
+
return decodeBytes(key, defValue);
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
@Override
|
|
1578
|
+
public int getInt(String key, int defValue) {
|
|
1579
|
+
return decodeInt(nativeHandle, key, defValue);
|
|
1580
|
+
}
|
|
1581
|
+
|
|
1582
|
+
@Override
|
|
1583
|
+
public Editor putInt(String key, int value) {
|
|
1584
|
+
encodeInt(nativeHandle, key, value);
|
|
1585
|
+
return this;
|
|
1586
|
+
}
|
|
1587
|
+
|
|
1588
|
+
public Editor putInt(String key, int value, int expireDurationInSecond) {
|
|
1589
|
+
encodeInt_2(nativeHandle, key, value, expireDurationInSecond);
|
|
1590
|
+
return this;
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
@Override
|
|
1594
|
+
public long getLong(String key, long defValue) {
|
|
1595
|
+
return decodeLong(nativeHandle, key, defValue);
|
|
1596
|
+
}
|
|
1597
|
+
|
|
1598
|
+
@Override
|
|
1599
|
+
public Editor putLong(String key, long value) {
|
|
1600
|
+
encodeLong(nativeHandle, key, value);
|
|
1601
|
+
return this;
|
|
1602
|
+
}
|
|
1603
|
+
|
|
1604
|
+
public Editor putLong(String key, long value, int expireDurationInSecond) {
|
|
1605
|
+
encodeLong_2(nativeHandle, key, value, expireDurationInSecond);
|
|
1606
|
+
return this;
|
|
1607
|
+
}
|
|
1608
|
+
|
|
1609
|
+
@Override
|
|
1610
|
+
public float getFloat(String key, float defValue) {
|
|
1611
|
+
return decodeFloat(nativeHandle, key, defValue);
|
|
1612
|
+
}
|
|
1613
|
+
|
|
1614
|
+
@Override
|
|
1615
|
+
public Editor putFloat(String key, float value) {
|
|
1616
|
+
encodeFloat(nativeHandle, key, value);
|
|
1617
|
+
return this;
|
|
1618
|
+
}
|
|
1619
|
+
|
|
1620
|
+
public Editor putFloat(String key, float value, int expireDurationInSecond) {
|
|
1621
|
+
encodeFloat_2(nativeHandle, key, value, expireDurationInSecond);
|
|
1622
|
+
return this;
|
|
1623
|
+
}
|
|
1624
|
+
|
|
1625
|
+
@Override
|
|
1626
|
+
public boolean getBoolean(String key, boolean defValue) {
|
|
1627
|
+
return decodeBool(nativeHandle, key, defValue);
|
|
1628
|
+
}
|
|
1629
|
+
|
|
1630
|
+
@Override
|
|
1631
|
+
public Editor putBoolean(String key, boolean value) {
|
|
1632
|
+
encodeBool(nativeHandle, key, value);
|
|
1633
|
+
return this;
|
|
1634
|
+
}
|
|
1635
|
+
|
|
1636
|
+
public Editor putBoolean(String key, boolean value, int expireDurationInSecond) {
|
|
1637
|
+
encodeBool_2(nativeHandle, key, value, expireDurationInSecond);
|
|
1638
|
+
return this;
|
|
1639
|
+
}
|
|
1640
|
+
|
|
1641
|
+
@Override
|
|
1642
|
+
public Editor remove(String key) {
|
|
1643
|
+
removeValueForKey(key);
|
|
1644
|
+
return this;
|
|
1645
|
+
}
|
|
1646
|
+
|
|
1647
|
+
/**
|
|
1648
|
+
* {@link #clearAll()}
|
|
1649
|
+
*/
|
|
1650
|
+
@Override
|
|
1651
|
+
public Editor clear() {
|
|
1652
|
+
clearAll();
|
|
1653
|
+
return this;
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1656
|
+
/**
|
|
1657
|
+
* @deprecated This method is only for compatibility purpose. You should remove all the calls after migration to MMKV.
|
|
1658
|
+
* MMKV doesn't rely on commit() to save data to file.
|
|
1659
|
+
* If you really worry about losing battery and data corruption, call {@link #async()} or {@link #sync()} instead.
|
|
1660
|
+
*/
|
|
1661
|
+
@Override
|
|
1662
|
+
@Deprecated
|
|
1663
|
+
public boolean commit() {
|
|
1664
|
+
sync(true);
|
|
1665
|
+
return true;
|
|
1666
|
+
}
|
|
1667
|
+
|
|
1668
|
+
/**
|
|
1669
|
+
* @deprecated This method is only for compatibility purpose. You should remove all the calls after migration to MMKV.
|
|
1670
|
+
* MMKV doesn't rely on apply() to save data to file.
|
|
1671
|
+
* If you really worry about losing battery and data corruption, call {@link #async()} instead.
|
|
1672
|
+
*/
|
|
1673
|
+
@Override
|
|
1674
|
+
@Deprecated
|
|
1675
|
+
public void apply() {
|
|
1676
|
+
sync(false);
|
|
1677
|
+
}
|
|
1678
|
+
|
|
1679
|
+
@Override
|
|
1680
|
+
public boolean contains(String key) {
|
|
1681
|
+
return containsKey(key);
|
|
1682
|
+
}
|
|
1683
|
+
|
|
1684
|
+
@Override
|
|
1685
|
+
public Editor edit() {
|
|
1686
|
+
return this;
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1689
|
+
/**
|
|
1690
|
+
* Intentionally Not Supported by MMKV. We believe it's better not for a storage framework to notify the change of data.
|
|
1691
|
+
* Check {@link #registerContentChangeNotify} for a potential replacement on inter-process scene.
|
|
1692
|
+
*/
|
|
1693
|
+
@Override
|
|
1694
|
+
public void registerOnSharedPreferenceChangeListener(OnSharedPreferenceChangeListener listener) {
|
|
1695
|
+
throw new UnsupportedOperationException("Intentionally Not implement in MMKV");
|
|
1696
|
+
}
|
|
1697
|
+
|
|
1698
|
+
/**
|
|
1699
|
+
* Intentionally Not Supported by MMKV. We believe it's better not for a storage framework to notify the change of data.
|
|
1700
|
+
*/
|
|
1701
|
+
@Override
|
|
1702
|
+
public void unregisterOnSharedPreferenceChangeListener(OnSharedPreferenceChangeListener listener) {
|
|
1703
|
+
throw new UnsupportedOperationException("Intentionally Not implement in MMKV");
|
|
1704
|
+
}
|
|
1705
|
+
|
|
1706
|
+
/**
|
|
1707
|
+
* Get an ashmem MMKV instance that has been initiated by another process.
|
|
1708
|
+
* Normally you should just call {@link #mmkvWithAshmemID(Context, String, int, int, String)} instead.
|
|
1709
|
+
*
|
|
1710
|
+
* @param mmapID The unique ID of the MMKV instance.
|
|
1711
|
+
* @param fd The file descriptor of the ashmem of the MMKV file, transferred from another process by binder.
|
|
1712
|
+
* @param metaFD The file descriptor of the ashmem of the MMKV crc file, transferred from another process by binder.
|
|
1713
|
+
* @param cryptKey The encryption key of the MMKV instance (no more than 16 bytes).
|
|
1714
|
+
* @throws RuntimeException If any failure in JNI or runtime.
|
|
1715
|
+
*/
|
|
1716
|
+
// Parcelable
|
|
1717
|
+
@NonNull
|
|
1718
|
+
@Contract("_, _, _, _ -> new")
|
|
1719
|
+
public static MMKV mmkvWithAshmemFD(String mmapID, int fd, int metaFD, String cryptKey) throws RuntimeException {
|
|
1720
|
+
return mmkvWithAshmemFD(mmapID, fd, metaFD, cryptKey, false);
|
|
1721
|
+
}
|
|
1722
|
+
|
|
1723
|
+
/**
|
|
1724
|
+
* Get an ashmem MMKV instance that has been initiated by another process.
|
|
1725
|
+
* Normally you should just call {@link #mmkvWithAshmemID(Context, String, int, int, String)} instead.
|
|
1726
|
+
*
|
|
1727
|
+
* @param mmapID The unique ID of the MMKV instance.
|
|
1728
|
+
* @param fd The file descriptor of the ashmem of the MMKV file, transferred from another process by binder.
|
|
1729
|
+
* @param metaFD The file descriptor of the ashmem of the MMKV crc file, transferred from another process by binder.
|
|
1730
|
+
* @param cryptKey The encryption key of the MMKV instance (no more than 32 bytes).
|
|
1731
|
+
* @param aes256 Use AES 256 key length.
|
|
1732
|
+
* @throws RuntimeException If any failure in JNI or runtime.
|
|
1733
|
+
*/
|
|
1734
|
+
// Parcelable
|
|
1735
|
+
@NonNull
|
|
1736
|
+
@Contract("_, _, _, _, _ -> new")
|
|
1737
|
+
public static MMKV mmkvWithAshmemFD(String mmapID, int fd, int metaFD, String cryptKey, boolean aes256) throws RuntimeException {
|
|
1738
|
+
long handle = getMMKVWithAshmemFD(mmapID, fd, metaFD, cryptKey, aes256);
|
|
1739
|
+
if (handle == 0) {
|
|
1740
|
+
throw new RuntimeException("Fail to create an ashmem MMKV instance [" + mmapID + "] in JNI");
|
|
1741
|
+
}
|
|
1742
|
+
return new MMKV(handle);
|
|
1743
|
+
}
|
|
1744
|
+
|
|
1745
|
+
/**
|
|
1746
|
+
* @return The file descriptor of the ashmem of the MMKV file.
|
|
1747
|
+
*/
|
|
1748
|
+
public native int ashmemFD();
|
|
1749
|
+
|
|
1750
|
+
/**
|
|
1751
|
+
* @return The file descriptor of the ashmem of the MMKV crc file.
|
|
1752
|
+
*/
|
|
1753
|
+
public native int ashmemMetaFD();
|
|
1754
|
+
|
|
1755
|
+
/**
|
|
1756
|
+
* Create an native buffer, whose underlying memory can be directly transferred to another JNI method.
|
|
1757
|
+
* Avoiding unnecessary JNI boxing and unboxing.
|
|
1758
|
+
* An NativeBuffer must be manually {@link #destroyNativeBuffer} to avoid memory leak.
|
|
1759
|
+
*
|
|
1760
|
+
* @param size The size of the underlying memory.
|
|
1761
|
+
*/
|
|
1762
|
+
@Nullable
|
|
1763
|
+
public static NativeBuffer createNativeBuffer(int size) {
|
|
1764
|
+
long pointer = createNB(size);
|
|
1765
|
+
if (pointer == 0) {
|
|
1766
|
+
return null;
|
|
1767
|
+
}
|
|
1768
|
+
return new NativeBuffer(pointer, size);
|
|
1769
|
+
}
|
|
1770
|
+
|
|
1771
|
+
/**
|
|
1772
|
+
* Destroy the native buffer. An NativeBuffer must be manually destroy to avoid memory leak.
|
|
1773
|
+
*/
|
|
1774
|
+
public static void destroyNativeBuffer(@NonNull NativeBuffer buffer) {
|
|
1775
|
+
destroyNB(buffer.pointer, buffer.size);
|
|
1776
|
+
}
|
|
1777
|
+
|
|
1778
|
+
/**
|
|
1779
|
+
* Write the value of the key to the native buffer.
|
|
1780
|
+
*
|
|
1781
|
+
* @return The size written. Return -1 on any error.
|
|
1782
|
+
*/
|
|
1783
|
+
public int writeValueToNativeBuffer(String key, @NonNull NativeBuffer buffer) {
|
|
1784
|
+
return writeValueToNB(nativeHandle, key, buffer.pointer, buffer.size);
|
|
1785
|
+
}
|
|
1786
|
+
|
|
1787
|
+
// callback handler
|
|
1788
|
+
private static MMKVHandler gCallbackHandler = null;
|
|
1789
|
+
private static boolean gWantLogReDirecting = false;
|
|
1790
|
+
|
|
1791
|
+
/**
|
|
1792
|
+
* Register a handler for MMKV log redirecting, and error handling.
|
|
1793
|
+
*
|
|
1794
|
+
* @deprecated This method is deprecated.
|
|
1795
|
+
* Use the {@link #initialize(Context, String, LibLoader, MMKVLogLevel, MMKVHandler)} method instead.
|
|
1796
|
+
*/
|
|
1797
|
+
public static void registerHandler(MMKVHandler handler) {
|
|
1798
|
+
gCallbackHandler = handler;
|
|
1799
|
+
gWantLogReDirecting = gCallbackHandler.wantLogRedirecting();
|
|
1800
|
+
long nativeLogHandler = gCallbackHandler.getNativeLogHandler();
|
|
1801
|
+
setCallbackHandler(gWantLogReDirecting, true, nativeLogHandler);
|
|
1802
|
+
}
|
|
1803
|
+
|
|
1804
|
+
/**
|
|
1805
|
+
* Unregister the handler for MMKV.
|
|
1806
|
+
*/
|
|
1807
|
+
public static void unregisterHandler() {
|
|
1808
|
+
gCallbackHandler = null;
|
|
1809
|
+
|
|
1810
|
+
setCallbackHandler(false, false, 0);
|
|
1811
|
+
gWantLogReDirecting = false;
|
|
1812
|
+
}
|
|
1813
|
+
|
|
1814
|
+
private static int onMMKVCRCCheckFail(String mmapID) {
|
|
1815
|
+
MMKVRecoverStrategic strategic = MMKVRecoverStrategic.OnErrorDiscard;
|
|
1816
|
+
MMKVHandler handler = gCallbackHandler;
|
|
1817
|
+
if (handler != null) {
|
|
1818
|
+
strategic = handler.onMMKVCRCCheckFail(mmapID);
|
|
1819
|
+
}
|
|
1820
|
+
simpleLog(MMKVLogLevel.LevelInfo, "Recover strategic for " + mmapID + " is " + strategic);
|
|
1821
|
+
Integer value = recoverIndex.get(strategic);
|
|
1822
|
+
return (value == null) ? 0 : value;
|
|
1823
|
+
}
|
|
1824
|
+
|
|
1825
|
+
private static int onMMKVFileLengthError(String mmapID) {
|
|
1826
|
+
MMKVRecoverStrategic strategic = MMKVRecoverStrategic.OnErrorDiscard;
|
|
1827
|
+
MMKVHandler handler = gCallbackHandler;
|
|
1828
|
+
if (handler != null) {
|
|
1829
|
+
strategic = handler.onMMKVFileLengthError(mmapID);
|
|
1830
|
+
}
|
|
1831
|
+
simpleLog(MMKVLogLevel.LevelInfo, "Recover strategic for " + mmapID + " is " + strategic);
|
|
1832
|
+
Integer value = recoverIndex.get(strategic);
|
|
1833
|
+
return (value == null) ? 0 : value;
|
|
1834
|
+
}
|
|
1835
|
+
|
|
1836
|
+
private static void mmkvLogImp(int level, String file, int line, String function, String message) {
|
|
1837
|
+
MMKVHandler handler = gCallbackHandler;
|
|
1838
|
+
if (handler != null && gWantLogReDirecting) {
|
|
1839
|
+
handler.mmkvLog(index2LogLevel[level], file, line, function, message);
|
|
1840
|
+
} else {
|
|
1841
|
+
switch (index2LogLevel[level]) {
|
|
1842
|
+
case LevelDebug:
|
|
1843
|
+
Log.d("MMKV", message);
|
|
1844
|
+
break;
|
|
1845
|
+
case LevelInfo:
|
|
1846
|
+
Log.i("MMKV", message);
|
|
1847
|
+
break;
|
|
1848
|
+
case LevelWarning:
|
|
1849
|
+
Log.w("MMKV", message);
|
|
1850
|
+
break;
|
|
1851
|
+
case LevelError:
|
|
1852
|
+
Log.e("MMKV", message);
|
|
1853
|
+
break;
|
|
1854
|
+
case LevelNone:
|
|
1855
|
+
break;
|
|
1856
|
+
}
|
|
1857
|
+
}
|
|
1858
|
+
}
|
|
1859
|
+
|
|
1860
|
+
private static void simpleLog(MMKVLogLevel level, String message) {
|
|
1861
|
+
StackTraceElement[] stacktrace = Thread.currentThread().getStackTrace();
|
|
1862
|
+
StackTraceElement e = stacktrace[stacktrace.length - 1];
|
|
1863
|
+
Integer i = logLevel2Index.get(level);
|
|
1864
|
+
int intLevel = (i == null) ? 0 : i;
|
|
1865
|
+
mmkvLogImp(intLevel, e.getFileName(), e.getLineNumber(), e.getMethodName(), message);
|
|
1866
|
+
}
|
|
1867
|
+
|
|
1868
|
+
// content change notification of other process
|
|
1869
|
+
// trigger by getXXX() or setXXX() or checkContentChangedByOuterProcess()
|
|
1870
|
+
private static MMKVContentChangeNotification gContentChangeNotify;
|
|
1871
|
+
|
|
1872
|
+
/**
|
|
1873
|
+
* Register for MMKV inter-process content change notification.
|
|
1874
|
+
* The notification will trigger only when any method is manually called on the MMKV instance.
|
|
1875
|
+
* For example {@link #checkContentChangedByOuterProcess()}.
|
|
1876
|
+
*
|
|
1877
|
+
* @param notify The notification handler.
|
|
1878
|
+
*/
|
|
1879
|
+
public static void registerContentChangeNotify(MMKVContentChangeNotification notify) {
|
|
1880
|
+
gContentChangeNotify = notify;
|
|
1881
|
+
setWantsContentChangeNotify(gContentChangeNotify != null);
|
|
1882
|
+
}
|
|
1883
|
+
|
|
1884
|
+
/**
|
|
1885
|
+
* Unregister for MMKV inter-process content change notification.
|
|
1886
|
+
*/
|
|
1887
|
+
public static void unregisterContentChangeNotify() {
|
|
1888
|
+
gContentChangeNotify = null;
|
|
1889
|
+
setWantsContentChangeNotify(false);
|
|
1890
|
+
}
|
|
1891
|
+
|
|
1892
|
+
private static void onContentChangedByOuterProcess(String mmapID) {
|
|
1893
|
+
if (gContentChangeNotify != null) {
|
|
1894
|
+
gContentChangeNotify.onContentChangedByOuterProcess(mmapID);
|
|
1895
|
+
}
|
|
1896
|
+
}
|
|
1897
|
+
|
|
1898
|
+
private static native void setWantsContentChangeNotify(boolean needsNotify);
|
|
1899
|
+
|
|
1900
|
+
/**
|
|
1901
|
+
* Check inter-process content change manually.
|
|
1902
|
+
*/
|
|
1903
|
+
public native void checkContentChangedByOuterProcess();
|
|
1904
|
+
|
|
1905
|
+
/**
|
|
1906
|
+
* Check if this instance is in multi-process mode.
|
|
1907
|
+
*/
|
|
1908
|
+
public native boolean isMultiProcess();
|
|
1909
|
+
|
|
1910
|
+
/**
|
|
1911
|
+
* Check if this instance is in read-only mode.
|
|
1912
|
+
*/
|
|
1913
|
+
public native boolean isReadOnly();
|
|
1914
|
+
|
|
1915
|
+
// jni
|
|
1916
|
+
private final long nativeHandle;
|
|
1917
|
+
|
|
1918
|
+
private MMKV(long handle) {
|
|
1919
|
+
nativeHandle = handle;
|
|
1920
|
+
}
|
|
1921
|
+
|
|
1922
|
+
private static native void jniInitialize(String rootDir, String cacheDir, int level, boolean wantLogReDirecting, boolean hasCallback, long nativeHandler);
|
|
1923
|
+
|
|
1924
|
+
native static long
|
|
1925
|
+
getMMKVWithID(String mmapID, int mode, @Nullable String cryptKey, @Nullable String rootPath,
|
|
1926
|
+
long expectedCapacity, boolean aes256);
|
|
1927
|
+
|
|
1928
|
+
private native static long getMMKVWithIDAndSize(String mmapID, int size, int mode, @Nullable String cryptKey, boolean aes256);
|
|
1929
|
+
|
|
1930
|
+
private native static long getDefaultMMKV(int mode, @Nullable String cryptKey, boolean aes256);
|
|
1931
|
+
|
|
1932
|
+
private native static long getMMKVWithAshmemFD(String mmapID, int fd, int metaFD, @Nullable String cryptKey, boolean aes256);
|
|
1933
|
+
|
|
1934
|
+
private native boolean encodeBool(long handle, String key, boolean value);
|
|
1935
|
+
|
|
1936
|
+
private native boolean encodeBool_2(long handle, String key, boolean value, int expireDurationInSecond);
|
|
1937
|
+
|
|
1938
|
+
private native boolean decodeBool(long handle, String key, boolean defaultValue);
|
|
1939
|
+
|
|
1940
|
+
private native boolean encodeInt(long handle, String key, int value);
|
|
1941
|
+
|
|
1942
|
+
private native boolean encodeInt_2(long handle, String key, int value, int expireDurationInSecond);
|
|
1943
|
+
|
|
1944
|
+
private native int decodeInt(long handle, String key, int defaultValue);
|
|
1945
|
+
|
|
1946
|
+
private native boolean encodeLong(long handle, String key, long value);
|
|
1947
|
+
|
|
1948
|
+
private native boolean encodeLong_2(long handle, String key, long value, int expireDurationInSecond);
|
|
1949
|
+
|
|
1950
|
+
private native long decodeLong(long handle, String key, long defaultValue);
|
|
1951
|
+
|
|
1952
|
+
private native boolean encodeFloat(long handle, String key, float value);
|
|
1953
|
+
|
|
1954
|
+
private native boolean encodeFloat_2(long handle, String key, float value, int expireDurationInSecond);
|
|
1955
|
+
|
|
1956
|
+
private native float decodeFloat(long handle, String key, float defaultValue);
|
|
1957
|
+
|
|
1958
|
+
private native boolean encodeDouble(long handle, String key, double value);
|
|
1959
|
+
|
|
1960
|
+
private native boolean encodeDouble_2(long handle, String key, double value, int expireDurationInSecond);
|
|
1961
|
+
|
|
1962
|
+
private native double decodeDouble(long handle, String key, double defaultValue);
|
|
1963
|
+
|
|
1964
|
+
private native boolean encodeString(long handle, String key, @Nullable String value);
|
|
1965
|
+
|
|
1966
|
+
private native boolean encodeString_2(long handle, String key, @Nullable String value, int expireDurationInSecond);
|
|
1967
|
+
|
|
1968
|
+
@Nullable
|
|
1969
|
+
private native String decodeString(long handle, String key, @Nullable String defaultValue);
|
|
1970
|
+
|
|
1971
|
+
private native boolean encodeSet(long handle, String key, @Nullable String[] value);
|
|
1972
|
+
|
|
1973
|
+
private native boolean encodeSet_2(long handle, String key, @Nullable String[] value, int expireDurationInSecond);
|
|
1974
|
+
|
|
1975
|
+
@Nullable
|
|
1976
|
+
private native String[] decodeStringSet(long handle, String key);
|
|
1977
|
+
|
|
1978
|
+
private native boolean encodeBytes(long handle, String key, @Nullable byte[] value);
|
|
1979
|
+
|
|
1980
|
+
private native boolean encodeBytes_2(long handle, String key, @Nullable byte[] value, int expireDurationInSecond);
|
|
1981
|
+
|
|
1982
|
+
@Nullable
|
|
1983
|
+
private native byte[] decodeBytes(long handle, String key);
|
|
1984
|
+
|
|
1985
|
+
private native boolean containsKey(long handle, String key);
|
|
1986
|
+
|
|
1987
|
+
private native String[] allKeys(long handle, boolean filterExpire);
|
|
1988
|
+
|
|
1989
|
+
private native long count(long handle, boolean filterExpire);
|
|
1990
|
+
|
|
1991
|
+
private native long totalSize(long handle);
|
|
1992
|
+
|
|
1993
|
+
private native long actualSize(long handle);
|
|
1994
|
+
|
|
1995
|
+
private native void removeValueForKey(long handle, String key);
|
|
1996
|
+
|
|
1997
|
+
private native int valueSize(long handle, String key, boolean actualSize);
|
|
1998
|
+
|
|
1999
|
+
private static native void setLogLevel(int level);
|
|
2000
|
+
|
|
2001
|
+
private static native void setCallbackHandler(boolean logReDirecting, boolean hasCallback, long nativeHandle);
|
|
2002
|
+
|
|
2003
|
+
private static native long createNB(int size);
|
|
2004
|
+
|
|
2005
|
+
private static native void destroyNB(long pointer, int size);
|
|
2006
|
+
|
|
2007
|
+
private native int writeValueToNB(long handle, String key, long pointer, int size);
|
|
2008
|
+
|
|
2009
|
+
private native boolean isCompareBeforeSetEnabled();
|
|
2010
|
+
|
|
2011
|
+
@FastNative
|
|
2012
|
+
private native boolean isEncryptionEnabled();
|
|
2013
|
+
|
|
2014
|
+
@FastNative
|
|
2015
|
+
private native boolean isExpirationEnabled();
|
|
2016
|
+
|
|
2017
|
+
private static native void enableDisableProcessMode(boolean enable);
|
|
2018
|
+
|
|
2019
|
+
private static native boolean checkProcessMode(long handle);
|
|
2020
|
+
|
|
2021
|
+
private static native boolean getNameSpace(String rootPath);
|
|
2022
|
+
|
|
2023
|
+
private native long importFrom(long handle, long srcHandle);
|
|
2024
|
+
}
|