I write little application for design message history from whatsapp app. The whatsapp app is stored data into sqlite db.
First of all I decrypt the db.
Secondly, I see that the DB have a table for messages, with those columns (attached as link):
So, there have a records for images, video, audio and etc.
Now, for every record I try to save to local directory on my pc, as follows:
First way:
File.WriteAllBytes(Path.Combine(directoryPath, msg.Media.MediaName)), msg.Media.RAW_DATA);
But I see, that it working only for image files, not for audio and video files..
Second way:
using (FileStream fs = new FileStream(Path.Combine(directoryPath, msg.Media.MediaName), FileMode.Create))
{
using (BinaryWriter writer = new BinaryWriter(fs))
{
writer.Write(msg.Media.RAW_DATA);
}
}
but I get same results :-(
My question - what the correct way for getting audio and video files?