For iPhone Wifi Develop
Categories: iPhone on Dec.29, 2008
Using Private Framework is banned by Apple. It’s the biggest violation to Apple’s sdk agrement. But who cares, that doesn’t mean we can try and experiment what we can really do with an iphone. I’ll show you here in few lines how to link at runtime your application with a private framework. In this case I will use Apple80211.
- void *libHandle;
- void *airportHandle;
- int (*open)(void *);
- int (*bind)(void *, NSString *);
- int (*close)(void *);
- int (*associate)(void *, NSDictionary*, NSString*);
- int (*scan)(void *, NSArray **, void *);
- libHandle = dlopen(”/System/Library/PrivateFrameworks/Apple80211.framework/Apple80211″, RTLD_LAZY);
- open = dlsym(libHandle, “Apple80211Open”);
- bind = dlsym(libHandle, “Apple80211BindToInterface”);
- close = dlsym(libHandle, “Apple80211Close”);
- associate = dlsym(libHandle, “Apple80211Associate”);
- scan = dlsym(libHandle, “Apple80211Scan”);
The real drawback of this approach is that the framework absolute path is hardcoded in our call to dlopen, which means Apple is able, with a real small change to the OS, to breaks our app. For completeness, the last framework organization change happened with the big step between firmware 1.x and 2.x.
Similar posts:




July 17th, 2009 on 12:04 am
really good job copying word by word my original blog post:
check it out: http://openovo.wordpress.com/2008/12/15/linking-private-framework/
in this case you should put a reference.
July 17th, 2009 on 12:10 am
Anyway..there are some minor changes with OS 3.0. That code you posted will crash your phone. And i want to be nice…here they are, so you can update your post:
the location of the framework is different..so
change
libHandle = dlopen(”/System/Library/PrivateFrameworks/Apple80211.framework/Apple80211″, RTLD_LAZY);
to
libHandle = dlopen(”/System/Library/SystemConfiguration/WiFiManager.bundle/WiFiManager”, RTLD_LAZY);
there are some minor diffs in the data you get back.. as of now i remember the signal strength was different… but you’ll figure it out.
July 17th, 2009 on 1:55 am
thanks :)