Turning off parental restrictions on the iPhone when you’ve forgotten the PIN

FOLLOWUP:

I followed these instructions, but alas, they do not work under iOS 6.1.3. I got an OK restore, but still couldn’t unlock Parental Restrictions. I used iExplorer to backup all my text messages and voicemails, and did a “set up as new device” to get a known passcode on Parental Restrictions again.

This is, not to put too fine a point on it, a real pain. Fortunately the nice folks at iphonebackupextractor.com had the steps lined out; I just needed to do a little command-line tinkering to make it work. So here’s the rundown:

  1. Turn off the password protection of your backups. (If you’ve forgotten this one too you may be stuck.)
  2. Take a backup via iTunes.
  3. Open Terminal.
    1. cd ~/Library/Application\ Support/MobileSync/Backups
    2. ls -lart
    3. cd (the latest one, which will be the last one listed)
    4. cp 662bc19b13aecef58a7e855d0316e4cf61e2642b ~
    5. openssl sha1 662bc19b13aecef58a7e855d0316e4cf61e2642b
    6. Copy the resulting SHA1 for later.
    7. plutil -convert xml1 662bc19b13aecef58a7e855d0316e4cf61e2642b
    8. Using the editor of your choice, look for “SBParentalControlsEnabled” and make sure the value below it is “true”. If it isn’t, you won’t be able to do the rest of this.
    9. Add these two lines right below “true”:

      <key> SBParentalControlsPIN</key>
      <string>1234</string>

    10. Save.
    11. openssl sha1 662bc19b13aecef58a7e855d0316e4cf61e2642b
    12. Record this new SHA1.
    13. cp Manifest.mbdb ~
    14. Open Manifest.mbdb with a hex editor. I used Hex Fiend.
    15. Find the first SHA1 you saved.
    16. Replace it with the second one. This is quite easy with Hex Fiend, as the “Find…” operation lets you cut and paste the hex strings directly into the find-and-replace boxes.
    17. Save.
  4. Go back to iTunes and restore this backup. Make sure you get the backup you just edited.

You should now be able to access parental controls again if you got all the steps right. If not, copy the two files you backed up to ~ back into the backup directory and restore the backup again. You should be in no worse shape than you were before.