IPhone Wifi Scan Stumbler

I am trying to use SOLStumbler from here: Access and use MobileWiFi.framework to scan Wi-Fi networks. I know that this is not supported by the apple, but it is intended for educational purposes and experiments. I add the following files to the application and it compiles fine, but it always comes out with an error code. (As part of the ".m" file.) Does anyone know how to make this work?

SOLStumbler.h :

SOLStumbler.m :

This part of SOLStumbler.m always generates a one-letter error. Usually e , but sometimes u .

 libHandle = dlopen("/System/Library/SystemConfiguration/WiFiManager.bundle/WiFiManager", RTLD_LAZY); char *error; if (libHandle == NULL && (error = dlerror()) != NULL) { NSLog(@"%c",error); exit(1); } 

My ViewController Code:

 #import "SOLStumbler.h" -(void)viewDidLoad{ SOLStumbler *networksManager = [[SOLStumbler alloc] init]; [networksManager scanNetworks]; NSLog(@"%@", [networksManager description]); [networksManager release]; } 
+2
source share
1 answer

The SOLStumbler code you are trying to use is pretty old. This material (e.g. WiFiManager ) is in a private structure. This means that Apple can and will often change it or move it, if from the OS version to the version.

I assume you are using iOS 5?

I entered my iOS 5 phone, and really,

 /System/Library/SystemConfiguration/WiFiManager.bundle/ 

does not exist. So why is your code not working.

Take a look at this useful thread.

It looks like you can now find the equivalent (?) Functions in the IPConfiguration structure. Try this code:

 libHandle = dlopen("/System/Library/SystemConfiguration/IPConfiguration.bundle/IPConfiguration", RTLD_LAZY); 

I ran it on jailbroken iOS 5.0.1 and it worked (downloaded dylib and found some Apple80211 features). From this thread I'm connected to, it looks like you might need to install it in / Applications on a jailbroken phone to work fully. Or you may have to deal with adding some rights to your isolated application.

+2
source

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


All Articles