react-native-fs: Error when reading large file on Android
I am trying to read 2xxmb crypt12 file from FS.
When I trying to run await RNFS.readFile(
${RNFS.ExternalStorageDirectoryPath}/Whatsapp/Databases/msgstore.db.crypt12)
, it prompts up
Could not invoke RNFSManager.readFile
null
Failed to allocate a 536870928 byte allocation with 25165824 free bytes and 248MB until OOM, max allowed footprint 301365936, growth limit 536870912
I have already set android:hardwareAccelerated="false"
and android:largeHeap="true"
in AndroidManifest.xml but no luck.
How can I solve it? Thank you
About this issue
- Original URL
- State: open
- Created 6 years ago
- Reactions: 5
- Comments: 25 (1 by maintainers)
I am having the same issue any solution??
Well, such things happen when you are blowing your devices memory with such a big file. It was never a good practice to load a file completely into memory. You should treat this instead on a chunk-by-chunk basis. Best thing here would be to find a library, that is capable of decrypting the crypt12-file. Then you can load this database (assuming it is Sqlite3 based) with react-native-sqlite-storage to dig trough the data.
There is little chance, that whatsapp is using sqlite-cipher for encyrption (DYOR pls). Then this issue should give you help: https://github.com/craftzdog/react-native-sqlite-2/issues/32