where("in_adminid", intval($_COOKIE["in_adminid"]))->value("in_adminid") || md5(db("admin")->where("in_adminid", intval($_COOKIE["in_adminid"]))->value("in_adminpassword")) !== $_COOKIE["in_adminpassword"]) { exit("-1"); } $time = $_GET["time"]; $xml_size = $_GET["size"]; $tmp = IN_ROOT . "data/tmp/" . $time . ".apk"; $explode = explode("_", $time); $icontime = md5($explode[0] . "_" . $explode[1] . "_" . rand(2, pow(2, 24))) . ".png"; $apptime = md5($explode[1] . "_" . $explode[0] . "_" . rand(2, pow(2, 24))) . ".apk"; $apk = new \ApkParser\Parser($tmp); $xml_mnvs = $apk->getManifest()->getMinSdkLevel(); $xml_bid = $apk->getManifest()->getPackageName(); $xml_bsvs = $apk->getManifest()->getVersionName(); $xml_bvs = $apk->getManifest()->getVersionCode(); $labelResourceId = $apk->getManifest()->getApplication()->getLabel(); $appLabel = $apk->getResources($labelResourceId); $xml_name = detect_encoding($appLabel[0]); $resourceId = $apk->getManifest()->getApplication()->getIcon(); $resources = $apk->getResources($resourceId); foreach ($resources as $resource) { fwrite(fopen(IN_ROOT . "data/attachment/" . $icontime, "w"), stream_get_contents($apk->getStream($resource))); } $function = PHP_OS == "Linux" ? "rename" : "copy"; $function($tmp, IN_ROOT . "data/attachment/" . $apptime); echo "{'name':'" . $xml_name . "','mnvs':'" . $xml_mnvs . "','bid':'" . $xml_bid . "','bsvs':'" . $xml_bsvs . "','bvs':'" . $xml_bvs . "','form':'Android','nick':'*','type':'0','team':'*','icon':'" . $icontime . "','app':'" . $apptime . "','size':'" . $xml_size . "'}";