Filed under: Hacks, How-tos, iPhone
How to relock your iPhone before the firmware update
Really, don't do this. The dev team is coming out with a relock tool any second now.
Apple has your unlocked iPhone in their crosshairs. What do you do? This method in no way guarantees that your iPhone will survive the update after being unlocked. If you're risk adverse, you may want to wait a day or two for these instructions to get debugged. And be aware there may be a lock/unlock limit set by hardware.
Important note: people are experiencing munged IMEI's. "Delayed Green" says that he saw this "Incorrect SIM" error in the early unlock days and that he knows of no way to fix the problem. The IMEI errors seems to be unrelated to unlock method--I'm hearing from people who used pretty much each of the unlock scenarios. Quite a few people have simply re-unlocked and are using their phones without problem but can't re-lock, that is reverse the unlock. Can you put the genie back into the bottle? Reliably? Apparently not yet. And the methods previously published just aren't working properly. If you haven't tried relocking yet, do yourself a favor and just wait until we figure out why some relocks are going wrong. Update; iPhone unlocking team promises relocking tool within a week.
TUAW Reader Peter writes: "The reason why we're getting the Invalid SIM error seems to be because running bbupdater with the .fls and .eep files somehow causes the phone's IMEI number become 004999010640000. Running AnySIM or using any of the other unlock methods seems to "program" the iPhone again with the correct IMEI number. There must be another step required to reflash the baseband and get the correct IMEI number back. "
Here's yet another link to check out.
- (Take out your SIM from your iPhone.)--Still checking on this step.
- Download the 1.0.2 firmware to your computer and unzip it. It uses a .ipsw extension but your unzip program should still work. Change the extension if you have to.
- Extract the ramdisk as such:
dd if=009-7698-4.dmg of=ramdisk.dmg bs=512 skip=4 conv=sync - Mount the extracted ramdisk.
- From the ramdisk, copy /usr/local/bin/bbupdater, /usr/local/standalone/firmware/ICE03.14.08_G.eep, and /usr/local/standalone/firmware/ICE03.14.08_G.fls to your iPhone. Place these into a folder on the OS partition (such as /bbupdate) and not into a folder on /var/root. The /var/root partition is set noexec and you cannot run programs from there.
- Disable com.apple.CommCenter.plist--either using UIctl or launchctl:
launchctl unload /System/Library/LaunchDaemons/com.apple.CommCenter.plist - On the iPhone, navigate to the folder where you stored bbupdater and the eep and fls files.
- Run bbupdater as such:
./bbupdater -f *.fls -e *.eep - Reload comm center:
launchctl load /System/Library/LaunchDaemons/com.apple.CommCenter.plist - Reactivate with your favorite AT&T SIM. I personally like using iASign.
Thanks to Shaun T. Erickson and Kai Cherry
"What about restore?" -- Unlocks survive restore. It's a different part of your phone.
"Will this affect Jailbreak or 3rd party apps?" -- No but you still may have to restore before the next firmware update.
"Will the next firmware update lock me out from jailbreak and 3rd party apps?" -- We have to see but...likely yes.
"Do I have to update my iPhone when the next firmware is released?" -- No. But then you're kind of sticking your iPhone into a time warp. Everything else will change but not your iPhone. And I don't see there being a parallel development effort on the part of hackers.


![TUAW [Cafepress]](http://www.blogsmithmedia.com/www.tuaw.com/media/tuaw-cafepress-promo.png)


Reader Comments (Page 1 of 4)
Callum said 6:07PM on 9-24-2007
omg, erica are you married already?
Reply
Donald Burr said 6:20PM on 9-24-2007
Thank you. I've been looking for such a guide for a while now. I actually have a slightly different reason for wanting it however; I installed the unlock in its first, raw command line state, and I somehow managed to do something incorrect, leaving the phone in a sort of "half-locked, half-unlocked" limbo state. I wanted to start from a clean slate and use the anySIM GUI app that was released, but all my attempts have failed; anySIM apparently thinks that my iPhone had been unlocked at some point in the past and refuses to run.
Hopefully with this method I'll be able to start clean and anySIM will stop its complaining. Although now, with the WiFi iTMS release imminent, I might just wait and see how that plays out before attempting to install it.
Reply
Reg said 6:50PM on 9-24-2007
If this works (is there enough data in the above files to reflash the baseband to it original state?) then perhaps a nice, one-tap GUI app is in order!
To complement anySIM, maybe there needs to be an "origSIM."
Or, in keeping with Steve Jobs' "cat & mouse" theme (and why did he claim they were the mouse on the eve of delivering the ferocious Leopard)...
"Cheese."
Reply
dlaw said 7:03PM on 9-24-2007
Won't iTunes "Restore" command do everything neccesary to restore the unit to it's Factory State?
Reply
Admiral said 7:23PM on 9-24-2007
way too much work for a phone - no matter how cool it is...
Reply
Peter said 7:35PM on 9-24-2007
I unlocked my iPhone, because I live near Canada and travel there frequently, so I have a pre-paid account with Fido. In anticipation of a firmware update, I tried to re-lock my phone using similar instructions last week. The re-lock seemed to work, but the iPhone then detected my AT&T SIM as an invalid SIM. I ended up having to unlock it again to restore service. Has anyone successfully re-locked their phones using this method?
Reply
David Chartier said 7:32PM on 9-24-2007
Awesome work Erica! I hope this saves a lot of people's butts before the firmware update.
Reply
one1step1 said 7:36PM on 9-24-2007
I hope this only affects the ability to use different SIMs. I bought the iPhone (sans phone activation) instead of the iPod touch since I wanted Email and other capabilities. Hopefully this won't stop the fake activations.
Reply
Peter said 7:36PM on 9-24-2007
I forgot to mention that I couldn't even activate it again with iTunes. I'm not sure if a fresh never-activated SIM card would have yielded any different results.
Reply
David Chartier said 7:36PM on 9-24-2007
@Admiral: "5. way too much work for a phone - no matter how cool it is..."
I didn't unlock my phone, so I don't have to do any work. Most iPhone owners didn't unlock or even jailbreak their iPhone to install apps on it, so they don't have to do any work either.
So the badass, game-changing cool factor certainly hasn't been lost on the greater majority of us. :)
Reply
Robert Lindsley said 7:50PM on 9-24-2007
dlaw, I just did an iTunes "Restore" command rather than use iASign and now my iPhone says "Incorrect Sim - Insert an unlocked and valid SIM to activate iPhone." Any thoughts on what I should do now?
Reply
Andy C. said 7:58PM on 9-24-2007
Erica, can you please clarify if this method works for iPhones unlocked using the paid iPhoneSimFree unlock method, the free AnySim method or both? I think it needs to be clarified.
Reply
Adam Snow said 7:58PM on 9-24-2007
Remember - This is only required if you HAVE to upgrade... If you never update your phone, you can use it in it's current state forever... The update is done through iTunes, not OTA.
Just don't update until the Dev Team has a solution.
Reply
why not the LS2/LS7? said 8:01PM on 9-24-2007
Just one warning: there's no guarantee you'll be able to unlock your phone after the upgrade. Jailbreaking isn't working on the Touch, it may not work on the iPhone with the updated SW.
Reply
VanillaSpice said 8:02PM on 9-24-2007
Yeah, Callum, there is a Mister über-iPhone-Hacker, sorry to relate.
And in any case, there is a line here, you know, if Doctor Sadun is ever on the open market again, you'll have to wait for the rest of us to try and woo her first.
Reply
nodis said 8:05PM on 9-24-2007
Peter --
Exactly the same think happened to me. I originally used Erica's GUI application "Unlock.app" to unlock my iPhone. (This was the one to use before anySIM came out.)
The unlocking worked flawlessly (thanks, Erica!). Truthfully, I had unlocked the phone just for fun, so last week I decided to relock, using the instructions Erica just posted that I found on hacktheiphone. The reflashing of the baseband worked fine but I then had a hosed phone -- I could not activate any of my AT&T SIMs (even a legitimate one, using iTunes) even after restoring the firmware. The only way I was able to get my phone to work again was to run anySIM, and re-unlock the iPhone.
I'm curious, Peter -- how did you originally unlock your phone? With Unlock.app?
For me, at least, I'm worried that the unlocking permanently damaged my phone's firmware. Sigh. I may have to drop the phone so my credit card's damage protection will kick in.
Reply
jh said 8:09PM on 9-24-2007
FYI -
This method seems to nuke the ICCID information for the SIM card as far as the iPhone is concerned. I am not certain if this would occur if you can manage to remove the SIM card at some point during the flashing process or if there is any real approach to avoid this end result.
The SIM card, while unusable in the iPhone, still worked in my old blackberry... go figure.
Anyway, the theoretical solution is to stroll into your local ATT store, play dumb, and get a fresh, new & most importantly free SIM card. I would recommend doing this sooner than later before a memo goes out to stores regarding a potential flood of iPhone owners experiencing this mysterious problem with SIMs having unknown ICCID issues...
However, in my particular case, iTunes sees this new SIM as an unsupported card.
Reply
palex9 said 8:17PM on 9-24-2007
lets all keep our sanity here. if you unlocked your phone and its usable now, just hold on and wait, just because apple is coming out with an update (probably the itunes download feature, who needs that anyway) doesnt mean you have to, lemming wise, immediately try to upgrade your phone. in fact that re-locked upgrading and then trying to unlock again might be the straw that broke the camels back = you now
Reply
Milhaus said 8:18PM on 9-24-2007
Am I not getting something? Why the worry? Just don't update iTunes, or the phone itself . . . So we may be short of a few services until folks figure out how to unlock it, but that's all. In Canada, none of the new services work anyway. Are people thinking that there's a planned forced upgrade - i.e. no ability to sync without updating? I can do with ITMS, wireless downloads, etc.
Reply
JeffDM said 8:35PM on 9-24-2007
The problem with not updating is that Apple does roll-out subtle changes in each update, and you'll miss out on them. If you don't want iTunes WiFi, then that's fine, but what other updates might be in store?
Reply