Some information - some questions
I did some research on this one, even not beeing in Egypt and not beeing able to try out anything.
One question upfront: GPS worked up to firmware 2.0.2 then quit working starting at firmware 2.1 and still not working at fw 2.2, right?
Thats what I think is happening:
In any country with any simcard, once you insert a simcard and the simcard connects to a network it gets a "Mobile Country Code" and "Mobile Network Code" (MCC/MNC). The MCC for Egypt is 602, MNC for Mobinil is 1, MNC for Vodafone_EG is 2.
This happens not only if you are using one of their simcards, but aswell if you are roaming with a simcard from another country.
You can test it: Open the phone app, goto the keypad and type *3001#12345#* This will open the (hidden) app FieldTest on the iPhone. Goto "MM Info" -> "Serving PLMN" and look for "Mobile Country Code" and "Mobile Network Code".
Seems to me that once the iPhone gets the MCC 602, you wont get GPS.
I dont know, what is happening to that value on its way to locationd, the daemon that is handeling GPS location and the modem. But this is the place where the mentioned code is in:
I have been looking up the locationd of firmware 2.1 and 2.2. Even thought it is in different places (line 2640 in 2.2 and 8214:8665 in 2.1) it is there in both versions. So your finding make sense, GPS is probably disabled since 2.1.
subscriber country %03d prohibits GPS
serving country %03d prohibits GPS
BTW: locationd is to be found at /usr/libexec
Be careful, it is an executable (programm) that is binary, playing around with it if you dont know what you are doing might leave you with a non-functional iPhone and you'd have at least to restore the firmware!
In firmware 2.0.2 the daemon is called locationd82 - different name. All versions have different sizes aswell.
locationd82 2.0.2 788 KB
locationd 2.1 828 KB
locationd 2.2 856 KB
locationd82 does not contain the above code so this is probably why GPS worked in Egypt up to firmware 2.0.2.
I do have tons of work at this time in my real life job, cant do much more investigation on this topic for a while (at least the next 10 days), just wanted to share my ideas.
I have been looking where "%03d" is from in this code fragment, still have no clue. This would be my first try to find a fix. Messing around with the daemons might not lead to much fun. Renaming the 2.0.2 locationd82 to locationd and replacing the one in fw 2.2 probably wont work, i have not tried it though.
If you guys want to check the system AND you have a Mac, this is the way to go:
Use Pwnagetool 2.2.1 to produce custom firmware files for 2.0.2, 2.1 and 2.2 - the iPhone does not have to be connected to the Mac while you do so.
The files end *.ipsw and are sitting on your desktop. In the Mac's finder rename them to *.ipsw.zip. finder will ask if you really want .zip, choose it. You will se a zip file on your desktop, doubleclick it. It will be expanded, open the folder. In there - among other stuff - you'll find two .dmg images. Mount the bigger one, thats where the system stuff and daemons are sitting in.
Last note: if you fiddle around with the daemon and find something, don't post download links here, this is copyrighted software and we dont allow that, Use mail instead.
Very last note: playing around with those files might turn your iPhone none-functional. Even though I have been doing this several times and never ended with a brick, I had to DFU restore manymany times - so, you are on your own.
hope that helps