'Kein App-Release vorhanden.'])); } $path = site_storage() . '/apps/' . $platform . '/' . basename((string) $release['file']); if (!is_file($path)) { http_response_code(404); exit; } if (($_GET['download'] ?? '') !== '1') { header('Content-Type: application/json; charset=utf-8'); header('Cache-Control: no-store'); echo json_encode([ 'platform' => $platform, 'version' => $release['version'], 'sha256' => $release['sha256'], 'size' => (int) $release['size'], 'notes' => $release['notes'], 'created_at' => $release['created_at'], ], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); exit; } $filename = ['android' => 'DeskHub.apk', 'windows' => 'DeskHub-Setup.exe', 'minecraft' => 'DeskHub-Minecraft.jar'][$platform]; while (ob_get_level() > 0) @ob_end_clean(); header('Content-Type: ' . ['android' => 'application/vnd.android.package-archive', 'windows' => 'application/vnd.microsoft.portable-executable', 'minecraft' => 'application/java-archive'][$platform]); header('Content-Disposition: attachment; filename="' . $filename . '"'); header('Content-Length: ' . filesize($path)); header('X-Content-Type-Options: nosniff'); header('X-DeskHub-SHA256: ' . $release['sha256']); header('X-DeskHub-Version: ' . $release['version']); readfile($path);