Gboard and Clipboard History

Gboard has been around since 2016 but I only recently realized some of the capabilities the Clipboard piece of it has. Yogesh Khatri wrote an excellent post a few years back on the typing aspects of Gboard artifacts but nothing regarding the clipboard itself (I'm not sure if this feature was implement after his blog).The user has the choice to enable with a little toggle switch in the settings (as seen in the UI next to the edit pencil).

Figure 1: Default view of Gboard Clipboard

Gboard gives you some default sample tips on how the clipboard works. You can edit your clips as well as pin them if you want to keep them for longer than the hour retention period. Are they really deleted? Lets take a look. 

The file path of interest for the Gboard clipboard database is:


The file may or may not exist depending on the toggle from what I can tell. If we open the database file we only get one table of interest, "clips".

Figure 2: Default entries in the "clips" table

We see some columns are straight forward, others not so much. After some testing here is what I could determine:
  • _id - unique identifier for each clip, also appears to match the timestamp added
  • text - text copied to the clipboard
  • html_text - TBD, I haven't been able to get this field populated but perhaps it's text copied from web files?
  • item_type - I've only seen the default (0) and pinned (1) here, maybe there are more types
    • The default tips shown from the start have item_types of 6, 10, 18, 34 respectfully
  • entity_type - I've only seen the default (0) and URL Link (1) here, maybe there are more types
  • timestamp - Unix epoch millisecond timestamp of when the clip was added
  • uri - local path to an image clipped
  • group_id - TBD, always NULL so far in my research
As stated for URI, the path looks like this:

Figure 3: URI content in "clips" table

From a filesystem perspective these files are found in the folder:


Figure 4: clipboard_image folder with images

No manipulation of extensions is needed which is nice for our parsing purposes. A quick SQLite query and some minor Python updates we now can parse clipboard history in ALEAPP, including embedded images.

Figure 5: Sample ALEAPP report for Gboard clipboard

Grab the latest code of ALEAPP now!