And by big brother, I mean Steve.
Gosh, that 1984 Apple commercial seems awfully silly now, doesn’t it?
You’ve probably heard the news that the iPhones, iPads, iPod Touches, etc. that are running iOS 4 or later come with the hidden bonus feature of tracking your every movement via GPS and storing about a year’s worth of that data in a database on the phone. Without your knowledge or consent and without any disclosure by Apple. Apple has yet to make a statement so far, and no one knows why the data is being collected, what it’s for, or if it’s being transmitted to Apple.
Being the owner of an iPhone, I really wanted to check this out. Let’s explore, shall we?
When I was reading about this, I was directed to this site by these guys who made an application for OS X that will supposedly do everything for you. But since I have a business machine and not a Mac, we’re going to do things the hard way. (And coincidentally, the way that teaches you about the underlying processes, requires a modicum of your own brainpower, and will make you feel smarter for having done it. Well, me anyway. All you have to do is follow my instructions. I have to do everything around here.)
Ahem.
If you have a jailbroken phone, I hear you can access the file system of the phone directly. But since I’m not that much of a nerd that I jailbroke my phone, (actually I am I just haven’t done it yet,) the best place to find this data is in the backups on your PC that iTunes makes of your phone when you sync it. On my Windows 7 x64 system, those backups were stored in:
C:\Users\Ryan\AppData\Roaming\Apple Computer\MobileSync\Backup\0cd386f7a7more-crazyass-guid-like-numbers\
Every time iTunes makes a backup of your phone, you get another folder in there made up of more crazyass-guid-like-numbers. Oh, and if you encrypt your backups, just stop now because this won’t work, because your backups are… encrypted. Sort the folders by date and go into the most recent one. Inside you’ll find… a shitload more crazyass-guid-like-numbered files. Those represent the actual files that reside on your iPhone. But Apple cleverly renamed all the files with very cryptic filenames. It seems very much like Apple to assume that these big, scary filenames were enough to scare most people away. For Mac users, that’s probably true. Now we just have to figure out which one of those files is the actual database file that we’re looking for.
Luckily, we get to be script kiddies today. Someone’s already done the hard work for us. Here is a Python script, the purpose of which is to decipher what actual files the crazily-numbered files correspond to. I didn’t write it. Some dude on Stackoverflow did. There’s a Manifest.mddb and Manifest.mbdx file buried in your iPhone backup folder with all the crazy files that contains the real names of the files. Now you may be wondering to yourself, “what the hell do I do with a Python script?” Well, just Google for “IronPython” and download it. IronPython is a .NET-based version of Python. And .NET is awesome. So support it.
So now you have Python. I recommend putting the script you just downloaded into the same folder as all your crazy files in your backup folder. Now at the command prompt, navigate to your backup folder with all the crazy files and the Manifest files, and execute the script that you put in there like so:
“C:\Program Files (x86)\Iron Python 2.7\ipy.exe” iphonels.py > output.txt
See how I redirected the output to a text file there? If you don’t, all the output is just going to scroll down your console. And unless you read really fast, this won’t do you any good. So go ahead and open up that new text file in a text editor. I recommend Notepad++. Get it if you want to be as cool and hacker-like as me. Inside that text file, do a search for “consolidated.” You’ll see a line like this in your text file:
…1280884484 (4096c9ec676f2847dc283405900e284a7c815836) RootDomain::Library/Caches/locationd/consolidated.db
What this is trying to tell you is that the file name that I put in bold up there, is actually the file consolidated.db. Consolidated.db is the file we want with all the juicy data in it. So copy that file to another directory and rename it something.db.
That database file is in SQLLite format. It’s like SQL, only… light. There are a lot of SQLLite readers out there. I hear there’s even a Firefox extension that reads SQLLite databases. I for one chose to download the freeware program SQLLite2009 Pro, because it has nice features that let you export the data into Excel format, and you’re gonna’ want that.
So now that you’ve installed a SQLLite client, open your *.db file. If you’ve done everything right so far, the database should load, and you should see tables with names like “Cell,” “CellLocation,” “CellLocationCounts,” etc. etc. load in the left pane of the program. At this point, you should feel free to explore the different tables. But the one you’re probably most interested in is the table named “CellLocation.” In the window that says “Query #1″, type in the following:
select * from CellLocation
And hit F5 to execute the query. Do you feel like a DBA yet? Now the screen will fill up with thousands of rows of data. This data is purportedly your latitude and longitude and timestamps, everywhere you’ve ever carried your phone, going back about a year or so. Personally my phone only contained 3058 rows in this table. My coworker’s phone, however, contained more like 25,000.
But this raw data isn’t much fun to look at, is it? You want this shit on a map, don’t you? Don’t worry, baby bird.
Hit the “export resultset to Excel” button up there. Now it’s in Excel spreadsheet format. But that still isn’t enough! If you want to upload this data to Google Earth or Google Maps, it’ll have to be in KML format. I found a website here that will do just that for you. Hit “Choose File” to upload your Excel spreadsheet, then hit “View on Google Earth.” Don’t worry about signing up. It will download a KML version of the Excel spreadsheet you just uploaded. Now go to Google Maps, click “My Maps” in the upper left, create a new map, and import your KML file when you get the option.
And holy crap, you’re done!
All those little dots are supposedly everywhere you’ve been. The only problem though, is that it isn’t. For me, the pins on the map did seem to somewhat represent my normal patterns of movement, but it’s almost as if they were all shifted due west several miles. For instance, there isn’t one single pinpoint at or near my place of employment… yet, apparently my iPhone thinks I’m an NFL player, because there are several pinpoints right on the 50 yard line of the Cowboys Stadium. It looks like my girlfriend won’t be able to tell exactly which one of those slut’s houses I was over at after all… phew!
So apparently, not only is Apple tracking our every move without our knowledge… they’re not even doing it well. Another interesting table in your consolidated.db file are the Wifi ones. It appears to be full of MAC addresses and latitude/longitudes of every wifi hotspot that your phone has ever detected.
So we’re left with some questions. Is this GPS data, or cellphone tower triangulation data? Why is it being stored? Why does it seem to be so inaccurate, when we know that the iPhone is capable of accurate GPS information?
Maybe there’s more to this data. Maybe it doesn’t mean exactly what we think it means…