Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS SpringBoardServices get UIApplication

using otool -tV SpringBoardServices command, I am able to get C functions in SpringBoardServices framework binary..

I can see SBFrontmostApplicationDisplayIdentifier which will give me id of the foremost app. Can this id be used to get UIApplication? Ultimately I want to get topmost view which is consuming touch events and its type like UIButton etc?

Any help appreciated.

like image 919
TorukMakto Avatar asked Oct 22 '22 10:10

TorukMakto


1 Answers

This is not a real answer, but rather just some thoughts on this problem.

C vs Objective C API's

  • Generally speaking, there are two types of API's: C API's (like SBFrontmostApplicationDisplayIdentifier) and objective C API's.

  • I believe all of C API's just work with primitive types (strings, integers and so on). I didn't see any C API which returns Objective C object.

  • SBFrontmostApplicationDisplayIdentifier returns id (which is just a string). As example "com.apple.Preferences" for Preferences app.

  • I believe you will have better luck looking for Objective C API's which returns any kind of objects

Inter-process communication

  • There is no simple way to transfer object (especially complex objects pointing to other objects, which points to other objects and so on) between processes. If you think about it, UIApplication object can reference half of application. The only way is to serialize EVERYTHING on one end and deserialize on another end.

  • Taking into account problems related to serialization of objects, most of API which needs to do inter-process communication, pass simple structures with most critical information to each other. And I saw exactly this pattern while reverse engineering iOS binaries.

UIApplication

  • My guess that UIApplication objects never leaves a process space. Actually existence of SBApplication class (inherited from SBDisplay) in Springboard is kind-of indirect confirmation for this.

Ideas

  • Try to look at BackboardService

  • Try to review all API's in SpringboardService

  • I would try to haunt for anything related to Display.

P.S. I would love to see the solution, because I am not aware of any API's which gives visibility into 3rd party app UI.

like image 74
Victor Ronin Avatar answered Nov 01 '22 19:11

Victor Ronin