Where does Android store clipboard data?
I have a rooted Android phone. Where are clipboard files stored? I can find that in a rooted Samsung device at /data/Clipboard
, but am not able to find in other Android phones (e.g. Sony, HTC). For phones running GingerBread.
I'm able to see the clipboard data using adb shell service call clipboard 1
, but after Gingerbread this service call command does not show the data.
Answer
Pure AOSP version of Android does not save clipboard data to files; the data is stored only in RAM by the ClipboardService, which runs inside the system_server
process.
Samsung, like many other manufacturers, adds their proprietary modifications to the base AOSP code; one of these modifications is the ability to keep the clipboard history, and this history is stored in files in the /data/Clipboard
directory. Of course, you won't find this proprietary Samsung code on other devices, or even in third-party ROMs for Samsung devices.
As for accessing the clipboard service using adb shell service call clipboard ...
, you cannot do it on recent Android versions, because the IClipboard interface now has security checks (it requires specifying the package name, and the calling uid must own the package name). This interface is also an implementation detail and changes between different Android versions.
No comments:
Post a Comment