我正在使用 MobileWifi 私有框架列出所有接入点。它是一部越狱手机,我使用 iOSOpenDev 进行编译和部署。我在 Project->BuildSettings->"Code Signing Entitlements" 中包含了 entitlements.xml
XML 有
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.wifi.manager-access</key>
<true/>
</dict>
</plist>
我仍然收到错误
_wifi_manager_open Client WifiTest has no entitlement
我想我错过了添加权利的正确方法。任何想法如何使它工作?
编辑: 所以我使用 ldid 根据您之前的答案对应用程序进行签名。ldid 给出了以下输出。
WifiTest
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>application-identifier</key>
<string>ECZNUJJL7C.com.WifiTest</string>
<key>get-task-allow</key>
<true/>
<key>keychain-access-groups</key>
<array>
<string>ECZNUJJL7C.com.WifiTest</string>
</array>
</dict>
</plist>
我假设它签署了应用程序。然后使用 iExplorer,我直接在设备上传输了 WifiTest.app。它崩溃了。日志显示..
Sep 6 16:02:31 com.apple.launchd[1] (UIKitApplication:com.WifiTest[0x4d49][19575]) <Error>: (UIKitApplication:com.WifiTest[0x4d49]) posix_spawn("/var/mobile/Applications/CCCAA7CB-2304-4A99-8306-20234E38652F/WifiTest.app/WifiTest", ...): Permission denied
Sep 6 16:02:31 SpringBoard[19291] <Warning>: Unable to obtain a task name port right for pid 19575: (os/kern) failure
Sep 6 16:02:31 com.apple.launchd[1] (UIKitApplication:com.WifiTest[0x4d49][19575]) <Warning>: (UIKitApplication:com.WifiTest[0x4d49]) Exited with code: 1
Sep 6 16:02:31 SpringBoard[19291] <Warning>: Unable to look up event port name for pid 19575: (os/kern) successful
Sep 6 16:02:31 SpringBoard[19291] <Warning>: Unable to send activation event to <SBApplication: 0xd223be0> com.WifiTest animate statusBarOrientation = 1 activate: animationStart = 0 deactivate: : (ipc/send) invalid destination port