Private API Failed on iOS? Try to check entitlements settings.

摘要:Private API Failed on iOS? Try to check entitlements settings.


在编写一些使用私有API的例子中,发现一些进程在执行过程中会出现一些莫名其妙的错误,比如没有返回或者什么的,这些很多都是在过去测试通过,但是现在却不行了。比如我们之前提到过的GDB调试问题。

苹果官方文档也有关于entitlements文档的描述,可以参见: Entitlement Key Reference

但是对私有API来说,很多权限并没有开放文档资料,那么怎么获取呢?

方法如下:

ldid -e <进程>

查看对应的权限。比如,下面就是SpringBoard的权限列表:





	allow-obliterate-device
	
	application-identifier
	com.apple.springboard
	aps-connection-initiate
	
	checklessPersistentURLTranslation
	
	com.apple.CommCenter.Preferences-delete
	
	com.apple.MobileInternetSharing.allow
	
	com.apple.SystemConfiguration.SCDynamicStore-write-access
	
	com.apple.SystemConfiguration.SCPreferences-write-access
	
		com.apple.AutoWake.xml
		preferences.plist
		com.apple.radios.plist
	
	com.apple.aosnotification.aosnotifyd-access
	
	com.apple.assistant.client
	
	com.apple.backboard.client
	
	com.apple.bulletinboard.observer
	
	com.apple.bulletinboard.settings
	
	com.apple.bulletinboard.systemstate
	
	com.apple.bulletinboard.utilities
	
	com.apple.cards.all-access
	
	com.apple.coremedia.allow-protected-content-playback
	
	com.apple.coretelephony.CTVoiceSupport.allow
	
	com.apple.iapd.accessibility
	
	com.apple.imagent.av
	
	com.apple.imagent.chat
	
	com.apple.itunesstored.private
	
	com.apple.keystore.device
	
	com.apple.locationd.authorizeapplications
	
	com.apple.locationd.effective_bundle
	
	com.apple.locationd.prompt_behavior
	
	com.apple.locationd.status
	
	com.apple.managedconfiguration.mdmd-access
	
	com.apple.managedconfiguration.profiled-access
	
	com.apple.mediastream.mstreamd-access
	
	com.apple.messages.composeclient
	
	com.apple.mobile.deleted.AllowFreeSpace
	
	com.apple.mobilemail.mailservices
	
	com.apple.multitasking.systemappassertions
	
	com.apple.multitasking.termination
	
	com.apple.private.accounts.allaccounts
	
	com.apple.private.allow-webviewcontroller
	
	com.apple.private.hid.manager.client
	
	com.apple.private.icfcallserver
	
	com.apple.private.imavcore.imavagent
	
	com.apple.private.imcore.imremoteurlconnection
	
	com.apple.private.kernel.jetsam
	
	com.apple.private.librarian.can-get-application-info
	
	com.apple.private.mobileinstall.allowedSPI
	
		Uninstall
		SetCapabilities
		Lookup
	
	com.apple.private.tcc.allow
	
		kTCCServiceAddressBook
		kTCCServiceCalendar
		kTCCServiceReminders
		kTCCServicePhotos
	
	com.apple.private.ubiquity-kvstore-access
	
		com.apple.weather
		com.apple.stocks
	
	com.apple.remotenotification.access
	
	com.apple.remotenotification.preferences
	
	com.apple.springboard.activateawayviewplugins
	
	com.apple.springboard.opensensitiveurl
	
	com.apple.timed
	
	com.apple.videoconference.allow-conferencing
	
	com.apple.wifi.manager-access
	
	keychain-access-groups
	
		apple
		com.apple.preferences
	
	vm-pressure-level
	

如果想签署一个和SpringBoard同样权限的软件,则可以保存这个plist,然后使用:

ldid -S[entitlements.xml]

签署一下就可以了

------------------------------

文章的授权使用CC BY-ND2.5协议。凡是标示“转载”的文章,均来源于网络并尽可能标注作者。如果有侵犯您的权益,请及时联系删除或者署名、授权。


Gtalk/Email: cmd4shell  [at]  gmail.com