diff --git a/.DS_Store b/.DS_Store index a88a95e..4255a32 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/Demo.gif b/Demo.gif index 7af7d47..92cf3ce 100644 Binary files a/Demo.gif and b/Demo.gif differ diff --git a/README.md b/README.md index 8d64576..160bf7b 100644 --- a/README.md +++ b/README.md @@ -1,89 +1,122 @@ # Pebble-Imessager -A [PebbleJs](https://github.com/pebble/pebblejs) and Server Application to allow iMessage texting on microphone enabled pebble smartwatches. -## Demo +A [PebbleJs](https://github.com/pebble/pebblejs) and Server Application to allow WhatsApp chatting on microphone enabled pebble smartwatches. + +## Demo + ![](Demo.gif) -## About -Since the takeover by Fitbit pebble smartwatches could no longer send messages on iPhones. However, using this watch app and server -applications users can once again send iMessage’s from iPhones. To accomplish this the application uses a server running on a Mac (or -[emulated Mac](https://github.com/foxlet/macOS-Simple-KVM)) to send messages. +## About + +Using this watch app and server microphone enabled pebbles can reply to WhatApp messages. Based on [GitHub - integraloftheday/Pebble-Imessager: A PebbleJs and Server Application to allow imessage texting on pebble smart watches](https://github.com/integraloftheday/Pebble-Imessager) + +## A Security Note -## A Security Note In the current state all server requests are sent over http which is not encrypted. In the future it is planed to update this to https to ensure fully encrypted requests. In the meantime, it is recommended to only use this application over local networks or use a VPN to establish a secure connection to a local network. ## Server Installation -### Requirments -1. A Mac or [emulated Mac](https://github.com/foxlet/macOS-Simple-KVM) with iMessage signed in -2. Xcode Command Line Tools, Can be installed by typeing `xcode-select --install` in terminal -3. Python3 (sometimes included in Xcode Command Line Tools or can be installed at (python.org)[https://www.python.org/]) + +### Requirments + +1. A computer / raspberry pi (Anything that can run node.js) +2. [Node.js]((https://nodejs.org/en/)) installed + ### Steps -The simplest way is to use the install.sh script. It only downloads the required files. -1. `curl -o install.sh https://raw.githubusercontent.com/integraloftheday/Pebble-Imessager/master/installer.sh` -2. `sh install.sh` The server should install inside a folder called "PebbleImessageServer" -3. `cd PebbleImessageServer` -4. `sh start.sh` To run the server + +The easiest way is to use the install.sh script. It only downloads the required files. + +1. `curl -o install.sh https://raw.githubusercontent.com/integraloftheday/Pebble-WhatsApp/master/installer.sh` + +2. `sh install.sh` The server will install inside the directory "PebbleWhatsAppServer" + +3. `cd PebbleWhatsAppServer` + +4. `node app.js` Run the server + +5. Scan the QR code with your phone connecting WhatsApp To keep the server running [screen](http://www.kinnetica.com/2011/05/29/using-screen-on-mac-os-x/) can be used. -### Configuration -Inside the `PebbleImessageServer` folder there is a file `config.json` which included everything that needs to configured. The file looks like: -```json +### Configuration + +Inside the `PebbleWhatsAppServer` folder there is a file `config.json` which included everything that needs to configured. The file looks like: + +```json { "key":"abc", "port":5000, +"saveLogin":false, "contacts":[ - { - "buddyName":"Demo", - "displayName":"Demo" - } - + { + "buddyName":"Demo", + "displayName":"Demo" + }, ] } ``` -The `"key"` is generated in the watch app and must be set to the same value. The `"port"` is what port the server runs on and `"contacts"` -is the list of everyone the watch app can message. Each contact has two fields `"buddyName"` which is the exact name as displayed on the Mac -in iMessages. The `"displayName"` is what name will be displayed in the watch app. As many contacts as needed can be added to `config.json` -below is an example of a config file on port 2020 with 3 contacts. **Note** when editing `config.json` restarting the server is not needed -unless the `"port"` has be edited. -```json +* `"key"` is generated in the watch app and must be set to the same value. + +* `"port"` is what port the server runs on + +* `"saveLogin"` if set to `true` the server will remember the WhatsApp login. + +* `"contacts"` is the list of everyone the watch app can message. + + * `"buddyName"` is the WhatsApp id for each contact/group. It follows this pattern for an individual `[country code][phone number]@s.whatsapp.net` for example, ``19999999999@s.whatsapp.net`. For infromation including for groups can be found here: [GitHub - adiwajshing/Baileys: Lightweight full-featured typescript/javascript WhatsApp Web API](https://github.com/adiwajshing/Baileys#sending-messages). + + * `"displayName"` is what will be displayed in the WatchApp + + **Note** when editing `config.json` restarting the server is not needed + unless the `"port"` has be edited. + +```json { "key":"abc", "port":2020, "contacts":[ - { - "buddyName":"Homer Simpson", - "displayName":"Homer" - }, + { + "buddyName":"Homer Simpson", + "displayName":"Homer" + }, { - "buddyName":"Marge Simpson", - "displayName":"Marge" - }, - { - "buddyName":"Bart Simpson", - "displayName":"Bart" - } + "buddyName":"Marge Simpson", + "displayName":"Marge" + }, + { + "buddyName":"Bart Simpson", + "displayName":"Bart" + } ] } ``` -## Watch Installation + +## Watch Installation + Currently the watch app needs to be sideloaded but could be added to the rebble store in the future. -### Requirements + +### Requirements + 1. A microphone enabled pebble watch + 2. A [rebble voice subscription](https://rebble.io) -### Side Loading -1. Downloaded the latest .pbw file from the [releases](https://github.com/integraloftheday/Pebble-Imessager/releases) on your phone. -2. Click the share icon then "more" then select "Copy to Pebble" + + ### Side Loading + +3. Downloaded the latest .pbw file from the [releases](https://github.com/integraloftheday/Pebble-Imessager/releases) on your phone. + +4. Click the share icon then "more" then select "Copy to Pebble" The pebble app then will install the watch app. -### Watch App Configuration + +### Watch App Configuration + These steps must be done before the watch app can be used. + 1. Click "Settings" and scroll to "Server IP" select and enter the Server's IP address and Port Number 2. Click "key Generate" and updated `config.json` to match the key displayed on the watch app 3. Click "Contact Fetch" to update the watches internal contacts. This can be done after any update to `config.json` 4. Click "Current" if everything was entered correctly and working the server IP the key and any contacts should be displayed. 5. Send Messages! by clicking on the contacts name on the main menu. - diff --git a/WhatsAppServer/app.js b/WhatsAppServer/app.js index 06baee0..81c49b1 100644 --- a/WhatsAppServer/app.js +++ b/WhatsAppServer/app.js @@ -57,8 +57,8 @@ app.post("/what/api/v1/send",function(req,res){ var config = JSON.parse(fs.readFileSync("./config.json","utf-8")); console.log("MessageSend:",req.body); if(config.key == req.body.key){ - try { - + try { + console.log("Sending Message") client.sendTextMessage(req.body.to,req.body.msg); var response = {"sucess":"true"}; res.status(200).json(response); diff --git a/WhatsAppServer/config.json b/WhatsAppServer/config.json index e626937..24913a3 100644 --- a/WhatsAppServer/config.json +++ b/WhatsAppServer/config.json @@ -6,11 +6,6 @@ { "buddyName":"Demo", "displayName":"Demo" - }, - { - "buddyName":"Demo2", - "displayName":"Demo2" } - ] } diff --git a/installer.sh b/installer.sh index 37be963..8cce1f1 100644 --- a/installer.sh +++ b/installer.sh @@ -2,21 +2,21 @@ echo "Creating Node.js Folder" -mkdir PebbleWhatsApp +mkdir PebbleWhatsAppServer echo "Downloading Required Files" -curl -o PebbleWhatsApp/app.js https://raw.githubusercontent.com/integraloftheday/Pebble-WhatsApp/master/WhatsAppServer/app.js +curl -o PebbleWhatsAppServer/app.js https://raw.githubusercontent.com/integraloftheday/Pebble-WhatsApp/master/WhatsAppServer/app.js -curl -o PebbleWhatsApp/config.json https://raw.githubusercontent.com/integraloftheday/Pebble-WhatsApp/master/WhatsAppServer/config.json +curl -o PebbleWhatsAppServer/config.json https://raw.githubusercontent.com/integraloftheday/Pebble-WhatsApp/master/WhatsAppServer/config.json -curl -o PebbleWhatsApp/package.json https://raw.githubusercontent.com/integraloftheday/Pebble-WhatsApp/master/WhatsAppServer/package.json +curl -o PebbleWhatsAppServer/package.json https://raw.githubusercontent.com/integraloftheday/Pebble-WhatsApp/master/WhatsAppServer/package.json -npm install --prefix PebbleWhatsApp/ +npm install --prefix PebbleWhatsAppServer/ echo "Now edit config.json to add contacts, to change the port number, and to set the key" -echo "Use node app.js to start the server in side PebbleWahtsApp" +echo "Use node app.js to start the server inside PebbleWhatsAppServer"