简体   繁体   中英

How can I enable and disable WiFi connectivity with a jailbroken iOS device?

如何以编程方式启用和禁用越狱的iOS设备的WiFi连接?

void SetWiFiMode(BOOL mode)
{
    void* manager = WiFiManagerClientCreate(kCFAllocatorDefault, nil);
    if (mode)
    {
        WiFiManagerClientSetProperty(manager, CFSTR("AllowEnable"), kCFBooleanTrue);
    }
    else
    {
        WiFiManagerClientSetProperty(manager, CFSTR("AllowEnable"), kCFBooleanFalse);
    }
    CFRelease(manager);
}

To use this your application entitlements should have com.apple.wifi.manager-access key with boolean value set to true. All functions can be found in private MobileWiFi.framework

There isn't a way using the APIs provided by the SDK. It's trivial to do if you use private frameworks, but if you use private frameworks, you will be in violation of Apple's SDK license agreement.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM