0

I'm developing a tweak for jailbroken iPhones. I'm trying to intercept the process of a call being added to the call history. With a little bit search I found CTCallHistoryStoreAddCall function in CoreTelephony framework found here. When I try to use it I get an error:

Undefined symbols for architecture armv7: "_CTCallHistoryStoreAddCall"

I linked the CoreTelephony framework and the way I used it in my code was:

typedef struct __CTCall * CTCallRef;
extern "C" void CTCallHistoryStoreAddCall(CTCallRef call);

I guess that means this function does not exist anymore or if it does I'm not using it in the correct way. How can I find the right function that is responsible for adding an incoming phone call to the call history?

Thanks in advanced.

I'm using iOSOpenDev on Xcode 5.

Hamed
  • 297
  • 3
  • 21
  • There is no such function. At least in iOS7. I've posted solution for iOS7 here http://stackoverflow.com/questions/22729003/hide-a-phone-call-completely-in-ios-jailbreak-device/22897769#22897769 On iOS6 class names are different but code is exactly the same - Apple just renamed the classes. My solution with hooking Phone app classes works, I use it since iOS4. – creker May 02 '14 at 14:36
  • I tested what you did but it just freezes and shows the call in the list. After I close mobile phone app and open it again it works. Is there a way to intercept it without the freeze? – Hamed May 02 '14 at 18:45
  • I don't see the freeze. My code works for me even when I'm in the phone app. I cancel hidden call and nothing shows up in the call list, even if hidden call was canceled while the phone app is in the foreground. – creker May 02 '14 at 19:10
  • I found out why it was slow. The problem was that `initWithCTCall` is called for each call in the call history so any process in that function could cause a pause in the application UI. I deleted all the call history and lightened the code a bit and now it works! Post your answer so I accept is as an answer. Thanks! – Hamed May 03 '14 at 14:11

2 Answers2

1

There is no such function. At least in iOS7.

I've posted solution for iOS7 here Hide a phone call completely in iOS (jailbreak device)

Here is the code:

//Private API from CoreTelephony.framework
void CTCallDeleteFromCallHistory(CTCallRef call);

%hook PHRecentCall

-(id)initWithCTCall:(CTCallRef)call
{
    if (IsCallShouldBeDeleted(call) == YES)
    {
        //Delete call from call history
        CTCallDeleteFromCallHistory(call);

        //Update MobilePhone app UI
        id PHRecentsViewController = [[[[[UIApplication sharedApplication] delegate] rootViewController] tabBarViewController] recentsViewController];
        if ([PHRecentsViewController isViewLoaded])
        {
            [PHRecentsViewController resetCachedIndexes];
            [PHRecentsViewController _reloadTableViewAndNavigationBar];
        }

        //Try uncommenting this, may be it will work. Should make the code faster.
        //return nil;
    }

    return %orig;
}

%end

Tweak hooks class inside MobilePhone app so bundle filter is com.apple.mobilephone.

IsCallShouldBeDeleted is pseudo function that determines whether a call should be deleted. You can remove it or implement your own. It's there just to make the code more clear.

On iOS6 class names are different but code is exactly the same - Apple just renamed the classes. I use that solution since iOS4. Also on iOS4 it requires a bit more code as there was no CTCallDeleteFromCallHistory function.

Community
  • 1
  • 1
creker
  • 9,400
  • 1
  • 30
  • 47
0

You are encountering this error because the CoreTelephony framework is not being linked to your program. To fix this, add the following to your makefile:

PROJECT_NAME_PRIVATE_FRAMEWORKS = CoreTelephony

Note that you have to replace PROJECT_NAME with your own project's name.

Vatsal Manot
  • 17,695
  • 9
  • 44
  • 80
  • I'm using iOSOpenDev and I have already linked the framework but it gives me the error. Anyway thank you for answering! – Hamed May 02 '14 at 09:13