Giter Club home page Giter Club logo

piemessage's Introduction

PieMessage - iMessage on Android

This is project allows Android clients to communicate using iMessage.

Video Demonstration

IMAGE ALT TEXT HERE

Disclaimer

This project is a super alpha prototype. I am releasing it because I need your help. :)

About

There are 4 parts to the PieMessage project.

  • messages.applescript
  • Java Web Server (JWS)
  • OSX Client
  • Android Client

The messages.applescript is arguably the most important part of the project. It is what makes sending iMessages possible. This script is what sends an iMessage message.

The OSX Client & JWS run on any OSX machine (Macbook, Mac, etc.).

If the OSX Client detects any changes to the "Messages" sqlite database file where a new message has been received, it will send the JWS a socket 'incoming' JSON message. Incoming messages are detected from a change from the sqlite chat.db of the 'Messages' app whose default location is ~/Library/Messages/chat.db. I have provided a database schema to help visualize the database in the pdf, MessagesSchema.pdf.

The JWS is what connects the OSX Client to the Android client. If the JWS receives a socket 'outgoing' JSON message from the Android client, it will pass it to the OSX Client to tell it to send the iMessage that was requested from the Android. If the JWS recieves a socket 'incoming' JSON message from the OSX Client, it means the OSX Client has detected a new message and wants the JWS to notify the Android client.

The Android client connects to a socket that whose IP address is of the OSX device that is running the JWS and OSX Client. It then sends JSON messages to the JWS using that socket. It also receives JSON to show in list of any new incoming iMessages.

Requirements

  • OSX device
  • Public IP for OSX device
  • iCloud account w/ iMessage enabled
  • Java JDK
  • Android device (4.0+)

Optional Requirement

  • IntelliJ IDEA
  • Android Studio

Set up

  1. Open the Messages application and add your iCloud account in Messages > Preferences > Accounts.
  2. Clone the PieMessage project onto your OSX Device.
  3. Edit the socketAddress value in PieOSXClient/src/Constants.java to your public IP address that is linked to your OSX device.

You can do either terminal or GUI setup from here. If you will be working on this you will eventually need to set it up in IntelliJ/Android Studio or get it to work in your IDE of choice.

Via Terminal

  1. cd PieMessage/ && cp messages.applescript ~
  2. In one terminal window/screen: cd PieMessage/JavaWebServer && gradle run. This will need to remain open.
  3. In another window/screen: cd PieMessage/PieOSXClient && gradle run. This will need to remain open.
  4. In a final window/screen: cd PieMessage/PieMessage-Android && gradle installDebug. This is simply to compile and load the application.

Via GUI

  1. Move messages.applescript to your ~ home directory (/Users/).
  2. Open the JavaWebServer/ as a project in IntelliJ. Run the Server class.
  3. Open the PieOSXClient/ as a project in IntelliJ.
  4. Run PieOSXClient class.
  5. Open PieMessage-Android/ as a project in Android Studio.
  6. Compile apk to any Android device.

WishList

Since I've moved onto other projects and haven't had time to finish this, there are few things that wanted to implement. It would be nice to combine the OSX Client and the JWS. Also the OSX Client sometimes timesout and loses socket connection over a 2 hour+ period. I'm not sure if this is my own internet, the OSX it self.

Also it is possible to recieve group messaging, just not send it. Unfortunately I couldnt figure out an applescript to send to multiple clients in a single conversation thread. You definitely can send multiple individual messages at once but that still isn't in the same conversation thread. The only reason why we can receive is because it's just a chat table in the sqlite database on the OSX device.

Photo/Video messages are definitely possible too. There is a place in the SQLite table named message_attachment_join and attachment. It just has to link that in some kind of protocol for the OSX, JWS, and Android client to implement.

There can be clients for any platform like Windows, web, BlackBerry OS, Windows Phone, a toaster, etc. Since the JWS, and OSX Client just take in a JSON to send & receive, one just has to implement a client that is similar to the way the Android client communicates with it.

piemessage's People

Contributors

bboyairwreck 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  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  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

piemessage's Issues

OSX Client Connection Refused

Running the Code I get it to start, find the applescript, then JAVA.NET refuses the connection. I checked the ports, and pinged the port and all is fine on the server side. Something here might be amiss. Any ideas? [Terminal Shot Below]

Merci!

cd PieMessage/PieOSXClient && gradle run
Starting a Gradle Daemon, 1 busy Daemon could not be reused, use --status for details
:compileJava
:processResources UP-TO-DATE
:classes
:run
File "/messages.applescript" exists
java.net.ConnectException: Connection refused
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
        at java.net.Socket.connect(Socket.java:589)
        at java.net.Socket.connect(Socket.java:538)
        at java.net.Socket.<init>(Socket.java:434)
        at java.net.Socket.<init>(Socket.java:211)
        at OSXIncomingMessageThread.run(OSXIncomingMessageThread.java:30)
        at java.lang.Thread.run(Thread.java:745)
java.net.ConnectException: Connection refused
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
        at java.net.Socket.connect(Socket.java:589)
        at java.net.Socket.connect(Socket.java:538)
        at java.net.Socket.<init>(Socket.java:434)
        at java.net.Socket.<init>(Socket.java:211)
        at OSXOutgoingMessageThread.run(OSXOutgoingMessageThread.java:25)
        at java.lang.Thread.run(Thread.java:745)

BUILD SUCCESSFUL

Total time: 4.605 secs

Help

Does anyone wanna help me get the app
I'm not a codding person
Please and thank you ๐Ÿ™

Sent from my LGE LG-H812 using FastHub

Can only send iMessages; Can't receive, nothing in inbox

I was able to send messages to people, just had no idea if they messaged me back unless I checked my MacBook/iPad. Inbox is always blank so I have to start from scratch and retype numbers every time I send something.

At least sending works, but it would obviously be excellent if I could receive messages. Any tips?

Please Help!

Can someone PLEASE leave a step by step tutorial for those of us that have never done a day of coding in our lives, and actually explain how?? Tired of all these "Just do it" tutorials. Or maybe even assemble the APK file for us? Please and thank you!

PieOSXClient: Operation Timed out

java.net.ConnectException: Operation timed out

The PieOSXClient fails to connect to my OSX Client, and likewise for the Android App
I've retrieved my public IP from Google/other sources so it should be accurate

Thoughts?

I'll move to a different building and see if I can reproduce on another router

Build Failed

When I run the command
grade installDebug

I get the following error:

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/JakeWilliams/Downloads/PieMessage-master/PieMessage-Android/app/build.gradle' line: 1

* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'com.android.application']
   > Gradle version 2.10 is required. Current version is 2.5. If using the gradle wrapper, try editing the distributionUrl in /Users/JakeWilliams/Downloads/PieMessage-master/PieMessage-Android/gradle/wrapper/gradle-wrapper.properties to gradle-2.10-all.zip

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 3.717 secs

I've tried updating grade and have changed the distrubutionURL but the error still appears.

Photo/Video messaging - Receiving

Hey guys, developer of PieMessage here. As I mentioned, Photo/Video is possible. Look at the MessagesSchema.pdf. You'll notice there is a message_attachment_join and attachment in the SQLite chat database. This should provide the file location to a received message w/ attachment.

The first step is detecting the message is an attachment message. The next step is defining a protocol to be able to send an image from OSX to the Android device. Then implement the file sending. I have never sent a file through sockets so this is out of my league. I would imagine sockets wouldn't be the best way to send a file. and HTTP request is probably a better solution.

Cannot Connect to Device

When entering cd PieMessage/PieMessage-Android && gradle installDebug into the terminal, it will get to 97% and fail... throwing the exception it cannot connect to a device. Unsure why this is happening. Both other terminal windows are running in the background and the app was successfully running with the correct ip entered on the android device.

Improvements needed

Hi, I'm planning on contributing to this project. I had a few questions

  1. Does PieMessage use SSL to encrypt messages between the Android client, the JWS, and the OSX Client?

  2. Has incoming group message support already been handled, or does that need to be added?

  3. Is it totally impossible to send a group message from the apple script, or could it potentially be added?

Unfortunately PieMessage has stopped

Is anyone getting the same error, how do you fix it?

Thats the error message:

06-05 19:54:17.728 27735-27735/com.ericchee.bboyairwreck.piemessage E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.ericchee.bboyairwreck.piemessage, PID: 27735
java.lang.NoSuchMethodError: android.view.Window.setStatusBarColor
at com.ericchee.bboyairwreck.piemessage.MessageActivity.setStatusBarColor(MessageActivity.java:270)
at com.ericchee.bboyairwreck.piemessage.MessageActivity.onCreate(MessageActivity.java:69)
at android.app.Activity.performCreate(Activity.java:5350)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1088)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2320)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1342)
at android.os.Handler.dispatchMessage(Handler.java:110)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5322)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:829)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:645)
at dalvik.system.NativeStart.main(Native Method)

Galaxy S8 can't connect

Whenever I try to send a message via my S8, it doesn't go through (message boxes are faded out). However, when I compile the apk unto a virtual android device in Android Studio everything works fine.

Any thoughts as to why it's not connecting on my S8?

Would be awesome to see this brought to Disa

Hey!

You've achieved what I was really interested in doing a few years back when I was a Mac user transitioning to Windows 8 and Lumia, now I'm transitioning to 10 and Android. :- )

Would love to see intergration of PieMessage with Disa as a plugin: http://disa.im/plugins.html

Will be looking forward to contributing code to PieMessage. Keep it up!

Unable to Receive Messages

I am able to send messages on my phone, but I do not receive any. There are no errors in the IntelliJ clients, so I am stumped as to why it isn't working.

ERROR: OSX input/output has not be set. Can't send client's message to OSX

Hello,

I have just installed piemessage and keep seeing this error in the terminal whenever I try to send a message. The phone is clearly connected to the server but it won't send the message

ERROR: OSX input/output has not be set. Can't send client's message to OSX
Lost connection
Lost connection of Mobile Client

Encryption

Hey eric!

I am parsing your sources but cannot find any implementation for encryption between the JWS and AndroidClient. Are there any future plans for implementing such?

Typo error

There is an error in the first line of the text, which is written as, " This is project allows Android clients to communicate using iMessage."
The word 'is' is an error here and it should be avoided.
The correct sentence could be written as, "This project allows Android clients to communicate using iMessage."

Thank you.

Photo/Video messaging - Sending

Hey guys, Eric, developer of PieMessage here. As mentioned, Photo/Video messaging is possible.

Developers have claimed to be able to send an image via Applescript. Their code as shown here:
http://forums.macrumors.com/threads/send-image-from-messages-app-to-imessage.1471616/
https://discussions.apple.com/thread/5007228?tstart=0

But before that, we'll need some kind of protocol to send image from the Android device to the OSX client. You can hack this and just use like a dropbox API. I have never sent a file via sockets. That is not my area of expertise. I would imagine an HTTP request would be better?

But its good to know this is possible as far as I can tell

unable to send or receive

After all the intermediate level programming involved, I have a very basic problem. I suspect a simple solution but just can't see it! I run a rooted nexus 6p on cyanogenmod 13.0 angler. I'm trying to communicate with my wifes iphone 4s running ios 9.something. We can imessage mac to iphone and back but messages are not sending or receiving via pie message. Any messages I send from piemessage are not saving in the conversations list. My mac is permanently on as a server. Any ideas??

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.