last day (15 days later) » 

02:01
1
Q: Which file has the saved contact data in android? How to get this file in an unrooted phone?

user17915My android phone's screen is damaged and only shows a white pixelated background and does not recognise any touch input (although it does recognise when I swipe on the initial lock screen after I restart the phone, I know this because I can hear the audio feedback). However everything seems intac...

Did you sync the contacts with a Google account? You may be able to recover them from there.
no the contacts were completely on the phone only, except for may be viber contacts which also used to show up on the phone contact list somehow (not sure how exactly that works)
Is the device encrypted? I don't know how this works but some tutorials inspire confidence that a custom recovery can be flashed in an S4 without deleting any data. If you can manage to flash a custom recovery without wiping user data partition in process you can have root access with adb enabled in recovery mode. Than you can pull contacts file into your PC. See google.com/… // This is risky because I still do not know whether user data would survive in recovery flashing
no it is not encrypted, but I cannot even go to firmware download mode (that is, I cannot be sure whether the phone properly reached firmware download mode or not) because of the broken screen
Your only option is trial and error.
02:01
Related: any way to read DATA/ directory's CONTACTS.DB?. The phone's contact data is usually saved in "Contacts Provider", a system app. Normally, you need to be rooted to access it though.
@Firelord I am going to risk it and try flashing a custom recovery (from here, for this model: forum.xda-developers.com/showthread.php?t=2529064). Posts, such as these, android.stackexchange.com/questions/188124/…, seem to hint that flashing custom recovery will not erase data or contacts. However, I want to make sure that flashing a custom recovery will definitely give me root access...
@Firelord... What I want to have happen is this. (1) I flash custom recovery in the phone using Odin (2) I booth up into custom recovery (Vol up+home+power) [the screen is broken so I can't see or touch anything, everything upto this point will be based on trial and error] (3) Assuming the phone is now at the custom recovery screen, I connect USB cable, then adb into the phone. I get an adb prompt with root (#) access...
@Firelord... Have I understood how this works correctly? Should I expect to be able to get a root shell when I adb into the phone while it is booted into the custom recovery? Will just flashing the custom recovery also get me root capability at the custom recovery screen? I am considering trying out (forum.xda-developers.com/showthread.php?t=2529064), (theunlockr.com/…) or (forum.xda-developers.com/galaxy-s4/i9505-orig-develop/…)
@Firelord The reason I am asking is reading the forums I linked to above, they all talk about flashing a custom recovery and then rooting the phone. What I want to make sure is while the phone is at the recovery screen, will it have root privileges or not.
I don't know which custom recovery you would be flashing, but if it is Twrp than you are good to go. When you would boot into that recovery after flashing it, adb shell would automatically grant you root access. As for about the rooting thing you read about on the internet it is about rooting your Android OS using custom recovery. You don't need that so you can avoid reading about it now.
I must tell you something beforehand. The Contacts database that you would be fetching through custom recovery is not user friendly to read. The Contacts and details are scattered in it. You would have to open that file in a Sqlite reader type software and then manually save each and every contacts into your target. It is messy and laborious work. But if you get that file, you may fire up a question on our site how to conveniently copy contacts from that database into a vcf file to store it in your target device.
@Firelord thanks for the heads up. I will be going with twrp as far as possible. I don't mind getting my hands dirty trying to recover contacts from the database file as long as it's something possible to do. Just 1 question if you don't mind. I read this article customroms.net/faq/bootloader where it says first step to getting a custom recovery is unlocking the bootloader, and the phone is made in such a way that unlocking bootloader process itself wipes all user data. If this is true i don't see how my data can be safe if i flash a custom recovery...
@Firelord ... but the links i posted earlier seem to indicate it does not wipe user data. Is this something i should be worried about?
Yes, this is what I was talking about that flashing custom recovery by unlocking bootloader could wipe your whole of the data, there is no point going forward. But when I read the link I mentioned earlier it gave me confidence that the data would not be deleted. This is a high risk.
@Firelord Seems to work. I downloaded TWRP and was able to adb as root. Now I have a backup of contacts2,db, and I also managed to find the db files for my sms messages so hopefully I can recover them too. What other interesting things are here that should keep a backup of? The data/data folder seems to have folder entries for the viber messenger. Would this have my viber conversation history too, or is this kind of thing too application dependent and we can't know?
@Firelord also I suppose the current root level access I have is only available during the recovery mode and won't be available if I boot into android. Is there a way to get permanent root access for the android OS as well, only through adb while in recovery mode? I am hoping if this possible I can find some way of streaming the screen contents to the PC and may be control the phone interface completely through adb. I'm sure this might be too much of a hassle, but is this something doable?
02:01
Now that you have succeeded with TWRP, my first suggestion is to pull the data partition into a disk image into your PC (you need adequate space in PC the size of the storage of your phone) so that you can peek into it and extract such data you find interesting without depending on the phone anymore. This is easy. Search our site or internet and you would find a solution. As for root access, yes it is right now limited to recovery. You would have to find out how your device can be rooted using custom recovery. For starters, see if Magisk can be used to root your device.
You would also have to enable USB Debugging in your device (not recovery, but Android OS) through recovery mode if you hope to do anything in your Android OS with a non-functioning display. Our site has many questions related to this problem and so as the internet. If you fail or get stuck, popup up a question here. :)
The " enable USB Debugging" is the part I am hoping to bypass somehow through recovery itself, because although the phone has USB debug enabled in settings, I cannot use the screen to approve USB debugging when using adb (the approval dialog box that pops up with the RSA keys)
Once you get to enable and get a functioning adb you can further search this site. We do have questions how to control or project screen content onto another display. I recently used scrcpy tool and it works both to display content as well as control the device. Requires adb of course. :)
"pull the data partition into a disk image into your PC" So this would be like a CD ISO image? Will this be a complete backup of everything in the phone (including things such as camera photoes, music files etc + all the files I needed to have root in order to view )? The phone has internal sdcard of 16 GB so I should have 16 gb free in my PC for this?
Yes, that's why I said search to find out how to bypass that authentication dialog. I had once posted a solution which used a custom recovery to bypass adb authentication for a Samsung/OnePlus device. So again, keep searching. You are very good in helping yourself. Good luck. If you get stuck, ping me or ask a question. :)
If there was no external card, than yes, when you would pull the whole of data partition into a disk image (img extension - you got it right, like iso, easily mountable), your personal data files would also be pulled and saved inside the image. Yes, if that's the size of storage than you should have at least that much space.
@Firelord Is this what I need to do to make an image of all the data? stackoverflow.com/a/41422730/1693203
02:01
True. But in your case the partition name may vary, so try this answer to ascertain which block device you need to copy to pull data partition. android.stackexchange.com/a/102551/96277
@Firelord so I found the data partition and I have a backup of ~12 GB img file in my PC (that's what the internal sdcard size actually was). Do I have a backup of everything now? While the phone is in TWRP recovery, if I use adb shell and then do an ls, it shows me a bunch of stuff that are not inside the img file. THe adb shell's ls shows me a data folder and the contents of this are int he img file, but what about the other stuff that shows up in the adb shell's ls? There are things such as init, init.rc, dev, etc, sdcard, etc. Do I need to keep a backup of all these?
Good to know you managed to backup it and that the backup is fully explorable (you opened the img file, correct?). Yes, the data directory is the mount point of the partition you backed up. Everything else you see is temporary (related to running OS since boot). It is not important with respect to saving it.
@Firelord Yes I can open it. The default mount option on Windows 10 doesn't work with it (I don't know what windows 10 mount actually does) but 7zip opens it so no problem. I have some confusion regarding rooting this phone though can you have a look at my other question please? android.stackexchange.com/questions/218626/…
 
7 hours later…
09:09
@user17915 now as your phone has TWRP, it's easy to enable usb-debugging in /system/build.prop and place RSA Keys in /data/misc/adb
@user17915 this can help to mirror screen to PC
@user17915 MyPhoneExplorer will backup contacts and sms to PC
@user17915 Migrate will backup app data in a way you can restore selective to other device. It even works without rooting source phone, all it needs is emergency flash to backup
(but I recommend to root android and install app from F-Droid, so you can backup regular way)

last day (15 days later) »