/doulCi.iDeviceCheck.php

https://github.com/JesPratt/Doulci · PHP · 231 lines · 168 code · 11 blank · 52 comment · 36 complexity · 6c8309fa54986d95fe161fb8b3e08de6 MD5 · raw file

  1. <?php
  2. // Checking Activation State & Grab the Tickets.
  3. if ( $DeviceClass == "iPhone" )
  4. {
  5. global $SIM_OK;
  6. $Message .= "DeviceClass = " .$DeviceClass . "\n";
  7. // We have an iPhone and let's start
  8. if ( $SIM_OK === true )
  9. {
  10. // This iPhone is Ready for Activation?
  11. if ( $ActivationState == "Unactivated" )
  12. {
  13. // Do We Have Already saved Tickets?
  14. if ( Check_File ( $Request_Path . DS . $ProductType . "_" . $BuildVersion . "_" . "ActivationTicket.data" ) )
  15. {
  16. // Get the iPhone UnBricked.
  17. // $Unbrick_Dec64 = file_get_contents ( $Request_Path . DS .
  18. // $ProductType . "_" . $BuildVersion . "_" .
  19. // "ActivationTicket.data" );
  20. // $Unbrick = base64_decode ( $Unbrick_Dec64 );
  21. $Unbrick = cURLgetData ( APPLE_ALBERT_ACTIVATION, USER_AGENT_ACTIVATION );
  22. $Message .= "<br><b>1 We have a Saved Activation Tickets Backup for your " . $DeviceClass . " from doulCi Server!</b>" . "<br>";
  23. }
  24. elseif ( Check_File ( $Request_Path . DS . $ProductType . "_" . $BuildVersion . "_" . "SoftActivationTicket.data" ) )
  25. {
  26. // Get the iDevice UnBricked.
  27. // $Unbrick_Dec64 = file_get_contents ( $Request_Path . DS .
  28. // $ProductType . "_" . $BuildVersion . "_" .
  29. // "SoftActivationTicket.data" );
  30. // $Unbrick = base64_decode ( $Unbrick_Dec64 );
  31. $Unbrick = cURLgetData ( APPLE_ALBERT_ACTIVATION, USER_AGENT_ACTIVATION );
  32. $Message .= "<br><b>2 We have a Saved SoftActivation Tickets Backup for your " . $DeviceClass . " from doulCi Server!</b>" . "<br>";
  33. }
  34. else
  35. {
  36. // Send Original iTunes Request to the Remote Server
  37. $Unbrick = cURLgetData ( APPLE_ALBERT_ACTIVATION, USER_AGENT_ACTIVATION );
  38. $Message .= "<br><b>3 Attempting to Get Activation Ticket for " . $DeviceClass . " from Apple Server!</b>" . "<br>";
  39. }
  40. }
  41. elseif ( $ActivationState == "Activated" )
  42. {
  43. $Unbrick = Setting_iTunes ( );
  44. $Message .= "<br><b> Your " . $DeviceClass . " state is 'Activated'.! it must be 'Unactivated' to gain help of 'doulCi Server'.</b>" . "<br>";
  45. }
  46. elseif ( $ActivationState == "SoftActivated" )
  47. {
  48. $Unbrick = Setting_iTunes ( );
  49. $Message .= "<br><b> Your " . $DeviceClass . " state is 'SoftActivated'.! it must be 'Unactivated' to gain help of 'doulCi Server'.</b>" . "<br>";
  50. }
  51. elseif ( $ActivationState == "SoftActivation" )
  52. {
  53. $Unbrick = Setting_iTunes ( );
  54. $Message .= "<br><b> Your " . $DeviceClass . " state is 'SoftActivation'.! it must be 'Unactivated' to gain help of 'doulCi Server'.</b>" . "<br>";
  55. }
  56. elseif ( $ActivationState == "FactoryActivated" )
  57. {
  58. $Unbrick = Setting_iTunes ( );
  59. $Message .= "<br><b> Your " . $DeviceClass . " state is 'FactoryActivated'.! it must be 'Unactivated' to gain help of 'doulCi Server'.</b>" . "<br>";
  60. }
  61. elseif ( $ActivationState == "WildcardActivated" )
  62. {
  63. $Unbrick = Setting_iTunes ( );
  64. $Message .= "<br><b> Your " . $DeviceClass . " state is 'WildcardActivated'.! it must be 'Unactivated' to gain help of 'doulCi Server'.</b>" . "<br>";
  65. }
  66. else
  67. {
  68. // "WTF Is Going On??"
  69. $Unbrick = cURLgetData ( APPLE_ALBERT_ACTIVATION, USER_AGENT_ACTIVATION );
  70. $Message .= "<br><b>0 doulCi Unknown Error Accrued for " . $DeviceClass . " ! Move to WTF Mode and Get Default Apple Response.</b>" . "<br>";
  71. // Show Merruk's Activation Error.
  72. // print Merruks_Error ( $SerialNumber ) ;
  73. }
  74. }
  75. else
  76. {
  77. // Send Original iTunes Request to the Remote Server
  78. $Unbrick = cURLgetData ( APPLE_ALBERT_ACTIVATION, USER_AGENT_ACTIVATION );
  79. $Message .= "<br><b> This " . $DeviceClass . " Cannot be activated by doulCi Server! Check your SIM Card Status.</b>" . "<br>";
  80. }
  81. }
  82. else
  83. {
  84. $Message .= "DeviceClass = " .$DeviceClass . "\n";
  85. // This iDevice is Ready for Activation?
  86. if ( $ActivationState == "Unactivated" )
  87. {
  88. // Do We Have Already saved Tickets?
  89. if ( Check_File ( $Request_Path . DS . $ProductType . "_" . $BuildVersion . "_" . "ActivationTicket.data" ) )
  90. {
  91. // Get the iDevice UnBricked.
  92. // $Unbrick_Dec64 = file_get_contents ( $Request_Path . DS .
  93. // $ProductType . "_" . $BuildVersion . "_" .
  94. // "ActivationTicket.data" );
  95. // $Unbrick = base64_decode ( $Unbrick_Dec64 );
  96. $Unbrick = cURLgetData ( APPLE_ALBERT_ACTIVATION, USER_AGENT_ACTIVATION );
  97. $Message .= "<br><b> We have a Saved Activation Tickets Backup for your " . $DeviceClass . " from doulCi Server!</b>" . "<br>";
  98. }
  99. elseif ( Check_File ( $Request_Path . DS . $ProductType . "_" . $BuildVersion . "_" . "SoftActivationTicket.data" ) )
  100. {
  101. // Get the iDevice UnBricked.
  102. // $Unbrick_Dec64 = file_get_contents ( $Request_Path . DS .
  103. // $ProductType . "_" . $BuildVersion . "_" .
  104. // "SoftActivationTicket.data" );
  105. // $Unbrick = base64_decode ( $Unbrick_Dec64 );
  106. $Unbrick = cURLgetData ( APPLE_ALBERT_ACTIVATION, USER_AGENT_ACTIVATION );
  107. $Message .= "<br><b> We have a Saved SoftActivation Tickets Backup for your " . $DeviceClass . " from doulCi Server!</b>" . "<br>";
  108. }
  109. else
  110. {
  111. // Send the Original iTunes Request to the Remote Server
  112. $Unbrick = cURLgetData ( APPLE_ALBERT_ACTIVATION, USER_AGENT_ACTIVATION );
  113. $Message .= "<br><b> Attempting to Get Activation Ticket for " . $DeviceClass . " from Apple Server!</b>" . "<br>";
  114. }
  115. }
  116. elseif ( $ActivationState == "Activated" )
  117. {
  118. $Unbrick = Setting_iTunes ( );
  119. $Message .= "<br><b> Your " . $DeviceClass . " state is 'Activated'.! it must be 'Unactivated' to gain help of 'doulCi Server'.</b>" . "<br>";
  120. }
  121. elseif ( $ActivationState == "SoftActivated" )
  122. {
  123. $Unbrick = Setting_iTunes ( );
  124. $Message .= "<br><b> Your " . $DeviceClass . " state is 'SoftActivated'.! it must be 'Unactivated' to gain help of 'doulCi Server'.</b>" . "<br>";
  125. }
  126. elseif ( $ActivationState == "SoftActivation" )
  127. {
  128. $Unbrick = Setting_iTunes ( );
  129. $Message .= "<br><b> Your " . $DeviceClass . " state is 'SoftActivation'.! it must be 'Unactivated' to gain help of 'doulCi Server'.</b>" . "<br>";
  130. }
  131. elseif ( $ActivationState == "FactoryActivated" )
  132. {
  133. $Unbrick = Setting_iTunes ( );
  134. $Message .= "<br><b> Your " . $DeviceClass . " state is 'FactoryActivated'.! it must be 'Unactivated' to gain help of 'doulCi Server'.</b>" . "<br>";
  135. }
  136. elseif ( $ActivationState == "WildcardActivated" )
  137. {
  138. $Unbrick = Setting_iTunes ( );
  139. $Message .= "<br><b> Your " . $DeviceClass . " state is 'WildcardActivated'.! it must be 'Unactivated' to gain help of 'doulCi Server'.</b>" . "<br>";
  140. }
  141. else
  142. {
  143. // "WTF Is Going On??"
  144. $Unbrick = cURLgetData ( APPLE_ALBERT_ACTIVATION, USER_AGENT_ACTIVATION );
  145. $Message .= "<br><b> doulCi Unknown Error Accrued for " . $DeviceClass . " ! Move to WTF Mode and Get Default Apple Response.</b>" . "<br>";
  146. // Show Merruk's Activation Error.
  147. // print Merruks_Error ( $SerialNumber ) ;
  148. }
  149. }
  150. // Activation Processes is Done! Now Save the Files.
  151. if ( strpos ( $Unbrick, 'ack-received' ) !== false )
  152. {
  153. $Unbrick_Enc64 = true;
  154. $Message .= "Get iTunes Settings." . "\n";
  155. }
  156. elseif ( strpos ( $Unbrick, 'activation-record' ) !== false )
  157. {
  158. $Unbrick_Enc64 = file_put_contents ( $Request_Path . DS . $ProductType . "_" . $BuildVersion . "_" . "ActivationTicket.data", base64_encode ( $Unbrick ) );
  159. $Message .= "We have Actiation Tickets." . "\n";
  160. }
  161. elseif ( strpos ( $Unbrick, 'activation-info-base64' ) !== false )
  162. {
  163. $Unbrick_Enc64 = file_put_contents ( $Request_Path . DS . $ProductType . "_" . $BuildVersion . "_" . "iCloud_Locked.data", base64_encode ( $Unbrick ) );
  164. $Message .= "iCloud Locked Device." . "\n";
  165. $_POST [ 'guid' ] = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX";
  166. //$Unbrick = cURLgetData ( DOULCI_ALBERT_CERTIFYME, USER_AGENT_IOS_DEVICE );
  167. //$Unbrick_Enc64 = file_put_contents ( $Request_Path . DS . $ProductType . "_" . $BuildVersion . "_" . "SoftActivationTicket.data", base64_encode ( $Unbrick ) );
  168. /*
  169. $login_change = "name=\"login\" value=\"\"";
  170. $dlogin_change = "name=\"login\" value=\"z0r.days@gmail.com\"";
  171. $password_change = "name=\"password\"";
  172. $dpassword_change = "name=\"password\" value=\"s78963210S\"";
  173. $button_change = "<button id=\"btn-continue\" class=\"btn-continue\" type=\"submit\" onclick=\"submitActivate();\">Continue</button>";
  174. $input_change = "<input id=\"btn-continue\" class=\"btn-continue\" type=\"submit\" value=\"Continue\">";
  175. $Unbrick = str_replace ( APPLE_ALBERT_ACTIVATION, DOULCI_ALBERT_ACTIVATION, $Unbrick );
  176. $Unbrick = str_replace ( $button_change, $input_change, $Unbrick );
  177. $Unbrick = str_replace ( $login_change, $dlogin_change, $Unbrick );
  178. $Unbrick = str_replace ( $password_change, $dpassword_change, $Unbrick );
  179. $Message .= "Show Tweaked Page." . "\n";
  180. */
  181. }
  182. elseif ( strpos ( $Unbrick, 'Service Answer Center' ) !== false )
  183. {
  184. $Unbrick_Enc64 = file_put_contents ( $Request_Path . DS . $ProductType . "_" . $BuildVersion . "_" . "SAM_Patched.data", base64_encode ( $Unbrick ) );
  185. $_POST [ 'guid' ] = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX";
  186. $Unbrick = cURLgetData ( DOULCI_ALBERT_CERTIFYME, USER_AGENT_ACTIVATION );
  187. $Unbrick_Enc64 = file_put_contents ( $Request_Path . DS . $ProductType . "_" . $BuildVersion . "_" . "SoftActivationTicket.data", base64_encode ( $Unbrick ) );
  188. $Message .= "Service Answer Center." . "\n";
  189. }
  190. else
  191. {
  192. $Unbrick_Enc64 = file_put_contents ( $Request_Path . DS . $ProductType . "_" . $BuildVersion . "_" . "Unknown_Activation_Status.data", base64_encode ( $Unbrick ) );
  193. $Message .= "doulCi Unknown Error." . "\n";
  194. }
  195. if ( ! $Unbrick_Enc64 && $Unbrick = Setting_iTunes ( ) )
  196. {
  197. if ( @Check_File ( $Request_Path . DS . $ProductType . "_" . $BuildVersion . "_" . "ActivationTicket.data" ) )
  198. {
  199. @unlink ( $Request_Path . DS . $ProductType . "_" . $BuildVersion . "_" . "ActivationTicket.data" );
  200. }
  201. if ( @Check_File ( $Request_Path . DS . $ProductType . "_" . $BuildVersion . "_" . "SoftActivationTicket.data" ) )
  202. {
  203. @unlink ( $Request_Path . DS . $ProductType . "_" . $BuildVersion . "_" . "SoftActivationTicket.data" );
  204. }
  205. if ( @Check_File ( $Request_Path . DS . $ProductType . "_" . $BuildVersion . "_" . "iCloud_Locked.data" ) )
  206. {
  207. @unlink ( $Request_Path . DS . $ProductType . "_" . $BuildVersion . "_" . "iCloud_Locked.data" );
  208. }
  209. if ( @Check_File ( $Request_Path . DS . $ProductType . "_" . $BuildVersion . "_" . "Unknown_Activation_Status.data" ) )
  210. {
  211. @unlink ( $Request_Path . DS . $ProductType . "_" . $BuildVersion . "_" . "Unknown_Activation_Status.data" );
  212. }
  213. }
  214. print $Unbrick;
  215. if ( $doulCi_Debug == true )
  216. {
  217. die ( $Message );
  218. }
  219. ?>