Search code examples
objective-cios7hookwifimanagertheos

How to hook SBWiFiManager into an app



I would like to know how can I hook SBWiFiManager methods into an app that I'm making with "theos".

I know that "SBWiFiManager" is a class that only exist in SpringBoard, and I know how to hook that making a tweak but not how to do that making an app.

I just want an app for my purpose with a switch to turn on/off the "wifi" connection.


Solution

  • You can't hook a class from another process. As you said, SBWiFiManager only exists in SpringBoard. What you can do, however is work with any of the existing methods for IPC, probably Darwin notifications as your aim is to switch the connection. Take a look at CoreFoundation's Notification Center API, where you will be using CFNotificationCenterPostNotification() in your application and CFNotificationCenterAddObserver() in a tweak injected into SpringBoard.