How can I access the iOS WiFiManager Framework?

I am trying to access the WiFiManager infrastructure (formerly apple80211) and cannot find the information I need. I understand that Apple does not allow the use of private application frameworks in the application store, but I am writing this application for personal use, so this does not concern me. I need to know if I can access the WiFiManager Framework for an application that I download directly to my phone, and is there any information on how to do this? Thanks in advance for ANY help.

+3
source share
1 answer

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];
}
+5
source

Source: https://habr.com/ru/post/1788601/


All Articles