&1'; $output = []; $code = 0; exec($cmd, $output, $code); if ($code !== 0 || !file_exists($zipPath)) { fail_json('Packaging failed', 500, [ 'log' => implode("\n", $output) ]); } json_response([ 'ok' => true, 'id' => $id, 'package_url' => "/api/download.php?id=$id", 'package_path' => $zipPath, 'note' => 'HF Linux cannot build a signed macOS DMG. This packages the generated app folder. Final DMG signing must happen on macOS.' ]);