iMessage Colbat Thorium Bomb

Published

We all know that Maps is such bad implemented product by Apple (and people got fired by it). We also know siri doesn’t work as well as the package says.

But one thing that confounds me how possible is to make something as bad as this is iMessage. Beyond maps or siri, iMessage was so poorly implemented that either this was designed by a committee or the person wasn’t even a good product manager.

Why does is it so bad? So check this. In iMessage Apple decided to implement a version o SMS that was free and able to send group messages (early versions of SMS in the iPhone were able to send messages to a group of people but each reply was treated as a single message from that contact). However one of the problems that you have immediately as you have groups messages is where you can add arbitrary people is that some people may want to leave. Apple decided that iMessage should be a SMS replacement and not a IM over Phone kind of thing (like whatsapp). And here is where the problems start.

Each time you send a group message you send both the message and the group of people to everyone. Each of the participants each time they reply, they reply to everyone. As long anyone replies to a group with those people, everyone will receive both of those things. The problem is that, even if you try to delete that “chat” you are just deleting a message and a group of contacts. As soon as someone else in that group, replies to that “thread” what happens is that you get everything all over again.

The only way this makes sense is if you design iMessage as SMS+ think. The problem is that is broken! I can’t leave group messages and I have people always sending messages to old groups.

Since I can’t fix this (and yeah Gruber, sorry but this is one case, if this stuff was open, I would hack the living shit out of this to make it better), i decided to implement a kind of doomsday device.

Since Messages.app is connected to iMessage and Messages.app has support to AppleScript, you can write a AppleScript and a Python script that allows you to send messages from any python script. You can use as a iMessage API as long you have Messages.app open and connected to a iCloud account with iMessages activated.

The thing is you can send mass messages to any group of people. As it were as long you can can get the chat id you can nuke them with messages continuously leaving them with two options: endure it (which will cause them to waste huge amounts of batery) or turn off iMessage.

Maybe this can open Apple eyes.

How to use the scripts

As long you can open a terminal you should be able to use the scripts.

The first thing you need is to open Messages.app and ensure that you have a iMessage account set up.

Next you copy paste this into a file:

set c to ""
tell application "Messages"
    set c to chats
end tell
return c

and run this as follows (suposing you’ve written a file in your home directory called dumpChats):

$ osascript ~/dumpChats

this will output a list of chats that you have open in your Messages.app. What you need next is to identify the iMessage chat that you wish to hit. Now this is a hit and miss kind of thing. I think they are orded from last to first, to keep trying. An iMessage chat id should look like

iMessage;+;chat555555555555555555

After this is simple. You only need to write two files. The first is the AppleScript file:

on run argv
  set message_text to item 1 of argv
  tell application "Messages"
      send (message_text as text) to text chat id "iMessage;+;chat555555555555555555" 
  end tell
end run

This will read the first argument and send it to that iMessage chat. Write that into a file called nuke.ascript.

Next you need to interface this with python so you can use a proper programing language. This is done by the next script. Write this into nuke.py

from time import sleep
from subprocess import call
from random import randrange
for i from range(1,100):
  call(["/usr/bin/osascript", "/Users/user/nuke.ascript","NUKE!"])
  sleep(randrange(3))

The “/Users/user/nuke.ascript” should be replaced with the full path to nuke.ascript file.

And simply call python nuke.py.