I am trying to access the WiFiManager Framework (previously apple80211) and can't find the right information. I understand Apple doesn't allow the use of private frameworks for apps on the app store but I am writing this app for personal use so this is of no concern to me. What I need to know is can I still access the WiFiManager Framework for an app I upload directly to my phone and is there any information out there on how to? Thanks in advance for ANY help.
Asked
Active
Viewed 6,746 times
1 Answers
5
See my answer here.
//IN YOUR APP
notify_post("com.yourcompany.yourapp.yournotification");
//IN YOUR DYLIB
#import <SpringBoard/SBWiFiManager.h>
HOOK(SpringBoard, applicationDidFinishLaunching$, void, id app) {
//Listen for events via DARWIN NOTIFICATION CENTER
CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL,
&NotificationReceivedCallback, CFSTR("com.yourcompany.yourapp.yournotification"), NULL,
CFNotificationSuspensionBehaviorCoalesce);
}
//THIS IS WHERE THE MAGIC HAPPENS
static void NotificationReceivedCallback(CFNotificationCenterRef center,
void *observer, CFStringRef name,
const void *object, CFDictionaryRef
userInfo)
{
[[objc_getClass("SBWiFiManager") sharedInstance] setWiFiEnabled:NO];
}
-
Thanks for the quick response WrightsCS. Is the SpringBoard framework built into the ios 4.2 sdk or is it third party. Also, once the NotificationReceivedCallback function is called, is there an object (SBWiFiManager) that is accessible and can be used or is it a C function that just allows access to the framework. – SteveWight Jan 28 '11 at 22:00
-
SpringBoard is not a framework. It's a Core Service. When you create an instance of SBWiFiManager, the you can access other parts of it. – WrightsCS Jan 28 '11 at 22:07
-
Beautiful hackery, @WrightsCS. Lots of shiny objects in them private frameworks ;-) – Johannes Fahrenkrug Jan 28 '11 at 22:09
-
Thanks for the help WrightsCS. Should I create my own DYLIB file or am I adding the import and hook into another DYLIB? – SteveWight Jan 29 '11 at 21:08
-
If you are creating a MobileSubstrate Extension (Cydia) then you can create a DYLIB. But it is pretty much the same concept. – WrightsCS Jan 29 '11 at 21:56
-
Will apple accepts this when app will uploaded into app store? – Santo Dec 07 '15 at 14:45
-
No Apple will reject your app if you user private framework in your app. – aniket.ghode Jul 25 '20 at 07:39