Saturday, December 31, 2011

How to Install and Configure Spire and SiriProxy

Introduction:

This will (hopefully) assist you in setting up a SiriProxy server so you can safely configure Spire on your non-4S devices. This is by no means complete and there are some (minor) bugs. One found so far is that you can't use the 4S and non-4S device to make Siri requests simultaneously. guzzoni will not respond. You will need the following:
  • The ability to fully read this guide
  • Basic knowledge of a linux command line. (You shouldn't be near this if you don't meet this one.)
  • Ability to SSH into your phone to edit files. (WinSCP or Cyberduck work well.)
  • A domain name or dynamic dns for your server so you can use Siri over 3G on your non-4S device. (Not explaining this, you should know how to get this and forward ports in your router.)
  • A working Ubuntu install with a static IP address (Virtual Machine is fine.) OSX should work as well, but I'm not writing this for OSX
  • SiriProxy (westbaer's fork)
  • An iPhone 4S on the same network.
  • A jailbroken non-4S iDevice running at least 5.0 with OpenSSH installed
**If you don't already have SBSettings (helpful for toggling SSH) & OpenSSH installed please do so now before proceeding and reboot your device.**

Step 1: Install Spire

This is quite possibly the easiest step of this guide. Make sure you are connected to WiFi, its a 100MB download.
  1. Fire up Cydia, let the updated package lists download.
  2. Go to the Search tab and, you guessed it, search for Spire.
  3. Install Spire and wait while it downloads. I had some issues here with my phone auto-locking, so make sure you don't let that happen.
  4. After the download is finished, tap Reboot Device.
After the reboot you can navigate to Settings > General and see that Siri is indeed on the device. Now we'll get that bad bitch working.

Step 2: Install SiriProxy

First things first, make sure your server has a static LAN IP and a dynamic dns set up in your router (or domain). Forward port 443 to your server.
There has already been a great guide and tutorial for installing SiriProxy created by plamoni on GitHub, and it ain't broke, so we're not fixing it. Make sure to read through this and familiarize yourself with the commands. Head on over to https://gist.github.com/1428474 and follow all the steps. There is also a video of him going through these steps here if you would like a visual aid.

When you get to the clone SiriProxy repo step (Lines 45-46) MAKE SURE you change the line to "git clone git://github.com/westbaer/SiriProxy.git" Not optional.

After you follow all the steps and do 'rvmsudo siriproxy server' You will see the server start with "Starting server on port 443."
  1. Make sure your iPhone 4S has the generated ca.pem certificate installed and is on the same local network as the server.
  2. Change your DNS address under Settings > Wifi to the IP of your server.
  3. Hold the Home button to bring up Siri and say "Test Siri Proxy" you should see some data start flowing in the terminal and a "Siri Proxy is up and running!" response on your phone.
If you were able to successfully test SiriProxy you are ready to move on. Don't move on from this step unless your iPhone 4S gets successful responses from the SiriProxy test.

Step 3: Configure non-4S Device

Now that we have our iPhone 4S running like a champ on SiriProxy, it's time to set up the non-4S device. Follow these steps and this will be painless.

  1. Remember that ca.pem file you emailed to yourself while setting up SiriProxy? Open and install it on your non-4S device now.
  2. Now go to Settings > Spire and set your Proxy Host to "https://guzzoni.apple.com"
  3. SSH into your phone and edit your /etc/hosts file to point requests for guzzoni.apple.com to your server. (example: your.dyndns.com guzzoni.apple.com)
  4. While you're digging around in there, mosey on over to /var/mobile/Library/Preferences and copy com.apple.assistant.plist to your desktop. (Windows users need a plist editor for this next step. Google.)
  5. Open up the plist we just copied and under Root > Accounts > Big Hex Key add the following items so yours looks like mine: (My hex key is all F's in the picture to hide my unique key. The Value fields for the 3 items you create are irrelevant.)
  6. See Pic above
  7. Copy the plist you just edited back to it's home in /var/mobile/Library/Preferences (and the edited hosts file back to /etc/ if you haven't done so already.

Step 4: If you didn't screw it up...

It's about to get real.

One more time, for good measure, test SiriProxy one more time from your 4S. ("Test Siri Proxy")

If this works, time to try the non-4S device you just bestowed badassery upon. Same thing but this time from the non-4S device. "Test Siri Proxy"

If this works, pat yourself on the back. Change the DNS on your iPhone 4S back to whatever it was before. Relax, Gloat and most of all donate to the creators of these awesome utilities if you can, they worked the magic that put that victory smile on your face.

Tips for Maintaining the Greatness

  • If the 4S you're sharing a key from and non-4S device attempt to use Siri at, or around the same time, this causes a temporary unresponsiveness on both devices.
  • It isn't necessary to leave the DNS setting on your iPhone 4S pointing to your SiriProxy server if you have access to that 4S on a daily basis. This is only necessary to update the auth tokens once a day. If you desire to leave the SiriProxy server DNS on your phone (I don't because I'm not yet using the proxy for any of the other cool things it's capable of), just tack on your normal DNS server on the end with a comma. (siriproxy.dns.ip, normal.dns.ip)
I'll add more things here when I think of it.

In Closing...

I wrote this quickly because I was excited to finally have this working over 3G and I know there are others out there itching to do the same thing. If you have any comments you can reach me on EFNet (method).

Everything in this guide is the product of many, many comments left by awesome people on GitHub. Just for completeness, you can read them here. Specifically, issues #210#222, and most definitely #226 were the ones that had some serious work put in to. Without those awesome people, I'm sure this wouldn't be done yet.

[Methoddk]

2 comments :

  1. i am some what new at this but do you think you could make a video also? it would greatly appreciated!

    ReplyDelete
  2. Did you actually get it to work?
    Where it says: SSH into your phone and edit your /etc/hosts file to point requests for guzzoni.apple.com to your server. (example: your.dyndns.com guzzoni.apple.com) makes no sense to me, I ended up putting something random that I read on a forum in place of your.dydns.com (since I have no idea what your.dydns.com is supposed to mean) and edited my .plist file but get the errors that the author of this article claims are indicative of a .plist file problem, but I added the same fields "Ace Host, Speech Identifier, and Assistant Identifier" with either blank or random string values and no dice on my iphone4.

    ReplyDelete