1. <i id='1W4vT'><tr id='1W4vT'><dt id='1W4vT'><q id='1W4vT'><span id='1W4vT'><b id='1W4vT'><form id='1W4vT'><ins id='1W4vT'></ins><ul id='1W4vT'></ul><sub id='1W4vT'></sub></form><legend id='1W4vT'></legend><bdo id='1W4vT'><pre id='1W4vT'><center id='1W4vT'></center></pre></bdo></b><th id='1W4vT'></th></span></q></dt></tr></i><div id='1W4vT'><tfoot id='1W4vT'></tfoot><dl id='1W4vT'><fieldset id='1W4vT'></fieldset></dl></div>
      2. <legend id='1W4vT'><style id='1W4vT'><dir id='1W4vT'><q id='1W4vT'></q></dir></style></legend>

        <small id='1W4vT'></small><noframes id='1W4vT'>

      3. <tfoot id='1W4vT'></tfoot>
        • <bdo id='1W4vT'></bdo><ul id='1W4vT'></ul>

        使用私有 API 在 iOS 7 上扫描网络 (SSID)

        时间:2023-10-05

          <tfoot id='SNoJI'></tfoot>
            • <i id='SNoJI'><tr id='SNoJI'><dt id='SNoJI'><q id='SNoJI'><span id='SNoJI'><b id='SNoJI'><form id='SNoJI'><ins id='SNoJI'></ins><ul id='SNoJI'></ul><sub id='SNoJI'></sub></form><legend id='SNoJI'></legend><bdo id='SNoJI'><pre id='SNoJI'><center id='SNoJI'></center></pre></bdo></b><th id='SNoJI'></th></span></q></dt></tr></i><div id='SNoJI'><tfoot id='SNoJI'></tfoot><dl id='SNoJI'><fieldset id='SNoJI'></fieldset></dl></div>

              <small id='SNoJI'></small><noframes id='SNoJI'>

              <legend id='SNoJI'><style id='SNoJI'><dir id='SNoJI'><q id='SNoJI'></q></dir></style></legend>

                  <tbody id='SNoJI'></tbody>
                • <bdo id='SNoJI'></bdo><ul id='SNoJI'></ul>
                  本文介绍了使用私有 API 在 iOS 7 上扫描网络 (SSID)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  是否可以通过在 iOS 7 越狱设备上使用私有 API 来获取周围网络的 SSID 列表?

                  Is it possible to get list of SSID's of networks around by using private API on iOS 7 Jailbroken device?

                  我知道在 iOS 上管理 WiFi 功能的 MobileWiFi.framework.(它取代了过时的 Apple80211 框架.)

                  I know about MobileWiFi.framework that manages WiFi functionality on iOS. (It replaces the obsolete Apple80211 framework.)

                  这是 4 岁的答案如何使用它:访问&使用 MobileWiFi.framework

                  Here is 4 years old answer how to use it: Accessing & Using the MobileWiFi.framework

                  我尝试在 iOS 7 上使用这些方法,但没有成功.

                  I tried to use these methods on iOS 7, but have no luck.

                  在此解决方案作者的评论之一中,我收到了这个答案:

                  In one of the comments of author of this solution I receive this answer:

                  scanNetworks 失败,因为该代码现已使用 4 年.正如我在回答中所描述的,您必须使用新框架来获得等效功能(至少从 iOS 5 开始您就必须这样做).如果您尝试使用 iOS 7 执行此操作,我建议您发布一个新问题.

                  附言

                  这不是 获取 iOS 范围内的 SSID 的重复7 .我问一下这些功能的越狱方法.

                  UPD:

                  上面的链接和 creker 的答案中都有工作代码.但它需要通过沙盒限制.所以,正确的问题是:有没有办法用常规的 iOS 应用程序做到这一点?

                  There is working code in the link above and in the creker's answer too. But it's needed to pass the sandbox restrictions. So, the right question is: Is there a way to do that with regular iOS app?

                  推荐答案

                  这是我在iOS5-7上使用的

                  Here is what I use on iOS5-7

                  void* library = dlopen("/System/Library/SystemConfiguration/IPConfiguration.bundle/IPConfiguration", RTLD_LAZY);
                  
                  int (*apple80211Open)(void*) = (int(*)(void*))dlsym(library, "Apple80211Open");
                  int (*apple80211Bind)(void*, NSString*) = (int(*)(void*, NSString*))dlsym(library, "Apple80211BindToInterface");
                  int (*apple80211Close)(void*) = (int(*)(void*))dlsym(library, "Apple80211Close");
                  int (*apple80211Scan)(void*, NSArray**, void*) = (int(*)(void*, NSArray**, void*))dlsym(library, "Apple80211Scan");
                  
                  void *airport = NULL;
                  apple80211Open(&airport);
                  apple80211Bind(airport, @"en0");
                  
                  NSArray* networks = nil;
                  apple80211Scan(airport, &networks, [NSDictionary dictionary]);
                  
                  //"networks" is an array of NSDictionary objects for all the visible Wi-Fi networks
                  
                  apple80211Close(airport);
                  dlclose(library); 
                  

                  IPConfiguration 不是胖二进制文件.它仅包含一种与设备匹配的架构.因此,如果您计划支持 arm64 设备,您还必须为 arm64 编译代码 - 32 位应用程序无法加载 64 位 dylib.armv7 和 arm64 足以满足所有现代设备的需求.

                  IPConfiguration is not a fat binary. It contains only one architecture matching the device. Thus if you're planning on supporting arm64 devices you have to compile your code for arm64 also - 32-bit applications can't load 64-bit dylibs. armv7 and arm64 are enough for all modern devices.

                  更新

                  不幸的是,即使在越狱设备上,此代码也无法在常规 iOS 应用中运行.越狱不会关闭沙箱,这就是代码不起作用的原因.要使此代码正常工作,您需要将应用程序放在未应用沙盒限制的 /var/mobile/Applications 目录之外.它可以是 /Applications 目录中的守护进程、tweak 或 GUI 应用程序.该目录内的应用程序默认没有任何限制,可以访问任何私有 API.

                  Unfortunatelly this code doesn't work in regular iOS apps even on jailbroken device. Jailbreak doesn't turn off the sandbox which is the reason the code doesn't work. For this code to work you need to place your application outside /var/mobile/Applications directory where sandbox restrictions aren't applied. It could be a daemon, a tweak or a GUI application inside /Applications directory. Applications inside that directory doesn't have any restrictions by default and can access any private API.

                  这篇关于使用私有 API 在 iOS 7 上扫描网络 (SSID)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:禁用 NSOutputStream 的 Nagle 算法 下一篇:NSMutableURLRequest 和“请求主体流已用尽"错误

                  相关文章

                    • <bdo id='4f4Yy'></bdo><ul id='4f4Yy'></ul>
                    <legend id='4f4Yy'><style id='4f4Yy'><dir id='4f4Yy'><q id='4f4Yy'></q></dir></style></legend>
                    <i id='4f4Yy'><tr id='4f4Yy'><dt id='4f4Yy'><q id='4f4Yy'><span id='4f4Yy'><b id='4f4Yy'><form id='4f4Yy'><ins id='4f4Yy'></ins><ul id='4f4Yy'></ul><sub id='4f4Yy'></sub></form><legend id='4f4Yy'></legend><bdo id='4f4Yy'><pre id='4f4Yy'><center id='4f4Yy'></center></pre></bdo></b><th id='4f4Yy'></th></span></q></dt></tr></i><div id='4f4Yy'><tfoot id='4f4Yy'></tfoot><dl id='4f4Yy'><fieldset id='4f4Yy'></fieldset></dl></div>
                    <tfoot id='4f4Yy'></tfoot>
                  1. <small id='4f4Yy'></small><noframes id='4f4Yy'>