Search code examples
iosobjective-cjailbreaktheos

Call duration class


I'm looking for the class that handles call duration UIView ( Or caller name ) for iOS 8 , So i could hook into it and find its frame position

enter image description here

What i tried and found so far :

  • I looked up the TelephonyUI private framework headers classes and Found nothing after so many hours of digging and trying

  • Sounds to me that it's related to MobilePhone.app but couldn't also find anything

  • syslog mostly logs data from it under Core Telephony Framework


Solution

  • On iOS 8 the in call UI no longers runs in MobilePhone or SpringBoard. It actually runs in a separate process - InCallService.app. It's works just like MFMessageComposeViewController I researched here. MobilePhone or SpringBoard (don't know for sure and it doesn't really matter), displays, what is called, remote view controller for in call view - it's a view controller which is being displayed in your app but the actual logic behind it runs in a separate process.

    For example, when you display MFMessageComposeViewController to send SMS message from your app you actualy using proxy object which connects through XPC to another process where actual view controller code runs. Your app only sends user input to the process and displays results that it returns to you - remote view controller forwards method calls through XPC connection. You don't actually have any control over the controller - you can manipulate it through a very limited API provided by XPC service that implements the logic.

    Obvious purpose of these remote view controllers is security. On iOS 5 there wasn't any and MFMessageComposeViewController was implemented just like a regular view controller. It meant that you could reverse engineer it to send SMS messages without user permission. And that exactly what some people did - there was AppStore apps that could send SMS messages silently using this code. Starting at iOS 6 that code requires special entitlement that AppStore can't have. MessagesViewService.app has it and through remote view controller running in it you can send SMS messages from AppStore apps but now you can't do it without the UI and user interaction.

    Same with in call UI. You can test it by doing a call and then killing InCallService.app process - in call view will disappear. So in order to change something you need to hook InCallService.app. Unfortunatelly I didn't research it to tell you exactly which methods you need to hook but at this point it will be very easy. I suggest you start looking at PHInCallRootViewController, PHInCallRootViewControllerActual and PHCallParticipantsView. The latter has a very interesting method setSingleDurationTimerLabel:(id) which modifies _singleDurationTimerLabel ivar. It looks like duration label view.