One of the jobs I’ve been meaning to tackle for some time is sychronizing my Blackberry Bold 9780 bookmarks with my Ubuntu Linux system. I had hoped the bookmarks would be in a simple XML format that could just be copied over and parsed, but from what I can tell bookmarks are stored in a binary database blob (I could be mistaken on this).
At any rate my Bold 9780 pretty much automounts when I plug it into my notebook. I looked through the directory tree structure and couldn’t find any indication of browser data. Then I remembered Net Direct’s Barry tool. Checking the Ubuntu repositories I saw there was a Gtk gui to back up a Blackberry, but I took this to mean making a raw backup, which I could just do with tar.
I checked out the barry man(ual) page and discovered that if you issued:
btool -t
Barry would list all the types of databases it stored, one of which turned out to be ‘Browser Bookmarks.’ To dump the database I just needed the -d switch and to redirect it to a file:
barry -d ‘Browser Bookmarks’ > raw-bookmarks.txt
What I discovered is that barry dumps the database as a binary+ascii file that resembles the following:
Raw record dump for record: 75200bac
00000000: 06 00 a9 00 40 01 44 01 0b 00 ac 0b 20 75 00 6b ….@.D….. u.k
00000010: 00 11 87 a9 80 97 2c 08 04 01 00 28 57 65 6c 63 ……,….(Welc
00000020: 6f 6d 65 20 74 6f 20 66 72 65 73 68 6d 65 61 74 ome to freshmeat
00000030: 2e 6e 65 74 20 7c 20 66 72 65 73 68 6d 65 61 74 .net | freshmeat
00000040: 2e 6e 65 74 81 b9 fc f8 f6 c2 e3 a4 d5 08 00 05 .net…………
00000050: 01 00 20 68 74 74 70 3a 2f 2f 66 72 65 73 68 6d .. http://freshm
00000060: 65 61 74 2e 6e 65 74 2f 66 61 76 69 63 6f 6e 2e eat.net/favicon.
00000070: 69 63 6f 00 a6 b2 ee 84 df 65 00 00 00 29 00 12 ico……e…)..
00000080: 00 15 68 74 74 70 3a 2f 2f 66 72 65 73 68 6d 65 ..http://freshme
00000090: 61 74 2e 6e 65 74 2f 01 c2 21 00 00 00 00 00 00 at.net/..!……
000000a0: 00 04 00 00 8f ff ff ff 7f ………
It’s readable, but still in an unfriendly format. I may as well just browse to each site on the device and type its URL into Firefox on my notebook.
I’ve gone down 3 paths trying to parse this file: hexdump, od, and xxd. So far I haven’t had a lot of luck. The closest I got was Brendan Zagaeski’s hexdump examples:
hexdump -v -e ‘”%010_ad |” 16/1 “%_p” “|\n”‘ raw-bookmarks.txt
But this seems to remove some data and it maintains the addressing in front of each line, so cutting and pasting isn’t so easy.
For now this is as close as I’ve gotten to synchronization. I hope someone with better sed/awk skills will shame me by posting a solution.