If UIPasteboard object is set 'persistent', it seems that items of UIPasteboard are stored in database or something like that. So is there any hint to me to find where the data is stored in system? Jailbreak. Thanks in advance.
Pasteboard is managed by com.apple.UIKit.pasteboardd
daemon located at /System/Library/Frameworks/UIKit.framework/Support/pasteboardd
. It doesn't run all the time, only when somebody actually needs it i.e. uses copy/paste.
It does use a persistent storage - /var/mobile/Library/Caches/com.apple.UIKit.pboard/pasteboardDB
binary property list. Even if you SIGKILL the daemon it will restore the pasteboard contents from the database.
pasteboardDB
root object is NSArray
. Each element is a NSDictionary
object that's bound to specific bundle id and name. For example, general copy/paste uses shared storage - dictionary has bundle->com.apple.UIKit.pboard
and name->com.apple.UIKit.pboard.general
keys. Under items
key there is an array of pasteboard items. Yoy can try to copy some text and you will find it there as unencrypted UTF8 string stored as NSData
object.