A
A
Alexey Guzenko2013-11-20 20:06:29
Objective-C
Alexey Guzenko, 2013-11-20 20:06:29

Sending hidden SMS in iOS?

Hello,
I am writing a tweak for jailbreak iOS in which I need the ability to send hidden SMS. I found this solution on StackOverflow:

dispatch_queue_t queue = dispatch_queue_create("com.apple.chatkit.clientcomposeserver.xpc_connection_queue", DISPATCH_QUEUE_SERIAL);
xpc_connection_t connection = xpc_connection_create_mach_service("com.apple.chatkit.clientcomposeserver.xpc", queue, 0);
xpc_connection_set_event_handler(connection, ^(xpc_object_t){});
xpc_connection_resume(connection);
dispatch_release(queue);

xpc_object_t dictionary = xpc_dictionary_create(0, 0, 0);
xpc_dictionary_set_int64(dictionary, "message-type", 0);
NSData* recipients = [NSPropertyListSerialization dataWithPropertyList:[NSArray arrayWithObject:@"12212"] format:NSPropertyListBinaryFormat_v1_0 options:0 error:NULL];
xpc_dictionary_set_data(dictionary, "recipients", recipients.bytes, recipients.length);
xpc_dictionary_set_string(dictionary, "markup", "SMS text");

xpc_connection_send_message(connection, dictionary);
xpc_release(dictionary);

But when I try to send SMS to me, it says in the log that I do not have permission to do this. In the same place on SO it is written that you need
To send message using this code your application entitlements should have com.apple.messages.composeclient key with boolean value set to true. Otherwise you get error in console saying application lacks entitlement.

The tweak is written using MobileSubstrate and I don't really understand where I need to set these rights. Someone wrote a similar thing and can help?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2013-11-20
@InViZz

add the com.apple.messages.composeclient key to the application plist and set its value to YES

W
Webdesus, 2013-11-20
@Webdesus

As I understand it, this is generally not specified by the code. And you must have a production acc with official permission from apple for this implementation.
Personally, I would not want to get an application that itself sent something via SMS. So you have to write to apple technical support and get it right.
I made this conclusion from a comment to the same post on SO.

Unfortunately, no. Did you sign your app with the entitlement? If you did I will create and post a sample project.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question