I’ve been sitting on this code for a while now. I had been tooling around with it mostly about a year ago when I was collecting live market data - it actually took a long time to figure out what the actual token was. Not sure if this method will be changed since there is apparently a big update for the market coming up, I’m assuming it won’t change though - otherwise older versions of the market would break. For people who don’t know - the http requests the vending apk is sending holds a token which there was no link to how it was obtained or formed. It turns out to just be a simple token requested like any other google service. The “service” name just turned out to be android. Other “services” that the market uses are androidsecure and sierra - the latter being the codename for google-checkout.
The main reason this was a pain to figure out was because it’s being handled by the com.google.android.googleapps package, not the vending.apk package.
Hopefully this snippet will be useful for some people, like the MyMarket creators or anyone else trying to do market data analysis. I’ll try to post later how to actually send data and receive it using this token. Enjoy for now!
// declare variables for use in gettig auth-token private final static String account = "[email protected]"; private final static String password = "yourPassword";
// service must be 'android' for market-data private final static String service = "android";
public static void main(String[] args) throws UnsupportedEncodingException, MalformedURLException, IOException {