3

I have the following code:

<?php
$ids = 'ids=com.hugogames.hugotrollwars';

$opts = array('http' =>
array(
    'method'  => 'POST',
    'header'  => 'Content-type: application/x-www-form-urlencoded',
    'content' => $ids
)
);
$context  = stream_context_create($opts);
$result = file_get_contents('https://play.google.com/store/xhr/getdoc', false,             
$context);

$convert = explode("\n", $result);

Basically its pulling permissions from the Playstore and displaying it as a string. The issue I am having is removing the un needed data (image links, description) and only show the permissions and the permissions description. I tried using the json_decode function with php and it returned NULL.

Is there something i'm missing?

Any help is greatly appreciated!

1
  • 1
    Well there is an issue if you are logged into a google account. It will require the use of a valid token. If you log out, this requirement isnt needed. There is no API for the playstore sadly. So this is all new territory. There is a pattern of some sort. I noticed that {"42656262": is present on every app that gets returned. Commented Mar 2, 2014 at 22:36

1 Answer 1

2

$result is not valid json. Google Play API is using a protobuf variant.

http://www.segmentationfault.fr/publications/reversing-google-play-and-micro-protobuf-applications/

There are also php libraries to talk to google play.

https://github.com/splitfeed/android-market-api-php

https://github.com/thetutlage/Google-Play-Store-API

Sign up to request clarification or add additional context in comments.

3 Comments

That PHP Api doesnt actually work. If you try pulling permissions, it returns nothing.
Just updated the answer, second looks more powerful.
Sorry also outdated. Google just recently changed how they pull permissions. It used to be that they were in the source just not visible to the user until you triggered the modal. Not they send a ajax request to the URL above, retrieve the data then fill the modal in.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.