3

I am using MobileWifi private framework to list all access points. Its a jailbroken phone and I use iOSOpenDev to compile and deploy. I included entitlements.xml in Project->BuildSettings->"Code Signing Entitlements"

XML has

<?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>

I still get error

_wifi_manager_open Client WifiTest has no entitlement 

I think I am missing the right way to add entitlements. Any ideas how to make it work?

EDIT: So I used ldid to sign the app per your previous answer. ldid gave following output.

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>

I am assuming it signed the app. Then using iExplorer I transferred the WifiTest.app directly on device. It crashes. Logs show..

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
TorukMakto
  • 2,066
  • 2
  • 24
  • 38
  • @Nate - So I was hooking the tweak(which is separate dylib) with my custom app and it did not have the entitlements. If I hook it with SpringBoard it works.. If I apply entitlements to my custom app, xcode throws error as custom app is not a tweak or legos project.. any ideas how to make it work... – TorukMakto Sep 06 '13 at 04:19
  • @Nate - I have also added complete xml in question. – TorukMakto Sep 06 '13 at 04:20
  • @Nate - I also tried using "codesign -f -s --entitlements entitlements.xml " - I used identity as the developer license that I already have.. But I am signing dylib. Not the custom app that actually hooks and invokes tweak.. Should I be? – TorukMakto Sep 06 '13 at 04:24
  • 2
    So, I'm not using iOSOpenDev right now ... just normal Xcode. But, in general, I don't add entitlements via my Xcode project. I build inside Xcode without code signing at all, and then run a one line command with `ldid` afterwords to fake codesign and add entitlements.xml file, all at once. [Have you tried this technique](http://stackoverflow.com/a/14885266/119114)? If you already have iOSOpenDev installed, it will have done a couple of those steps for you. – Nate Sep 06 '13 at 04:25
  • So, the important thing would be to add the entitlements to your app, not the dylib that it uses. Even if the dylib is the one making the MobileWifi calls, I think you need to sign the app executable that will be running it. Does that make sense? – Nate Sep 06 '13 at 04:26
  • Great, Let me try it and get back in few hours.. Thx for your help... – TorukMakto Sep 06 '13 at 04:28
  • I don't understand your `ldid` output. `ldid` normally doesn't have any output. Are you saying that you ran `ldid -Sentitlements.xml WifiTest`, and then, **after that**, you ran `ldid -e WifiTest` just to *list* the entitlements ... double-checking what you've done? – Nate Sep 07 '13 at 03:54
  • @Nate - I just executed one command - ldid -entitlements.xml WifiTest. It still echoed the XML which is slightly different that original input xml.. – TorukMakto Sep 08 '13 at 06:50
  • there is a capital S before the name of the xml file. do you have that? – Nate Sep 08 '13 at 07:07
  • @Nate - Thanks. yes I had missed S as I thought its not my file name and failed to realize its a flag(I was literally dumb).. Now I was able to sign without any output and also verify the signature with -e command. I tried installing the .app via iExplorer. It gets copied but does not show icon on SpringBoard even after killall -HUP SpringBoard.. So how do I convert .app to .ipa and install? – TorukMakto Sep 09 '13 at 05:37
  • Ok, so I'm going to recommend that you ask a new question. If you've successfully signed the app (or fake signed with `ldid`), and added the entitlements, then the problem converting an app to an installable .ipa file is really a separate problem. I'd also recommend you just delete this question, because if the problem was just a missing `S` in the command line, I don't think many others will be helped by seeing this question and answer. It's your decision, but that's my recommendation. If you create a new question, just asking about the .ipa installation, I can try to take a look. Thx. – Nate Sep 09 '13 at 06:58
  • Thanks Nate - I posted a new question. I will also delete this answer later. – TorukMakto Sep 09 '13 at 07:12

0 Answers0