Skip to content

Instantly share code, notes, and snippets.

@1Conan
Created December 20, 2016 07:23
Show Gist options
  • Select an option

  • Save 1Conan/520da7812ce24a1ed518bd4d3c52374d to your computer and use it in GitHub Desktop.

Select an option

Save 1Conan/520da7812ce24a1ed518bd4d3c52374d to your computer and use it in GitHub Desktop.
<?php
$signedVersionsURL = "https://api.ipsw.me/v2.1/firmwares.json/condensed";
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL,$signedVersionsURL);
$result = curl_exec($ch);
curl_close($ch);
$data = json_decode($result, true);
$firmwares = $data['devices'][$deviceInfo['deviceIdentifier']]['firmwares'];
$countFirmwares = count($firmwares);
for($i = 0; $i < $countFirmwares; $i++) {
$current = $firmwares[$i];
if($current['signed'] == true)
$firmware[] = $current;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment