Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "This is a library, i think",
"keywords": ["api", "php", "GD-API", "geometrydash", "php-library", "geometrydash-api"],
"license":"MIT",
"version": "1.0",
"version": "1.1",
"autoload": {
"psr-4": {
"GD-API\\GD-API\\": "autoload.php"
Expand Down
30 changes: 17 additions & 13 deletions src/GDComment.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,12 @@ public function __construct ($h, $u, $p, $s = null){
$this->password = $p;
$udid = "S" . mt_rand(111111111,999999999) . mt_rand(111111111,999999999) . mt_rand(111111111,999999999) . mt_rand(111111111,999999999) . mt_rand(1,9);
$sid = mt_rand(111111111,999999999) . mt_rand(11111111,99999999);
$this->host = str_replace("boomlings", "www.boomlings", $this->host); // <- you have to use www for some reason, thanks rob!
$ch = curl_init ();
curl_setopt ($ch, CURLOPT_URL, $this->host."/accounts/loginGJAccount.php");
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($ch, CURLOPT_POSTFIELDS, ["secret" => "Wmfv3899gc9", "userName" => $this->username, "password" => $this->password, "udid" => $udid, "sID" => $sid]);
curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query(["secret" => "Wmfv3899gc9", "userName" => $this->username, "password" => $this->password, "udid" => $udid, "sID" => $sid, "gameVersion" => '22', "binaryVersion" => '35']));
curl_setopt ($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded", "x-forwarded-for: ". $this->getServerIp()]);
$info = explode (",", curl_exec ($ch));
$this->usrID = $info[1];
$this->accID = $info[0];
Expand All @@ -76,7 +78,8 @@ public function postAccComment ($t, bool $bool = false){
$comment = base64_encode($t);
$ch = curl_init ($this->host."/uploadGJAccComment20.php");
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($ch, CURLOPT_POSTFIELDS, ["userName" => $this->username, "gjp" => $this->gjp, "comment" => $comment, "accountID" => $this->accID, "secret" => $secret]);
curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query(["userName" => $this->username, "gjp" => $this->gjp, "comment" => $comment, "accountID" => $this->accID, "secret" => $secret, "gameVersion" => '22', "binaryVersion" => '35']));
curl_setopt ($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded", "x-forwarded-for: ". $this->getServerIp()]);
$res = curl_exec ($ch);
if ($res == "-1"){
include __DIR__."/Exception/GDErrors.php";
Expand Down Expand Up @@ -105,17 +108,16 @@ public function postComment (string $t, int $l, $bool = false){
//$chk = "UA4BDAQBC1IPVQUMVw0AUAoCWlAAAFFZUwBYBg0JVFoCWwlWC1cPAQ==";

$ch = curl_init ($this->host."/uploadGJComment21.php");
$headers = array ("X-FORWARDED-FOR: ". $this->getServerIp());
curl_setopt ($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($ch, CURLOPT_POSTFIELDS, ["userName" => $this->username, "gjp" => $this->gjp,"chk" => $chk, "accountID" => $this->accID, "gameVersion" => $gameVersion, "binaryVersion" => $binaryVersion, "comment" => $comment, "levelID" => $levelID, "percent" => $percent, "secret" => $secret]);
curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query(["userName" => $this->username, "gjp" => $this->gjp,"chk" => $chk, "accountID" => $this->accID, "gameVersion" => "22", "binaryVersion" => "35", "comment" => $comment, "levelID" => $levelID, "percent" => $percent, "secret" => $secret]));
curl_setopt ($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded", "x-forwarded-for: ". $this->getServerIp()]);
if (curl_exec($ch) == "-1"){
include __DIR__."/Exception/GDErrors.php";
$err = new GDErrors ($this->host);
if ($bool = false){
GDErrors::GDPostComment ($levelID);
} elseif ($bool = true){
return curl_exec ($ch)."/". $chk."/". $gameVersion."/". $this->gjp."\/". $comment."/". $secret."/". $this->accID."/". $this->username;
return curl_exec ($ch)."/". $chk."/". "22"."/". $this->gjp."\/". $comment."/". $secret."/". $this->accID."/". $this->username;
}
} else {
return curl_exec ($ch);
Expand All @@ -132,7 +134,8 @@ public function fetchComment ($i, $m = 0, $c = 0){
$levelID = $i;
$ch = curl_init ($url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($ch, CURLOPT_POSTFIELDS, ["secret" => $secret, "levelID" => $levelID, "gameVersion" => $gameVersion, "binaryVersion" => $binaryVersion, "mode" => $m, "page" => $c, "count" => 10]);
curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query(["secret" => $secret, "levelID" => $levelID, "gameVersion" => "22", "binaryVersion" => "35", "mode" => $m, "page" => $c, "count" => 10]));
curl_setopt ($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded", "x-forwarded-for: ". $this->getServerIp()]);
$arr = explode ("#", curl_exec ($ch))[0];
$arr = explode ("|", $arr);
foreach ( $arr as $fetch){
Expand Down Expand Up @@ -181,14 +184,14 @@ public function fetchAccComment (){
$page = $this->getPage ();
$ch = curl_init ($url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($ch, CURLOPT_POSTFIELDS, [
"gameVersion" => $gameVersion,
"binaryVersion" => $binaryVersion,
curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query([
"gameVersion" => '22',
"binaryVersion" => '35',
"secret" => $secret,
"accountID" => $accounts,
"page" => $page,
"total" => 10]);

"total" => 10]));
curl_setopt ($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded", "x-forwarded-for: ". $this->getServerIp()]);
$result = curl_exec ($ch);
$result = explode ("#", $result)[0];
$result = explode ("|", $result);
Expand All @@ -214,9 +217,10 @@ public function fetchCommentHistory ($m = 0){
$userID = $this->usrID;
$page = $this->getPage ();

$pst = ["gameVersion" => $gameVersion, "binaryVersion" => $binaryVersion, "userID" => $userID, "total" => 10, "secret" => $secret, "mode" => $m, "page" => $page];
$pst = http_build_query(["gameVersion" => "22", "binaryVersion" => "35", "userID" => $userID, "total" => 10, "secret" => $secret, "mode" => $m, "page" => $page]);

$ch = curl_init ($host);
curl_setopt ($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded", "x-forwarded-for: ". $this->getServerIp()]);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $pst);

Expand Down
24 changes: 16 additions & 8 deletions src/GDConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class GDConfig {
public function __construct ($a, $b = null, $c = null){
//Set Host GD
$this->host = $a;
$this->host = str_replace("boomlings", "www.boomlings", $this->host);
$this->username = $b;
$this->password = $c;

Expand All @@ -19,7 +20,7 @@ public function __construct ($a, $b = null, $c = null){
$sid = mt_rand(111111111,999999999) . mt_rand(11111111,99999999);
curl_setopt ($ch, CURLOPT_URL, $this->host."/accounts/loginGJAccount.php");
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($ch, CURLOPT_POSTFIELDS, ["secret" => "Wmfv3899gc9", "userName" => $this->username, "password" => $this->password, "udid" => $udid, "sID" => $sid]);
curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query(["secret" => "Wmfv3899gc9", "userName" => $this->username, "password" => $this->password, "udid" => $udid, "sID" => $sid, "gameVersion" => '22', "binaryVersion" => '35']));
if (curl_exec($ch) == "-1"){
include __DIR__."/Exception/GDErrors.php";
$err = new GDErrors($this->host);
Expand Down Expand Up @@ -88,17 +89,19 @@ public function downloadSaveData ($p){
include __DIR__."/../config/config.php";
$url = $this->getAccountURL();
$url = $url."/database/accounts/syncGJAccountNew.php";
$postfields["gameVersion"] = $gameVersion;
$postfields["binaryVersion"] = 35;
$postfields["userName"] = $this->username;
$postfields["accountID"] = $this->accountID;
$postfields["password"] = $this->password;
$postfields["secret"] = "Wmfv3899gc9";
$postfields["gdw"] = 0;
$postfields["gameVersion"] = '22';
$postfields["binaryVersion"] = '35';


$ch = curl_init ($url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postfields);
curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query($postfields));
curl_setopt ($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded"]);
$response = curl_exec ($ch);
file_put_contents ($p, explode (";", $response)[0]);
return $response;
Expand All @@ -107,8 +110,8 @@ public function uploadSaveData ($kizunaAI){
include __DIR__."/../config/config.php";
$url = $this->getAccountURL();
$url = $url."/database/accounts/backupGJAccountNew.php";
$postfields["gameVersion"] = $gameVersion;
$postfields["binaryVersion"] = 35;
$postfields["gameVersion"] = '22';
$postfields["binaryVersion"] = '35';
$postfields["userName"] = $this->username;
$postfields["accountID"] = $this->accountID;
$postfields["password"] = $this->password;
Expand All @@ -118,7 +121,8 @@ public function uploadSaveData ($kizunaAI){

$ch = curl_init ($url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postfields);
curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query($postfields));
curl_setopt ($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded"]);
$response = curl_exec ($ch);
if ($response == "-1" || empty ($response)){
return "Upload Save Data Failed! / ". $response;
Expand All @@ -130,10 +134,14 @@ private function getAccountURL(){
$postURL["accountID"] = $this->accountID;
$postURL["type"] = "2";
$postURL["secret"] = "Wmfd2893gb7";
$postURL["gameVersion"] = '22';
$postURL["binaryVersion"] = '35';


$ch = curl_init ($this->host."/getAccountURL.php");
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postURL);
curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query($postURL));
curl_setopt ($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded"]);
$newHost = curl_exec ($ch);
curl_close ($ch);
return $newHost;
Expand Down
4 changes: 3 additions & 1 deletion src/GDLevel.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ class GDLevel {

public function __construct ($h, $i, $n = null){
include __DIR__."/../config/config.php";
$h = str_replace("boomlings", "www.boomlings", $h);
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $h."/downloadGJLevel22.php");
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($ch, CURLOPT_POSTFIELDS, ["levelID" => $i, "secret" => $secret]);
curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query(["levelID" => $i, "secret" => $secret, "gameVersion" => '22', "binaryVersion" => '35']));
curl_setopt ($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded"]);
$info = explode (":", curl_exec ($ch));

$this->fullString = curl_exec ($ch);
Expand Down
22 changes: 14 additions & 8 deletions src/GDMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public function __construct ($h, $u, $p){
include __DIR__."/../config/config.php";
$this->username = $u;
$this->host = $h;
$this->host = str_replace("boomlings", "www.boomlings", $this->host);
self::$password = $p;
$gjp = $this->plaintext (self::$password, 37526);
$gp = base64_encode ($gjp);
Expand All @@ -74,7 +75,8 @@ public function __construct ($h, $u, $p){
$sid = mt_rand(111111111,999999999) . mt_rand(11111111,99999999);
$ch = curl_init ($this->host."/accounts/loginGJAccount.php");
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($ch, CURLOPT_POSTFIELDS, ["udid" => $udid, "sID" => $sid,"userName" => $u, "password" => $p, "secret" => "Wmfv3899gc9"]);
curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query(["udid" => $udid, "sID" => $sid,"userName" => $u, "password" => $p, "secret" => "Wmfv3899gc9", "gameVersion" => '22', "binaryVersion" => '35']));
curl_setopt ($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded"]);
$res = curl_exec ($ch);
if ($res == "-1"){
include __DIR__."/Exception/GDErrors.php";
Expand All @@ -92,26 +94,28 @@ public function getMessage ($pgm = 0){
$url = $this->host."/getGJMessages20.php";
$ch = curl_init ($url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($ch, CURLOPT_POSTFIELDS, ["accountID" => $this->accID, "page" => $pgm, "getSent" => 0, "gjp" => self::$gjp, "secret" => $secret]);
curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query(["accountID" => $this->accID, "page" => $pgm, "getSent" => 0, "gjp" => self::$gjp, "secret" => $secret, "gameVersion" => '22', "binaryVersion" => '35']));
curl_setopt ($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded"]);
$res = curl_exec ($ch);
if ($res == "-1"){
return "Nothing here";
} else {
$info = explode ("#", $res)[0];
$info = explode ("|", $info);
foreach ($info as $fetch){
foreach ($info as $fetch) {
$msg = explode (":", $fetch);
$arr[] = ["username" => $msg[1], "userID" => $msg[3], "accountID" => $msg[5], "msg" => array("subject" => str_replace ("☆", "", base64_decode ($msg[9])), "messageID" => $msg [7], "sentDate" => $msg[15])];
}
return $arr;
}
return $res != "-2" ? $arr : [];
}
}
public function readMessage (int $mk){
include __DIR__."/../config/config.php";
$url = $this->host."/downloadGJMessage20.php";
$ch = curl_init ($url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($ch, CURLOPT_POSTFIELDS, ["accountID" => $this->accID, "secret" => $secret, "gjp" => self::$gjp, "messageID" => $mk]);
curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query(["accountID" => $this->accID, "secret" => $secret, "gjp" => self::$gjp, "messageID" => $mk, "gameVersion" => '22', "binaryVersion" => '35']));
curl_setopt ($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded"]);
$res = curl_exec ($ch);
$info = explode (":", $res);
$message = $this->cipher (base64_decode($info[15]), 14251);
Expand All @@ -121,10 +125,11 @@ public function readMessage (int $mk){
public function deleteMessage (int $o){
include __DIR__."/../config/config.php";
$messageID = $o;
$post = ["accountID" => $this->accID, "gjp" => self::$gjp, "messageID" => $messageID, "secret" => $secret];
$post = http_build_query(["accountID" => $this->accID, "gjp" => self::$gjp, "messageID" => $messageID, "secret" => $secret, "gameVersion" => '22', "binaryVersion" => '35']);
$ch = curl_init ($this->host."/deleteGJMessages20.php");
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt ($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded"]);
echo curl_exec ($ch);
}
public function sendMessage (string $m, string $s, int $t){
Expand All @@ -137,7 +142,8 @@ public function sendMessage (string $m, string $s, int $t){
$toAccount = $t;
$ch = curl_init ($this->host."/uploadGJMessage20.php");
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($ch, CURLOPT_POSTFIELDS, ["toAccountID" => $toAccount, "accountID" => $this->accID, "gjp" => self::$gjp, "body" => $message, "subject" => $subject, "secret" => $secret]);
curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query(["toAccountID" => $toAccount, "accountID" => $this->accID, "gjp" => self::$gjp, "body" => $message, "subject" => $subject, "secret" => $secret, "gameVersion" => '22', "binaryVersion" => '35']));
curl_setopt ($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded"]);
return curl_exec ($ch);
}
}
6 changes: 5 additions & 1 deletion src/GDProfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@ public function __construct ($u, $a, $s = null){
include __DIR__."/../config/config.php";
$tar = $a;
$host = $u;
$host = str_replace("boomlings", "www.boomlings", $host); // <- you have to use www for some reason, thanks rob!
$ch = curl_init ($host."/getGJUserInfo20.php");
curl_setopt ($ch, CURLOPT_POST, true);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($ch, CURLOPT_POSTFIELDS, ["targetAccountID" => $tar, "secret" => $secret]);
curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query(["targetAccountID" => $tar, "secret" => $secret, "gameVersion" => '22', "binaryVersion" => '35']));
curl_setopt ($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded"]);
if ($s == true){
if (curl_exec ($ch) == "1"){
echo "Not Found";
Expand All @@ -39,6 +42,7 @@ public function __construct ($u, $a, $s = null){
}
$this->fullString = curl_exec ($ch);
$info = explode (":", curl_exec ($ch));
curl_close($ch);
$this->userName = $info[1];
$this->usrID = $info[3];
$this->coins = $info[7];
Expand Down
6 changes: 5 additions & 1 deletion src/GDRegister.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
class GDRegister {
public function __construct ($h, $u, $p, $e){
include __DIR__."/../config/config.php";
$h = str_replace("boomlings", "www.boomlings", $h);
$url = $h."/accounts/registerGJAccount.php";

$username = $u;
Expand All @@ -12,10 +13,13 @@ public function __construct ($h, $u, $p, $e){
$post["password"] = $password;
$post["email"] = $email;
$post["secret"] = "Wmfv3899gc9";
$post["gameVersion"] = '22';
$post["binaryVersion"] = '35';

$ch = curl_init ($url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query($post));
curl_setopt ($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded"]);
$res = curl_exec ($ch);
}
}
6 changes: 5 additions & 1 deletion src/GDSong.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@ class GDSong {

public function __construct ($i2, $i, $s = null){
include __DIR__."/../config/config.php";
$i2 = str_replace("boomlings", "www.boomlings", $i2);
$host = $i2."/getGJSongInfo.php";
$ch = curl_init ($host);
$post["songID"] = $i;
$post["secret"] = $secret;
$post["gameVersion"] = '22';
$post["binaryVersion"] = '35';
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query($post));
curl_setopt($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded"]);
if ($s == true){
if (curl_exec ($ch) == "-1" OR curl_exec ($ch) == ""){
echo "Not Found";
Expand Down