Skip to content
This repository was archived by the owner on Dec 16, 2020. It is now read-only.

Commit d6e5256

Browse files
committed
9.10 login changes
1 parent f830a9c commit d6e5256

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

src/snapchat.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ public function device()
133133
}
134134
private function getAttestation($password, $timestamp)
135135
{
136-
$nonce = base64_encode(hash('sha256', "$this->username|$password|$timestamp|loq/login", true));
136+
$hashString = $this->username."|{$password}|{$timestamp}|/loq/login";
137+
$nonce = base64_encode(hash('sha256', $hashString, true));
137138
$authentication = 'cp4craTcEr82Pdf5j8mwFKyb8FNZbcel';
138139
$apkDigest = 'JJShKOLH4YYjWZlJQ71A2dPTcmxbaMboyfo0nsKYayE';
139140

@@ -340,7 +341,7 @@ public function login($password, $force = FALSE)
340341
return $auth;
341342
}
342343
parent::setGAuth($auth);
343-
$attestation = $this->getAttestation($password, $timestamp);
344+
$attestation = $this->getAttestation($password, $timestamp);
344345

345346
$result = parent::post(
346347
'/loq/login',
@@ -356,7 +357,7 @@ public function login($password, $force = FALSE)
356357
'ptoken' => "ie",
357358
'timestamp' => $timestamp,
358359
'attestation' => $attestation,
359-
'sflag' => '1',
360+
'sflag' => 1,
360361
'application_id' => 'com.snapchat.android',
361362
'req_token' => $req_token,
362363
),

src/snapchat_agent.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,6 @@ public function post($endpoint, $data, $params, $multipart = FALSE, $debug = FAL
395395
curl_setopt($ch, CURLOPT_WRITEHEADER, $headerBuff);
396396
curl_setopt($ch, CURLOPT_PROXY, $this->proxyServer);
397397
$result = curl_exec($ch);
398-
399-
400398
if(strlen($result) > 0) //make sure curl worked. if not, keep going
401399
{
402400
if($endpoint == "/loq/login") $result = gzdecode($result);
@@ -427,7 +425,7 @@ public function post($endpoint, $data, $params, $multipart = FALSE, $debug = FAL
427425
{
428426
$jsonResult = json_decode($result);
429427
echo 'RESULT: ' . print_r($jsonResult) . "\n";
430-
if ($jsonResult->status == '-103')
428+
if (property_exists($jsonResult, "status") && $jsonResult->status == '-103')
431429
exit();
432430
}
433431
else

0 commit comments

Comments
 (0)