GithubHelp home page GithubHelp logo

node-siri's Introduction

node-siri

NPM version

node-siri is a light-weight Siri Proxy written in Node.JS that does not require you to jailbreak your device.

Installation

NPM (Easy)

npm install siri

Git (Advanced)

git clone https://github.com/zhangyuanwei/node-siri.git
npm update

Getting Started

The installation script requires TCP/443 and optionally TCP/80 (for the setup, this port can be changed) to be open and should run under a privileged account which can open those ports.

Normal operation requires port TCP/443 to be open and optionally UDP/53 (if using dnsproxy) to be open, and should run under a privileged account which can open those ports.

Configuration

Configuration can come either from the command line or your config.json file.

  1. Copy config.json.sample to config.json.
  2. Use a text editor to edit your defaults.

While it is recommended to keep your configuration in the file, you may wish you temporarily change some settings while testing. To do so, add the argument(s) on the command line.

sudo node examples/proxy.js --debug 1 --locale zh

DNS

You need a way to hijack DNS requests for guzzoni.apple.com and send them to your server running node-siri. You only need to perform one of the following DNS procedures.

Using dnsproxy (Easy)

node-siri includes a dns proxy server to simplify things.

  1. Set dnsproxy to true (or 1) in config.json.
  2. Configure your iDevice to use the node-siri server's IP address for the first DNS Server.

Custom DNS Server (Advanced)

If you already have a DNS server on your network, simply create a zone file for guzzoni.apple.com to point to your node-siri server.

See the contrib/ directory for a sample zone file.

Setup

  1. Run sudo node install.js
  2. Browse to http://guzzoni.apple.com from your iDevice (in Safari!)
  3. Install the certificate from the link provided on the webpage.
  4. Reload the webpage.
  5. If everything is green, end the install.js process.
  6. Run sudo node examples/en-US/hello.js
  7. Activate Siri and say "Hello".

Siri should respond with "Siri Proxy says 'Hello!'"

Example

var siri = require("siri");

siri.createServer(function(cmd, dev) {
    if (/Hello/.test(cmd)) {
        dev.end("Siri Proxy says 'Hello!'");
    } else {
        dev.proxy();
    }
}).start();

API

A Siri conversation consists of one or more requests from the client and n or more responses from the Siri server.

A Siri Proxy conversation may call .say() or .ask() zero or more times during the transaction, however, it must finish with an .end().

SiriDevice.say(text[, speakable]):

Returns information to Siri. This can be called multiple times during the conversation.

SiriDevice.ask(text[, speakable], callback):

Returns information to Siri and waits for an answer. This can be called multiple times during the conversation.

The answer is sent to the callback function of your choosing.

callback(answer)

Answers the callback function.

SiriDevice.end([text[, speakable]]):

This dialog ends, and optionally returns any information. This MUST be called to finalize the transaction.

SiriDevice.proxy():

The conversation is handed over to the Siri server for processing.

Troubleshooting

  • Ensure your iDevice resolves guzzoni.apple.com as your node-siri server.
  • DEPTH_ZERO_SELF_SIGNED_CERT : Ensure your node-siri server is resolving guzzoni.apple.com to the internet. It should not be pointing to itself!
  • EACCES : Start node in privledged mode, e.g. (sudo node)

Debugging

Logging of extraneous output has been moved to the debug module. To have node-siri output non-critical messages, run your app with the DEBUG environment variable set like so:

$ DEBUG=siri:* node app.js

node-siri exposes three log-levels:

siri:debug
siri:warn
siri:error

If you only want to get errors and warnings reported, start your node server like so:

$ sudo DEBUG=siri:warn,siri:error node app.js

Reporting Issues

Submit an issue on github with a pastebin (or equivilant) of the output of the following commands:

You should be running these commands from the main node-siri directory, where siri.js is located.

pwd
ls -la
cat config.json
cat examples/proxy.js
openssl x509 -in keys/server-cert.pem -noout -text
nslookup guzzoni.apple.com
node -v
sudo DEBUG=siri:* node examples/proxy.js --dumpdata true

node-siri's People

Contributors

jnovack avatar zhangyuanwei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-siri's Issues

Error ECONNRESET

Hi,

Hard to tell how often I got this error but perhaps every 2 days, the listener stops because of that issue:

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: read ECONNRESET
    at errnoException (net.js:901:11)
    at TCP.onread (net.js:556:19)

From what I have understood here (http://stackoverflow.com/questions/17245881/node-js-econnreset) the only way to fix this error is handle the error by adding something like:

process.on('uncaughtException', function (err) {

This is something to add into siri.js for clientStream or serverStream ?

Thanks

PS: (I did not copied/pasted my config based on what is explained in the README because everything works fine except this error but not really siriproxy related)

错误错误:DEPTH_ZERO_SELF_SIGNED_CERT : nodejs 0.10.12

你好,
我设法成功安装节点siri的,但现在我得到一个错误:

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: DEPTH_ZERO_SELF_SIGNED_CERT

我有nodejs版本10.12,我认为它来自TLS连接。
我试图安装的是旧版本0.8.15测试。

遗憾的文本,我使用谷歌翻译,希望能对你有所帮助:)


Hello,
I managed to successfully install node-siri, but now I get an error:

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: DEPTH_ZERO_SELF_SIGNED_CERT

I have nodejs version 10.12 and I think it comes from the tls connection.
I am trying to install an older version 0.8.15 test.

sorry for the text I use google translate, hoping for your help :)

Text returned is concatenated without any space between the words

Hi,

Strange behavior. The text returned by cmd, is concatenated and of course the regexp is not well evaluated.

console.log("Speech Processed: " + cmd);

When i say "Hello Siri", "HelloSiri" is displayed and in consequence not evaluated. I am a bit surprise because I didn't touched the source code. Is there something I do not well understand ?

To make it works, I have adjusted what getRecognizedText returns row 311 into siri.js. Instead of return arr.join("");, now return arr.join(" "); is returned in order to add a space between each word.

Thanks,

Error: ACE:Unknow ACE package type"7".

Error: ACE:Unknow ACE package type"7".
    at SiriParser.StreamParser.onError (/var/www/node-siri/parser.js:40:11)
    at PackageParser.packageParser.onError (/var/www/node-siri/parser.js:227:14)
    at PackageParser.execute (/var/www/node-siri/parser.js:383:26)
    at Fifo.callback (/var/www/node-siri/parser.js:16:21)
    at Fifo.push (/var/www/node-siri/fifo.js:44:22)
    at PackageParser.StreamParser.parse (/var/www/node-siri/parser.js:29:15)
    at Unzip.<anonymous> (/var/www/node-siri/parser.js:215:23)
    at emitOne (events.js:90:13)
    at Unzip.emit (events.js:182:7)
    at readableAddChunk (_stream_readable.js:153:18)

but dns, certs are correct!

iPhone 4S Only?

@zhangyuanwei Does this only work with an iPhone 4S?

I am trying to get it to work with an iPad3, and all I am getting is CommandFailed

data/035.server.json:

{
"group":"string:com.apple.ace.system",
"class":"string:CommandFailed",
"v":"string:2.1",
"aceId":"string:5917fb83-AAAA-AAAA-AAAA-8db4861ce689",
"refId":"string:7D1645EE-AAAA-AAAA-AAAA-1C4DD07944EF",
"properties":{
    "errorCode":"uint:722",
    "reason":"string:E92F6B42-AAAA-AAAA-AAAA-1E8A869639EF was not the last request, cannot roll back"
    }
}

data/036.server.json:

{
"group":"string:com.apple.ace.system",
"class":"string:GetAssistantData",
"v":"string:2.1",
"aceId":"string:3eb1e86e-AAAA-AAAA-AAAA-665bb30db6b3",
"refId":"string:8A9905DA-AAAA-AAAA-AAAA-8B1BC4F9A337"
}

data/037.server.json:

{
"group":"string:com.apple.ace.assistant",
"class":"string:AddViews",
"v":"string:2.1",
"aceId":"string:8fa12547-AAAA-AAAA-AAAA-52e0bf617dd3",
"refId":"string:E92F6B42-AAAA-AAAA-AAAA-1E8A869639EF",
"properties"{
    "dialogPhase":"string:Error",
    "scrollToTop":"bool:false",
    "temporary":"bool:false",
    "views": [
        {
        "group":"string:com.apple.ace.assistant",
        "class":"string:AssistantUtteranceView",
        "v":"string:2.1",
        "properties": {
            "speakableText":"unicode:Sorry, something’s gone wrong. Can you try that again?",
            "dialogIdentifier":"string:Error#genericError",
            "text":"unicode:Sorry, something’s gone wrong. Can you try that again?"
            }
        }
    ]
    }
}

data/038.server.json:

{
"group":"string:com.apple.ace.system",
"class":"string:CommandFailed",
"v":"string:2.1",
"aceId":"string:bc4728b3-AAAA-AAAA-AAAA-1dd731d6e2ef",
"refId":"string:E92F6B42-AAAA-AAAA-AAAA-1E8A869639EF",
"properties":{
    "errorCode":"uint:718",
    "reason":"string:Can not obtain AssistantData"
    }
}

HTTPS-Service in fail with the new version

Hi,

Under another directory, I have installed the new version of the proxy following the steps described in the README

When I run node install.js, Starting HTTPS-Service fails. When I run the same command from the previous directory where the old version of the proxy is running, everything is ok.

Not sure if it is important but i copied the previous certificats from the other directory.

Any ideas ?

Generating certificates for iOS 7

I am running iOS 7 and the siri server seems to be different. I used wireshark to figure out which siri server is used and from what I gather the siri server for iOS 7 seems to be daryl.apple.com.

I am trying to generate the certificates for daryl.apple.com using openssl. When I replace the certificates in your keys directory with the ones I generate and run the install app, I am able to install the certificate on my phone and then everything is green on the install page. But when the siri server starts and I try to speak to siri I get the following error:

Error: 1292:error:1408A0C1:SSL routines:SSL3_GET_CLIENT_HELLO:no shared cipher:openssl\ssl\s3_srvr.c:1355

I am really not familiar with SSL so I am pretty sure that I am doing something wrong when I generate the certificates

Could you tell me the exact openssl commands you used to generate the guzzoni.apple.com certificate

Thank you

启动HTTPS服务 失败

你好,我在按照你的操作步骤来时,在把host文件里加上我的服务器地址后:
1,检测DNS解析 成功
2,启动HTTPS服务 失败

排查了很久,包含重启服务,重启手机,都不行~~~麻烦指点下啊~~~

Checking HTTPS cert - FAIL

Hi,

I was able to install everything (node, dnsmasq, etc..) and the server starts via sudo node install.js
By going to guzzoni.apple.com, i got an error : Checking HTTPS cert - FAIL
However Checking DNS and Checking HTTPS Service are ok.

I have regenerated a certificat via genca.sh and sent/installed server-cert.pem on my iphone.

Any ideas ?

Thanks!

Certificates are expired

I got this error

Error: ACE:Unknow ACE package type"7".
    at SiriParser.StreamParser.onError (/var/www/node-siri/parser.js:40:11)
    at PackageParser.packageParser.onError (/var/www/node-siri/parser.js:227:14)
    at PackageParser.execute (/var/www/node-siri/parser.js:382:26)
    at Fifo.callback (/var/www/node-siri/parser.js:16:21)
    at Fifo.push (/var/www/node-siri/fifo.js:44:22)
    at PackageParser.StreamParser.parse (/var/www/node-siri/parser.js:29:15)
    at Unzip.<anonymous> (/var/www/node-siri/parser.js:215:23)
    at emitOne (events.js:90:13)
    at Unzip.emit (events.js:182:7)
    at readableAddChunk (_stream_readable.js:153:18)

Do you have cert generation script?

Does siri node works with iphone - ipad not jailbroken?

I'm sorry I'm not very good in Chinese :) But is it possible to use siri node with an iphone - ipad not jailbroken? If so are you able to give me more explanation on how to operate? I use siriproxy Plamoni of the moment and am looking for a javascript equivalent with nodejs. Thank you in advance for your reply.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.