March 5, 2020

22:33

Ha! Fun! When you ask Google Play for anything, you get a binary blob in response which must be parsed, using the protobuf library. There are two version of that library available (v2.x and v3.x) that implement version 2 and 3 of the protocol buffer language respectively. Since the two languages are incompatible with each other, I always assumed that the libraries would be as well, but that’s not the case! Version 3.x of the library is actually backwards compatible and able to properly handle blobs created with v2.x!

Why is this so great? Well, Play is inherently tied to version 2 of the language, but the v2.x library lacks a lot of useful features, such as the ability to export a binary blob to JSON. You can only format a message as plain text which kinda looks like JSON, but won’t be parseable. For small stuff that’s sufficient, but you are completely at a loss when dealing with something bigger, such as search results.

So, here’s the same search result (“test”) in the plain text and in the json format. The later can easily be inspected in existing tools (Firefox for example).