Make Siri Do What You Want With SiriProxy On Mac OS X And iPad 3

siri proxy macI’ve been wanting to try out SiriProxy for some Arduino home automation projects, but I refuse to buy a new phone when my iPhone 4 is still working just fine (yes, I stopped using my HTC One X; 6 months with Android is more than enough for me). But then I realized; I have Siri already, on my iPad 3. Surely I could use that? Indeed you can. So in this tutorial I’ll walk you through getting SiriProxy working with your iPad 3 and Mac OS X – much of this will be relevant to Mountain Lion only though.

I also warn you in advance, this is pretty difficult stuff and almost all done on the command line, and while I’ve tried to break it down step by step in the exact manner that worked for me, you may need to Google some errors yourself as and when they arise.

Requirements

  • iPad or iPhone with Siri capabilities. I won’t be showing how to hack Siri onto older devices using fake servers, so don’t ask.
  • Mac OS X. You can install SiriProxy on Linux too but I won’t be trying that today.
  • iOS6.1

Preparing

Download the pkg installer for your OS X version from MacPorts.org. MacPorts allows us to install a variety of UNIX utilities that have been ported to Mac. You also need to have XCode installed, which can be downloaded for free from the Mac App Store, but it’s a hefty download so get started now.

siri proxy mac

MacPorts adds some new path entries to your system, but doesn’t update correctly. To avoid port command not found errors later, run

source .profile

At this point, you’ll need to install XCode too, from the app store. When installed run this command to tell your system where the compiler is:

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

Next, install DNSMasq; a simple DNS forwarder that let’s us intercept requests to a certain IP.

sudo port install dnsmasq

Install Ruby and RVM

Download and install RVM package manager with this command:

bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)

Then run this to correctly add it to your system:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"

Install Ruby using the following command; this will use the latest version 1.9.3 at the time of writing, and I suggest you do the same or the rest of this guide probably won’t work.

rvm install 1.9.3

siri proxy mac os

If you get a bunch of random red text with an error, run this instead:

rvm install 1.9.3 –with-gcc=clang

then do

rvm use 1.9.3 default

to set the default ruby environment version. Congratulations, you now have Ruby on your system!

Download SiriProxy

Begin by using Git to clone the SiriProxy project to your machine.

git clone git://github.com/plamoni/SiriProxy.git
cd /SiriProxy

When you first do this, you may get a security warning about script files detected. Go ahead and trust this if you’ve download from the github source.

siri proxy mac os

Next we’re going to copy across the config file.

mkdir ~/.siriproxy
cp ./config.example.yml ~/.siriproxy/config.yml

Open up that config file using your favorite text editor, and change the IP at the top of the file from 0.0.0.0 to your Mac’s local IP. Moving on:

rvmsudo gem install rake bundler
rvmsudo rake install

This should install SiriProxy for you, but we’ll need to repeat this later on to deal with errors. For now, let’s continue and make some certificates.

We’ll need OpenSSL installed first.

sudo port install openssl

The first time I ran this, it failed with numerous zlib errors; to fix this I needed to run

sudo port -f activate zlib

Next, we’ll generate certificates:

siriproxy gencerts

If all goes well, you should see a message similar to this.

siri proxy mac os

Use the Finder->Go to Folder menu option to enter the path listed in the output; you should find a ca.pem file there. Email that to yourself, and then open it on your Siri capable device. This will jump over to settings, and give you the option to install it as a new certificate. Not, yours will say it’s untrusted (in red) the first time around – I took this screenshot after installing, so it says trusted.

siri proxy ipad

Back on your Mac, run the following command to update some random files that are needed.

bundle install

Setup DNS forwarding

The final step is to make your Mac into a DNS server that can intercept calls to Apple’s servers and route them via SiriProxy instead. Again, using Finder->Go To Folder, open up /opt/local/etc, and edit dnsmsq.conf. Add the following line, replacing 192.168.0.6 with the local IP address of your Mac.

address=/guzzoni.apple.com/192.168.0.6

siri proxy ipad

To activate DNSMasq service, run the following. You’ll need to do this upon every restart (along with launching SiriProxy as we describe later).

sudo /opt/local/sbin/dnsmasq

On your iPad, or iPhone, open your network settings and change the DNS server of the WiFi to your Mac IP address. Yes, SiriProxy will only work over your home WiFi, but you can theoretically VPN into your home router if you wish to use it while out and about. We won’t cover that today.

I also needed to set a new port forwarding rule on my router; port 53 should be forwarded to your Mac IP. (This is the port used by DNS)

Start SiriProxy

The final step is to start the SiriProxy server and test. Do this using:

export rvmsudo_secure_path=1

If at this point, you are getting a screen full of errors like “invalid symbol” as soon you press the home button, continue on with this bit. You’re getting errors due to an older version of CFPropertyList included with the SiriProxy package. Hopefully this will be fixed soon, so you may not need this, but just in case…

Download the newest version of CFPropertyList like this:

sudo gem install CFPropertyList -v 2.1.2

Now, use Finder to Go To Folder ~/.rvm/gems/ . Navigate inside the lastest Ruby – in my case ruby-1.9.3-p385/ and copy the gems/CFPropertyList-2.1.2/lib folder over to ruby-1.9.3-p385@SiriProxy/gems/CFPropertyList 2.2.0 . Yes, authenticate and overwrite the older version lib with the lib from the newer version; a horrible hack, but the only way I could get it working. The final fix needed is to manually edit the gemspec file. Do this by changing to the SiriProxy directory, and opening up siriproxy.gemspec. Do this from the command line with VI or Nano using:

sudo vi siriproxy.gemspec

Or just use a text editor. Replace the line which is about 4 lines from bottom containing “CFPropertyList” with the following:

s.add_runtime_dependency('CFPropertyList', '2.1.2')

Now run

rvmsudo siriproxy update

And all should be good with the world. Start the server again and retest.

rvmsudo siriproxy server

 

siri proxy ipad

Test it by asking Siri to “test siri proxy” and you should get a response that it’s up and running. View more test commands here.

siri proxy mac

Next time, we’ll look at some SiriProxy plugins you can run and actually start making use of this thing.

To be honest, that whole process was more immensely complicated than I hoped, but I hope this guide turns out useful for some of you, since it literally took me all day to get right. Do you have any recommendations for SiriProxy plugins that I should check out? Did this process work for you? Let us know in the comments, and I’ll try to help you out, but the project GitHub page is full of far more knowledgeable folks.


MakeUseOf Recommends

James Bruce

James is a keen gamer with a passion for the iPad, and records Technophilia - an awesome but somewhat NSFW technology podcast - weekly with Justin and Dave.

Leave a comment

Get a MakeUseOf account using one of your online accounts below.
Why? Earn points, unlock giveaways, access locked exclusives.

Hide 4 Comments

  • Rehab Engineering February 25, 2013
    0 likes

    Wow. That is a stunning bunch of hoops to jump through. Myself, I would have just bought a Windows Pro tablet and installed Dragon Naturally speaking. At least it has access to any sort of applications and scripting, not just “native’ ones, and doesn’t need internet connectivity. I do appreciate the ipad based effort and smarts used to execute this….but I’d hope consumers would really shop for what they need. Often it seems like people buy an ipad then someone very “techy” cobbles things together to try and make it useful, whereas if they had just bought a suitable “other” device, they could have had a better solution with less hassle.

    • Muo TechGuy February 26, 2013
      0 likes

      If your main aim is to get customized speech recognition, then I would agree – there are better devices than an iPad for that, at least until Apple opens up the SDK for developers to integrate with Siri.

      But there is no comparison otherwise between an iPad and a windows/android tablet, so I’m not sure that’s a valid argument. Saying you need some cobbled together techy solution to make an iPad “useful” seems to be missing the point. People will always push the boundaries of what is possible on any device, and certainly that’s more difficult on Apple products, but that doesn’t negate the fact that the iPad is the best tablet out there for general use, bar none.

  • Hank March 3, 2013
    0 likes

    Thanks a lot–it works for me! I’ve been searching for a step-by-step setup for Mac for a very long time. You should try FindMyIPhone plugin.

    I’d like to jump the gun a bit and understand how to get this setup working over the Internet via 3G. The best I’ve found is the following steps:

    For iPhone without Jailbreak
    I must create a network VPN solution with dyndns.org or other personal domain

    For iPhone with Jailbreak
    1) Edit the etc/hosts and add
    example.dyndns.org guzzoni.apple.com
    2) Edit the com.apple.assistant the file and add
    Hostname
    http://example.dyndns.org

    3) Edit the ~/.siriproxy/config.yml with the updated IP
    4) Re-generate the certification and send it to the iPhone again

    I haven’t tried it yet and would like your input before I mess things up.

    • Ihf March 23, 2013
      0 likes

      Will Siriproxy work remotely if the server has a fixed IP address or is there something inherent in how this is done that precludes remote use except via the process described here?