iPhone get SSID without private library

后端 未结 9 987
[愿得一人]
[愿得一人] 2020-11-22 06:00

I have a commercial app that has a completely legitimate reason to see the SSID of the network it is connected to: If it is connected to a Adhoc network for a 3rd party har

9条回答
  •  眼角桃花
    2020-11-22 06:49

    This code work well in order to get SSID.

    #import 
    
    @implementation IODAppDelegate
    
    @synthesize window = _window;
    
    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
    
    
    CFArrayRef myArray = CNCopySupportedInterfaces();
    CFDictionaryRef myDict = CNCopyCurrentNetworkInfo(CFArrayGetValueAtIndex(myArray, 0));
    NSLog(@"Connected at:%@",myDict);
    NSDictionary *myDictionary = (__bridge_transfer NSDictionary*)myDict;
    NSString * BSSID = [myDictionary objectForKey:@"BSSID"];
    NSLog(@"bssid is %@",BSSID);
    // Override point for customization after application launch.
    return YES;
    }
    

    And this is the results :

    Connected at:{
    BSSID = 0;
    SSID = "Eqra'aOrange";
    SSIDDATA = <45717261 27614f72 616e6765>;
    

    }

提交回复
热议问题