viny76 / iphone-wireless

Automatically exported from code.google.com/p/iphone-wireless
0 stars 0 forks source link

Error on iOS SDK 5.0 when calling open(&handle); #45

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Following code (opening a handel with C library dlfcn.h) was working find till 
iOS 4.3.3 

----------
void *handle = 
dlopen("/System/Library/SystemConfiguration/WiFiManager.bundle/WiFiManager", 
RTLD_LAZY);

    int (*open)(void *) = dlsym(handle, "Apple80211Open");
    int (*bind)(void *, CFStringRef) = dlsym(handle, "Apple80211BindToInterface");
    int (*close)(void *) = dlsym(handle, "Apple80211Close");        
    int (*scan)(void *, CFArrayRef *, void *) = dlsym(handle, "Apple80211Scan");

    open(&handle);    
    bind(handle, CFSTR("en0"));   
    CFDictionaryRef parameters = CFDictionaryCreateMutable(NULL, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);    
    CFArrayRef networks;    
    scan(handle, &networks, parameters);

----------
With new SDK 5.0 on beta getting following error, 
Is there any one who have found a solution on this?

Errors:
warning: check_safe_call: could not restore current frame
warning: Unable to restore previously selected frame.

Original issue reported on code.google.com by tso...@gmail.com on 10 Jun 2011 at 4:23

GoogleCodeExporter commented 8 years ago
Substituting 
"/System/Library/SystemConfiguration/WiFiManager.bundle/WiFiManager" with
"/System/Library/SystemConfiguration/IPConfiguration.bundle/IPConfiguration"  
works.

However per  http://blog.guvenergokce.com/iphone-wireless-scanner-ios5/170/ we 
need a jailbroken device.

However during our tests we found that issuing the stop command from the XCODE 
debugger seems to get the scan results even on non-jailbroken devices. Is there 
a way to send a SIGINT inside the code and add a handler to catch the signal to 
mimic the GDB stop. This could work around needing root permissions.

Original comment by jaga...@gmail.com on 12 Nov 2011 at 12:40

GoogleCodeExporter commented 8 years ago
How can I do to run GDB in sending the SIGINT dear friend "Comment 51:

Original comment by nin...@gmail.com on 12 Nov 2011 at 2:03

GoogleCodeExporter commented 8 years ago
I don't know anything about this stuff but I thought of something that I'm now 
wondering about.  Like many of you I need to run my app on a non-jailbroken 
iPhone. But....  What if I had a jailbroken iPhone. Is it possible to copy the 
WiFiManager or IPConfiguration dylib off the iPhone and include it as a 
resource in my Xcode project.  Then when running on a non-jailbroken iPhone, 
use the version from my app bundle.  I don't know if this is even possible and 
if so does it get around the permissions problem?

Original comment by c...@crimtec.com on 16 Nov 2011 at 11:07

GoogleCodeExporter commented 8 years ago
Seems currently all the applications(include those in APP store) are not 
available for iOS5. Anyhow, the hint is Airport Utility is able to do the 
scan...
Hope we can find new solution soon for not Jail breaked iPhones.

Original comment by Yan.P.B...@gmail.com on 18 Nov 2011 at 2:25

GoogleCodeExporter commented 8 years ago
Airport Utility, uses the string in the entitlements.plist, but it's
impossible to put the app on the device with that string.

Original comment by iwha...@gmail.com on 18 Nov 2011 at 8:32

GoogleCodeExporter commented 8 years ago
So anybody have a response to my Comment #53?

Original comment by c...@crimtec.com on 23 Nov 2011 at 2:20

GoogleCodeExporter commented 8 years ago
Today I found the debug that Apple uses the 
"/System/Library/SystemConfiguration/WiFiManager.bundle/WiFiManager"  

Original comment by nin...@gmail.com on 28 Nov 2011 at 3:48

GoogleCodeExporter commented 8 years ago
At comment 57: My friend this does not work with iOS 5. it crashes me when I 
use this path.
So is not the solution. I don't know if solution will exist (for non jailbreak 
iOS devices).

Original comment by csiloua...@googlemail.com on 30 Nov 2011 at 1:48

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Anyone have updates regarding this? Are there any hope for non-jailbreaking 
users?

Original comment by garcia.i...@gmail.com on 24 Jan 2012 at 6:11

GoogleCodeExporter commented 8 years ago
hi everyone, i tested 
/System/Library/SystemConfiguration/IPConfiguration.bundle/IPConfiguration, i 
can get rssi from  Apple80211GetInfoCopy and it need not jailbreak your ios, 
but i doesn't test other APIs.

My devices are ipad2-ios5.0.1 and ipad2-ios5.1.

Original comment by yupeng...@gmail.com on 11 Apr 2012 at 5:38

GoogleCodeExporter commented 8 years ago
Could anyone please confirm yupengs findings?

If anyone could test if 
http://code.google.com/p/iphone-wireless/wiki/Apple80211Scan works with 5.0.1 
and 5.1 I would be greatful.

Original comment by malek.ma...@gmail.com on 17 Apr 2012 at 11:48

GoogleCodeExporter commented 8 years ago
Apple80211Scan works with 5.0.1 and 5.1 but only on jailbreak devices. On 
non-jailbreak devices you still get the "deny system-socket" due to sandboxing.

Original comment by agrana...@gmail.com on 17 Apr 2012 at 3:45

GoogleCodeExporter commented 8 years ago
Thanks for the answer

Original comment by malek.ma...@gmail.com on 17 Apr 2012 at 3:49

GoogleCodeExporter commented 8 years ago
Has anyone managed to get the Apple80211Associate method to work?
I can successfully run Apple80211Open, Apple80211Close, 
Apple80211BindToInterface, Apple80211Scan, and Apple80211GetInfoCopy on my 
jailbroken device thanks to 
http://blog.guvenergokce.com/iphone-wireless-scanner-ios5/170/ but I can't seem 
to associate to a network; any help would be much appreciated 
(going through http://code.google.com/p/iphone-wireless/issues/detail?id=20 did 
not solve my problem).

Original comment by specktas...@gmail.com on 23 Apr 2012 at 3:59

GoogleCodeExporter commented 8 years ago
Apple80211Scan can not work on jailbreak devics with ios 5.0.1 and ios 5.1, I 
use the sample from 
http://blog.guvenergokce.com/iphone-wireless-scanner-ios5/170/.

Original comment by chexinsh...@gmail.com on 25 Apr 2012 at 3:57

GoogleCodeExporter commented 8 years ago
unable to scan wifi using Apple80211Scan with iOS 5.1.0. Did someone manage to 
make it work.

Original comment by ans...@affle.com on 11 Jun 2012 at 7:00