0

I am using iOS 7 iPhone 5S which is untethered jailbroken and i want to make a phone call and disconnect the call programmatically.

I have known that the api CTCall works well for iOS 6 but now it doesn't work for iOS 7. in this post someone gave a solution -- adding entitlements to app .

How to to use CTCall on iOS 7?

Note: My App is not going to be on AppStore.

Cœur
  • 37,241
  • 25
  • 195
  • 267
  • Look at http://stackoverflow.com/questions/4582327/how-to-make-a-call-programmatically – ZeMoon Apr 10 '14 at 15:22
  • 1
    Yes, to use `CTCallDial` on iOS 7 you need to sign your app with the entitlement. To do this read this http://stackoverflow.com/questions/14871748/how-do-i-change-my-applications-entitlements-to-com-apple-backboard-client You don't need to hook anything like in the answer below - just sign your app with the entitlement. – creker Apr 10 '14 at 19:35
  • @creker I tried your solution and it really make it.Many thanks. – user2932379 Apr 13 '14 at 11:46
  • Does it only work for jailbroken phone? – Bagusflyer Dec 01 '14 at 02:34

1 Answers1

0

Apple added new entitlements for a lot of Private API So for your tweak you have o sign it with com.apple.coretelephony.Calls.allow entitlement

code below took from @b3ll MessageBox with editing it to make it work with CTCallDial

#define XPCObjects "/System/Library/PrivateFrameworks/XPCObjects.framework/XPCObjects"

%config(generator=MobileSubstrate);

%group backboarddHooks

static int (*orig_XPConnectionHasEntitlement)(id connection, NSString *entitlement);

static int tw_XPConnectionHasEntitlement(id connection, NSString *entitlement) {
    DebugLog(@"XPCConnectionHasEntitlement... no u");

    //Only grant the required entitlement
    if (xpc_connection_get_pid(connection) == PIDForProcessNamed(@"SpringBoard") && [entitlement isEqualToString:@"com.apple.coretelephony.Calls.allow"])
        return true;

    return orig_XPConnectionHasEntitlement(connection, entitlement);
}

%end

%ctor {

    if ([bundleIdentifier isEqualToString:@"com.apple.backboardd"]) {
        %init(backboarddHooks);

        dlopen(XPCObjects, RTLD_LAZY);

        void *xpcFunction = MSFindSymbol(NULL, "_XPCConnectionHasEntitlement");

        MSHookFunction(xpcFunction, (void *)tw_XPConnectionHasEntitlement, (void **)&orig_XPConnectionHasEntitlement);
    }

}

Now you can use CTCallDial again if i'm not wrong ;) and from here it's your tour to play with it ;)

fo any errors while compiling check @b3ll MessageBox Good Luck

iMokhles
  • 219
  • 2
  • 9
  • First, this isn't neccessary, much easier to just sign your app with the entitlement. Second, SpringBoard is already signed with `com.apple.coretelephony.Calls.allow`. If it's a SpringBoard tweak, you don't need to do anything. – creker Apr 10 '14 at 19:41
  • And I don't think `backboardd` daemon has anything to do with CoreTelephony XPC calls - it's a helper daemon for the SpringBoard, it deals with touch events, proximity sensor, display brightness and other stuff that SpringBoard did in the past. CoreTelephony XPC calls are forwarded to `CommCenter` daemon and it's him who is checking entitlements. I checked disassembly and `com.apple.coretelephony.Calls.allow` entitlement is checked by `CommCenter` daemon. – creker Apr 10 '14 at 20:09
  • and if he want to put it in a tweak not an application ? :D – iMokhles Apr 13 '14 at 01:54
  • Then you need to choose a process that is signed with the entitlements you need or write a daemon that your tweak will use. Either way, your code will not help in case of CTCall. Backboardd has nothing to do with CoreTelephony APIs. – creker Apr 13 '14 at 02:24
  • Your code is an overkill and should be used in cases where nothing else will help. The question is clearly not such a case. It's about application, not a tweak. – creker Apr 13 '14 at 02:29