Skip to content

Instantly share code, notes, and snippets.

@tewilove
Created June 25, 2016 05:14
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tewilove/08a46c9c8314c6975a603ca06f91a68e to your computer and use it in GitHub Desktop.
Save tewilove/08a46c9c8314c6975a603ca06f91a68e to your computer and use it in GitHub Desktop.
<?php
$req = array(
"method" => "get_all_builds",
"params" => array(
"device" => "icesky_msm8992_user", // ro.product.device + "_" + ro.build.type
"version" => "2.5.3-2016012303-user-is", // ro.smartisan.version
"buildtime" => "1453489594", // ro.build.date.utc
"deviceid" => "990006210028584", // IMEI
"flag" => "0", // rooted
)
);
$req = json_encode($req);
var_dump($req);
$url = "https://ota.smartisan.com/update.php";
$headers = array(
"Cache-Control: no-cache",
"Content-Type: application/octet-stream",
"Content-Length: ". strlen($req),
);
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_VERBOSE, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_USERAGENT, "com.smartisanos.updater/5.1.1-64");
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POSTFIELDS, $req);
$res = curl_exec($curl);
var_dump($res);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment