Obviously, this is hacking and is intended only for people who know what they are doing, but since Chrome Mobile does not allow the user to export / import their bookmarks (which are not very convenient for the user!), Sometimes there is no choice - imagine you need to clear your bookmark file with thousands of entries manually.
Anyway, here's a working Python implementation:
roots = ['bookmark_bar', 'other', 'synced'] def checksum_bookmarks(bookmarks): md5 = hashlib.md5() def checksum_node(node): md5.update(node['id'].encode()) md5.update(node['name'].encode('utf-16le')) if node['type'] == 'url': md5.update(b'url') md5.update(node['url'].encode()) else: md5.update(b'folder') if 'children' in node: for c in node['children']: checksum_node(c) for root in roots: checksum_node(bookmarks['roots'][root]) return md5.hexdigest()
While you only add bookmarks, you are probably fine, but for something more complicated (for example, performing basic cleanups, editing and deleting bookmarks, especially when several devices are involved), you must reset โChrome Syncโ, or it will return everything to you deleted materials and an additional copy of each changed bookmark: Settings โ Synchronization โ Manage synchronized data โ reset Synchronization
Pavel source share