SiriProxy Guide for Windows

For purposes of this tutorial I have been using Windows 7, Please note this tutorial is in beta. It will be improved as I get more feedback from you guys :) 

Install Ruby and DevKit:

Download necessary files here and here
  • Run Ruby '1.9.3.exe'
  • Install to desired path (I used default C:\Ruby193)
  • Select all optional installation extras
You will now have 'Start Command Prompt with Ruby' in your menu, This is what we will be using.
(I will refer to this in guides as RubyCMD)
  • Open 'Ruby DevKit 4.5.2' (Please Run After fresh ruby install [No extra gems installed])
  • Extract to chosen destination (I chose C:\DevKit and recommend this)
  • Open RubyCMD
Run:
 cd C:\Devkit
 //*[or your chosen install directory]
 ruby dk.rb init
 ruby dk.rb install

Testing the install:
 gem install rdiscount --platform=ruby

You should see: Temporarily enhancing PATH to include DevKit...

Confirm gem is working:
ruby -rubygems -e "require 'rdiscount'; puts RDiscount.new ('**Hello Ruby Installer**').to_html'"

Congratulations you now have Ruby with DevKit installed on Windows.
*Credit for installed to 'RubyInstaller for Windows'*

For OpenSSL download the following files:
  • 32-bit or 64-bit
  • Install to C:\OpenSSL
  • Note: You may need to install Microsoft C++ 2008 Redistributables. Get them here:
  • Microsoft C++ 2008 Redistributables: 32-bit or 64-bit
  • Choose to Copy OpenSSL DLLs to \bin directory.
  • Now we need to add this to the system path.
  • Open: Control Panel, System, Advanced, Environment Variables,System Variable.
  • Edit the variable named 'path' and add:
  • ;C:\OpenSSL\bin
  • At the end of the current value.
  • Apply and close
Open RubyCMD and type:
 openssl

You should now start OpenSSL in RubyCMD with no errors congratulations!


Download Python:
  • 32-bit or 64-bit
  • Install to C:\Python
  • Choose to Copy OpenSSL DLLs to \bin directory.
  • Now we need to add this to system path.
  • Open: Control Panel, System, Advanced, Environment Variables,System Variable)
  • Edit the variable named 'path' and add:
  • ;C:\Python
  • At the end of the current value.
  • Apply and close
Open RubyCMD and type:
 python

Python should now start in RubyCMD.

We now need to install necessary gems


Open RubyCMD and run:
 gem install CFPropertyList 
 gem install eventmachine --pre


Install libxml2:
  • Download necessary files Here
  • Move both iconv.dll and libxml2-2.dll to C:\Ruby193\bin
Generating the certificates
  • Download the SiriProxy files here, and extract to C:\SiriProxy
  • Create folder C:\SiriProxy\Certs
Open RubyCMD as Admin and run:

(When prompted for password enter whatever you wish. I recommend you choose the same password whenever requested to avoid confusion.
When requested you can enter whatever company information you wish, except at all times enter your PCs IP address as common name, and put in no challenge password.)


 cd C:\SiriProxy\Certs
 openssl 
 genrsa -des3 -out ca.key 4096
 req –new –x509 –days 365 –key ca.key –out ca.crt
 genrsa –des3 –out server.key 4096
 req –new –key server.key –out  server.csr

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

 rsa –in server.key –out server.key.insecure



 Exit

 move server.key server.key.secure
 move server.key.insecure server.passless.key


In your C:\SiriProxy\Certs folder you should now have the file ca.crt:
  • Email to your iDevice and install by opening the file on it.
Move server.passless.key and server.passless.crt to C:\SiriProxy


Install required gems


Run:
 gem install httparty


Now create files called:

  • speechId
  • assistantId
  • sessionValidationData
In each of these files you need to enter the keys you gained from your iPhone 4S. Place these in C:\SiriProxy


Running the DNS
  • Download the DNS script here
  • Extract dns.py to /yourpath/DNS
  • On line 29 edit 'YourIPGoesHere' with the ip address of your PC
  • On Your phones Wi-Fi, click the blue icon and set the DNS to the IP address of your PC.
Run:
 cd /yourpath/DNS
 python dns.py

Start the server


Run:
 cd C:\SiriProxy
 ruby StartProxy.rb

Now test by saying "Test SiriProxy" to the phone.


Please Share and follow @BraddStevo


The more feedback the more I will work to help and make these guides easier



68 comments:

  1. I appreciate this a lot but for those to enjoy it that are complete noobs, I feel like you need to dumb this down quite a bit.

    ReplyDelete
  2. Okay ill start trying to dumb it down, was hard to find a balance between keeping the guide relatively short and how easy it is to follow

    ReplyDelete
  3. Would you ever consider a good ol fashioned YouTube step by step tutorial? I feel like this would be a HUGE asset to the community since one just doesn't exist. You'd be a hero! Haha

    ReplyDelete
  4. it is pretty clear up to this part: Running the DNS
    so if you could elaborate a bit that would be great. thanks!

    ReplyDelete
  5. I will be looking into doing videos for everything soon, still not happy with how easy they are to follow and this feedback is great :) with regards to last comment, do you mean installing all the required files is fine but you are struggling after this? or the other way around? :)

    ReplyDelete
  6. I actually got everything working down to this line: siriproxy gencerts. I get an error on that command. thanks very much!

    ReplyDelete
  7. Hope you guys like the more detailed instructions, by tomorrow hopefully whole thing will be as detailed as the first section. Please share if you want me to keep writing these guides :)

    ReplyDelete
  8. hello, want to ask if i follow this guide, will siri in my iphone 4 works ? i'm using spire, and i dont have any iphone4s. if it will work, i will try to setup a proxy server. please reply here. thanks !

    ReplyDelete
  9. If you follow this guide you will be able to set up a proxy which can work with any device yes, however you will need 4S keys for the proxy to work

    ReplyDelete
  10. dns script link is dead. i found another dns.py, file size (1,419 bytes) but when executing "python dns.py" giving syntax error. please help ! thanks

    ReplyDelete
  11. thanks for uploading the new dns. but when executing " rake install "
    it shows this :
    "C:\SiriProxy>rake install
    The system cannot find the path specified.
    The system cannot find the path specified.
    The system cannot find the path specified.
    siriproxy 0.3.0 built to pkg/siriproxy-0.3.0.gem
    siriproxy (0.3.0) installed"

    system cannot find the path specified ?
    and after that, when i execute "siriproxy gencerts"
    it shows:
    "C:\SiriProxy>siriproxy gencerts
    'siriproxy' is not recognized as an internal or external command, operable program or batch file."

    please help ! thankss

    ReplyDelete
  12. First, thanks for this guide, helps a lot.

    Will this server work with spire? if i have the 4S keys.

    Thanks!

    ReplyDelete
  13. is this step important for the ruby devkit installation? Cause i get an unterminated string meets end of file error.

    Confirm gem is working:
    ruby -rubygems -e "require 'rdiscount'; puts RDiscount.new ('**Hello Ruby Installer**').to_html'"

    ReplyDelete
  14. Please be patient I'm working on a major update to this guide to bring it up the the level of the other

    ReplyDelete
  15. I got the dump on command line, but do not know how to use the tokens...

    ReplyDelete
  16. The DNS script is giving me an error
    File "dns.py", line 30
    print 'Fake DNS Server:: dom.query. 60 IN A %s' % ip
    ^
    SyntaxError: invalid syntax

    ReplyDelete
    Replies
    1. In Python 3.3 the print changes from a statement to a function.
      print 'Fake DNS Server:: dom.query. 60 IN A %s' % ip changes to the print function:
      print ("Fake DNS Server:: dom.query. 60 IN A %s % ip")
      Line 40 is also faulty: Change
      print 'Activity: %s -> %s' % (p.dominio, ip) to
      print('Activity: %s -> %s') % (p.dominio, ip)
      That should fix your problem. If you need a copy of my dns.py, just message me.

      Delete
  17. Please uninstall Python, re-download and install again

    ReplyDelete
  18. thanks for uploading the new dns. but when executing " rake install "
    it shows this :
    "C:\SiriProxy>rake install
    The system cannot find the path specified.
    The system cannot find the path specified.
    The system cannot find the path specified.
    siriproxy 0.3.0 built to pkg/siriproxy-0.3.0.gem
    siriproxy (0.3.0) installed"

    system cannot find the path specified ?
    and after that, when i execute "siriproxy gencerts"
    it shows:
    "C:\SiriProxy>siriproxy gencerts
    'siriproxy' is not recognized as an internal or external command, operable program or batch file."

    please help ! thankss

    ReplyDelete
  19. "C:\SiriProxy>siriproxy gencerts
    'siriproxy' is not recognized as an internal or external command, operable program or batch file."

    help

    ReplyDelete
  20. Extract dns.py to /yourpath/DNS

    I dont have this /yourpath/DNS
    where is it at? Do I create a folder named yourpath and another one inside named DNS?

    ReplyDelete
  21. ^^ You decide where you want to add the folder DNS.. or whatever you want to name it, then extract dns.py to that destination.

    ReplyDelete
  22. When I run "python dns.py"
    I get this!

    The DNS script is giving me an error
    File "dns.py", line 30
    print 'Fake DNS Server:: dom.query. 60 IN A %s' % ip
    ^
    SyntaxError: invalid syntax

    What do I do now?

    ReplyDelete
    Replies
    1. In Python 3.3 the print changes from a statement to a function.
      print 'Fake DNS Server:: dom.query. 60 IN A %s' % ip changes to the print function:
      print ("Fake DNS Server:: dom.query. 60 IN A %s % ip")
      Line 40 is also faulty: Change
      print 'Activity: %s -> %s' % (p.dominio, ip) to
      print('Activity: %s -> %s') % (p.dominio, ip)
      That should fix your problem. If you need a copy of my dns.py, just message me.

      Delete
  23. I'll try it right now and see what happens.
    thanks for the tut

    -fifarulez

    ReplyDelete
  24. Well, two things up to now...

    1. Confirm gem is working:
    ruby -rubygems -e "require 'rdiscount'; puts RDiscount.new ('**Hello Ruby Installer**').to_html'"

    give me an error.. (I kept going on though...)


    and then another thing is

    2.Download Python:

    32-bit or 64-bit
    Install to C:\Python32
    Choose to Copy OpenSSL DLLs to \bin directory.

    I rename the C:\Python27\ to C:\Python32\ but then it doesn't say anything about dll's so ill try to do it manually.. thanks!


    -fifarulez

    ReplyDelete
  25. Extract dns.py to /yourpath/DNS
    On line 29 edit 'YourIPGoesHere' with the ip address of your PC
    On Your phones Wi-Fi, click the blue icon and set the DNS to the IP address of your PC.

    Run:

    cd /yourpath/DNS
    python dns.py

    I don't really know what path so I did any.
    I edited the dns.py with notepad and added my local ip.
    and on python i ran like this

    dns.py

    and it showed me something then I closed cause i didn't know what else to do there..

    -fifarulez

    ReplyDelete
  26. siriproxy is not recognized as an internal or external command..

    I'm going to leave it here for the night, thanks for everything though, ill try again tomorrow.


    (by the way, im on Windows Server 2003)

    bye
    -fifarulez

    ReplyDelete
  27. @Binhu Please un install python then re download and reinstall,

    @fifarulez, you have done the DNS step perfectly. leave this open and as you use your iPhone it will log and re route your iPhone's DNS requests

    ReplyDelete
  28. I'm still getting siriproxy is not recognized as an internal or external command when trying to get the gencerts.

    ReplyDelete
  29. can anyone explain the DNC again .... i am having hard time with it ??!!!!!

    ReplyDelete
  30. THE DNS PART )))

    ReplyDelete
  31. dont believe these badstevo he just get some idea of you guys.. hes crazy

    ReplyDelete
  32. Few people are having an error with siriproxy not being recognised I'm looking into this,

    what errors are you getting at DNS?

    ReplyDelete
  33. yah man got dns already

    ReplyDelete
  34. Brad, I have the siriproxy error, but no dns errors.

    I do get this before

    "C:\SiriProxy>rake install
    The system cannot find the path specified.
    The system cannot find the path specified.
    The system cannot find the path specified.
    siriproxy 0.3.0 built to pkg/siriproxy-0.3.0.gem
    siriproxy (0.3.0) installed"

    Not sure if that is causing a problem

    ReplyDelete
  35. will this allow for spire to run siri on an iphone 4? or is this only to create custom siri commands for a 4S?

    ReplyDelete
  36. hey man it says i have to pay for openssl?

    ReplyDelete
  37. @BradStevo I'm still getting this siriproxy not recognized... any help?

    ReplyDelete
  38. From what I just read on a different website newer Siriproxy releases will not build on Windows platform. You'll probably have to run a virtual machine with ubuntu or the like. Or maybe find an older version that builds in windows.

    ReplyDelete
  39. Fail tutorial, doesn't even work.

    ReplyDelete
  40. tutorial worked good i got the keys thanks :) everyone else is stupid yeye

    ReplyDelete
  41. Tutorial updated guys, give me some feedback and hope you all find it easy!

    ReplyDelete
  42. when i type:
    python dns.py
    i get:
    File "dns.py", line 30
    ....
    ^
    SyntaxError: invalid syntax

    what should i do?

    ReplyDelete
  43. Well, I've gotten everything except when I start siriproxy.rb, nothing happens and when I try to use siri, It says it can't connect to the network.
    I also can't do anything that uses the wifi, but the dns.py is showing the activity.

    ReplyDelete
  44. Now its saying my 4S is not a 4S..

    [Info - SiriProxy] - iPhone 4 or other non 4S connected. Using saved keys
    C:/SiriProxy/siriProxy.rb:169:in `inflate': incorrect header check (Zlib::DataEr
    ror)

    ReplyDelete
  45. Thanks!... will this work for IPOD TOUCH 4G?
    please reply back fast!

    ReplyDelete
  46. For me too, once i change the DNS on my iPhone 4 the Wi-Fi stops working..
    I can't see any activity on the dns.py.

    ReplyDelete
  47. @Ori Dahan if you are still having syntax error issues, ensure you have python 2.7.2 installed by typing 'python' into CMD.

    Make sure you add the keys you gained into the C:\SiriProxy folder before running the script, don't think I made that clear enough before

    Thanks Guys :)

    ReplyDelete
  48. ok, didn't understand how do i create the 4S files?
    Where do i put the keys i generated from my 4S?
    By the way, sessionValidationData should be really long?

    ReplyDelete
  49. read and find out where you have to put the keys ;)

    ReplyDelete
  50. Where do I find the keys to put in these files? And are they "files" or ruby files?

    ReplyDelete
  51. "Now create files called:

    speechId
    assistantId
    sessionValidationData"

    how to create this file?

    ReplyDelete
  52. Now create files called:


    speechId
    assistantId
    sessionValidationData

    how to creat these files?

    ReplyDelete
  53. C:\SiriProxy>ruby StartProxy.rb
    C:/Ruby193/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot loa
    d such file -- uuidtools (LoadError)
    from C:/Ruby193/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require
    '
    from C:/SiriProxy/siriObjectGenerator.rb:3:in `'
    from C:/Ruby193/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require
    '
    from C:/Ruby193/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require
    '
    from C:/SiriProxy/plugins/thermostat/siriThermostat.rb:3:in `'
    from C:/Ruby193/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require
    '
    from C:/Ruby193/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require
    '
    from StartProxy.rb:3:in `'

    What is wrong? and how can i fix this?

    ReplyDelete
  54. i have a 4s .. im through til generating certs,bt after that u said to create 3 files ? how do i do that ? i skipped that tried running dns.py then i get error msg lik ths..



    Fake DNS Server:: dom.query. 60 IN A 192.168.137.1
    Traceback (most recent call last):
    File "C:\DNS\dns.py", line 33, in
    udps.bind(('',53))
    File "C:\Python27\lib\socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
    socket.error: [Errno 10048] Only one usage of each socket address (protocol/network address/port) is normally permitted

    what should i do ? I own a 4s ,,No idea hw to create those files and put those innfo ? Can u help me ?

    ReplyDelete
  55. Hi,
    I have this problems
    1. trying to Confirm gem is working with -
    ruby -rubygems -e "require 'rdiscount'; puts RDiscount.new
    and geting this reply -
    C:/Ruby193/lib/ruby/gems/1.9.1/gems/rdiscount-1.6.8/lib/rdiscount.rb:87:in `init
    ialize': wrong number of arguments (0 for 1) (ArgumentError)
    from -e:1:in `new'
    from -e:1:in `'

    Also when i try to run openssl after I install it i get -

    'openssl' is not recognized as an internal or external command,
    operable program or batch file.

    Any ideas???

    ReplyDelete
  56. This comment has been removed by the author.

    ReplyDelete
  57. bradstevo

    Could you please make a video Tutorial as soon as possible cause this would help the community so much ,, and will make
    the work more simple for us >> noobs

    hope u can make it ,, =) cause i need it to do my university senior project

    ReplyDelete
  58. If i set this up will i need to get a new iphone 4S key every 24 hours? or can i just get it once? can never get a clear answer on that. I want to setup my own server, but if i have to get an iphone 4S key everyday seems impossible to keep the server updated.

    ReplyDelete
  59. I don't have an iphone 4s, how do i get the keys ? how do i create the files ?

    ReplyDelete
  60. I'm getting the same errors as Jim Coumans. I did this tutorial step by step.

    I also don't know where to get the keys from on my device to add to the 3 files (.txt) I created in the SiriProxy folder. Any follow-up help would be appreciated.

    ReplyDelete
  61. Hi Brad.

    Great tutorial. I too have followed the tutorial step by step with everything going as stated, however I have faced the exact same problem as Rod Ferris & Jim Coumans.

    The DNS is reporting great all the traffic but when running the server I get the same as Rod above.

    Also I too am uncertain about the 3 files and the keys.

    Any help would be greatly appreciated.

    Regards,

    Whittie

    ReplyDelete
  62. all is running but I get an error after each command:
    C:\SiriProxy>ruby start.rb
    [Info - SiriProxy] - iPhone 4 or other non 4S connected. Using saved keys
    [Info - SiriProxy] - iPhone 4 or other non 4S connected. Using saved keys
    C:/SiriProxy/siriProxy.rb:169:in `inflate': incorrect header check (Zlib::DataEr
    ror)
    from C:/SiriProxy/siriProxy.rb:169:in `process_compressed_data'
    from C:/SiriProxy/siriProxy.rb:131:in `receive_binary_data'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/eventmachine-1.0.0.rc.4-x86-min
    gw32/lib/em/protocols/linetext2.rb:94:in `receive_data'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/eventmachine-1.0.0.rc.4-x86-min
    gw32/lib/em/protocols/linetext2.rb:65:in `receive_data'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/eventmachine-1.0.0.rc.4-x86-min
    gw32/lib/em/protocols/linetext2.rb:65:in `receive_data'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/eventmachine-1.0.0.rc.4-x86-min
    gw32/lib/em/protocols/linetext2.rb:65:in `receive_data'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/eventmachine-1.0.0.rc.4-x86-min
    gw32/lib/eventmachine.rb:187:in `run_machine'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/eventmachine-1.0.0.rc.4-x86-min
    gw32/lib/eventmachine.rb:187:in `run'
    from C:/SiriProxy/siriProxy.rb:399:in `initialize'
    from start.rb:12:in `new'
    from start.rb:12:in `'
    Any thoughts?

    ReplyDelete