Skip to content
This repository has been archived by the owner on Jan 21, 2019. It is now read-only.

Commit

Permalink
User-Agent and Device Identifers to Match Nexus for Compatibillity is…
Browse files Browse the repository at this point in the history
…sues with newer apps, so most of the market apps should be visible. Tickets addressed #10 #13 #8 #7
  • Loading branch information
vincentkoc committed Jul 11, 2013
1 parent 98f0948 commit 2ef5e1b
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions Market/MarketSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class MarketSession {
function __construct () {
$this->context = new RequestContext();
$this->context->setUnknown1(0);
$this->context->setVersion(2009011);
$this->context->setDeviceAndSdkVersion("passion:8");
$this->context->setVersion(8013013);
$this->context->setDeviceAndSdkVersion("crespo:15");

$this->context->setUserLanguage("en");
$this->context->setUserCountry("US");
Expand Down Expand Up @@ -84,12 +84,17 @@ public function login($email, $password) {
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
@curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);


$headers = array(
"User-Agent: Android-Market/2 (sapphire PLAT-RC33); gzip",
//"User-Agent: Android-Market/2 (sapphire PLAT-RC33); gzip",
//"Content-Type: application/x-www-form-urlencoded",
//"Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7",

//New Headers - Old Ones Commented Out for Refernce
"User-Agent: Android-Finsky/3.7.13 (api=3,versionCode=8013013,sdk=15,device=crespo,hardware=herring,product=soju)",
"Content-Type: application/x-www-form-urlencoded",
"Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7",
);
Expand Down Expand Up @@ -192,8 +197,9 @@ private function executeRawHttpQuery($request) {
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_COOKIE, "ANDROID=".$this->authSubToken);
curl_setopt($ch, CURLOPT_USERAGENT, "Android-Market/2 (sapphire PLAT-RC33); gzip");

//curl_setopt($ch, CURLOPT_USERAGENT, "Android-Market/2 (sapphire PLAT-RC33); gzip");
curl_setopt($ch, CURLOPT_USERAGENT, "Android-Finsky/3.7.13 (api=3,versionCode=8013013,sdk=15,device=crespo,hardware=herring,product=soju)");

$post = "version=2&request=".base64_encode($request);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);

Expand Down

0 comments on commit 2ef5e1b

Please sign in to comment.