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

后端 未结 2 707
抹茶落季
抹茶落季 2020-12-18 16:21

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

相关标签:
2条回答
  • 2020-12-18 16:45

    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.

    0 讨论(0)
  • 2020-12-18 16:58
    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

    0 讨论(0)
提交回复
热议问题