Siddarth Kumar 92dcd1140b
refactor native modules into separate modules (#18385)
The native module : `react-native-status` has always been 1 big fat file per platform which contained all of the native modules.

In case of Android it was `StatusModule.java`
This commit modularises it & attempts to thin out this 1 big file into these categories:
- `AccountManager.java`
- `EncryptionUtils.java`
- `DatabaseManager.java`
- `UIHelper.java`
- `LogManager.java`
- `NetworkManager.java`
- `Utils.java`

In case of iOS it was `RCTStatus.m`
This commit modularises it & attempts to thin out this 1 big file into these categories:
- `AccountManager.m`
- `EncryptionUtils.m`
- `DatabaseManager.m`
- `UIHelper.m`
- `LogManager.m`
- `NetworkManager.m`
- `Utils.m`

In this commit we also remove a lot of unused native code which has no reference on cljs side.
2024-01-15 18:57:35 +05:30

34 lines
779 B
Objective-C

#import "DatabaseManager.h"
#import "React/RCTBridge.h"
#import "React/RCTEventDispatcher.h"
#import "Statusgo.h"
#import "Utils.h"
@implementation DatabaseManager
RCT_EXPORT_MODULE();
RCT_EXPORT_METHOD(exportUnencryptedDatabase:(NSString *)accountData
password:(NSString *)password
callback:(RCTResponseSenderBlock)callback) {
#if DEBUG
NSLog(@"exportUnencryptedDatabase() method called");
#endif
NSString *filePath = [Utils getExportDbFilePath];
StatusgoExportUnencryptedDatabase(accountData, password, filePath);
callback(@[filePath]);
}
RCT_EXPORT_METHOD(importUnencryptedDatabase:(NSString *)accountData
password:(NSString *)password) {
#if DEBUG
NSLog(@"importUnencryptedDatabase() method called");
#endif
"";
}
@end