Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Developer Console v2

willlunniss edited this page Aug 9, 2012 · 25 revisions

A collection of information on the new 'v2' of the Android Developer Console. At the moment this is a WIP collection of information/TODO list. Once the implementation is done, this should be adapted to be a nice guide on everything you need to know about v2 and how to collect and parse the data.

Sign up for the new console here. Note that Google lets you switch between the old and new so you can still access the old one via Andlytics.

Andlytics issue link.

Branch containing work towards it link.

High level TODO List

  • Login process doesn't get past the first step (so remaining steps haven't been properly tested and may not be properly implemented either)
  • Fetching data doesn't work due to lack of login and haven't been able to re-use authentication data from browser
  • Investigate large numbers of apps (may not be an issue)
  • Properly detect draft apps (as google now lets you save incomplete information)
  • Investigate supporting accounts with multiple consoles

General comments

Firstly this is a massive change and we have no timeframe from Google as to when they will roll this out and switch off the old one, so we need to get this working ASAP. We can then hold it back until all users have v2 access, at which point we can roll it out.

Data responses are structured in a much nicer way compared to v1 and are parsed automatically using JSONArray and JSONObject (already done). However, active/total installs is not provided in the main overview anymore, so we have to get it from the /statistics requests which contains the full historical data broken down by category for all the different install metrics (so 2 requests per app for active and total). Number of ratings and comments are also seperated out as well. This all means we have to make a lot more requests.

Login, XSRF_TOKEN and cookies

Login now requires more steps that the old on to get the required data. Note that the ANDROID_DEV cookie from v1 has been replaced with an AD cookie in v2. I have also been unable to make the later requests work by using the details collected after logging in using my browser, so something else may be needed.

Extended dump of the login process link.

Get AUTH_TOKEN

Same as old version (use built in account manager java calls).

Get AD cookie

Note: Blocked on this as cannot get it to work, maybe more data is needed...

Request: GET https://play.google.com/apps/publish/v2/?auth=AUTH_TOKEN [HTTP/1.1 302 Moved Temporarily]

Gives cookie: AD

Gives location: https://play.google.com/apps/publish/v2/

Get DEV_ACC variable

Request: GET https://play.google.com/apps/publish/v2/ [HTTP/1.1 302 Moved Temporarily]

Requires cookie: AD

Gives location: https://play.google.com/apps/publish/v2/?dev_acc=DEV_ACC

Get XSRF_TOKEN

Request: GET https://play.google.com/apps/publish/v2/?dev_acc=DEV_ACC [HTTP/1.1 200 OK]

Requires cookie: AD

XSRF_TOKEN is in entity as JSON: "XsrfToken":"[null,\"XSRF_TOKEN\"]\n"

App data

Parsing is done using JSONObject and JSONArray and is now solved. However, due to inability to login, we haven't confirmed exactly what is needed to perform the requests.

List of apps

Number of requests needed: 1 per account

Request: POST https://play.google.com/apps/publish/v2/androidapps?dev_acc=DEV_ACC

Requires cookie: AD

Payload: {"method":"fetch","params":[,,1,1],"xsrf":"XSRF_TOKEN"}

Response:

{"result" : [ null,
      [ [ null,
          [ null,
            "PACKAGENAME",
            [ null,
              [ [ null,
                  "en-US",
                  "NAME",
                  "DESCRIPTION"
                  "",
                  "LAST_WHATS_NEW"
                ] ],
              [ null,
                0,
                24,
                1
              ]
            ],
            null,
            [ [ null,
                null,
                [ null,
                  null,
                  "PACKAGENAME",
                  VERSION_NUMBER,
                  "VERSION_NAME,
                  null,
                  [ null,
                    null,
                    null,
                    "APP_ICON_URL"
                  ]
                ],
                2
              ],
              .....
              LIST OF VERSIONS
              .....
            ],
            [ null,
              "PRICE",
              "GBP"
            ],
            "1343835459797", -- DATE?
            1
          ]
        ],
        .....
        LIST OF APPS
        .....
      ]
    ],
  "xsrf" : "XSRF_TOKEN"
}

Use: List of all apps and some of their version info

Stats

First request

Number of requests: 1 per app

Request: POST https://play.google.com/apps/publish/v2/statistics?dev_acc=DEV_ACC

Requires cookie: AD

Payload: {"method":"getSupportedMetrics","params":[,"PACKAGE_NAME"],"xsrf":"XSRF_TOKEN"}

Response: {"result":[null,0],"xsrf":"XSRF_TOKEN"}

Use: Not sure

App stats

Number of requests: 1 for active and 1 for total per app. (lots more if we want it broken down by the STATS_TYPE metrics)

Request: POST https://play.google.com/apps/publish/v2/statistics?dev_acc=DEV_ACC

Requires cookie: AD

Payload: {"method":"getCombinedStats","params":[,"PACKAGE_NAME",1,STATS_TYPE_INDEX,[STATS_BY_INDEX]],"xsrf":"XSRF_TOKEN"}

STATS_TYPE_INDEX Key: 1 = Active installs, ... 8 = Total user installs ...

STATS_BY_INDEX Key: Data by: 1 = Android version, 2 = Device, 3 = Country, 4 = Language, 5 = App version, 6 = Carrier

Reponse (For active installs by android version):

{ "result" : [ null,
      [ null,
        [ null,
          [ [ null,
              "1327737599999", -- Day 1
              "5"
            ],
            ....
            Active installs by day
            ....
            [ null,
              "1344063599999", -- TODAY
              "ACTIVE_INSTALLS"
            ]
          ]
        ],
        [ null, -- Active installs by API, ordered most by API version today to last by API version today
          [ [ null,
              [ [ null,
                  "1327823999999",
                  "0"
                ],
                ....
                Active installs by day for android API 15
                ....
                [ null,
                  "1344063599999",
                  "4066"
                ]
              ],
              null,
              null,
              "15",
              "Android 4.0.3 - 4.0.4" -- VERSION
            ],
            
          ....
		  List by version
		  ....
          [ null,
            [ null,
              [ [ null,
                  "API e.g. 15",
                  "INSTALLS",
                  "VERSION RANGE e.g. Anroid 4.0.3 - 4.0.4"
                ],
                ....
                List of overview data
                ....
              ]
            ],
            null,
            [ null, -- Percentage data for my app
              [ [ null,
                  0.4757224757224757,
                  "Android 4.0.3 - 4.0.4",
                  "Android 4.0.3 - 4.0.4"
                ],
                ....
              ]
            ],
            null,
            [ null, -- All aps in category
              [ [ null,
                  "API",
                  "ACTIVE_INSTALLS_BY_VERSION",
                  "VERSION_RANGE",
                  0.18342732537584786
                ],
                ....
              ]
            ],
            null,
            [ null,
              [ [ null, -- Total
                  0.581975898262862,
                  "Android 2.3.3 - 2.3.7",
                  "Android 2.3.3 - 2.3.7"
                ],
                ....
              ]
            ],
            null,
            "1344063599999", -- DATE
            24, -- NOT SURE
            "ACTIVE_INSTALLS"
          ]
        ],
        null,
        null,
        null,
        null,
        null,
        "APP_NAME"
      ]
    ],
  "xsrf" : "XSRF_TOKEN"
}

Ratings/Comments

Ratings

Number of requests: 1 per app

Request: POST https://play.google.com/apps/publish/v2/reviews?dev_acc=DEV_ACC

Requires cookie: AD

Payload: {"method":"getRatings","params":[,["PACKAGE_NAME"]],"xsrf":"XSRF_TOKEN"}

Response:

{ "result" : [ null,
      [ [ null,
          "PACKAGE_NAME",
          "NUM_1_STARS",
          "NUM_2_STARS",
          "NUM_3_STARS",
          "NUM_4_STARS",
          "NUM_5_STARS"
        ] ]
    ],
  "xsrf" : "XSRF_TOKEN"
}

Comments

Number of requests: 1 per app

Request: POST https://play.google.com/apps/publish/v2/reviews?dev_acc=DEV_ACC

Requires cookie: AD

Payload: {"method":"getReviews","params":[,"PACKAGE_NAME",START_INDEX,NUMBER_OF_COMMENTS_TO_FETCH] ,"xsrf":"XSRF_TOKEN"}

Response:

{ "result" : [ null,
      [ [ null,
          "gaia:17919762185957048423:1:vm:11887109942373535891", -- ID?
          "REVIEWERS_NAME",
          "1343652956570", -- DATE?
          RATING,
          "",
          "COMMENT",
          null,
          "VERSION_NAME",
          [ null,
            "DEVICE_CODE_NAME",
            "DEVICE_MANFACTURER",
            "DEVICE_MODEL"
          ],
          "LOCALE",
          null,
          0
        ],
        ....
        List of comments
        ....
      ],
      "TOTAL_COMMENTS"
    ],
  "xsrf" : "XSRF_TOKEN"
}