I'm trying to work out what the current phone number is for an Android device based solely off a disk image. I've looked in the mmssms.db and the contacts2.db but neither seem to store the details of the current phone number.

Is there a database or log file that would store this sort of information?

Its just a stock image. At the moment I have a YAFFS dd and logical image but I'm expecting EnCase and other image formats as well.

It's not guaranteed to be stored anywhere in the phone, since the SIM provides the phone number. However, some applications might log the phone number. No idea which ones might though.
–
PolynomialJul 20 '12 at 8:37

3 Answers
3

It's not guaranteed to be stored anywhere in the phone, since the SIM provides the phone number. However, some applications might log the phone number. No idea which ones might though, sorry.

At best, you could probably write a script to scan for phone numbers. Unfortunately, you have no idea how one might be stored, so you're really stuck with searching for ASCII and Unicode string representations of numbers that could be phone numbers. Even when you hit a possible number, you have no idea if it's the user's number or a contact's number, or if it's a false positive. It's not likely to be very accurate.

was the image compressed from a Nandroid back-up? (Via ClockworkMod Recovery?) if you can find out / tell me the version of Android it's running then I can give you a clear answer. For Froyo the devices stores the users number in the system settings under, "About Phone," and same goes for ICS, (4.0.X) with the added menue, "System Settings / About Phone / Status / My Phone Number," also if you were to take the image and restore to the devices. also @Polynomial, GSM phones do log the number based off of the SIM, but with Android to the best of my knowledge, all versions keep the phone number logged in the above listed system path.

Do you have any details about where that might be stored on the actual file system? I know that the phone UI displays the phone number under "About Phone" but I'm not sure that its stored anywhere. For example my Galaxy Nexus (Android 4.1.1) actually says "My phone number: Unknown" on that screen.
–
Luke QuinaneJul 27 '12 at 2:20

I will have to look into where it is packaged into the back-up, a good start, rather where I would start looking would be a Google search of, "Where nandroid back-up's store device owners phone number."