mattermost-mobile/patches/react-native-mmkv-storage+0.6.6.patch
Joseph Baylon 92de752e2a
Detox/E2E: Fix android build command and update deps (#5879)
* Detox/E2E: Fix android build command and update deps

* fix build error with assembleAndroidTest

Co-authored-by: Saturnino Abril <saturnino.abril@gmail.com>
2021-12-17 04:17:20 +08:00

43 lines
2.3 KiB
Diff

diff --git a/node_modules/react-native-mmkv-storage/ios/MMKVNative.mm b/node_modules/react-native-mmkv-storage/ios/MMKVNative.mm
index ffac535..4608563 100644
--- a/node_modules/react-native-mmkv-storage/ios/MMKVNative.mm
+++ b/node_modules/react-native-mmkv-storage/ios/MMKVNative.mm
@@ -79,11 +79,12 @@ BOOL functionDiedBeforeCompletion = YES;
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory,
NSUserDomainMask, YES);
- NSString *libraryPath = (NSString *)[paths firstObject];
- NSString *rootDir = [libraryPath stringByAppendingPathComponent:@"mmkv"];
- rPath = rootDir;
+ NSBundle *bundle = [NSBundle mainBundle];
+ NSString *APP_GROUP_ID = [bundle objectForInfoDictionaryKey:@"AppGroupIdentifier"];
+ NSString *groupDir = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:APP_GROUP_ID].path;
+ rPath = groupDir;
_secureStorage = [[SecureStorage alloc] init];
- [MMKV initializeMMKV:rootDir];
+ [MMKV initializeMMKV:nil groupDir:groupDir logLevel:MMKVLogInfo];
install(*(jsi::Runtime *)cxxBridge.runtime);
[self migrate];
}
@@ -186,7 +187,7 @@ static void install(jsi::Runtime &jsiRuntime) {
jsiRuntime, PropNameID::forAscii(jsiRuntime, "initializeMMKV"), 0,
[](Runtime &runtime, const Value &thisValue, const Value *arguments,
size_t count) -> Value {
- [MMKV initializeMMKV:rPath];
+ [MMKV initializeMMKV:nil groupDir:rPath logLevel:MMKVLogInfo];
return Value::undefined();
});
diff --git a/node_modules/react-native-mmkv-storage/android/build.gradle b/node_modules/react-native-mmkv-storage/android/build.gradle
index 618a7de..4aaca89 100644
--- a/node_modules/react-native-mmkv-storage/android/build.gradle
+++ b/node_modules/react-native-mmkv-storage/android/build.gradle
@@ -85,7 +85,7 @@ android {
}
packagingOptions {
- excludes = ["**/libc++_shared.so","**/libjsi.so","**/libreactnativejni.so"]
+ excludes = ["**/libc++_shared.so","**/libjsi.so","**/libreactnativejni.so", "META-INF/MANIFEST.MF"]
}
configurations {