How add entitlement via ldid

2019-01-26 19:29发布

问题:

I have some problems. I want use in my app next function:

int SBSLaunchApplicationWithIdentifier(CFStringRef displayIdentifier, Boolean suspended);
  • I add SpringboardServices.framework in my project
  • I add URL Schemes for my app
  • Created the file entitlement.xml with
<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> 
<dict> 
    <key>com.apple.springboard.launchapplications</key> 
    <true/> 
</dict> 
</plist>
  • Paste entitlement.xml in `Developer/Xcode/DerivedData/MyApp-efjwoxgwdyixnfassijmwtptxvlj/Build/Products/Debug-iphoneos/

  • Paste ldid in Developer/Xcode/DerivedData/MyApp-efjwoxgwdyixnfassijmwtptxvlj/Build/Products/Debug-iphoneos/

  • Did ./ldid -Sentitlement.xml MyApp.app/MyApp in console. It's good working But I saw some problem:

  • I did ./ldid -e MyApp.app/MyApp and saw next in console(double output entitlement.xml):
<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "apple.com/DTDs/PropertyList-1.0.dtd">; 
<plist version="1.0"> 
<dict> 
    <key>com.apple.springboard.launchapplications</key> 
    <true/> 
</dict> 
</plist>
<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "apple.com/DTDs/PropertyList-1.0.dtd">; 
<plist version="1.0"> 
<dict> 
    <key>com.apple.springboard.launchapplications</key> 
    <true/> 
</dict> 
</plist>
  • I create MyApp.ipa file consist with:
ItunesArtwork
Payload
|---MyApp.app
|---Info.plist
  • I installed this ipa file on my jailbreak iPhone via iTools MyApp is run but can't do some function. I try authorization via Internet and it's false. But when I installed app without added entitlement an didn't do some instruction with ldid, application working fine.

P.S: i didn't set in true Targets->AppName->Summary->Entitlements property (is it true or false ?) Please help me