Multi-Process Siri Proxy with Automatic Authentication for iPhone 4/3GS/iPod Touch

NOTE: Read entire post and the Additional information at the bottom before proceeding.

So you have access to an iPhone 4S, but also have a Jailbroken iPhone 4 or 3GS or iPod Touch and would like to run Siri on it.

When completed, you will have two processes of SiriProxy Server (Two separate Terminal Windows) which allows you to connect/use Siri on all hardware (iPhone 4/3GS etc) which runs Siri (Spire is what I will be using) while also allowing your (or a family/friends) iPhone 4S to connect (On your Wifi Network) and automatically save its Authorization Tokens. You will not have to edit information on your iPhone 4/3GS using this method since it will store the Siri Auth. Tokens locally on your new SiriProxy Server. OH YEAH!

Things you need:
1. Siri (Spire Installed on Jailbroken iPhone 4/3Gs)
2. An iPhone 4S (to connect to your proxy so it grabs the new Auth. Tokens when Apple renew’s them)
3. Linux / MacOS (Im doing this on a Mac with Ubuntu running in VMware Fusion but will soon try to install this in Mac OS directly)

4. A Modified SiriProxy – Download Multi-Process SiriProxy
5. DNSMASQ Setup

1. Installing all needed Tools (Run these commands in an Ubuntu Terminal Window):
sudo apt-get install dnsmasq ruby build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion

sudo apt-get install openssl

sudo apt-get install libopenssl-devel

sudo apt-get install zlib

sudo apt-get install zlib-devel

sudo apt-get install ruby

sudo apt-get install ruby-gems

sudo apt-get install make

sudo apt-get install gcc

sudo apt-get install gcc-c++

sudo apt-get install libxml2*
(If some of these steps fail (zlib etc), continue and see if you we get errors later when starting the server)

All needed ruby gems:
sudo gem install eventmachine — –with-ssl-dir=/usr/bin/openssl
sudo 
gem install CFPropertyList

sudo gem install httparty

sudo gem install json
sudo 
gem install uuidtools

2. Create a Directory:
mkdir ~/Siri

cd Siri
Copy the “Multi-Process” SiriProxy folder/files in here

cd SiriProxy

3. Create your Certificates for iPhone 4S:
(You can use any Password and any Information to create these certificates)

openssl genrsa -des3 -out ca.key 4096

openssl req -new -x509 -days 365 -key ca.key -out ca.crt

openssl genrsa -des3 -out server.key 4096

(IMPORTANT: This cert is used by the iPhone 4S. Enter guzzoni.apple.com in “common name”)

openssl req -new -key server.key -out server.csr

openssl x509 -req -days 365 -in server.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out server.passless.crt


openssl rsa -in server.key -out server.key.insecure


mv server.key server.key.secure


mv server.key.insecure server.passless.key

Install the certificate on your iPhone 4S:

Email (Or just drag to your desktop from VMWare and email) the ca.crt file to yourself and open it in your iPhone 4S. Then press install.

Create your Certificates for iPhone 4/3GS etc.:
I made a copy of the SiriProxy Dir and ran the below commands in the new copied SiriProxy2 dir.

(You can use any Password and any Information to create these certificates)

openssl genrsa -des3 -out ca.key 4096

openssl req -new -x509 -days 365 -key ca.key -out ca.crt

openssl genrsa -des3 -out server.key 4096

(IMPORTANT: This cert is used by the iPhone 4/3GS. Enter your ubuntu IP address (example: 192.168.1.100) in “common name”)

openssl req -new -key server.key -out server.csr

openssl x509 -req -days 365 -in server.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out server.passless2.crt

openssl rsa -in server.key -out server.key.insecure

mv server.key server.key.secure

mv server.key.insecure server.passless2.key
(NOTICE the above commands used a “2” at the end. This is the second certificate for use with iPhone 4/3Gs)

Install the certificate on your iPhone 4/3GS:

Email (Or just drag to your desktop from VMWare and email) the ca.crt file to yourself and open it in your iPhone 4S. Then press install.
Now COPY the server.passless2.crt and server.passless2.key to your original SiriProxy dir.

EDIT siriProxy2.rb file:
This file is for your iPhone 4/3GS process and will reflect the Ubuntu IP address and DIFFERENT port number then the default siriproxy.

Change this line in siriProxy2.rb to reflect your IP address:
EventMachine::start_server(‘192.168.1.20’, 1000, SiriIPhoneConnection)

4. Setting up DNS on your Ubunto Virual Machine:
Edit DNS MASQ:
sudo nano /etc/dnsmasq.conf

Look for the #address=double-click.net/127.0.0.1 line and under it you will add the next piece of text: address=/guzzoni.apple.com/192.168.1.x (ip-address-of-your-ubunto)

After this you have to save it CONTROL O and Exit Control X in the terminal application type the following command restart dnsmasq:
sudo /etc/init.d/dnsmasq restart

WE ARE READY TO START THE SIRIPROXY!
Open TWO terminal windows:

Terminal Window One (iPhone 4S SiriProxy)
sudo ruby start.rb

Terminal Window Two (iPhone 4/3Gs SiriProxy)
sudo ruby start2.rb

CONFIGURATION NOTES on iPhone(s) Settings app.:
(iPhone 4S)
Working Siri Setup with guzzoni.apple.com Certifcate:
DNS Settings for your WIfi connection on iPhone 4S Points to SiriProxy Server: 192.168.1.x
(This will change once iPhone 4S is Jailbroken and we can change the IP on the Phone itself)

(iPhone 4/3GS)
Working Siri Setup with 192.168.1.x Certifcate:
DNS on iPhone 4/3GS: (NO CHANGES REQUIRED on iPhone 4/3Gs)
Spire/Siri – Proxy Server Set to: https://192.168.1.x:10000 (IP of your SiriProxy and Port# set in siriProxy2.rb)

You can also use Siri when away (on 3G data) from your home network. You will need a DynDNS type service and create that second certificate (the cert with IP address 192.168.1.x for iPhone 4/3Gs) to the host name you assigned in DynDNS (example: siri.dyndns-home.net) as well as use “port forwarding on your router for port 1000 pointing to your SiriProxy Server IP address, set the Spire Proxy Server IP to match your new DynDNS Host name (example: https://siri.dyndns-home.net:1000).

OTHER HELPFUL INFORMATION:
Ubunto on your Mac: Video Help from iDownload Blog
Step 1: If you have Ubuntu already installed, great! If not, that’s okay, too. If you’re on a Windows box, you can install Ubuntu outright as if it was just another program. If you’re on a Mac, you can install Ubuntu as a virtual machine using software like Parallels 7 or VMWare Fusion. In this tutorial, I use Parallels.

Step 2: Install the latest Ubuntu updates if applicable. Please see 1:00 on the video tutorial.

Step 3: If you’re using Parallels, or any other virtual machine, you will need to set the Internet connection to bridged mode so that devices on your network can interface directly with the virtual machine. Please see 4:00 on the video tutorial for more info.

Note: Big thanks to http://Interlync.com for help and hosting some things for me. SiriProxy is not coded by me. And parts of this tutorial was originally posted at the Ketchup blog, but was missing a few steps for this type of install.

Advertisements

29 thoughts on “Multi-Process Siri Proxy with Automatic Authentication for iPhone 4/3GS/iPod Touch

  1. Hi,

    By entering the ruby gem commands in the terminal, it return me the following message : “sudo: gem: command not found”. Are they absolutly necessary for the rest of the tutorial ?

    • If you do get errors on your machine, just continue on and note which you got errors on. Be sure to run that “BIG” command:

      sudo apt-get install dnsmasq ruby build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion

    • attention to the copy / paste command post on the tutorial contains some extra space so they should be deleted

      google traduction …

  2. this is awesome i have been using it for a few days now. but how would i go about using plugins with this siri proxy as well?

    • good question, I have tried to install plugins and failed. I will look into it more and figure that out next. Glad its working for you. Ive been using it for a few weeks now, and it rarely crashes, but you can turn on Remote Login in Ubunto and use Mac Screen Sharing or VNC to login remotely and restart the process.

    • The Process (Server) doesn’t report its running when you start it (Like some of the others), if you try and connect and see nothing on the screen, Check or redo your certificates. The Certificates are KEY to getting this to work.

  3. Hi, very nice tutorial. Before doing it I wanted to know something.
    When an iPhone 4S connects (with the iPhone 4S certificate), this SiriProxy grabs the auth keys from it automatically, and then when an iPhone 4 connects (with the iPhone 4 certificate and Spire), it works ? I don’t need to manually enter the x-ace-host and the validation data ?

  4. I finally followed you tutorial. But unfortunately, I get an error at the last step, when running the 2 commands. Any solution ?

    parallels@ubuntu:~/Siri/SiriProxy$ sudo ruby start.rb
    /usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:572:in `start_tcp_server’: no acceptor (RuntimeError)
    from /usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:572:in `start_server’
    from ./siriProxy.rb:400:in `initialize’
    from /usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `call’
    from /usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine’
    from /usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run’
    from ./siriProxy.rb:399:in `initialize’
    from start.rb:11:in `new’
    from start.rb:11

    parallels@ubuntu:~/Siri/SiriProxy$ sudo ruby start2.rb
    /usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:572:in `start_tcp_server’: no acceptor (RuntimeError)
    from /usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:572:in `start_server’
    from ./siriProxy2.rb:400:in `initialize’
    from /usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `call’
    from /usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine’
    from /usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run’
    from ./siriProxy2.rb:399:in `initialize’
    from start2.rb:11:in `new’
    from start2.rb:11

  5. Ok so i have done all required however seem to have this error running it
    $ sudo ruby start2.rb
    ./siriObjectGenerator.rb:2:in `require’: no such file to load — rubygems (LoadError)
    from ./siriObjectGenerator.rb:2
    from ./plugins/thermostat/siriThermostat.rb:3:in `require’
    from ./plugins/thermostat/siriThermostat.rb:3
    from start2.rb:2:in `require’
    from start2.rb:2

    thinking should reinstall ruby fully… damn sigh* any suggestions?

    • ok line 2 states it requires the ruby-gems package… have a feeling this was not installed running apt-get… ahhhhhaaa… apt-get does not find the package

      $ sudo apt-get update
      $ sudo apt-get install ruby-gems
      Reading package lists… Done
      Building dependency tree
      Reading state information… Done
      E: Couldn’t find package ruby-gems

      are ruby-gems perhaps installed along with apt-get install ruby?

      • appears rvmsudo gem install XXXXX works, but running rvmsudo with
        $ rvmsudo ruby start.rb
        doesnt work, spits out error

  6. ok so if anyone is having problems here are some solutions (its 3am so ignore spelling :P) (Bolded words dont mean shouting! 🙂 )
    $ sudo apt-get install ruby-gems — NO LONGER EXISTS
    rather do this (The beginning)
    fire up synaptic package manager, uninstall everything to do with ruby, like me i had ruby 1.9.3 running through rvmsudo.. yeah.. ok now once all ruby + dependacies are done, look for ruby 1.8.x – on synaptic its version 4.3 or something, read info for the 1.8.x comment, install that / $ sudo apt-get install ruby .. once completed you can install rubygems but before that run in terminal $ ruby –version .. just to double check if its the correct version matches 1.8.x, now in synaptics look for rubygems or $ sudo apt-get install rubygems.. yaaay we have gems installed, run $ sudo gem to see what happens :D… now install all the gems… but now hold on just a minute!! gems can now be installed (hopefully) but there seems to be a problem concerning certain missing packages when running the start & start2.rb, if you have problems with something along the lines of net/https or gem_require etc or requiring certain missing librarys.. fire up terminal and $ sudo apt-get install ruby-full… this installs the full ruby package… also the zlib installation $ sudo apt-get install zlib + zlib-devel no longer exists.. but ill ignore that but install zlib1g package and report back (already installed running that super big sudo command), (this was done with ubuntu desktop 10.04 formatted and installed over ubuntu server) aka its a fresh install 🙂

    • confirmed working.. you dont see anything in terminal.. terminal doesnt spit back to $ entry just sits almost at awaiting a entry type thing almost like its taking forever to load… hope my stuff helps you guys out.. sorry 5 posts, just thinking might help others out that are at a specific step 🙂 gordo out 🙂

  7. Apple renews their authentication keys roughly every 24 hrs. Does this setup automatically update the proxy when those keys are changed?

  8. Question. So in my family we have one 4s and three 4. So I want to be able to setup a proxy so I can have the other three iPhone 4 to Siri. Will I have to grab auth tokens from the 4S every night. Or will this setup automatically grab it from the 4S?

  9. Hi.

    I have few questions.

    If I have a jailbroken 4S, do I still need to modify my DNS settings or can I change com.apple.assisstant.plist to point to my internal/external IP for the Siri Proxy?

    Do I need certificates for both 4 and 4S, or just 4S?

    SSL port is already forwarded to an existing Windows Server, can I use some other port if both iPhone 4 and iPhone 4S are jailbroken?

  10. K2 Design Lab ,
    thank you for your great work.you said the token is automatically grabbed every 24 hours. can this be done via VPN. for example. if my friend, who has the iPhone 4s, does not stay at my house, will my proxy server be able to grab the authentication token via VPN. if so, can you please provide me the steps.
    Thank you in advance

  11. Hiya very nice web site!! Man .. Beautiful .. Wonderful .
    . I will bookmark your site and take the feeds also?
    I’m glad to seek out a lot of helpful info right here in the put up, we need develop extra techniques in this regard, thanks for sharing. . . . . .

  12. Hi! I’ve been reading your web site for a long time now and finally got the bravery to go ahead and give you a shout out from Dallas Texas! Just wanted to mention keep up the fantastic work!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s