Recovering contacts (contacts2.db) - Android Q&A, Help & Troubleshooting

First of all, there are several guides here on xda-developers that show how to recover files from internal memory. Those threads are really difficult to navigate, because the discussion is going on two fronts: how to create the image file and how to recover files from the created image file. I wish luck someone to read 182 pages.
So I'll be very specific here.
I have got the image file. Now, I would like to recover my contacts. In my case the contacts2.db file was somehow corrupted, with all contacts gone, and the size of the current contacts2.db file is similar to that that has no contacts.
First thing I would like to do, is since the lost data is surely resides not on the allocated space, is there a way to extract only the unallocated space from the raw disk image? In that way I would have gotten a much smaller image to work with.
Now, contacts2.db is a sqlite 3 file. I can recover it via photorec (btw, photorec supports raw disk images), however I have gotten a bunch of files that seems like .db sqlite files. None of them seems to be the contacts2.db file and when I use Grep under Windows I find the contacts data in several of them.
How can I find out which one of these .db files are readable? And, in case one of them represents my contacts2.db file, but is slightly corrupted, - is there a way to fix it?
And, is there any other software that can recover sqlite 3 files, other than photorec? And, is there a Windows versions of Foremost, Scalpel and possibly extundelete?

I'm wondering that nobody answered this thread.
I also found via Google "site:forum.xda-developers.com contacts2.db recover contacts" several threads with some or no answers.
Currently I'm also trying to recover contacts data from an contacts2.db from an Avus A57.
The contacts are stored in "Phone" and are not associated to any account (Google, WhatsApp, SIM).
Tools I use:
JihosoftAndroidRecoveryTrial8.3.exe which didn't find the missing contacts
EASUS MobiSaver emsa_free.exe which didn't find the missing contacts
Minimal ADB and Fastboot using adb root, adb remount and adb pull to copy files between Avus A57 and PC
adb pull /data/data/com.android.providers.calendar/ E:\Backup\Android\com.android.providers.calendar\
Notepad++ to view the plain raw contacts2.db
Openoffice / Libreoffice Base via SQLite3 ODBC Driver connected to the contacts2.db
Very strange:
In Base I open the View view_contacts but here are - like on the Avus A57 - some contacts missing.
But if I search inside the contacts2.db using Notepad++ for the name (several times) the missing contacts are found.
How can I restore the found contacts so that they are also found in view_contacts?
Is there any defect in the Android implementation that destroys the contacts2.db?
Another problem is that in Google Calendar all entries are gone and when open with Browser the Calendar trash is empty.

Hello and welcome to XDA Q&A section of the Forum.
Using adb, do "adb restore contacs.db". It should restore the whole file (hopefully). If that did not work, you can run this and hopefully it should view it fine and you can be able to load of the contacts.
Hopefully that solved your issue and hit thanks if I did

Related

[discussion] where does snapchat store photos/videos?

So I've went into the /data/data/com.snapchat.android/ folder, and it is only about 200KB, so the image/video files can't be stored there.
I also noticed if you have a new message, and you close and open the app, it will have to redownload it. So it seems that snapchat is storing the images in the RAM.
So I dumped the ram of my snapchat PID, using this method. I had to download a compiled gdb binary.
I then used photoRec to scan all the *.dump files [I concatenated them all first, the file was about 100MB]. For filesystem I said "Other."
All I got was one txt file. It seemed to be xml, and contained a lot of usernames of my friends, but that's all.
If anyone has any input on the subject, here is the thread for it!
Bump for interest
mvmacd said:
So I've went into the /data/data/com.snapchat.android/ folder, and it is only about 200KB, so the image/video files can't be stored there.
Click to expand...
Click to collapse
Snapchat save picture under /data/data/com.snapchat.android/cache/received_image_snaps. You then have to copy and paste the file out of the folder, and rename the file extension from .jpgnomedia to .jpg
I can not find where the videos are stored. That's how I found this thread.
Like the previous poster said images are stored in /data/data/com.snapchat.android/cache/received_image_snaps. They are deleted when they are viewed though so you must copy them to your sdcard or wherever and change the file extension before viewing them. Videos are stored in /data/media/0/Android/data/com.snapchat.android/cache/tcs_pahn
Samsung Infuse
Where can I find these files on my Samsung Infuse? I go into /data/data/com.snapchat.android/cache but the folder is empty.
JCBucks said:
Where can I find these files on my Samsung Infuse? I go into /data/data/com.snapchat.android/cache but the folder is empty.
Click to expand...
Click to collapse
I have not had time to check this location, however I have sort of discovered a workaround. [HTC Rezound CM10.1]
Ideally you should have a wifi toggle in the statusbar.
Open snapchat and then click on your snaps, after it loads the images [It will say "Loading image..", then "Tap to view"], turn off WiFi. Then you can view the snapchats [pic or video], and before enabling wifi, wipe Snapchat's data.
This way you can screenshot while offline and they will not know.
Alternatively you can use TitaniumBackup. Backup app while logged in, after viewing snapchat offline, restore data from backup so you do not constantly have to login.
JCBucks said:
Where can I find these files on my Samsung Infuse? I go into /data/data/com.snapchat.android/cache but the folder is empty.
Click to expand...
Click to collapse
same here....
Galaxy Nexus CM 10.1
If you can't find the video folder, it's because it deletes it and the videos when they are not loaded. They are stored under /data/media/Android/data/com.snapchat.android/cache/received_video_snaps/ in mp4 format with a .nomedia file extension. As soon as you navigate away from the app, they are deleted, so I set up a tasker gesture to allow me to copy them while they are loaded.
As people said before, the images are stored in /data/data/com.snapchat.android/cache/received_image_snaps/ with the jpg.nomedia extension. If that folder doesn't exist, try making sure you've received and loaded a snapchat first. The images seem to stay until they're viewed.
shenkenstein said:
If you can't find the video folder, it's because it deletes it and the videos when they are not loaded. They are stored under /data/media/Android/data/com.snapchat.android/cache/received_video_snaps/ in mp4 format with a .nomedia file extension. As soon as you navigate away from the app, they are deleted, so I set up a tasker gesture to allow me to copy them while they are loaded.
As people said before, the images are stored in /data/data/com.snapchat.android/cache/received_image_snaps/ with the jpg.nomedia extension. If that folder doesn't exist, try making sure you've received and loaded a snapchat first. The images seem to stay until they're viewed.
Click to expand...
Click to collapse
That location you name for videos doesn't exist on my phone.
- I have /data/media/ "0" and "obb" are the only 2 folders within there
- I have also read that the videos are stored in /Storage (SD CARD)/Android/data/com.snapchat.android/cache/... but there isn't anything further from here, my 'cache' folder is empty, there's never been a "received_video_snaps" folder, let alone any content within here.
- I am able to get the photos from /data/data/com.snapchat.android/cache/received_image_snaps/ but never been able to intercept videos
Note: this is all done BEFORE "viewing" the material and allowing it to "load" and show "tap to view" from within SC
I'm using the EVO 3D CDMA version
incarceration said:
That location you name for videos doesn't exist on my phone.
- I have /data/media/ "0" and "obb" are the only 2 folders within there
- I have also read that the videos are stored in /Storage (SD CARD)/Android/data/com.snapchat.android/cache/... but there isn't anything further from here, my 'cache' folder is empty, there's never been a "received_video_snaps" folder, let alone any content within here.
- I am able to get the photos from /data/data/com.snapchat.android/cache/received_image_snaps/ but never been able to intercept videos
Note: this is all done BEFORE "viewing" the material and allowing it to "load" and show "tap to view" from within SC
I'm using the EVO 3D CDMA version
Click to expand...
Click to collapse
I'm running TouchWiz. I wonder if you are on a 4.2.2 ROM or something, cause I've experienced the sdcard being moved around before...
Does your "0" folder have any subdirectories? such as Android/data/com.snapchat.android/cache/
In any case, videos are special: You need to actually click "load" (but don't hold, or else you'll actually view it before saving) if it doesn't do that automatically. Unless I misinterpreted, you didn't do that step. I think they might load automatically on Wi-Fi or something, though. For a general rule: As soon as it says "Load", the video is no longer (or never was) on your device. Furthermore, the sneaky little application deletes the folder at the same time, which is why you're never seeing "received_video_snaps" within the cache folder you found (assuming that one actually stores the videos in your version) because in my experience, almost everytime you navigate away from Snapchat, it unloads the video.
If you want to test for whether a file exists in a particular directory using Tasker, mess around with different directories in a File Modified profile (and have the associated task flash something). It'll flash as soon as something is added to that folder (including another folder, it seems).
Otherwise, check out my thread for this here.
I'm not familiar with Tasker. is it possible to have it automagically copy and rename the files that show up in the picture cache folder upon receiving a snap?
-edit-
From reddit:
I've got one method working on doing this, albeit I dislike it because this is questionable practice as is.
you''ll need Tasker and the Secure Settings plugin (tasker's run shell didn't like playing nice most of the time, but the secure setting run command does).
so i have tasker wait for snapchat to be opened, then the opening tasks are to wait 7 seconds (gives you time to load any pictures, honestly, i tried doing this with a file closed but tasker doesn't seem to like using wildcards in that command. if you really want, you can make this an exit command and open snapchat then back out before viewing)
then run shell as root cp -r /data/data/com.snapchat.android/cache/received_image_snaps/ /storage/emulated/0/snaps/ (you'll need to change the second directory, mine is for a gnex on 4.2.2 so that's why it's emulated/0)
next, you'll need to make a script in atext editor, and for sake of sanity, push it to /system/bin with chmod 755 (rwxr-xr-x)
the script then reads as CODE
!/system/bin/sh #there should be a hashtag in front of this but reddit's formatting is being wonky
cd /storage/emulated/0/snaps/ #wherever you copied them to
for file in *.nomedia
do
mv "$file" "${file/.nomedia}"
done
exit
then in tasker, as an exit action, run a secure settings run command with the command of whatever your script name is (include location if you do no push to bin).
it should work
You can play with the triggers and such, but i was having no luck including the scripted portion with the copy actions, it never seemed to run the script (secure settings has options to notify that it's running/completed).
Again, this is mean to be instructional on how to automate this with tasker, since I wanted to solve a puzzle. Not for anyone to be a creepy ass person saving snapchats that you shouldn't.
Click to expand...
Click to collapse
Couldn't post link =/
nannus said:
I'm not familiar with Tasker. is it possible to have it automagically copy and rename the files that show up in the picture cache folder upon receiving a snap?
Couldn't post link =/
Click to expand...
Click to collapse
Is it possible, yes. Will it work flawlessly, not really.
Once I move the file and remove the no media extension. I can open the image but it is blank. Any ideas? Anyone know how to retrieve deleted Images
kprz24 said:
Once I move the file and remove the no media extension. I can open the image but it is blank. Any ideas? Anyone know how to retrieve deleted Images
Click to expand...
Click to collapse
Deleted images are deleted. That's the point of Snapchat. As for the file you moved (I'd recommend you copy it instead, cause Snapchat'll show a blank screen when you view it if you moved the file), make sure it ends in .jpg (for images) or .mp4 (for videos).
kprz24 said:
Once I move the file and remove the no media extension. I can open the image but it is blank. Any ideas? Anyone know how to retrieve deleted Images
Click to expand...
Click to collapse
Actually there is a program called PhotoRec that scans a disk for files using the headers. So as long as the file is unfragmented and not been written over, you can retrieve it with the software. Of course you'll have to either plug in your phone to your PC with usb mass storage mode [if your phone supports it], or else put it in a card reader.
mvmacd said:
Actually there is a program called PhotoRec that scans a disk for files using the headers. So as long as the file is unfragmented and not been written over, you can retrieve it with the software. Of course you'll have to either plug in your phone to your PC with usb mass storage mode [if your phone supports it], or else put it in a card reader.
Click to expand...
Click to collapse
Nice! I didn't think that technology was available on phones at this point.
quantemplation said:
Nice! I didn't think that technology was available on phones at this point.
Click to expand...
Click to collapse
Well actually it's not run from the phone [as I mentioned in my previous post], you must plug your card into your PC with usb mode in order for it to work.
I have used PhotoRec in the past and it has worked pretty well. The only thing, and it's not PhotoRec's fault, your files will have a random number. There's no way to know what the old filename/path used to be, so you have to figure that part out on your own.
In short, always backup your sdcard unless you don't mind losing everything, and depending on the damage, might be able to recover the files, but only the ones not fragmented and they will be randomly named.
I developed an easy way to sync the received pictures and videos with your Dropbox account.
If it is interesting you can check my thread here
Using the Droid DNA and looking in com.snapchat.android and the cache folder is there, but that is empty. There is no received images folder. Anyone know why this is the case? I know I've gotten plenty of images from snapchat.
jaredkent said:
Using the Droid DNA and looking in com.snapchat.android and the cache folder is there, but that is empty. There is no received images folder. Anyone know why this is the case? I know I've gotten plenty of images from snapchat.
Click to expand...
Click to collapse
The same thing is happening with my Galaxy S3

Whatsapp Data location

Hi,
I have an old phone (Galaxy S3 international unbrandedand) and I would like to decrypt my whatsapp backup files.
I've googled many tutorials but they all seem to be outdated.
Most of them presume that the key file is located in /data/data/com.whatsapp/, however this folder does not exist on my phone.
I've also tried adb backup as root on my linux laptop (adb backup -f whatsapp.ab -noapk com.whatsapp), but when I transform this ab file into a tar and then extract its contents, it's just empty.
I've also tried to locate the com.whatsapp folder (not the user files folder with the actual *.crypt8 files, pictures, etc), but I can't find it anywhere on my phone.
Am I missing something? Are the whatsapp app files somewhere else now? Or has the location of whatsapp changed?

ADB functions clarification and usage for data transfer/backup on an image disk

Hello xda-developers,
I'm trying to figure out the proper way to transfer app data from an Android image disk. I'm very new to this, so I hope I'm not missing something basic.
Situation. I have a .img disk image file obtained from a .vmdk file via a virtualbox conversion , the latter being created by an Android emulator. I'm trying to recover some app data and transfer that to a new, working, .img disk. The emulator works on Android 4.4.2, if that matters.
What I did. I extracted apks and copied app data folders (com.<devname>.<appname>) from/to the /data/data directory. I did that using a file manager (ES file explorer) or via the cp command, as I found in many tutorials and guides. Others suggested to copy those folders to /Android/data instead, so I did try that as well. These procedures were ineffective, because they both messed up with folders and files permissions. Although cp -ar retains folders/files permissions and ownership, that was of no use after the import into the working image. Those operations were performed on Ubuntu 18.04.
The problem (and a workaround). When the apks are installed, a new uid (in the 10000 group) is generated for them. These values are unknown when I import the data folders, hence they are destroyed at phone boot. A log in /data/system/uiderrors.txt confirms this. The only way I could make it work was to install the apk from scratch, open the app so that the new data folders are created with a proper uid, replace those folders with old ones and manually change ownership and permissions accordingly (for every apk). This turned out to be effective but it's a very tedious and error-prone process.
What am I doing wrong? How do ADB push, pull and backup commands manage folders permissions/ownership and app uids? Could they be useful in my situation? If so, how can I use them on a .img file?
Thank you.

Backup all QuickMemo+ notes?

Hello!
How do I backup each and every note of my LG G5 QuickMemo+?
If your phone is rooted, you can do that by using automatic backup tools such as Titanium Backup, or by manually copying /data/data/com.lge.qmemoplus/ folder to your backup location and then restoring it by copying it back to the same folder, setting the right permission with Root Explorer or similar.
If you're planning to copy them to a txt file, it's quite easy for text notes, as the text is inside /data/data/com.lge.qmemoplus/databases/qmemoplus.db, a SQLite database, in a format similar to HTML.
tremalnaik said:
If your phone is rooted, you can do that by using automatic backup tools such as Titanium Backup, or by manually copying /data/data/com.lge.qmemoplus/ folder to your backup location and then restoring it by copying it back to the same folder, setting the right permission with Root Explorer or similar.
If you're planning to copy them to a txt file, it's quite easy for text notes, as the text is inside /data/data/com.lge.qmemoplus/databases/qmemoplus.db, a SQLite database, in a format similar to HTML.
Click to expand...
Click to collapse
My phone is not rooted and I do not plan to root it. Most of the notes I wish to backup are images, is that still possible?
accessing in the /data/data folder is possible only with root. I don't know where images are, if they are in /sdcard/android/data/com.lge.quickmemoplus you can backup them, otherwise not.
EDIT: media files are in /sdcard/android/data/com.lge.quickmemoplus, so you can just copy that folder even without root.
tremalnaik said:
EDIT: media files are in /sdcard/android/data/com.lge.quickmemoplus, so you can just copy that folder even without root.
Click to expand...
Click to collapse
Oh. So should all my phone data get deleted, if I paste the pre-copied folder, all the dozens of saved images in QuickMemo+ would be there?
/sdcard/ is (opposite to what would be logical) the internal memory. So if your phone data is erased, also QuickMemo+ photos are deleted But you can always backup them whenever you want.
tremalnaik said:
/sdcard/ is (opposite to what would be logical) the internal memory. So if your phone data is erased, also QuickMemo+ photos are deleted But you can always backup them whenever you want.
Click to expand...
Click to collapse
I just went in that folder and I seem to have thousands of 'qmemo_' folders in there, each has 'audios', 'drawings', 'images' and 'videos' sub-folders. The problem is there seem to be a lot of memos I have deleted from my phone long ago (which apparently also is the reason why it took some time to load all the folders as there are thousands), how come the deleted memos appear in those sub-folders? How can I backup only the relevant ones?
If there is a mismatch between the database of notes seen by QuickMemo and the files in the folder, well, you just have to be patient and check them one by one.
You can start by opening QuickMemo and looking at the earliest memo: any folder that has been edited before that date, is something you deleted.
You can use LG Backup too

Recover Whatsapp stickers

I had autoupdate to google drive turned off for Whatsapp. Got myself a new phone now, and I had coppied the "stickers.db.crypt14" from my old phone already before it got bricked. It was in the "backup folder" and because of this I thought it was the only file needed to recover a backup. I had a lot of stickers and so it's actually a big file. So for this it seemed verry obvious that this was the file I needed.
But now I try to restore and I come across toppics on google and here, talking about more files from other dirs too.
Is it possible to restore stickers from only this "stickers.db.crypt14" file?
I also backuped another, containing all (or at least most of all the individual stickers as a "image" file.

Categories

Resources